diff --git a/.gitattributes b/.gitattributes index 4ec0184b7154dfcd69ad69345f31830feedfff9f..9aed13797dcd9c3295f6d9d00b6fe92bb47768ae 100644 --- a/.gitattributes +++ b/.gitattributes @@ -203,3 +203,4 @@ Kliendibaas/TaaviPeters_Cobaltex[[:space:]]OÜ/fwdarved/20260708_204725_statemen Kliendibaas/TaaviPeters_Cobaltex[[:space:]]OÜ/fwdarved/20260708_204731_statement.pdf filter=lfs diff=lfs merge=lfs -text Kliendibaas/TaaviPeters_Cobaltex[[:space:]]OÜ/fwdarved/20260708_204738_statement.pdf filter=lfs diff=lfs merge=lfs -text Kliendibaas/TaaviPeters_Cobaltex[[:space:]]OÜ/fwdarved/20260708_204745_statement.pdf filter=lfs diff=lfs merge=lfs -text +loan-advisor-chatgpt-app/node_modules/@rolldown/binding-win32-x64-msvc/rolldown-binding.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/LICENSE b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b8ac8dc0f960bbe0b0cc90cd06d58b672151773f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/LICENSE @@ -0,0 +1,19 @@ +Copyright 2025 OpenAI + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/README.md b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/README.md new file mode 100644 index 0000000000000000000000000000000000000000..31a93d5f6ffd95d03c0567b31c79be426992e19a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/README.md @@ -0,0 +1,146 @@ +# Apps SDK UI + +Apps SDK UI is a lightweight, accessible design system for building high-quality ChatGPT apps with the [Apps SDK](https://developers.openai.com/apps-sdk). It provides Tailwind-integrated design tokens, a curated React component library, and utilities optimized for consistent experiences inside ChatGPT. + +## Features + +- **Design tokens** for colors, typography, spacing, sizing, shadows, surfaces, and more. +- **Tailwind 4 integration** pre-configured with Apps SDK UI's design tokens. +- **Accessible components**, built on Radix primitives with consistent styling. +- **Utilities** for dark mode, responsive layouts, and ChatGPT-optimized behaviors. +- **Minimal boilerplate** — import styles, wrap with a provider, start building. + +## Prerequisites + +Apps SDK UI requires **React 18 or 19** and **Tailwind 4**. + +- React: https://react.dev/learn/installation +- Tailwind 4: https://tailwindcss.com/docs/installation + +## Installation + +### 1. Install the package + +```bash +npm install @openai/apps-sdk-ui +``` + +### 2. Setup styles + +Add the foundation styles and Tailwind layers to the top of your global stylesheet (e.g. `main.css`): + +```css +@import "tailwindcss"; +@import "@openai/apps-sdk-ui/css"; +/* Required for Tailwind to find class references in Apps SDK UI components. */ +@source "../node_modules/@openai/apps-sdk-ui"; + +/* The rest of your application CSS */ +``` + +Then import your stylesheet _before_ rendering any components: + +```tsx +// Must be imported first to ensure Tailwind layers and style foundations are defined before any potential component styles +import "./main.css" + +import { StrictMode } from "react" +import { createRoot } from "react-dom/client" +import { App } from "./App" + +createRoot(document.getElementById("root")!).render( + + + , +) +``` + +### 3. Configure router (optional) + +`` helps define your default router link component, used in components like `` and ``. + +This provider is optional - router links can also be [passed directly to components](https://openai.github.io/apps-sdk-ui/?path=/docs/components-textlink--docs#component-level) via the `as` prop. + +```tsx +// Must be imported first to ensure Tailwind layers and style foundations are defined before component styles +import "./main.css" + +import { AppsSDKUIProvider } from "@openai/apps-sdk-ui/components/AppsSDKUIProvider" +import { StrictMode } from "react" +import { createRoot } from "react-dom/client" +import { Link } from "react-router" +import { App } from "./App" + +declare global { + interface AppsSDKUIConfig { + LinkComponent: typeof Link + } +} + +createRoot(document.getElementById("root")!).render( + + + + + , +) +``` + +### Start building + +Your project is now ready to use Apps SDK UI! + +Here's an example of a simple reservation card, using Tailwind classes and components. + +```tsx +import { Badge } from "@openai/apps-sdk-ui/components/Badge" +import { Button } from "@openai/apps-sdk-ui/components/Button" +import { Calendar, Invoice, Maps, Members, Phone } from "@openai/apps-sdk-ui/components/Icon" + +export function ReservationCard() { + return ( +
+
+
+

Reservation

+

La Luna Bistro

+
+ Confirmed +
+
+
+
+ + Date +
+
Apr 12 · 7:30 PM
+
+ + Guests +
+
Party of 2
+
+ + Reference +
+
4F9Q2K
+
+
+
+ + +
+
+ ) +} +``` + +## License + +[MIT](LICENSE) © OpenAI diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Markdown/useMathPlugins.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Markdown/useMathPlugins.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..487ddfcd170dde08664b628cc70fea9a8725bab0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Markdown/useMathPlugins.d.ts @@ -0,0 +1,8 @@ +import { type ComponentProps } from "react"; +import ReactMarkdown from "react-markdown"; +type MathPlugins = { + remarkPlugins: NonNullable["remarkPlugins"]>; + rehypePlugins: NonNullable["rehypePlugins"]>; +}; +export declare function useMathPlugins(enabled: boolean): MathPlugins; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Markdown/useParseMarkdownPre.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Markdown/useParseMarkdownPre.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bacf0ceae33e40066f0be08464c729af6412e805 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Markdown/useParseMarkdownPre.d.ts @@ -0,0 +1,5 @@ +import { type ReactNode } from "react"; +export declare function useParseMarkdownPre(children: ReactNode): { + code: string; + language: string; +}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Menu/Menu.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Menu/Menu.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..db8685e9e1e9abb0d42de4e626742024589a266d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Menu/Menu.d.ts @@ -0,0 +1,170 @@ +import { DropdownMenu } from "radix-ui"; +import React, { type ComponentProps, type ComponentType, type MouseEvent, type ReactNode } from "react"; +export type MenuProps = { + children: React.ReactNode; + /** Force the menu to remain open or closed */ + forceOpen?: boolean; + /** Callback triggered when the modal is opened */ + onOpen?: () => void; + /** Callback triggered when the modal is closed */ + onClose?: () => void; + /** + * When set to `true`, interaction with outside elements will be disabled and only menu content will be visible to screen readers. + * @default false + */ + modal?: boolean; +}; +export declare const Menu: { + ({ children, forceOpen, onOpen, onClose, modal }: MenuProps): import("react/jsx-runtime").JSX.Element; + Content: ({ children, side, sideOffset, align, alignOffset, width, minWidth, maxHeight, }: MenuContentProps) => import("react/jsx-runtime").JSX.Element; + Item: ({ className, children, disabled, onSelect, onClick }: MenuItemProps) => import("react/jsx-runtime").JSX.Element; + ItemActions: ({ className, children }: { + className?: string; + children: ReactNode; + }) => import("react/jsx-runtime").JSX.Element; + ItemAction: ({ children, onClick, }: { + children: ReactNode; + onClick: (evt: MouseEvent) => void; + }) => import("react/jsx-runtime").JSX.Element; + Link: MenuLink; + Separator: ({ className }: { + className?: string; + }) => import("react/jsx-runtime").JSX.Element; + Trigger: ({ children, disabled }: DropdownMenu.DropdownMenuTriggerProps) => import("react/jsx-runtime").JSX.Element; + Sub: ({ children, forceOpen, onOpen, onClose }: SubmenuProps) => import("react/jsx-runtime").JSX.Element; + SubTrigger: ({ className, children, disabled, }: { + className?: string; + children: ReactNode; + disabled?: boolean; + }) => import("react/jsx-runtime").JSX.Element; + SubContent: ({ children, sideOffset, alignOffset, width, minWidth, maxHeight, }: SubContentProps) => import("react/jsx-runtime").JSX.Element; + CheckboxItem: ({ className, children, indicatorPosition, indicatorVariant, ...props }: MenuCheckboxItemProps) => import("react/jsx-runtime").JSX.Element; + RadioGroup: ({ children, value, onChange, indicatorPosition, ...props }: MenuRadioGroupProps) => import("react/jsx-runtime").JSX.Element; + RadioItem: ({ className, children, ...props }: MenuRadioItemProps) => import("react/jsx-runtime").JSX.Element; +}; +export type MenuItemProps = { + className?: string; + children: React.ReactNode; + /** Callback triggered when the item is pressed */ + onSelect?: DropdownMenu.DropdownMenuItemProps["onSelect"]; + /** Callback triggered when the item is clicked */ + onClick?: DropdownMenu.DropdownMenuItemProps["onClick"]; + /** Disables the menu item */ + disabled?: boolean; +}; +type MenuLinkProps = Omit, "href" | "children"> & { + /** Content rendered inside the Link */ + children: React.ReactNode; + /** Disables the menu item */ + disabled?: boolean; +}; +type MenuLink = | "a" = AppsSDKUI.LinkComponent>(props: Omit, "href"> & MenuLinkProps & { + /** + * Override the default component used for the link. This is useful for + * using a routing library, or SSR rendering. + * purposes. + * + * @default 'a' + */ + as?: T; +} & ComponentProps) => ReactNode; +export type MenuContentProps = { + children: React.ReactNode; + /** + * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. + * @default bottom + */ + side?: DropdownMenu.DropdownMenuContentProps["side"]; + /** + * The distance in pixels from the trigger. + * @default 5 + */ + sideOffset?: DropdownMenu.DropdownMenuContentProps["sideOffset"]; + /** + * The preferred alignment against the trigger. May change when collisions occur. + * @default center + */ + align?: DropdownMenu.DropdownMenuContentProps["align"]; + /** + * An offset in pixels from the "start" or "end" alignment options. + * @default 0 + */ + alignOffset?: DropdownMenu.DropdownMenuContentProps["alignOffset"]; + /** + * Defines the `width` property of the content + * @default auto + */ + width?: number | "auto"; + /** + * Defines the `min-width` property of the content, in pixels. + * @default 300 + */ + minWidth?: number | "auto"; + /** + * Defines the `max-width` property of the content, in pixels. + */ + maxHeight?: number; +}; +export type SubmenuProps = { + children: React.ReactNode; + /** Force the menu to remain open or closed */ + forceOpen?: boolean; + /** Callback triggered when the modal is opened */ + onOpen?: () => void; + /** Callback triggered when the modal is closed */ + onClose?: () => void; +}; +type SubContentProps = { + children: ReactNode; + sideOffset?: DropdownMenu.DropdownMenuSubContentProps["sideOffset"]; + alignOffset?: DropdownMenu.DropdownMenuSubContentProps["alignOffset"]; + width?: number | "auto"; + minWidth?: number | "auto"; + maxHeight?: number; +}; +export type MenuRadioGroupProps = { + /** Controlled value */ + value: T; + /** Fired when selection changes */ + onChange: (value: T) => void; + children: ReactNode; + /** + * The orientation of the indicator within the radio item. + * @default end + */ + indicatorPosition?: "start" | "end"; +}; +export type MenuRadioItemProps = { + value: T; + /** Class applied to the radio item */ + className?: string; + children: ReactNode; + /** Callback triggered when the radio item is pressed */ + onSelect?: DropdownMenu.DropdownMenuItemProps["onSelect"]; + /** Disables the radio item */ + disabled?: boolean; +}; +export type MenuCheckboxItemProps = { + /** Controlled checked state of the checkbox item */ + checked?: DropdownMenu.DropdownMenuCheckboxItemProps["checked"]; + /** Event handler called when the checked state changes */ + onCheckedChange?: DropdownMenu.DropdownMenuCheckboxItemProps["onCheckedChange"]; + /** Class applied to the checkbox item */ + className?: string; + children: ReactNode; + /** Callback triggered when the checkbox item is pressed */ + onSelect?: DropdownMenu.DropdownMenuItemProps["onSelect"]; + /** Disables the checkbox item */ + disabled?: boolean; + /** + * The orientation of the indicator within the checkbox item. + * @default end + */ + indicatorPosition?: "start" | "end"; + /** + * Visual treatment for the checkbox indicator. + * @default solid + */ + indicatorVariant?: "solid" | "ghost"; +}; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Menu/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Menu/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..878ca6e96bba5874e69fcc7ec47dcb24549a2c77 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Menu/index.d.ts @@ -0,0 +1 @@ +export { Menu } from "./Menu"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/Popover.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/Popover.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c32d8dee5b3a330060ee0abf11bce3762d0c61df --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/Popover.d.ts @@ -0,0 +1,78 @@ +import { Popover as RadixPopover } from "radix-ui"; +import { type MouseEventHandler, type PointerEventHandler, type ReactNode } from "react"; +export type PopoverProps = { + /** Sets controlled visibility state */ + open?: boolean; + /** Callback invoked when visibility state changes */ + onOpenChange?: (nextState: boolean) => void; + showOnHover?: boolean; + hoverOpenDelay?: number; + children: React.ReactNode; +}; +export declare const Popover: { + ({ open: controlledOpen, onOpenChange: controlledOnOpenChange, showOnHover, hoverOpenDelay, children, }: PopoverProps): import("react/jsx-runtime").JSX.Element; + Trigger: ({ children, onPointerDown, onClick, }: { + children: React.ReactNode; + onPointerDown?: PointerEventHandler; + onClick?: MouseEventHandler; + }) => import("react/jsx-runtime").JSX.Element; + Content: (props: PopoverContentProps) => import("react/jsx-runtime").JSX.Element; +}; +export type PopoverContentProps = { + children: ReactNode; + /** + * Whether to avoid collisions with vieport/scroll containersw. + * @default true + */ + avoidCollisions?: boolean; + /** + * Set the `width` of the popover, in pixels. + * @default auto + */ + width?: number | "auto"; + /** + * Set the `min-width` of the popover, in pixels. + * @default 300 + */ + minWidth?: number | "auto"; + /** + * Set the `max-width` of the popover, in pixels. + */ + maxWidth?: number; + /** + * Background style for the popover + * @default default + */ + /** + * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. + * @default bottom + */ + side?: RadixPopover.PopoverContentProps["side"]; + /** + * The distance in pixels from the trigger. + * @default 8 + */ + sideOffset?: RadixPopover.PopoverContentProps["sideOffset"]; + /** + * The preferred alignment against the trigger. May change when collisions occur. + * @default center + */ + align?: RadixPopover.PopoverContentProps["align"]; + /** + * An offset in pixels from the "start" or "end" alignment options. + * @default 0 + */ + alignOffset?: RadixPopover.PopoverContentProps["alignOffset"]; + /** + * Whether the popover surface should be translucent. + * @default false + */ + translucent?: boolean; + /** Additional class name to apply to the popover content, you usually don't want to set this, but ag-grid needs it to render a custom editor properly */ + className?: string; + /** + * Auto focus the popover content when it is opened. + * @default true + */ + autoFocus?: boolean; +}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c7f4f0299052f8e90fb0bb86cd623c2d8a11930 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/index.d.ts @@ -0,0 +1,2 @@ +export { Popover, type PopoverContentProps, type PopoverProps } from "./Popover"; +export { usePopoverController } from "./usePopoverController"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/pointerIntent.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/pointerIntent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..339123029a417b2cd704183b7ceb4fafe4646b66 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/pointerIntent.d.ts @@ -0,0 +1,8 @@ +export type Polygon = Point[]; +type Point = { + x: number; + y: number; +}; +export declare const createPointerIntentArea: (event: PointerEvent, hoverTarget: HTMLElement) => Point[]; +export declare function isPointInPolygon(point: Point, polygon: Polygon): boolean; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/usePopoverContext.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/usePopoverContext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d707692a5782794a03c8c595dc94769e5a5b9d12 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/usePopoverContext.d.ts @@ -0,0 +1,17 @@ +import { type RefObject } from "react"; +export type PopoverContextValue = { + open: boolean; + setOpen: (next: boolean) => void; + shake: boolean; + setShake: (next: boolean) => void; + showOnHover: boolean; + temporarilyPreventClickToClose: boolean; + onTriggerEnter: () => void; + onTriggerLeave: () => void; + hoverOpenFocusedWithTab: RefObject; + isPointerInTransitRef: RefObject; + triggerRef: RefObject; + contentRef: RefObject; +}; +export declare const PopoverContext: import("react").Context; +export declare const usePopoverContext: () => PopoverContextValue; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/usePopoverController.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/usePopoverController.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..acf7ccf31b22d5288b4c0995d0488a1707906968 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Popover/usePopoverController.d.ts @@ -0,0 +1,8 @@ +export declare const usePopoverClose: () => () => void; +export declare const usePopoverShake: () => () => void; +export declare const usePopoverController: () => { + /** Plays a short shake animation on the modal. */ + shake: () => void; + /** Imperatively closes the modal. */ + close: () => void; +}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/RadioGroup/RadioGroup.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/RadioGroup/RadioGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b0fa50085b5644e9d2a9f91ef1e0f388898c295 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/RadioGroup/RadioGroup.d.ts @@ -0,0 +1,34 @@ +import React from "react"; +type Direction = "col" | "row"; +export type RadioGroupProps = { + "defaultValue"?: T; + "value"?: T; + "name"?: string; + "onChange"?: (value: T) => void; + /** Accessible label for the radio options */ + "aria-label": string; + /** Determines the layout direction of the radio items + * @default row + */ + "direction"?: Direction; + /** Controls whether the entire radio group is disabled */ + "disabled"?: boolean; + /** Class applied to the radio group container */ + "className"?: string; + "children": React.ReactNode; + "required"?: boolean; +}; +export declare const RadioGroup: { + ({ onChange, children, className, direction, disabled, ...restProps }: RadioGroupProps): import("react/jsx-runtime").JSX.Element; + Item: ({ value, disabled: itemDisabled, required, children, className, block, ...restProps }: RadioGroupItemProps) => import("react/jsx-runtime").JSX.Element; +}; +export type RadioGroupItemProps = { + value: T; + /** Determines if a given radio item is disabled */ + disabled?: boolean; + required?: boolean; + block?: boolean; + className?: string; + children: React.ReactNode; +}; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/RadioGroup/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/RadioGroup/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2df792ae5e45ea4e0a72ddb22fedc4de3f47f5cc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/RadioGroup/index.d.ts @@ -0,0 +1 @@ +export { RadioGroup, type RadioGroupItemProps, type RadioGroupProps } from "./RadioGroup"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SegmentedControl/SegmentedControl.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SegmentedControl/SegmentedControl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aeed77faa502f9436a3380191bbe41278c591894 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SegmentedControl/SegmentedControl.d.ts @@ -0,0 +1,71 @@ +import { type ControlSize, type Sizes } from "../../types"; +export type SizeVariant = "2xs" | "xs" | "sm" | "md" | "lg" | "xl"; +export type SegmentedControlProps = { + /** + * Controlled value for the group + */ + "value": T; + /** Callback for when a new value is selected */ + "onChange"?: (nextValue: T) => void; + /** Callback any time the control is clicked (even if a new value was not selected) */ + "onClick"?: () => void; + /** + * Text read aloud to screen readers when the control is focused + */ + "aria-label": string; + /** + * Controls the size of the segmented control + * + * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl | + * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | + * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` | + * + * @default md + */ + "size"?: ControlSize; + /** + * Controls gutter on the edges of the button, defaults to value from `size`. + * + * | 2xs | xs | sm | md | lg | xl | + * | ------ | ------ | ------ | ------ | ------ | ------ | + * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` | + */ + "gutterSize"?: Sizes<"2xs" | "xs" | "sm" | "md" | "lg" | "xl">; + /** Disable the entire group */ + "disabled"?: boolean; + /** + * Display the control as a block element with equal width segments + * @default false + */ + "block"?: boolean; + /** + * Determines if the segment control, and its options, should be a fully rounded pill shape. + * @default false + */ + "pill"?: boolean; + "className"?: string; + "children": React.ReactNode; +}; +export declare const SegmentedControl: { + ({ value, onChange, children, block, pill, size, gutterSize, className, onClick, ...restProps }: SegmentedControlProps): import("react/jsx-runtime").JSX.Element; + Option: ({ children, ...restProps }: SegmentedControlOptionProps) => import("react/jsx-runtime").JSX.Element; +}; +type SegmentedControlOptionProps = { + /** + * Option value + */ + "value": string; + /** + * Text read aloud to screen readers when the option is focused + */ + "aria-label"?: string; + /** + * Content to render in the option + */ + "children": React.ReactNode; + /** + * Disable the individual option + */ + "disabled"?: boolean; +}; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SegmentedControl/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SegmentedControl/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a93932207d2ebf4cf093af3a352ca7ee6170ede3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SegmentedControl/index.d.ts @@ -0,0 +1,2 @@ +export { SegmentedControl } from "./SegmentedControl"; +export type { SegmentedControlProps, SizeVariant } from "./SegmentedControl"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Select/Select.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Select/Select.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e92dd05a4179521aac2b9cbaa73c161ed3cbf51 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Select/Select.d.ts @@ -0,0 +1,217 @@ +import React, { type ReactNode } from "react"; +import { type SelectControlProps } from "../SelectControl"; +export type Option = { + value: T; + label: string; + /** Disable the option */ + disabled?: boolean; + /** Displayed as secondary text below the option `label` */ + description?: React.ReactNode; + tooltip?: { + content: React.ReactNode; + maxWidth?: number; + }; +}; +export type OptionGroup = { + label: string; + options: T[]; + optionsLimit?: { + label: string; + limit: number; + }; +}; +export type Options = T[] | OptionGroup[]; +type CallbackWithOption = (option: T) => void; +type CallbackWithOptions = (options: T[]) => void; +type CallbackWithActionId = (actionId: string) => void; +type SearchPredicate = (option: T, searchTerm: string) => boolean; +type Action = { + /** Unique ID to identify the action with */ + id: string; + /** Label display for the action */ + label: string; + /** Icon displayed to the left of the action */ + Icon?: React.ComponentType>; + /** Custom class applied to the action container */ + className?: string; + /** Callback invoked when the action is pressed */ + onSelect: CallbackWithActionId; +}; +type Actions = Action[]; +export type PopoverSide = "top" | "bottom"; +export type PopoverAlign = "start" | "center" | "end"; +type SingleSelectProps = { + /** + * Determines if the select should support multiple selection + * @default false + */ + multiple?: false; + value: string; + onChange: CallbackWithOption; + /** + * Customize the rendered output of the trigger + * NOTE: Must be passed as a stable reference, not created inline. + */ + TriggerView?: React.FC; +}; +type MultiSelectTriggerViewProps = { + values: T[]; + selectedAll: boolean; +}; +type MultiSelectProps = { + /** + * Determines if the select should support multiple selection + * @default false + */ + multiple: true; + value: string[]; + onChange: CallbackWithOptions; + /** + * Customize the rendered output of the trigger + * NOTE: Must be passed as a stable reference, not created line. + */ + TriggerView?: React.FC>; +}; +export type SelectProps = (SingleSelectProps | MultiSelectProps) & { + options: Options; + /** + * Disables the select visually and from interactions + * @default false + */ + disabled?: boolean; + /** + * Allows the select to be targeted with htmlFor + */ + id?: string; + /** + * Marks the select as a required field when using native form submission + */ + required?: boolean; + /** + * Creates the ability to query the value with `[name="${name}"]` + */ + name?: string; + /** + * Placeholder text for the select + * @default Select... + */ + placeholder?: string; + /** + * Placeholder text for the select while loading. Behaves exactly like `placeholder`, and `value` will be shown if provided. + * @default Loading... + */ + loadingPlaceholder?: string; + /** + * Displays loading indicator on top of button contents + * @default false + */ + loading?: boolean; + /** + * Style variant for the select trigger + * @default outline + */ + variant?: SelectControlProps["variant"]; + /** + * Determines if the select trigger should be a fully rounded pill shape + * @default false + */ + pill?: boolean; + /** + * Controls size of the select trigger, and several other aspects of trigger styling. + * + * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl | + * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | + * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` | + * @default md + */ + size?: SelectControlProps["size"]; + /** + * Icon displayed in the far right of the select trigger + * @default dropdown + */ + dropdownIconType?: SelectControlProps["dropdownIconType"]; + /** + * Actions to display below the options list. + */ + actions?: Actions; + /** Custom class applied to option containers */ + optionClassName?: string; + /** + * Customize the rendered output of individual options + * NOTE: Must be passed as a stable reference, not created line. + */ + OptionView?: React.FC; + /** Icon displayed at the start of the select trigger */ + TriggerStartIcon?: SelectControlProps["StartIcon"]; + /** + * Custom class applied to the select trigger + */ + triggerClassName?: string; + /** + * Applies a negative margin using the current gutter to optically align the trigger + * with surrounding content. + */ + opticallyAlign?: "start" | "end"; + /** + * Display a clear action that allows the select to be unset. + * @default false + */ + clearable?: boolean; + /** + * Extends select to 100% of available width. + * @default true + */ + block?: boolean; + /** + * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. + * @default bottom + */ + side?: PopoverSide; + /** + * The preferred alignment against the trigger. May change when collisions occur. + * @default center + */ + align?: PopoverAlign; + /** + * An offset in pixels from the "start" or "end" alignment options. + * @default 0 + */ + alignOffset?: number; + /** + * Prevents collision detection in the custom menu. Use with caution. + * @default true + */ + avoidCollisions?: boolean; + /** + * Set the width of the custom select menu + * @default auto + */ + listWidth?: number | "auto"; + /** + * Defines the `min-width` property of the custom select menu, in pixels. + * @default auto + */ + listMinWidth?: number | "auto"; + /** + * Defines the `max-width` property of the custom select menu, in pixels. + * @default auto + */ + listMaxWidth?: number | "auto"; + /** Predicate used to filter searches */ + searchPredicate?: SearchPredicate; + /** Placeholder of the search input */ + searchPlaceholder?: string; + /** + * Message displayed when search results are empty. Can be a simple string, or custom JSX. + */ + searchEmptyMessage?: ReactNode; +}; +export declare const Select: (props: SelectProps) => import("react/jsx-runtime").JSX.Element; +type SelectTriggerProps = { + onOpenChange?: (maybeNextState?: boolean) => void; + tabIndex?: number; + ["aria-hidden"]?: "false" | "true"; + ref?: React.Ref; +}; +export declare const SelectTrigger: (props: SelectTriggerProps) => import("react/jsx-runtime").JSX.Element; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Select/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Select/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43f2a9d3a49f1b33886502c2ebd52f2df70cbf03 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Select/index.d.ts @@ -0,0 +1 @@ +export { Select, type Option, type OptionGroup, type SelectProps } from "./Select"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SelectControl/SelectControl.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SelectControl/SelectControl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b582978ceed2cb5d5902241fb422f935958325f9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SelectControl/SelectControl.d.ts @@ -0,0 +1,81 @@ +import { type ReactNode } from "react"; +import type { ControlSize, Variants } from "../../types"; +export type DropdownIconType = "chevronDown" | "dropdown" | "none"; +export type SelectControlProps = Omit, "onClick"> & { + /** + * Style variant for the Button + * @default fill + */ + variant?: Variants<"soft" | "outline" | "ghost">; + /** + * Determines if the control should be a fully rounded pill shape + * @default false + */ + pill?: boolean; + /** + * Extends the control to 100% of available width. + * @default true + */ + block?: boolean; + /** + * Applies a negative margin using the current gutter to optically align the control + * with surrounding content. + */ + opticallyAlign?: "start" | "end"; + /** + * Disables the control visually and from interactions + * @default false + */ + disabled?: boolean; + /** + * Visually indicates that the control is in an invalid state + * @default false + */ + invalid?: boolean; + /** + * Indicates that the control is selected. An unselected state will display placeholder styles. + * @default false + */ + selected?: boolean; + /** + * Display a clear action that allows the select to be unset. + * @default false + */ + onClearClick?: () => void; + /** + * Primary handler for when the control is selected with pointer or keyboard events + */ + onInteract?: () => void; + /** + * Determines size of the size and spacing of the control. + * + * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl | + * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | + * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` | + * @default md + */ + size?: ControlSize; + /** + * Displays loading indicator on top of button contents + * @default false + */ + loading?: boolean; + /** + * Icon displayed in the far right of the select trigger + * @default dropdown + */ + dropdownIconType?: DropdownIconType; + /** Icon displayed at the start of the control */ + StartIcon?: React.ComponentType>; + /** Custom class applied to the control element */ + className?: string; + /** Content rendered for the control */ + children: ReactNode; + ref?: React.Ref; +}; +export declare const SelectControl: ({ ref, onPointerDown, onKeyDown, onPointerEnter, onInteract, invalid, disabled, children, className, variant, size, block, opticallyAlign, pill, loading, onClearClick, selected, StartIcon, dropdownIconType, ...restProps }: SelectControlProps) => import("react/jsx-runtime").JSX.Element; +type DropdownIconProps = { + iconType: Omit; +}; +export declare const DropdownIcon: ({ iconType }: DropdownIconProps) => import("react/jsx-runtime").JSX.Element; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SelectControl/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SelectControl/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..869361d34ec58913e7baa0214a6dd5e374d0f1ec --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/SelectControl/index.d.ts @@ -0,0 +1 @@ +export { SelectControl, type DropdownIconType, type SelectControlProps } from "./SelectControl"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/ShimmerText/ShimmerText.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/ShimmerText/ShimmerText.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..393905eee92d82abedbe91215065507df2b9e2a6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/ShimmerText/ShimmerText.d.ts @@ -0,0 +1,12 @@ +import { type ReactNode } from "react"; +export declare const ShimmerText: ({ as: Tag, children, className, }: { + as?: "p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div"; + children: ReactNode; + className?: string; +}) => import("react/jsx-runtime").JSX.Element; +export declare const ShimmerableText: ({ as: Tag, children, className, shimmer, ...restProps }: { + as?: "p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div"; + children: ReactNode; + className?: string; + shimmer?: boolean; +}) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/ShimmerText/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/ShimmerText/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b275d884a00f5ef4e1c1f6fe3778009a4d55b871 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/ShimmerText/index.d.ts @@ -0,0 +1 @@ +export { ShimmerText, ShimmerableText } from "./ShimmerText"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Slider/Slider.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Slider/Slider.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4ce1f97577aba42a0028d704f7464ecf69f52eb9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Slider/Slider.d.ts @@ -0,0 +1,69 @@ +import { Slider as RadixSlider } from "radix-ui"; +import { type ElementRef, type FocusEventHandler, type ReactNode } from "react"; +export type SliderMark = { + value: number; + label: string; +}; +export type SliderProps = { + /** + * The current value of the slider + */ + value: number; + /** + * The minimum value the slider can have + */ + min: number; + /** + * The maximum value the slider can have + */ + max: number; + /** + * The step increment between slider values + */ + step: number; + /** + * Value that will be offered as a "reset to default" option + */ + resetValue?: number; + /** + * String that will be displayed in the tooltip + * @default Reset to default + */ + resetTooltip?: string; + /** + * Unit to display next to the slider value (e.g., ms, px) + */ + unit?: string; + /** + * Unit to display to the right of the slider value (e.g., $) + */ + prefixUnit?: string; + /** + * Optional label for the slider, which can be a string or React node. + */ + label?: ReactNode; + /** + * List of marks to display below the slider track + */ + marks?: SliderMark[]; + /** + * Color of the slider track + */ + trackColor?: string; + /** + * Color of the slider progress along the track + */ + rangeColor?: string; + className?: string; + disabled?: boolean; + /** + * Callback function invoked when the slider value changes. + * + * @param value - The new value of the slider. + */ + onChange: (value: number) => void; + onBlur?: FocusEventHandler; + onFocus?: FocusEventHandler; + ref?: React.Ref | null>; +}; +export declare const Slider: import("react").MemoExoticComponent<(props: SliderProps) => import("react/jsx-runtime").JSX.Element>; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Slider/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Slider/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6de6a62df69c5a8f8b67de9072c49b2aca19a392 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Slider/index.d.ts @@ -0,0 +1,2 @@ +export { Slider } from "./Slider"; +export type { SliderMark, SliderProps } from "./Slider"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Switch/Switch.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Switch/Switch.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7369cfd845fae7c8d906e7d551042045913ceee --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Switch/Switch.d.ts @@ -0,0 +1,33 @@ +import { type FocusEventHandler, type ReactNode } from "react"; +export type SwitchProps = { + /** The `id` of the switch. */ + id?: string; + /** The state of the switch when it is initially rendered. Use when you do not need to control its state. */ + defaultChecked?: boolean; + /** The controlled state of the switch. Must be used in conjunction with `onCheckedChange`. */ + checked?: boolean; + /** Optional accessible label rendered to the right of the checkbox. */ + label?: ReactNode; + /** Event handler called when the state of the switch changes. */ + onCheckedChange?: (nextState: boolean) => void; + /** Event handler called when the checkbox looses focus. */ + onBlur?: FocusEventHandler; + /** Event handler called when the checkbox gains focus. */ + onFocus?: FocusEventHandler; + /** When `true`, prevents the user from interacting with the switch. */ + disabled?: boolean; + /** When `true`, indicates that the user must check the switch before the owning form can be submitted. */ + required?: boolean; + /** The name of the switch. Submitted with its owning form as part of a name/value pair. */ + name?: string; + /** The value given as data when submitted with a `name`. */ + value?: string; + /** CSS classes applied to wrapper node */ + className?: string; + /** + * The position of the label relative to the switch. + * @default end + */ + labelPosition?: "start" | "end"; +}; +export declare const Switch: ({ className, label, id: propsId, disabled, labelPosition, ...restProps }: SwitchProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Switch/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Switch/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3376146baec3d72e137a08cf35b8cd176d85def4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Switch/index.d.ts @@ -0,0 +1 @@ +export { Switch, type SwitchProps } from "./Switch"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TagInput/TagInput.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TagInput/TagInput.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..22aced543e074d6881760add83009e6b8e1856b9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TagInput/TagInput.d.ts @@ -0,0 +1,62 @@ +import type { Sizes } from "../../types"; +export type Tag = { + value: string; + valid: boolean; +}; +export type TagInputProps = { + /** + * The state of the tag input when it is initially rendered, used when uncontrolled + */ + defaultValue?: Tag[]; + /** + * The value of the tag input, used to control the tag input + */ + value?: Tag[]; + /** + * Allows the tag input to be targeted with htmlFor + */ + id?: string; + /** + * Corresponds with Input height when rows=1 + * @default xl + */ + size?: Sizes<"md" | "lg" | "xl" | "2xl" | "3xl">; + /** + * Callback function invoked when the tag list changes + */ + onChange?: (tags: Tag[]) => void; + /** + * Placeholder text for the input + */ + placeholder?: string; + /** + * A function that returns whether a given value is a valid tag. + * Invalid tags are highlighted in red. + * Tags are evaluated for validity only on creation; changing the validator function later has no effect + */ + validator?: (value: string) => boolean; + /** + * The maximum number of tags allowed before the input is disabled; displays a counter below the input + */ + maxTags?: number; + /** + * Whether to focus this input on mount + * @default false + */ + autoFocus?: boolean; + /** + * The minimum number of rows for the tag input + * @default 1 + */ + rows?: number; + /** + * Controls what characters will count towards creating a new tag + * @default [",", " "] + */ + delimiters?: string[]; + /** + * Disables the tag input visually and from interactions + */ + disabled?: boolean; +}; +export declare const TagInput: (props: TagInputProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TagInput/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TagInput/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8261ed665fcef9a4909bc06d785e9ba7ac719b35 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TagInput/index.d.ts @@ -0,0 +1 @@ +export { TagInput, type Tag, type TagInputProps } from "./TagInput"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TextLink/TextLink.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TextLink/TextLink.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e87e90a288cf14677fc196a1b90735390ef2961 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TextLink/TextLink.d.ts @@ -0,0 +1,30 @@ +import { type ComponentProps, type ComponentType, type ReactNode } from "react"; +export type TextLinkProps = Omit, "href" | "children"> & { + /** Content rendered inside the Link */ + children: React.ReactNode; + /** + * Applies a primary color to the link and removes the default `underline`. + * @default false + */ + primary?: boolean; + /** + * Apply `text-decoration: underline` to the Link + * @default true + */ + underline?: boolean; + /** Force external link behavior, which is automatically detected based on the URL. */ + forceExternal?: boolean; +}; +type MakeOptional = Omit & Partial>>; +type TextLink = | "a" = AppsSDKUI.LinkComponent>(props: Omit, "href"> & TextLinkProps & { + /** + * Override the default component used for the link. This is useful for + * using a routing library, or SSR rendering. + * purposes. + * + * @default 'a' + */ + as?: T; +} & MakeOptional, "href" | "to">) => ReactNode; +export declare const TextLink: TextLink; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TextLink/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TextLink/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..486870281fe02d478531fc9c62b97622045f9720 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/TextLink/index.d.ts @@ -0,0 +1 @@ +export { TextLink } from "./TextLink"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Textarea/Textarea.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Textarea/Textarea.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..560d7e03558ccce9f852a362e8f3a4f648d134db --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Textarea/Textarea.d.ts @@ -0,0 +1,66 @@ +import { type ControlSize, type Sizes, type Variants } from "../../types"; +export type TextareaProps = { + /** + * Visual style of the textarea + * @default outline + */ + variant?: Variants<"outline" | "soft">; + /** + * Controls the size of the textarea + * + * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl | + * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | + * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` | + * + * @default md + */ + size?: ControlSize; + /** + * Controls gutter on the edges of the textarea, defaults to value from `size`. + * + * | 2xs | xs | sm | md | lg | xl | + * | ------ | ------ | ------ | ------ | ------ | ------ | + * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` | + */ + gutterSize?: Sizes<"2xs" | "xs" | "sm" | "md" | "lg" | "xl">; + /** + * Disables the textarea visually and from interactions + * @default false + */ + disabled?: boolean; + /** + * Mark the textarea as invalid + * @default false + */ + invalid?: boolean; + /** + * Allow autofill extensions to appear in the textarea + * @default false + */ + allowAutofillExtensions?: boolean; + /** + * Select all contents of the textarea when mounted. + * @default false + */ + autoSelect?: boolean; + /** Callback invoked when the textarea is autofilled by the browser */ + onAutofill?: () => void; + /** + * Default number of rows to display + * @default 3 + */ + rows?: number; + /** + * Automatically adjust the height of the textarea based on its contents. + * @default false + */ + autoResize?: boolean; + /** + * Maximum number of rows that can be displayed when autoResize is enabled. + * @default Math.max(rows, 10) + */ + maxRows?: number; + /** Ref for the textarea */ + ref?: React.Ref; +} & Omit, "disabled" | "size">; +export declare const Textarea: (props: TextareaProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Textarea/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Textarea/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..707cba84bd478eefa172aa6883537b24c042d145 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Textarea/index.d.ts @@ -0,0 +1 @@ +export { Textarea, type TextareaProps } from "./Textarea"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/CopyTooltip.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/CopyTooltip.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..107d38144c714f989faca2165fc63fcd8bfed1b0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/CopyTooltip.d.ts @@ -0,0 +1,32 @@ +import { Tooltip as RadixTooltip } from "radix-ui"; +export type CopyTooltipProps = { + children: React.ReactNode; + /** Value to copy to the clipboard */ + copyValue: string; + /** + * Delay of when the tooltip is shown from first interaction, in milliseconds. + * @default 150 + */ + openDelay?: number; + /** + * The preferred alignment against the trigger. May change when collisions occur. + * @default center + */ + align?: RadixTooltip.TooltipContentProps["align"]; + /** + * An offset in pixels from the "start" or "end" alignment options. + * @default 0 + */ + alignOffset?: RadixTooltip.TooltipContentProps["alignOffset"]; + /** + * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. + * @default top + */ + side?: RadixTooltip.TooltipContentProps["side"]; + /** + * The distance in pixels from the trigger. + * @default 5 + */ + sideOffset?: RadixTooltip.TooltipContentProps["sideOffset"]; +}; +export declare const CopyTooltip: ({ children, copyValue, openDelay, align, alignOffset, side, sideOffset, }: CopyTooltipProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/Tooltip.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/Tooltip.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..991c019154b8eb57bdf2217478fc58c24071a36f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/Tooltip.d.ts @@ -0,0 +1,111 @@ +import { Tooltip as RadixTooltip } from "radix-ui"; +import { type MouseEventHandler, type PointerEventHandler } from "react"; +export type TooltipProps = { + children: React.ReactNode; + /** + * The content of the tooltip. If `null`, the tooltip will not render. + */ + content: React.ReactNode; + /** + * Defines the `max-width` of the tooltip content. `"none"` creates a single-line, naturally sized tooltip. + * @default 300 + */ + maxWidth?: number | "none"; + /** + * Forces the tooltip to remain open or closed + */ + forceOpen?: boolean; + /** + * Delay of when the tooltip is shown from first interaction, in milliseconds. + * @default 150 + */ + openDelay?: number; + /** Indicates that the tooltip has interactive content, and should remain open when hovered. */ + interactive?: boolean; + /** + * Short, 1-3 word tooltips, stylized inversely from normal tooltips + */ + compact?: boolean; + /** + * Prevents the tooltip from closing when the trigger is clicked right after opening + * @default false + */ + preventUnintentionalClickToClose?: true; + /** + * The preferred alignment against the trigger. May change when collisions occur. + * @default center + */ + align?: RadixTooltip.TooltipContentProps["align"]; + /** + * An offset in pixels from the "start" or "end" alignment options. + * @default 0 + */ + alignOffset?: RadixTooltip.TooltipContentProps["alignOffset"]; + /** + * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. + * @default top + */ + side?: RadixTooltip.TooltipContentProps["side"]; + /** + * The distance in pixels from the trigger. + * @default 5 + */ + sideOffset?: RadixTooltip.TooltipContentProps["sideOffset"]; + /** + * Gutter sizing inside the tooltip content + * @default md + */ + gutterSize?: "sm" | "md" | "lg"; + /** Ref for the tooltip */ + ref?: React.Ref; + onPointerDown?: PointerEventHandler; + onClick?: MouseEventHandler; + /** Optional class name to apply to the tooltip content */ + contentClassName?: string; +}; +export declare const Tooltip: { + (props: TooltipProps): import("react/jsx-runtime").JSX.Element; + Root: ({ children, open, onOpenChange, ...restProps }: RadixTooltip.TooltipProps & { + open: boolean; + onOpenChange: (nextState: boolean) => void; + }) => import("react/jsx-runtime").JSX.Element; + Content: ({ children, maxWidth, compact, clickable, alignOffset, sideOffset, gutterSize, className, style, ...restProps }: TooltipContentProps) => import("react/jsx-runtime").JSX.Element; + Trigger: ({ children, asChild, ...restProps }: RadixTooltip.TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element; + TriggerDecorator: (props: TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element; +}; +type TooltipContentProps = RadixTooltip.TooltipContentProps & { + children: React.ReactNode; + /** + * Defines the `max-width` of the tooltip content. `"none"` creates a single-line, naturally sized tooltip. + * @default 300 + */ + maxWidth?: number | "none"; + /** + * Short, 1-3 word tooltips, stylized inversely from normal tooltips + */ + compact?: boolean; + /** + * Gutter sizing inside the tooltip content + * @default md + */ + gutterSize?: "sm" | "md" | "lg"; + /** Determines if the tooltip content should respond to click events */ + clickable?: boolean; +}; +export declare const Content: ({ children, maxWidth, compact, clickable, alignOffset, sideOffset, gutterSize, className, style, ...restProps }: TooltipContentProps) => import("react/jsx-runtime").JSX.Element; +type TooltipTriggerProps = RadixTooltip.TooltipTriggerProps & { + /** + * Determines if `tabindex=0` is applied to the trigger + * @default true + */ + focusable?: boolean; + /** + * Optional class name to apply to the trigger + */ + className?: string; + /** Ref for the trigger */ + ref?: React.Ref; +}; +export declare const Trigger: ({ children, asChild, ...restProps }: RadixTooltip.TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element; +export declare const TriggerDecorator: (props: TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..54541cf44233377b6b8ab5f7725716a5d0de9203 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Tooltip/index.d.ts @@ -0,0 +1,2 @@ +export { CopyTooltip, type CopyTooltipProps } from "./CopyTooltip"; +export { Tooltip, type TooltipProps } from "./Tooltip"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/Animate.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/Animate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4718cc8388b82930e9590d42fc9652af849d7451 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/Animate.d.ts @@ -0,0 +1,23 @@ +import { type TransitionGroupProps } from "./TransitionGroup"; +import { type InitialTransitionDefinition, type TransitionDefinition } from "./shared"; +export type AnimateProps = Pick & { + /** Class applied to the inner TransitionGroup */ + transitionClassName?: string; + /** Styles applied to the enter transition */ + enter?: TransitionDefinition; + /** Styles applied to the exit transition */ + exit?: TransitionDefinition; + /** Styles applied before the enter transition occurs */ + initial?: InitialTransitionDefinition; + /** + * Determines how transition states are positioned + * @default absolute + */ + transitionPosition?: "absolute" | "static"; + /** + * Applies `will-change` to force animating elements to composite layers. Use with caution! + * @default false + */ + forceCompositeLayer?: boolean; +}; +export declare const Animate: (props: AnimateProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/AnimateLayout.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/AnimateLayout.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d86051e6b2a995b57c5f8bad9d72825b79348a3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/AnimateLayout.d.ts @@ -0,0 +1,33 @@ +import { type TransitionGroupProps } from "./TransitionGroup"; +import { type InitialTransitionDefinition, type LayoutTransitionDefinition, type TransitionDefinition } from "./shared"; +export type AnimateLayoutProps = Pick & { + /** + * Determines if `overflow: hidden` is applied to the wrapper element + * @default false + */ + hideOverflow?: boolean; + /** + * Determines which side of the container the items will pin to during enter/exit + * @default "start" + */ + itemAnchor?: "start" | "end"; + /** + * Determines which property will be animated during transitions + * @default "height" + */ + dimension?: "width" | "height"; + layoutEnter?: LayoutTransitionDefinition; + layoutExit?: LayoutTransitionDefinition; + layoutMove?: LayoutTransitionDefinition; + enter?: TransitionDefinition; + exit?: TransitionDefinition; + initial?: InitialTransitionDefinition; + /** Class applied to the inner TransitionGroup */ + transitionClassName?: string; + /** + * Applies `will-change` to force animating elements to composite layers. Use with caution! + * @default false + */ + forceCompositeLayer?: boolean; +}; +export declare const AnimateLayout: (props: AnimateLayoutProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/AnimateLayoutGroup.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/AnimateLayoutGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9492cd599b21e1b789a896ee2ab8040892107830 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/AnimateLayoutGroup.d.ts @@ -0,0 +1,33 @@ +import { type TransitionGroupProps } from "./TransitionGroup"; +import { type InitialTransitionDefinition, type LayoutTransitionDefinition, type TransitionDefinition } from "./shared"; +export type AnimateLayoutGroupProps = Pick & { + /** + * Determines if `overflow: hidden` is applied to the wrapper element + * @default false + */ + hideOverflow?: boolean; + /** + * Determines which side of the container the items will pin to during enter/exit + * @default "start" + */ + itemAnchor?: "start" | "end"; + /** + * Determines which property will be animated during transitions + * @default "height" + */ + dimension?: "width" | "height"; + layoutEnter?: LayoutTransitionDefinition; + layoutExit?: LayoutTransitionDefinition; + layoutMove?: LayoutTransitionDefinition; + enter?: TransitionDefinition; + exit?: TransitionDefinition; + initial?: InitialTransitionDefinition; + /** Class applied to the inner TransitionGroup */ + transitionClassName?: string; + /** + * Applies `will-change` to force animating elements to composite layers. Use with caution! + * @default false + */ + forceCompositeLayer?: boolean; +}; +export declare const AnimateLayoutGroup: (props: AnimateLayoutGroupProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/SlotTransitionGroup.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/SlotTransitionGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dede86ae192a16b8bf8377d1db1287b2a462081e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/SlotTransitionGroup.d.ts @@ -0,0 +1,24 @@ +import React from "react"; +import { type TransitionGroupChildCallbacks } from "./shared"; +export type SlotTransitionGroupProps = { + /** Components controlled by SlotTransitionGroup rendering */ + children: React.ReactNode; + /** Determines the amount of time that the enter state is applied during mounting */ + enterDuration?: number; + /** Determines the amount of time that the exit state is applied before unmounting */ + exitDuration?: number; + /** + * Determines if children should have an enter transition applied during mounting of the group. + * @default true + */ + preventInitialTransition?: boolean; + /** Delay in MS to wait before mounting a child. `null` for no delay (default). */ + enterMountDelay?: number; + /** Render children changes immediately, bypassing transition timings */ + disableAnimations?: boolean; + /** Determines how new children are added to the children array */ + insertMethod?: "append" | "prepend"; + /** Ref for the SlotTransitionGroup (applied to the single child when possible) */ + ref?: React.Ref; +} & Partial; +export declare const SlotTransitionGroup: (props: SlotTransitionGroupProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/TransitionGroup.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/TransitionGroup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1cd175f70da9f59f7995794e086538d718633461 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/TransitionGroup.d.ts @@ -0,0 +1,32 @@ +import React, { type CSSProperties } from "react"; +import { type TransitionGroupChildCallbacks } from "./shared"; +export type TransitionGroupProps = { + /** Components controlled by TransitionGroup rendering */ + children: React.ReactNode; + /** Determines the tag used by wrapping elements */ + as?: "div" | "span"; + /** Class passed to wrapping elements */ + className?: string; + /** Identifier passed to wrapping elements as `[data-transition-id]` */ + transitionId?: string; + /** Determines the amount of time that the enter state is applied during mounting */ + enterDuration?: number; + /** Determines the amount of time that the exit state is applied before unmounting */ + exitDuration?: number; + /** + * Determines if children should have an enter transition applied during mounting of the TransitionGroup. + * @default true + */ + preventInitialTransition?: boolean; + /** Delay in MS to wait before mounting a child. `null` for no delay (default). */ + enterMountDelay?: number; + /** Render children changes immediately, bypassing transition timings */ + disableAnimations?: boolean; + /** Determines how new children are added to the children array */ + insertMethod?: "append" | "prepend"; + /** Styles applied to wrapping elements */ + style?: CSSProperties; + /** Ref for the TransitionGroup */ + ref?: React.Ref; +} & Partial; +export declare const TransitionGroup: (props: TransitionGroupProps) => import("react/jsx-runtime").JSX.Element; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/getDisableAnimations.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/getDisableAnimations.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9b847c1729ad2cb7307a60aa4548aedbbc9b82f9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/getDisableAnimations.d.ts @@ -0,0 +1,2 @@ +declare const _default: () => boolean; +export default _default; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1c6f568986746fad1abb0e6ead045d64af44dfe --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/index.d.ts @@ -0,0 +1,5 @@ +export { Animate, type AnimateProps } from "./Animate"; +export { AnimateLayout, type AnimateLayoutProps } from "./AnimateLayout"; +export { AnimateLayoutGroup, type AnimateLayoutGroupProps } from "./AnimateLayoutGroup"; +export { SlotTransitionGroup, type SlotTransitionGroupProps } from "./SlotTransitionGroup"; +export { TransitionGroup, type TransitionGroupProps } from "./TransitionGroup"; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/shared.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/shared.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4293e241fc529493156f90444fa6dbcb4bf6e25 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/shared.d.ts @@ -0,0 +1,52 @@ +import React from "react"; +export type TransitionDefinition = { + opacity?: number; + /** The horizontal translation value in pixels */ + x?: number; + /** The horizontal vertical value in pixels */ + y?: number; + /** The opacity value ranging from 0 to 1. */ + scale?: number; + rotate?: number | string; + skewX?: number | string; + skewY?: number | string; + blur?: number; + duration?: number; + delay?: number; + timingFunction?: string; +}; +export type InitialTransitionDefinition = Omit; +export type LayoutTransitionDefinition = { + duration?: number; + delay?: number; + timingFunction?: string; +}; +export type CallbackType = "enter" | "enter-active" | "enter-complete" | "exit" | "exit-active" | "exit-complete"; +export type TransitionGroupChildCallback = (element: HTMLDivElement) => void; +export type TransitionGroupChildCallbacks = { + /** Callback fired when an enter animation is staged (e.g., component mounted to the DOM) */ + onEnter: TransitionGroupChildCallback; + /** Callback fired when an enter animation starts */ + onEnterActive: TransitionGroupChildCallback; + /** Callback fired when an enter animation completes */ + onEnterComplete: TransitionGroupChildCallback; + /** Callback fired when an exit animation is staged */ + onExit: TransitionGroupChildCallback; + /** Callback fired when an exit animation starts */ + onExitActive: TransitionGroupChildCallback; + /** Callback fired when an exit animation completes (e.g., component unmounted from the DOM) */ + onExitComplete: TransitionGroupChildCallback; +}; +export declare const NonNullChildren: (children: React.ReactNode) => (string | number | bigint | React.ReactElement> | Iterable | React.ReactPortal | Promise> | Iterable | null | undefined>)[]; +export interface ReactElementWithKey extends React.ReactElement { + key: string; +} +export declare const ChildrenWithKeys: (children: React.ReactNode, shouldThrow?: boolean, componentName?: string) => ReactElementWithKey[]; +export declare const noop: () => void; +export declare const useChildCallback: (cb: (el: HTMLDivElement) => void) => (el: HTMLDivElement) => void; +export type InsertMethod = "append" | "prepend"; +export declare function computeNextRenderChildren(propChildrenArray: ReactElementWithKey[], currentRenderChildren: RenderChild[], createDefaultRenderChildProps: (child: ReactElementWithKey) => RenderChild, insertMethod: InsertMethod): RenderChild[]; +export declare function assertSingleChildWhenRef(componentName: string, ref: React.Ref | undefined, childrenCount: number): void; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/transitionReducer.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/transitionReducer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..55ce7c1c554d5a7ce199371d4c2de1b2bf351ff9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/components/Transition/transitionReducer.d.ts @@ -0,0 +1,21 @@ +export type TransitionState = { + enter: boolean; + enterActive: boolean; + exit: boolean; + exitActive: boolean; + interrupted: boolean; +}; +export type TransitionStateAction = { + type: "enter-before"; +} | { + type: "enter-active"; +} | { + type: "exit-before"; +} | { + type: "exit-active"; +} | { + type: "done"; +}; +export declare const RESTING_TRANSITION_STATE: TransitionState; +export declare const getInitialTransitionState: (preventMountTransition: boolean) => TransitionState; +export declare const transitionReducer: (state: TransitionState, action: TransitionStateAction) => TransitionState; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/global.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/global.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4644dba2c6703f215980fe271f5b3509f0d2da96 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/global.d.ts @@ -0,0 +1,21 @@ +declare global { + interface DefaultConfig { + LinkComponent: "a" + Breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" + } + + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + interface AppsSDKUIOverrides {} + + // Utility type to merge defaults with overrides. The override keys take precedence. + type MergeOverrides = Omit & Overrides + + type Config = MergeOverrides + + namespace AppsSDKUI { + export type LinkComponent = Config["LinkComponent"] + export type Breakpoint = Config["Breakpoint"] + } +} + +export {} diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useAnimatedScrollTo.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useAnimatedScrollTo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8197bf6f9781b72de7d50b39e83f2af5bf9b1729 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useAnimatedScrollTo.d.ts @@ -0,0 +1 @@ +export declare const useAnimatedScrollTo: (scrollRef: React.RefObject) => (targetScrollTop: number) => void; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useAutoGrowTextarea.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useAutoGrowTextarea.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9ce5b9a10c74d05c41c36e16fe1f81f5c437677 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useAutoGrowTextarea.d.ts @@ -0,0 +1,4 @@ +import { type RefObject } from "react"; +export declare const useAutoGrowTextarea: (ref: RefObject, value: string) => void; +export declare const unsafeForceCalculateAutoGrowHeight: (textarea: HTMLTextAreaElement) => void; +export declare const getAutoGrowTextareaHeight: (textarea: HTMLTextAreaElement) => any; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useBreakpoints.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useBreakpoints.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8caa6d296e6c9f78040c1292c575b82f2cc26f4b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useBreakpoints.d.ts @@ -0,0 +1,2 @@ +export declare const cache: Map; +export declare const useBreakpoint: (bp: AppsSDKUI.Breakpoint) => boolean; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useCharactersPerSecond.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useCharactersPerSecond.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..508d60ae7e34e30fa4e8c3bb3b3f597d7f3a1dad --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useCharactersPerSecond.d.ts @@ -0,0 +1 @@ +export declare function useCharactersPerSecond(text: string, streaming: boolean): () => number; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useDocumentVisible.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useDocumentVisible.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b52032ca9e6aa1a54d84b8af3ac78a5f6a342c81 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useDocumentVisible.d.ts @@ -0,0 +1 @@ +export declare function useDocumentVisible(): boolean; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useEscCloseStack.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useEscCloseStack.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44cd7def1797bef6dc5e0a706cd22eafa0c35ba5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useEscCloseStack.d.ts @@ -0,0 +1 @@ +export declare const useEscCloseStack: (listening: boolean, cb: () => void) => void; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useIsMounted.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useIsMounted.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e236789f2f9e986b63af18fd937fb0385ac7960c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useIsMounted.d.ts @@ -0,0 +1,2 @@ +export declare function useIsMounted(): boolean; +export declare function useIsMountedRef(): import("react").RefObject; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useLatestValue.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useLatestValue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ce868285541b7c0c0cedee7d9a9e4418ea87aaa --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useLatestValue.d.ts @@ -0,0 +1 @@ +export declare function useLatestValue(value: T): import("react").RefObject; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/usePrevious.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/usePrevious.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9546dc1bc172a175197928aff1d14ae4bc2af0ce --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/usePrevious.d.ts @@ -0,0 +1 @@ +export declare function usePrevious(value: T): T; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useScrollable.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useScrollable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..10711b5be8de50b580c7e701c753d6ba37e2050c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useScrollable.d.ts @@ -0,0 +1,6 @@ +import { type RefObject } from "react"; +export declare const useScrollable: (ref: RefObject) => { + isScrollable: boolean; + isAtStart: boolean; + isAtEnd: boolean; +}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useSimulatedProgress.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useSimulatedProgress.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a93430ca42b87fecf1f63cd61843874524216d4b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useSimulatedProgress.d.ts @@ -0,0 +1,18 @@ +/** + * Deterministically returns a progress value between 0 and 100 that decays as it approaches 100, + * based on a maximum duration and the elapsed time. + * + * @param maxTime - The maximum duration (in ms) after which the progress will be 100 + * @param elapsedTime - The elapsed time (in ms) since the start time + * @returns The simulated progress percentage + */ +export declare function getSimulatedProgress(maxTime: number, elapsedTime: number): number; +/** + * Returns a number that will increase over time, decaying as it approaches 100, + * withouth ever reaching the end. + * + * @param startAt - The time at which the progress started + * @param maxDuration - The maximum duration (in ms) after which the progress will be 100 + * @param completed - Sets progress to 100% immediately + */ +export declare const useSimulatedProgress: (startAt: number, maxDuration: number, completed?: boolean) => number; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useStableCallback.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useStableCallback.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebff173190758fad3d5722c14481693abe592d14 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useStableCallback.d.ts @@ -0,0 +1,3 @@ +type AnyFunction = (...args: any[]) => any; +export declare function useStableCallback(callback: T): T; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useTextSelection.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useTextSelection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d530739895af22ee06873110e2d429c6dab4eeea --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useTextSelection.d.ts @@ -0,0 +1,2 @@ +export declare const useTextSelection: (listening: boolean, cb: (currentSelection: Selection | null) => void) => void; +export declare const clearTextSelection: () => void; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useTrailingValue.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useTrailingValue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3424b2c28ed4344ac5c32aa4e5c336a208d6426a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/hooks/useTrailingValue.d.ts @@ -0,0 +1,6 @@ +/** + * Returns a version of `value` that updates to the latest `value` after `delay` + * milliseconds. Useful for holding on to a previous value for a short time + * after it changes (e.g. for coordinating animations). + */ +export declare function useTrailingValue(value: T, delay: number): T; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/assert.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/assert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ff6ef9b1d1d493b8da1522726636e62124b6d9b9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/assert.d.ts @@ -0,0 +1 @@ +export declare function assertIs(a: unknown, b: T): asserts a is T; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/casing.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/casing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68160277a97fc4b0e47494320a0d0969002a50f0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/casing.d.ts @@ -0,0 +1,3 @@ +export declare function filenameToTitleCase(filename: string): string; +export declare function kebabCaseToPascalCase(name: string): string; +export declare function capitalize(str: T): Capitalize; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/constants.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6a17a52b560459c613e739b140e4d3ed84b0d13 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/constants.d.ts @@ -0,0 +1,2 @@ +export { isDev, isTest } from "./environment"; +export declare const EMAIL_REGEX: RegExp; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/copyToClipboard.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/copyToClipboard.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..388738bf52828cecb410e9f7db0642cd63b28585 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/copyToClipboard.d.ts @@ -0,0 +1,31 @@ +export type ClipboardContent = { + "text/plain"?: string; + "image/png"?: Blob; + "image/jpeg"?: Blob; + "image/webp"?: Blob; +}; +export declare function toClipboardItem(content: ClipboardContent): ClipboardItem; +/** + * Utility for copying rich content in a cross-browser way + * + * @param {string | ClipboardContent} content + * @param {HTMLElement} container - Fallback text copy method requires appending a textarea + * to the DOM and focusing it. If you don't want to shift focus out of the currently + * focused container (e.g. a popover) you can specify a custom container to append + * the textarea to keep focus in that container. This need for this edge case is + * exceedingly rare as navigator.clipboard.writeText support expands. + * @returns - A promise that resolves to true if the copy was successful, false otherwise. + */ +export declare function copyToClipboard(content: string | ClipboardContent, container?: HTMLElement): Promise; +/** + * Utility for copying plaintext in a cross-browser way + * + * @param {string} text + * @param {HTMLElement} container - Fallback text copy method requires appending a textarea + * to the DOM and focusing it. If you don't want to shift focus out of the currently + * focused container (e.g. a popover) you can specify a custom container to append + * the textarea to keep focus in that container. This need for this edge case is + * exceedingly rare as navigator.clipboard.writeText support expands. + * @returns - A promise that resolves to true if the copy was successful, false otherwise. + */ +export declare function copyText(text: string, container?: HTMLElement): Promise; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/dateUtils.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/dateUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ece70990519fc07c7054e37646a129a254236fd --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/dateUtils.d.ts @@ -0,0 +1,32 @@ +import { DateTime } from "luxon"; +/** + * Get all days in a given month as DateTime objects + */ +export declare const getDaysOfMonth: (date: DateTime) => DateTime[]; +/** + * Check if the first date is before the second date + */ +export declare const isBefore: (targetDate: DateTime, compareDate: DateTime) => boolean; +/** + * Check if the first date is after the second date + */ +export declare const isAfter: (targetDate: DateTime, compareDate: DateTime) => boolean; +/** + * Check if two dates are the same day (ignoring time) + */ +export declare const isSameDay: (targetDate: DateTime, compareDate: DateTime) => boolean; +/** + * Check if a date is today + */ +export declare const isToday: (dateTime: DateTime) => boolean; +/** + * Split an array of days into weeks (arrays of 7 days each) + */ +export declare const chunkIntoWeeks: (daysInMonth: DateTime[], size?: number) => DateTime[][]; +/** + * Get the start and end date of the month the provided date is in, with optional min and max limits. + */ +export declare const getMonthStartAndEnd: (date: DateTime, { min, max }?: { + min?: DateTime; + max?: DateTime; +}) => [DateTime, DateTime]; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/environment.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/environment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a3fa26d0a827e6aa7919a02badffd1ac259926d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/environment.d.ts @@ -0,0 +1,6 @@ +export declare const isDev: boolean; +export declare const isJSDomLike: boolean; +export declare const isTest: boolean; +export declare const hasWindow: boolean; +export declare const hasDocument: boolean; +export declare const canUseDOM: boolean; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/helpers.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/helpers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25cbb07cb22be40dd3f4e7b646bf0449d0bc3557 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/helpers.d.ts @@ -0,0 +1,41 @@ +import { type CSSProperties } from "react"; +export declare const prefersReducedMotion: () => boolean; +export declare const handlePressableMouseEnter: (evt: React.MouseEvent) => void; +interface CancelAnimationFrame { + (): void; +} +export declare const waitForAnimationFrame: (cb: () => void, options?: { + frames: number; +}) => CancelAnimationFrame; +export declare const toCssVariables: (variables: Record) => CSSProperties; +export declare const toAngle: (value: number | string) => string; +export declare const toOpacityProperty: (opacity: number) => string; +export declare const toMsDurationProperty: (duration: number) => string; +export declare const toTransformProperty: ({ x, y, scale, rotate, skewX, skewY, }?: { + x?: number; + y?: number; + scale?: number; + rotate?: number | string; + skewX?: number | string; + skewY?: number | string; +}) => string; +export declare const toFilterProperty: ({ blur }?: { + blur?: number | undefined; +}) => string; +export declare const preventDefaultHandler: (evt: Event) => void; +export declare const focusableElements: (element: HTMLElement) => NodeListOf; +export declare const sleep: (ms: number) => Promise; +/** + * Group an array of objects by a property, preserving the *first-seen* order + * of each group. + * + * @example + * groupByOrdered(people, "team") + * // => [ { team: "infra", items:[...] }, { team:"design", items:[...] }, ... ] + */ +export declare function groupByProperty(items: T[], key: K, format?: (raw: T[K], item: T) => F): ({ [P in K]: F; } & { + items: T[]; +} extends infer T_1 extends Record ? { [K_1 in keyof T_1]: ({ [P in K]: F; } & { + items: T[]; +})[K_1]; } : never)[]; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/ids.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/ids.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9b7954a028f34f776313cf79d47946399434e00 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/ids.d.ts @@ -0,0 +1 @@ +export declare const createId: (prefix: string, maxLength?: number) => T; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/renderHelpers.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/renderHelpers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..125a04c3ce5bd953e31656c86e6938dc11fff57c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/renderHelpers.d.ts @@ -0,0 +1,2 @@ +import { type ReactNode } from "react"; +export declare const wrapTextNodeSiblings: (children: ReactNode) => ReactNode; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/safeBase64.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/safeBase64.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ab0de8c34e6ffb146b3f2b7dffce6d569176673 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/safeBase64.d.ts @@ -0,0 +1,2 @@ +export declare const encodeBase64: (value: unknown) => string; +export declare const decodeBase64: (b64: string) => T; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/theme.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/theme.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0d89fd6ae26c2ce5ab27e51b54b3239ffb835bc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/theme.d.ts @@ -0,0 +1,4 @@ +export type DocumentTheme = "light" | "dark"; +export declare function useDocumentTheme(): "dark" | "light"; +export declare function getDocumentTheme(): "dark" | "light"; +export declare function applyDocumentTheme(theme: "light" | "dark"): void; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/userAgent.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/userAgent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a1e9088a6385be680c64bed7efe7329835f288c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/userAgent.d.ts @@ -0,0 +1,10 @@ +export declare function isIosBrowser(): boolean; +export declare function isAndroidBrowser(): boolean; +export declare function isIosChromeBrowser(): boolean; +export declare function isMobileDevice(): boolean; +export declare function isSafariBrowser(): boolean; +export declare function isAndroidChromeBrowser(): boolean; +export declare function isMacDevice(): boolean; +export declare function isWindowsDevice(): boolean; +export declare function isChromeDesktopBrowser(): boolean; +export declare function isFirefoxBrowser(): boolean; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/utilityTypes.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/utilityTypes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..636206d19b0a2e1959732e8c71c3ccec9c194478 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/lib/utilityTypes.d.ts @@ -0,0 +1,8 @@ +export type Pretty> = {} & { + [K in keyof T]: T[K]; +}; +declare const brand: unique symbol; +export type Brand = T & { + [brand]: B; +}; +export {}; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/types.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7e5ed9243cac724f97f3c822cf60f3549dffcd4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/types.d.ts @@ -0,0 +1,15 @@ +export type Size = "5xs" | "4xs" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl"; +export type Sizes = T; +export type ControlSize = Sizes<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl">; +export type Radius = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full"; +export type Radii = T; +export type TextColor = "base" | "emphasis" | "secondary" | "tertiary"; +export type TextColors = T; +export type SemanticColor = "primary" | "secondary" | "danger" | "success" | "warning" | "caution" | "discovery" | "info"; +export type SemanticColors = T; +export type Variant = "solid" | "soft" | "outline" | "ghost"; +export type Variants = T; +export type Alignment = "start" | "center" | "end"; +export type Alignments = T; +export type FontWeight = "inherit" | "normal" | "medium" | "semibold" | "bold"; +export type FontWeights = T; diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/vite-env.d.ts b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/vite-env.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11f02fe2a0061d6e6e1f271b21da95423b448b32 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/dist/types/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/package.json b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dd123c56cb51420a728dd0ebf7c591217979b9d2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@openai/apps-sdk-ui/package.json @@ -0,0 +1,157 @@ +{ + "name": "@openai/apps-sdk-ui", + "version": "0.2.2", + "description": "Design system for building apps for ChatGPT with Apps SDK", + "license": "MIT", + "homepage": "https://github.com/openai/apps-sdk-ui#readme", + "repository": { + "type": "git", + "url": "https://github.com/openai/apps-sdk-ui.git" + }, + "bugs": { + "url": "https://github.com/openai/apps-sdk-ui/issues" + }, + "private": false, + "files": [ + "dist/es/**", + "dist/types/**" + ], + "exports": { + "./css": "./dist/es/styles/index.css", + "./components/*": { + "types": "./dist/types/components/*/index.d.ts", + "default": "./dist/es/components/*/index.js" + }, + "./hooks/*": { + "types": "./dist/types/hooks/*.d.ts", + "default": "./dist/es/hooks/*.js" + }, + "./theme": { + "types": "./dist/types/lib/theme.d.ts", + "default": "./dist/es/lib/theme.js" + }, + "./helpers": { + "types": "./dist/types/lib/helpers.d.ts", + "default": "./dist/es/lib/helpers.js" + }, + "./userAgent": { + "types": "./dist/types/lib/userAgent.d.ts", + "default": "./dist/es/lib/userAgent.js" + }, + "./dateUtils": { + "types": "./dist/types/lib/dateUtils.d.ts", + "default": "./dist/es/lib/dateUtils.js" + } + }, + "scripts": { + "format": "prettier --check --cache --ignore-path .gitignore --ignore-path .prettierignore '**/*.{js,jsx,ts,tsx,json,css,md}'", + "format:fix": "prettier --write --cache --ignore-path .gitignore --ignore-path .prettierignore '**/*.{js,jsx,ts,tsx,json,css,md}'", + "lint": "npm run lint:ts && npm run lint:css", + "lint:ts": "eslint . --ignore-pattern dist --ignore-pattern node_modules", + "lint:css": "stylelint \"src/**/*.css\" --ignore-path .stylelintignore", + "test": "vitest run", + "types": "tsc", + "build:clean": "rm -rf dist", + "build:js": "tsc -p tsconfig.build.json", + "build:css": "node ./scripts/build-css.mjs", + "build:assets": "rsync -a --include='*/' --include='*.d.ts' --exclude='*' src/ dist/types/", + "build": "npm run build:clean && npm run build:js && npm run build:css && npm run build:assets", + "prepublishOnly": "npm run format:fix && npm run lint && npm run types && npm run test && npm run build", + "storybook": "storybook dev -p 6006 --config-dir .storybook-base", + "build-storybook": "storybook build --disable-telemetry --config-dir .storybook-base" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "tailwindcss": "^4.0.10" + }, + "dependencies": { + "clsx": "^2.1.1", + "lodash": "4.17.21", + "luxon": "3.7.1", + "radix-ui": "^1.1.3", + "react-markdown": "^9.0.3", + "react-merge-refs": "^2.1.1", + "react-syntax-highlighter": "^16.1.0", + "rehype-katex": "7.0.1", + "remark-breaks": "^4.0.0", + "remark-directive": "^3.0.1", + "remark-gfm": "^4.0.0", + "remark-math": "6.0.0", + "unist-util-visit": "^5.0.0", + "usehooks-ts": "^3.1.1" + }, + "devDependencies": { + "@chromatic-com/storybook": "^3.2.4", + "@eslint/js": "^9.19.0", + "@happy-dom/global-registrator": "20.0.10", + "@mdx-js/react": "^3.1.0", + "@mdx-js/rollup": "^3.1.0", + "@storybook/addon-essentials": "^8.6.12", + "@storybook/addon-interactions": "^8.6.12", + "@storybook/addon-links": "^8.6.12", + "@storybook/addon-storysource": "^8.6.12", + "@storybook/addon-toolbars": "^8.6.12", + "@storybook/blocks": "^8.6.12", + "@storybook/components": "^8.6.12", + "@storybook/manager-api": "^8.6.12", + "@storybook/react": "^8.6.12", + "@storybook/react-vite": "^8.6.12", + "@storybook/test": "^8.6.12", + "@storybook/theming": "^8.6.12", + "@tailwindcss/postcss": "4.0.17", + "@testing-library/dom": "10.4.0", + "@testing-library/jest-dom": "^6.5.0", + "@testing-library/react": "16.3.0", + "@types/jsdom": "21.1.7", + "@types/lodash": "4.17.16", + "@types/luxon": "3.6.2", + "@types/mdast": "^4.0.4", + "@types/mdx": "^2.0.13", + "@types/postcss-functions": "4.0.4", + "@types/postcss-mixins": "9.0.6", + "@types/react": "19.0.8", + "@types/react-dom": "19.0.3", + "@types/react-syntax-highlighter": "^15.5.13", + "@vitejs/plugin-react": "^4.3.4", + "autoprefixer": "10.4.20", + "eslint": "^9.19.0", + "eslint-config-prettier": "^10.0.1", + "eslint-plugin-mdx": "^3.1.5", + "eslint-plugin-path": "1.4.0-beta.0", + "eslint-plugin-react": "^7.37.4", + "eslint-plugin-react-compiler": "19.0.0-beta-27714ef-20250124", + "eslint-plugin-react-hooks": "^5.0.0", + "eslint-plugin-react-refresh": "^0.4.18", + "eslint-plugin-storybook": "^0.11.3", + "globals": "^15.14.0", + "happy-dom": "20.0.10", + "jsdom": "24.1.3", + "openai": "4.87.3", + "postcss": "^8", + "postcss-functions": "^4.0.2", + "postcss-mixins": "^11.0.3", + "postcss-nested": "^7.0.2", + "postcss-selector-parser": "7.1.0", + "postcss-value-parser": "4.2.0", + "prettier": "3.2.5", + "prettier-plugin-organize-imports": "4.1.0", + "prettier-plugin-tailwindcss": "^0.6.11", + "react": "19.0.0", + "react-dom": "19.0.0", + "react-router": "^7.1.5", + "rollup": "4.35.0", + "rollup-plugin-dts": "6.2.3", + "storybook": "^8.6.12", + "stylelint": "16.18.0", + "stylelint-config-standard": "^37.0.0", + "stylelint-order": "^6.0.4", + "stylelint-prettier": "^5.0.3", + "stylelint-scss": "6.12.1", + "tailwindcss": "4.0.10", + "typescript": "5.7.3", + "typescript-eslint": "^8.22.0", + "vite": "6.2.4", + "vite-tsconfig-paths": "5.1.4", + "vitest": "^2.1.5" + } +} diff --git a/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/LICENSE b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..444bffc00e5190817c0092e5e6fde787102977d2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2024-present VoidZero Inc. & Contributors +Copyright (c) 2023 Boshen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/README.md b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d5b248ac3fc1e8673b6fc55bda1c04e9a0464d02 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/README.md @@ -0,0 +1,3 @@ +# Oxc Types + +Typescript definitions for Oxc AST nodes. diff --git a/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/package.json b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8d60f9032f2747458743a3e73ab0582171d82deb --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/package.json @@ -0,0 +1,26 @@ +{ + "name": "@oxc-project/types", + "version": "0.137.0", + "description": "Types for Oxc AST nodes", + "keywords": [ + "AST", + "Parser" + ], + "homepage": "https://oxc.rs", + "bugs": "https://github.com/oxc-project/oxc/issues", + "license": "MIT", + "author": "Boshen and oxc contributors", + "repository": { + "type": "git", + "url": "git+https://github.com/oxc-project/oxc.git", + "directory": "npm/oxc-types" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "files": [ + "types.d.ts" + ], + "type": "module", + "types": "types.d.ts" +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/types.d.ts b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c94c1159e6302de98254582d9f3aeea5514bdd71 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@oxc-project/types/types.d.ts @@ -0,0 +1,1912 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`. + +export interface Program extends Span { + type: "Program"; + body: Array; + sourceType: ModuleKind; + hashbang: Hashbang | null; + parent?: null; +} + +export type Expression = + | BooleanLiteral + | NullLiteral + | NumericLiteral + | BigIntLiteral + | RegExpLiteral + | StringLiteral + | TemplateLiteral + | IdentifierReference + | MetaProperty + | Super + | ArrayExpression + | ArrowFunctionExpression + | AssignmentExpression + | AwaitExpression + | BinaryExpression + | CallExpression + | ChainExpression + | Class + | ConditionalExpression + | Function + | ImportExpression + | LogicalExpression + | NewExpression + | ObjectExpression + | ParenthesizedExpression + | SequenceExpression + | TaggedTemplateExpression + | ThisExpression + | UnaryExpression + | UpdateExpression + | YieldExpression + | PrivateInExpression + | JSXElement + | JSXFragment + | TSAsExpression + | TSSatisfiesExpression + | TSTypeAssertion + | TSNonNullExpression + | TSInstantiationExpression + | V8IntrinsicExpression + | MemberExpression; + +export interface IdentifierName extends Span { + type: "Identifier"; + decorators?: []; + name: string; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface IdentifierReference extends Span { + type: "Identifier"; + decorators?: []; + name: string; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface BindingIdentifier extends Span { + type: "Identifier"; + decorators?: []; + name: string; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface LabelIdentifier extends Span { + type: "Identifier"; + decorators?: []; + name: string; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface ThisExpression extends Span { + type: "ThisExpression"; + parent?: Node; +} + +export interface ArrayExpression extends Span { + type: "ArrayExpression"; + elements: Array; + parent?: Node; +} + +export type ArrayExpressionElement = SpreadElement | null | Expression; + +export interface ObjectExpression extends Span { + type: "ObjectExpression"; + properties: Array; + parent?: Node; +} + +export type ObjectPropertyKind = ObjectProperty | SpreadElement; + +export interface ObjectProperty extends Span { + type: "Property"; + kind: PropertyKind; + key: PropertyKey; + value: Expression; + method: boolean; + shorthand: boolean; + computed: boolean; + optional?: false; + parent?: Node; +} + +export type PropertyKey = IdentifierName | PrivateIdentifier | Expression; + +export type PropertyKind = "init" | "get" | "set"; + +export interface TemplateLiteral extends Span { + type: "TemplateLiteral"; + quasis: Array; + expressions: Array; + parent?: Node; +} + +export interface TaggedTemplateExpression extends Span { + type: "TaggedTemplateExpression"; + tag: Expression; + typeArguments?: TSTypeParameterInstantiation | null; + quasi: TemplateLiteral; + parent?: Node; +} + +export interface TemplateElement extends Span { + type: "TemplateElement"; + value: TemplateElementValue; + tail: boolean; + parent?: Node; +} + +export interface TemplateElementValue { + raw: string; + cooked: string | null; +} + +export type MemberExpression = + | ComputedMemberExpression + | StaticMemberExpression + | PrivateFieldExpression; + +export interface ComputedMemberExpression extends Span { + type: "MemberExpression"; + object: Expression; + property: Expression; + optional: boolean; + computed: true; + parent?: Node; +} + +export interface StaticMemberExpression extends Span { + type: "MemberExpression"; + object: Expression; + property: IdentifierName; + optional: boolean; + computed: false; + parent?: Node; +} + +export interface PrivateFieldExpression extends Span { + type: "MemberExpression"; + object: Expression; + property: PrivateIdentifier; + optional: boolean; + computed: false; + parent?: Node; +} + +export interface CallExpression extends Span { + type: "CallExpression"; + callee: Expression; + typeArguments?: TSTypeParameterInstantiation | null; + arguments: Array; + optional: boolean; + parent?: Node; +} + +export interface NewExpression extends Span { + type: "NewExpression"; + callee: Expression; + typeArguments?: TSTypeParameterInstantiation | null; + arguments: Array; + parent?: Node; +} + +export interface MetaProperty extends Span { + type: "MetaProperty"; + meta: IdentifierName; + property: IdentifierName; + parent?: Node; +} + +export interface SpreadElement extends Span { + type: "SpreadElement"; + argument: Expression; + parent?: Node; +} + +export type Argument = SpreadElement | Expression; + +export interface UpdateExpression extends Span { + type: "UpdateExpression"; + operator: UpdateOperator; + prefix: boolean; + argument: SimpleAssignmentTarget; + parent?: Node; +} + +export interface UnaryExpression extends Span { + type: "UnaryExpression"; + operator: UnaryOperator; + argument: Expression; + prefix: true; + parent?: Node; +} + +export interface BinaryExpression extends Span { + type: "BinaryExpression"; + left: Expression; + operator: BinaryOperator; + right: Expression; + parent?: Node; +} + +export interface PrivateInExpression extends Span { + type: "BinaryExpression"; + left: PrivateIdentifier; + operator: "in"; + right: Expression; + parent?: Node; +} + +export interface LogicalExpression extends Span { + type: "LogicalExpression"; + left: Expression; + operator: LogicalOperator; + right: Expression; + parent?: Node; +} + +export interface ConditionalExpression extends Span { + type: "ConditionalExpression"; + test: Expression; + consequent: Expression; + alternate: Expression; + parent?: Node; +} + +export interface AssignmentExpression extends Span { + type: "AssignmentExpression"; + operator: AssignmentOperator; + left: AssignmentTarget; + right: Expression; + parent?: Node; +} + +export type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern; + +export type SimpleAssignmentTarget = + | IdentifierReference + | TSAsExpression + | TSSatisfiesExpression + | TSNonNullExpression + | TSTypeAssertion + | MemberExpression; + +export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget; + +export interface ArrayAssignmentTarget extends Span { + type: "ArrayPattern"; + decorators?: []; + elements: Array; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface ObjectAssignmentTarget extends Span { + type: "ObjectPattern"; + decorators?: []; + properties: Array; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface AssignmentTargetRest extends Span { + type: "RestElement"; + decorators?: []; + argument: AssignmentTarget; + optional?: false; + typeAnnotation?: null; + value?: null; + parent?: Node; +} + +export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget; + +export interface AssignmentTargetWithDefault extends Span { + type: "AssignmentPattern"; + decorators?: []; + left: AssignmentTarget; + right: Expression; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export type AssignmentTargetProperty = + | AssignmentTargetPropertyIdentifier + | AssignmentTargetPropertyProperty; + +export interface AssignmentTargetPropertyIdentifier extends Span { + type: "Property"; + kind: "init"; + key: IdentifierReference; + value: IdentifierReference | AssignmentTargetWithDefault; + method: false; + shorthand: true; + computed: false; + optional?: false; + parent?: Node; +} + +export interface AssignmentTargetPropertyProperty extends Span { + type: "Property"; + kind: "init"; + key: PropertyKey; + value: AssignmentTargetMaybeDefault; + method: false; + shorthand: false; + computed: boolean; + optional?: false; + parent?: Node; +} + +export interface SequenceExpression extends Span { + type: "SequenceExpression"; + expressions: Array; + parent?: Node; +} + +export interface Super extends Span { + type: "Super"; + parent?: Node; +} + +export interface AwaitExpression extends Span { + type: "AwaitExpression"; + argument: Expression; + parent?: Node; +} + +export interface ChainExpression extends Span { + type: "ChainExpression"; + expression: ChainElement; + parent?: Node; +} + +export type ChainElement = CallExpression | TSNonNullExpression | MemberExpression; + +export interface ParenthesizedExpression extends Span { + type: "ParenthesizedExpression"; + expression: Expression; + parent?: Node; +} + +export type Statement = + | BlockStatement + | BreakStatement + | ContinueStatement + | DebuggerStatement + | DoWhileStatement + | EmptyStatement + | ExpressionStatement + | ForInStatement + | ForOfStatement + | ForStatement + | IfStatement + | LabeledStatement + | ReturnStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | WithStatement + | Declaration + | ModuleDeclaration; + +export interface Directive extends Span { + type: "ExpressionStatement"; + expression: StringLiteral; + directive: string; + parent?: Node; +} + +export interface Hashbang extends Span { + type: "Hashbang"; + value: string; + parent?: Node; +} + +export interface BlockStatement extends Span { + type: "BlockStatement"; + body: Array; + parent?: Node; +} + +export type Declaration = + | VariableDeclaration + | Function + | Class + | TSTypeAliasDeclaration + | TSInterfaceDeclaration + | TSEnumDeclaration + | TSModuleDeclaration + | TSGlobalDeclaration + | TSImportEqualsDeclaration; + +export interface VariableDeclaration extends Span { + type: "VariableDeclaration"; + kind: VariableDeclarationKind; + declarations: Array; + declare?: boolean; + parent?: Node; +} + +export type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using"; + +export interface VariableDeclarator extends Span { + type: "VariableDeclarator"; + id: BindingPattern; + init: Expression | null; + definite?: boolean; + parent?: Node; +} + +export interface EmptyStatement extends Span { + type: "EmptyStatement"; + parent?: Node; +} + +export interface ExpressionStatement extends Span { + type: "ExpressionStatement"; + expression: Expression; + directive?: string | null; + parent?: Node; +} + +export interface IfStatement extends Span { + type: "IfStatement"; + test: Expression; + consequent: Statement; + alternate: Statement | null; + parent?: Node; +} + +export interface DoWhileStatement extends Span { + type: "DoWhileStatement"; + body: Statement; + test: Expression; + parent?: Node; +} + +export interface WhileStatement extends Span { + type: "WhileStatement"; + test: Expression; + body: Statement; + parent?: Node; +} + +export interface ForStatement extends Span { + type: "ForStatement"; + init: ForStatementInit | null; + test: Expression | null; + update: Expression | null; + body: Statement; + parent?: Node; +} + +export type ForStatementInit = VariableDeclaration | Expression; + +export interface ForInStatement extends Span { + type: "ForInStatement"; + left: ForStatementLeft; + right: Expression; + body: Statement; + parent?: Node; +} + +export type ForStatementLeft = VariableDeclaration | AssignmentTarget; + +export interface ForOfStatement extends Span { + type: "ForOfStatement"; + await: boolean; + left: ForStatementLeft; + right: Expression; + body: Statement; + parent?: Node; +} + +export interface ContinueStatement extends Span { + type: "ContinueStatement"; + label: LabelIdentifier | null; + parent?: Node; +} + +export interface BreakStatement extends Span { + type: "BreakStatement"; + label: LabelIdentifier | null; + parent?: Node; +} + +export interface ReturnStatement extends Span { + type: "ReturnStatement"; + argument: Expression | null; + parent?: Node; +} + +export interface WithStatement extends Span { + type: "WithStatement"; + object: Expression; + body: Statement; + parent?: Node; +} + +export interface SwitchStatement extends Span { + type: "SwitchStatement"; + discriminant: Expression; + cases: Array; + parent?: Node; +} + +export interface SwitchCase extends Span { + type: "SwitchCase"; + test: Expression | null; + consequent: Array; + parent?: Node; +} + +export interface LabeledStatement extends Span { + type: "LabeledStatement"; + label: LabelIdentifier; + body: Statement; + parent?: Node; +} + +export interface ThrowStatement extends Span { + type: "ThrowStatement"; + argument: Expression; + parent?: Node; +} + +export interface TryStatement extends Span { + type: "TryStatement"; + block: BlockStatement; + handler: CatchClause | null; + finalizer: BlockStatement | null; + parent?: Node; +} + +export interface CatchClause extends Span { + type: "CatchClause"; + param: BindingPattern | null; + body: BlockStatement; + parent?: Node; +} + +export interface DebuggerStatement extends Span { + type: "DebuggerStatement"; + parent?: Node; +} + +export type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern; + +export interface AssignmentPattern extends Span { + type: "AssignmentPattern"; + decorators?: []; + left: BindingPattern; + right: Expression; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface ObjectPattern extends Span { + type: "ObjectPattern"; + decorators?: []; + properties: Array; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface BindingProperty extends Span { + type: "Property"; + kind: "init"; + key: PropertyKey; + value: BindingPattern; + method: false; + shorthand: boolean; + computed: boolean; + optional?: false; + parent?: Node; +} + +export interface ArrayPattern extends Span { + type: "ArrayPattern"; + decorators?: []; + elements: Array; + optional?: false; + typeAnnotation?: null; + parent?: Node; +} + +export interface BindingRestElement extends Span { + type: "RestElement"; + decorators?: []; + argument: BindingPattern; + optional?: false; + typeAnnotation?: null; + value?: null; + parent?: Node; +} + +export interface Function extends Span { + type: FunctionType; + id: BindingIdentifier | null; + generator: boolean; + async: boolean; + declare?: boolean; + typeParameters?: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType?: TSTypeAnnotation | null; + body: FunctionBody | null; + expression: false; + parent?: Node; +} + +export type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest; + +export type FunctionType = + | "FunctionDeclaration" + | "FunctionExpression" + | "TSDeclareFunction" + | "TSEmptyBodyFunctionExpression"; + +export interface FormalParameterRest extends Span { + type: "RestElement"; + argument: BindingPattern; + decorators?: []; + optional?: boolean; + typeAnnotation?: TSTypeAnnotation | null; + value?: null; + parent?: Node; +} + +export type FormalParameter = { + decorators?: Array; +} & BindingPattern; + +export interface TSParameterProperty extends Span { + type: "TSParameterProperty"; + accessibility: TSAccessibility | null; + decorators: Array; + override: boolean; + parameter: FormalParameter; + readonly: boolean; + static: boolean; + parent?: Node; +} + +export interface FunctionBody extends Span { + type: "BlockStatement"; + body: Array; + parent?: Node; +} + +export interface ArrowFunctionExpression extends Span { + type: "ArrowFunctionExpression"; + expression: boolean; + async: boolean; + typeParameters?: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType?: TSTypeAnnotation | null; + body: FunctionBody | Expression; + id: null; + generator: false; + parent?: Node; +} + +export interface YieldExpression extends Span { + type: "YieldExpression"; + delegate: boolean; + argument: Expression | null; + parent?: Node; +} + +export interface Class extends Span { + type: ClassType; + decorators: Array; + id: BindingIdentifier | null; + typeParameters?: TSTypeParameterDeclaration | null; + superClass: Expression | null; + superTypeArguments?: TSTypeParameterInstantiation | null; + implements?: Array; + body: ClassBody; + abstract?: boolean; + declare?: boolean; + parent?: Node; +} + +export type ClassType = "ClassDeclaration" | "ClassExpression"; + +export interface ClassBody extends Span { + type: "ClassBody"; + body: Array; + parent?: Node; +} + +export type ClassElement = + | StaticBlock + | MethodDefinition + | PropertyDefinition + | AccessorProperty + | TSIndexSignature; + +export interface MethodDefinition extends Span { + type: MethodDefinitionType; + decorators: Array; + key: PropertyKey; + value: Function; + kind: MethodDefinitionKind; + computed: boolean; + static: boolean; + override?: boolean; + optional?: boolean; + accessibility?: TSAccessibility | null; + parent?: Node; +} + +export type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition"; + +export interface PropertyDefinition extends Span { + type: PropertyDefinitionType; + decorators: Array; + key: PropertyKey; + typeAnnotation?: TSTypeAnnotation | null; + value: Expression | null; + computed: boolean; + static: boolean; + declare?: boolean; + override?: boolean; + optional?: boolean; + definite?: boolean; + readonly?: boolean; + accessibility?: TSAccessibility | null; + parent?: Node; +} + +export type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition"; + +export type MethodDefinitionKind = "constructor" | "method" | "get" | "set"; + +export interface PrivateIdentifier extends Span { + type: "PrivateIdentifier"; + name: string; + parent?: Node; +} + +export interface StaticBlock extends Span { + type: "StaticBlock"; + body: Array; + parent?: Node; +} + +export type ModuleDeclaration = + | ImportDeclaration + | ExportAllDeclaration + | ExportDefaultDeclaration + | ExportNamedDeclaration + | TSExportAssignment + | TSNamespaceExportDeclaration; + +export type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty"; + +export interface AccessorProperty extends Span { + type: AccessorPropertyType; + decorators: Array; + key: PropertyKey; + typeAnnotation?: TSTypeAnnotation | null; + value: Expression | null; + computed: boolean; + static: boolean; + override?: boolean; + definite?: boolean; + accessibility?: TSAccessibility | null; + declare?: false; + optional?: false; + readonly?: false; + parent?: Node; +} + +export interface ImportExpression extends Span { + type: "ImportExpression"; + source: Expression; + options: Expression | null; + phase: ImportPhase | null; + parent?: Node; +} + +export interface ImportDeclaration extends Span { + type: "ImportDeclaration"; + specifiers: Array; + source: StringLiteral; + phase: ImportPhase | null; + attributes: Array; + importKind?: ImportOrExportKind; + parent?: Node; +} + +export type ImportPhase = "source" | "defer"; + +export type ImportDeclarationSpecifier = + | ImportSpecifier + | ImportDefaultSpecifier + | ImportNamespaceSpecifier; + +export interface ImportSpecifier extends Span { + type: "ImportSpecifier"; + imported: ModuleExportName; + local: BindingIdentifier; + importKind?: ImportOrExportKind; + parent?: Node; +} + +export interface ImportDefaultSpecifier extends Span { + type: "ImportDefaultSpecifier"; + local: BindingIdentifier; + parent?: Node; +} + +export interface ImportNamespaceSpecifier extends Span { + type: "ImportNamespaceSpecifier"; + local: BindingIdentifier; + parent?: Node; +} + +export interface ImportAttribute extends Span { + type: "ImportAttribute"; + key: ImportAttributeKey; + value: StringLiteral; + parent?: Node; +} + +export type ImportAttributeKey = IdentifierName | StringLiteral; + +export interface ExportNamedDeclaration extends Span { + type: "ExportNamedDeclaration"; + declaration: Declaration | null; + specifiers: Array; + source: StringLiteral | null; + exportKind?: ImportOrExportKind; + attributes: Array; + parent?: Node; +} + +export interface ExportDefaultDeclaration extends Span { + type: "ExportDefaultDeclaration"; + declaration: ExportDefaultDeclarationKind; + exportKind?: "value"; + parent?: Node; +} + +export interface ExportAllDeclaration extends Span { + type: "ExportAllDeclaration"; + exported: ModuleExportName | null; + source: StringLiteral; + attributes: Array; + exportKind?: ImportOrExportKind; + parent?: Node; +} + +export interface ExportSpecifier extends Span { + type: "ExportSpecifier"; + local: ModuleExportName; + exported: ModuleExportName; + exportKind?: ImportOrExportKind; + parent?: Node; +} + +export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression; + +export type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral; + +export interface V8IntrinsicExpression extends Span { + type: "V8IntrinsicExpression"; + name: IdentifierName; + arguments: Array; + parent?: Node; +} + +export interface BooleanLiteral extends Span { + type: "Literal"; + value: boolean; + raw: string | null; + parent?: Node; +} + +export interface NullLiteral extends Span { + type: "Literal"; + value: null; + raw: "null" | null; + parent?: Node; +} + +export interface NumericLiteral extends Span { + type: "Literal"; + value: number; + raw: string | null; + parent?: Node; +} + +export interface StringLiteral extends Span { + type: "Literal"; + value: string; + raw: string | null; + parent?: Node; +} + +export interface BigIntLiteral extends Span { + type: "Literal"; + value: bigint; + raw: string | null; + bigint: string; + parent?: Node; +} + +export interface RegExpLiteral extends Span { + type: "Literal"; + value: RegExp | null; + raw: string | null; + regex: { pattern: string; flags: string }; + parent?: Node; +} + +export interface JSXElement extends Span { + type: "JSXElement"; + openingElement: JSXOpeningElement; + children: Array; + closingElement: JSXClosingElement | null; + parent?: Node; +} + +export interface JSXOpeningElement extends Span { + type: "JSXOpeningElement"; + name: JSXElementName; + typeArguments?: TSTypeParameterInstantiation | null; + attributes: Array; + selfClosing: boolean; + parent?: Node; +} + +export interface JSXClosingElement extends Span { + type: "JSXClosingElement"; + name: JSXElementName; + parent?: Node; +} + +export interface JSXFragment extends Span { + type: "JSXFragment"; + openingFragment: JSXOpeningFragment; + children: Array; + closingFragment: JSXClosingFragment; + parent?: Node; +} + +export interface JSXOpeningFragment extends Span { + type: "JSXOpeningFragment"; + attributes?: []; + selfClosing?: false; + parent?: Node; +} + +export interface JSXClosingFragment extends Span { + type: "JSXClosingFragment"; + parent?: Node; +} + +export type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression; + +export interface JSXNamespacedName extends Span { + type: "JSXNamespacedName"; + namespace: JSXIdentifier; + name: JSXIdentifier; + parent?: Node; +} + +export interface JSXMemberExpression extends Span { + type: "JSXMemberExpression"; + object: JSXMemberExpressionObject; + property: JSXIdentifier; + parent?: Node; +} + +export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression; + +export interface JSXExpressionContainer extends Span { + type: "JSXExpressionContainer"; + expression: JSXExpression; + parent?: Node; +} + +export type JSXExpression = JSXEmptyExpression | Expression; + +export interface JSXEmptyExpression extends Span { + type: "JSXEmptyExpression"; + parent?: Node; +} + +export type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute; + +export interface JSXAttribute extends Span { + type: "JSXAttribute"; + name: JSXAttributeName; + value: JSXAttributeValue | null; + parent?: Node; +} + +export interface JSXSpreadAttribute extends Span { + type: "JSXSpreadAttribute"; + argument: Expression; + parent?: Node; +} + +export type JSXAttributeName = JSXIdentifier | JSXNamespacedName; + +export type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment; + +export interface JSXIdentifier extends Span { + type: "JSXIdentifier"; + name: string; + parent?: Node; +} + +export type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild; + +export interface JSXSpreadChild extends Span { + type: "JSXSpreadChild"; + expression: Expression; + parent?: Node; +} + +export interface JSXText extends Span { + type: "JSXText"; + value: string; + raw: string | null; + parent?: Node; +} + +export interface TSThisParameter extends Span { + type: "Identifier"; + decorators: []; + name: "this"; + optional: false; + typeAnnotation: TSTypeAnnotation | null; + parent?: Node; +} + +export interface TSEnumDeclaration extends Span { + type: "TSEnumDeclaration"; + id: BindingIdentifier; + body: TSEnumBody; + const: boolean; + declare: boolean; + parent?: Node; +} + +export interface TSEnumBody extends Span { + type: "TSEnumBody"; + members: Array; + parent?: Node; +} + +export interface TSEnumMember extends Span { + type: "TSEnumMember"; + id: TSEnumMemberName; + initializer: Expression | null; + computed: boolean; + parent?: Node; +} + +export type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral; + +export interface TSTypeAnnotation extends Span { + type: "TSTypeAnnotation"; + typeAnnotation: TSType; + parent?: Node; +} + +export interface TSLiteralType extends Span { + type: "TSLiteralType"; + literal: TSLiteral; + parent?: Node; +} + +export type TSLiteral = + | BooleanLiteral + | NumericLiteral + | BigIntLiteral + | StringLiteral + | TemplateLiteral + | UnaryExpression; + +export type TSType = + | TSAnyKeyword + | TSBigIntKeyword + | TSBooleanKeyword + | TSIntrinsicKeyword + | TSNeverKeyword + | TSNullKeyword + | TSNumberKeyword + | TSObjectKeyword + | TSStringKeyword + | TSSymbolKeyword + | TSUndefinedKeyword + | TSUnknownKeyword + | TSVoidKeyword + | TSArrayType + | TSConditionalType + | TSConstructorType + | TSFunctionType + | TSImportType + | TSIndexedAccessType + | TSInferType + | TSIntersectionType + | TSLiteralType + | TSMappedType + | TSNamedTupleMember + | TSTemplateLiteralType + | TSThisType + | TSTupleType + | TSTypeLiteral + | TSTypeOperator + | TSTypePredicate + | TSTypeQuery + | TSTypeReference + | TSUnionType + | TSParenthesizedType + | JSDocNullableType + | JSDocNonNullableType + | JSDocUnknownType; + +export interface TSConditionalType extends Span { + type: "TSConditionalType"; + checkType: TSType; + extendsType: TSType; + trueType: TSType; + falseType: TSType; + parent?: Node; +} + +export interface TSUnionType extends Span { + type: "TSUnionType"; + types: Array; + parent?: Node; +} + +export interface TSIntersectionType extends Span { + type: "TSIntersectionType"; + types: Array; + parent?: Node; +} + +export interface TSParenthesizedType extends Span { + type: "TSParenthesizedType"; + typeAnnotation: TSType; + parent?: Node; +} + +export interface TSTypeOperator extends Span { + type: "TSTypeOperator"; + operator: TSTypeOperatorOperator; + typeAnnotation: TSType; + parent?: Node; +} + +export type TSTypeOperatorOperator = "keyof" | "unique" | "readonly"; + +export interface TSArrayType extends Span { + type: "TSArrayType"; + elementType: TSType; + parent?: Node; +} + +export interface TSIndexedAccessType extends Span { + type: "TSIndexedAccessType"; + objectType: TSType; + indexType: TSType; + parent?: Node; +} + +export interface TSTupleType extends Span { + type: "TSTupleType"; + elementTypes: Array; + parent?: Node; +} + +export interface TSNamedTupleMember extends Span { + type: "TSNamedTupleMember"; + label: IdentifierName; + elementType: TSTupleElement; + optional: boolean; + parent?: Node; +} + +export interface TSOptionalType extends Span { + type: "TSOptionalType"; + typeAnnotation: TSType; + parent?: Node; +} + +export interface TSRestType extends Span { + type: "TSRestType"; + typeAnnotation: TSType; + parent?: Node; +} + +export type TSTupleElement = TSOptionalType | TSRestType | TSType; + +export interface TSAnyKeyword extends Span { + type: "TSAnyKeyword"; + parent?: Node; +} + +export interface TSStringKeyword extends Span { + type: "TSStringKeyword"; + parent?: Node; +} + +export interface TSBooleanKeyword extends Span { + type: "TSBooleanKeyword"; + parent?: Node; +} + +export interface TSNumberKeyword extends Span { + type: "TSNumberKeyword"; + parent?: Node; +} + +export interface TSNeverKeyword extends Span { + type: "TSNeverKeyword"; + parent?: Node; +} + +export interface TSIntrinsicKeyword extends Span { + type: "TSIntrinsicKeyword"; + parent?: Node; +} + +export interface TSUnknownKeyword extends Span { + type: "TSUnknownKeyword"; + parent?: Node; +} + +export interface TSNullKeyword extends Span { + type: "TSNullKeyword"; + parent?: Node; +} + +export interface TSUndefinedKeyword extends Span { + type: "TSUndefinedKeyword"; + parent?: Node; +} + +export interface TSVoidKeyword extends Span { + type: "TSVoidKeyword"; + parent?: Node; +} + +export interface TSSymbolKeyword extends Span { + type: "TSSymbolKeyword"; + parent?: Node; +} + +export interface TSThisType extends Span { + type: "TSThisType"; + parent?: Node; +} + +export interface TSObjectKeyword extends Span { + type: "TSObjectKeyword"; + parent?: Node; +} + +export interface TSBigIntKeyword extends Span { + type: "TSBigIntKeyword"; + parent?: Node; +} + +export interface TSTypeReference extends Span { + type: "TSTypeReference"; + typeName: TSTypeName; + typeArguments: TSTypeParameterInstantiation | null; + parent?: Node; +} + +export type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression; + +export interface TSQualifiedName extends Span { + type: "TSQualifiedName"; + left: TSTypeName; + right: IdentifierName; + parent?: Node; +} + +export interface TSTypeParameterInstantiation extends Span { + type: "TSTypeParameterInstantiation"; + params: Array; + parent?: Node; +} + +export interface TSTypeParameter extends Span { + type: "TSTypeParameter"; + name: BindingIdentifier; + constraint: TSType | null; + default: TSType | null; + in: boolean; + out: boolean; + const: boolean; + parent?: Node; +} + +export interface TSTypeParameterDeclaration extends Span { + type: "TSTypeParameterDeclaration"; + params: Array; + parent?: Node; +} + +export interface TSTypeAliasDeclaration extends Span { + type: "TSTypeAliasDeclaration"; + id: BindingIdentifier; + typeParameters: TSTypeParameterDeclaration | null; + typeAnnotation: TSType; + declare: boolean; + parent?: Node; +} + +export type TSAccessibility = "private" | "protected" | "public"; + +export interface TSClassImplements extends Span { + type: "TSClassImplements"; + expression: IdentifierReference | ThisExpression | MemberExpression; + typeArguments: TSTypeParameterInstantiation | null; + parent?: Node; +} + +export interface TSInterfaceDeclaration extends Span { + type: "TSInterfaceDeclaration"; + id: BindingIdentifier; + typeParameters: TSTypeParameterDeclaration | null; + extends: Array; + body: TSInterfaceBody; + declare: boolean; + parent?: Node; +} + +export interface TSInterfaceBody extends Span { + type: "TSInterfaceBody"; + body: Array; + parent?: Node; +} + +export interface TSPropertySignature extends Span { + type: "TSPropertySignature"; + computed: boolean; + optional: boolean; + readonly: boolean; + key: PropertyKey; + typeAnnotation: TSTypeAnnotation | null; + accessibility: null; + static: false; + parent?: Node; +} + +export type TSSignature = + | TSIndexSignature + | TSPropertySignature + | TSCallSignatureDeclaration + | TSConstructSignatureDeclaration + | TSMethodSignature; + +export interface TSIndexSignature extends Span { + type: "TSIndexSignature"; + parameters: Array; + typeAnnotation: TSTypeAnnotation; + readonly: boolean; + static: boolean; + accessibility: null; + parent?: Node; +} + +export interface TSCallSignatureDeclaration extends Span { + type: "TSCallSignatureDeclaration"; + typeParameters: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType: TSTypeAnnotation | null; + parent?: Node; +} + +export type TSMethodSignatureKind = "method" | "get" | "set"; + +export interface TSMethodSignature extends Span { + type: "TSMethodSignature"; + key: PropertyKey; + computed: boolean; + optional: boolean; + kind: TSMethodSignatureKind; + typeParameters: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType: TSTypeAnnotation | null; + accessibility: null; + readonly: false; + static: false; + parent?: Node; +} + +export interface TSConstructSignatureDeclaration extends Span { + type: "TSConstructSignatureDeclaration"; + typeParameters: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType: TSTypeAnnotation | null; + parent?: Node; +} + +export interface TSIndexSignatureName extends Span { + type: "Identifier"; + decorators: []; + name: string; + optional: false; + typeAnnotation: TSTypeAnnotation; + parent?: Node; +} + +export interface TSInterfaceHeritage extends Span { + type: "TSInterfaceHeritage"; + expression: Expression; + typeArguments: TSTypeParameterInstantiation | null; + parent?: Node; +} + +export interface TSTypePredicate extends Span { + type: "TSTypePredicate"; + parameterName: TSTypePredicateName; + asserts: boolean; + typeAnnotation: TSTypeAnnotation | null; + parent?: Node; +} + +export type TSTypePredicateName = IdentifierName | TSThisType; + +export interface TSModuleDeclaration extends Span { + type: "TSModuleDeclaration"; + id: BindingIdentifier | StringLiteral | TSQualifiedName; + body: TSModuleBlock | null; + kind: TSModuleDeclarationKind; + declare: boolean; + global: false; + parent?: Node; +} + +export type TSModuleDeclarationKind = "module" | "namespace"; + +export interface TSGlobalDeclaration extends Span { + type: "TSModuleDeclaration"; + id: IdentifierName; + body: TSModuleBlock; + kind: "global"; + declare: boolean; + global: true; + parent?: Node; +} + +export interface TSModuleBlock extends Span { + type: "TSModuleBlock"; + body: Array; + parent?: Node; +} + +export interface TSTypeLiteral extends Span { + type: "TSTypeLiteral"; + members: Array; + parent?: Node; +} + +export interface TSInferType extends Span { + type: "TSInferType"; + typeParameter: TSTypeParameter; + parent?: Node; +} + +export interface TSTypeQuery extends Span { + type: "TSTypeQuery"; + exprName: TSTypeQueryExprName; + typeArguments: TSTypeParameterInstantiation | null; + parent?: Node; +} + +export type TSTypeQueryExprName = TSImportType | TSTypeName; + +export interface TSImportType extends Span { + type: "TSImportType"; + source: StringLiteral; + options: ObjectExpression | null; + qualifier: TSImportTypeQualifier | null; + typeArguments: TSTypeParameterInstantiation | null; + parent?: Node; +} + +export type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName; + +export interface TSImportTypeQualifiedName extends Span { + type: "TSQualifiedName"; + left: TSImportTypeQualifier; + right: IdentifierName; + parent?: Node; +} + +export interface TSFunctionType extends Span { + type: "TSFunctionType"; + typeParameters: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType: TSTypeAnnotation; + parent?: Node; +} + +export interface TSConstructorType extends Span { + type: "TSConstructorType"; + abstract: boolean; + typeParameters: TSTypeParameterDeclaration | null; + params: ParamPattern[]; + returnType: TSTypeAnnotation; + parent?: Node; +} + +export interface TSMappedType extends Span { + type: "TSMappedType"; + key: BindingIdentifier; + constraint: TSType; + nameType: TSType | null; + typeAnnotation: TSType | null; + optional: TSMappedTypeModifierOperator | false; + readonly: TSMappedTypeModifierOperator | null; + parent?: Node; +} + +export type TSMappedTypeModifierOperator = true | "+" | "-"; + +export interface TSTemplateLiteralType extends Span { + type: "TSTemplateLiteralType"; + quasis: Array; + types: Array; + parent?: Node; +} + +export interface TSAsExpression extends Span { + type: "TSAsExpression"; + expression: Expression; + typeAnnotation: TSType; + parent?: Node; +} + +export interface TSSatisfiesExpression extends Span { + type: "TSSatisfiesExpression"; + expression: Expression; + typeAnnotation: TSType; + parent?: Node; +} + +export interface TSTypeAssertion extends Span { + type: "TSTypeAssertion"; + typeAnnotation: TSType; + expression: Expression; + parent?: Node; +} + +export interface TSImportEqualsDeclaration extends Span { + type: "TSImportEqualsDeclaration"; + id: BindingIdentifier; + moduleReference: TSModuleReference; + importKind: ImportOrExportKind; + parent?: Node; +} + +export type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName; + +export interface TSExternalModuleReference extends Span { + type: "TSExternalModuleReference"; + expression: StringLiteral; + parent?: Node; +} + +export interface TSNonNullExpression extends Span { + type: "TSNonNullExpression"; + expression: Expression; + parent?: Node; +} + +export interface Decorator extends Span { + type: "Decorator"; + expression: Expression; + parent?: Node; +} + +export interface TSExportAssignment extends Span { + type: "TSExportAssignment"; + expression: Expression; + parent?: Node; +} + +export interface TSNamespaceExportDeclaration extends Span { + type: "TSNamespaceExportDeclaration"; + id: IdentifierName; + parent?: Node; +} + +export interface TSInstantiationExpression extends Span { + type: "TSInstantiationExpression"; + expression: Expression; + typeArguments: TSTypeParameterInstantiation; + parent?: Node; +} + +export type ImportOrExportKind = "value" | "type"; + +export interface JSDocNullableType extends Span { + type: "TSJSDocNullableType"; + typeAnnotation: TSType; + postfix: boolean; + parent?: Node; +} + +export interface JSDocNonNullableType extends Span { + type: "TSJSDocNonNullableType"; + typeAnnotation: TSType; + postfix: boolean; + parent?: Node; +} + +export interface JSDocUnknownType extends Span { + type: "TSJSDocUnknownType"; + parent?: Node; +} + +export type ModuleKind = "script" | "module" | "commonjs"; + +export interface Span { + start: number; + end: number; + range?: [number, number]; +} + +export type AssignmentOperator = + | "=" + | "+=" + | "-=" + | "*=" + | "/=" + | "%=" + | "**=" + | "<<=" + | ">>=" + | ">>>=" + | "|=" + | "^=" + | "&=" + | "||=" + | "&&=" + | "??="; + +export type BinaryOperator = + | "==" + | "!=" + | "===" + | "!==" + | "<" + | "<=" + | ">" + | ">=" + | "+" + | "-" + | "*" + | "/" + | "%" + | "**" + | "<<" + | ">>" + | ">>>" + | "|" + | "^" + | "&" + | "in" + | "instanceof"; + +export type LogicalOperator = "||" | "&&" | "??"; + +export type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete"; + +export type UpdateOperator = "++" | "--"; + +export type Node = + | Program + | IdentifierName + | IdentifierReference + | BindingIdentifier + | LabelIdentifier + | ThisExpression + | ArrayExpression + | ObjectExpression + | ObjectProperty + | TemplateLiteral + | TaggedTemplateExpression + | TemplateElement + | ComputedMemberExpression + | StaticMemberExpression + | PrivateFieldExpression + | CallExpression + | NewExpression + | MetaProperty + | SpreadElement + | UpdateExpression + | UnaryExpression + | BinaryExpression + | PrivateInExpression + | LogicalExpression + | ConditionalExpression + | AssignmentExpression + | ArrayAssignmentTarget + | ObjectAssignmentTarget + | AssignmentTargetRest + | AssignmentTargetWithDefault + | AssignmentTargetPropertyIdentifier + | AssignmentTargetPropertyProperty + | SequenceExpression + | Super + | AwaitExpression + | ChainExpression + | ParenthesizedExpression + | Directive + | Hashbang + | BlockStatement + | VariableDeclaration + | VariableDeclarator + | EmptyStatement + | ExpressionStatement + | IfStatement + | DoWhileStatement + | WhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | ContinueStatement + | BreakStatement + | ReturnStatement + | WithStatement + | SwitchStatement + | SwitchCase + | LabeledStatement + | ThrowStatement + | TryStatement + | CatchClause + | DebuggerStatement + | AssignmentPattern + | ObjectPattern + | BindingProperty + | ArrayPattern + | BindingRestElement + | Function + | FunctionBody + | ArrowFunctionExpression + | YieldExpression + | Class + | ClassBody + | MethodDefinition + | PropertyDefinition + | PrivateIdentifier + | StaticBlock + | AccessorProperty + | ImportExpression + | ImportDeclaration + | ImportSpecifier + | ImportDefaultSpecifier + | ImportNamespaceSpecifier + | ImportAttribute + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + | ExportSpecifier + | V8IntrinsicExpression + | BooleanLiteral + | NullLiteral + | NumericLiteral + | StringLiteral + | BigIntLiteral + | RegExpLiteral + | JSXElement + | JSXOpeningElement + | JSXClosingElement + | JSXFragment + | JSXOpeningFragment + | JSXClosingFragment + | JSXNamespacedName + | JSXMemberExpression + | JSXExpressionContainer + | JSXEmptyExpression + | JSXAttribute + | JSXSpreadAttribute + | JSXIdentifier + | JSXSpreadChild + | JSXText + | TSThisParameter + | TSEnumDeclaration + | TSEnumBody + | TSEnumMember + | TSTypeAnnotation + | TSLiteralType + | TSConditionalType + | TSUnionType + | TSIntersectionType + | TSParenthesizedType + | TSTypeOperator + | TSArrayType + | TSIndexedAccessType + | TSTupleType + | TSNamedTupleMember + | TSOptionalType + | TSRestType + | TSAnyKeyword + | TSStringKeyword + | TSBooleanKeyword + | TSNumberKeyword + | TSNeverKeyword + | TSIntrinsicKeyword + | TSUnknownKeyword + | TSNullKeyword + | TSUndefinedKeyword + | TSVoidKeyword + | TSSymbolKeyword + | TSThisType + | TSObjectKeyword + | TSBigIntKeyword + | TSTypeReference + | TSQualifiedName + | TSTypeParameterInstantiation + | TSTypeParameter + | TSTypeParameterDeclaration + | TSTypeAliasDeclaration + | TSClassImplements + | TSInterfaceDeclaration + | TSInterfaceBody + | TSPropertySignature + | TSIndexSignature + | TSCallSignatureDeclaration + | TSMethodSignature + | TSConstructSignatureDeclaration + | TSIndexSignatureName + | TSInterfaceHeritage + | TSTypePredicate + | TSModuleDeclaration + | TSGlobalDeclaration + | TSModuleBlock + | TSTypeLiteral + | TSInferType + | TSTypeQuery + | TSImportType + | TSImportTypeQualifiedName + | TSFunctionType + | TSConstructorType + | TSMappedType + | TSTemplateLiteralType + | TSAsExpression + | TSSatisfiesExpression + | TSTypeAssertion + | TSImportEqualsDeclaration + | TSExternalModuleReference + | TSNonNullExpression + | Decorator + | TSExportAssignment + | TSNamespaceExportDeclaration + | TSInstantiationExpression + | JSDocNullableType + | JSDocNonNullableType + | JSDocUnknownType + | ParamPattern; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/README.md new file mode 100644 index 0000000000000000000000000000000000000000..783d5f4ac0f455d774be5ceb7beeaddf8ffb1004 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/README.md @@ -0,0 +1,3 @@ +# `number` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..971ef6b9aa0cd15adfe3b5ab314f9c5d9e1ff4e9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.d.mts @@ -0,0 +1,3 @@ +declare function clamp(value: number, [min, max]: [number, number]): number; + +export { clamp }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..971ef6b9aa0cd15adfe3b5ab314f9c5d9e1ff4e9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.d.ts @@ -0,0 +1,3 @@ +declare function clamp(value: number, [min, max]: [number, number]): number; + +export { clamp }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..099db098fef88f99522bf86a6eeaf81b611fa9fb --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.js @@ -0,0 +1,31 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + clamp: () => clamp +}); +module.exports = __toCommonJS(index_exports); + +// src/number.ts +function clamp(value, [min, max]) { + return Math.min(max, Math.max(min, value)); +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f438a44bc1621a36ee8ebab089463cb51c2cc92c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/number.ts"], + "sourcesContent": ["export { clamp } from './number';\n", "function clamp(value: number, [min, max]: [number, number]): number {\n return Math.min(max, Math.max(min, value));\n}\n\nexport { clamp };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,MAAM,OAAe,CAAC,KAAK,GAAG,GAA6B;AAClE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c4bec233cd1477472897e65a88a9dee1464f926a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.mjs @@ -0,0 +1,8 @@ +// src/number.ts +function clamp(value, [min, max]) { + return Math.min(max, Math.max(min, value)); +} +export { + clamp +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..3357e7e141da5de9457af4c7c590ea4e958cf5be --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/number.ts"], + "sourcesContent": ["function clamp(value: number, [min, max]: [number, number]): number {\n return Math.min(max, Math.max(min, value));\n}\n\nexport { clamp };\n"], + "mappings": ";AAAA,SAAS,MAAM,OAAe,CAAC,KAAK,GAAG,GAA6B;AAClE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8c5ef83425104d5b94f0c09687517aa0124903af --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/number/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/number", + "version": "1.1.2", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "devDependencies": { + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/core/number" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/README.md new file mode 100644 index 0000000000000000000000000000000000000000..79d1eef22a1eb564a20adc03814dd443ccc5bf8e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/README.md @@ -0,0 +1,3 @@ +# `primitive` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..dad4db4aeb2ff16aa0f006b132a1f98b8ca7006e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.d.mts @@ -0,0 +1,20 @@ +declare const canUseDOM: boolean; +declare function composeEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: { + checkForDefaultPrevented?: boolean | undefined; +}): (event: E) => void; +declare function getOwnerWindow(element: Node | null | undefined): Window & typeof globalThis; +declare function getOwnerDocument(element: Node | null | undefined): Document; +/** + * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37 + * MIT License, Copyright (c) AriaKit. + */ +declare function getActiveElement(node: Node | null | undefined, activeDescendant?: boolean): HTMLElement | null; +declare function isFrame(element: Element): element is HTMLIFrameElement; + +type Timeout = ReturnType; +type Interval = ReturnType; +type Immediate = ReturnType; + +export { type Immediate, type Interval, type Timeout, canUseDOM, composeEventHandlers, getActiveElement, getOwnerDocument, getOwnerWindow, isFrame }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dad4db4aeb2ff16aa0f006b132a1f98b8ca7006e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.d.ts @@ -0,0 +1,20 @@ +declare const canUseDOM: boolean; +declare function composeEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: { + checkForDefaultPrevented?: boolean | undefined; +}): (event: E) => void; +declare function getOwnerWindow(element: Node | null | undefined): Window & typeof globalThis; +declare function getOwnerDocument(element: Node | null | undefined): Document; +/** + * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37 + * MIT License, Copyright (c) AriaKit. + */ +declare function getActiveElement(node: Node | null | undefined, activeDescendant?: boolean): HTMLElement | null; +declare function isFrame(element: Element): element is HTMLIFrameElement; + +type Timeout = ReturnType; +type Interval = ReturnType; +type Immediate = ReturnType; + +export { type Immediate, type Interval, type Timeout, canUseDOM, composeEventHandlers, getActiveElement, getOwnerDocument, getOwnerWindow, isFrame }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..24ae5dea44e598438e32dda15623ecd5a2146c75 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.js @@ -0,0 +1,76 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + canUseDOM: () => canUseDOM, + composeEventHandlers: () => composeEventHandlers, + getActiveElement: () => getActiveElement, + getOwnerDocument: () => getOwnerDocument, + getOwnerWindow: () => getOwnerWindow, + isFrame: () => isFrame +}); +module.exports = __toCommonJS(index_exports); + +// src/primitive.tsx +var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); +function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { + return function handleEvent(event) { + originalEventHandler?.(event); + if (checkForDefaultPrevented === false || !event.defaultPrevented) { + return ourEventHandler?.(event); + } + }; +} +function getOwnerWindow(element) { + if (!canUseDOM) { + throw new Error("Cannot access window outside of the DOM"); + } + return element?.ownerDocument?.defaultView ?? window; +} +function getOwnerDocument(element) { + if (!canUseDOM) { + throw new Error("Cannot access document outside of the DOM"); + } + return element?.ownerDocument ?? document; +} +function getActiveElement(node, activeDescendant = false) { + const { activeElement } = getOwnerDocument(node); + if (!activeElement?.nodeName) { + return null; + } + if (isFrame(activeElement) && activeElement.contentDocument) { + return getActiveElement(activeElement.contentDocument.body, activeDescendant); + } + if (activeDescendant) { + const id = activeElement.getAttribute("aria-activedescendant"); + if (id) { + const element = getOwnerDocument(activeElement).getElementById(id); + if (element) { + return element; + } + } + } + return activeElement; +} +function isFrame(element) { + return element.tagName === "IFRAME"; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..6a97e5c521821e01b1aee08c9f2f4e80b878dc05 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/primitive.tsx"], + "sourcesContent": ["export * from './primitive';\nexport type * from './types';\n", "/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {},\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false,\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n\n if (activeDescendant) {\n const id = activeElement.getAttribute('aria-activedescendant');\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,YAAY,CAAC,EACxB,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAIX,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAC,MAAM,kBAAkB;AACjE,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;AAEO,SAAS,eAAe,SAAkC;AAC/D,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,SAAO,SAAS,eAAe,eAAe;AAChD;AAEO,SAAS,iBAAiB,SAAkC;AACjE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AAEA,SAAO,SAAS,iBAAiB;AACnC;AAMO,SAAS,iBACd,MACA,mBAAmB,OACC;AACpB,QAAM,EAAE,cAAc,IAAI,iBAAiB,IAAI;AAC/C,MAAI,CAAC,eAAe,UAAU;AAG5B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,aAAa,KAAK,cAAc,iBAAiB;AAC3D,WAAO,iBAAiB,cAAc,gBAAgB,MAAM,gBAAgB;AAAA,EAC9E;AAEA,MAAI,kBAAkB;AACpB,UAAM,KAAK,cAAc,aAAa,uBAAuB;AAC7D,QAAI,IAAI;AACN,YAAM,UAAU,iBAAiB,aAAa,EAAE,eAAe,EAAE;AACjE,UAAI,SAAS;AACX,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,QAAQ,SAAgD;AACtE,SAAO,QAAQ,YAAY;AAC7B;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d28e40879e85ea74263f3a3dcb8d987d35d09891 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.mjs @@ -0,0 +1,53 @@ +// src/primitive.tsx +var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); +function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { + return function handleEvent(event) { + originalEventHandler?.(event); + if (checkForDefaultPrevented === false || !event.defaultPrevented) { + return ourEventHandler?.(event); + } + }; +} +function getOwnerWindow(element) { + if (!canUseDOM) { + throw new Error("Cannot access window outside of the DOM"); + } + return element?.ownerDocument?.defaultView ?? window; +} +function getOwnerDocument(element) { + if (!canUseDOM) { + throw new Error("Cannot access document outside of the DOM"); + } + return element?.ownerDocument ?? document; +} +function getActiveElement(node, activeDescendant = false) { + const { activeElement } = getOwnerDocument(node); + if (!activeElement?.nodeName) { + return null; + } + if (isFrame(activeElement) && activeElement.contentDocument) { + return getActiveElement(activeElement.contentDocument.body, activeDescendant); + } + if (activeDescendant) { + const id = activeElement.getAttribute("aria-activedescendant"); + if (id) { + const element = getOwnerDocument(activeElement).getElementById(id); + if (element) { + return element; + } + } + } + return activeElement; +} +function isFrame(element) { + return element.tagName === "IFRAME"; +} +export { + canUseDOM, + composeEventHandlers, + getActiveElement, + getOwnerDocument, + getOwnerWindow, + isFrame +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..123834e91eb793dd1e147fa5cef480bac7350de2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/primitive.tsx"], + "sourcesContent": ["/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {},\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false,\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n\n if (activeDescendant) {\n const id = activeElement.getAttribute('aria-activedescendant');\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n"], + "mappings": ";AAGO,IAAM,YAAY,CAAC,EACxB,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAIX,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAC,MAAM,kBAAkB;AACjE,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;AAEO,SAAS,eAAe,SAAkC;AAC/D,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,SAAO,SAAS,eAAe,eAAe;AAChD;AAEO,SAAS,iBAAiB,SAAkC;AACjE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AAEA,SAAO,SAAS,iBAAiB;AACnC;AAMO,SAAS,iBACd,MACA,mBAAmB,OACC;AACpB,QAAM,EAAE,cAAc,IAAI,iBAAiB,IAAI;AAC/C,MAAI,CAAC,eAAe,UAAU;AAG5B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,aAAa,KAAK,cAAc,iBAAiB;AAC3D,WAAO,iBAAiB,cAAc,gBAAgB,MAAM,gBAAgB;AAAA,EAC9E;AAEA,MAAI,kBAAkB;AACpB,UAAM,KAAK,cAAc,aAAa,uBAAuB;AAC7D,QAAI,IAAI;AACN,YAAM,UAAU,iBAAiB,aAAa,EAAE,eAAe,EAAE;AACjE,UAAI,SAAS;AACX,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,QAAQ,SAAgD;AACtE,SAAO,QAAQ,YAAY;AAC7B;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d652f746f4cecd141f3eed15b97e28c16b3544a9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/primitive/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/primitive", + "version": "1.1.4", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "devDependencies": { + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/core/primitive" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7e1df5d0897f32687c5ebd1b5c18b6a201f5a910 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/README.md @@ -0,0 +1,3 @@ +# `react-accessible-icon` + +View docs [here](https://radix-ui.com/primitives/docs/utilities/accessible-icon). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f105c4087a22303b5f9229abe385fff624ab47b6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.d.mts @@ -0,0 +1,14 @@ +import * as React from 'react'; + +interface AccessibleIconProps { + children?: React.ReactNode; + /** + * The accessible label for the icon. This label will be visually hidden but announced to screen + * reader users, similar to `alt` text for `img` tags. + */ + label: string; +} +declare const AccessibleIcon: React.FC; +declare const Root: React.FC; + +export { AccessibleIcon, type AccessibleIconProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f105c4087a22303b5f9229abe385fff624ab47b6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; + +interface AccessibleIconProps { + children?: React.ReactNode; + /** + * The accessible label for the icon. This label will be visually hidden but announced to screen + * reader users, similar to `alt` text for `img` tags. + */ + label: string; +} +declare const AccessibleIcon: React.FC; +declare const Root: React.FC; + +export { AccessibleIcon, type AccessibleIconProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9492711c291638b3453c887a63de348a0c5a419e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.js @@ -0,0 +1,57 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + AccessibleIcon: () => AccessibleIcon, + Root: () => Root2 +}); +module.exports = __toCommonJS(index_exports); + +// src/accessible-icon.tsx +var React = __toESM(require("react")); +var VisuallyHiddenPrimitive = __toESM(require("@radix-ui/react-visually-hidden")); +var import_jsx_runtime = require("react/jsx-runtime"); +var NAME = "AccessibleIcon"; +var AccessibleIcon = ({ children, label }) => { + const child = React.Children.only(children); + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + React.cloneElement(child, { + // accessibility + "aria-hidden": "true", + focusable: "false" + // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable + }), + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenPrimitive.Root, { children: label }) + ] }); +}; +AccessibleIcon.displayName = NAME; +var Root2 = AccessibleIcon; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7be0c158e69a620bb4cefc2f580c2e7d11105c59 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/accessible-icon.tsx"], + "sourcesContent": ["export {\n AccessibleIcon,\n //\n Root,\n} from './accessible-icon';\nexport type { AccessibleIconProps } from './accessible-icon';\n", "import * as React from 'react';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nconst NAME = 'AccessibleIcon';\n\ninterface AccessibleIconProps {\n children?: React.ReactNode;\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label: string;\n}\n\nconst AccessibleIcon: React.FC = ({ children, label }) => {\n const child = React.Children.only(children);\n return (\n <>\n {React.cloneElement(child as React.ReactElement>, {\n // accessibility\n 'aria-hidden': 'true',\n focusable: 'false', // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable\n })}\n {label}\n \n );\n};\n\nAccessibleIcon.displayName = NAME;\n\nconst Root = AccessibleIcon;\n\nexport {\n AccessibleIcon,\n //\n Root,\n};\nexport type { AccessibleIconProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,8BAAyC;AAgBrC;AAdJ,IAAM,OAAO;AAWb,IAAM,iBAAgD,CAAC,EAAE,UAAU,MAAM,MAAM;AAC7E,QAAM,QAAc,eAAS,KAAK,QAAQ;AAC1C,SACE,4EACG;AAAA,IAAM,mBAAa,OAA8D;AAAA;AAAA,MAEhF,eAAe;AAAA,MACf,WAAW;AAAA;AAAA,IACb,CAAC;AAAA,IACD,4CAAyB,8BAAxB,EAA8B,iBAAM;AAAA,KACvC;AAEJ;AAEA,eAAe,cAAc;AAE7B,IAAMC,QAAO;", + "names": ["Root", "Root"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..735a6494a5e038ce6ffb90523b0dd2a820d4ed29 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.mjs @@ -0,0 +1,24 @@ +// src/accessible-icon.tsx +import * as React from "react"; +import * as VisuallyHiddenPrimitive from "@radix-ui/react-visually-hidden"; +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var NAME = "AccessibleIcon"; +var AccessibleIcon = ({ children, label }) => { + const child = React.Children.only(children); + return /* @__PURE__ */ jsxs(Fragment, { children: [ + React.cloneElement(child, { + // accessibility + "aria-hidden": "true", + focusable: "false" + // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable + }), + /* @__PURE__ */ jsx(VisuallyHiddenPrimitive.Root, { children: label }) + ] }); +}; +AccessibleIcon.displayName = NAME; +var Root2 = AccessibleIcon; +export { + AccessibleIcon, + Root2 as Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..41543e2235a38473ec53da099cf42b89477649d6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/accessible-icon.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nconst NAME = 'AccessibleIcon';\n\ninterface AccessibleIconProps {\n children?: React.ReactNode;\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label: string;\n}\n\nconst AccessibleIcon: React.FC = ({ children, label }) => {\n const child = React.Children.only(children);\n return (\n <>\n {React.cloneElement(child as React.ReactElement>, {\n // accessibility\n 'aria-hidden': 'true',\n focusable: 'false', // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable\n })}\n {label}\n \n );\n};\n\nAccessibleIcon.displayName = NAME;\n\nconst Root = AccessibleIcon;\n\nexport {\n AccessibleIcon,\n //\n Root,\n};\nexport type { AccessibleIconProps };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,YAAY,6BAA6B;AAgBrC,mBAME,KANF;AAdJ,IAAM,OAAO;AAWb,IAAM,iBAAgD,CAAC,EAAE,UAAU,MAAM,MAAM;AAC7E,QAAM,QAAc,eAAS,KAAK,QAAQ;AAC1C,SACE,iCACG;AAAA,IAAM,mBAAa,OAA8D;AAAA;AAAA,MAEhF,eAAe;AAAA,MACf,WAAW;AAAA;AAAA,IACb,CAAC;AAAA,IACD,oBAAyB,8BAAxB,EAA8B,iBAAM;AAAA,KACvC;AAEJ;AAEA,eAAe,cAAc;AAE7B,IAAMA,QAAO;", + "names": ["Root"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/package.json new file mode 100644 index 0000000000000000000000000000000000000000..03f8dda0712cf0e7c376b8a0ae10913c52c697c4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accessible-icon/package.json @@ -0,0 +1,68 @@ +{ + "name": "@radix-ui/react-accessible-icon", + "version": "1.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-visually-hidden": "1.2.6" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/accessible-icon" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e5f7dc9cea73a6d8b275baf6413a71075acbc687 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/README.md @@ -0,0 +1,3 @@ +# `react-accordion` + +View docs [here](https://radix-ui.com/primitives/docs/components/accordion). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..76cbbc45958717c9ec72e9bf416e31fe05226d74 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.d.mts @@ -0,0 +1,114 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'; + +type Direction = 'ltr' | 'rtl'; +declare const createAccordionScope: _radix_ui_react_context.CreateScope; +interface AccordionSingleProps extends AccordionImplSingleProps { + type: 'single'; +} +interface AccordionMultipleProps extends AccordionImplMultipleProps { + type: 'multiple'; +} +declare const Accordion: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes>; +interface AccordionImplSingleProps extends AccordionImplProps { + /** + * The controlled stateful value of the accordion item whose content is expanded. + */ + value?: string; + /** + * The value of the item whose content is expanded when the accordion is initially rendered. Use + * `defaultValue` if you do not need to control the state of an accordion. + */ + defaultValue?: string; + /** + * The callback that fires when the state of the accordion changes. + */ + onValueChange?(value: string): void; + /** + * Whether an accordion item can be collapsed after it has been opened. + * @default false + */ + collapsible?: boolean; +} +interface AccordionImplMultipleProps extends AccordionImplProps { + /** + * The controlled stateful value of the accordion items whose contents are expanded. + */ + value?: string[]; + /** + * The value of the items whose contents are expanded when the accordion is initially rendered. Use + * `defaultValue` if you do not need to control the state of an accordion. + */ + defaultValue?: string[]; + /** + * The callback that fires when the state of the accordion changes. + */ + onValueChange?(value: string[]): void; +} +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface AccordionImplProps extends PrimitiveDivProps { + /** + * Whether or not an accordion is disabled from user interaction. + * + * @defaultValue false + */ + disabled?: boolean; + /** + * The layout in which the Accordion operates. + * @default vertical + */ + orientation?: React.AriaAttributes['aria-orientation']; + /** + * The language read direction. + */ + dir?: Direction; +} +type CollapsibleProps = React.ComponentPropsWithoutRef; +interface AccordionItemProps extends Omit { + /** + * Whether or not an accordion item is disabled from user interaction. + * + * @defaultValue false + */ + disabled?: boolean; + /** + * A string value for the accordion item. All items within an accordion should use a unique value. + */ + value: string; +} +/** + * `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`. + */ +declare const AccordionItem: React.ForwardRefExoticComponent>; +type PrimitiveHeading3Props = React.ComponentPropsWithoutRef; +interface AccordionHeaderProps extends PrimitiveHeading3Props { +} +/** + * `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible + * whether or not its content is collapsed. + */ +declare const AccordionHeader: React.ForwardRefExoticComponent>; +type CollapsibleTriggerProps = React.ComponentPropsWithoutRef; +interface AccordionTriggerProps extends CollapsibleTriggerProps { +} +/** + * `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It + * should always be nested inside of an `AccordionHeader`. + */ +declare const AccordionTrigger: React.ForwardRefExoticComponent>; +type CollapsibleContentProps = React.ComponentPropsWithoutRef; +interface AccordionContentProps extends CollapsibleContentProps { +} +/** + * `AccordionContent` contains the collapsible content for an `AccordionItem`. + */ +declare const AccordionContent: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes>; +declare const Item: React.ForwardRefExoticComponent>; +declare const Header: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; + +export { Accordion, AccordionContent, type AccordionContentProps, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionSingleProps, AccordionTrigger, type AccordionTriggerProps, Content, Header, Item, Root, Trigger, createAccordionScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76cbbc45958717c9ec72e9bf416e31fe05226d74 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.d.ts @@ -0,0 +1,114 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'; + +type Direction = 'ltr' | 'rtl'; +declare const createAccordionScope: _radix_ui_react_context.CreateScope; +interface AccordionSingleProps extends AccordionImplSingleProps { + type: 'single'; +} +interface AccordionMultipleProps extends AccordionImplMultipleProps { + type: 'multiple'; +} +declare const Accordion: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes>; +interface AccordionImplSingleProps extends AccordionImplProps { + /** + * The controlled stateful value of the accordion item whose content is expanded. + */ + value?: string; + /** + * The value of the item whose content is expanded when the accordion is initially rendered. Use + * `defaultValue` if you do not need to control the state of an accordion. + */ + defaultValue?: string; + /** + * The callback that fires when the state of the accordion changes. + */ + onValueChange?(value: string): void; + /** + * Whether an accordion item can be collapsed after it has been opened. + * @default false + */ + collapsible?: boolean; +} +interface AccordionImplMultipleProps extends AccordionImplProps { + /** + * The controlled stateful value of the accordion items whose contents are expanded. + */ + value?: string[]; + /** + * The value of the items whose contents are expanded when the accordion is initially rendered. Use + * `defaultValue` if you do not need to control the state of an accordion. + */ + defaultValue?: string[]; + /** + * The callback that fires when the state of the accordion changes. + */ + onValueChange?(value: string[]): void; +} +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface AccordionImplProps extends PrimitiveDivProps { + /** + * Whether or not an accordion is disabled from user interaction. + * + * @defaultValue false + */ + disabled?: boolean; + /** + * The layout in which the Accordion operates. + * @default vertical + */ + orientation?: React.AriaAttributes['aria-orientation']; + /** + * The language read direction. + */ + dir?: Direction; +} +type CollapsibleProps = React.ComponentPropsWithoutRef; +interface AccordionItemProps extends Omit { + /** + * Whether or not an accordion item is disabled from user interaction. + * + * @defaultValue false + */ + disabled?: boolean; + /** + * A string value for the accordion item. All items within an accordion should use a unique value. + */ + value: string; +} +/** + * `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`. + */ +declare const AccordionItem: React.ForwardRefExoticComponent>; +type PrimitiveHeading3Props = React.ComponentPropsWithoutRef; +interface AccordionHeaderProps extends PrimitiveHeading3Props { +} +/** + * `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible + * whether or not its content is collapsed. + */ +declare const AccordionHeader: React.ForwardRefExoticComponent>; +type CollapsibleTriggerProps = React.ComponentPropsWithoutRef; +interface AccordionTriggerProps extends CollapsibleTriggerProps { +} +/** + * `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It + * should always be nested inside of an `AccordionHeader`. + */ +declare const AccordionTrigger: React.ForwardRefExoticComponent>; +type CollapsibleContentProps = React.ComponentPropsWithoutRef; +interface AccordionContentProps extends CollapsibleContentProps { +} +/** + * `AccordionContent` contains the collapsible content for an `AccordionItem`. + */ +declare const AccordionContent: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent<(AccordionSingleProps | AccordionMultipleProps) & React.RefAttributes>; +declare const Item: React.ForwardRefExoticComponent>; +declare const Header: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; + +export { Accordion, AccordionContent, type AccordionContentProps, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionSingleProps, AccordionTrigger, type AccordionTriggerProps, Content, Header, Item, Root, Trigger, createAccordionScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7ab1a7fd0131fa108983c3085ca48c86a46a5dfe --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.js @@ -0,0 +1,352 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Accordion: () => Accordion, + AccordionContent: () => AccordionContent, + AccordionHeader: () => AccordionHeader, + AccordionItem: () => AccordionItem, + AccordionTrigger: () => AccordionTrigger, + Content: () => Content2, + Header: () => Header, + Item: () => Item, + Root: () => Root2, + Trigger: () => Trigger2, + createAccordionScope: () => createAccordionScope +}); +module.exports = __toCommonJS(index_exports); + +// src/accordion.tsx +var React = __toESM(require("react")); +var import_react_context = require("@radix-ui/react-context"); +var import_react_collection = require("@radix-ui/react-collection"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible")); +var import_react_collapsible = require("@radix-ui/react-collapsible"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_jsx_runtime = require("react/jsx-runtime"); +var ACCORDION_NAME = "Accordion"; +var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"]; +var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(ACCORDION_NAME); +var [createAccordionContext, createAccordionScope] = (0, import_react_context.createContextScope)(ACCORDION_NAME, [ + createCollectionScope, + import_react_collapsible.createCollapsibleScope +]); +var useCollapsibleScope = (0, import_react_collapsible.createCollapsibleScope)(); +var Accordion = React.forwardRef( + (props, forwardedRef) => { + const { type, ...accordionProps } = props; + const singleProps = accordionProps; + const multipleProps = accordionProps; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: props.__scopeAccordion, children: type === "multiple" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionImplMultiple, { ...multipleProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionImplSingle, { ...singleProps, ref: forwardedRef }) }); + } +); +Accordion.displayName = ACCORDION_NAME; +var [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME); +var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext( + ACCORDION_NAME, + { collapsible: false } +); +var AccordionImplSingle = React.forwardRef( + (props, forwardedRef) => { + const { + value: valueProp, + defaultValue, + onValueChange = () => { + }, + collapsible = false, + ...accordionSingleProps + } = props; + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + defaultProp: defaultValue ?? "", + onChange: onValueChange, + caller: ACCORDION_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + AccordionValueProvider, + { + scope: props.__scopeAccordion, + value: React.useMemo(() => value ? [value] : [], [value]), + onItemOpen: setValue, + onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) }) + } + ); + } +); +var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => { + const { + value: valueProp, + defaultValue, + onValueChange = () => { + }, + ...accordionMultipleProps + } = props; + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + defaultProp: defaultValue ?? [], + onChange: onValueChange, + caller: ACCORDION_NAME + }); + const handleItemOpen = React.useCallback( + (itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]), + [setValue] + ); + const handleItemClose = React.useCallback( + (itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)), + [setValue] + ); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + AccordionValueProvider, + { + scope: props.__scopeAccordion, + value, + onItemOpen: handleItemOpen, + onItemClose: handleItemClose, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionImpl, { ...accordionMultipleProps, ref: forwardedRef }) }) + } + ); +}); +var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME); +var AccordionImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props; + const accordionRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(accordionRef, forwardedRef); + const getItems = useCollection(__scopeAccordion); + const direction = (0, import_react_direction.useDirection)(dir); + const isDirectionLTR = direction === "ltr"; + const handleKeyDown = (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + if (!ACCORDION_KEYS.includes(event.key)) return; + const target = event.target; + const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled); + const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target); + const triggerCount = triggerCollection.length; + if (triggerIndex === -1) return; + event.preventDefault(); + let nextIndex = triggerIndex; + const homeIndex = 0; + const endIndex = triggerCount - 1; + const moveNext = () => { + nextIndex = triggerIndex + 1; + if (nextIndex > endIndex) { + nextIndex = homeIndex; + } + }; + const movePrev = () => { + nextIndex = triggerIndex - 1; + if (nextIndex < homeIndex) { + nextIndex = endIndex; + } + }; + switch (event.key) { + case "Home": + nextIndex = homeIndex; + break; + case "End": + nextIndex = endIndex; + break; + case "ArrowRight": + if (orientation === "horizontal") { + if (isDirectionLTR) { + moveNext(); + } else { + movePrev(); + } + } + break; + case "ArrowDown": + if (orientation === "vertical") { + moveNext(); + } + break; + case "ArrowLeft": + if (orientation === "horizontal") { + if (isDirectionLTR) { + movePrev(); + } else { + moveNext(); + } + } + break; + case "ArrowUp": + if (orientation === "vertical") { + movePrev(); + } + break; + } + const clampedIndex = nextIndex % triggerCount; + triggerCollection[clampedIndex].ref.current?.focus(); + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + AccordionImplProvider, + { + scope: __scopeAccordion, + disabled, + direction: dir, + orientation, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...accordionProps, + "data-orientation": orientation, + ref: composedRefs, + onKeyDown: disabled ? void 0 : handleKeyDown + } + ) }) + } + ); + } +); +var ITEM_NAME = "AccordionItem"; +var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME); +var AccordionItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, value, ...accordionItemProps } = props; + const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion); + const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion); + const collapsibleScope = useCollapsibleScope(__scopeAccordion); + const triggerId = (0, import_react_id.useId)(); + const open = value && valueContext.value.includes(value) || false; + const disabled = accordionContext.disabled || props.disabled; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + AccordionItemProvider, + { + scope: __scopeAccordion, + open, + disabled, + triggerId, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CollapsiblePrimitive.Root, + { + "data-orientation": accordionContext.orientation, + "data-state": getState(open), + ...collapsibleScope, + ...accordionItemProps, + ref: forwardedRef, + disabled, + open, + onOpenChange: (open2) => { + if (open2) { + valueContext.onItemOpen(value); + } else { + valueContext.onItemClose(value); + } + } + } + ) + } + ); + } +); +AccordionItem.displayName = ITEM_NAME; +var HEADER_NAME = "AccordionHeader"; +var AccordionHeader = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, ...headerProps } = props; + const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion); + const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.h3, + { + "data-orientation": accordionContext.orientation, + "data-state": getState(itemContext.open), + "data-disabled": itemContext.disabled ? "" : void 0, + ...headerProps, + ref: forwardedRef + } + ); + } +); +AccordionHeader.displayName = HEADER_NAME; +var TRIGGER_NAME = "AccordionTrigger"; +var AccordionTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, ...triggerProps } = props; + const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion); + const itemContext = useAccordionItemContext(TRIGGER_NAME, __scopeAccordion); + const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME, __scopeAccordion); + const collapsibleScope = useCollapsibleScope(__scopeAccordion); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, { scope: __scopeAccordion, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CollapsiblePrimitive.Trigger, + { + "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0, + "data-orientation": accordionContext.orientation, + id: itemContext.triggerId, + ...collapsibleScope, + ...triggerProps, + ref: forwardedRef + } + ) }); + } +); +AccordionTrigger.displayName = TRIGGER_NAME; +var CONTENT_NAME = "AccordionContent"; +var AccordionContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, ...contentProps } = props; + const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion); + const itemContext = useAccordionItemContext(CONTENT_NAME, __scopeAccordion); + const collapsibleScope = useCollapsibleScope(__scopeAccordion); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CollapsiblePrimitive.Content, + { + role: "region", + "aria-labelledby": itemContext.triggerId, + "data-orientation": accordionContext.orientation, + ...collapsibleScope, + ...contentProps, + ref: forwardedRef, + style: { + "--radix-accordion-content-height": "var(--radix-collapsible-content-height)", + "--radix-accordion-content-width": "var(--radix-collapsible-content-width)", + ...props.style + } + } + ); + } +); +AccordionContent.displayName = CONTENT_NAME; +function getState(open) { + return open ? "open" : "closed"; +} +var Root2 = Accordion; +var Item = AccordionItem; +var Header = AccordionHeader; +var Trigger2 = AccordionTrigger; +var Content2 = AccordionContent; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e019861b526055a649378ec8fcddacf62a389cf2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/accordion.tsx"], + "sourcesContent": ["'use client';\nexport {\n createAccordionScope,\n //\n Accordion,\n AccordionItem,\n AccordionHeader,\n AccordionTrigger,\n AccordionContent,\n //\n Root,\n Item,\n Header,\n Trigger,\n Content,\n} from './accordion';\nexport type {\n AccordionSingleProps,\n AccordionMultipleProps,\n AccordionItemProps,\n AccordionHeaderProps,\n AccordionTriggerProps,\n AccordionContentProps,\n} from './accordion';\n", "import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport { createCollapsibleScope } from '@radix-ui/react-collapsible';\nimport { useId } from '@radix-ui/react-id';\n\nimport type { Scope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * Accordion\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACCORDION_NAME = 'Accordion';\nconst ACCORDION_KEYS = ['Home', 'End', 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'];\n\nconst [Collection, useCollection, createCollectionScope] =\n createCollection(ACCORDION_NAME);\n\ntype ScopedProps

= P & { __scopeAccordion?: Scope };\nconst [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [\n createCollectionScope,\n createCollapsibleScope,\n]);\nconst useCollapsibleScope = createCollapsibleScope();\n\ntype AccordionElement = AccordionImplMultipleElement | AccordionImplSingleElement;\ninterface AccordionSingleProps extends AccordionImplSingleProps {\n type: 'single';\n}\ninterface AccordionMultipleProps extends AccordionImplMultipleProps {\n type: 'multiple';\n}\n\nconst Accordion = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { type, ...accordionProps } = props;\n const singleProps = accordionProps as AccordionImplSingleProps;\n const multipleProps = accordionProps as AccordionImplMultipleProps;\n return (\n \n {type === 'multiple' ? (\n \n ) : (\n \n )}\n \n );\n },\n);\n\nAccordion.displayName = ACCORDION_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype AccordionValueContextValue = {\n value: string[];\n onItemOpen(value: string): void;\n onItemClose(value: string): void;\n};\n\nconst [AccordionValueProvider, useAccordionValueContext] =\n createAccordionContext(ACCORDION_NAME);\n\nconst [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(\n ACCORDION_NAME,\n { collapsible: false },\n);\n\ntype AccordionImplSingleElement = AccordionImplElement;\ninterface AccordionImplSingleProps extends AccordionImplProps {\n /**\n * The controlled stateful value of the accordion item whose content is expanded.\n */\n value?: string;\n /**\n * The value of the item whose content is expanded when the accordion is initially rendered. Use\n * `defaultValue` if you do not need to control the state of an accordion.\n */\n defaultValue?: string;\n /**\n * The callback that fires when the state of the accordion changes.\n */\n onValueChange?(value: string): void;\n /**\n * Whether an accordion item can be collapsed after it has been opened.\n * @default false\n */\n collapsible?: boolean;\n}\n\nconst AccordionImplSingle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {},\n collapsible = false,\n ...accordionSingleProps\n } = props;\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? '',\n onChange: onValueChange,\n caller: ACCORDION_NAME,\n });\n\n return (\n (value ? [value] : []), [value])}\n onItemOpen={setValue}\n onItemClose={React.useCallback(() => collapsible && setValue(''), [collapsible, setValue])}\n >\n \n \n \n \n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype AccordionImplMultipleElement = AccordionImplElement;\ninterface AccordionImplMultipleProps extends AccordionImplProps {\n /**\n * The controlled stateful value of the accordion items whose contents are expanded.\n */\n value?: string[];\n /**\n * The value of the items whose contents are expanded when the accordion is initially rendered. Use\n * `defaultValue` if you do not need to control the state of an accordion.\n */\n defaultValue?: string[];\n /**\n * The callback that fires when the state of the accordion changes.\n */\n onValueChange?(value: string[]): void;\n}\n\nconst AccordionImplMultiple = React.forwardRef<\n AccordionImplMultipleElement,\n AccordionImplMultipleProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {},\n ...accordionMultipleProps\n } = props;\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? [],\n onChange: onValueChange,\n caller: ACCORDION_NAME,\n });\n\n const handleItemOpen = React.useCallback(\n (itemValue: string) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue],\n );\n\n const handleItemClose = React.useCallback(\n (itemValue: string) =>\n setValue((prevValue = []) => prevValue.filter((value) => value !== itemValue)),\n [setValue],\n );\n\n return (\n \n \n \n \n \n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype AccordionImplContextValue = {\n disabled?: boolean;\n direction: AccordionImplProps['dir'];\n orientation: AccordionImplProps['orientation'];\n};\n\nconst [AccordionImplProvider, useAccordionContext] =\n createAccordionContext(ACCORDION_NAME);\n\ntype AccordionImplElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface AccordionImplProps extends PrimitiveDivProps {\n /**\n * Whether or not an accordion is disabled from user interaction.\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * The layout in which the Accordion operates.\n * @default vertical\n */\n orientation?: React.AriaAttributes['aria-orientation'];\n /**\n * The language read direction.\n */\n dir?: Direction;\n}\n\nconst AccordionImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, disabled, dir, orientation = 'vertical', ...accordionProps } = props;\n const accordionRef = React.useRef(null);\n const composedRefs = useComposedRefs(accordionRef, forwardedRef);\n const getItems = useCollection(__scopeAccordion);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === 'ltr';\n\n const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {\n if (!ACCORDION_KEYS.includes(event.key)) return;\n const target = event.target as HTMLElement;\n const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled);\n const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target);\n const triggerCount = triggerCollection.length;\n\n if (triggerIndex === -1) return;\n\n // Prevents page scroll while user is navigating\n event.preventDefault();\n\n let nextIndex = triggerIndex;\n const homeIndex = 0;\n const endIndex = triggerCount - 1;\n\n const moveNext = () => {\n nextIndex = triggerIndex + 1;\n if (nextIndex > endIndex) {\n nextIndex = homeIndex;\n }\n };\n\n const movePrev = () => {\n nextIndex = triggerIndex - 1;\n if (nextIndex < homeIndex) {\n nextIndex = endIndex;\n }\n };\n\n switch (event.key) {\n case 'Home':\n nextIndex = homeIndex;\n break;\n case 'End':\n nextIndex = endIndex;\n break;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n if (isDirectionLTR) {\n moveNext();\n } else {\n movePrev();\n }\n }\n break;\n case 'ArrowDown':\n if (orientation === 'vertical') {\n moveNext();\n }\n break;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n if (isDirectionLTR) {\n movePrev();\n } else {\n moveNext();\n }\n }\n break;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n movePrev();\n }\n break;\n }\n\n const clampedIndex = nextIndex % triggerCount;\n triggerCollection[clampedIndex]!.ref.current?.focus();\n });\n\n return (\n \n \n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'AccordionItem';\n\ntype AccordionItemContextValue = { open?: boolean; disabled?: boolean; triggerId: string };\nconst [AccordionItemProvider, useAccordionItemContext] =\n createAccordionContext(ITEM_NAME);\n\ntype AccordionItemElement = React.ComponentRef;\ntype CollapsibleProps = React.ComponentPropsWithoutRef;\ninterface AccordionItemProps extends Omit<\n CollapsibleProps,\n 'open' | 'defaultOpen' | 'onOpenChange'\n> {\n /**\n * Whether or not an accordion item is disabled from user interaction.\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * A string value for the accordion item. All items within an accordion should use a unique value.\n */\n value: string;\n}\n\n/**\n * `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`.\n */\nconst AccordionItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, value, ...accordionItemProps } = props;\n const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);\n const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n const triggerId = useId();\n const open = (value && valueContext.value.includes(value)) || false;\n const disabled = accordionContext.disabled || props.disabled;\n\n return (\n \n {\n if (open) {\n valueContext.onItemOpen(value);\n } else {\n valueContext.onItemClose(value);\n }\n }}\n />\n \n );\n },\n);\n\nAccordionItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst HEADER_NAME = 'AccordionHeader';\n\ntype AccordionHeaderElement = React.ComponentRef;\ntype PrimitiveHeading3Props = React.ComponentPropsWithoutRef;\ninterface AccordionHeaderProps extends PrimitiveHeading3Props {}\n\n/**\n * `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible\n * whether or not its content is collapsed.\n */\nconst AccordionHeader = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, ...headerProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);\n return (\n \n );\n },\n);\n\nAccordionHeader.displayName = HEADER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'AccordionTrigger';\n\ntype AccordionTriggerElement = React.ComponentRef;\ntype CollapsibleTriggerProps = React.ComponentPropsWithoutRef;\ninterface AccordionTriggerProps extends CollapsibleTriggerProps {}\n\n/**\n * `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It\n * should always be nested inside of an `AccordionHeader`.\n */\nconst AccordionTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, ...triggerProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(TRIGGER_NAME, __scopeAccordion);\n const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n return (\n \n \n \n );\n },\n);\n\nAccordionTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AccordionContent';\n\ntype AccordionContentElement = React.ComponentRef;\ntype CollapsibleContentProps = React.ComponentPropsWithoutRef;\ninterface AccordionContentProps extends CollapsibleContentProps {}\n\n/**\n * `AccordionContent` contains the collapsible content for an `AccordionItem`.\n */\nconst AccordionContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, ...contentProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(CONTENT_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n return (\n \n );\n },\n);\n\nAccordionContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open?: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Accordion;\nconst Item = AccordionItem;\nconst Header = AccordionHeader;\nconst Trigger = AccordionTrigger;\nconst Content = AccordionContent;\n\nexport {\n createAccordionScope,\n //\n Accordion,\n AccordionItem,\n AccordionHeader,\n AccordionTrigger,\n AccordionContent,\n //\n Root,\n Item,\n Header,\n Trigger,\n Content,\n};\nexport type {\n AccordionSingleProps,\n AccordionMultipleProps,\n AccordionItemProps,\n AccordionHeaderProps,\n AccordionTriggerProps,\n AccordionContentProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,2BAAmC;AACnC,8BAAiC;AACjC,gCAAgC;AAChC,uBAAqC;AACrC,0CAAqC;AACrC,6BAA0B;AAC1B,2BAAsC;AACtC,+BAAuC;AACvC,sBAAsB;AAGtB,6BAA6B;AAqCnB;AA7BV,IAAM,iBAAiB;AACvB,IAAM,iBAAiB,CAAC,QAAQ,OAAO,aAAa,WAAW,aAAa,YAAY;AAExF,IAAM,CAAC,YAAY,eAAe,qBAAqB,QACrD,0CAA0C,cAAc;AAG1D,IAAM,CAAC,wBAAwB,oBAAoB,QAAI,yCAAmB,gBAAgB;AAAA,EACxF;AAAA,EACA;AACF,CAAC;AACD,IAAM,0BAAsB,iDAAuB;AAUnD,IAAM,YAAkB;AAAA,EACtB,CAAC,OAAmE,iBAAiB;AACnF,UAAM,EAAE,MAAM,GAAG,eAAe,IAAI;AACpC,UAAM,cAAc;AACpB,UAAM,gBAAgB;AACtB,WACE,4CAAC,WAAW,UAAX,EAAoB,OAAO,MAAM,kBAC/B,mBAAS,aACR,4CAAC,yBAAuB,GAAG,eAAe,KAAK,cAAc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/B,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,IAAMC,QAAO;AACb,IAAM,OAAO;AACb,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,WAAU;", + "names": ["Content", "Root", "Trigger", "value", "open", "Root", "Trigger", "Content"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..06e730e399bdc5800ffd0cffd6bdd1fc3e6cd58b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.mjs @@ -0,0 +1,320 @@ +"use client"; + +// src/accordion.tsx +import * as React from "react"; +import { createContextScope } from "@radix-ui/react-context"; +import { createCollection } from "@radix-ui/react-collection"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { Primitive } from "@radix-ui/react-primitive"; +import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"; +import { createCollapsibleScope } from "@radix-ui/react-collapsible"; +import { useId } from "@radix-ui/react-id"; +import { useDirection } from "@radix-ui/react-direction"; +import { jsx } from "react/jsx-runtime"; +var ACCORDION_NAME = "Accordion"; +var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"]; +var [Collection, useCollection, createCollectionScope] = createCollection(ACCORDION_NAME); +var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [ + createCollectionScope, + createCollapsibleScope +]); +var useCollapsibleScope = createCollapsibleScope(); +var Accordion = React.forwardRef( + (props, forwardedRef) => { + const { type, ...accordionProps } = props; + const singleProps = accordionProps; + const multipleProps = accordionProps; + return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeAccordion, children: type === "multiple" ? /* @__PURE__ */ jsx(AccordionImplMultiple, { ...multipleProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(AccordionImplSingle, { ...singleProps, ref: forwardedRef }) }); + } +); +Accordion.displayName = ACCORDION_NAME; +var [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME); +var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext( + ACCORDION_NAME, + { collapsible: false } +); +var AccordionImplSingle = React.forwardRef( + (props, forwardedRef) => { + const { + value: valueProp, + defaultValue, + onValueChange = () => { + }, + collapsible = false, + ...accordionSingleProps + } = props; + const [value, setValue] = useControllableState({ + prop: valueProp, + defaultProp: defaultValue ?? "", + onChange: onValueChange, + caller: ACCORDION_NAME + }); + return /* @__PURE__ */ jsx( + AccordionValueProvider, + { + scope: props.__scopeAccordion, + value: React.useMemo(() => value ? [value] : [], [value]), + onItemOpen: setValue, + onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]), + children: /* @__PURE__ */ jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) }) + } + ); + } +); +var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => { + const { + value: valueProp, + defaultValue, + onValueChange = () => { + }, + ...accordionMultipleProps + } = props; + const [value, setValue] = useControllableState({ + prop: valueProp, + defaultProp: defaultValue ?? [], + onChange: onValueChange, + caller: ACCORDION_NAME + }); + const handleItemOpen = React.useCallback( + (itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]), + [setValue] + ); + const handleItemClose = React.useCallback( + (itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)), + [setValue] + ); + return /* @__PURE__ */ jsx( + AccordionValueProvider, + { + scope: props.__scopeAccordion, + value, + onItemOpen: handleItemOpen, + onItemClose: handleItemClose, + children: /* @__PURE__ */ jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: true, children: /* @__PURE__ */ jsx(AccordionImpl, { ...accordionMultipleProps, ref: forwardedRef }) }) + } + ); +}); +var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME); +var AccordionImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props; + const accordionRef = React.useRef(null); + const composedRefs = useComposedRefs(accordionRef, forwardedRef); + const getItems = useCollection(__scopeAccordion); + const direction = useDirection(dir); + const isDirectionLTR = direction === "ltr"; + const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => { + if (!ACCORDION_KEYS.includes(event.key)) return; + const target = event.target; + const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled); + const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target); + const triggerCount = triggerCollection.length; + if (triggerIndex === -1) return; + event.preventDefault(); + let nextIndex = triggerIndex; + const homeIndex = 0; + const endIndex = triggerCount - 1; + const moveNext = () => { + nextIndex = triggerIndex + 1; + if (nextIndex > endIndex) { + nextIndex = homeIndex; + } + }; + const movePrev = () => { + nextIndex = triggerIndex - 1; + if (nextIndex < homeIndex) { + nextIndex = endIndex; + } + }; + switch (event.key) { + case "Home": + nextIndex = homeIndex; + break; + case "End": + nextIndex = endIndex; + break; + case "ArrowRight": + if (orientation === "horizontal") { + if (isDirectionLTR) { + moveNext(); + } else { + movePrev(); + } + } + break; + case "ArrowDown": + if (orientation === "vertical") { + moveNext(); + } + break; + case "ArrowLeft": + if (orientation === "horizontal") { + if (isDirectionLTR) { + movePrev(); + } else { + moveNext(); + } + } + break; + case "ArrowUp": + if (orientation === "vertical") { + movePrev(); + } + break; + } + const clampedIndex = nextIndex % triggerCount; + triggerCollection[clampedIndex].ref.current?.focus(); + }); + return /* @__PURE__ */ jsx( + AccordionImplProvider, + { + scope: __scopeAccordion, + disabled, + direction: dir, + orientation, + children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx( + Primitive.div, + { + ...accordionProps, + "data-orientation": orientation, + ref: composedRefs, + onKeyDown: disabled ? void 0 : handleKeyDown + } + ) }) + } + ); + } +); +var ITEM_NAME = "AccordionItem"; +var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME); +var AccordionItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, value, ...accordionItemProps } = props; + const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion); + const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion); + const collapsibleScope = useCollapsibleScope(__scopeAccordion); + const triggerId = useId(); + const open = value && valueContext.value.includes(value) || false; + const disabled = accordionContext.disabled || props.disabled; + return /* @__PURE__ */ jsx( + AccordionItemProvider, + { + scope: __scopeAccordion, + open, + disabled, + triggerId, + children: /* @__PURE__ */ jsx( + CollapsiblePrimitive.Root, + { + "data-orientation": accordionContext.orientation, + "data-state": getState(open), + ...collapsibleScope, + ...accordionItemProps, + ref: forwardedRef, + disabled, + open, + onOpenChange: (open2) => { + if (open2) { + valueContext.onItemOpen(value); + } else { + valueContext.onItemClose(value); + } + } + } + ) + } + ); + } +); +AccordionItem.displayName = ITEM_NAME; +var HEADER_NAME = "AccordionHeader"; +var AccordionHeader = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, ...headerProps } = props; + const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion); + const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion); + return /* @__PURE__ */ jsx( + Primitive.h3, + { + "data-orientation": accordionContext.orientation, + "data-state": getState(itemContext.open), + "data-disabled": itemContext.disabled ? "" : void 0, + ...headerProps, + ref: forwardedRef + } + ); + } +); +AccordionHeader.displayName = HEADER_NAME; +var TRIGGER_NAME = "AccordionTrigger"; +var AccordionTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, ...triggerProps } = props; + const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion); + const itemContext = useAccordionItemContext(TRIGGER_NAME, __scopeAccordion); + const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME, __scopeAccordion); + const collapsibleScope = useCollapsibleScope(__scopeAccordion); + return /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx( + CollapsiblePrimitive.Trigger, + { + "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0, + "data-orientation": accordionContext.orientation, + id: itemContext.triggerId, + ...collapsibleScope, + ...triggerProps, + ref: forwardedRef + } + ) }); + } +); +AccordionTrigger.displayName = TRIGGER_NAME; +var CONTENT_NAME = "AccordionContent"; +var AccordionContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAccordion, ...contentProps } = props; + const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion); + const itemContext = useAccordionItemContext(CONTENT_NAME, __scopeAccordion); + const collapsibleScope = useCollapsibleScope(__scopeAccordion); + return /* @__PURE__ */ jsx( + CollapsiblePrimitive.Content, + { + role: "region", + "aria-labelledby": itemContext.triggerId, + "data-orientation": accordionContext.orientation, + ...collapsibleScope, + ...contentProps, + ref: forwardedRef, + style: { + "--radix-accordion-content-height": "var(--radix-collapsible-content-height)", + "--radix-accordion-content-width": "var(--radix-collapsible-content-width)", + ...props.style + } + } + ); + } +); +AccordionContent.displayName = CONTENT_NAME; +function getState(open) { + return open ? "open" : "closed"; +} +var Root2 = Accordion; +var Item = AccordionItem; +var Header = AccordionHeader; +var Trigger2 = AccordionTrigger; +var Content2 = AccordionContent; +export { + Accordion, + AccordionContent, + AccordionHeader, + AccordionItem, + AccordionTrigger, + Content2 as Content, + Header, + Item, + Root2 as Root, + Trigger2 as Trigger, + createAccordionScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..8e7f00a04751e49880b190bdd35805bacc56c7c6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/accordion.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport { createCollapsibleScope } from '@radix-ui/react-collapsible';\nimport { useId } from '@radix-ui/react-id';\n\nimport type { Scope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * Accordion\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACCORDION_NAME = 'Accordion';\nconst ACCORDION_KEYS = ['Home', 'End', 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'];\n\nconst [Collection, useCollection, createCollectionScope] =\n createCollection(ACCORDION_NAME);\n\ntype ScopedProps

= P & { __scopeAccordion?: Scope };\nconst [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [\n createCollectionScope,\n createCollapsibleScope,\n]);\nconst useCollapsibleScope = createCollapsibleScope();\n\ntype AccordionElement = AccordionImplMultipleElement | AccordionImplSingleElement;\ninterface AccordionSingleProps extends AccordionImplSingleProps {\n type: 'single';\n}\ninterface AccordionMultipleProps extends AccordionImplMultipleProps {\n type: 'multiple';\n}\n\nconst Accordion = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { type, ...accordionProps } = props;\n const singleProps = accordionProps as AccordionImplSingleProps;\n const multipleProps = accordionProps as AccordionImplMultipleProps;\n return (\n \n {type === 'multiple' ? (\n \n ) : (\n \n )}\n \n );\n },\n);\n\nAccordion.displayName = ACCORDION_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype AccordionValueContextValue = {\n value: string[];\n onItemOpen(value: string): void;\n onItemClose(value: string): void;\n};\n\nconst [AccordionValueProvider, useAccordionValueContext] =\n createAccordionContext(ACCORDION_NAME);\n\nconst [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(\n ACCORDION_NAME,\n { collapsible: false },\n);\n\ntype AccordionImplSingleElement = AccordionImplElement;\ninterface AccordionImplSingleProps extends AccordionImplProps {\n /**\n * The controlled stateful value of the accordion item whose content is expanded.\n */\n value?: string;\n /**\n * The value of the item whose content is expanded when the accordion is initially rendered. Use\n * `defaultValue` if you do not need to control the state of an accordion.\n */\n defaultValue?: string;\n /**\n * The callback that fires when the state of the accordion changes.\n */\n onValueChange?(value: string): void;\n /**\n * Whether an accordion item can be collapsed after it has been opened.\n * @default false\n */\n collapsible?: boolean;\n}\n\nconst AccordionImplSingle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {},\n collapsible = false,\n ...accordionSingleProps\n } = props;\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? '',\n onChange: onValueChange,\n caller: ACCORDION_NAME,\n });\n\n return (\n (value ? [value] : []), [value])}\n onItemOpen={setValue}\n onItemClose={React.useCallback(() => collapsible && setValue(''), [collapsible, setValue])}\n >\n \n \n \n \n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype AccordionImplMultipleElement = AccordionImplElement;\ninterface AccordionImplMultipleProps extends AccordionImplProps {\n /**\n * The controlled stateful value of the accordion items whose contents are expanded.\n */\n value?: string[];\n /**\n * The value of the items whose contents are expanded when the accordion is initially rendered. Use\n * `defaultValue` if you do not need to control the state of an accordion.\n */\n defaultValue?: string[];\n /**\n * The callback that fires when the state of the accordion changes.\n */\n onValueChange?(value: string[]): void;\n}\n\nconst AccordionImplMultiple = React.forwardRef<\n AccordionImplMultipleElement,\n AccordionImplMultipleProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {},\n ...accordionMultipleProps\n } = props;\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? [],\n onChange: onValueChange,\n caller: ACCORDION_NAME,\n });\n\n const handleItemOpen = React.useCallback(\n (itemValue: string) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue],\n );\n\n const handleItemClose = React.useCallback(\n (itemValue: string) =>\n setValue((prevValue = []) => prevValue.filter((value) => value !== itemValue)),\n [setValue],\n );\n\n return (\n \n \n \n \n \n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype AccordionImplContextValue = {\n disabled?: boolean;\n direction: AccordionImplProps['dir'];\n orientation: AccordionImplProps['orientation'];\n};\n\nconst [AccordionImplProvider, useAccordionContext] =\n createAccordionContext(ACCORDION_NAME);\n\ntype AccordionImplElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface AccordionImplProps extends PrimitiveDivProps {\n /**\n * Whether or not an accordion is disabled from user interaction.\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * The layout in which the Accordion operates.\n * @default vertical\n */\n orientation?: React.AriaAttributes['aria-orientation'];\n /**\n * The language read direction.\n */\n dir?: Direction;\n}\n\nconst AccordionImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, disabled, dir, orientation = 'vertical', ...accordionProps } = props;\n const accordionRef = React.useRef(null);\n const composedRefs = useComposedRefs(accordionRef, forwardedRef);\n const getItems = useCollection(__scopeAccordion);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === 'ltr';\n\n const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {\n if (!ACCORDION_KEYS.includes(event.key)) return;\n const target = event.target as HTMLElement;\n const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled);\n const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target);\n const triggerCount = triggerCollection.length;\n\n if (triggerIndex === -1) return;\n\n // Prevents page scroll while user is navigating\n event.preventDefault();\n\n let nextIndex = triggerIndex;\n const homeIndex = 0;\n const endIndex = triggerCount - 1;\n\n const moveNext = () => {\n nextIndex = triggerIndex + 1;\n if (nextIndex > endIndex) {\n nextIndex = homeIndex;\n }\n };\n\n const movePrev = () => {\n nextIndex = triggerIndex - 1;\n if (nextIndex < homeIndex) {\n nextIndex = endIndex;\n }\n };\n\n switch (event.key) {\n case 'Home':\n nextIndex = homeIndex;\n break;\n case 'End':\n nextIndex = endIndex;\n break;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n if (isDirectionLTR) {\n moveNext();\n } else {\n movePrev();\n }\n }\n break;\n case 'ArrowDown':\n if (orientation === 'vertical') {\n moveNext();\n }\n break;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n if (isDirectionLTR) {\n movePrev();\n } else {\n moveNext();\n }\n }\n break;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n movePrev();\n }\n break;\n }\n\n const clampedIndex = nextIndex % triggerCount;\n triggerCollection[clampedIndex]!.ref.current?.focus();\n });\n\n return (\n \n \n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'AccordionItem';\n\ntype AccordionItemContextValue = { open?: boolean; disabled?: boolean; triggerId: string };\nconst [AccordionItemProvider, useAccordionItemContext] =\n createAccordionContext(ITEM_NAME);\n\ntype AccordionItemElement = React.ComponentRef;\ntype CollapsibleProps = React.ComponentPropsWithoutRef;\ninterface AccordionItemProps extends Omit<\n CollapsibleProps,\n 'open' | 'defaultOpen' | 'onOpenChange'\n> {\n /**\n * Whether or not an accordion item is disabled from user interaction.\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * A string value for the accordion item. All items within an accordion should use a unique value.\n */\n value: string;\n}\n\n/**\n * `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`.\n */\nconst AccordionItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, value, ...accordionItemProps } = props;\n const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);\n const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n const triggerId = useId();\n const open = (value && valueContext.value.includes(value)) || false;\n const disabled = accordionContext.disabled || props.disabled;\n\n return (\n \n {\n if (open) {\n valueContext.onItemOpen(value);\n } else {\n valueContext.onItemClose(value);\n }\n }}\n />\n \n );\n },\n);\n\nAccordionItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst HEADER_NAME = 'AccordionHeader';\n\ntype AccordionHeaderElement = React.ComponentRef;\ntype PrimitiveHeading3Props = React.ComponentPropsWithoutRef;\ninterface AccordionHeaderProps extends PrimitiveHeading3Props {}\n\n/**\n * `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible\n * whether or not its content is collapsed.\n */\nconst AccordionHeader = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, ...headerProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);\n return (\n \n );\n },\n);\n\nAccordionHeader.displayName = HEADER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'AccordionTrigger';\n\ntype AccordionTriggerElement = React.ComponentRef;\ntype CollapsibleTriggerProps = React.ComponentPropsWithoutRef;\ninterface AccordionTriggerProps extends CollapsibleTriggerProps {}\n\n/**\n * `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It\n * should always be nested inside of an `AccordionHeader`.\n */\nconst AccordionTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, ...triggerProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(TRIGGER_NAME, __scopeAccordion);\n const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n return (\n \n \n \n );\n },\n);\n\nAccordionTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AccordionContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AccordionContent';\n\ntype AccordionContentElement = React.ComponentRef;\ntype CollapsibleContentProps = React.ComponentPropsWithoutRef;\ninterface AccordionContentProps extends CollapsibleContentProps {}\n\n/**\n * `AccordionContent` contains the collapsible content for an `AccordionItem`.\n */\nconst AccordionContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAccordion, ...contentProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(CONTENT_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n return (\n \n );\n },\n);\n\nAccordionContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open?: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Accordion;\nconst Item = AccordionItem;\nconst Header = AccordionHeader;\nconst Trigger = AccordionTrigger;\nconst Content = AccordionContent;\n\nexport {\n createAccordionScope,\n //\n Accordion,\n AccordionItem,\n AccordionHeader,\n AccordionTrigger,\n AccordionContent,\n //\n Root,\n Item,\n Header,\n Trigger,\n Content,\n};\nexport type {\n AccordionSingleProps,\n AccordionMultipleProps,\n AccordionItemProps,\n AccordionHeaderProps,\n AccordionTriggerProps,\n AccordionContentProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,u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G;AAAA,QACH,GAAG;AAAA,QACJ,KAAK;AAAA;AAAA,IACP,GACF;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAM/B,IAAM,eAAe;AASrB,IAAM,mBAAyB;AAAA,EAC7B,CAAC,OAA2C,iBAAiB;AAC3D,UAAM,EAAE,kBAAkB,GAAG,aAAa,IAAI;AAC9C,UAAM,mBAAmB,oBAAoB,gBAAgB,gBAAgB;AAC7E,UAAM,cAAc,wBAAwB,cAAc,gBAAgB;AAC1E,UAAM,mBAAmB,oBAAoB,gBAAgB;AAC7D,WACE;AAAA,MAAsB;AAAA,MAArB;AAAA,QACC,MAAK;AAAA,QACL,mBAAiB,YAAY;AAAA,QAC7B,oBAAkB,iBAAiB;AAAA,QAClC,GAAG;AAAA,QACH,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,OAAO;AAAA,UACL,oCAAoC;AAAA,UACpC,mCAAmC;AAAA,UACnC,GAAG,MAAM;AAAA,QACX;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAI/B,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,IAAMC,QAAO;AACb,IAAM,OAAO;AACb,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,WAAU;", + "names": ["value", "open", "Root", "Trigger", "Content"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b26b2e6929163c51a50101fc987bb5dd1febb539 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-accordion/package.json @@ -0,0 +1,76 @@ +{ + "name": "@radix-ui/react-accordion", + "version": "1.2.14", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-collapsible": "1.1.14", + "@radix-ui/react-collection": "1.1.10", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-controllable-state": "1.2.3" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/accordion" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/README.md new file mode 100644 index 0000000000000000000000000000000000000000..819c90d63ad7e51054834114a6b7a6d13af1c2a2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/README.md @@ -0,0 +1,3 @@ +# `react-alert-dialog` + +View docs [here](https://radix-ui.com/primitives/docs/components/alert-dialog). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..048750913c2e0d99411a6229e52a12a5755bd802 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.d.mts @@ -0,0 +1,51 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import * as DialogPrimitive from '@radix-ui/react-dialog'; + +declare const createAlertDialogScope: _radix_ui_react_context.CreateScope; +type DialogProps = React.ComponentPropsWithoutRef; +interface AlertDialogProps extends Omit { +} +declare const AlertDialog: React.FC; +type DialogTriggerProps = React.ComponentPropsWithoutRef; +interface AlertDialogTriggerProps extends DialogTriggerProps { +} +declare const AlertDialogTrigger: React.ForwardRefExoticComponent>; +type DialogPortalProps = React.ComponentPropsWithoutRef; +interface AlertDialogPortalProps extends DialogPortalProps { +} +declare const AlertDialogPortal: React.FC; +type DialogOverlayProps = React.ComponentPropsWithoutRef; +interface AlertDialogOverlayProps extends DialogOverlayProps { +} +declare const AlertDialogOverlay: React.ForwardRefExoticComponent>; +type DialogContentProps = React.ComponentPropsWithoutRef; +interface AlertDialogContentProps extends Omit { +} +declare const AlertDialogContent: React.ForwardRefExoticComponent>; +type DialogTitleProps = React.ComponentPropsWithoutRef; +interface AlertDialogTitleProps extends DialogTitleProps { +} +declare const AlertDialogTitle: React.ForwardRefExoticComponent>; +type DialogDescriptionProps = React.ComponentPropsWithoutRef; +interface AlertDialogDescriptionProps extends DialogDescriptionProps { +} +declare const AlertDialogDescription: React.ForwardRefExoticComponent>; +type DialogCloseProps = React.ComponentPropsWithoutRef; +interface AlertDialogActionProps extends DialogCloseProps { +} +declare const AlertDialogAction: React.ForwardRefExoticComponent>; +interface AlertDialogCancelProps extends DialogCloseProps { +} +declare const AlertDialogCancel: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Overlay: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Action: React.ForwardRefExoticComponent>; +declare const Cancel: React.ForwardRefExoticComponent>; +declare const Title: React.ForwardRefExoticComponent>; +declare const Description: React.ForwardRefExoticComponent>; + +export { Action, AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, type AlertDialogPortalProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, Cancel, Content, Description, Overlay, Portal, Root, Title, Trigger, createAlertDialogScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..048750913c2e0d99411a6229e52a12a5755bd802 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.d.ts @@ -0,0 +1,51 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import * as DialogPrimitive from '@radix-ui/react-dialog'; + +declare const createAlertDialogScope: _radix_ui_react_context.CreateScope; +type DialogProps = React.ComponentPropsWithoutRef; +interface AlertDialogProps extends Omit { +} +declare const AlertDialog: React.FC; +type DialogTriggerProps = React.ComponentPropsWithoutRef; +interface AlertDialogTriggerProps extends DialogTriggerProps { +} +declare const AlertDialogTrigger: React.ForwardRefExoticComponent>; +type DialogPortalProps = React.ComponentPropsWithoutRef; +interface AlertDialogPortalProps extends DialogPortalProps { +} +declare const AlertDialogPortal: React.FC; +type DialogOverlayProps = React.ComponentPropsWithoutRef; +interface AlertDialogOverlayProps extends DialogOverlayProps { +} +declare const AlertDialogOverlay: React.ForwardRefExoticComponent>; +type DialogContentProps = React.ComponentPropsWithoutRef; +interface AlertDialogContentProps extends Omit { +} +declare const AlertDialogContent: React.ForwardRefExoticComponent>; +type DialogTitleProps = React.ComponentPropsWithoutRef; +interface AlertDialogTitleProps extends DialogTitleProps { +} +declare const AlertDialogTitle: React.ForwardRefExoticComponent>; +type DialogDescriptionProps = React.ComponentPropsWithoutRef; +interface AlertDialogDescriptionProps extends DialogDescriptionProps { +} +declare const AlertDialogDescription: React.ForwardRefExoticComponent>; +type DialogCloseProps = React.ComponentPropsWithoutRef; +interface AlertDialogActionProps extends DialogCloseProps { +} +declare const AlertDialogAction: React.ForwardRefExoticComponent>; +interface AlertDialogCancelProps extends DialogCloseProps { +} +declare const AlertDialogCancel: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Overlay: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Action: React.ForwardRefExoticComponent>; +declare const Cancel: React.ForwardRefExoticComponent>; +declare const Title: React.ForwardRefExoticComponent>; +declare const Description: React.ForwardRefExoticComponent>; + +export { Action, AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, type AlertDialogPortalProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, Cancel, Content, Description, Overlay, Portal, Root, Title, Trigger, createAlertDialogScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..abd6225a768cdd6b0c24d4f827f0963119778b5b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.js @@ -0,0 +1,173 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Action: () => Action, + AlertDialog: () => AlertDialog, + AlertDialogAction: () => AlertDialogAction, + AlertDialogCancel: () => AlertDialogCancel, + AlertDialogContent: () => AlertDialogContent, + AlertDialogDescription: () => AlertDialogDescription, + AlertDialogOverlay: () => AlertDialogOverlay, + AlertDialogPortal: () => AlertDialogPortal, + AlertDialogTitle: () => AlertDialogTitle, + AlertDialogTrigger: () => AlertDialogTrigger, + Cancel: () => Cancel, + Content: () => Content2, + Description: () => Description2, + Overlay: () => Overlay2, + Portal: () => Portal2, + Root: () => Root2, + Title: () => Title2, + Trigger: () => Trigger2, + createAlertDialogScope: () => createAlertDialogScope +}); +module.exports = __toCommonJS(index_exports); + +// src/alert-dialog.tsx +var React = __toESM(require("react")); +var import_react_context = require("@radix-ui/react-context"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var DialogPrimitive = __toESM(require("@radix-ui/react-dialog")); +var import_react_dialog = require("@radix-ui/react-dialog"); +var import_primitive = require("@radix-ui/primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var ROOT_NAME = "AlertDialog"; +var [createAlertDialogContext, createAlertDialogScope] = (0, import_react_context.createContextScope)(ROOT_NAME, [ + import_react_dialog.createDialogScope +]); +var useDialogScope = (0, import_react_dialog.createDialogScope)(); +var AlertDialog = (props) => { + const { __scopeAlertDialog, ...alertDialogProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true }); +}; +AlertDialog.displayName = ROOT_NAME; +var TRIGGER_NAME = "AlertDialogTrigger"; +var AlertDialogTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...triggerProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef }); + } +); +AlertDialogTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "AlertDialogPortal"; +var AlertDialogPortal = (props) => { + const { __scopeAlertDialog, ...portalProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Portal, { ...dialogScope, ...portalProps }); +}; +AlertDialogPortal.displayName = PORTAL_NAME; +var OVERLAY_NAME = "AlertDialogOverlay"; +var AlertDialogOverlay = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...overlayProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef }); + } +); +AlertDialogOverlay.displayName = OVERLAY_NAME; +var CONTENT_NAME = "AlertDialogContent"; +var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME); +var AlertDialogContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, children, ...contentProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + const contentRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef); + const cancelRef = React.useRef(null); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogPrimitive.Content, + { + role: "alertdialog", + ...dialogScope, + ...contentProps, + ref: composedRefs, + onOpenAutoFocus: (0, import_primitive.composeEventHandlers)(contentProps.onOpenAutoFocus, (event) => { + event.preventDefault(); + cancelRef.current?.focus({ preventScroll: true }); + }), + onPointerDownOutside: (event) => event.preventDefault(), + onInteractOutside: (event) => event.preventDefault(), + children + } + ) }); + } +); +AlertDialogContent.displayName = CONTENT_NAME; +var TITLE_NAME = "AlertDialogTitle"; +var AlertDialogTitle = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...titleProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef }); + } +); +AlertDialogTitle.displayName = TITLE_NAME; +var DESCRIPTION_NAME = "AlertDialogDescription"; +var AlertDialogDescription = React.forwardRef((props, forwardedRef) => { + const { __scopeAlertDialog, ...descriptionProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef }); +}); +AlertDialogDescription.displayName = DESCRIPTION_NAME; +var ACTION_NAME = "AlertDialogAction"; +var AlertDialogAction = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...actionProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef }); + } +); +AlertDialogAction.displayName = ACTION_NAME; +var CANCEL_NAME = "AlertDialogCancel"; +var AlertDialogCancel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...cancelProps } = props; + const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog); + const dialogScope = useDialogScope(__scopeAlertDialog); + const ref = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, cancelRef); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref }); + } +); +AlertDialogCancel.displayName = CANCEL_NAME; +var Root2 = AlertDialog; +var Trigger2 = AlertDialogTrigger; +var Portal2 = AlertDialogPortal; +var Overlay2 = AlertDialogOverlay; +var Content2 = AlertDialogContent; +var Action = AlertDialogAction; +var Cancel = AlertDialogCancel; +var Title2 = AlertDialogTitle; +var Description2 = AlertDialogDescription; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1e9c59a5328772dc587add607fdfb5fd4d122f6c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/alert-dialog.tsx"], + "sourcesContent": ["'use client';\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n} from './alert-dialog';\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n} from './alert-dialog';\n", "import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { createDialogScope } from '@radix-ui/react-dialog';\nimport { composeEventHandlers } from '@radix-ui/primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_NAME = 'AlertDialog';\n\ntype ScopedProps

= P & { __scopeAlertDialog?: Scope };\nconst [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope,\n]);\nconst useDialogScope = createDialogScope();\n\ntype DialogProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogProps extends Omit {}\n\nconst AlertDialog: React.FC = (props: ScopedProps) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n};\n\nAlertDialog.displayName = ROOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst TRIGGER_NAME = 'AlertDialogTrigger';\n\ntype AlertDialogTriggerElement = React.ComponentRef;\ntype DialogTriggerProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst AlertDialogTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'AlertDialogPortal';\n\ntype DialogPortalProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogPortalProps extends DialogPortalProps {}\n\nconst AlertDialogPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n};\n\nAlertDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'AlertDialogOverlay';\n\ntype AlertDialogOverlayElement = React.ComponentRef;\ntype DialogOverlayProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogOverlay.displayName = OVERLAY_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AlertDialogContent';\n\ntype AlertDialogContentContextValue = {\n cancelRef: React.MutableRefObject;\n};\n\nconst [AlertDialogContentProvider, useAlertDialogContentContext] =\n createAlertDialogContext(CONTENT_NAME);\n\ntype AlertDialogContentElement = React.ComponentRef;\ntype DialogContentProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogContentProps extends Omit<\n DialogContentProps,\n 'onPointerDownOutside' | 'onInteractOutside'\n> {}\n\nconst AlertDialogContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n\n return (\n \n {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n })}\n onPointerDownOutside={(event) => event.preventDefault()}\n onInteractOutside={(event) => event.preventDefault()}\n >\n {children}\n \n \n );\n },\n);\n\nAlertDialogContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'AlertDialogTitle';\n\ntype AlertDialogTitleElement = React.ComponentRef;\ntype DialogTitleProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogTitleProps extends DialogTitleProps {}\n\nconst AlertDialogTitle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'AlertDialogDescription';\n\ntype AlertDialogDescriptionElement = React.ComponentRef;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogDescriptionProps extends DialogDescriptionProps {}\n\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n});\n\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'AlertDialogAction';\n\ntype AlertDialogActionElement = React.ComponentRef;\ntype DialogCloseProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogActionProps extends DialogCloseProps {}\n\nconst AlertDialogAction = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogAction.displayName = ACTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogCancel\n * -----------------------------------------------------------------------------------------------*/\n\nconst CANCEL_NAME = 'AlertDialogCancel';\n\ntype AlertDialogCancelElement = React.ComponentRef;\ninterface AlertDialogCancelProps extends DialogCloseProps {}\n\nconst AlertDialogCancel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return ;\n },\n);\n\nAlertDialogCancel.displayName = CANCEL_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = AlertDialog;\nconst Trigger = AlertDialogTrigger;\nconst Portal = AlertDialogPortal;\nconst Overlay = AlertDialogOverlay;\nconst Content = AlertDialogContent;\nconst Action = AlertDialogAction;\nconst Cancel = AlertDialogCancel;\nconst Title = AlertDialogTitle;\nconst Description = AlertDialogDescription;\n\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n};\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA,mBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,cAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,2BAAmC;AACnC,gCAAgC;AAChC,sBAAiC;AACjC,0BAAkC;AAClC,uBAAqC;AAsB5B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,EAAE,oBAAoB,GAAG,YAAY,IAAI;AAC/C,UAAM,cAAc,eAAe,kBAAkB;AACrD,WAAO,4CAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,aAAa,KAAK,cAAc;AAAA,EACrF;AACF;AAEA,kBAAkB,cAAc;AAMhC,IAAM,cAAc;AAKpB,IAAM,oBAA0B;AAAA,EAC9B,CAAC,OAA4C,iBAAiB;AAC5D,UAAM,EAAE,oBAAoB,GAAG,YAAY,IAAI;AAC/C,UAAM,EAAE,UAAU,IAAI,6BAA6B,aAAa,kBAAkB;AAClF,UAAM,cAAc,eAAe,kBAAkB;AACrD,UAAM,UAAM,2CAAgB,cAAc,SAAS;AACnD,WAAO,4CAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,aAAa,KAAU;AAAA,EAC5E;AACF;AAEA,kBAAkB,cAAc;AAIhC,IAAMC,QAAO;AACb,IAAMC,WAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,WAAU;AAChB,IAAM,SAAS;AACf,IAAM,SAAS;AACf,IAAMC,SAAQ;AACd,IAAMC,eAAc;", + "names": ["Content", "Description", "Overlay", "Portal", "Root", "Title", "Trigger", "Root", "Trigger", "Portal", "Overlay", "Content", "Title", "Description"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6ed545a1768e6a4ad5366e0169c8d3e0eae19629 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs @@ -0,0 +1,141 @@ +"use client"; + +// src/alert-dialog.tsx +import * as React from "react"; +import { createContextScope } from "@radix-ui/react-context"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import * as DialogPrimitive from "@radix-ui/react-dialog"; +import { createDialogScope } from "@radix-ui/react-dialog"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { jsx } from "react/jsx-runtime"; +var ROOT_NAME = "AlertDialog"; +var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [ + createDialogScope +]); +var useDialogScope = createDialogScope(); +var AlertDialog = (props) => { + const { __scopeAlertDialog, ...alertDialogProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true }); +}; +AlertDialog.displayName = ROOT_NAME; +var TRIGGER_NAME = "AlertDialogTrigger"; +var AlertDialogTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...triggerProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef }); + } +); +AlertDialogTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "AlertDialogPortal"; +var AlertDialogPortal = (props) => { + const { __scopeAlertDialog, ...portalProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps }); +}; +AlertDialogPortal.displayName = PORTAL_NAME; +var OVERLAY_NAME = "AlertDialogOverlay"; +var AlertDialogOverlay = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...overlayProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef }); + } +); +AlertDialogOverlay.displayName = OVERLAY_NAME; +var CONTENT_NAME = "AlertDialogContent"; +var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME); +var AlertDialogContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, children, ...contentProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, contentRef); + const cancelRef = React.useRef(null); + return /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsx( + DialogPrimitive.Content, + { + role: "alertdialog", + ...dialogScope, + ...contentProps, + ref: composedRefs, + onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => { + event.preventDefault(); + cancelRef.current?.focus({ preventScroll: true }); + }), + onPointerDownOutside: (event) => event.preventDefault(), + onInteractOutside: (event) => event.preventDefault(), + children + } + ) }); + } +); +AlertDialogContent.displayName = CONTENT_NAME; +var TITLE_NAME = "AlertDialogTitle"; +var AlertDialogTitle = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...titleProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef }); + } +); +AlertDialogTitle.displayName = TITLE_NAME; +var DESCRIPTION_NAME = "AlertDialogDescription"; +var AlertDialogDescription = React.forwardRef((props, forwardedRef) => { + const { __scopeAlertDialog, ...descriptionProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef }); +}); +AlertDialogDescription.displayName = DESCRIPTION_NAME; +var ACTION_NAME = "AlertDialogAction"; +var AlertDialogAction = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...actionProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef }); + } +); +AlertDialogAction.displayName = ACTION_NAME; +var CANCEL_NAME = "AlertDialogCancel"; +var AlertDialogCancel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAlertDialog, ...cancelProps } = props; + const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog); + const dialogScope = useDialogScope(__scopeAlertDialog); + const ref = useComposedRefs(forwardedRef, cancelRef); + return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref }); + } +); +AlertDialogCancel.displayName = CANCEL_NAME; +var Root2 = AlertDialog; +var Trigger2 = AlertDialogTrigger; +var Portal2 = AlertDialogPortal; +var Overlay2 = AlertDialogOverlay; +var Content2 = AlertDialogContent; +var Action = AlertDialogAction; +var Cancel = AlertDialogCancel; +var Title2 = AlertDialogTitle; +var Description2 = AlertDialogDescription; +export { + Action, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogOverlay, + AlertDialogPortal, + AlertDialogTitle, + AlertDialogTrigger, + Cancel, + Content2 as Content, + Description2 as Description, + Overlay2 as Overlay, + Portal2 as Portal, + Root2 as Root, + Title2 as Title, + Trigger2 as Trigger, + createAlertDialogScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..f209a5533817afaea5ce627fcc6ee0db672fa9c4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/alert-dialog.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { createDialogScope } from '@radix-ui/react-dialog';\nimport { composeEventHandlers } from '@radix-ui/primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_NAME = 'AlertDialog';\n\ntype ScopedProps

= P & { __scopeAlertDialog?: Scope };\nconst [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope,\n]);\nconst useDialogScope = createDialogScope();\n\ntype DialogProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogProps extends Omit {}\n\nconst AlertDialog: React.FC = (props: ScopedProps) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n};\n\nAlertDialog.displayName = ROOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst TRIGGER_NAME = 'AlertDialogTrigger';\n\ntype AlertDialogTriggerElement = React.ComponentRef;\ntype DialogTriggerProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst AlertDialogTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'AlertDialogPortal';\n\ntype DialogPortalProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogPortalProps extends DialogPortalProps {}\n\nconst AlertDialogPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n};\n\nAlertDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'AlertDialogOverlay';\n\ntype AlertDialogOverlayElement = React.ComponentRef;\ntype DialogOverlayProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogOverlay.displayName = OVERLAY_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AlertDialogContent';\n\ntype AlertDialogContentContextValue = {\n cancelRef: React.MutableRefObject;\n};\n\nconst [AlertDialogContentProvider, useAlertDialogContentContext] =\n createAlertDialogContext(CONTENT_NAME);\n\ntype AlertDialogContentElement = React.ComponentRef;\ntype DialogContentProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogContentProps extends Omit<\n DialogContentProps,\n 'onPointerDownOutside' | 'onInteractOutside'\n> {}\n\nconst AlertDialogContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n\n return (\n \n {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n })}\n onPointerDownOutside={(event) => event.preventDefault()}\n onInteractOutside={(event) => event.preventDefault()}\n >\n {children}\n \n \n );\n },\n);\n\nAlertDialogContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'AlertDialogTitle';\n\ntype AlertDialogTitleElement = React.ComponentRef;\ntype DialogTitleProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogTitleProps extends DialogTitleProps {}\n\nconst AlertDialogTitle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'AlertDialogDescription';\n\ntype AlertDialogDescriptionElement = React.ComponentRef;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogDescriptionProps extends DialogDescriptionProps {}\n\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n});\n\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'AlertDialogAction';\n\ntype AlertDialogActionElement = React.ComponentRef;\ntype DialogCloseProps = React.ComponentPropsWithoutRef;\ninterface AlertDialogActionProps extends DialogCloseProps {}\n\nconst AlertDialogAction = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return ;\n },\n);\n\nAlertDialogAction.displayName = ACTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogCancel\n * -----------------------------------------------------------------------------------------------*/\n\nconst CANCEL_NAME = 'AlertDialogCancel';\n\ntype AlertDialogCancelElement = React.ComponentRef;\ninterface AlertDialogCancelProps extends DialogCloseProps {}\n\nconst AlertDialogCancel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return ;\n },\n);\n\nAlertDialogCancel.displayName = CANCEL_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = AlertDialog;\nconst Trigger = AlertDialogTrigger;\nconst Portal = AlertDialogPortal;\nconst Overlay = AlertDialogOverlay;\nconst Content = AlertDialogContent;\nconst Action = AlertDialogAction;\nconst Cancel = AlertDialogCancel;\nconst Title = AlertDialogTitle;\nconst Description = AlertDialogDescription;\n\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n};\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AAsB5B;AAdT,IAAM,YAAY;AAGlB,IAAM,CAAC,0BAA0B,sBAAsB,IAAI,mBAAmB,WAAW;AAAA,EACvF;AACF,CAAC;AACD,IAAM,iBAAiB,kBAAkB;AAKzC,IAAM,cAA0C,CAAC,UAAyC;AACxF,QAAM,EAAE,oBAAoB,GAAG,iBAAiB,IAAI;AACpD,QAAM,cAAc,eAAe,kBAAkB;AACrD,SAAO,oBAAiB,sBAAhB,EAAsB,GAAG,aAAc,GAAG,kBAAkB,OAAO,MAAM;AACnF;AAEA,YAAY,cAAc;AAK1B,IAAM,eAAe;AAMrB,IAAM,qBAA2B;AAAA,EAC/B,CAAC,OAA6C,iBAAiB;AAC7D,UAAM,EAAE,oBAAoB,GAAG,aAAa,IAAI;AAChD,UAAM,cAAc,eAAe,kBAAkB;AACrD,WAAO,oBAAiB,yBAAhB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,cAAc;AAIhC,IAAMA,QAAO;AACb,IAAMC,WAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,WAAU;AAChB,IAAM,SAAS;AACf,IAAM,SAAS;AACf,IAAMC,SAAQ;AACd,IAAMC,eAAc;", + "names": ["Root", "Trigger", "Portal", "Overlay", "Content", "Title", "Description"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ce3e6c5042b5fac2067436760daef564c4c0ea76 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/package.json @@ -0,0 +1,72 @@ +{ + "name": "@radix-ui/react-alert-dialog", + "version": "1.1.17", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "src", + "dist" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-dialog": "1.1.17", + "@radix-ui/react-primitive": "2.1.6" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/typescript-config": "0.0.0", + "@repo/builder": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/alert-dialog" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.test.tsx b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.test.tsx new file mode 100644 index 0000000000000000000000000000000000000000..1c05fa65edf7f203c50d44514b26060fadddd723 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.test.tsx @@ -0,0 +1,64 @@ +import * as React from 'react'; +import { axe } from 'vitest-axe'; +import type { RenderResult } from '@testing-library/react'; +import { cleanup, render, fireEvent } from '@testing-library/react'; +import * as AlertDialog from './alert-dialog'; +import { afterEach, describe, it, beforeEach, expect } from 'vitest'; + +const OPEN_TEXT = 'Open'; +const CANCEL_TEXT = 'Cancel'; +const ACTION_TEXT = 'Do it'; +const TITLE_TEXT = 'Warning'; +const DESC_TEXT = 'This is a warning'; +const OVERLAY_TEST_ID = 'test-overlay'; + +const DialogTest = (props: React.ComponentProps) => ( + + {OPEN_TEXT} + + + {TITLE_TEXT} + {DESC_TEXT} + {CANCEL_TEXT} + {ACTION_TEXT} + + +); + +describe('given a default Dialog', () => { + let rendered: RenderResult; + let title: HTMLElement; + let trigger: HTMLElement; + let cancelButton: HTMLElement; + + afterEach(cleanup); + + beforeEach(() => { + rendered = render(); + trigger = rendered.getByText(OPEN_TEXT); + }); + + it('should have no accessibility violations in default state', async () => { + expect(await axe(rendered.container)).toHaveNoViolations(); + }); + + describe('after clicking the trigger', () => { + beforeEach(() => { + fireEvent.click(trigger); + title = rendered.getByText(TITLE_TEXT); + cancelButton = rendered.getByText(CANCEL_TEXT); + }); + + it('should open the content', () => { + expect(title).toBeVisible(); + }); + + it('should have no accessibility violations when open', async () => { + expect(await axe(rendered.container)).toHaveNoViolations(); + }); + + it('should focus the cancel button', () => { + expect(cancelButton).toHaveFocus(); + }); + }); +}); diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.tsx b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ad57cc18744abcac1ad07ae6102ee37e0a0f8617 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/alert-dialog.tsx @@ -0,0 +1,269 @@ +import * as React from 'react'; +import { createContextScope } from '@radix-ui/react-context'; +import { useComposedRefs } from '@radix-ui/react-compose-refs'; +import * as DialogPrimitive from '@radix-ui/react-dialog'; +import { createDialogScope } from '@radix-ui/react-dialog'; +import { composeEventHandlers } from '@radix-ui/primitive'; + +import type { Scope } from '@radix-ui/react-context'; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialog + * -----------------------------------------------------------------------------------------------*/ + +const ROOT_NAME = 'AlertDialog'; + +type ScopedProps

= P & { __scopeAlertDialog?: Scope }; +const [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [ + createDialogScope, +]); +const useDialogScope = createDialogScope(); + +type DialogProps = React.ComponentPropsWithoutRef; +interface AlertDialogProps extends Omit {} + +const AlertDialog: React.FC = (props: ScopedProps) => { + const { __scopeAlertDialog, ...alertDialogProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; +}; + +AlertDialog.displayName = ROOT_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogTrigger + * -----------------------------------------------------------------------------------------------*/ +const TRIGGER_NAME = 'AlertDialogTrigger'; + +type AlertDialogTriggerElement = React.ComponentRef; +type DialogTriggerProps = React.ComponentPropsWithoutRef; +interface AlertDialogTriggerProps extends DialogTriggerProps {} + +const AlertDialogTrigger = React.forwardRef( + (props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, ...triggerProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; + }, +); + +AlertDialogTrigger.displayName = TRIGGER_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogPortal + * -----------------------------------------------------------------------------------------------*/ + +const PORTAL_NAME = 'AlertDialogPortal'; + +type DialogPortalProps = React.ComponentPropsWithoutRef; +interface AlertDialogPortalProps extends DialogPortalProps {} + +const AlertDialogPortal: React.FC = ( + props: ScopedProps, +) => { + const { __scopeAlertDialog, ...portalProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; +}; + +AlertDialogPortal.displayName = PORTAL_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogOverlay + * -----------------------------------------------------------------------------------------------*/ + +const OVERLAY_NAME = 'AlertDialogOverlay'; + +type AlertDialogOverlayElement = React.ComponentRef; +type DialogOverlayProps = React.ComponentPropsWithoutRef; +interface AlertDialogOverlayProps extends DialogOverlayProps {} + +const AlertDialogOverlay = React.forwardRef( + (props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, ...overlayProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; + }, +); + +AlertDialogOverlay.displayName = OVERLAY_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogContent + * -----------------------------------------------------------------------------------------------*/ + +const CONTENT_NAME = 'AlertDialogContent'; + +type AlertDialogContentContextValue = { + cancelRef: React.MutableRefObject; +}; + +const [AlertDialogContentProvider, useAlertDialogContentContext] = + createAlertDialogContext(CONTENT_NAME); + +type AlertDialogContentElement = React.ComponentRef; +type DialogContentProps = React.ComponentPropsWithoutRef; +interface AlertDialogContentProps extends Omit< + DialogContentProps, + 'onPointerDownOutside' | 'onInteractOutside' +> {} + +const AlertDialogContent = React.forwardRef( + (props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, children, ...contentProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, contentRef); + const cancelRef = React.useRef(null); + + return ( + + { + event.preventDefault(); + cancelRef.current?.focus({ preventScroll: true }); + })} + onPointerDownOutside={(event) => event.preventDefault()} + onInteractOutside={(event) => event.preventDefault()} + > + {children} + + + ); + }, +); + +AlertDialogContent.displayName = CONTENT_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogTitle + * -----------------------------------------------------------------------------------------------*/ + +const TITLE_NAME = 'AlertDialogTitle'; + +type AlertDialogTitleElement = React.ComponentRef; +type DialogTitleProps = React.ComponentPropsWithoutRef; +interface AlertDialogTitleProps extends DialogTitleProps {} + +const AlertDialogTitle = React.forwardRef( + (props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, ...titleProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; + }, +); + +AlertDialogTitle.displayName = TITLE_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogDescription + * -----------------------------------------------------------------------------------------------*/ + +const DESCRIPTION_NAME = 'AlertDialogDescription'; + +type AlertDialogDescriptionElement = React.ComponentRef; +type DialogDescriptionProps = React.ComponentPropsWithoutRef; +interface AlertDialogDescriptionProps extends DialogDescriptionProps {} + +const AlertDialogDescription = React.forwardRef< + AlertDialogDescriptionElement, + AlertDialogDescriptionProps +>((props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, ...descriptionProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; +}); + +AlertDialogDescription.displayName = DESCRIPTION_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogAction + * -----------------------------------------------------------------------------------------------*/ + +const ACTION_NAME = 'AlertDialogAction'; + +type AlertDialogActionElement = React.ComponentRef; +type DialogCloseProps = React.ComponentPropsWithoutRef; +interface AlertDialogActionProps extends DialogCloseProps {} + +const AlertDialogAction = React.forwardRef( + (props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, ...actionProps } = props; + const dialogScope = useDialogScope(__scopeAlertDialog); + return ; + }, +); + +AlertDialogAction.displayName = ACTION_NAME; + +/* ------------------------------------------------------------------------------------------------- + * AlertDialogCancel + * -----------------------------------------------------------------------------------------------*/ + +const CANCEL_NAME = 'AlertDialogCancel'; + +type AlertDialogCancelElement = React.ComponentRef; +interface AlertDialogCancelProps extends DialogCloseProps {} + +const AlertDialogCancel = React.forwardRef( + (props: ScopedProps, forwardedRef) => { + const { __scopeAlertDialog, ...cancelProps } = props; + const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog); + const dialogScope = useDialogScope(__scopeAlertDialog); + const ref = useComposedRefs(forwardedRef, cancelRef); + return ; + }, +); + +AlertDialogCancel.displayName = CANCEL_NAME; + +/* ---------------------------------------------------------------------------------------------- */ + +const Root = AlertDialog; +const Trigger = AlertDialogTrigger; +const Portal = AlertDialogPortal; +const Overlay = AlertDialogOverlay; +const Content = AlertDialogContent; +const Action = AlertDialogAction; +const Cancel = AlertDialogCancel; +const Title = AlertDialogTitle; +const Description = AlertDialogDescription; + +export { + createAlertDialogScope, + // + AlertDialog, + AlertDialogTrigger, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogContent, + AlertDialogAction, + AlertDialogCancel, + AlertDialogTitle, + AlertDialogDescription, + // + Root, + Trigger, + Portal, + Overlay, + Content, + Action, + Cancel, + Title, + Description, +}; +export type { + AlertDialogProps, + AlertDialogTriggerProps, + AlertDialogPortalProps, + AlertDialogOverlayProps, + AlertDialogContentProps, + AlertDialogActionProps, + AlertDialogCancelProps, + AlertDialogTitleProps, + AlertDialogDescriptionProps, +}; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/index.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..5561fed2f518b73e6191c56265aa9c0a85be0e15 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-alert-dialog/src/index.ts @@ -0,0 +1,35 @@ +'use client'; +export { + createAlertDialogScope, + // + AlertDialog, + AlertDialogTrigger, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogContent, + AlertDialogAction, + AlertDialogCancel, + AlertDialogTitle, + AlertDialogDescription, + // + Root, + Trigger, + Portal, + Overlay, + Content, + Action, + Cancel, + Title, + Description, +} from './alert-dialog'; +export type { + AlertDialogProps, + AlertDialogTriggerProps, + AlertDialogPortalProps, + AlertDialogOverlayProps, + AlertDialogContentProps, + AlertDialogActionProps, + AlertDialogCancelProps, + AlertDialogTitleProps, + AlertDialogDescriptionProps, +} from './alert-dialog'; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4030b172f224ff7c1d73da3bd1c4a13bdbf3963e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/README.md @@ -0,0 +1,3 @@ +# `react-arrow` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..436792063bed117ff5672d36b39fb2ea189d3ce8 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.d.mts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveSvgProps = React.ComponentPropsWithoutRef; +interface ArrowProps extends PrimitiveSvgProps { +} +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { Arrow, type ArrowProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..436792063bed117ff5672d36b39fb2ea189d3ce8 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveSvgProps = React.ComponentPropsWithoutRef; +interface ArrowProps extends PrimitiveSvgProps { +} +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { Arrow, type ArrowProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f812482c77978158ce0cb3d1edb85acd191f308b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.js @@ -0,0 +1,60 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Arrow: () => Arrow, + Root: () => Root +}); +module.exports = __toCommonJS(index_exports); + +// src/arrow.tsx +var React = __toESM(require("react")); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var NAME = "Arrow"; +var Arrow = React.forwardRef((props, forwardedRef) => { + const { children, width = 10, height = 5, ...arrowProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.svg, + { + ...arrowProps, + ref: forwardedRef, + width, + height, + viewBox: "0 0 30 10", + preserveAspectRatio: "none", + children: props.asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polygon", { points: "0,0 30,0 15,10" }) + } + ); +}); +Arrow.displayName = NAME; +var Root = Arrow; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..694fdfe6763be864cb3c54ed53bd69c15f357265 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/arrow.tsx"], + "sourcesContent": ["export {\n Arrow,\n //\n Root,\n} from './arrow';\nexport type { ArrowProps } from './arrow';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Arrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Arrow';\n\ntype ArrowElement = React.ComponentRef;\ntype PrimitiveSvgProps = React.ComponentPropsWithoutRef;\ninterface ArrowProps extends PrimitiveSvgProps {}\n\nconst Arrow = React.forwardRef((props, forwardedRef) => {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return (\n \n {/* We use their children if they're slotting to replace the whole svg */}\n {props.asChild ? children : }\n \n );\n});\n\nArrow.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Arrow;\n\nexport {\n Arrow,\n //\n Root,\n};\nexport type { ArrowProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AAwBQ;AAlBlC,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,QAAM,EAAE,UAAU,QAAQ,IAAI,SAAS,GAAG,GAAG,WAAW,IAAI;AAC5D,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAQ;AAAA,MACR,qBAAoB;AAAA,MAGnB,gBAAM,UAAU,WAAW,4CAAC,aAAQ,QAAO,kBAAiB;AAAA;AAAA,EAC/D;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a15d6db0ce2d2c2ed5f7e63393d288cc160081db --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.mjs @@ -0,0 +1,27 @@ +// src/arrow.tsx +import * as React from "react"; +import { Primitive } from "@radix-ui/react-primitive"; +import { jsx } from "react/jsx-runtime"; +var NAME = "Arrow"; +var Arrow = React.forwardRef((props, forwardedRef) => { + const { children, width = 10, height = 5, ...arrowProps } = props; + return /* @__PURE__ */ jsx( + Primitive.svg, + { + ...arrowProps, + ref: forwardedRef, + width, + height, + viewBox: "0 0 30 10", + preserveAspectRatio: "none", + children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" }) + } + ); +}); +Arrow.displayName = NAME; +var Root = Arrow; +export { + Arrow, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..8289098c06d9f5e49ee628e31c8c9c0468bbf878 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/arrow.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Arrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Arrow';\n\ntype ArrowElement = React.ComponentRef;\ntype PrimitiveSvgProps = React.ComponentPropsWithoutRef;\ninterface ArrowProps extends PrimitiveSvgProps {}\n\nconst Arrow = React.forwardRef((props, forwardedRef) => {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return (\n \n {/* We use their children if they're slotting to replace the whole svg */}\n {props.asChild ? children : }\n \n );\n});\n\nArrow.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Arrow;\n\nexport {\n Arrow,\n //\n Root,\n};\nexport type { ArrowProps };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAwBQ;AAlBlC,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,QAAM,EAAE,UAAU,QAAQ,IAAI,SAAS,GAAG,GAAG,WAAW,IAAI;AAC5D,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,SAAQ;AAAA,MACR,qBAAoB;AAAA,MAGnB,gBAAM,UAAU,WAAW,oBAAC,aAAQ,QAAO,kBAAiB;AAAA;AAAA,EAC/D;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/package.json new file mode 100644 index 0000000000000000000000000000000000000000..dc6fe83b935cac85024f7572fef0e7e79070abb8 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-arrow/package.json @@ -0,0 +1,68 @@ +{ + "name": "@radix-ui/react-arrow", + "version": "1.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-primitive": "2.1.6" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/arrow" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a4db17b3f1e75b2a6cedd1fcabe6541790dd75e0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/README.md @@ -0,0 +1,3 @@ +# `react-aspect-ratio` + +View docs [here](https://radix-ui.com/primitives/docs/utilities/aspect-ratio). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a3bca7b0ca10539ce519ca5f26b18414952956ca --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.d.mts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface AspectRatioProps extends PrimitiveDivProps { + ratio?: number; +} +declare const AspectRatio: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { AspectRatio, type AspectRatioProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3bca7b0ca10539ce519ca5f26b18414952956ca --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface AspectRatioProps extends PrimitiveDivProps { + ratio?: number; +} +declare const AspectRatio: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { AspectRatio, type AspectRatioProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e9a40631a9e969f03a04531ef77e280ebe72ed46 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.js @@ -0,0 +1,79 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + AspectRatio: () => AspectRatio, + Root: () => Root +}); +module.exports = __toCommonJS(index_exports); + +// src/aspect-ratio.tsx +var React = __toESM(require("react")); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var NAME = "AspectRatio"; +var AspectRatio = React.forwardRef( + (props, forwardedRef) => { + const { ratio = 1 / 1, style, ...aspectRatioProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "div", + { + style: { + // ensures inner element is contained + position: "relative", + // ensures padding bottom trick maths works + width: "100%", + paddingBottom: `${100 / ratio}%` + }, + "data-radix-aspect-ratio-wrapper": "", + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...aspectRatioProps, + ref: forwardedRef, + style: { + ...style, + // ensures children expand in ratio + position: "absolute", + top: 0, + right: 0, + bottom: 0, + left: 0 + } + } + ) + } + ); + } +); +AspectRatio.displayName = NAME; +var Root = AspectRatio; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..0ecca46c1580fb093311b47620b1074b16b1f428 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/aspect-ratio.tsx"], + "sourcesContent": ["export {\n AspectRatio,\n //\n Root,\n} from './aspect-ratio';\nexport type { AspectRatioProps } from './aspect-ratio';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * AspectRatio\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'AspectRatio';\n\ntype AspectRatioElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface AspectRatioProps extends PrimitiveDivProps {\n ratio?: number;\n}\n\nconst AspectRatio = React.forwardRef(\n (props, forwardedRef) => {\n const { ratio = 1 / 1, style, ...aspectRatioProps } = props;\n return (\n \n \n \n );\n },\n);\n\nAspectRatio.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = AspectRatio;\n\nexport {\n AspectRatio,\n //\n Root,\n};\nexport type { AspectRatioProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AA4BlB;AAtBR,IAAM,OAAO;AAQb,IAAM,cAAoB;AAAA,EACxB,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,QAAQ,IAAI,GAAG,OAAO,GAAG,iBAAiB,IAAI;AACtD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA;AAAA,UAEL,UAAU;AAAA;AAAA,UAEV,OAAO;AAAA,UACP,eAAe,GAAG,MAAM,KAAK;AAAA,QAC/B;AAAA,QACA,mCAAgC;AAAA,QAEhC;AAAA,UAAC,iCAAU;AAAA,UAAV;AAAA,YACE,GAAG;AAAA,YACJ,KAAK;AAAA,YACL,OAAO;AAAA,cACL,GAAG;AAAA;AAAA,cAEH,UAAU;AAAA,cACV,KAAK;AAAA,cACL,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,MAAM;AAAA,YACR;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAI1B,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d33bd1fcedee5a93897ebc6bdb87c68e8ff67b5f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs @@ -0,0 +1,46 @@ +// src/aspect-ratio.tsx +import * as React from "react"; +import { Primitive } from "@radix-ui/react-primitive"; +import { jsx } from "react/jsx-runtime"; +var NAME = "AspectRatio"; +var AspectRatio = React.forwardRef( + (props, forwardedRef) => { + const { ratio = 1 / 1, style, ...aspectRatioProps } = props; + return /* @__PURE__ */ jsx( + "div", + { + style: { + // ensures inner element is contained + position: "relative", + // ensures padding bottom trick maths works + width: "100%", + paddingBottom: `${100 / ratio}%` + }, + "data-radix-aspect-ratio-wrapper": "", + children: /* @__PURE__ */ jsx( + Primitive.div, + { + ...aspectRatioProps, + ref: forwardedRef, + style: { + ...style, + // ensures children expand in ratio + position: "absolute", + top: 0, + right: 0, + bottom: 0, + left: 0 + } + } + ) + } + ); + } +); +AspectRatio.displayName = NAME; +var Root = AspectRatio; +export { + AspectRatio, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..5f7f6bdedab6d82cc40fa7829fee2f733de91667 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/aspect-ratio.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * AspectRatio\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'AspectRatio';\n\ntype AspectRatioElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface AspectRatioProps extends PrimitiveDivProps {\n ratio?: number;\n}\n\nconst AspectRatio = React.forwardRef(\n (props, forwardedRef) => {\n const { ratio = 1 / 1, style, ...aspectRatioProps } = props;\n return (\n \n \n \n );\n },\n);\n\nAspectRatio.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = AspectRatio;\n\nexport {\n AspectRatio,\n //\n Root,\n};\nexport type { AspectRatioProps };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AA4BlB;AAtBR,IAAM,OAAO;AAQb,IAAM,cAAoB;AAAA,EACxB,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,QAAQ,IAAI,GAAG,OAAO,GAAG,iBAAiB,IAAI;AACtD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA;AAAA,UAEL,UAAU;AAAA;AAAA,UAEV,OAAO;AAAA,UACP,eAAe,GAAG,MAAM,KAAK;AAAA,QAC/B;AAAA,QACA,mCAAgC;AAAA,QAEhC;AAAA,UAAC,UAAU;AAAA,UAAV;AAAA,YACE,GAAG;AAAA,YACJ,KAAK;AAAA,YACL,OAAO;AAAA,cACL,GAAG;AAAA;AAAA,cAEH,UAAU;AAAA,cACV,KAAK;AAAA,cACL,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,MAAM;AAAA,YACR;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAI1B,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/package.json new file mode 100644 index 0000000000000000000000000000000000000000..511d4f2f985e90f26eb16b08d9a94ef6bda5620e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-aspect-ratio/package.json @@ -0,0 +1,68 @@ +{ + "name": "@radix-ui/react-aspect-ratio", + "version": "1.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-primitive": "2.1.6" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/aspect-ratio" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cfe4acf4f522690d80028bb7aeccb5ad692326a9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/README.md @@ -0,0 +1,3 @@ +# `react-avatar` + +View docs [here](https://radix-ui.com/primitives/docs/components/avatar). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..dc96b7202e9469d9e499518b85b37e137e8b3193 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.d.mts @@ -0,0 +1,21 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createAvatarScope: _radix_ui_react_context.CreateScope; +type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error'; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface AvatarProps extends PrimitiveSpanProps { +} +declare const Avatar: React.ForwardRefExoticComponent>; +type PrimitiveImageProps = React.ComponentPropsWithoutRef; +interface AvatarImageProps extends PrimitiveImageProps { + onLoadingStatusChange?: (status: ImageLoadingStatus) => void; +} +declare const AvatarImage: React.ForwardRefExoticComponent>; +interface AvatarFallbackProps extends PrimitiveSpanProps { + delayMs?: number; +} +declare const AvatarFallback: React.ForwardRefExoticComponent>; + +export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarFallback as Fallback, AvatarImage as Image, Avatar as Root, createAvatarScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc96b7202e9469d9e499518b85b37e137e8b3193 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.d.ts @@ -0,0 +1,21 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createAvatarScope: _radix_ui_react_context.CreateScope; +type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error'; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface AvatarProps extends PrimitiveSpanProps { +} +declare const Avatar: React.ForwardRefExoticComponent>; +type PrimitiveImageProps = React.ComponentPropsWithoutRef; +interface AvatarImageProps extends PrimitiveImageProps { + onLoadingStatusChange?: (status: ImageLoadingStatus) => void; +} +declare const AvatarImage: React.ForwardRefExoticComponent>; +interface AvatarFallbackProps extends PrimitiveSpanProps { + delayMs?: number; +} +declare const AvatarFallback: React.ForwardRefExoticComponent>; + +export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarFallback as Fallback, AvatarImage as Image, Avatar as Root, createAvatarScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..936edb05aef53d99e1315814a9efecc487580ac1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.js @@ -0,0 +1,183 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Avatar: () => Avatar, + AvatarFallback: () => AvatarFallback, + AvatarImage: () => AvatarImage, + Fallback: () => AvatarFallback, + Image: () => AvatarImage, + Root: () => Avatar, + createAvatarScope: () => createAvatarScope +}); +module.exports = __toCommonJS(index_exports); + +// src/avatar.tsx +var React = __toESM(require("react")); +var import_react_context = require("@radix-ui/react-context"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var AVATAR_NAME = "Avatar"; +var [createAvatarContext, createAvatarScope] = (0, import_react_context.createContextScope)(AVATAR_NAME); +var STATIC_IMAGE_COUNT_STATE = [ + 0, + () => void 0 +]; +var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME); +var Avatar = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAvatar, ...avatarProps } = props; + const [imageLoadingStatus, setImageLoadingStatus] = React.useState("idle"); + const [imageCount, setImageCount] = useImageCount(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + AvatarProvider, + { + scope: __scopeAvatar, + imageLoadingStatus, + setImageLoadingStatus, + imageCount, + setImageCount, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.span, { ...avatarProps, ref: forwardedRef }) + } + ); + } +); +Avatar.displayName = AVATAR_NAME; +var IMAGE_NAME = "AvatarImage"; +var AvatarImage = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAvatar, src, onLoadingStatusChange, ...imageProps } = props; + const context = useAvatarContext(IMAGE_NAME, __scopeAvatar); + useUpdateImageCount(context.setImageCount); + const imageLoadingStatus = useImageLoadingStatus(src, { + referrerPolicy: imageProps.referrerPolicy, + crossOrigin: imageProps.crossOrigin, + loadingStatus: context.imageLoadingStatus, + setLoadingStatus: context.setImageLoadingStatus + }); + const handleLoadingStatusChange = (0, import_react_use_callback_ref.useCallbackRef)((status) => { + onLoadingStatusChange?.(status); + }); + const loadingStatusRef = React.useRef(imageLoadingStatus); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + const previousLoadingStatus = loadingStatusRef.current; + loadingStatusRef.current = imageLoadingStatus; + if (imageLoadingStatus !== previousLoadingStatus) { + handleLoadingStatusChange(imageLoadingStatus); + } + }, [imageLoadingStatus, handleLoadingStatusChange]); + return imageLoadingStatus === "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null; + } +); +AvatarImage.displayName = IMAGE_NAME; +var FALLBACK_NAME = "AvatarFallback"; +var AvatarFallback = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAvatar, delayMs, ...fallbackProps } = props; + const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar); + const [canRender, setCanRender] = React.useState(delayMs === void 0); + React.useEffect(() => { + if (delayMs !== void 0) { + const timerId = window.setTimeout(() => setCanRender(true), delayMs); + return () => window.clearTimeout(timerId); + } + }, [delayMs]); + return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null; + } +); +AvatarFallback.displayName = FALLBACK_NAME; +function useImageLoadingStatus(src, { + loadingStatus, + setLoadingStatus, + referrerPolicy, + crossOrigin +}) { + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (!src) { + setLoadingStatus("error"); + return; + } + const image = new window.Image(); + const handleLoad = (event) => { + const image2 = event.currentTarget; + setLoadingStatus(getImageLoadingStatus(image2)); + }; + const handleError = () => setLoadingStatus("error"); + image.addEventListener("load", handleLoad); + image.addEventListener("error", handleError); + if (referrerPolicy) { + image.referrerPolicy = referrerPolicy; + } + image.crossOrigin = crossOrigin ?? null; + image.src = src; + setLoadingStatus(getImageLoadingStatus(image)); + return () => { + image.removeEventListener("load", handleLoad); + image.removeEventListener("error", handleError); + setLoadingStatus("idle"); + }; + }, [src, crossOrigin, referrerPolicy, setLoadingStatus]); + return loadingStatus; +} +function getImageLoadingStatus(image) { + return image.complete ? image.naturalWidth > 0 ? "loaded" : "error" : "loading"; +} +function useImageCount() { + let state = STATIC_IMAGE_COUNT_STATE; + if (true) { + state = React.useState(0); + const [imageCount] = state; + const hasWarnedRef = React.useRef(false); + React.useEffect(() => { + if (imageCount > 1 && !hasWarnedRef.current) { + hasWarnedRef.current = true; + console.warn( + "Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior." + ); + } + }, [imageCount]); + } + return state; +} +function useUpdateImageCount(setImageCount) { + if (true) { + React.useEffect(() => { + setImageCount((imageCount) => imageCount + 1); + return () => { + setImageCount((imageCount) => imageCount - 1); + }; + }, [setImageCount]); + } +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..07dd6e9acb605c8ecbe948301173a46cea871043 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/avatar.tsx"], + "sourcesContent": ["'use client';\nexport {\n createAvatarScope,\n //\n Avatar,\n AvatarImage,\n AvatarFallback,\n //\n Root,\n Image,\n Fallback,\n} from './avatar';\nexport type { AvatarProps, AvatarImageProps, AvatarFallbackProps } from './avatar';\n", "import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Avatar\n * -----------------------------------------------------------------------------------------------*/\n\nconst AVATAR_NAME = 'Avatar';\n\ntype ScopedProps

= P & { __scopeAvatar?: Scope };\nconst [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);\n\ntype ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\ntype AvatarContextValue = {\n imageLoadingStatus: ImageLoadingStatus;\n setImageLoadingStatus: React.Dispatch>;\n imageCount: number;\n setImageCount: React.Dispatch>;\n};\n\nconst STATIC_IMAGE_COUNT_STATE: [number, React.Dispatch>] = [\n 0,\n () => void 0,\n];\n\nconst [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);\n\ntype AvatarElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface AvatarProps extends PrimitiveSpanProps {}\n\nconst Avatar = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAvatar, ...avatarProps } = props;\n const [imageLoadingStatus, setImageLoadingStatus] = React.useState('idle');\n const [imageCount, setImageCount] = useImageCount();\n\n return (\n \n \n \n );\n },\n);\n\nAvatar.displayName = AVATAR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AvatarImage\n * -----------------------------------------------------------------------------------------------*/\n\nconst IMAGE_NAME = 'AvatarImage';\n\ntype AvatarImageElement = React.ComponentRef;\ntype PrimitiveImageProps = React.ComponentPropsWithoutRef;\ninterface AvatarImageProps extends PrimitiveImageProps {\n onLoadingStatusChange?: (status: ImageLoadingStatus) => void;\n}\n\nconst AvatarImage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAvatar, src, onLoadingStatusChange, ...imageProps } = props;\n const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);\n useUpdateImageCount(context.setImageCount);\n\n const imageLoadingStatus = useImageLoadingStatus(src, {\n referrerPolicy: imageProps.referrerPolicy,\n crossOrigin: imageProps.crossOrigin,\n loadingStatus: context.imageLoadingStatus,\n setLoadingStatus: context.setImageLoadingStatus,\n });\n const handleLoadingStatusChange = useCallbackRef((status: ImageLoadingStatus) => {\n onLoadingStatusChange?.(status);\n });\n\n const loadingStatusRef = React.useRef(imageLoadingStatus);\n\n useLayoutEffect(() => {\n const previousLoadingStatus = loadingStatusRef.current;\n loadingStatusRef.current = imageLoadingStatus;\n\n if (imageLoadingStatus !== previousLoadingStatus) {\n handleLoadingStatusChange(imageLoadingStatus);\n }\n }, [imageLoadingStatus, handleLoadingStatusChange]);\n\n return imageLoadingStatus === 'loaded' ? (\n \n ) : null;\n },\n);\n\nAvatarImage.displayName = IMAGE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AvatarFallback\n * -----------------------------------------------------------------------------------------------*/\n\nconst FALLBACK_NAME = 'AvatarFallback';\n\ntype AvatarFallbackElement = React.ComponentRef;\ninterface AvatarFallbackProps extends PrimitiveSpanProps {\n delayMs?: number;\n}\n\nconst AvatarFallback = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAvatar, delayMs, ...fallbackProps } = props;\n const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);\n const [canRender, setCanRender] = React.useState(delayMs === undefined);\n\n React.useEffect(() => {\n if (delayMs !== undefined) {\n const timerId = window.setTimeout(() => setCanRender(true), delayMs);\n return () => window.clearTimeout(timerId);\n }\n }, [delayMs]);\n\n return canRender && context.imageLoadingStatus !== 'loaded' ? (\n \n ) : null;\n },\n);\n\nAvatarFallback.displayName = FALLBACK_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useImageLoadingStatus(\n src: string | undefined,\n {\n loadingStatus,\n setLoadingStatus,\n referrerPolicy,\n crossOrigin,\n }: {\n referrerPolicy: React.HTMLAttributeReferrerPolicy | undefined;\n crossOrigin: string | undefined;\n loadingStatus: ImageLoadingStatus;\n setLoadingStatus: React.Dispatch>;\n },\n) {\n useLayoutEffect(() => {\n if (!src) {\n setLoadingStatus('error');\n return;\n }\n\n const image = new window.Image();\n const handleLoad = (event: Event) => {\n const image = event.currentTarget as HTMLImageElement;\n setLoadingStatus(getImageLoadingStatus(image));\n };\n const handleError = () => setLoadingStatus('error');\n image.addEventListener('load', handleLoad);\n image.addEventListener('error', handleError);\n if (referrerPolicy) {\n image.referrerPolicy = referrerPolicy;\n }\n image.crossOrigin = crossOrigin ?? null;\n image.src = src;\n\n setLoadingStatus(getImageLoadingStatus(image));\n return () => {\n image.removeEventListener('load', handleLoad);\n image.removeEventListener('error', handleError);\n setLoadingStatus('idle');\n };\n }, [src, crossOrigin, referrerPolicy, setLoadingStatus]);\n\n return loadingStatus;\n}\n\nfunction getImageLoadingStatus(image: HTMLImageElement) {\n return image.complete ? (image.naturalWidth > 0 ? 'loaded' : 'error') : 'loading';\n}\n\n// Image count is only used in development to warn about multiple images, which\n// is unsupported. Gating behind a development flag to avoid performance\n// overhead in production is safe because useState is guaranteed to run\n// consistently in the same environment.\n// oxlint-disable react-hooks/rules-of-hooks\nfunction useImageCount() {\n let state = STATIC_IMAGE_COUNT_STATE;\n if (process.env.NODE_ENV !== 'production') {\n state = React.useState(0);\n const [imageCount] = state;\n const hasWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (imageCount > 1 && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n 'Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior.',\n );\n }\n }, [imageCount]);\n }\n\n return state;\n}\n\nfunction useUpdateImageCount(setImageCount: React.Dispatch>) {\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n setImageCount((imageCount) => imageCount + 1);\n return () => {\n setImageCount((imageCount) => imageCount - 1);\n };\n }, [setImageCount]);\n }\n}\n// oxlint-enable react-hooks/rules-of-hooks\n\nexport {\n createAvatarScope,\n //\n Avatar,\n AvatarImage,\n AvatarFallback,\n //\n Avatar as Root,\n AvatarImage as Image,\n AvatarFallback as Fallback,\n};\nexport type { AvatarProps, AvatarImageProps, AvatarFallbackProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;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iB,SAAS,WAAW;AAC3C,QAAI,gBAAgB;AAClB,YAAM,iBAAiB;AAAA,IACzB;AACA,UAAM,cAAc,eAAe;AACnC,UAAM,MAAM;AAEZ,qBAAiB,sBAAsB,KAAK,CAAC;AAC7C,WAAO,MAAM;AACX,YAAM,oBAAoB,QAAQ,UAAU;AAC5C,YAAM,oBAAoB,SAAS,WAAW;AAC9C,uBAAiB,MAAM;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,KAAK,aAAa,gBAAgB,gBAAgB,CAAC;AAEvD,SAAO;AACT;AAEA,SAAS,sBAAsB,OAAyB;AACtD,SAAO,MAAM,WAAY,MAAM,eAAe,IAAI,WAAW,UAAW;AAC1E;AAOA,SAAS,gBAAgB;AACvB,MAAI,QAAQ;AACZ,MAAI,MAAuC;AACzC,YAAc,eAAS,CAAC;AACxB,UAAM,CAAC,UAAU,IAAI;AACrB,UAAM,eAAqB,aAAO,KAAK;AACvC,IAAM,gBAAU,MAAM;AACpB,UAAI,aAAa,KAAK,CAAC,aAAa,SAAS;AAC3C,qBAAa,UAAU;AACvB,gBAAQ;AAAA,UACN;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,UAAU,CAAC;AAAA,EACjB;AAEA,SAAO;AACT;AAEA,SAAS,oBAAoB,eAA6D;AACxF,MAAI,MAAuC;AACzC,IAAM,gBAAU,MAAM;AACpB,oBAAc,CAAC,eAAe,aAAa,CAAC;AAC5C,aAAO,MAAM;AACX,sBAAc,CAAC,eAAe,aAAa,CAAC;AAAA,MAC9C;AAAA,IACF,GAAG,CAAC,aAAa,CAAC;AAAA,EACpB;AACF;", + "names": ["image"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..dbadfa68109b93924980f93e652b56432a8503a2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.mjs @@ -0,0 +1,151 @@ +"use client"; + +// src/avatar.tsx +import * as React from "react"; +import { createContextScope } from "@radix-ui/react-context"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; +import { Primitive } from "@radix-ui/react-primitive"; +import { jsx } from "react/jsx-runtime"; +var AVATAR_NAME = "Avatar"; +var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME); +var STATIC_IMAGE_COUNT_STATE = [ + 0, + () => void 0 +]; +var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME); +var Avatar = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAvatar, ...avatarProps } = props; + const [imageLoadingStatus, setImageLoadingStatus] = React.useState("idle"); + const [imageCount, setImageCount] = useImageCount(); + return /* @__PURE__ */ jsx( + AvatarProvider, + { + scope: __scopeAvatar, + imageLoadingStatus, + setImageLoadingStatus, + imageCount, + setImageCount, + children: /* @__PURE__ */ jsx(Primitive.span, { ...avatarProps, ref: forwardedRef }) + } + ); + } +); +Avatar.displayName = AVATAR_NAME; +var IMAGE_NAME = "AvatarImage"; +var AvatarImage = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAvatar, src, onLoadingStatusChange, ...imageProps } = props; + const context = useAvatarContext(IMAGE_NAME, __scopeAvatar); + useUpdateImageCount(context.setImageCount); + const imageLoadingStatus = useImageLoadingStatus(src, { + referrerPolicy: imageProps.referrerPolicy, + crossOrigin: imageProps.crossOrigin, + loadingStatus: context.imageLoadingStatus, + setLoadingStatus: context.setImageLoadingStatus + }); + const handleLoadingStatusChange = useCallbackRef((status) => { + onLoadingStatusChange?.(status); + }); + const loadingStatusRef = React.useRef(imageLoadingStatus); + useLayoutEffect(() => { + const previousLoadingStatus = loadingStatusRef.current; + loadingStatusRef.current = imageLoadingStatus; + if (imageLoadingStatus !== previousLoadingStatus) { + handleLoadingStatusChange(imageLoadingStatus); + } + }, [imageLoadingStatus, handleLoadingStatusChange]); + return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null; + } +); +AvatarImage.displayName = IMAGE_NAME; +var FALLBACK_NAME = "AvatarFallback"; +var AvatarFallback = React.forwardRef( + (props, forwardedRef) => { + const { __scopeAvatar, delayMs, ...fallbackProps } = props; + const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar); + const [canRender, setCanRender] = React.useState(delayMs === void 0); + React.useEffect(() => { + if (delayMs !== void 0) { + const timerId = window.setTimeout(() => setCanRender(true), delayMs); + return () => window.clearTimeout(timerId); + } + }, [delayMs]); + return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null; + } +); +AvatarFallback.displayName = FALLBACK_NAME; +function useImageLoadingStatus(src, { + loadingStatus, + setLoadingStatus, + referrerPolicy, + crossOrigin +}) { + useLayoutEffect(() => { + if (!src) { + setLoadingStatus("error"); + return; + } + const image = new window.Image(); + const handleLoad = (event) => { + const image2 = event.currentTarget; + setLoadingStatus(getImageLoadingStatus(image2)); + }; + const handleError = () => setLoadingStatus("error"); + image.addEventListener("load", handleLoad); + image.addEventListener("error", handleError); + if (referrerPolicy) { + image.referrerPolicy = referrerPolicy; + } + image.crossOrigin = crossOrigin ?? null; + image.src = src; + setLoadingStatus(getImageLoadingStatus(image)); + return () => { + image.removeEventListener("load", handleLoad); + image.removeEventListener("error", handleError); + setLoadingStatus("idle"); + }; + }, [src, crossOrigin, referrerPolicy, setLoadingStatus]); + return loadingStatus; +} +function getImageLoadingStatus(image) { + return image.complete ? image.naturalWidth > 0 ? "loaded" : "error" : "loading"; +} +function useImageCount() { + let state = STATIC_IMAGE_COUNT_STATE; + if (true) { + state = React.useState(0); + const [imageCount] = state; + const hasWarnedRef = React.useRef(false); + React.useEffect(() => { + if (imageCount > 1 && !hasWarnedRef.current) { + hasWarnedRef.current = true; + console.warn( + "Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior." + ); + } + }, [imageCount]); + } + return state; +} +function useUpdateImageCount(setImageCount) { + if (true) { + React.useEffect(() => { + setImageCount((imageCount) => imageCount + 1); + return () => { + setImageCount((imageCount) => imageCount - 1); + }; + }, [setImageCount]); + } +} +export { + Avatar, + AvatarFallback, + AvatarImage, + AvatarFallback as Fallback, + AvatarImage as Image, + Avatar as Root, + createAvatarScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..9e387fbdbf0418c91219fbafcb25311aba9be2a2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/avatar.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Avatar\n * -----------------------------------------------------------------------------------------------*/\n\nconst AVATAR_NAME = 'Avatar';\n\ntype ScopedProps

= P & { __scopeAvatar?: Scope };\nconst [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);\n\ntype ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\ntype AvatarContextValue = {\n imageLoadingStatus: ImageLoadingStatus;\n setImageLoadingStatus: React.Dispatch>;\n imageCount: number;\n setImageCount: React.Dispatch>;\n};\n\nconst STATIC_IMAGE_COUNT_STATE: [number, React.Dispatch>] = [\n 0,\n () => void 0,\n];\n\nconst [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);\n\ntype AvatarElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface AvatarProps extends PrimitiveSpanProps {}\n\nconst Avatar = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAvatar, ...avatarProps } = props;\n const [imageLoadingStatus, setImageLoadingStatus] = React.useState('idle');\n const [imageCount, setImageCount] = useImageCount();\n\n return (\n \n \n \n );\n },\n);\n\nAvatar.displayName = AVATAR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AvatarImage\n * -----------------------------------------------------------------------------------------------*/\n\nconst IMAGE_NAME = 'AvatarImage';\n\ntype AvatarImageElement = React.ComponentRef;\ntype PrimitiveImageProps = React.ComponentPropsWithoutRef;\ninterface AvatarImageProps extends PrimitiveImageProps {\n onLoadingStatusChange?: (status: ImageLoadingStatus) => void;\n}\n\nconst AvatarImage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAvatar, src, onLoadingStatusChange, ...imageProps } = props;\n const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);\n useUpdateImageCount(context.setImageCount);\n\n const imageLoadingStatus = useImageLoadingStatus(src, {\n referrerPolicy: imageProps.referrerPolicy,\n crossOrigin: imageProps.crossOrigin,\n loadingStatus: context.imageLoadingStatus,\n setLoadingStatus: context.setImageLoadingStatus,\n });\n const handleLoadingStatusChange = useCallbackRef((status: ImageLoadingStatus) => {\n onLoadingStatusChange?.(status);\n });\n\n const loadingStatusRef = React.useRef(imageLoadingStatus);\n\n useLayoutEffect(() => {\n const previousLoadingStatus = loadingStatusRef.current;\n loadingStatusRef.current = imageLoadingStatus;\n\n if (imageLoadingStatus !== previousLoadingStatus) {\n handleLoadingStatusChange(imageLoadingStatus);\n }\n }, [imageLoadingStatus, handleLoadingStatusChange]);\n\n return imageLoadingStatus === 'loaded' ? (\n \n ) : null;\n },\n);\n\nAvatarImage.displayName = IMAGE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AvatarFallback\n * -----------------------------------------------------------------------------------------------*/\n\nconst FALLBACK_NAME = 'AvatarFallback';\n\ntype AvatarFallbackElement = React.ComponentRef;\ninterface AvatarFallbackProps extends PrimitiveSpanProps {\n delayMs?: number;\n}\n\nconst AvatarFallback = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeAvatar, delayMs, ...fallbackProps } = props;\n const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);\n const [canRender, setCanRender] = React.useState(delayMs === undefined);\n\n React.useEffect(() => {\n if (delayMs !== undefined) {\n const timerId = window.setTimeout(() => setCanRender(true), delayMs);\n return () => window.clearTimeout(timerId);\n }\n }, [delayMs]);\n\n return canRender && context.imageLoadingStatus !== 'loaded' ? (\n \n ) : null;\n },\n);\n\nAvatarFallback.displayName = FALLBACK_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useImageLoadingStatus(\n src: string | undefined,\n {\n loadingStatus,\n setLoadingStatus,\n referrerPolicy,\n crossOrigin,\n }: {\n referrerPolicy: React.HTMLAttributeReferrerPolicy | undefined;\n crossOrigin: string | undefined;\n loadingStatus: ImageLoadingStatus;\n setLoadingStatus: React.Dispatch>;\n },\n) {\n useLayoutEffect(() => {\n if (!src) {\n setLoadingStatus('error');\n return;\n }\n\n const image = new window.Image();\n const handleLoad = (event: Event) => {\n const image = event.currentTarget as HTMLImageElement;\n setLoadingStatus(getImageLoadingStatus(image));\n };\n const handleError = () => setLoadingStatus('error');\n image.addEventListener('load', handleLoad);\n image.addEventListener('error', handleError);\n if (referrerPolicy) {\n image.referrerPolicy = referrerPolicy;\n }\n image.crossOrigin = crossOrigin ?? null;\n image.src = src;\n\n setLoadingStatus(getImageLoadingStatus(image));\n return () => {\n image.removeEventListener('load', handleLoad);\n image.removeEventListener('error', handleError);\n setLoadingStatus('idle');\n };\n }, [src, crossOrigin, referrerPolicy, setLoadingStatus]);\n\n return loadingStatus;\n}\n\nfunction getImageLoadingStatus(image: HTMLImageElement) {\n return image.complete ? (image.naturalWidth > 0 ? 'loaded' : 'error') : 'loading';\n}\n\n// Image count is only used in development to warn about multiple images, which\n// is unsupported. Gating behind a development flag to avoid performance\n// overhead in production is safe because useState is guaranteed to run\n// consistently in the same environment.\n// oxlint-disable react-hooks/rules-of-hooks\nfunction useImageCount() {\n let state = STATIC_IMAGE_COUNT_STATE;\n if (process.env.NODE_ENV !== 'production') {\n state = React.useState(0);\n const [imageCount] = state;\n const hasWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (imageCount > 1 && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n 'Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior.',\n );\n }\n }, [imageCount]);\n }\n\n return state;\n}\n\nfunction useUpdateImageCount(setImageCount: React.Dispatch>) {\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n setImageCount((imageCount) => imageCount + 1);\n return () => {\n setImageCount((imageCount) => imageCount - 1);\n };\n }, [setImageCount]);\n }\n}\n// oxlint-enable react-hooks/rules-of-hooks\n\nexport {\n createAvatarScope,\n //\n Avatar,\n AvatarImage,\n AvatarFallback,\n //\n Avatar as Root,\n AvatarImage as Image,\n AvatarFallback as Fallback,\n};\nexport type { AvatarProps, AvatarImageProps, AvatarFallbackProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AA+ClB;AAvCR,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,IAAI,mBAAmB,WAAW;AAW/E,IAAM,2BAAmF;AAAA,EACvF;AAAA,EACA,MAAM;AACR;AAEA,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAM9F,IAAM,SAAe;AAAA,EACnB,CAAC,OAAiC,iBAAiB;AACjD,UAAM,EAAE,eAAe,GAAG,YAAY,IAAI;AAC1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B;AACvB,MAAI,QAAQ;AACZ,MAAI,MAAuC;AACzC,YAAc,eAAS,CAAC;AACxB,UAAM,CAAC,UAAU,IAAI;AACrB,UAAM,eAAqB,aAAO,KAAK;AACvC,IAAM,gBAAU,MAAM;AACpB,UAAI,aAAa,KAAK,CAAC,aAAa,SAAS;AAC3C,qBAAa,UAAU;AACvB,gBAAQ;AAAA,UACN;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,UAAU,CAAC;AAAA,EACjB;AAEA,SAAO;AACT;AAEA,SAAS,oBAAoB,eAA6D;AACxF,MAAI,MAAuC;AACzC,IAAM,gBAAU,MAAM;AACpB,oBAAc,CAAC,eAAe,aAAa,CAAC;AAC5C,aAAO,MAAM;AACX,sBAAc,CAAC,eAAe,aAAa,CAAC;AAAA,MAC9C;AAAA,IACF,GAAG,CAAC,aAAa,CAAC;AAAA,EACpB;AACF;", + "names": ["image"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ae25f0f386880f5b6ec428be883e0cd2bb59a661 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-avatar/package.json @@ -0,0 +1,72 @@ +{ + "name": "@radix-ui/react-avatar", + "version": "1.2.0", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-is-hydrated": "0.1.1", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/avatar" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f934a79a159d54908beb179aceded5aa8beffa75 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/README.md @@ -0,0 +1,3 @@ +# `react-checkbox` + +View docs [here](https://radix-ui.com/primitives/docs/components/checkbox). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..dbee673a65783784c2d5e6be4042ce1df92faf0b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.d.mts @@ -0,0 +1,50 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeCheckbox?: Scope; +}; +declare const createCheckboxScope: _radix_ui_react_context.CreateScope; +type CheckedState = boolean | 'indeterminate'; +interface CheckboxProviderProps { + checked?: State | boolean; + defaultChecked?: State | boolean; + required?: boolean; + onCheckedChange?(checked: State | boolean): void; + name?: string; + form?: string; + disabled?: boolean; + value?: string | number | readonly string[]; + children?: React.ReactNode; +} +declare function CheckboxProvider(props: ScopedProps>): react_jsx_runtime.JSX.Element; +interface CheckboxTriggerProps extends Omit, keyof CheckboxProviderProps> { + children?: React.ReactNode; +} +declare const CheckboxTrigger: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface CheckboxProps extends Omit { + checked?: CheckedState; + defaultChecked?: CheckedState; + required?: boolean; + onCheckedChange?(checked: CheckedState): void; +} +declare const Checkbox: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface CheckboxIndicatorProps extends PrimitiveSpanProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const CheckboxIndicator: React.ForwardRefExoticComponent>; +type InputProps = React.ComponentPropsWithoutRef; +interface CheckboxBubbleInputProps extends Omit { +} +declare const CheckboxBubbleInput: React.ForwardRefExoticComponent>; + +export { Checkbox, CheckboxIndicator, type CheckboxIndicatorProps, type CheckboxProps, type CheckedState, CheckboxIndicator as Indicator, Checkbox as Root, createCheckboxScope, CheckboxBubbleInput as unstable_BubbleInput, CheckboxBubbleInput as unstable_CheckboxBubbleInput, type CheckboxBubbleInputProps as unstable_CheckboxBubbleInputProps, CheckboxProvider as unstable_CheckboxProvider, type CheckboxProviderProps as unstable_CheckboxProviderProps, CheckboxTrigger as unstable_CheckboxTrigger, type CheckboxTriggerProps as unstable_CheckboxTriggerProps, CheckboxProvider as unstable_Provider, CheckboxTrigger as unstable_Trigger }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbee673a65783784c2d5e6be4042ce1df92faf0b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.d.ts @@ -0,0 +1,50 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeCheckbox?: Scope; +}; +declare const createCheckboxScope: _radix_ui_react_context.CreateScope; +type CheckedState = boolean | 'indeterminate'; +interface CheckboxProviderProps { + checked?: State | boolean; + defaultChecked?: State | boolean; + required?: boolean; + onCheckedChange?(checked: State | boolean): void; + name?: string; + form?: string; + disabled?: boolean; + value?: string | number | readonly string[]; + children?: React.ReactNode; +} +declare function CheckboxProvider(props: ScopedProps>): react_jsx_runtime.JSX.Element; +interface CheckboxTriggerProps extends Omit, keyof CheckboxProviderProps> { + children?: React.ReactNode; +} +declare const CheckboxTrigger: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface CheckboxProps extends Omit { + checked?: CheckedState; + defaultChecked?: CheckedState; + required?: boolean; + onCheckedChange?(checked: CheckedState): void; +} +declare const Checkbox: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface CheckboxIndicatorProps extends PrimitiveSpanProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const CheckboxIndicator: React.ForwardRefExoticComponent>; +type InputProps = React.ComponentPropsWithoutRef; +interface CheckboxBubbleInputProps extends Omit { +} +declare const CheckboxBubbleInput: React.ForwardRefExoticComponent>; + +export { Checkbox, CheckboxIndicator, type CheckboxIndicatorProps, type CheckboxProps, type CheckedState, CheckboxIndicator as Indicator, Checkbox as Root, createCheckboxScope, CheckboxBubbleInput as unstable_BubbleInput, CheckboxBubbleInput as unstable_CheckboxBubbleInput, type CheckboxBubbleInputProps as unstable_CheckboxBubbleInputProps, CheckboxProvider as unstable_CheckboxProvider, type CheckboxProviderProps as unstable_CheckboxProviderProps, CheckboxTrigger as unstable_CheckboxTrigger, type CheckboxTriggerProps as unstable_CheckboxTriggerProps, CheckboxProvider as unstable_Provider, CheckboxTrigger as unstable_Trigger }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6fb1a27897e543acf531704205f561f98eba0229 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.js @@ -0,0 +1,316 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Checkbox: () => Checkbox, + CheckboxIndicator: () => CheckboxIndicator, + Indicator: () => CheckboxIndicator, + Root: () => Checkbox, + createCheckboxScope: () => createCheckboxScope, + unstable_BubbleInput: () => CheckboxBubbleInput, + unstable_CheckboxBubbleInput: () => CheckboxBubbleInput, + unstable_CheckboxProvider: () => CheckboxProvider, + unstable_CheckboxTrigger: () => CheckboxTrigger, + unstable_Provider: () => CheckboxProvider, + unstable_Trigger: () => CheckboxTrigger +}); +module.exports = __toCommonJS(index_exports); + +// src/checkbox.tsx +var React = __toESM(require("react")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_use_previous = require("@radix-ui/react-use-previous"); +var import_react_use_size = require("@radix-ui/react-use-size"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var CHECKBOX_NAME = "Checkbox"; +var [createCheckboxContext, createCheckboxScope] = (0, import_react_context.createContextScope)(CHECKBOX_NAME); +var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME); +function CheckboxProvider(props) { + const { + __scopeCheckbox, + checked: checkedProp, + children, + defaultChecked, + disabled, + form, + name, + onCheckedChange, + required, + value = "on", + // @ts-expect-error + internal_do_not_use_render + } = props; + const [checked, setChecked] = (0, import_react_use_controllable_state.useControllableState)({ + prop: checkedProp, + defaultProp: defaultChecked ?? false, + onChange: onCheckedChange, + caller: CHECKBOX_NAME + }); + const [control, setControl] = React.useState(null); + const [bubbleInput, setBubbleInput] = React.useState(null); + const hasConsumerStoppedPropagationRef = React.useRef(false); + const isFormControl = control ? !!form || !!control.closest("form") : ( + // We set this to true by default so that events bubble to forms without JS (SSR) + true + ); + const context = { + checked, + disabled, + setChecked, + control, + setControl, + name, + form, + value, + hasConsumerStoppedPropagationRef, + required, + defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked, + isFormControl, + bubbleInput, + setBubbleInput + }; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CheckboxProviderImpl, + { + scope: __scopeCheckbox, + ...context, + children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children + } + ); +} +var TRIGGER_NAME = "CheckboxTrigger"; +var CheckboxTrigger = React.forwardRef( + ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => { + const { + control, + value, + disabled, + checked, + required, + setControl, + setChecked, + hasConsumerStoppedPropagationRef, + isFormControl, + bubbleInput + } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, setControl); + const initialCheckedStateRef = React.useRef(checked); + React.useEffect(() => { + const form = control?.form; + if (form) { + const reset = () => setChecked(initialCheckedStateRef.current); + form.addEventListener("reset", reset); + return () => form.removeEventListener("reset", reset); + } + }, [control, setChecked]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + role: "checkbox", + "aria-checked": isIndeterminate(checked) ? "mixed" : checked, + "aria-required": required, + "data-state": getState(checked), + "data-disabled": disabled ? "" : void 0, + disabled, + value, + ...checkboxProps, + ref: composedRefs, + onKeyDown: (0, import_primitive.composeEventHandlers)(onKeyDown, (event) => { + if (event.key === "Enter") event.preventDefault(); + }), + onClick: (0, import_primitive.composeEventHandlers)(onClick, (event) => { + setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked); + if (bubbleInput && isFormControl) { + hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(); + if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation(); + } + }) + } + ); + } +); +CheckboxTrigger.displayName = TRIGGER_NAME; +var Checkbox = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeCheckbox, + name, + checked, + defaultChecked, + required, + disabled, + value, + onCheckedChange, + form, + ...checkboxProps + } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CheckboxProvider, + { + __scopeCheckbox, + checked, + defaultChecked, + disabled, + required, + onCheckedChange, + name, + form, + value, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CheckboxTrigger, + { + ...checkboxProps, + ref: forwardedRef, + __scopeCheckbox + } + ), + isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CheckboxBubbleInput, + { + __scopeCheckbox + } + ) + ] }) + } + ); + } +); +Checkbox.displayName = CHECKBOX_NAME; +var INDICATOR_NAME = "CheckboxIndicator"; +var CheckboxIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeCheckbox, forceMount, ...indicatorProps } = props; + const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_presence.Presence, + { + present: forceMount || isIndeterminate(context.checked) || context.checked === true, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.span, + { + "data-state": getState(context.checked), + "data-disabled": context.disabled ? "" : void 0, + ...indicatorProps, + ref: forwardedRef, + style: { pointerEvents: "none", ...props.style } + } + ) + } + ); + } +); +CheckboxIndicator.displayName = INDICATOR_NAME; +var BUBBLE_INPUT_NAME = "CheckboxBubbleInput"; +var CheckboxBubbleInput = React.forwardRef( + ({ __scopeCheckbox, ...props }, forwardedRef) => { + const { + control, + hasConsumerStoppedPropagationRef, + checked, + defaultChecked, + required, + disabled, + name, + value, + form, + bubbleInput, + setBubbleInput + } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, setBubbleInput); + const prevChecked = (0, import_react_use_previous.usePrevious)(checked); + const controlSize = (0, import_react_use_size.useSize)(control); + React.useEffect(() => { + const input = bubbleInput; + if (!input) return; + const inputProto = window.HTMLInputElement.prototype; + const descriptor = Object.getOwnPropertyDescriptor( + inputProto, + "checked" + ); + const setChecked = descriptor.set; + const bubbles = !hasConsumerStoppedPropagationRef.current; + if (prevChecked !== checked && setChecked) { + const event = new Event("click", { bubbles }); + input.indeterminate = isIndeterminate(checked); + setChecked.call(input, isIndeterminate(checked) ? false : checked); + input.dispatchEvent(event); + } + }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]); + const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.input, + { + type: "checkbox", + "aria-hidden": true, + defaultChecked: defaultChecked ?? defaultCheckedRef.current, + required, + disabled, + name, + value, + form, + ...props, + tabIndex: -1, + ref: composedRefs, + style: { + ...props.style, + ...controlSize, + position: "absolute", + pointerEvents: "none", + opacity: 0, + margin: 0, + // We transform because the input is absolutely positioned but we have + // rendered it **after** the button. This pulls it back to sit on top + // of the button. + transform: "translateX(-100%)" + } + } + ); + } +); +CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME; +function isFunction(value) { + return typeof value === "function"; +} +function isIndeterminate(checked) { + return checked === "indeterminate"; +} +function getState(checked) { + return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..824950daadc6587d33803071f97ec3d3007b4d9d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/checkbox.tsx"], + "sourcesContent": ["'use client';\nexport {\n createCheckboxScope,\n //\n Checkbox,\n CheckboxProvider as unstable_CheckboxProvider,\n CheckboxTrigger as unstable_CheckboxTrigger,\n CheckboxIndicator,\n CheckboxBubbleInput as unstable_CheckboxBubbleInput,\n //\n Root,\n Provider as unstable_Provider,\n Trigger as unstable_Trigger,\n Indicator,\n BubbleInput as unstable_BubbleInput,\n} from './checkbox';\nexport type {\n CheckboxProps,\n CheckboxProviderProps as unstable_CheckboxProviderProps,\n CheckboxTriggerProps as unstable_CheckboxTriggerProps,\n CheckboxIndicatorProps,\n CheckboxBubbleInputProps as unstable_CheckboxBubbleInputProps,\n CheckedState,\n} from './checkbox';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst CHECKBOX_NAME = 'Checkbox';\n\ntype ScopedProps

= P & { __scopeCheckbox?: Scope };\nconst [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxContextValue = {\n checked: State | boolean;\n setChecked: React.Dispatch>;\n disabled: boolean | undefined;\n control: HTMLButtonElement | null;\n setControl: React.Dispatch>;\n name: string | undefined;\n form: string | undefined;\n value: string | number | readonly string[];\n hasConsumerStoppedPropagationRef: React.RefObject;\n required: boolean | undefined;\n defaultChecked: boolean | undefined;\n isFormControl: boolean;\n bubbleInput: HTMLInputElement | null;\n setBubbleInput: React.Dispatch>;\n};\n\nconst [CheckboxProviderImpl, useCheckboxContext] =\n createCheckboxContext(CHECKBOX_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CheckboxProviderProps {\n checked?: State | boolean;\n defaultChecked?: State | boolean;\n required?: boolean;\n onCheckedChange?(checked: State | boolean): void;\n name?: string;\n form?: string;\n disabled?: boolean;\n value?: string | number | readonly string[];\n children?: React.ReactNode;\n}\n\nfunction CheckboxProvider(\n props: ScopedProps>,\n) {\n const {\n __scopeCheckbox,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = 'on',\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: CHECKBOX_NAME,\n });\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = control\n ? !!form || !!control.closest('form')\n : // We set this to true by default so that events bubble to forms without JS (SSR)\n true;\n\n const context: CheckboxContextValue = {\n checked: checked,\n disabled: disabled,\n setChecked: setChecked,\n control: control,\n setControl: setControl,\n name: name,\n form: form,\n value: value,\n hasConsumerStoppedPropagationRef: hasConsumerStoppedPropagationRef,\n required: required,\n defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,\n isFormControl: isFormControl,\n bubbleInput,\n setBubbleInput,\n };\n\n return (\n )}\n >\n {isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children}\n \n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'CheckboxTrigger';\n\ninterface CheckboxTriggerProps extends Omit<\n React.ComponentPropsWithoutRef,\n keyof CheckboxProviderProps\n> {\n children?: React.ReactNode;\n}\n\nconst CheckboxTrigger = React.forwardRef(\n (\n { __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }: ScopedProps,\n forwardedRef,\n ) => {\n const {\n control,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const form = control?.form;\n if (form) {\n const reset = () => setChecked(initialCheckedStateRef.current);\n form.addEventListener('reset', reset);\n return () => form.removeEventListener('reset', reset);\n }\n }, [control, setChecked]);\n\n return (\n {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onClick={composeEventHandlers(onClick, (event) => {\n setChecked((prevChecked) => (isIndeterminate(prevChecked) ? true : !prevChecked));\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if checkbox has a bubble input and is a form control, stop\n // propagation from the button so that we only propagate one click\n // event (from the input). We propagate changes from an input so\n // that native form validation works and form events reflect\n // checkbox updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n );\n },\n);\n\nCheckboxTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Checkbox\n * -----------------------------------------------------------------------------------------------*/\n\ntype CheckboxElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface CheckboxProps extends Omit {\n checked?: CheckedState;\n defaultChecked?: CheckedState;\n required?: boolean;\n onCheckedChange?(checked: CheckedState): void;\n}\n\nconst Checkbox = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeCheckbox,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...checkboxProps\n } = props;\n\n return (\n (\n <>\n \n {isFormControl && (\n \n )}\n \n )}\n />\n );\n },\n);\n\nCheckbox.displayName = CHECKBOX_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxIndicator';\n\ntype CheckboxIndicatorElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface CheckboxIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst CheckboxIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeCheckbox, forceMount, ...indicatorProps } = props;\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);\n return (\n \n \n \n );\n },\n);\n\nCheckboxIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'CheckboxBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef;\ninterface CheckboxBubbleInputProps extends Omit {}\n\nconst CheckboxBubbleInput = React.forwardRef(\n ({ __scopeCheckbox, ...props }: ScopedProps, forwardedRef) => {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput,\n } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);\n\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked',\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n\n const bubbles = !hasConsumerStoppedPropagationRef.current;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n input.indeterminate = isIndeterminate(checked);\n setChecked.call(input, isIndeterminate(checked) ? false : checked);\n input.dispatchEvent(event);\n }\n }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);\n\n const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked);\n return (\n \n );\n },\n);\n\nCheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createCheckboxScope,\n //\n Checkbox,\n CheckboxProvider,\n CheckboxTrigger,\n CheckboxIndicator,\n CheckboxBubbleInput,\n //\n Checkbox as Root,\n CheckboxProvider as Provider,\n CheckboxTrigger as Trigger,\n CheckboxIndicator as Indicator,\n CheckboxBubbleInput as BubbleInput,\n};\nexport type {\n CheckboxProps,\n CheckboxProviderProps,\n CheckboxTriggerProps,\n CheckboxIndicatorProps,\n CheckboxBubbleInputProps,\n CheckedState,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,gCAAgC;AAChC,2BAAmC;AACnC,uBAAqC;AACrC,0CAAqC;AACrC,gCAA4B;AAC5B,4BAAwB;AACxB,4BAAyB;AACzB,6BAA0B;AAiGtB;AA7FJ,IAAM,gBAAgB;AAGtB,IAAM,CAAC,uBAAuB,mBAAmB,QAAI,yCAAmB,aAAa;AAqBrF,IAAM,CAAC,sBAAsB,kBAAkB,IAC7C,sBAA4C,aAAa;AAkB3D,SAAS,iBACP,OACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA;AAAA,IAER;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,SAAS,UAAU,QAAI,0DAAqB;AAAA,IACjD,MAAM;AAAA,IACN,aAAa,kBAAkB;AAAA,IAC/B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV,CAAC;AACD,QAAM,CAAC,SAAS,UAAU,IAAU,eAAmC,IAAI;AAC3E,QAAM,CAAC,aAAa,cAAc,IAAU,eAAkC,IAAI;AAClF,QAAM,mCAAyC,aAAO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AAA,IACF,GAAG,CAAC,aAAa,aAAa,SAAS,gCAAgC,CAAC;AAExE,UAAM,oBAA0B,aAAO,gBAAgB,OAAO,IAAI,QAAQ,OAAO;AACjF,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACL,eAAW;AAAA,QACX,gBAAgB,kBAAkB,kBAAkB;AAAA,QACpD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QACJ,UAAU;AAAA,QACV,KAAK;AAAA,QACL,OAAO;AAAA,UACL,GAAG,MAAM;AAAA,UACT,GAAG;AAAA,UACH,UAAU;AAAA,UACV,eAAe;AAAA,UACf,SAAS;AAAA,UACT,QAAQ;AAAA;AAAA;AAAA;AAAA,UAIR,WAAW;AAAA,QACb;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;AAIlC,SAAS,WAAW,OAAkD;AACpE,SAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,gBAAgB,SAAoD;AAC3E,SAAO,YAAY;AACrB;AAEA,SAAS,SAAS,SAAuB;AACvC,SAAO,gBAAgB,OAAO,IAAI,kBAAkB,UAAU,YAAY;AAC5E;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3f718f60b0032a25ad9386082aab9329bd6f5c7a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.mjs @@ -0,0 +1,284 @@ +"use client"; + +// src/checkbox.tsx +import * as React from "react"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { usePrevious } from "@radix-ui/react-use-previous"; +import { useSize } from "@radix-ui/react-use-size"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive } from "@radix-ui/react-primitive"; +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var CHECKBOX_NAME = "Checkbox"; +var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME); +var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME); +function CheckboxProvider(props) { + const { + __scopeCheckbox, + checked: checkedProp, + children, + defaultChecked, + disabled, + form, + name, + onCheckedChange, + required, + value = "on", + // @ts-expect-error + internal_do_not_use_render + } = props; + const [checked, setChecked] = useControllableState({ + prop: checkedProp, + defaultProp: defaultChecked ?? false, + onChange: onCheckedChange, + caller: CHECKBOX_NAME + }); + const [control, setControl] = React.useState(null); + const [bubbleInput, setBubbleInput] = React.useState(null); + const hasConsumerStoppedPropagationRef = React.useRef(false); + const isFormControl = control ? !!form || !!control.closest("form") : ( + // We set this to true by default so that events bubble to forms without JS (SSR) + true + ); + const context = { + checked, + disabled, + setChecked, + control, + setControl, + name, + form, + value, + hasConsumerStoppedPropagationRef, + required, + defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked, + isFormControl, + bubbleInput, + setBubbleInput + }; + return /* @__PURE__ */ jsx( + CheckboxProviderImpl, + { + scope: __scopeCheckbox, + ...context, + children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children + } + ); +} +var TRIGGER_NAME = "CheckboxTrigger"; +var CheckboxTrigger = React.forwardRef( + ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => { + const { + control, + value, + disabled, + checked, + required, + setControl, + setChecked, + hasConsumerStoppedPropagationRef, + isFormControl, + bubbleInput + } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox); + const composedRefs = useComposedRefs(forwardedRef, setControl); + const initialCheckedStateRef = React.useRef(checked); + React.useEffect(() => { + const form = control?.form; + if (form) { + const reset = () => setChecked(initialCheckedStateRef.current); + form.addEventListener("reset", reset); + return () => form.removeEventListener("reset", reset); + } + }, [control, setChecked]); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + role: "checkbox", + "aria-checked": isIndeterminate(checked) ? "mixed" : checked, + "aria-required": required, + "data-state": getState(checked), + "data-disabled": disabled ? "" : void 0, + disabled, + value, + ...checkboxProps, + ref: composedRefs, + onKeyDown: composeEventHandlers(onKeyDown, (event) => { + if (event.key === "Enter") event.preventDefault(); + }), + onClick: composeEventHandlers(onClick, (event) => { + setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked); + if (bubbleInput && isFormControl) { + hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(); + if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation(); + } + }) + } + ); + } +); +CheckboxTrigger.displayName = TRIGGER_NAME; +var Checkbox = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeCheckbox, + name, + checked, + defaultChecked, + required, + disabled, + value, + onCheckedChange, + form, + ...checkboxProps + } = props; + return /* @__PURE__ */ jsx( + CheckboxProvider, + { + __scopeCheckbox, + checked, + defaultChecked, + disabled, + required, + onCheckedChange, + name, + form, + value, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx( + CheckboxTrigger, + { + ...checkboxProps, + ref: forwardedRef, + __scopeCheckbox + } + ), + isFormControl && /* @__PURE__ */ jsx( + CheckboxBubbleInput, + { + __scopeCheckbox + } + ) + ] }) + } + ); + } +); +Checkbox.displayName = CHECKBOX_NAME; +var INDICATOR_NAME = "CheckboxIndicator"; +var CheckboxIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeCheckbox, forceMount, ...indicatorProps } = props; + const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox); + return /* @__PURE__ */ jsx( + Presence, + { + present: forceMount || isIndeterminate(context.checked) || context.checked === true, + children: /* @__PURE__ */ jsx( + Primitive.span, + { + "data-state": getState(context.checked), + "data-disabled": context.disabled ? "" : void 0, + ...indicatorProps, + ref: forwardedRef, + style: { pointerEvents: "none", ...props.style } + } + ) + } + ); + } +); +CheckboxIndicator.displayName = INDICATOR_NAME; +var BUBBLE_INPUT_NAME = "CheckboxBubbleInput"; +var CheckboxBubbleInput = React.forwardRef( + ({ __scopeCheckbox, ...props }, forwardedRef) => { + const { + control, + hasConsumerStoppedPropagationRef, + checked, + defaultChecked, + required, + disabled, + name, + value, + form, + bubbleInput, + setBubbleInput + } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox); + const composedRefs = useComposedRefs(forwardedRef, setBubbleInput); + const prevChecked = usePrevious(checked); + const controlSize = useSize(control); + React.useEffect(() => { + const input = bubbleInput; + if (!input) return; + const inputProto = window.HTMLInputElement.prototype; + const descriptor = Object.getOwnPropertyDescriptor( + inputProto, + "checked" + ); + const setChecked = descriptor.set; + const bubbles = !hasConsumerStoppedPropagationRef.current; + if (prevChecked !== checked && setChecked) { + const event = new Event("click", { bubbles }); + input.indeterminate = isIndeterminate(checked); + setChecked.call(input, isIndeterminate(checked) ? false : checked); + input.dispatchEvent(event); + } + }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]); + const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked); + return /* @__PURE__ */ jsx( + Primitive.input, + { + type: "checkbox", + "aria-hidden": true, + defaultChecked: defaultChecked ?? defaultCheckedRef.current, + required, + disabled, + name, + value, + form, + ...props, + tabIndex: -1, + ref: composedRefs, + style: { + ...props.style, + ...controlSize, + position: "absolute", + pointerEvents: "none", + opacity: 0, + margin: 0, + // We transform because the input is absolutely positioned but we have + // rendered it **after** the button. This pulls it back to sit on top + // of the button. + transform: "translateX(-100%)" + } + } + ); + } +); +CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME; +function isFunction(value) { + return typeof value === "function"; +} +function isIndeterminate(checked) { + return checked === "indeterminate"; +} +function getState(checked) { + return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; +} +export { + Checkbox, + CheckboxIndicator, + CheckboxIndicator as Indicator, + Checkbox as Root, + createCheckboxScope, + CheckboxBubbleInput as unstable_BubbleInput, + CheckboxBubbleInput as unstable_CheckboxBubbleInput, + CheckboxProvider as unstable_CheckboxProvider, + CheckboxTrigger as unstable_CheckboxTrigger, + CheckboxProvider as unstable_Provider, + CheckboxTrigger as unstable_Trigger +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..74d9491ae675e8f40ae7ee70ea06f4c4ec2e6b13 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/checkbox.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst CHECKBOX_NAME = 'Checkbox';\n\ntype ScopedProps

= P & { __scopeCheckbox?: Scope };\nconst [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxContextValue = {\n checked: State | boolean;\n setChecked: React.Dispatch>;\n disabled: boolean | undefined;\n control: HTMLButtonElement | null;\n setControl: React.Dispatch>;\n name: string | undefined;\n form: string | undefined;\n value: string | number | readonly string[];\n hasConsumerStoppedPropagationRef: React.RefObject;\n required: boolean | undefined;\n defaultChecked: boolean | undefined;\n isFormControl: boolean;\n bubbleInput: HTMLInputElement | null;\n setBubbleInput: React.Dispatch>;\n};\n\nconst [CheckboxProviderImpl, useCheckboxContext] =\n createCheckboxContext(CHECKBOX_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CheckboxProviderProps {\n checked?: State | boolean;\n defaultChecked?: State | boolean;\n required?: boolean;\n onCheckedChange?(checked: State | boolean): void;\n name?: string;\n form?: string;\n disabled?: boolean;\n value?: string | number | readonly string[];\n children?: React.ReactNode;\n}\n\nfunction CheckboxProvider(\n props: ScopedProps>,\n) {\n const {\n __scopeCheckbox,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = 'on',\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: CHECKBOX_NAME,\n });\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = control\n ? !!form || !!control.closest('form')\n : // We set this to true by default so that events bubble to forms without JS (SSR)\n true;\n\n const context: CheckboxContextValue = {\n checked: checked,\n disabled: disabled,\n setChecked: setChecked,\n control: control,\n setControl: setControl,\n name: name,\n form: form,\n value: value,\n hasConsumerStoppedPropagationRef: hasConsumerStoppedPropagationRef,\n required: required,\n defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,\n isFormControl: isFormControl,\n bubbleInput,\n setBubbleInput,\n };\n\n return (\n )}\n >\n {isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children}\n \n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'CheckboxTrigger';\n\ninterface CheckboxTriggerProps extends Omit<\n React.ComponentPropsWithoutRef,\n keyof CheckboxProviderProps\n> {\n children?: React.ReactNode;\n}\n\nconst CheckboxTrigger = React.forwardRef(\n (\n { __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }: ScopedProps,\n forwardedRef,\n ) => {\n const {\n control,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const form = control?.form;\n if (form) {\n const reset = () => setChecked(initialCheckedStateRef.current);\n form.addEventListener('reset', reset);\n return () => form.removeEventListener('reset', reset);\n }\n }, [control, setChecked]);\n\n return (\n {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onClick={composeEventHandlers(onClick, (event) => {\n setChecked((prevChecked) => (isIndeterminate(prevChecked) ? true : !prevChecked));\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if checkbox has a bubble input and is a form control, stop\n // propagation from the button so that we only propagate one click\n // event (from the input). We propagate changes from an input so\n // that native form validation works and form events reflect\n // checkbox updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n );\n },\n);\n\nCheckboxTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Checkbox\n * -----------------------------------------------------------------------------------------------*/\n\ntype CheckboxElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface CheckboxProps extends Omit {\n checked?: CheckedState;\n defaultChecked?: CheckedState;\n required?: boolean;\n onCheckedChange?(checked: CheckedState): void;\n}\n\nconst Checkbox = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeCheckbox,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...checkboxProps\n } = props;\n\n return (\n (\n <>\n \n {isFormControl && (\n \n )}\n \n )}\n />\n );\n },\n);\n\nCheckbox.displayName = CHECKBOX_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxIndicator';\n\ntype CheckboxIndicatorElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface CheckboxIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst CheckboxIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeCheckbox, forceMount, ...indicatorProps } = props;\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);\n return (\n \n \n \n );\n },\n);\n\nCheckboxIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'CheckboxBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef;\ninterface CheckboxBubbleInputProps extends Omit {}\n\nconst CheckboxBubbleInput = React.forwardRef(\n ({ __scopeCheckbox, ...props }: ScopedProps, forwardedRef) => {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput,\n } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);\n\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked',\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n\n const bubbles = !hasConsumerStoppedPropagationRef.current;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n input.indeterminate = isIndeterminate(checked);\n setChecked.call(input, isIndeterminate(checked) ? false : checked);\n input.dispatchEvent(event);\n }\n }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);\n\n const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked);\n return (\n \n );\n },\n);\n\nCheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createCheckboxScope,\n //\n Checkbox,\n CheckboxProvider,\n CheckboxTrigger,\n CheckboxIndicator,\n CheckboxBubbleInput,\n //\n Checkbox as Root,\n CheckboxProvider as Provider,\n CheckboxTrigger as Trigger,\n CheckboxIndicator as Indicator,\n CheckboxBubbleInput as BubbleInput,\n};\nexport type {\n CheckboxProps,\n CheckboxProviderProps,\n CheckboxTriggerProps,\n CheckboxIndicatorProps,\n CheckboxBubbleInputProps,\n CheckedState,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAiGtB,SA+HM,UA/HN,KA+HM,YA/HN;AA7FJ,IAAM,gBAAgB;AAGtB,IAAM,CAAC,uBAAuB,mBAAmB,IAAI,mBAAmB,aAAa;AAqBrF,IAAM,CAAC,sBAAsB,kBAAkB,IAC7C,sBAA4C,aAAa;AAkB3D,S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node_modules/@radix-ui/react-checkbox/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a1cd387ded59d88b2b110ad55f5422de66a39f81 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-checkbox/package.json @@ -0,0 +1,75 @@ +{ + "name": "@radix-ui/react-checkbox", + "version": "1.3.5", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-size": "1.1.2", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-previous": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/typescript-config": "0.0.0", + "@repo/builder": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/checkbox" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ce3d5bba01a9898b28207bdac37b6d4aee71bc83 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/README.md @@ -0,0 +1,3 @@ +# `react-collapsible` + +View docs [here](https://radix-ui.com/primitives/docs/components/collapsible). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..28cb0f12a349b86126fa41a64602936dfe3a66c1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.d.mts @@ -0,0 +1,33 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createCollapsibleScope: _radix_ui_react_context.CreateScope; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface CollapsibleProps extends PrimitiveDivProps { + defaultOpen?: boolean; + open?: boolean; + disabled?: boolean; + onOpenChange?(open: boolean): void; +} +declare const Collapsible: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface CollapsibleTriggerProps extends PrimitiveButtonProps { +} +declare const CollapsibleTrigger: React.ForwardRefExoticComponent>; +interface CollapsibleContentProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const CollapsibleContent: React.ForwardRefExoticComponent>; +interface CollapsibleContentImplProps extends PrimitiveDivProps { + present: boolean; +} +declare const Root: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; + +export { Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Content, Root, Trigger, createCollapsibleScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..28cb0f12a349b86126fa41a64602936dfe3a66c1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.d.ts @@ -0,0 +1,33 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createCollapsibleScope: _radix_ui_react_context.CreateScope; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface CollapsibleProps extends PrimitiveDivProps { + defaultOpen?: boolean; + open?: boolean; + disabled?: boolean; + onOpenChange?(open: boolean): void; +} +declare const Collapsible: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface CollapsibleTriggerProps extends PrimitiveButtonProps { +} +declare const CollapsibleTrigger: React.ForwardRefExoticComponent>; +interface CollapsibleContentProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const CollapsibleContent: React.ForwardRefExoticComponent>; +interface CollapsibleContentImplProps extends PrimitiveDivProps { + present: boolean; +} +declare const Root: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; + +export { Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Content, Root, Trigger, createCollapsibleScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..40e309ac3deeb55f45ae8ef0d409850801f5d759 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.js @@ -0,0 +1,187 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Collapsible: () => Collapsible, + CollapsibleContent: () => CollapsibleContent, + CollapsibleTrigger: () => CollapsibleTrigger, + Content: () => Content, + Root: () => Root, + Trigger: () => Trigger, + createCollapsibleScope: () => createCollapsibleScope +}); +module.exports = __toCommonJS(index_exports); + +// src/collapsible.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_id = require("@radix-ui/react-id"); +var import_jsx_runtime = require("react/jsx-runtime"); +var COLLAPSIBLE_NAME = "Collapsible"; +var [createCollapsibleContext, createCollapsibleScope] = (0, import_react_context.createContextScope)(COLLAPSIBLE_NAME); +var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME); +var Collapsible = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeCollapsible, + open: openProp, + defaultOpen, + disabled, + onOpenChange, + ...collapsibleProps + } = props; + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: COLLAPSIBLE_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + CollapsibleProvider, + { + scope: __scopeCollapsible, + disabled, + contentId: (0, import_react_id.useId)(), + open, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-state": getState(open), + "data-disabled": disabled ? "" : void 0, + ...collapsibleProps, + ref: forwardedRef + } + ) + } + ); + } +); +Collapsible.displayName = COLLAPSIBLE_NAME; +var TRIGGER_NAME = "CollapsibleTrigger"; +var CollapsibleTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeCollapsible, ...triggerProps } = props; + const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + "aria-controls": context.open ? context.contentId : void 0, + "aria-expanded": context.open || false, + "data-state": getState(context.open), + "data-disabled": context.disabled ? "" : void 0, + disabled: context.disabled, + ...triggerProps, + ref: forwardedRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle) + } + ); + } +); +CollapsibleTrigger.displayName = TRIGGER_NAME; +var CONTENT_NAME = "CollapsibleContent"; +var CollapsibleContent = React.forwardRef( + (props, forwardedRef) => { + const { forceMount, ...contentProps } = props; + const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) }); + } +); +CollapsibleContent.displayName = CONTENT_NAME; +var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => { + const { __scopeCollapsible, present, children, ...contentProps } = props; + const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible); + const [isPresent, setIsPresent] = React.useState(present); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const heightRef = React.useRef(0); + const height = heightRef.current; + const widthRef = React.useRef(0); + const width = widthRef.current; + const isOpen = context.open || isPresent; + const isMountAnimationPreventedRef = React.useRef(isOpen); + const originalStylesRef = React.useRef(void 0); + React.useEffect(() => { + const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false); + return () => cancelAnimationFrame(rAF); + }, []); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + const node = ref.current; + if (node) { + originalStylesRef.current = originalStylesRef.current || { + transitionDuration: node.style.transitionDuration, + animationName: node.style.animationName + }; + node.style.transitionDuration = "0s"; + node.style.animationName = "none"; + const rect = node.getBoundingClientRect(); + heightRef.current = rect.height; + widthRef.current = rect.width; + if (!isMountAnimationPreventedRef.current) { + node.style.transitionDuration = originalStylesRef.current.transitionDuration; + node.style.animationName = originalStylesRef.current.animationName; + } + setIsPresent(present); + } + }, [context.open, present]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-state": getState(context.open), + "data-disabled": context.disabled ? "" : void 0, + id: context.contentId, + hidden: !isOpen, + ...contentProps, + ref: composedRefs, + style: { + [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0, + [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0, + ...props.style + }, + children: isOpen && children + } + ); +}); +function getState(open) { + return open ? "open" : "closed"; +} +var Root = Collapsible; +var Trigger = CollapsibleTrigger; +var Content = CollapsibleContent; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1fd07154df38c9fd6aaee89c7418dabdfb72393a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-collapsible/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/collapsible.tsx"], + "sourcesContent": ["'use client';\nexport {\n createCollapsibleScope,\n //\n Collapsible,\n CollapsibleTrigger,\n CollapsibleContent,\n //\n Root,\n Trigger,\n Content,\n} from './collapsible';\nexport type {\n CollapsibleProps,\n CollapsibleTriggerProps,\n CollapsibleContentProps,\n} from './collapsible';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Presence } from '@radix-ui/react-presence';\nimport { useId } from '@radix-ui/react-id';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Collapsible\n * -----------------------------------------------------------------------------------------------*/\n\nconst COLLAPSIBLE_NAME = 'Collapsible';\n\ntype ScopedProps

= P & { __scopeCollapsible?: Scope };\nconst [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);\n\ntype CollapsibleContextValue = {\n contentId: string;\n disabled?: boolean;\n open: boolean;\n onOpenToggle(): void;\n};\n\nconst [CollapsibleProvider, useCollapsibleContext] =\n createCollapsibleContext(COLLAPSIBLE_NAME);\n\ntype CollapsibleElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface CollapsibleProps extends PrimitiveDivProps {\n defaultOpen?: boolean;\n open?: boolean;\n disabled?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst Collapsible = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: COLLAPSIBLE_NAME,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n >\n \n \n );\n },\n);\n\nCollapsible.displayName = COLLAPSIBLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CollapsibleTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'CollapsibleTrigger';\n\ntype CollapsibleTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface CollapsibleTriggerProps extends PrimitiveButtonProps {}\n\nconst CollapsibleTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeCollapsible, ...triggerProps } = props;\n const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);\n return (\n \n );\n },\n);\n\nCollapsibleTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CollapsibleContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'CollapsibleContent';\n\ntype CollapsibleContentElement = CollapsibleContentImplElement;\ninterface CollapsibleContentProps extends Omit {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst CollapsibleContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);\n return (\n \n {({ present }) => (\n \n )}\n \n );\n },\n);\n\nCollapsibleContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype CollapsibleContentImplElement = React.ComponentRef;\ninterface CollapsibleContentImplProps extends PrimitiveDivProps {\n present: boolean;\n}\n\nconst CollapsibleContentImpl = React.forwardRef<\n CollapsibleContentImplElement,\n CollapsibleContentImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeCollapsible, present, children, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);\n const [isPresent, setIsPresent] = React.useState(present);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const heightRef = React.useRef(0);\n const height = heightRef.current;\n const widthRef = React.useRef(0);\n const width = widthRef.current;\n // when opening we want it to immediately open to retrieve dimensions\n // when closing we delay `present` to retrieve dimensions before closing\n const isOpen = context.open || isPresent;\n const isMountAnimationPreventedRef = React.useRef(isOpen);\n const originalStylesRef = React.useRef>(undefined);\n\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => (isMountAnimationPreventedRef.current = false));\n return () => cancelAnimationFrame(rAF);\n }, []);\n\n useLayoutEffect(() => {\n const node = ref.current;\n if (node) {\n originalStylesRef.current = originalStylesRef.current || {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName,\n };\n // block any animations/transitions so the element renders at its full dimensions\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none';\n\n // get width and height from full dimensions\n const rect = node.getBoundingClientRect();\n heightRef.current = rect.height;\n widthRef.current = rect.width;\n\n // kick off any animations/transitions that were originally set up if it isn't the initial mount\n if (!isMountAnimationPreventedRef.current) {\n node.style.transitionDuration = originalStylesRef.current.transitionDuration!;\n node.style.animationName = originalStylesRef.current.animationName!;\n }\n\n setIsPresent(present);\n }\n /**\n * depends on `context.open` because it will change to `false`\n * when a close is triggered but `present` will be `false` on\n * animation end (so when close finishes). This allows us to\n * retrieve the dimensions *before* closing.\n */\n }, [context.open, present]);\n\n return (\n

= P & { __scopeCollapsible?: Scope };\nconst [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);\n\ntype CollapsibleContextValue = {\n contentId: string;\n disabled?: boolean;\n open: boolean;\n onOpenToggle(): void;\n};\n\nconst [CollapsibleProvider, useCollapsibleContext] =\n createCollapsibleContext(COLLAPSIBLE_NAME);\n\ntype CollapsibleElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface CollapsibleProps extends PrimitiveDivProps {\n defaultOpen?: boolean;\n open?: boolean;\n disabled?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst Collapsible = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: COLLAPSIBLE_NAME,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n >\n \n \n );\n },\n);\n\nCollapsible.displayName = COLLAPSIBLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CollapsibleTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'CollapsibleTrigger';\n\ntype CollapsibleTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface CollapsibleTriggerProps extends PrimitiveButtonProps {}\n\nconst CollapsibleTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeCollapsible, ...triggerProps } = props;\n const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);\n return (\n \n );\n },\n);\n\nCollapsibleTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CollapsibleContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'CollapsibleContent';\n\ntype CollapsibleContentElement = CollapsibleContentImplElement;\ninterface CollapsibleContentProps extends Omit {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst CollapsibleContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);\n return (\n \n {({ present }) => (\n \n )}\n \n );\n },\n);\n\nCollapsibleContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype CollapsibleContentImplElement = React.ComponentRef;\ninterface CollapsibleContentImplProps extends PrimitiveDivProps {\n present: boolean;\n}\n\nconst CollapsibleContentImpl = React.forwardRef<\n CollapsibleContentImplElement,\n CollapsibleContentImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeCollapsible, present, children, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);\n const [isPresent, setIsPresent] = React.useState(present);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const heightRef = React.useRef(0);\n const height = heightRef.current;\n const widthRef = React.useRef(0);\n const width = widthRef.current;\n // when opening we want it to immediately open to retrieve dimensions\n // when closing we delay `present` to retrieve dimensions before closing\n const isOpen = context.open || isPresent;\n const isMountAnimationPreventedRef = React.useRef(isOpen);\n const originalStylesRef = React.useRef>(undefined);\n\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => (isMountAnimationPreventedRef.current = false));\n return () => cancelAnimationFrame(rAF);\n }, []);\n\n useLayoutEffect(() => {\n const node = ref.current;\n if (node) {\n originalStylesRef.current = originalStylesRef.current || {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName,\n };\n // block any animations/transitions so the element renders at its full dimensions\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none';\n\n // get width and height from full dimensions\n const rect = node.getBoundingClientRect();\n heightRef.current = rect.height;\n widthRef.current = rect.width;\n\n // kick off any animations/transitions that were originally set up if it isn't the initial mount\n if (!isMountAnimationPreventedRef.current) {\n node.style.transitionDuration = originalStylesRef.current.transitionDuration!;\n node.style.animationName = originalStylesRef.current.animationName!;\n }\n\n setIsPresent(present);\n }\n /**\n * depends on `context.open` because it will change to `false`\n * when a close is triggered but `present` will be `false` on\n * animation end (so when close finishes). This allows us to\n * retrieve the dimensions *before* closing.\n */\n }, [context.open, present]);\n\n return (\n

= P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ninterface ContextMenuContextValue {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n hasInteractedRef: React.RefObject;\n}\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC = (props: ScopedProps) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, dir, modal = true } = props;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n const hasInteractedRef = React.useRef(false);\n if (process.env.NODE_ENV !== 'production') {\n const hasWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (openProp === true && !hasInteractedRef.current && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n // dev warning: open prop is controllable but its position has not been set\n // because the user has not interacted with the trigger. The controllable\n // state is only enabled so that the user can read or programatically close\n // the menu. Programatically opening the menu will anchor it to the most\n // recently interacted position.\n console.warn(\n 'ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport.',\n );\n }\n }, [openProp]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: false,\n onChange: onOpenChange,\n caller: CONTEXT_MENU_NAME,\n });\n\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n \n \n {children}\n \n \n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {\n disabled?: boolean;\n}\n\nconst ContextMenuTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, disabled = false, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n [],\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n context.hasInteractedRef.current = true;\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]);\n\n return (\n <>\n \n {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })\n }\n onPointerDown={\n disabled\n ? props.onPointerDown\n : composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n if (context.open) {\n context.onOpenChange(false);\n }\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n }),\n )\n }\n onPointerMove={\n disabled\n ? props.onPointerMove\n : composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))\n }\n onPointerCancel={\n disabled\n ? props.onPointerCancel\n : composeEventHandlers(props.onPointerCancel, whenTouchOrPen(clearLongPress))\n }\n onPointerUp={\n disabled\n ? props.onPointerUp\n : composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))\n }\n />\n \n );\n },\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'ContextMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n};\n\nContextMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ComponentRef;\ntype MenuContentProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuContentProps extends Omit<\n MenuContentProps,\n 'onEntryFocus' | 'side' | 'sideOffset' | 'align'\n> {}\n\nconst ContextMenuContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-context-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-context-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-context-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-context-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-context-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'ContextMenuGroup';\n\ntype ContextMenuGroupElement = React.ComponentRef;\ntype MenuGroupProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'ContextMenuLabel';\n\ntype ContextMenuLabelElement = React.ComponentRef;\ntype MenuLabelProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'ContextMenuItem';\n\ntype ContextMenuItemElement = React.ComponentRef;\ntype MenuItemProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';\n\ntype ContextMenuCheckboxItemElement = React.ComponentRef;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'ContextMenuRadioGroup';\n\ntype ContextMenuRadioGroupElement = React.ComponentRef;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'ContextMenuRadioItem';\n\ntype ContextMenuRadioItemElement = React.ComponentRef;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ContextMenuItemIndicator';\n\ntype ContextMenuItemIndicatorElement = React.ComponentRef;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'ContextMenuSeparator';\n\ntype ContextMenuSeparatorElement = React.ComponentRef;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'ContextMenuArrow';\n\ntype ContextMenuArrowElement = React.ComponentRef;\ntype MenuArrowProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC = (props: ScopedProps) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SUB_NAME,\n });\n\n return (\n \n {children}\n \n );\n};\n\nContextMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';\n\ntype ContextMenuSubTriggerElement = React.ComponentRef;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'ContextMenuSubContent';\n\ntype ContextMenuSubContentElement = React.ComponentRef;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n \n );\n});\n\nContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen(handler: React.PointerEventHandler): React.PointerEventHandler {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA,oBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,cAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,iBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,iBAAAC;AAAA,EAAA,WAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,2BAAmC;AACnC,6BAA0B;AAC1B,oBAA+B;AAC/B,wBAAgC;AAChC,0CAAqC;AA+E/B;AArEN,IAAM,oBAAoB;AAG1B,IAAM,CAAC,0BAA0B,sBAAsB,QAAI,yCAAmB,mBAAmB;AAAA,EAC/F;AACF,CAAC;AACD,IAAM,mBAAe,mCAAgB;AASrC,IAAM,CAAC,qBAAqB,qBAAqB,IAC/C,yBAAkD,iBAAiB;AAUrE,IAAM,cAA0C,CAAC,UAAyC;AACxF,QAAM,EAAE,oBAAoB,UAAU,cAAc,MAAM,UAAU,KAAK,QAAQ,KAAK,IAAI;AAM1F,QAAM,mBAAyB,aAAO,KAAK;AAC3C,MAAI,MAAuC;AACzC,UAAM,eAAqB,aAAO,KAAK;AACvC,IAAM,gBAAU,MAAM;AACpB,UAAI,aAAa,QAAQ,CAAC,iBAAiB,WAAW,CAAC,aAAa,SAAS;AAC3E,qBAAa,UAAU;AAM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AAClE,QAAM,EAAE,oBAAoB,GAAG,iBAAiB,IAAI;AACpD,QAAM,YAAY,aAAa,kBAAkB;AACjD,SAAO,4CAAe,0BAAd,EAA0B,GAAG,WAAY,GAAG,kBAAkB,KAAK,cAAc;AAC3F,CAAC;AAED,sBAAsB,cAAc;AAMpC,IAAM,mBAAmB;AAMzB,IAAM,wBAA8B,iBAGlC,CAAC,OAAgD,iBAAiB;AAClE,QAAM,EAAE,oBAAoB,GAAG,gBAAgB,IAAI;AACnD,QAAM,YAAY,aAAa,kBAAkB;AAEjD,SACE;AAAA,IAAe;AAAA,IAAd;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,OAAO;AAAA,QACL,GAAG,MAAM;AAAA;AAAA,QAET,GAAG;AAAA,UACD,iDAAiD;AAAA,UACjD,gDAAgD;AAAA,UAChD,iDAAiD;AAAA,UACjD,sCAAsC;AAAA,UACtC,uCAAuC;AAAA,QACzC;AAAA,MACF;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,sBAAsB,cAAc;AAIpC,SAAS,eAAkB,SAAqE;AAC9F,SAAO,CAAC,UAAW,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI;AACtE;AAEA,IAAMC,QAAO;AACb,IAAM,UAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;AACd,IAAMC,SAAQ;AACd,IAAMC,QAAO;AACb,IAAMC,gBAAe;AACrB,IAAMC,cAAa;AACnB,IAAMC,aAAY;AAClB,IAAMC,iBAAgB;AACtB,IAAMC,aAAY;AAClB,IAAMC,SAAQ;AACd,IAAMC,OAAM;AACZ,IAAMC,cAAa;AACnB,IAAMC,cAAa;", + "names": ["Arrow", "CheckboxItem", "Content", "Group", "Item", "ItemIndicator", "Label", "Portal", "RadioGroup", "RadioItem", "Root", "Separator", "Sub", "SubContent", "SubTrigger", "Root", "Portal", "Content", "Group", "Label", "Item", "CheckboxItem", "RadioGroup", "RadioItem", "ItemIndicator", "Separator", "Arrow", "Sub", "SubTrigger", "SubContent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..12657f777d7bfec116e3855883c7ecb93d16a461 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/dist/index.mjs @@ -0,0 +1,328 @@ +"use client"; + +// src/context-menu.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { createContextScope } from "@radix-ui/react-context"; +import { Primitive } from "@radix-ui/react-primitive"; +import * as MenuPrimitive from "@radix-ui/react-menu"; +import { createMenuScope } from "@radix-ui/react-menu"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var CONTEXT_MENU_NAME = "ContextMenu"; +var [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [ + createMenuScope +]); +var useMenuScope = createMenuScope(); +var [ContextMenuProvider, useContextMenuContext] = createContextMenuContext(CONTEXT_MENU_NAME); +var ContextMenu = (props) => { + const { __scopeContextMenu, children, onOpenChange, open: openProp, dir, modal = true } = props; + const hasInteractedRef = React.useRef(false); + if (true) { + const hasWarnedRef = React.useRef(false); + React.useEffect(() => { + if (openProp === true && !hasInteractedRef.current && !hasWarnedRef.current) { + hasWarnedRef.current = true; + console.warn( + "ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport." + ); + } + }, [openProp]); + } + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: false, + onChange: onOpenChange, + caller: CONTEXT_MENU_NAME + }); + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx( + ContextMenuProvider, + { + scope: __scopeContextMenu, + open, + onOpenChange: setOpen, + modal, + hasInteractedRef, + children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, dir, open, onOpenChange: setOpen, modal, children }) + } + ); +}; +ContextMenu.displayName = CONTEXT_MENU_NAME; +var TRIGGER_NAME = "ContextMenuTrigger"; +var ContextMenuTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeContextMenu, disabled = false, ...triggerProps } = props; + const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu); + const menuScope = useMenuScope(__scopeContextMenu); + const pointRef = React.useRef({ x: 0, y: 0 }); + const virtualRef = React.useRef({ + getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }) + }); + const longPressTimerRef = React.useRef(0); + const clearLongPress = React.useCallback( + () => window.clearTimeout(longPressTimerRef.current), + [] + ); + const handleOpen = (event) => { + context.hasInteractedRef.current = true; + pointRef.current = { x: event.clientX, y: event.clientY }; + context.onOpenChange(true); + }; + React.useEffect(() => clearLongPress, [clearLongPress]); + React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]); + return /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { ...menuScope, virtualRef }), + /* @__PURE__ */ jsx( + Primitive.span, + { + "data-state": context.open ? "open" : "closed", + "data-disabled": disabled ? "" : void 0, + ...triggerProps, + ref: forwardedRef, + style: { WebkitTouchCallout: "none", ...props.style }, + onContextMenu: disabled ? props.onContextMenu : composeEventHandlers(props.onContextMenu, (event) => { + clearLongPress(); + handleOpen(event); + event.preventDefault(); + }), + onPointerDown: disabled ? props.onPointerDown : composeEventHandlers( + props.onPointerDown, + whenTouchOrPen((event) => { + clearLongPress(); + if (context.open) { + context.onOpenChange(false); + } + longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700); + }) + ), + onPointerMove: disabled ? props.onPointerMove : composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress)), + onPointerCancel: disabled ? props.onPointerCancel : composeEventHandlers(props.onPointerCancel, whenTouchOrPen(clearLongPress)), + onPointerUp: disabled ? props.onPointerUp : composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress)) + } + ) + ] }); + } +); +ContextMenuTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "ContextMenuPortal"; +var ContextMenuPortal = (props) => { + const { __scopeContextMenu, ...portalProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps }); +}; +ContextMenuPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "ContextMenuContent"; +var ContextMenuContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeContextMenu, ...contentProps } = props; + const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu); + const menuScope = useMenuScope(__scopeContextMenu); + const hasInteractedOutsideRef = React.useRef(false); + return /* @__PURE__ */ jsx( + MenuPrimitive.Content, + { + ...menuScope, + ...contentProps, + ref: forwardedRef, + side: "right", + sideOffset: 2, + align: "start", + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented && hasInteractedOutsideRef.current) { + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true; + }, + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-context-menu-content-available-width": "var(--radix-popper-available-width)", + "--radix-context-menu-content-available-height": "var(--radix-popper-available-height)", + "--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +ContextMenuContent.displayName = CONTENT_NAME; +var GROUP_NAME = "ContextMenuGroup"; +var ContextMenuGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeContextMenu, ...groupProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef }); + } +); +ContextMenuGroup.displayName = GROUP_NAME; +var LABEL_NAME = "ContextMenuLabel"; +var ContextMenuLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeContextMenu, ...labelProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef }); + } +); +ContextMenuLabel.displayName = LABEL_NAME; +var ITEM_NAME = "ContextMenuItem"; +var ContextMenuItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeContextMenu, ...itemProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef }); + } +); +ContextMenuItem.displayName = ITEM_NAME; +var CHECKBOX_ITEM_NAME = "ContextMenuCheckboxItem"; +var ContextMenuCheckboxItem = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...checkboxItemProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef }); +}); +ContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "ContextMenuRadioGroup"; +var ContextMenuRadioGroup = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...radioGroupProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef }); +}); +ContextMenuRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "ContextMenuRadioItem"; +var ContextMenuRadioItem = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...radioItemProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef }); +}); +ContextMenuRadioItem.displayName = RADIO_ITEM_NAME; +var INDICATOR_NAME = "ContextMenuItemIndicator"; +var ContextMenuItemIndicator = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...itemIndicatorProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef }); +}); +ContextMenuItemIndicator.displayName = INDICATOR_NAME; +var SEPARATOR_NAME = "ContextMenuSeparator"; +var ContextMenuSeparator = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...separatorProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef }); +}); +ContextMenuSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "ContextMenuArrow"; +var ContextMenuArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeContextMenu, ...arrowProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef }); + } +); +ContextMenuArrow.displayName = ARROW_NAME; +var SUB_NAME = "ContextMenuSub"; +var ContextMenuSub = (props) => { + const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props; + const menuScope = useMenuScope(__scopeContextMenu); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: SUB_NAME + }); + return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children }); +}; +ContextMenuSub.displayName = SUB_NAME; +var SUB_TRIGGER_NAME = "ContextMenuSubTrigger"; +var ContextMenuSubTrigger = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...triggerItemProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...triggerItemProps, ref: forwardedRef }); +}); +ContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "ContextMenuSubContent"; +var ContextMenuSubContent = React.forwardRef((props, forwardedRef) => { + const { __scopeContextMenu, ...subContentProps } = props; + const menuScope = useMenuScope(__scopeContextMenu); + return /* @__PURE__ */ jsx( + MenuPrimitive.SubContent, + { + ...menuScope, + ...subContentProps, + ref: forwardedRef, + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-context-menu-content-available-width": "var(--radix-popper-available-width)", + "--radix-context-menu-content-available-height": "var(--radix-popper-available-height)", + "--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); +}); +ContextMenuSubContent.displayName = SUB_CONTENT_NAME; +function whenTouchOrPen(handler) { + return (event) => event.pointerType !== "mouse" ? handler(event) : void 0; +} +var Root2 = ContextMenu; +var Trigger = ContextMenuTrigger; +var Portal2 = ContextMenuPortal; +var Content2 = ContextMenuContent; +var Group2 = ContextMenuGroup; +var Label2 = ContextMenuLabel; +var Item2 = ContextMenuItem; +var CheckboxItem2 = ContextMenuCheckboxItem; +var RadioGroup2 = ContextMenuRadioGroup; +var RadioItem2 = ContextMenuRadioItem; +var ItemIndicator2 = ContextMenuItemIndicator; +var Separator2 = ContextMenuSeparator; +var Arrow2 = ContextMenuArrow; +var Sub2 = ContextMenuSub; +var SubTrigger2 = ContextMenuSubTrigger; +var SubContent2 = ContextMenuSubContent; +export { + Arrow2 as Arrow, + CheckboxItem2 as CheckboxItem, + Content2 as Content, + ContextMenu, + ContextMenuArrow, + ContextMenuCheckboxItem, + ContextMenuContent, + ContextMenuGroup, + ContextMenuItem, + ContextMenuItemIndicator, + ContextMenuLabel, + ContextMenuPortal, + ContextMenuRadioGroup, + ContextMenuRadioItem, + ContextMenuSeparator, + ContextMenuSub, + ContextMenuSubContent, + ContextMenuSubTrigger, + ContextMenuTrigger, + Group2 as Group, + Item2 as Item, + ItemIndicator2 as ItemIndicator, + Label2 as Label, + Portal2 as Portal, + RadioGroup2 as RadioGroup, + RadioItem2 as RadioItem, + Root2 as Root, + Separator2 as Separator, + Sub2 as Sub, + SubContent2 as SubContent, + SubTrigger2 as SubTrigger, + Trigger, + createContextMenuScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..97ec8bd5781be42a39b29f67bb4bd2d79b4b44e5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/context-menu.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Point = { x: number; y: number };\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTEXT_MENU_NAME = 'ContextMenu';\n\ntype ScopedProps

= P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ninterface ContextMenuContextValue {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n hasInteractedRef: React.RefObject;\n}\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC = (props: ScopedProps) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, dir, modal = true } = props;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n const hasInteractedRef = React.useRef(false);\n if (process.env.NODE_ENV !== 'production') {\n const hasWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (openProp === true && !hasInteractedRef.current && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n // dev warning: open prop is controllable but its position has not been set\n // because the user has not interacted with the trigger. The controllable\n // state is only enabled so that the user can read or programatically close\n // the menu. Programatically opening the menu will anchor it to the most\n // recently interacted position.\n console.warn(\n 'ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport.',\n );\n }\n }, [openProp]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: false,\n onChange: onOpenChange,\n caller: CONTEXT_MENU_NAME,\n });\n\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n \n \n {children}\n \n \n );\n};\n\nContextMenu.displayName = CONTEXT_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {\n disabled?: boolean;\n}\n\nconst ContextMenuTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, disabled = false, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const pointRef = React.useRef({ x: 0, y: 0 });\n const virtualRef = React.useRef({\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...pointRef.current }),\n });\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n [],\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n context.hasInteractedRef.current = true;\n pointRef.current = { x: event.clientX, y: event.clientY };\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]);\n\n return (\n <>\n \n {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })\n }\n onPointerDown={\n disabled\n ? props.onPointerDown\n : composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n if (context.open) {\n context.onOpenChange(false);\n }\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n }),\n )\n }\n onPointerMove={\n disabled\n ? props.onPointerMove\n : composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))\n }\n onPointerCancel={\n disabled\n ? props.onPointerCancel\n : composeEventHandlers(props.onPointerCancel, whenTouchOrPen(clearLongPress))\n }\n onPointerUp={\n disabled\n ? props.onPointerUp\n : composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))\n }\n />\n \n );\n },\n);\n\nContextMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'ContextMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n};\n\nContextMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ComponentRef;\ntype MenuContentProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuContentProps extends Omit<\n MenuContentProps,\n 'onEntryFocus' | 'side' | 'sideOffset' | 'align'\n> {}\n\nconst ContextMenuContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-context-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-context-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-context-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-context-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-context-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nContextMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'ContextMenuGroup';\n\ntype ContextMenuGroupElement = React.ComponentRef;\ntype MenuGroupProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'ContextMenuLabel';\n\ntype ContextMenuLabelElement = React.ComponentRef;\ntype MenuLabelProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'ContextMenuItem';\n\ntype ContextMenuItemElement = React.ComponentRef;\ntype MenuItemProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'ContextMenuCheckboxItem';\n\ntype ContextMenuCheckboxItemElement = React.ComponentRef;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'ContextMenuRadioGroup';\n\ntype ContextMenuRadioGroupElement = React.ComponentRef;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'ContextMenuRadioItem';\n\ntype ContextMenuRadioItemElement = React.ComponentRef;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ContextMenuItemIndicator';\n\ntype ContextMenuItemIndicatorElement = React.ComponentRef;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'ContextMenuSeparator';\n\ntype ContextMenuSeparatorElement = React.ComponentRef;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'ContextMenuArrow';\n\ntype ContextMenuArrowElement = React.ComponentRef;\ntype MenuArrowProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n },\n);\n\nContextMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC = (props: ScopedProps) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SUB_NAME,\n });\n\n return (\n \n {children}\n \n );\n};\n\nContextMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'ContextMenuSubTrigger';\n\ntype ContextMenuSubTriggerElement = React.ComponentRef;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return ;\n});\n\nContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'ContextMenuSubContent';\n\ntype ContextMenuSubContentElement = React.ComponentRef;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n \n );\n});\n\nContextMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen(handler: React.PointerEventHandler): React.PointerEventHandler {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,iBAAi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CAAC;AAED,sBAAsB,cAAc;AAIpC,SAAS,eAAkB,SAAqE;AAC9F,SAAO,CAAC,UAAW,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI;AACtE;AAEA,IAAMA,QAAO;AACb,IAAM,UAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;AACd,IAAMC,SAAQ;AACd,IAAMC,QAAO;AACb,IAAMC,gBAAe;AACrB,IAAMC,cAAa;AACnB,IAAMC,aAAY;AAClB,IAAMC,iBAAgB;AACtB,IAAMC,aAAY;AAClB,IAAMC,SAAQ;AACd,IAAMC,OAAM;AACZ,IAAMC,cAAa;AACnB,IAAMC,cAAa;", + "names": ["Root", "Portal", "Content", "Group", "Label", "Item", "CheckboxItem", "RadioGroup", "RadioItem", "ItemIndicator", "Separator", "Arrow", "Sub", "SubTrigger", "SubContent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bccc220e5b70e1dede1e80e921e55d9b3a5b8625 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context-menu/package.json @@ -0,0 +1,73 @@ +{ + "name": "@radix-ui/react-context-menu", + "version": "2.3.1", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-menu": "2.1.18", + "@radix-ui/react-use-controllable-state": "1.2.3" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@repo/test-data": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/context-menu" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a637314dec76395862fd9b93fdb3869ed843504d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/README.md @@ -0,0 +1,3 @@ +# `react-context` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c047514614c29aad29c6451a2ae504419490372d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.d.mts @@ -0,0 +1,21 @@ +import * as React from 'react'; + +declare function createContext(rootComponentName: string, defaultContext?: ContextValueType): readonly [React.FC, (consumerName: string) => ContextValueType]; +type Scope = { + [scopeName: string]: React.Context[]; +} | undefined; +type ScopeHook = (scope: Scope) => { + [__scopeProp: string]: Scope; +}; +interface CreateScope { + scopeName: string; + (): ScopeHook; +} +declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [(rootComponentName: string, defaultContext?: ContextValueType) => readonly [React.FC; + children: React.ReactNode; +}>, (consumerName: string, scope: Scope) => ContextValueType], CreateScope]; + +export { type CreateScope, type Scope, createContext, createContextScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c047514614c29aad29c6451a2ae504419490372d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.d.ts @@ -0,0 +1,21 @@ +import * as React from 'react'; + +declare function createContext(rootComponentName: string, defaultContext?: ContextValueType): readonly [React.FC, (consumerName: string) => ContextValueType]; +type Scope = { + [scopeName: string]: React.Context[]; +} | undefined; +type ScopeHook = (scope: Scope) => { + [__scopeProp: string]: Scope; +}; +interface CreateScope { + scopeName: string; + (): ScopeHook; +} +declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [(rootComponentName: string, defaultContext?: ContextValueType) => readonly [React.FC; + children: React.ReactNode; +}>, (consumerName: string, scope: Scope) => ContextValueType], CreateScope]; + +export { type CreateScope, type Scope, createContext, createContextScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c356744a5b5bfedf2e50fc81b069b0977608bd9e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.js @@ -0,0 +1,116 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + createContext: () => createContext2, + createContextScope: () => createContextScope +}); +module.exports = __toCommonJS(index_exports); + +// src/create-context.tsx +var React = __toESM(require("react")); +var import_jsx_runtime = require("react/jsx-runtime"); +function createContext2(rootComponentName, defaultContext) { + const Context = React.createContext(defaultContext); + Context.displayName = rootComponentName + "Context"; + const Provider = (props) => { + const { children, ...context } = props; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName) { + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; +} +function createContextScope(scopeName, createContextScopeDeps = []) { + let defaultContexts = []; + function createContext3(rootComponentName, defaultContext) { + const BaseContext = React.createContext(defaultContext); + BaseContext.displayName = rootComponentName + "Context"; + const index = defaultContexts.length; + defaultContexts = [...defaultContexts, defaultContext]; + const Provider = (props) => { + const { scope, children, ...context } = props; + const Context = scope?.[scopeName]?.[index] || BaseContext; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName, scope) { + const Context = scope?.[scopeName]?.[index] || BaseContext; + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; + } + const createScope = () => { + const scopeContexts = defaultContexts.map((defaultContext) => { + return React.createContext(defaultContext); + }); + return function useScope(scope) { + const contexts = scope?.[scopeName] || scopeContexts; + return React.useMemo( + () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), + [scope, contexts] + ); + }; + }; + createScope.scopeName = scopeName; + return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; +} +function composeContextScopes(...scopes) { + const baseScope = scopes[0]; + if (scopes.length === 1) return baseScope; + const createScope = () => { + const scopeHooks = scopes.map((createScope2) => ({ + useScope: createScope2(), + scopeName: createScope2.scopeName + })); + return function useComposedScopes(overrideScopes) { + const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { + const scopeProps = useScope(overrideScopes); + const currentScope = scopeProps[`__scope${scopeName}`]; + return { ...nextScopes2, ...currentScope }; + }, {}); + return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); + }; + }; + createScope.scopeName = baseScope.scopeName; + return createScope; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a47ea8fda4d708b9140e915640852b5297f1df98 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/create-context.tsx"], + "sourcesContent": ["export { createContext, createContextScope } from './create-context';\nexport type { CreateScope, Scope } from './create-context';\n", "import * as React from 'react';\n\nfunction createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType,\n) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + 'Context';\n\n const Provider: React.FC = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope = { [scopeName: string]: React.Context[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType,\n ) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + 'Context';\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts],\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: [CreateScope, ...CreateScope[]]): CreateScope {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,YAAuB;AAcZ;AAZX,SAASC,eACP,mBACA,gBACA;AACA,QAAM,UAAgB,oBAA4C,cAAc;AAChF,UAAQ,cAAc,oBAAoB;AAE1C,QAAM,WAAuE,CAAC,UAAU;AACtF,UAAM,EAAE,UAAU,GAAG,QAAQ,IAAI;AAGjC,UAAM,QAAc,cAAQ,MAAM,SAAS,OAA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BAAc,cAAc;AAAA,IAC3C,CAAC;AACD,WAAO,SAAS,SAAS,OAAc;AACrC,YAAM,WAAW,QAAQ,SAAS,KAAK;AACvC,aAAa;AAAA,QACX,OAAO,EAAE,CAAC,UAAU,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,EAAE;AAAA,QACtE,CAAC,OAAO,QAAQ;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAEA,cAAY,YAAY;AACxB,SAAO,CAACD,gBAAe,qBAAqB,aAAa,GAAG,sBAAsB,CAAC;AACrF;AAMA,SAAS,wBAAwB,QAAsD;AACrF,QAAM,YAAY,OAAO,CAAC;AAC1B,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,cAA2B,MAAM;AACrC,UAAM,aAAa,OAAO,IAAI,CAACE,kBAAiB;AAAA,MAC9C,UAAUA,aAAY;AAAA,MACtB,WAAWA,aAAY;AAAA,IACzB,EAAE;AAEF,WAAO,SAAS,kBAAkB,gBAAgB;AAChD,YAAM,aAAa,WAAW,OAAO,CAACC,aAAY,EAAE,UAAU,UAAU,MAAM;AAI5E,cAAM,aAAa,SAAS,cAAc;AAC1C,cAAM,eAAe,WAAW,UAAU,SAAS,EAAE;AACrD,eAAO,EAAE,GAAGA,aAAY,GAAG,aAAa;AAAA,MAC1C,GAAG,CAAC,CAAC;AAEL,aAAa,cAAQ,OAAO,EAAE,CAAC,UAAU,UAAU,SAAS,EAAE,GAAG,WAAW,IAAI,CAAC,UAAU,CAAC;AAAA,IAC9F;AAAA,EACF;AAEA,cAAY,YAAY,UAAU;AAClC,SAAO;AACT;", + "names": ["createContext", "createContext", "useContext", "createScope", "nextScopes"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e15907cba0360cd0b72040dfd75f487591767c84 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.mjs @@ -0,0 +1,83 @@ +// src/create-context.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +function createContext2(rootComponentName, defaultContext) { + const Context = React.createContext(defaultContext); + Context.displayName = rootComponentName + "Context"; + const Provider = (props) => { + const { children, ...context } = props; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ jsx(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName) { + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; +} +function createContextScope(scopeName, createContextScopeDeps = []) { + let defaultContexts = []; + function createContext3(rootComponentName, defaultContext) { + const BaseContext = React.createContext(defaultContext); + BaseContext.displayName = rootComponentName + "Context"; + const index = defaultContexts.length; + defaultContexts = [...defaultContexts, defaultContext]; + const Provider = (props) => { + const { scope, children, ...context } = props; + const Context = scope?.[scopeName]?.[index] || BaseContext; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ jsx(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName, scope) { + const Context = scope?.[scopeName]?.[index] || BaseContext; + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; + } + const createScope = () => { + const scopeContexts = defaultContexts.map((defaultContext) => { + return React.createContext(defaultContext); + }); + return function useScope(scope) { + const contexts = scope?.[scopeName] || scopeContexts; + return React.useMemo( + () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), + [scope, contexts] + ); + }; + }; + createScope.scopeName = scopeName; + return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; +} +function composeContextScopes(...scopes) { + const baseScope = scopes[0]; + if (scopes.length === 1) return baseScope; + const createScope = () => { + const scopeHooks = scopes.map((createScope2) => ({ + useScope: createScope2(), + scopeName: createScope2.scopeName + })); + return function useComposedScopes(overrideScopes) { + const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { + const scopeProps = useScope(overrideScopes); + const currentScope = scopeProps[`__scope${scopeName}`]; + return { ...nextScopes2, ...currentScope }; + }, {}); + return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); + }; + }; + createScope.scopeName = baseScope.scopeName; + return createScope; +} +export { + createContext2 as createContext, + createContextScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..f1d9e853e53ddac69b36c0b1b97aa4acd73cb1e2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/create-context.tsx"], + "sourcesContent": ["import * as React from 'react';\n\nfunction createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType,\n) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + 'Context';\n\n const Provider: React.FC = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope = { [scopeName: string]: React.Context[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType,\n ) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + 'Context';\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts],\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: [CreateScope, ...CreateScope[]]): CreateScope {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n"], + "mappings": ";AAAA,YAAY,WAAW;AAcZ;AAZX,SAASA,eACP,mBACA,gBACA;AACA,QAAM,UAAgB,oBAA4C,cAAc;AAChF,UAAQ,cAAc,oBAAoB;AAE1C,QAAM,WAAuE,CAAC,UAAU;AACtF,UAAM,EAAE,UAAU,GAAG,QAAQ,IAAI;AAGjC,UAAM,QAAc,cAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACjE,WAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,cAAc,oBAAoB;AAE3C,WAASC,YAAW,cAAsB;AACxC,UAAM,UAAgB,iBAAW,OAAO;AACxC,QAAI,QAAS,QAAO;AACpB,QAAI,mBAAmB,OAAW,QAAO;AAEzC,UAAM,IAAI,MAAM,KAAK,YAAY,4BAA4B,iBAAiB,IAAI;AAAA,EACpF;AAEA,SAAO,CAAC,UAAUA,WAAU;AAC9B;AAaA,SAAS,mBAAmB,WAAmB,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,SAAS,wBAAwB,QAAsD;AACrF,QAAM,YAAY,OAAO,CAAC;AAC1B,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,cAA2B,MAAM;AACrC,UAAM,aAAa,OAAO,IAAI,CAACE,kBAAiB;AAAA,MAC9C,UAAUA,aAAY;AAAA,MACtB,WAAWA,aAAY;AAAA,IACzB,EAAE;AAEF,WAAO,SAAS,kBAAkB,gBAAgB;AAChD,YAAM,aAAa,WAAW,OAAO,CAACC,aAAY,EAAE,UAAU,UAAU,MAAM;AAI5E,cAAM,aAAa,SAAS,cAAc;AAC1C,cAAM,eAAe,WAAW,UAAU,SAAS,EAAE;AACrD,eAAO,EAAE,GAAGA,aAAY,GAAG,aAAa;AAAA,MAC1C,GAAG,CAAC,CAAC;AAEL,aAAa,cAAQ,OAAO,EAAE,CAAC,UAAU,UAAU,SAAS,EAAE,GAAG,WAAW,IAAI,CAAC,UAAU,CAAC;AAAA,IAC9F;AAAA,EACF;AAEA,cAAY,YAAY,UAAU;AAClC,SAAO;AACT;", + "names": ["createContext", "useContext", "createScope", "nextScopes"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ba9f89b229a7e929fcc1ea97b627dbce7322e428 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-context/package.json @@ -0,0 +1,60 @@ +{ + "name": "@radix-ui/react-context", + "version": "1.1.4", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/context" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0cd9f9b457b600566d1f56e2f1191e646643c70b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/README.md @@ -0,0 +1,3 @@ +# `react-dialog` + +View docs [here](https://radix-ui.com/primitives/docs/components/dialog). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..bc380b8229fb439358cabc568f10ae1fe3b27a24 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.d.mts @@ -0,0 +1,99 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import { Portal } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeDialog?: Scope; +}; +declare const createDialogScope: _radix_ui_react_context.CreateScope; +interface DialogProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + modal?: boolean; +} +declare const Dialog: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface DialogTriggerProps extends PrimitiveButtonProps { +} +declare const DialogTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface DialogPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogPortal: React.FC; +interface DialogOverlayProps extends DialogOverlayImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogOverlay: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DialogOverlayImplProps extends PrimitiveDivProps { +} +interface DialogContentProps extends DialogContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogContent: React.ForwardRefExoticComponent>; +interface DialogContentTypeProps extends Omit { +} +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type FocusScopeProps = React.ComponentPropsWithoutRef; +interface DialogContentImplProps extends Omit { + /** + * When `true`, focus cannot escape the `Content` via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapFocus?: FocusScopeProps['trapped']; + /** + * Event handler called when auto-focusing on open. + * Can be prevented. + */ + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; +} +type PrimitiveHeading2Props = React.ComponentPropsWithoutRef; +interface DialogTitleProps extends PrimitiveHeading2Props { +} +declare const DialogTitle: React.ForwardRefExoticComponent>; +type PrimitiveParagraphProps = React.ComponentPropsWithoutRef; +interface DialogDescriptionProps extends PrimitiveParagraphProps { +} +declare const DialogDescription: React.ForwardRefExoticComponent>; +interface DialogCloseProps extends PrimitiveButtonProps { +} +declare const DialogClose: React.ForwardRefExoticComponent>; +/** @deprecated Noop component to avoid breaking changes. */ +declare const WarningProvider: React.FC>; + +export { DialogClose as Close, DialogContent as Content, DialogDescription as Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DialogOverlay as Overlay, DialogPortal as Portal, Dialog as Root, DialogTitle as Title, DialogTrigger as Trigger, WarningProvider, createDialogScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc380b8229fb439358cabc568f10ae1fe3b27a24 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.d.ts @@ -0,0 +1,99 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import { Portal } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeDialog?: Scope; +}; +declare const createDialogScope: _radix_ui_react_context.CreateScope; +interface DialogProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + modal?: boolean; +} +declare const Dialog: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface DialogTriggerProps extends PrimitiveButtonProps { +} +declare const DialogTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface DialogPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogPortal: React.FC; +interface DialogOverlayProps extends DialogOverlayImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogOverlay: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DialogOverlayImplProps extends PrimitiveDivProps { +} +interface DialogContentProps extends DialogContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogContent: React.ForwardRefExoticComponent>; +interface DialogContentTypeProps extends Omit { +} +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type FocusScopeProps = React.ComponentPropsWithoutRef; +interface DialogContentImplProps extends Omit { + /** + * When `true`, focus cannot escape the `Content` via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapFocus?: FocusScopeProps['trapped']; + /** + * Event handler called when auto-focusing on open. + * Can be prevented. + */ + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; +} +type PrimitiveHeading2Props = React.ComponentPropsWithoutRef; +interface DialogTitleProps extends PrimitiveHeading2Props { +} +declare const DialogTitle: React.ForwardRefExoticComponent>; +type PrimitiveParagraphProps = React.ComponentPropsWithoutRef; +interface DialogDescriptionProps extends PrimitiveParagraphProps { +} +declare const DialogDescription: React.ForwardRefExoticComponent>; +interface DialogCloseProps extends PrimitiveButtonProps { +} +declare const DialogClose: React.ForwardRefExoticComponent>; +/** @deprecated Noop component to avoid breaking changes. */ +declare const WarningProvider: React.FC>; + +export { DialogClose as Close, DialogContent as Content, DialogDescription as Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DialogOverlay as Overlay, DialogPortal as Portal, Dialog as Root, DialogTitle as Title, DialogTrigger as Trigger, WarningProvider, createDialogScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b6f4519eaa1c35d28a5f6e54f09681e6cb88d548 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.js @@ -0,0 +1,330 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Close: () => DialogClose, + Content: () => DialogContent, + Description: () => DialogDescription, + Dialog: () => Dialog, + DialogClose: () => DialogClose, + DialogContent: () => DialogContent, + DialogDescription: () => DialogDescription, + DialogOverlay: () => DialogOverlay, + DialogPortal: () => DialogPortal, + DialogTitle: () => DialogTitle, + DialogTrigger: () => DialogTrigger, + Overlay: () => DialogOverlay, + Portal: () => DialogPortal, + Root: () => Dialog, + Title: () => DialogTitle, + Trigger: () => DialogTrigger, + WarningProvider: () => WarningProvider, + createDialogScope: () => createDialogScope +}); +module.exports = __toCommonJS(index_exports); + +// src/dialog.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_react_focus_scope = require("@radix-ui/react-focus-scope"); +var import_react_portal = require("@radix-ui/react-portal"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_focus_guards = require("@radix-ui/react-focus-guards"); +var import_react_remove_scroll = require("react-remove-scroll"); +var import_aria_hidden = require("aria-hidden"); +var import_react_slot = require("@radix-ui/react-slot"); +var import_jsx_runtime = require("react/jsx-runtime"); +var DIALOG_NAME = "Dialog"; +var [createDialogContext, createDialogScope] = (0, import_react_context.createContextScope)(DIALOG_NAME); +var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); +var Dialog = (props) => { + const { + __scopeDialog, + children, + open: openProp, + defaultOpen, + onOpenChange, + modal = true + } = props; + const triggerRef = React.useRef(null); + const contentRef = React.useRef(null); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: DIALOG_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogProvider, + { + scope: __scopeDialog, + triggerRef, + contentRef, + contentId: (0, import_react_id.useId)(), + titleId: (0, import_react_id.useId)(), + descriptionId: (0, import_react_id.useId)(), + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + modal, + children + } + ); +}; +Dialog.displayName = DIALOG_NAME; +var TRIGGER_NAME = "DialogTrigger"; +var DialogTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...triggerProps } = props; + const context = useDialogContext(TRIGGER_NAME, __scopeDialog); + const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : void 0, + "data-state": getState(context.open), + ...triggerProps, + ref: composedTriggerRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle) + } + ); + } +); +DialogTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "DialogPortal"; +var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { + forceMount: void 0 +}); +var DialogPortal = (props) => { + const { __scopeDialog, forceMount, children, container } = props; + const context = useDialogContext(PORTAL_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children: child }) })) }); +}; +DialogPortal.displayName = PORTAL_NAME; +var OVERLAY_NAME = "DialogOverlay"; +var DialogOverlay = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog); + return context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null; + } +); +DialogOverlay.displayName = OVERLAY_NAME; +var Slot = (0, import_react_slot.createSlot)("DialogOverlay.RemoveScroll"); +var DialogOverlayImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, __scopeDialog); + const registerDismissableSurface = (0, import_react_dismissable_layer.useDismissableLayerSurface)(); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, registerDismissableSurface); + return ( + // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` + // ie. when `Overlay` and `Content` are siblings + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-state": getState(context.open), + ...overlayProps, + ref: composedRefs, + style: { pointerEvents: "auto", ...overlayProps.style } + } + ) }) + ); + } +); +var CONTENT_NAME = "DialogContent"; +var DialogContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) }); + } +); +DialogContent.displayName = CONTENT_NAME; +var DialogContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const contentRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.contentRef, contentRef); + React.useEffect(() => { + const content = contentRef.current; + if (content) return (0, import_aria_hidden.hideOthers)(content); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: context.open, + onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => { + event.preventDefault(); + context.triggerRef.current?.focus(); + }), + onPointerDownOutside: (0, import_primitive.composeEventHandlers)(props.onPointerDownOutside, (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (isRightClick) event.preventDefault(); + }), + onFocusOutside: (0, import_primitive.composeEventHandlers)( + props.onFocusOutside, + (event) => event.preventDefault() + ) + } + ); + } +); +var DialogContentNonModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const hasInteractedOutsideRef = React.useRef(false); + const hasPointerDownOutsideRef = React.useRef(false); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented) { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === "pointerdown") { + hasPointerDownOutsideRef.current = true; + } + } + const target = event.target; + const targetIsTrigger = context.triggerRef.current?.contains(target); + if (targetIsTrigger) event.preventDefault(); + if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { + event.preventDefault(); + } + } + } + ); + } +); +var DialogContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, __scopeDialog); + (0, import_react_focus_guards.useFocusGuards)(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_focus_scope.FocusScope, + { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + role: "dialog", + id: context.contentId, + "aria-describedby": context.descriptionId, + "aria-labelledby": context.titleId, + "data-state": getState(context.open), + ...contentProps, + ref: forwardedRef, + deferPointerDownOutside: true, + onDismiss: () => context.onOpenChange(false) + } + ) + } + ) }); + } +); +var TITLE_NAME = "DialogTitle"; +var DialogTitle = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...titleProps } = props; + const context = useDialogContext(TITLE_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef }); + } +); +DialogTitle.displayName = TITLE_NAME; +var DESCRIPTION_NAME = "DialogDescription"; +var DialogDescription = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...descriptionProps } = props; + const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef }); + } +); +DialogDescription.displayName = DESCRIPTION_NAME; +var CLOSE_NAME = "DialogClose"; +var DialogClose = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...closeProps } = props; + const context = useDialogContext(CLOSE_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + ...closeProps, + ref: forwardedRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false)) + } + ); + } +); +DialogClose.displayName = CLOSE_NAME; +var WarningProvider = (props) => { + return props.children; +}; +function getState(open) { + return open ? "open" : "closed"; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1edd3c3c8836fc175119e31785a4ec3b5213291b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/dialog.tsx"], + "sourcesContent": ["'use client';\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n /** @deprecated Noop component to avoid breaking changes. */\n WarningProvider,\n} from './dialog';\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n} from './dialog';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { DismissableLayer, useDismissableLayerSurface } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport { hideOthers } from 'aria-hidden';\nimport { createSlot } from '@radix-ui/react-slot';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps

= P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject;\n contentRef: React.RefObject;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\n\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst Dialog: React.FC = (props: ScopedProps) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n {children}\n \n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n \n );\n },\n);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface DialogPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC = (props: ScopedProps) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n \n {React.Children.map(children, (child) => (\n \n \n {child}\n \n \n ))}\n \n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? (\n \n \n \n ) : null;\n },\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst Slot = createSlot('DialogOverlay.RemoveScroll');\n\nconst DialogOverlayImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n\n // Register the overlay as a dismiss surface so a consumer calling\n // `stopPropagation` on it (eg. to avoid triggering parent handlers) does not\n // prevent the dialog from closing. See: https://github.com/radix-ui/primitives/issues/3346\n const registerDismissableSurface = useDismissableLayerSurface();\n const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);\n\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return (\n \n {context.modal ? (\n \n ) : (\n \n )}\n \n );\n },\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps extends Omit<\n DialogContentImplProps,\n 'trapFocus' | 'disableOutsidePointerEvents'\n> {}\n\nconst DialogContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n {\n event.preventDefault();\n context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault(),\n )}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ComponentRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ninterface DialogContentImplProps extends Omit {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n \n context.onOpenChange(false)}\n />\n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ComponentRef;\ntype PrimitiveHeading2Props = React.ComponentPropsWithoutRef;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return ;\n },\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ComponentRef;\ntype PrimitiveParagraphProps = React.ComponentPropsWithoutRef;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return ;\n },\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ComponentRef;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n context.onOpenChange(false))}\n />\n );\n },\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/** @deprecated Noop component to avoid breaking changes. */\nexport const WarningProvider: React.FC<\n ScopedProps<{\n children?: React.ReactNode;\n contentName: string;\n titleName: string;\n docsSlug: 'dialog';\n }>\n> = (props) => {\n return props.children;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Dialog as Root,\n DialogTrigger as Trigger,\n DialogPortal as Portal,\n DialogOverlay as Overlay,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,sBAAsB;AACtB,0CAAqC;AACrC,qCAA6D;AAC7D,+BAA2B;AAC3B,0BAA0C;AAC1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AAU,GAAV,EAAY,IAAI,QAAQ,eAAgB,GAAG,kBAAkB,KAAK,cAAc;AAAA,EAC1F;AACF;AAEA,kBAAkB,cAAc;AAMhC,IAAM,aAAa;AAKnB,IAAM,cAAoB;AAAA,EACxB,CAAC,OAAsC,iBAAiB;AACtD,UAAM,EAAE,eAAe,GAAG,WAAW,IAAI;AACzC,UAAM,UAAU,iBAAiB,YAAY,aAAa;AAC1D,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACJ,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,uCAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAGnB,IAAM,kBAOT,CAAC,UAAU;AACb,SAAO,MAAM;AACf;AAIA,SAAS,SAAS,MAAe;AAC/B,SAAO,OAAO,SAAS;AACzB;", + "names": ["PortalPrimitive"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b32d2d1485e2905fb163f9fc6aa546e106d6a1f1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.mjs @@ -0,0 +1,298 @@ +"use client"; + +// src/dialog.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useId } from "@radix-ui/react-id"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { DismissableLayer, useDismissableLayerSurface } from "@radix-ui/react-dismissable-layer"; +import { FocusScope } from "@radix-ui/react-focus-scope"; +import { Portal as PortalPrimitive } from "@radix-ui/react-portal"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useFocusGuards } from "@radix-ui/react-focus-guards"; +import { RemoveScroll } from "react-remove-scroll"; +import { hideOthers } from "aria-hidden"; +import { createSlot } from "@radix-ui/react-slot"; +import { Fragment, jsx } from "react/jsx-runtime"; +var DIALOG_NAME = "Dialog"; +var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME); +var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); +var Dialog = (props) => { + const { + __scopeDialog, + children, + open: openProp, + defaultOpen, + onOpenChange, + modal = true + } = props; + const triggerRef = React.useRef(null); + const contentRef = React.useRef(null); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: DIALOG_NAME + }); + return /* @__PURE__ */ jsx( + DialogProvider, + { + scope: __scopeDialog, + triggerRef, + contentRef, + contentId: useId(), + titleId: useId(), + descriptionId: useId(), + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + modal, + children + } + ); +}; +Dialog.displayName = DIALOG_NAME; +var TRIGGER_NAME = "DialogTrigger"; +var DialogTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...triggerProps } = props; + const context = useDialogContext(TRIGGER_NAME, __scopeDialog); + const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : void 0, + "data-state": getState(context.open), + ...triggerProps, + ref: composedTriggerRef, + onClick: composeEventHandlers(props.onClick, context.onOpenToggle) + } + ); + } +); +DialogTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "DialogPortal"; +var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { + forceMount: void 0 +}); +var DialogPortal = (props) => { + const { __scopeDialog, forceMount, children, container } = props; + const context = useDialogContext(PORTAL_NAME, __scopeDialog); + return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) }); +}; +DialogPortal.displayName = PORTAL_NAME; +var OVERLAY_NAME = "DialogOverlay"; +var DialogOverlay = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog); + return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null; + } +); +DialogOverlay.displayName = OVERLAY_NAME; +var Slot = createSlot("DialogOverlay.RemoveScroll"); +var DialogOverlayImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, __scopeDialog); + const registerDismissableSurface = useDismissableLayerSurface(); + const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface); + return ( + // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` + // ie. when `Overlay` and `Content` are siblings + /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx( + Primitive.div, + { + "data-state": getState(context.open), + ...overlayProps, + ref: composedRefs, + style: { pointerEvents: "auto", ...overlayProps.style } + } + ) }) + ); + } +); +var CONTENT_NAME = "DialogContent"; +var DialogContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) }); + } +); +DialogContent.displayName = CONTENT_NAME; +var DialogContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef); + React.useEffect(() => { + const content = contentRef.current; + if (content) return hideOthers(content); + }, []); + return /* @__PURE__ */ jsx( + DialogContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: context.open, + onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { + event.preventDefault(); + context.triggerRef.current?.focus(); + }), + onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (isRightClick) event.preventDefault(); + }), + onFocusOutside: composeEventHandlers( + props.onFocusOutside, + (event) => event.preventDefault() + ) + } + ); + } +); +var DialogContentNonModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const hasInteractedOutsideRef = React.useRef(false); + const hasPointerDownOutsideRef = React.useRef(false); + return /* @__PURE__ */ jsx( + DialogContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented) { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === "pointerdown") { + hasPointerDownOutsideRef.current = true; + } + } + const target = event.target; + const targetIsTrigger = context.triggerRef.current?.contains(target); + if (targetIsTrigger) event.preventDefault(); + if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { + event.preventDefault(); + } + } + } + ); + } +); +var DialogContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, __scopeDialog); + useFocusGuards(); + return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx( + FocusScope, + { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ jsx( + DismissableLayer, + { + role: "dialog", + id: context.contentId, + "aria-describedby": context.descriptionId, + "aria-labelledby": context.titleId, + "data-state": getState(context.open), + ...contentProps, + ref: forwardedRef, + deferPointerDownOutside: true, + onDismiss: () => context.onOpenChange(false) + } + ) + } + ) }); + } +); +var TITLE_NAME = "DialogTitle"; +var DialogTitle = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...titleProps } = props; + const context = useDialogContext(TITLE_NAME, __scopeDialog); + return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef }); + } +); +DialogTitle.displayName = TITLE_NAME; +var DESCRIPTION_NAME = "DialogDescription"; +var DialogDescription = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...descriptionProps } = props; + const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog); + return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef }); + } +); +DialogDescription.displayName = DESCRIPTION_NAME; +var CLOSE_NAME = "DialogClose"; +var DialogClose = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...closeProps } = props; + const context = useDialogContext(CLOSE_NAME, __scopeDialog); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + ...closeProps, + ref: forwardedRef, + onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false)) + } + ); + } +); +DialogClose.displayName = CLOSE_NAME; +var WarningProvider = (props) => { + return props.children; +}; +function getState(open) { + return open ? "open" : "closed"; +} +export { + DialogClose as Close, + DialogContent as Content, + DialogDescription as Description, + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, + DialogOverlay as Overlay, + DialogPortal as Portal, + Dialog as Root, + DialogTitle as Title, + DialogTrigger as Trigger, + WarningProvider, + createDialogScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..4858ea70606ecc81fc47fef0e4fcedc5142cff28 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/dialog.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { DismissableLayer, useDismissableLayerSurface } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport { hideOthers } from 'aria-hidden';\nimport { createSlot } from '@radix-ui/react-slot';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps

= P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject;\n contentRef: React.RefObject;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\n\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst Dialog: React.FC = (props: ScopedProps) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n {children}\n \n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n \n );\n },\n);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface DialogPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC = (props: ScopedProps) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n \n {React.Children.map(children, (child) => (\n \n \n {child}\n \n \n ))}\n \n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? (\n \n \n \n ) : null;\n },\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst Slot = createSlot('DialogOverlay.RemoveScroll');\n\nconst DialogOverlayImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n\n // Register the overlay as a dismiss surface so a consumer calling\n // `stopPropagation` on it (eg. to avoid triggering parent handlers) does not\n // prevent the dialog from closing. See: https://github.com/radix-ui/primitives/issues/3346\n const registerDismissableSurface = useDismissableLayerSurface();\n const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);\n\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return (\n \n {context.modal ? (\n \n ) : (\n \n )}\n \n );\n },\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps extends Omit<\n DialogContentImplProps,\n 'trapFocus' | 'disableOutsidePointerEvents'\n> {}\n\nconst DialogContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n {\n event.preventDefault();\n context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault(),\n )}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ComponentRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ninterface DialogContentImplProps extends Omit {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n \n context.onOpenChange(false)}\n />\n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ComponentRef;\ntype PrimitiveHeading2Props = React.ComponentPropsWithoutRef;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return ;\n },\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ComponentRef;\ntype PrimitiveParagraphProps = React.ComponentPropsWithoutRef;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return ;\n },\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ComponentRef;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n context.onOpenChange(false))}\n />\n );\n },\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/** @deprecated Noop component to avoid breaking changes. */\nexport const WarningProvider: React.FC<\n ScopedProps<{\n children?: React.ReactNode;\n contentName: string;\n titleName: string;\n docsSlug: 'dialog';\n }>\n> = (props) => {\n return props.children;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Dialog as Root,\n DialogTrigger as Trigger,\n DialogPortal as Portal,\n DialogOverlay as Overlay,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,aAAa;AACtB,SAAS,4BAA4B;AACrC,SAAS,kBAAkB,kCAAkC;AAC7D,SAAS,kBAAkB;AAC3B,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAi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,IAAI,QAAQ,eAAgB,GAAG,kBAAkB,KAAK,cAAc;AAAA,EAC1F;AACF;AAEA,kBAAkB,cAAc;AAMhC,IAAM,aAAa;AAKnB,IAAM,cAAoB;AAAA,EACxB,CAAC,OAAsC,iBAAiB;AACtD,UAAM,EAAE,eAAe,GAAG,WAAW,IAAI;AACzC,UAAM,UAAU,iBAAiB,YAAY,aAAa;AAC1D,WACE;AAAA,MAAC,UAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACJ,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,SAAS,qBAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAGnB,IAAM,kBAOT,CAAC,UAAU;AACb,SAAO,MAAM;AACf;AAIA,SAAS,SAAS,MAAe;AAC/B,SAAO,OAAO,SAAS;AACzB;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a070fed453551ff6c9fc27e4cc21e31e26f80e5b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dialog/package.json @@ -0,0 +1,81 @@ +{ + "name": "@radix-ui/react-dialog", + "version": "1.1.17", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-focus-scope": "1.1.10", + "@radix-ui/react-dismissable-layer": "1.1.13", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-portal": "1.1.12", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-slot": "1.3.0" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/typescript-config": "0.0.0", + "@repo/builder": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/dialog" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6ef44f47b9c6b6646513956d3df1ac636fc1b125 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/README.md @@ -0,0 +1,3 @@ +# `react-direction` + +View docs [here](https://radix-ui.com/primitives/docs/utilities/direction). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b0f8834145f6a11f8864b08b5e770aa39ecfa9a5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.d.mts @@ -0,0 +1,12 @@ +import * as React from 'react'; + +type Direction = 'ltr' | 'rtl'; +interface DirectionProviderProps { + children?: React.ReactNode; + dir: Direction; +} +declare const DirectionProvider: React.FC; +declare function useDirection(localDir?: Direction): Direction; +declare const Provider: React.FC; + +export { DirectionProvider, Provider, useDirection }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0f8834145f6a11f8864b08b5e770aa39ecfa9a5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.d.ts @@ -0,0 +1,12 @@ +import * as React from 'react'; + +type Direction = 'ltr' | 'rtl'; +interface DirectionProviderProps { + children?: React.ReactNode; + dir: Direction; +} +declare const DirectionProvider: React.FC; +declare function useDirection(localDir?: Direction): Direction; +declare const Provider: React.FC; + +export { DirectionProvider, Provider, useDirection }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..911c17c5ebedfc73ff69d77ced72c21ebe19eb82 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.js @@ -0,0 +1,53 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + DirectionProvider: () => DirectionProvider, + Provider: () => Provider, + useDirection: () => useDirection +}); +module.exports = __toCommonJS(index_exports); + +// src/direction.tsx +var React = __toESM(require("react")); +var import_jsx_runtime = require("react/jsx-runtime"); +var DirectionContext = React.createContext(void 0); +var DirectionProvider = (props) => { + const { dir, children } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionContext.Provider, { value: dir, children }); +}; +function useDirection(localDir) { + const globalDir = React.useContext(DirectionContext); + return localDir || globalDir || "ltr"; +} +var Provider = DirectionProvider; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e70e1b9228b371068be6bd544bca083a033e7a88 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/direction.tsx"], + "sourcesContent": ["'use client';\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n} from './direction';\n", "import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC = (props) => {\n const { dir, children } = props;\n return {children};\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAed;AAZT,IAAM,mBAAyB,oBAAqC,MAAS;AAU7E,IAAM,oBAAsD,CAAC,UAAU;AACrE,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SAAO,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAC1D;AAIA,SAAS,aAAa,UAAsB;AAC1C,QAAM,YAAkB,iBAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEA,IAAM,WAAW;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..79faf27fddf8a0fef8d1e1a656f1ef1055edcc6e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.mjs @@ -0,0 +1,21 @@ +"use client"; + +// src/direction.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +var DirectionContext = React.createContext(void 0); +var DirectionProvider = (props) => { + const { dir, children } = props; + return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children }); +}; +function useDirection(localDir) { + const globalDir = React.useContext(DirectionContext); + return localDir || globalDir || "ltr"; +} +var Provider = DirectionProvider; +export { + DirectionProvider, + Provider, + useDirection +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..84651261ae6bc8f78ea36b370c2e427bc6085dd2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/direction.tsx"], + "sourcesContent": ["import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC = (props) => {\n const { dir, children } = props;\n return {children};\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AAed;AAZT,IAAM,mBAAyB,oBAAqC,MAAS;AAU7E,IAAM,oBAAsD,CAAC,UAAU;AACrE,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAC1D;AAIA,SAAS,aAAa,UAAsB;AAC1C,QAAM,YAAkB,iBAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEA,IAAM,WAAW;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fbf2f1354826861125758ae75183201574db6017 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-direction/package.json @@ -0,0 +1,60 @@ +{ + "name": "@radix-ui/react-direction", + "version": "1.1.2", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/direction" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fbb8e092a16d1a67c3f08c573303b40997c0c086 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/README.md @@ -0,0 +1,3 @@ +# `react-dismissable-layer` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..99bffc25fd5136c05cc0ac5bcc05a7ff5b075c37 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts @@ -0,0 +1,62 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DismissableLayerProps extends PrimitiveDivProps { + /** + * When `true`, hover/focus/click interactions will be disabled on elements outside + * the `DismissableLayer`. Users will need to click twice on outside elements to + * interact with them: once to close the `DismissableLayer`, and again to trigger the element. + */ + disableOutsidePointerEvents?: boolean; + /** + * When `true`, a `'pointerdown'` event outside of the layered element will + * wait for the interaction's click event before dispatching, allowing + * third-party code to stop propagation of later events and cancel dismissal. + */ + deferPointerDownOutside?: boolean; + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: (event: KeyboardEvent) => void; + /** + * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. + * Can be prevented. + */ + onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; + /** + * Event handler called when the focus moves outside of the `DismissableLayer`. + * Can be prevented. + */ + onFocusOutside?: (event: FocusOutsideEvent) => void; + /** + * Event handler called when an interaction happens outside the `DismissableLayer`. + * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. + * Can be prevented. + */ + onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void; + /** + * Handler called when the `DismissableLayer` should be dismissed + */ + onDismiss?: () => void; +} +declare const DismissableLayer: React.ForwardRefExoticComponent>; +type DismissableLayerBranchElement = React.ComponentRef; +interface DismissableLayerBranchProps extends PrimitiveDivProps { +} +declare const DismissableLayerBranch: React.ForwardRefExoticComponent>; +/** + * Registers a node as a "dismiss surface" for the enclosing DismissableLayer + */ +declare function useDismissableLayerSurface(): React.RefCallback; +type PointerDownOutsideEvent = CustomEvent<{ + originalEvent: PointerEvent; +}>; +type FocusOutsideEvent = CustomEvent<{ + originalEvent: FocusEvent; +}>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Branch: React.ForwardRefExoticComponent>; + +export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root, useDismissableLayerSurface }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99bffc25fd5136c05cc0ac5bcc05a7ff5b075c37 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts @@ -0,0 +1,62 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DismissableLayerProps extends PrimitiveDivProps { + /** + * When `true`, hover/focus/click interactions will be disabled on elements outside + * the `DismissableLayer`. Users will need to click twice on outside elements to + * interact with them: once to close the `DismissableLayer`, and again to trigger the element. + */ + disableOutsidePointerEvents?: boolean; + /** + * When `true`, a `'pointerdown'` event outside of the layered element will + * wait for the interaction's click event before dispatching, allowing + * third-party code to stop propagation of later events and cancel dismissal. + */ + deferPointerDownOutside?: boolean; + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: (event: KeyboardEvent) => void; + /** + * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. + * Can be prevented. + */ + onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; + /** + * Event handler called when the focus moves outside of the `DismissableLayer`. + * Can be prevented. + */ + onFocusOutside?: (event: FocusOutsideEvent) => void; + /** + * Event handler called when an interaction happens outside the `DismissableLayer`. + * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. + * Can be prevented. + */ + onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void; + /** + * Handler called when the `DismissableLayer` should be dismissed + */ + onDismiss?: () => void; +} +declare const DismissableLayer: React.ForwardRefExoticComponent>; +type DismissableLayerBranchElement = React.ComponentRef; +interface DismissableLayerBranchProps extends PrimitiveDivProps { +} +declare const DismissableLayerBranch: React.ForwardRefExoticComponent>; +/** + * Registers a node as a "dismiss surface" for the enclosing DismissableLayer + */ +declare function useDismissableLayerSurface(): React.RefCallback; +type PointerDownOutsideEvent = CustomEvent<{ + originalEvent: PointerEvent; +}>; +type FocusOutsideEvent = CustomEvent<{ + originalEvent: FocusEvent; +}>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Branch: React.ForwardRefExoticComponent>; + +export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root, useDismissableLayerSurface }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2611540cc52bf7c234f485e9f15dfe946264589e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.js @@ -0,0 +1,364 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Branch: () => Branch, + DismissableLayer: () => DismissableLayer, + DismissableLayerBranch: () => DismissableLayerBranch, + Root: () => Root, + useDismissableLayerSurface: () => useDismissableLayerSurface +}); +module.exports = __toCommonJS(index_exports); + +// src/dismissable-layer.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_use_escape_keydown = require("@radix-ui/react-use-escape-keydown"); +var import_jsx_runtime = require("react/jsx-runtime"); +var DISMISSABLE_LAYER_NAME = "DismissableLayer"; +var CONTEXT_UPDATE = "dismissableLayer.update"; +var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; +var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; +var originalBodyPointerEvents; +var DismissableLayerContext = React.createContext({ + layers: /* @__PURE__ */ new Set(), + layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), + branches: /* @__PURE__ */ new Set(), + // Outside elements that belong to a layer's own dismiss affordance (eg, a + // dialog overlay). Pressing them should dismiss the layer regardless of + // whether or not they stop propagation. + // + // See https://github.com/radix-ui/primitives/issues/3346 + dismissableSurfaces: /* @__PURE__ */ new Set() +}); +var DismissableLayer = React.forwardRef( + (props, forwardedRef) => { + const { + disableOutsidePointerEvents = false, + deferPointerDownOutside = false, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + ...layerProps + } = props; + const context = React.useContext(DismissableLayerContext); + const [node, setNode] = React.useState(null); + const ownerDocument = node?.ownerDocument ?? globalThis?.document; + const [, force] = React.useState({}); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node2) => setNode(node2)); + const layers = Array.from(context.layers); + const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); + const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); + const index = node ? layers.indexOf(node) : -1; + const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; + const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; + const isDeferredPointerDownOutsideRef = React.useRef(false); + const pointerDownOutside = usePointerDownOutside( + (event) => { + const target = event.target; + if (!(target instanceof Node)) { + return; + } + const isPointerDownOnBranch = [...context.branches].some( + (branch) => branch.contains(target) + ); + if (!isPointerEventsEnabled || isPointerDownOnBranch) return; + onPointerDownOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, + { + ownerDocument, + deferPointerDownOutside, + isDeferredPointerDownOutsideRef, + dismissableSurfaces: context.dismissableSurfaces + } + ); + const focusOutside = useFocusOutside((event) => { + if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) { + return; + } + const target = event.target; + const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); + if (isFocusInBranch) return; + onFocusOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, ownerDocument); + (0, import_react_use_escape_keydown.useEscapeKeydown)((event) => { + const isHighestLayer = index === context.layers.size - 1; + if (!isHighestLayer) return; + onEscapeKeyDown?.(event); + if (!event.defaultPrevented && onDismiss) { + event.preventDefault(); + onDismiss(); + } + }, ownerDocument); + React.useEffect(() => { + if (!node) return; + if (disableOutsidePointerEvents) { + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; + ownerDocument.body.style.pointerEvents = "none"; + } + context.layersWithOutsidePointerEventsDisabled.add(node); + } + context.layers.add(node); + dispatchUpdate(); + return () => { + if (disableOutsidePointerEvents) { + context.layersWithOutsidePointerEventsDisabled.delete(node); + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; + } + } + }; + }, [node, ownerDocument, disableOutsidePointerEvents, context]); + React.useEffect(() => { + return () => { + if (!node) return; + context.layers.delete(node); + context.layersWithOutsidePointerEventsDisabled.delete(node); + dispatchUpdate(); + }; + }, [node, context]); + React.useEffect(() => { + const handleUpdate = () => force({}); + document.addEventListener(CONTEXT_UPDATE, handleUpdate); + return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...layerProps, + ref: composedRefs, + style: { + pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, + ...props.style + }, + onFocusCapture: (0, import_primitive.composeEventHandlers)(props.onFocusCapture, focusOutside.onFocusCapture), + onBlurCapture: (0, import_primitive.composeEventHandlers)(props.onBlurCapture, focusOutside.onBlurCapture), + onPointerDownCapture: (0, import_primitive.composeEventHandlers)( + props.onPointerDownCapture, + pointerDownOutside.onPointerDownCapture + ) + } + ); + } +); +DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; +var BRANCH_NAME = "DismissableLayerBranch"; +var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => { + const context = React.useContext(DismissableLayerContext); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + React.useEffect(() => { + const node = ref.current; + if (node) { + context.branches.add(node); + return () => { + context.branches.delete(node); + }; + } + }, [context.branches]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...props, ref: composedRefs }); +}); +DismissableLayerBranch.displayName = BRANCH_NAME; +function useDismissableLayerSurface() { + const context = React.useContext(DismissableLayerContext); + const [node, setNode] = React.useState(null); + React.useEffect(() => { + if (!node) { + return; + } + context.dismissableSurfaces.add(node); + return () => { + context.dismissableSurfaces.delete(node); + }; + }, [node, context.dismissableSurfaces]); + return setNode; +} +function usePointerDownOutside(onPointerDownOutside, args) { + const { + ownerDocument = globalThis?.document, + deferPointerDownOutside = false, + isDeferredPointerDownOutsideRef, + dismissableSurfaces + } = args; + const handlePointerDownOutside = (0, import_react_use_callback_ref.useCallbackRef)(onPointerDownOutside); + const isPointerInsideReactTreeRef = React.useRef(false); + const isPointerDownOutsideRef = React.useRef(false); + const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */ new Map()); + const handleClickRef = React.useRef(() => { + }); + React.useEffect(() => { + function resetOutsideInteraction() { + isPointerDownOutsideRef.current = false; + isDeferredPointerDownOutsideRef.current = false; + interceptedOutsideInteractionEventsRef.current.clear(); + } + function isOutsideInteractionIntercepted() { + return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean); + } + function handleInteractionCapture(event) { + if (!isPointerDownOutsideRef.current) { + return; + } + const target = event.target; + const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target)); + if (!isDismissableSurface) { + interceptedOutsideInteractionEventsRef.current.set(event.type, true); + } + if (event.type === "click") { + window.setTimeout(() => { + if (isPointerDownOutsideRef.current) { + handleClickRef.current(); + } + }, 0); + } + } + function handleInteractionBubble(event) { + if (isPointerDownOutsideRef.current) { + interceptedOutsideInteractionEventsRef.current.set(event.type, false); + } + } + const handlePointerDown = (event) => { + if (event.target && !isPointerInsideReactTreeRef.current) { + let handleAndDispatchPointerDownOutsideEvent2 = function() { + ownerDocument.removeEventListener("click", handleClickRef.current); + const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted(); + resetOutsideInteraction(); + if (!wasOutsideInteractionIntercepted) { + handleAndDispatchCustomEvent( + POINTER_DOWN_OUTSIDE, + handlePointerDownOutside, + eventDetail, + { discrete: true } + ); + } + }; + var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; + const eventDetail = { originalEvent: event }; + isPointerDownOutsideRef.current = true; + isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0; + interceptedOutsideInteractionEventsRef.current.clear(); + if (!deferPointerDownOutside || event.button !== 0) { + handleAndDispatchPointerDownOutsideEvent2(); + } else { + ownerDocument.removeEventListener("click", handleClickRef.current); + handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; + ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); + } + } else { + ownerDocument.removeEventListener("click", handleClickRef.current); + resetOutsideInteraction(); + } + isPointerInsideReactTreeRef.current = false; + }; + const outsideInteractionEvents = [ + "pointerup", + "mousedown", + "mouseup", + "touchstart", + "touchend", + "click" + ]; + for (const eventName of outsideInteractionEvents) { + ownerDocument.addEventListener(eventName, handleInteractionCapture, true); + ownerDocument.addEventListener(eventName, handleInteractionBubble); + } + const timerId = window.setTimeout(() => { + ownerDocument.addEventListener("pointerdown", handlePointerDown); + }, 0); + return () => { + window.clearTimeout(timerId); + ownerDocument.removeEventListener("pointerdown", handlePointerDown); + ownerDocument.removeEventListener("click", handleClickRef.current); + for (const eventName of outsideInteractionEvents) { + ownerDocument.removeEventListener(eventName, handleInteractionCapture, true); + ownerDocument.removeEventListener(eventName, handleInteractionBubble); + } + }; + }, [ + ownerDocument, + handlePointerDownOutside, + deferPointerDownOutside, + isDeferredPointerDownOutsideRef, + dismissableSurfaces + ]); + return { + // ensures we check React component tree (not just DOM tree) + onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true + }; +} +function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { + const handleFocusOutside = (0, import_react_use_callback_ref.useCallbackRef)(onFocusOutside); + const isFocusInsideReactTreeRef = React.useRef(false); + React.useEffect(() => { + const handleFocus = (event) => { + if (event.target && !isFocusInsideReactTreeRef.current) { + const eventDetail = { originalEvent: event }; + handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { + discrete: false + }); + } + }; + ownerDocument.addEventListener("focusin", handleFocus); + return () => ownerDocument.removeEventListener("focusin", handleFocus); + }, [ownerDocument, handleFocusOutside]); + return { + onFocusCapture: () => isFocusInsideReactTreeRef.current = true, + onBlurCapture: () => isFocusInsideReactTreeRef.current = false + }; +} +function dispatchUpdate() { + const event = new CustomEvent(CONTEXT_UPDATE); + document.dispatchEvent(event); +} +function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { + const target = detail.originalEvent.target; + const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); + if (handler) target.addEventListener(name, handler, { once: true }); + if (discrete) { + (0, import_react_primitive.dispatchDiscreteCustomEvent)(target, event); + } else { + target.dispatchEvent(event); + } +} +var Root = DismissableLayer; +var Branch = DismissableLayerBranch; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..dd4d55efb11376fc840bf6bf7f98b7a35e4ea5b2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/dismissable-layer.tsx"], + "sourcesContent": ["'use client';\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n //\n Root,\n Branch,\n /** @internal */\n useDismissableLayerSurface,\n} from './dismissable-layer';\nexport type { DismissableLayerProps } from './dismissable-layer';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useEscapeKeydown } from '@radix-ui/react-use-escape-keydown';\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/\n\nconst DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst CONTEXT_UPDATE = 'dismissableLayer.update';\nconst POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\n\nlet originalBodyPointerEvents: string;\n\nconst DismissableLayerContext = React.createContext({\n layers: new Set(),\n layersWithOutsidePointerEventsDisabled: new Set(),\n branches: new Set(),\n\n // Outside elements that belong to a layer's own dismiss affordance (eg, a\n // dialog overlay). Pressing them should dismiss the layer regardless of\n // whether or not they stop propagation.\n //\n // See https://github.com/radix-ui/primitives/issues/3346\n dismissableSurfaces: new Set(),\n});\n\ntype DismissableLayerElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DismissableLayerProps extends PrimitiveDivProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n /**\n * When `true`, a `'pointerdown'` event outside of the layered element will\n * wait for the interaction's click event before dispatching, allowing\n * third-party code to stop propagation of later events and cancel dismissal.\n */\n deferPointerDownOutside?: boolean;\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onFocusOutside?: (event: FocusOutsideEvent) => void;\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n onDismiss?: () => void;\n}\n\nconst DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n deferPointerDownOutside = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled!); // prettier-ignore\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const isDeferredPointerDownOutsideRef = React.useRef(false);\n\n const pointerDownOutside = usePointerDownOutside(\n (event) => {\n const target = event.target;\n if (!(target instanceof Node)) {\n return;\n }\n\n const isPointerDownOnBranch = [...context.branches].some((branch) =>\n branch.contains(target),\n );\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n },\n {\n ownerDocument,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces: context.dismissableSurfaces,\n },\n );\n\n const focusOutside = useFocusOutside((event) => {\n if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {\n return;\n }\n\n const target = event.target as HTMLElement;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = 'none';\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n // We must remove this layer from the disabled set whenever\n // `disableOutsidePointerEvents` becomes `false` (eg, when a modal\n // closes but stays mounted during an exit animation) and not only on\n // unmount. Otherwise the `body` `pointer-events` could be left as\n // `none` when multiple layers overlap.\n // See: https://github.com/radix-ui/primitives/issues/3645\n if (disableOutsidePointerEvents) {\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n\n /**\n * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect\n * because a change to `disableOutsidePointerEvents` would remove this layer from the stack\n * and add it to the end again so the layering order wouldn't be _creation order_.\n * We only want them to be removed from context stacks when unmounted.\n */\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n\n return (\n \n );\n },\n);\n\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayerBranch\n * -----------------------------------------------------------------------------------------------*/\n\nconst BRANCH_NAME = 'DismissableLayerBranch';\n\ntype DismissableLayerBranchElement = React.ComponentRef;\ninterface DismissableLayerBranchProps extends PrimitiveDivProps {}\n\nconst DismissableLayerBranch = React.forwardRef<\n DismissableLayerBranchElement,\n DismissableLayerBranchProps\n>((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n\n return ;\n});\n\nDismissableLayerBranch.displayName = BRANCH_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n/**\n * Registers a node as a \"dismiss surface\" for the enclosing DismissableLayer\n */\nfunction useDismissableLayerSurface(): React.RefCallback {\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n\n React.useEffect(() => {\n if (!node) {\n return;\n }\n context.dismissableSurfaces.add(node);\n return () => {\n context.dismissableSurfaces.delete(node);\n };\n }, [node, context.dismissableSurfaces]);\n\n return setNode;\n}\n\ntype PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>;\ntype FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;\n\n/**\n * Listens for `pointerdown` outside a react subtree. We detect the start of the interaction on\n * `pointerdown`, then wait for `click` so external code can intercept later mouse events.\n * Returns props to pass to the node we want to check for outside events.\n */\nfunction usePointerDownOutside(\n onPointerDownOutside: ((event: PointerDownOutsideEvent) => void) | undefined,\n args: {\n ownerDocument: Document | undefined;\n deferPointerDownOutside: boolean;\n isDeferredPointerDownOutsideRef: React.RefObject;\n dismissableSurfaces: Set;\n },\n) {\n const {\n ownerDocument = globalThis?.document,\n deferPointerDownOutside = false,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n } = args;\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside) as EventListener;\n const isPointerInsideReactTreeRef = React.useRef(false);\n const isPointerDownOutsideRef = React.useRef(false);\n const interceptedOutsideInteractionEventsRef = React.useRef>(new Map());\n const handleClickRef = React.useRef(() => {});\n\n React.useEffect(() => {\n function resetOutsideInteraction() {\n isPointerDownOutsideRef.current = false;\n isDeferredPointerDownOutsideRef.current = false;\n interceptedOutsideInteractionEventsRef.current.clear();\n }\n\n function isOutsideInteractionIntercepted() {\n return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);\n }\n\n function handleInteractionCapture(event: Event) {\n if (!isPointerDownOutsideRef.current) {\n return;\n }\n\n const target = event.target;\n const isDismissableSurface =\n target instanceof Node &&\n [...dismissableSurfaces].some((surface) => surface.contains(target as Node));\n\n if (!isDismissableSurface) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, true);\n }\n\n if (event.type === 'click') {\n window.setTimeout(() => {\n if (isPointerDownOutsideRef.current) {\n handleClickRef.current();\n }\n }, 0);\n }\n }\n\n function handleInteractionBubble(event: Event) {\n if (isPointerDownOutsideRef.current) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, false);\n }\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n isPointerDownOutsideRef.current = true;\n isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;\n interceptedOutsideInteractionEventsRef.current.clear();\n\n function handleAndDispatchPointerDownOutsideEvent() {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();\n resetOutsideInteraction();\n\n if (!wasOutsideInteractionIntercepted) {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true },\n );\n }\n }\n\n /**\n * When deferring, we need to wait for a click event because:\n *\n * 1. On touch devices, browsers implement a ~350ms delay between the\n * time the user stops touching the display and when the browser\n * executes events. We need to ensure we don't reactivate\n * pointer-events within this timeframe otherwise the browser may\n * execute events that should have been prevented.\n *\n * 2. Browser extensions and other third-party code may call\n * `stopPropagation` on later mouse events like `mousedown`,\n * `mouseup`, or `click`. Waiting lets those intercepted events\n * cancel the outside interaction before we dismiss the layer. See\n * https://github.com/radix-ui/primitives/issues/2055\n *\n * Additionally, this also lets us deal automatically with cancellations\n * when a click event isn't raised because the page was considered\n * scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener,\n * because we cannot be certain that it was raised, and therefore\n * cleaned-up.\n *\n * For non-primary buttons, we dispatch the event immediately because we\n * cannot be certain that the event was canceled.\n */\n if (!deferPointerDownOutside || event.button !== 0) {\n handleAndDispatchPointerDownOutsideEvent();\n } else {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener('click', handleClickRef.current, { once: true });\n }\n } else {\n // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener('click', handleClickRef.current);\n resetOutsideInteraction();\n }\n isPointerInsideReactTreeRef.current = false;\n };\n\n const outsideInteractionEvents = [\n 'pointerup',\n 'mousedown',\n 'mouseup',\n 'touchstart',\n 'touchend',\n 'click',\n ];\n\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.addEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.addEventListener(eventName, handleInteractionBubble);\n }\n\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is not React specific, but rather how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener('pointerdown', handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener('pointerdown', handlePointerDown);\n ownerDocument.removeEventListener('click', handleClickRef.current);\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.removeEventListener(eventName, handleInteractionBubble);\n }\n };\n }, [\n ownerDocument,\n handlePointerDownOutside,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n ]);\n\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => (isPointerInsideReactTreeRef.current = true),\n };\n}\n\n/**\n * Listens for when focus happens outside a react subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */\nfunction useFocusOutside(\n onFocusOutside?: (event: FocusOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document,\n) {\n const handleFocusOutside = useCallbackRef(onFocusOutside) as EventListener;\n const isFocusInsideReactTreeRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleFocus = (event: FocusEvent) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false,\n });\n }\n };\n ownerDocument.addEventListener('focusin', handleFocus);\n return () => ownerDocument.removeEventListener('focusin', handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n\n return {\n onFocusCapture: () => (isFocusInsideReactTreeRef.current = true),\n onBlurCapture: () => (isFocusInsideReactTreeRef.current = false),\n };\n}\n\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n\nfunction handleAndDispatchCustomEvent(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent ? D : never),\n { discrete }: { discrete: boolean },\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler as EventListener, { once: true });\n\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n\nconst Root = DismissableLayer;\nconst Branch = DismissableLayerBranch;\n\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n useDismissableLayerSurface,\n //\n Root,\n Branch,\n};\nexport type { DismissableLayerProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,6BAAuD;AACvD,gCAAgC;AAChC,oCAA+B;AAC/B,sCAAiC;AA4L3B;AAtLN,IAAM,yBAAyB;AAC/B,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AAEtB,IAAI;AAEJ,IAAM,0BAAgC,oBAAc;AAAA,EAClD,QAAQ,oBAAI,IAA6B;AAAA,EACzC,wCAAwC,oBAAI,IAA6B;AAAA,EACzE,UAAU,oBAAI,IAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjD,qBAAqB,oBAAI,IAAmC;AAC9D,CAAC;AA4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iB,MAAM,SAA0B,EAAE,MAAM,KAAK,CAAC;AAEnF,MAAI,UAAU;AACZ,4DAA4B,QAAQ,KAAK;AAAA,EAC3C,OAAO;AACL,WAAO,cAAc,KAAK;AAAA,EAC5B;AACF;AAEA,IAAM,OAAO;AACb,IAAM,SAAS;", + "names": ["node", "handleAndDispatchPointerDownOutsideEvent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9d19cc7984803f74cbc01de8edd80622d21a5314 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs @@ -0,0 +1,332 @@ +"use client"; + +// src/dismissable-layer.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { Primitive, dispatchDiscreteCustomEvent } from "@radix-ui/react-primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown"; +import { jsx } from "react/jsx-runtime"; +var DISMISSABLE_LAYER_NAME = "DismissableLayer"; +var CONTEXT_UPDATE = "dismissableLayer.update"; +var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; +var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; +var originalBodyPointerEvents; +var DismissableLayerContext = React.createContext({ + layers: /* @__PURE__ */ new Set(), + layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), + branches: /* @__PURE__ */ new Set(), + // Outside elements that belong to a layer's own dismiss affordance (eg, a + // dialog overlay). Pressing them should dismiss the layer regardless of + // whether or not they stop propagation. + // + // See https://github.com/radix-ui/primitives/issues/3346 + dismissableSurfaces: /* @__PURE__ */ new Set() +}); +var DismissableLayer = React.forwardRef( + (props, forwardedRef) => { + const { + disableOutsidePointerEvents = false, + deferPointerDownOutside = false, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + ...layerProps + } = props; + const context = React.useContext(DismissableLayerContext); + const [node, setNode] = React.useState(null); + const ownerDocument = node?.ownerDocument ?? globalThis?.document; + const [, force] = React.useState({}); + const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2)); + const layers = Array.from(context.layers); + const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); + const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); + const index = node ? layers.indexOf(node) : -1; + const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; + const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; + const isDeferredPointerDownOutsideRef = React.useRef(false); + const pointerDownOutside = usePointerDownOutside( + (event) => { + const target = event.target; + if (!(target instanceof Node)) { + return; + } + const isPointerDownOnBranch = [...context.branches].some( + (branch) => branch.contains(target) + ); + if (!isPointerEventsEnabled || isPointerDownOnBranch) return; + onPointerDownOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, + { + ownerDocument, + deferPointerDownOutside, + isDeferredPointerDownOutsideRef, + dismissableSurfaces: context.dismissableSurfaces + } + ); + const focusOutside = useFocusOutside((event) => { + if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) { + return; + } + const target = event.target; + const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); + if (isFocusInBranch) return; + onFocusOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, ownerDocument); + useEscapeKeydown((event) => { + const isHighestLayer = index === context.layers.size - 1; + if (!isHighestLayer) return; + onEscapeKeyDown?.(event); + if (!event.defaultPrevented && onDismiss) { + event.preventDefault(); + onDismiss(); + } + }, ownerDocument); + React.useEffect(() => { + if (!node) return; + if (disableOutsidePointerEvents) { + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; + ownerDocument.body.style.pointerEvents = "none"; + } + context.layersWithOutsidePointerEventsDisabled.add(node); + } + context.layers.add(node); + dispatchUpdate(); + return () => { + if (disableOutsidePointerEvents) { + context.layersWithOutsidePointerEventsDisabled.delete(node); + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; + } + } + }; + }, [node, ownerDocument, disableOutsidePointerEvents, context]); + React.useEffect(() => { + return () => { + if (!node) return; + context.layers.delete(node); + context.layersWithOutsidePointerEventsDisabled.delete(node); + dispatchUpdate(); + }; + }, [node, context]); + React.useEffect(() => { + const handleUpdate = () => force({}); + document.addEventListener(CONTEXT_UPDATE, handleUpdate); + return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); + }, []); + return /* @__PURE__ */ jsx( + Primitive.div, + { + ...layerProps, + ref: composedRefs, + style: { + pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, + ...props.style + }, + onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), + onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), + onPointerDownCapture: composeEventHandlers( + props.onPointerDownCapture, + pointerDownOutside.onPointerDownCapture + ) + } + ); + } +); +DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; +var BRANCH_NAME = "DismissableLayerBranch"; +var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => { + const context = React.useContext(DismissableLayerContext); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + React.useEffect(() => { + const node = ref.current; + if (node) { + context.branches.add(node); + return () => { + context.branches.delete(node); + }; + } + }, [context.branches]); + return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs }); +}); +DismissableLayerBranch.displayName = BRANCH_NAME; +function useDismissableLayerSurface() { + const context = React.useContext(DismissableLayerContext); + const [node, setNode] = React.useState(null); + React.useEffect(() => { + if (!node) { + return; + } + context.dismissableSurfaces.add(node); + return () => { + context.dismissableSurfaces.delete(node); + }; + }, [node, context.dismissableSurfaces]); + return setNode; +} +function usePointerDownOutside(onPointerDownOutside, args) { + const { + ownerDocument = globalThis?.document, + deferPointerDownOutside = false, + isDeferredPointerDownOutsideRef, + dismissableSurfaces + } = args; + const handlePointerDownOutside = useCallbackRef(onPointerDownOutside); + const isPointerInsideReactTreeRef = React.useRef(false); + const isPointerDownOutsideRef = React.useRef(false); + const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */ new Map()); + const handleClickRef = React.useRef(() => { + }); + React.useEffect(() => { + function resetOutsideInteraction() { + isPointerDownOutsideRef.current = false; + isDeferredPointerDownOutsideRef.current = false; + interceptedOutsideInteractionEventsRef.current.clear(); + } + function isOutsideInteractionIntercepted() { + return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean); + } + function handleInteractionCapture(event) { + if (!isPointerDownOutsideRef.current) { + return; + } + const target = event.target; + const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target)); + if (!isDismissableSurface) { + interceptedOutsideInteractionEventsRef.current.set(event.type, true); + } + if (event.type === "click") { + window.setTimeout(() => { + if (isPointerDownOutsideRef.current) { + handleClickRef.current(); + } + }, 0); + } + } + function handleInteractionBubble(event) { + if (isPointerDownOutsideRef.current) { + interceptedOutsideInteractionEventsRef.current.set(event.type, false); + } + } + const handlePointerDown = (event) => { + if (event.target && !isPointerInsideReactTreeRef.current) { + let handleAndDispatchPointerDownOutsideEvent2 = function() { + ownerDocument.removeEventListener("click", handleClickRef.current); + const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted(); + resetOutsideInteraction(); + if (!wasOutsideInteractionIntercepted) { + handleAndDispatchCustomEvent( + POINTER_DOWN_OUTSIDE, + handlePointerDownOutside, + eventDetail, + { discrete: true } + ); + } + }; + var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; + const eventDetail = { originalEvent: event }; + isPointerDownOutsideRef.current = true; + isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0; + interceptedOutsideInteractionEventsRef.current.clear(); + if (!deferPointerDownOutside || event.button !== 0) { + handleAndDispatchPointerDownOutsideEvent2(); + } else { + ownerDocument.removeEventListener("click", handleClickRef.current); + handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; + ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); + } + } else { + ownerDocument.removeEventListener("click", handleClickRef.current); + resetOutsideInteraction(); + } + isPointerInsideReactTreeRef.current = false; + }; + const outsideInteractionEvents = [ + "pointerup", + "mousedown", + "mouseup", + "touchstart", + "touchend", + "click" + ]; + for (const eventName of outsideInteractionEvents) { + ownerDocument.addEventListener(eventName, handleInteractionCapture, true); + ownerDocument.addEventListener(eventName, handleInteractionBubble); + } + const timerId = window.setTimeout(() => { + ownerDocument.addEventListener("pointerdown", handlePointerDown); + }, 0); + return () => { + window.clearTimeout(timerId); + ownerDocument.removeEventListener("pointerdown", handlePointerDown); + ownerDocument.removeEventListener("click", handleClickRef.current); + for (const eventName of outsideInteractionEvents) { + ownerDocument.removeEventListener(eventName, handleInteractionCapture, true); + ownerDocument.removeEventListener(eventName, handleInteractionBubble); + } + }; + }, [ + ownerDocument, + handlePointerDownOutside, + deferPointerDownOutside, + isDeferredPointerDownOutsideRef, + dismissableSurfaces + ]); + return { + // ensures we check React component tree (not just DOM tree) + onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true + }; +} +function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { + const handleFocusOutside = useCallbackRef(onFocusOutside); + const isFocusInsideReactTreeRef = React.useRef(false); + React.useEffect(() => { + const handleFocus = (event) => { + if (event.target && !isFocusInsideReactTreeRef.current) { + const eventDetail = { originalEvent: event }; + handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { + discrete: false + }); + } + }; + ownerDocument.addEventListener("focusin", handleFocus); + return () => ownerDocument.removeEventListener("focusin", handleFocus); + }, [ownerDocument, handleFocusOutside]); + return { + onFocusCapture: () => isFocusInsideReactTreeRef.current = true, + onBlurCapture: () => isFocusInsideReactTreeRef.current = false + }; +} +function dispatchUpdate() { + const event = new CustomEvent(CONTEXT_UPDATE); + document.dispatchEvent(event); +} +function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { + const target = detail.originalEvent.target; + const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); + if (handler) target.addEventListener(name, handler, { once: true }); + if (discrete) { + dispatchDiscreteCustomEvent(target, event); + } else { + target.dispatchEvent(event); + } +} +var Root = DismissableLayer; +var Branch = DismissableLayerBranch; +export { + Branch, + DismissableLayer, + DismissableLayerBranch, + Root, + useDismissableLayerSurface +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..6ab3c9279bef234ad50fcabb9efc9f363f436b3d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/dismissable-layer.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useEscapeKeydown } from '@radix-ui/react-use-escape-keydown';\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/\n\nconst DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst CONTEXT_UPDATE = 'dismissableLayer.update';\nconst POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\n\nlet originalBodyPointerEvents: string;\n\nconst DismissableLayerContext = React.createContext({\n layers: new Set(),\n layersWithOutsidePointerEventsDisabled: new Set(),\n branches: new Set(),\n\n // Outside elements that belong to a layer's own dismiss affordance (eg, a\n // dialog overlay). Pressing them should dismiss the layer regardless of\n // whether or not they stop propagation.\n //\n // See https://github.com/radix-ui/primitives/issues/3346\n dismissableSurfaces: new Set(),\n});\n\ntype DismissableLayerElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DismissableLayerProps extends PrimitiveDivProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n /**\n * When `true`, a `'pointerdown'` event outside of the layered element will\n * wait for the interaction's click event before dispatching, allowing\n * third-party code to stop propagation of later events and cancel dismissal.\n */\n deferPointerDownOutside?: boolean;\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onFocusOutside?: (event: FocusOutsideEvent) => void;\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n onDismiss?: () => void;\n}\n\nconst DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n deferPointerDownOutside = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled!); // prettier-ignore\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const isDeferredPointerDownOutsideRef = React.useRef(false);\n\n const pointerDownOutside = usePointerDownOutside(\n (event) => {\n const target = event.target;\n if (!(target instanceof Node)) {\n return;\n }\n\n const isPointerDownOnBranch = [...context.branches].some((branch) =>\n branch.contains(target),\n );\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n },\n {\n ownerDocument,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces: context.dismissableSurfaces,\n },\n );\n\n const focusOutside = useFocusOutside((event) => {\n if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {\n return;\n }\n\n const target = event.target as HTMLElement;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = 'none';\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n // We must remove this layer from the disabled set whenever\n // `disableOutsidePointerEvents` becomes `false` (eg, when a modal\n // closes but stays mounted during an exit animation) and not only on\n // unmount. Otherwise the `body` `pointer-events` could be left as\n // `none` when multiple layers overlap.\n // See: https://github.com/radix-ui/primitives/issues/3645\n if (disableOutsidePointerEvents) {\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n\n /**\n * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect\n * because a change to `disableOutsidePointerEvents` would remove this layer from the stack\n * and add it to the end again so the layering order wouldn't be _creation order_.\n * We only want them to be removed from context stacks when unmounted.\n */\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n\n return (\n \n );\n },\n);\n\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayerBranch\n * -----------------------------------------------------------------------------------------------*/\n\nconst BRANCH_NAME = 'DismissableLayerBranch';\n\ntype DismissableLayerBranchElement = React.ComponentRef;\ninterface DismissableLayerBranchProps extends PrimitiveDivProps {}\n\nconst DismissableLayerBranch = React.forwardRef<\n DismissableLayerBranchElement,\n DismissableLayerBranchProps\n>((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n\n return ;\n});\n\nDismissableLayerBranch.displayName = BRANCH_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n/**\n * Registers a node as a \"dismiss surface\" for the enclosing DismissableLayer\n */\nfunction useDismissableLayerSurface(): React.RefCallback {\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n\n React.useEffect(() => {\n if (!node) {\n return;\n }\n context.dismissableSurfaces.add(node);\n return () => {\n context.dismissableSurfaces.delete(node);\n };\n }, [node, context.dismissableSurfaces]);\n\n return setNode;\n}\n\ntype PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>;\ntype FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;\n\n/**\n * Listens for `pointerdown` outside a react subtree. We detect the start of the interaction on\n * `pointerdown`, then wait for `click` so external code can intercept later mouse events.\n * Returns props to pass to the node we want to check for outside events.\n */\nfunction usePointerDownOutside(\n onPointerDownOutside: ((event: PointerDownOutsideEvent) => void) | undefined,\n args: {\n ownerDocument: Document | undefined;\n deferPointerDownOutside: boolean;\n isDeferredPointerDownOutsideRef: React.RefObject;\n dismissableSurfaces: Set;\n },\n) {\n const {\n ownerDocument = globalThis?.document,\n deferPointerDownOutside = false,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n } = args;\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside) as EventListener;\n const isPointerInsideReactTreeRef = React.useRef(false);\n const isPointerDownOutsideRef = React.useRef(false);\n const interceptedOutsideInteractionEventsRef = React.useRef>(new Map());\n const handleClickRef = React.useRef(() => {});\n\n React.useEffect(() => {\n function resetOutsideInteraction() {\n isPointerDownOutsideRef.current = false;\n isDeferredPointerDownOutsideRef.current = false;\n interceptedOutsideInteractionEventsRef.current.clear();\n }\n\n function isOutsideInteractionIntercepted() {\n return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);\n }\n\n function handleInteractionCapture(event: Event) {\n if (!isPointerDownOutsideRef.current) {\n return;\n }\n\n const target = event.target;\n const isDismissableSurface =\n target instanceof Node &&\n [...dismissableSurfaces].some((surface) => surface.contains(target as Node));\n\n if (!isDismissableSurface) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, true);\n }\n\n if (event.type === 'click') {\n window.setTimeout(() => {\n if (isPointerDownOutsideRef.current) {\n handleClickRef.current();\n }\n }, 0);\n }\n }\n\n function handleInteractionBubble(event: Event) {\n if (isPointerDownOutsideRef.current) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, false);\n }\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n isPointerDownOutsideRef.current = true;\n isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;\n interceptedOutsideInteractionEventsRef.current.clear();\n\n function handleAndDispatchPointerDownOutsideEvent() {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();\n resetOutsideInteraction();\n\n if (!wasOutsideInteractionIntercepted) {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true },\n );\n }\n }\n\n /**\n * When deferring, we need to wait for a click event because:\n *\n * 1. On touch devices, browsers implement a ~350ms delay between the\n * time the user stops touching the display and when the browser\n * executes events. We need to ensure we don't reactivate\n * pointer-events within this timeframe otherwise the browser may\n * execute events that should have been prevented.\n *\n * 2. Browser extensions and other third-party code may call\n * `stopPropagation` on later mouse events like `mousedown`,\n * `mouseup`, or `click`. Waiting lets those intercepted events\n * cancel the outside interaction before we dismiss the layer. See\n * https://github.com/radix-ui/primitives/issues/2055\n *\n * Additionally, this also lets us deal automatically with cancellations\n * when a click event isn't raised because the page was considered\n * scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener,\n * because we cannot be certain that it was raised, and therefore\n * cleaned-up.\n *\n * For non-primary buttons, we dispatch the event immediately because we\n * cannot be certain that the event was canceled.\n */\n if (!deferPointerDownOutside || event.button !== 0) {\n handleAndDispatchPointerDownOutsideEvent();\n } else {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener('click', handleClickRef.current, { once: true });\n }\n } else {\n // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener('click', handleClickRef.current);\n resetOutsideInteraction();\n }\n isPointerInsideReactTreeRef.current = false;\n };\n\n const outsideInteractionEvents = [\n 'pointerup',\n 'mousedown',\n 'mouseup',\n 'touchstart',\n 'touchend',\n 'click',\n ];\n\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.addEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.addEventListener(eventName, handleInteractionBubble);\n }\n\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is not React specific, but rather how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener('pointerdown', handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener('pointerdown', handlePointerDown);\n ownerDocument.removeEventListener('click', handleClickRef.current);\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.removeEventListener(eventName, handleInteractionBubble);\n }\n };\n }, [\n ownerDocument,\n handlePointerDownOutside,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n ]);\n\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => (isPointerInsideReactTreeRef.current = true),\n };\n}\n\n/**\n * Listens for when focus happens outside a react subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */\nfunction useFocusOutside(\n onFocusOutside?: (event: FocusOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document,\n) {\n const handleFocusOutside = useCallbackRef(onFocusOutside) as EventListener;\n const isFocusInsideReactTreeRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleFocus = (event: FocusEvent) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false,\n });\n }\n };\n ownerDocument.addEventListener('focusin', handleFocus);\n return () => ownerDocument.removeEventListener('focusin', handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n\n return {\n onFocusCapture: () => (isFocusInsideReactTreeRef.current = true),\n onBlurCapture: () => (isFocusInsideReactTreeRef.current = false),\n };\n}\n\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n\nfunction handleAndDispatchCustomEvent(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent ? D : never),\n { discrete }: { discrete: boolean },\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler as EventListener, { once: true });\n\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n\nconst Root = DismissableLayer;\nconst Branch = DismissableLayerBranch;\n\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n useDismissableLayerSurface,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BAAiB,WAAW,WAAW;AACrD,WAAO,MAAM,cAAc,oBAAoB,WAAW,WAAW;AAAA,EACvE,GAAG,CAAC,eAAe,kBAAkB,CAAC;AAEtC,SAAO;AAAA,IACL,gBAAgB,MAAO,0BAA0B,UAAU;AAAA,IAC3D,eAAe,MAAO,0BAA0B,UAAU;AAAA,EAC5D;AACF;AAEA,SAAS,iBAAiB;AACxB,QAAM,QAAQ,IAAI,YAAY,cAAc;AAC5C,WAAS,cAAc,KAAK;AAC9B;AAEA,SAAS,6BACP,MACA,SACA,QACA,EAAE,SAAS,GACX;AACA,QAAM,SAAS,OAAO,cAAc;AACpC,QAAM,QAAQ,IAAI,YAAY,MAAM,EAAE,SAAS,OAAO,YAAY,MAAM,OAAO,CAAC;AAChF,MAAI,QAAS,QAAO,iBAAiB,MAAM,SAA0B,EAAE,MAAM,KAAK,CAAC;AAEnF,MAAI,UAAU;AACZ,gCAA4B,QAAQ,KAAK;AAAA,EAC3C,OAAO;AACL,WAAO,cAAc,KAAK;AAAA,EAC5B;AACF;AAEA,IAAM,OAAO;AACb,IAAM,SAAS;", + "names": ["node", "handleAndDispatchPointerDownOutsideEvent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..738d00bb0e4cb1cd25dddb91f0d0fcd105d163c4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dismissable-layer/package.json @@ -0,0 +1,73 @@ +{ + "name": "@radix-ui/react-dismissable-layer", + "version": "1.1.13", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-escape-keydown": "1.1.2", + "@radix-ui/primitive": "1.1.4" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-remove-scroll": "^2.7.2", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/dismissable-layer" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d1e96feb24b6a55e0897c5ba9171b2a7a636ec7a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/README.md @@ -0,0 +1,3 @@ +# `react-dropdown-menu` + +View docs [here](https://radix-ui.com/primitives/docs/components/dropdown-menu). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c1e140f67dc63fc6afd3601aae4946a9bb5b8757 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.d.mts @@ -0,0 +1,97 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as MenuPrimitive from '@radix-ui/react-menu'; + +type Direction = 'ltr' | 'rtl'; +declare const createDropdownMenuScope: _radix_ui_react_context.CreateScope; +interface DropdownMenuProps { + children?: React.ReactNode; + dir?: Direction; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + modal?: boolean; +} +declare const DropdownMenu: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface DropdownMenuTriggerProps extends PrimitiveButtonProps { +} +declare const DropdownMenuTrigger: React.ForwardRefExoticComponent>; +type MenuPortalProps = React.ComponentPropsWithoutRef; +interface DropdownMenuPortalProps extends MenuPortalProps { +} +declare const DropdownMenuPortal: React.FC; +type MenuContentProps = React.ComponentPropsWithoutRef; +interface DropdownMenuContentProps extends Omit { +} +declare const DropdownMenuContent: React.ForwardRefExoticComponent>; +type MenuGroupProps = React.ComponentPropsWithoutRef; +interface DropdownMenuGroupProps extends MenuGroupProps { +} +declare const DropdownMenuGroup: React.ForwardRefExoticComponent>; +type MenuLabelProps = React.ComponentPropsWithoutRef; +interface DropdownMenuLabelProps extends MenuLabelProps { +} +declare const DropdownMenuLabel: React.ForwardRefExoticComponent>; +type MenuItemProps = React.ComponentPropsWithoutRef; +interface DropdownMenuItemProps extends MenuItemProps { +} +declare const DropdownMenuItem: React.ForwardRefExoticComponent>; +type MenuCheckboxItemProps = React.ComponentPropsWithoutRef; +interface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps { +} +declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent>; +type MenuRadioGroupProps = React.ComponentPropsWithoutRef; +interface DropdownMenuRadioGroupProps extends MenuRadioGroupProps { +} +declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent>; +type MenuRadioItemProps = React.ComponentPropsWithoutRef; +interface DropdownMenuRadioItemProps extends MenuRadioItemProps { +} +declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent>; +type MenuItemIndicatorProps = React.ComponentPropsWithoutRef; +interface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps { +} +declare const DropdownMenuItemIndicator: React.ForwardRefExoticComponent>; +type MenuSeparatorProps = React.ComponentPropsWithoutRef; +interface DropdownMenuSeparatorProps extends MenuSeparatorProps { +} +declare const DropdownMenuSeparator: React.ForwardRefExoticComponent>; +type MenuArrowProps = React.ComponentPropsWithoutRef; +interface DropdownMenuArrowProps extends MenuArrowProps { +} +declare const DropdownMenuArrow: React.ForwardRefExoticComponent>; +interface DropdownMenuSubProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; +} +declare const DropdownMenuSub: React.FC; +type MenuSubTriggerProps = React.ComponentPropsWithoutRef; +interface DropdownMenuSubTriggerProps extends MenuSubTriggerProps { +} +declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent>; +type MenuSubContentProps = React.ComponentPropsWithoutRef; +interface DropdownMenuSubContentProps extends MenuSubContentProps { +} +declare const DropdownMenuSubContent: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Group: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const CheckboxItem: React.ForwardRefExoticComponent>; +declare const RadioGroup: React.ForwardRefExoticComponent>; +declare const RadioItem: React.ForwardRefExoticComponent>; +declare const ItemIndicator: React.ForwardRefExoticComponent>; +declare const Separator: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Sub: React.FC; +declare const SubTrigger: React.ForwardRefExoticComponent>; +declare const SubContent: React.ForwardRefExoticComponent>; + +export { Arrow, CheckboxItem, Content, DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemIndicator, type DropdownMenuItemIndicatorProps, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, Group, Item, ItemIndicator, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger, createDropdownMenuScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1e140f67dc63fc6afd3601aae4946a9bb5b8757 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.d.ts @@ -0,0 +1,97 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as MenuPrimitive from '@radix-ui/react-menu'; + +type Direction = 'ltr' | 'rtl'; +declare const createDropdownMenuScope: _radix_ui_react_context.CreateScope; +interface DropdownMenuProps { + children?: React.ReactNode; + dir?: Direction; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + modal?: boolean; +} +declare const DropdownMenu: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface DropdownMenuTriggerProps extends PrimitiveButtonProps { +} +declare const DropdownMenuTrigger: React.ForwardRefExoticComponent>; +type MenuPortalProps = React.ComponentPropsWithoutRef; +interface DropdownMenuPortalProps extends MenuPortalProps { +} +declare const DropdownMenuPortal: React.FC; +type MenuContentProps = React.ComponentPropsWithoutRef; +interface DropdownMenuContentProps extends Omit { +} +declare const DropdownMenuContent: React.ForwardRefExoticComponent>; +type MenuGroupProps = React.ComponentPropsWithoutRef; +interface DropdownMenuGroupProps extends MenuGroupProps { +} +declare const DropdownMenuGroup: React.ForwardRefExoticComponent>; +type MenuLabelProps = React.ComponentPropsWithoutRef; +interface DropdownMenuLabelProps extends MenuLabelProps { +} +declare const DropdownMenuLabel: React.ForwardRefExoticComponent>; +type MenuItemProps = React.ComponentPropsWithoutRef; +interface DropdownMenuItemProps extends MenuItemProps { +} +declare const DropdownMenuItem: React.ForwardRefExoticComponent>; +type MenuCheckboxItemProps = React.ComponentPropsWithoutRef; +interface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps { +} +declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent>; +type MenuRadioGroupProps = React.ComponentPropsWithoutRef; +interface DropdownMenuRadioGroupProps extends MenuRadioGroupProps { +} +declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent>; +type MenuRadioItemProps = React.ComponentPropsWithoutRef; +interface DropdownMenuRadioItemProps extends MenuRadioItemProps { +} +declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent>; +type MenuItemIndicatorProps = React.ComponentPropsWithoutRef; +interface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps { +} +declare const DropdownMenuItemIndicator: React.ForwardRefExoticComponent>; +type MenuSeparatorProps = React.ComponentPropsWithoutRef; +interface DropdownMenuSeparatorProps extends MenuSeparatorProps { +} +declare const DropdownMenuSeparator: React.ForwardRefExoticComponent>; +type MenuArrowProps = React.ComponentPropsWithoutRef; +interface DropdownMenuArrowProps extends MenuArrowProps { +} +declare const DropdownMenuArrow: React.ForwardRefExoticComponent>; +interface DropdownMenuSubProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; +} +declare const DropdownMenuSub: React.FC; +type MenuSubTriggerProps = React.ComponentPropsWithoutRef; +interface DropdownMenuSubTriggerProps extends MenuSubTriggerProps { +} +declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent>; +type MenuSubContentProps = React.ComponentPropsWithoutRef; +interface DropdownMenuSubContentProps extends MenuSubContentProps { +} +declare const DropdownMenuSubContent: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Group: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const CheckboxItem: React.ForwardRefExoticComponent>; +declare const RadioGroup: React.ForwardRefExoticComponent>; +declare const RadioItem: React.ForwardRefExoticComponent>; +declare const ItemIndicator: React.ForwardRefExoticComponent>; +declare const Separator: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Sub: React.FC; +declare const SubTrigger: React.ForwardRefExoticComponent>; +declare const SubContent: React.ForwardRefExoticComponent>; + +export { Arrow, CheckboxItem, Content, DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemIndicator, type DropdownMenuItemIndicatorProps, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, Group, Item, ItemIndicator, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger, createDropdownMenuScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2087d670495a7664b83f0a910dbd09727a0b5679 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.js @@ -0,0 +1,337 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Arrow: () => Arrow2, + CheckboxItem: () => CheckboxItem2, + Content: () => Content2, + DropdownMenu: () => DropdownMenu, + DropdownMenuArrow: () => DropdownMenuArrow, + DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem, + DropdownMenuContent: () => DropdownMenuContent, + DropdownMenuGroup: () => DropdownMenuGroup, + DropdownMenuItem: () => DropdownMenuItem, + DropdownMenuItemIndicator: () => DropdownMenuItemIndicator, + DropdownMenuLabel: () => DropdownMenuLabel, + DropdownMenuPortal: () => DropdownMenuPortal, + DropdownMenuRadioGroup: () => DropdownMenuRadioGroup, + DropdownMenuRadioItem: () => DropdownMenuRadioItem, + DropdownMenuSeparator: () => DropdownMenuSeparator, + DropdownMenuSub: () => DropdownMenuSub, + DropdownMenuSubContent: () => DropdownMenuSubContent, + DropdownMenuSubTrigger: () => DropdownMenuSubTrigger, + DropdownMenuTrigger: () => DropdownMenuTrigger, + Group: () => Group2, + Item: () => Item2, + ItemIndicator: () => ItemIndicator2, + Label: () => Label2, + Portal: () => Portal2, + RadioGroup: () => RadioGroup2, + RadioItem: () => RadioItem2, + Root: () => Root2, + Separator: () => Separator2, + Sub: () => Sub2, + SubContent: () => SubContent2, + SubTrigger: () => SubTrigger2, + Trigger: () => Trigger, + createDropdownMenuScope: () => createDropdownMenuScope +}); +module.exports = __toCommonJS(index_exports); + +// src/dropdown-menu.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var MenuPrimitive = __toESM(require("@radix-ui/react-menu")); +var import_react_menu = require("@radix-ui/react-menu"); +var import_react_id = require("@radix-ui/react-id"); +var import_jsx_runtime = require("react/jsx-runtime"); +var DROPDOWN_MENU_NAME = "DropdownMenu"; +var [createDropdownMenuContext, createDropdownMenuScope] = (0, import_react_context.createContextScope)( + DROPDOWN_MENU_NAME, + [import_react_menu.createMenuScope] +); +var useMenuScope = (0, import_react_menu.createMenuScope)(); +var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME); +var DropdownMenu = (props) => { + const { + __scopeDropdownMenu, + children, + dir, + open: openProp, + defaultOpen, + onOpenChange, + modal = true + } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + const triggerRef = React.useRef(null); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: DROPDOWN_MENU_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DropdownMenuProvider, + { + scope: __scopeDropdownMenu, + triggerId: (0, import_react_id.useId)(), + triggerRef, + contentId: (0, import_react_id.useId)(), + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + modal, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children }) + } + ); +}; +DropdownMenu.displayName = DROPDOWN_MENU_NAME; +var TRIGGER_NAME = "DropdownMenuTrigger"; +var DropdownMenuTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props; + const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu); + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + id: context.triggerId, + "aria-haspopup": "menu", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : void 0, + "data-state": context.open ? "open" : "closed", + "data-disabled": disabled ? "" : void 0, + disabled, + ...triggerProps, + ref: (0, import_react_compose_refs.composeRefs)(forwardedRef, context.triggerRef), + onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => { + if (!disabled && event.button === 0 && event.ctrlKey === false) { + context.onOpenToggle(); + if (!context.open) event.preventDefault(); + } + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + if (disabled) return; + if (["Enter", " "].includes(event.key)) context.onOpenToggle(); + if (event.key === "ArrowDown") context.onOpenChange(true); + if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault(); + }) + } + ) }); + } +); +DropdownMenuTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "DropdownMenuPortal"; +var DropdownMenuPortal = (props) => { + const { __scopeDropdownMenu, ...portalProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Portal, { ...menuScope, ...portalProps }); +}; +DropdownMenuPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "DropdownMenuContent"; +var DropdownMenuContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...contentProps } = props; + const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu); + const menuScope = useMenuScope(__scopeDropdownMenu); + const hasInteractedOutsideRef = React.useRef(false); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuPrimitive.Content, + { + id: context.contentId, + "aria-labelledby": context.triggerId, + ...menuScope, + ...contentProps, + ref: forwardedRef, + onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + hasInteractedOutsideRef.current = false; + event.preventDefault(); + }), + onInteractOutside: (0, import_primitive.composeEventHandlers)(props.onInteractOutside, (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true; + }), + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)", + "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)", + "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +DropdownMenuContent.displayName = CONTENT_NAME; +var GROUP_NAME = "DropdownMenuGroup"; +var DropdownMenuGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...groupProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef }); + } +); +DropdownMenuGroup.displayName = GROUP_NAME; +var LABEL_NAME = "DropdownMenuLabel"; +var DropdownMenuLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...labelProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef }); + } +); +DropdownMenuLabel.displayName = LABEL_NAME; +var ITEM_NAME = "DropdownMenuItem"; +var DropdownMenuItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...itemProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef }); + } +); +DropdownMenuItem.displayName = ITEM_NAME; +var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem"; +var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...checkboxItemProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef }); +}); +DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "DropdownMenuRadioGroup"; +var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...radioGroupProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef }); +}); +DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "DropdownMenuRadioItem"; +var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...radioItemProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef }); +}); +DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME; +var INDICATOR_NAME = "DropdownMenuItemIndicator"; +var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...itemIndicatorProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef }); +}); +DropdownMenuItemIndicator.displayName = INDICATOR_NAME; +var SEPARATOR_NAME = "DropdownMenuSeparator"; +var DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...separatorProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef }); +}); +DropdownMenuSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "DropdownMenuArrow"; +var DropdownMenuArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...arrowProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef }); + } +); +DropdownMenuArrow.displayName = ARROW_NAME; +var DropdownMenuSub = (props) => { + const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: "DropdownMenuSub" + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children }); +}; +var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger"; +var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...subTriggerProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef }); +}); +DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "DropdownMenuSubContent"; +var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...subContentProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuPrimitive.SubContent, + { + ...menuScope, + ...subContentProps, + ref: forwardedRef, + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)", + "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)", + "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); +}); +DropdownMenuSubContent.displayName = SUB_CONTENT_NAME; +var Root2 = DropdownMenu; +var Trigger = DropdownMenuTrigger; +var Portal2 = DropdownMenuPortal; +var Content2 = DropdownMenuContent; +var Group2 = DropdownMenuGroup; +var Label2 = DropdownMenuLabel; +var Item2 = DropdownMenuItem; +var CheckboxItem2 = DropdownMenuCheckboxItem; +var RadioGroup2 = DropdownMenuRadioGroup; +var RadioItem2 = DropdownMenuRadioItem; +var ItemIndicator2 = DropdownMenuItemIndicator; +var Separator2 = DropdownMenuSeparator; +var Arrow2 = DropdownMenuArrow; +var Sub2 = DropdownMenuSub; +var SubTrigger2 = DropdownMenuSubTrigger; +var SubContent2 = DropdownMenuSubContent; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f25a11b424b3c28e4ff86a367019b66b9d499fa9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/dropdown-menu.tsx"], + "sourcesContent": ["'use client';\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuPortal,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n} from './dropdown-menu';\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuPortalProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n} from './dropdown-menu';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps

= P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope],\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuContextValue = {\n triggerId: string;\n triggerRef: React.RefObject;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] =\n createDropdownMenuContext(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n children?: React.ReactNode;\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst DropdownMenu: React.FC = (props: ScopedProps) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n \n {children}\n \n \n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return (\n \n {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keydown from scrolling window / first focused item to execute\n // that keydown (inadvertently closing the menu)\n if (['Enter', ' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n \n );\n },\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DropdownMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuPortalProps extends MenuPortalProps {}\n\nconst DropdownMenuPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n};\n\nDropdownMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\ntype DropdownMenuContentElement = React.ComponentRef;\ntype MenuContentProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuContentProps extends Omit {}\n\nconst DropdownMenuContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-dropdown-menu-content-transform-origin':\n 'var(--radix-popper-transform-origin)',\n '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-dropdown-menu-content-available-height':\n 'var(--radix-popper-available-height)',\n '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ComponentRef;\ntype MenuGroupProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ComponentRef;\ntype MenuLabelProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ComponentRef;\ntype MenuItemProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ComponentRef;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ComponentRef;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ComponentRef;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ComponentRef;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ComponentRef;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ComponentRef;\ntype MenuArrowProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DropdownMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst DropdownMenuSub: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: 'DropdownMenuSub',\n });\n\n return (\n \n {children}\n \n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger';\n\ntype DropdownMenuSubTriggerElement = React.ComponentRef;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'DropdownMenuSubContent';\n\ntype DropdownMenuSubContentElement = React.ComponentRef;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuSubContentProps extends MenuSubContentProps {}\n\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n\n return (\n \n );\n});\n\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Portal = DropdownMenuPortal;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\nconst Sub = DropdownMenuSub;\nconst SubTrigger = DropdownMenuSubTrigger;\nconst SubContent = DropdownMenuSubContent;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuPortal,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuPortalProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;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,IAAMC,cAAa;AACnB,IAAMC,aAAY;AAClB,IAAMC,iBAAgB;AACtB,IAAMC,aAAY;AAClB,IAAMC,SAAQ;AACd,IAAMC,OAAM;AACZ,IAAMC,cAAa;AACnB,IAAMC,cAAa;", + "names": ["Arrow", "CheckboxItem", "Content", "Group", "Item", "ItemIndicator", "Label", "Portal", "RadioGroup", "RadioItem", "Root", "Separator", "Sub", "SubContent", "SubTrigger", "Root", "Portal", "Content", "Group", "Label", "Item", "CheckboxItem", "RadioGroup", "RadioItem", "ItemIndicator", "Separator", "Arrow", "Sub", "SubTrigger", "SubContent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1799d5816f33aee1c512953bdd2acff61e91dd54 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs @@ -0,0 +1,305 @@ +"use client"; + +// src/dropdown-menu.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { composeRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { Primitive } from "@radix-ui/react-primitive"; +import * as MenuPrimitive from "@radix-ui/react-menu"; +import { createMenuScope } from "@radix-ui/react-menu"; +import { useId } from "@radix-ui/react-id"; +import { jsx } from "react/jsx-runtime"; +var DROPDOWN_MENU_NAME = "DropdownMenu"; +var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope( + DROPDOWN_MENU_NAME, + [createMenuScope] +); +var useMenuScope = createMenuScope(); +var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME); +var DropdownMenu = (props) => { + const { + __scopeDropdownMenu, + children, + dir, + open: openProp, + defaultOpen, + onOpenChange, + modal = true + } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + const triggerRef = React.useRef(null); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: DROPDOWN_MENU_NAME + }); + return /* @__PURE__ */ jsx( + DropdownMenuProvider, + { + scope: __scopeDropdownMenu, + triggerId: useId(), + triggerRef, + contentId: useId(), + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + modal, + children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children }) + } + ); +}; +DropdownMenu.displayName = DROPDOWN_MENU_NAME; +var TRIGGER_NAME = "DropdownMenuTrigger"; +var DropdownMenuTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props; + const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu); + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + id: context.triggerId, + "aria-haspopup": "menu", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : void 0, + "data-state": context.open ? "open" : "closed", + "data-disabled": disabled ? "" : void 0, + disabled, + ...triggerProps, + ref: composeRefs(forwardedRef, context.triggerRef), + onPointerDown: composeEventHandlers(props.onPointerDown, (event) => { + if (!disabled && event.button === 0 && event.ctrlKey === false) { + context.onOpenToggle(); + if (!context.open) event.preventDefault(); + } + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + if (disabled) return; + if (["Enter", " "].includes(event.key)) context.onOpenToggle(); + if (event.key === "ArrowDown") context.onOpenChange(true); + if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault(); + }) + } + ) }); + } +); +DropdownMenuTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "DropdownMenuPortal"; +var DropdownMenuPortal = (props) => { + const { __scopeDropdownMenu, ...portalProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps }); +}; +DropdownMenuPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "DropdownMenuContent"; +var DropdownMenuContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...contentProps } = props; + const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu); + const menuScope = useMenuScope(__scopeDropdownMenu); + const hasInteractedOutsideRef = React.useRef(false); + return /* @__PURE__ */ jsx( + MenuPrimitive.Content, + { + id: context.contentId, + "aria-labelledby": context.triggerId, + ...menuScope, + ...contentProps, + ref: forwardedRef, + onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + hasInteractedOutsideRef.current = false; + event.preventDefault(); + }), + onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true; + }), + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)", + "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)", + "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +DropdownMenuContent.displayName = CONTENT_NAME; +var GROUP_NAME = "DropdownMenuGroup"; +var DropdownMenuGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...groupProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef }); + } +); +DropdownMenuGroup.displayName = GROUP_NAME; +var LABEL_NAME = "DropdownMenuLabel"; +var DropdownMenuLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...labelProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef }); + } +); +DropdownMenuLabel.displayName = LABEL_NAME; +var ITEM_NAME = "DropdownMenuItem"; +var DropdownMenuItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...itemProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef }); + } +); +DropdownMenuItem.displayName = ITEM_NAME; +var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem"; +var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...checkboxItemProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef }); +}); +DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "DropdownMenuRadioGroup"; +var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...radioGroupProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef }); +}); +DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "DropdownMenuRadioItem"; +var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...radioItemProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef }); +}); +DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME; +var INDICATOR_NAME = "DropdownMenuItemIndicator"; +var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...itemIndicatorProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef }); +}); +DropdownMenuItemIndicator.displayName = INDICATOR_NAME; +var SEPARATOR_NAME = "DropdownMenuSeparator"; +var DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...separatorProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef }); +}); +DropdownMenuSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "DropdownMenuArrow"; +var DropdownMenuArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDropdownMenu, ...arrowProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef }); + } +); +DropdownMenuArrow.displayName = ARROW_NAME; +var DropdownMenuSub = (props) => { + const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: "DropdownMenuSub" + }); + return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children }); +}; +var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger"; +var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...subTriggerProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef }); +}); +DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "DropdownMenuSubContent"; +var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => { + const { __scopeDropdownMenu, ...subContentProps } = props; + const menuScope = useMenuScope(__scopeDropdownMenu); + return /* @__PURE__ */ jsx( + MenuPrimitive.SubContent, + { + ...menuScope, + ...subContentProps, + ref: forwardedRef, + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)", + "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)", + "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); +}); +DropdownMenuSubContent.displayName = SUB_CONTENT_NAME; +var Root2 = DropdownMenu; +var Trigger = DropdownMenuTrigger; +var Portal2 = DropdownMenuPortal; +var Content2 = DropdownMenuContent; +var Group2 = DropdownMenuGroup; +var Label2 = DropdownMenuLabel; +var Item2 = DropdownMenuItem; +var CheckboxItem2 = DropdownMenuCheckboxItem; +var RadioGroup2 = DropdownMenuRadioGroup; +var RadioItem2 = DropdownMenuRadioItem; +var ItemIndicator2 = DropdownMenuItemIndicator; +var Separator2 = DropdownMenuSeparator; +var Arrow2 = DropdownMenuArrow; +var Sub2 = DropdownMenuSub; +var SubTrigger2 = DropdownMenuSubTrigger; +var SubContent2 = DropdownMenuSubContent; +export { + Arrow2 as Arrow, + CheckboxItem2 as CheckboxItem, + Content2 as Content, + DropdownMenu, + DropdownMenuArrow, + DropdownMenuCheckboxItem, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuItemIndicator, + DropdownMenuLabel, + DropdownMenuPortal, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, + DropdownMenuTrigger, + Group2 as Group, + Item2 as Item, + ItemIndicator2 as ItemIndicator, + Label2 as Label, + Portal2 as Portal, + RadioGroup2 as RadioGroup, + RadioItem2 as RadioItem, + Root2 as Root, + Separator2 as Separator, + Sub2 as Sub, + SubContent2 as SubContent, + SubTrigger2 as SubTrigger, + Trigger, + createDropdownMenuScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..4744a579b6cbabdb0fd10adddc0678c1c803959c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/dropdown-menu.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps

= P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope],\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuContextValue = {\n triggerId: string;\n triggerRef: React.RefObject;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] =\n createDropdownMenuContext(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n children?: React.ReactNode;\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst DropdownMenu: React.FC = (props: ScopedProps) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n \n {children}\n \n \n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return (\n \n {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keydown from scrolling window / first focused item to execute\n // that keydown (inadvertently closing the menu)\n if (['Enter', ' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n \n );\n },\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DropdownMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuPortalProps extends MenuPortalProps {}\n\nconst DropdownMenuPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n};\n\nDropdownMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\ntype DropdownMenuContentElement = React.ComponentRef;\ntype MenuContentProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuContentProps extends Omit {}\n\nconst DropdownMenuContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-dropdown-menu-content-transform-origin':\n 'var(--radix-popper-transform-origin)',\n '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-dropdown-menu-content-available-height':\n 'var(--radix-popper-available-height)',\n '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ComponentRef;\ntype MenuGroupProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ComponentRef;\ntype MenuLabelProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ComponentRef;\ntype MenuItemProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ComponentRef;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ComponentRef;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ComponentRef;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ComponentRef;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ComponentRef;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ComponentRef;\ntype MenuArrowProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n },\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DropdownMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst DropdownMenuSub: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: 'DropdownMenuSub',\n });\n\n return (\n \n {children}\n \n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger';\n\ntype DropdownMenuSubTriggerElement = React.ComponentRef;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return ;\n});\n\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'DropdownMenuSubContent';\n\ntype DropdownMenuSubContentElement = React.ComponentRef;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef;\ninterface DropdownMenuSubContentProps extends MenuSubContentProps {}\n\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n\n return (\n \n );\n});\n\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Portal = DropdownMenuPortal;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\nconst Sub = DropdownMenuSub;\nconst SubTrigger = DropdownMenuSubTrigger;\nconst SubContent = DropdownMenuSubContent;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuPortal,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuPortalProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AAC1B,YAAY,mBAAmB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AAuEhB;AA7DN,IAAM,qBAAqB;AAG3B,IAAM,CAAC,2BAA2B,uBAAuB,IAAI;AAAA,EAC3D;AAAA,EACA,CAAC,eAAe;AAClB;AACA,IAAM,eAAe,gBAAgB;AAYrC,IAAM,CAAC,sBAAsB,sBAAsB,IACjD,0BAAoD,kBAAkB;AAWxE,IAAM,eAA4C,CAAC,UAA0C;AAC3F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV,IAAI;AACJ,QAAM,YAAY,aAAa,mBAAmB;AAClD,QAAM,aAAmB,aAA0B,IAAI;AACvD,QAAM,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAA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AAAA;AAAA,EACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;AAIrC,IAAMA,QAAO;AACb,IAAM,UAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;AACd,IAAMC,SAAQ;AACd,IAAMC,QAAO;AACb,IAAMC,gBAAe;AACrB,IAAMC,cAAa;AACnB,IAAMC,aAAY;AAClB,IAAMC,iBAAgB;AACtB,IAAMC,aAAY;AAClB,IAAMC,SAAQ;AACd,IAAMC,OAAM;AACZ,IAAMC,cAAa;AACnB,IAAMC,cAAa;", + "names": ["Root", "Portal", "Content", "Group", "Label", "Item", "CheckboxItem", "RadioGroup", "RadioItem", "ItemIndicator", "Separator", "Arrow", "Sub", "SubTrigger", "SubContent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c70d17fc546f95d2ca71423137cd4aefd0ed81ed --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-dropdown-menu/package.json @@ -0,0 +1,75 @@ +{ + "name": "@radix-ui/react-dropdown-menu", + "version": "2.1.18", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-menu": "2.1.18", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-use-controllable-state": "1.2.3" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/test-data": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/dropdown-menu" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c0de2543c69255a28b9d5aaf63d62bcb262e9b57 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/README.md @@ -0,0 +1,3 @@ +# `react-focus-guards` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..19d3b4dfe9bc81fbc7dfcbd9190689ab88abbd8b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts @@ -0,0 +1,13 @@ +import * as React from 'react'; + +interface FocusGuardsProps { + children?: React.ReactNode; +} +declare function FocusGuards(props: FocusGuardsProps): React.ReactNode; +/** + * Injects a pair of focus guards at the edges of the whole DOM tree + * to ensure `focusin` & `focusout` events can be caught consistently. + */ +declare function useFocusGuards(): void; + +export { FocusGuards, FocusGuards as Root, useFocusGuards }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..19d3b4dfe9bc81fbc7dfcbd9190689ab88abbd8b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; + +interface FocusGuardsProps { + children?: React.ReactNode; +} +declare function FocusGuards(props: FocusGuardsProps): React.ReactNode; +/** + * Injects a pair of focus guards at the edges of the whole DOM tree + * to ensure `focusin` & `focusout` events can be caught consistently. + */ +declare function useFocusGuards(): void; + +export { FocusGuards, FocusGuards as Root, useFocusGuards }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8830da62569129436d92f4f519b90793e308fc34 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.js @@ -0,0 +1,81 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + FocusGuards: () => FocusGuards, + Root: () => FocusGuards, + useFocusGuards: () => useFocusGuards +}); +module.exports = __toCommonJS(index_exports); + +// src/focus-guards.tsx +var React = __toESM(require("react")); +var count = 0; +var guards = null; +function FocusGuards(props) { + useFocusGuards(); + return props.children; +} +function useFocusGuards() { + React.useEffect(() => { + if (!guards) { + guards = { start: createFocusGuard(), end: createFocusGuard() }; + } + const { start, end } = guards; + if (document.body.firstElementChild !== start) { + document.body.insertAdjacentElement("afterbegin", start); + } + if (document.body.lastElementChild !== end) { + document.body.insertAdjacentElement("beforeend", end); + } + count++; + return () => { + if (count === 1) { + guards?.start.remove(); + guards?.end.remove(); + guards = null; + } + count = Math.max(0, count - 1); + }; + }, []); +} +function createFocusGuard() { + const element = document.createElement("span"); + element.setAttribute("data-radix-focus-guard", ""); + element.tabIndex = 0; + element.style.outline = "none"; + element.style.opacity = "0"; + element.style.position = "fixed"; + element.style.pointerEvents = "none"; + return element; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..cded8bbf1030e998cb6b71a2e076a78408c82359 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/focus-guards.tsx"], + "sourcesContent": ["'use client';\nexport {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n} from './focus-guards';\n", "import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\n/**\n * Cached references to the single shared pair of edge guards. Keeping these at\n * module scope lets us avoid scanning the whole document (`querySelectorAll`)\n * and re-inserting the guards on every overlay mount.\n */\nlet guards: { start: HTMLSpanElement; end: HTMLSpanElement } | null = null;\n\ninterface FocusGuardsProps {\n children?: React.ReactNode;\n}\n\nfunction FocusGuards(props: FocusGuardsProps) {\n useFocusGuards();\n return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n React.useEffect(() => {\n if (!guards) {\n guards = { start: createFocusGuard(), end: createFocusGuard() };\n }\n const { start, end } = guards;\n\n // Only mutate the DOM when the edge invariant is actually broken. Writing\n // to `document.body` dirties layout and forces a synchronous reflow once\n // sibling effects read layout (Popper measuring, react-remove-scroll,\n // aria-hidden, FocusScope), so skipping no-op moves avoids that cost on\n // every mount. The trailing guard still gets re-asserted to last whenever a\n // newly portaled node lands after it (portals append to the end of\n // `document.body`). See https://github.com/radix-ui/primitives/issues/2812\n if (document.body.firstElementChild !== start) {\n document.body.insertAdjacentElement('afterbegin', start);\n }\n if (document.body.lastElementChild !== end) {\n document.body.insertAdjacentElement('beforeend', end);\n }\n count++;\n\n return () => {\n if (count === 1) {\n guards?.start.remove();\n guards?.end.remove();\n guards = null;\n }\n count = Math.max(0, count - 1);\n };\n }, []);\n}\n\nfunction createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.outline = 'none';\n element.style.opacity = '0';\n element.style.position = 'fixed';\n element.style.pointerEvents = 'none';\n return element;\n}\n\nexport {\n FocusGuards,\n //\n FocusGuards as Root,\n //\n useFocusGuards,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAGvB,IAAI,QAAQ;AAOZ,IAAI,SAAkE;AAMtE,SAAS,YAAY,OAAyB;AAC5C,iBAAe;AACf,SAAO,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,QAAQ;AACX,eAAS,EAAE,OAAO,iBAAiB,GAAG,KAAK,iBAAiB,EAAE;AAAA,IAChE;AACA,UAAM,EAAE,OAAO,IAAI,IAAI;AASvB,QAAI,SAAS,KAAK,sBAAsB,OAAO;AAC7C,eAAS,KAAK,sBAAsB,cAAc,KAAK;AAAA,IACzD;AACA,QAAI,SAAS,KAAK,qBAAqB,KAAK;AAC1C,eAAS,KAAK,sBAAsB,aAAa,GAAG;AAAA,IACtD;AACA;AAEA,WAAO,MAAM;AACX,UAAI,UAAU,GAAG;AACf,gBAAQ,MAAM,OAAO;AACrB,gBAAQ,IAAI,OAAO;AACnB,iBAAS;AAAA,MACX;AACA,cAAQ,KAAK,IAAI,GAAG,QAAQ,CAAC;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,UAAQ,aAAa,0BAA0B,EAAE;AACjD,UAAQ,WAAW;AACnB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,WAAW;AACzB,UAAQ,MAAM,gBAAgB;AAC9B,SAAO;AACT;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ea0dcbce89179d44f8cf4e1aee7ee9a34f9d4f53 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.mjs @@ -0,0 +1,49 @@ +"use client"; + +// src/focus-guards.tsx +import * as React from "react"; +var count = 0; +var guards = null; +function FocusGuards(props) { + useFocusGuards(); + return props.children; +} +function useFocusGuards() { + React.useEffect(() => { + if (!guards) { + guards = { start: createFocusGuard(), end: createFocusGuard() }; + } + const { start, end } = guards; + if (document.body.firstElementChild !== start) { + document.body.insertAdjacentElement("afterbegin", start); + } + if (document.body.lastElementChild !== end) { + document.body.insertAdjacentElement("beforeend", end); + } + count++; + return () => { + if (count === 1) { + guards?.start.remove(); + guards?.end.remove(); + guards = null; + } + count = Math.max(0, count - 1); + }; + }, []); +} +function createFocusGuard() { + const element = document.createElement("span"); + element.setAttribute("data-radix-focus-guard", ""); + element.tabIndex = 0; + element.style.outline = "none"; + element.style.opacity = "0"; + element.style.position = "fixed"; + element.style.pointerEvents = "none"; + return element; +} +export { + FocusGuards, + FocusGuards as Root, + useFocusGuards +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..eb3878f6bf1e98480a78f2da918b5f3e84650cf9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/focus-guards.tsx"], + "sourcesContent": ["import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\n/**\n * Cached references to the single shared pair of edge guards. Keeping these at\n * module scope lets us avoid scanning the whole document (`querySelectorAll`)\n * and re-inserting the guards on every overlay mount.\n */\nlet guards: { start: HTMLSpanElement; end: HTMLSpanElement } | null = null;\n\ninterface FocusGuardsProps {\n children?: React.ReactNode;\n}\n\nfunction FocusGuards(props: FocusGuardsProps) {\n useFocusGuards();\n return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n React.useEffect(() => {\n if (!guards) {\n guards = { start: createFocusGuard(), end: createFocusGuard() };\n }\n const { start, end } = guards;\n\n // Only mutate the DOM when the edge invariant is actually broken. Writing\n // to `document.body` dirties layout and forces a synchronous reflow once\n // sibling effects read layout (Popper measuring, react-remove-scroll,\n // aria-hidden, FocusScope), so skipping no-op moves avoids that cost on\n // every mount. The trailing guard still gets re-asserted to last whenever a\n // newly portaled node lands after it (portals append to the end of\n // `document.body`). See https://github.com/radix-ui/primitives/issues/2812\n if (document.body.firstElementChild !== start) {\n document.body.insertAdjacentElement('afterbegin', start);\n }\n if (document.body.lastElementChild !== end) {\n document.body.insertAdjacentElement('beforeend', end);\n }\n count++;\n\n return () => {\n if (count === 1) {\n guards?.start.remove();\n guards?.end.remove();\n guards = null;\n }\n count = Math.max(0, count - 1);\n };\n }, []);\n}\n\nfunction createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.outline = 'none';\n element.style.opacity = '0';\n element.style.position = 'fixed';\n element.style.pointerEvents = 'none';\n return element;\n}\n\nexport {\n FocusGuards,\n //\n FocusGuards as Root,\n //\n useFocusGuards,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AAGvB,IAAI,QAAQ;AAOZ,IAAI,SAAkE;AAMtE,SAAS,YAAY,OAAyB;AAC5C,iBAAe;AACf,SAAO,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,QAAQ;AACX,eAAS,EAAE,OAAO,iBAAiB,GAAG,KAAK,iBAAiB,EAAE;AAAA,IAChE;AACA,UAAM,EAAE,OAAO,IAAI,IAAI;AASvB,QAAI,SAAS,KAAK,sBAAsB,OAAO;AAC7C,eAAS,KAAK,sBAAsB,cAAc,KAAK;AAAA,IACzD;AACA,QAAI,SAAS,KAAK,qBAAqB,KAAK;AAC1C,eAAS,KAAK,sBAAsB,aAAa,GAAG;AAAA,IACtD;AACA;AAEA,WAAO,MAAM;AACX,UAAI,UAAU,GAAG;AACf,gBAAQ,MAAM,OAAO;AACrB,gBAAQ,IAAI,OAAO;AACnB,iBAAS;AAAA,MACX;AACA,cAAQ,KAAK,IAAI,GAAG,QAAQ,CAAC;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,UAAQ,aAAa,0BAA0B,EAAE;AACjD,UAAQ,WAAW;AACnB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,WAAW;AACzB,UAAQ,MAAM,gBAAgB;AAC9B,SAAO;AACT;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fec0cb9c9303b2ebf7a0040ec707794950810624 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-guards/package.json @@ -0,0 +1,60 @@ +{ + "name": "@radix-ui/react-focus-guards", + "version": "1.1.4", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/focus-guards" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/README.md new file mode 100644 index 0000000000000000000000000000000000000000..46f03117fb1211fd95ebb2f9813522c1a7f54f5a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/README.md @@ -0,0 +1,3 @@ +# `react-focus-scope` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f35f9971d7cd705d0f0083e24ae695b963e0d2e1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts @@ -0,0 +1,32 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface FocusScopeProps extends PrimitiveDivProps { + /** + * When `true`, tabbing from last item will focus first tabbable + * and shift+tab from first item will focus last tababble. + * @defaultValue false + */ + loop?: boolean; + /** + * When `true`, focus cannot escape the focus scope via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapped?: boolean; + /** + * Event handler called when auto-focusing on mount. + * Can be prevented. + */ + onMountAutoFocus?: (event: Event) => void; + /** + * Event handler called when auto-focusing on unmount. + * Can be prevented. + */ + onUnmountAutoFocus?: (event: Event) => void; +} +declare const FocusScope: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { FocusScope, type FocusScopeProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f35f9971d7cd705d0f0083e24ae695b963e0d2e1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts @@ -0,0 +1,32 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface FocusScopeProps extends PrimitiveDivProps { + /** + * When `true`, tabbing from last item will focus first tabbable + * and shift+tab from first item will focus last tababble. + * @defaultValue false + */ + loop?: boolean; + /** + * When `true`, focus cannot escape the focus scope via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapped?: boolean; + /** + * Event handler called when auto-focusing on mount. + * Can be prevented. + */ + onMountAutoFocus?: (event: Event) => void; + /** + * Event handler called when auto-focusing on unmount. + * Can be prevented. + */ + onUnmountAutoFocus?: (event: Event) => void; +} +declare const FocusScope: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { FocusScope, type FocusScopeProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c91ae9196280060974778cbb1164839d5610e7d0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.js @@ -0,0 +1,246 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + FocusScope: () => FocusScope, + Root: () => Root +}); +module.exports = __toCommonJS(index_exports); + +// src/focus-scope.tsx +var React = __toESM(require("react")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_jsx_runtime = require("react/jsx-runtime"); +var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; +var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var FOCUS_SCOPE_NAME = "FocusScope"; +var FocusScope = React.forwardRef((props, forwardedRef) => { + const { + loop = false, + trapped = false, + onMountAutoFocus: onMountAutoFocusProp, + onUnmountAutoFocus: onUnmountAutoFocusProp, + ...scopeProps + } = props; + const [container, setContainer] = React.useState(null); + const onMountAutoFocus = (0, import_react_use_callback_ref.useCallbackRef)(onMountAutoFocusProp); + const onUnmountAutoFocus = (0, import_react_use_callback_ref.useCallbackRef)(onUnmountAutoFocusProp); + const lastFocusedElementRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setContainer(node)); + const focusScope = React.useRef({ + paused: false, + pause() { + this.paused = true; + }, + resume() { + this.paused = false; + } + }).current; + React.useEffect(() => { + if (trapped) { + let handleFocusIn2 = function(event) { + if (focusScope.paused || !container) return; + const target = event.target; + if (container.contains(target)) { + lastFocusedElementRef.current = target; + } else { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleFocusOut2 = function(event) { + if (focusScope.paused || !container) return; + const relatedTarget = event.relatedTarget; + if (relatedTarget === null) return; + if (!container.contains(relatedTarget)) { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleMutations2 = function(mutations) { + const focusedElement = document.activeElement; + if (focusedElement !== document.body) return; + for (const mutation of mutations) { + if (mutation.removedNodes.length > 0) focus(container); + } + }; + var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2; + document.addEventListener("focusin", handleFocusIn2); + document.addEventListener("focusout", handleFocusOut2); + const mutationObserver = new MutationObserver(handleMutations2); + if (container) mutationObserver.observe(container, { childList: true, subtree: true }); + return () => { + document.removeEventListener("focusin", handleFocusIn2); + document.removeEventListener("focusout", handleFocusOut2); + mutationObserver.disconnect(); + }; + } + }, [trapped, container, focusScope.paused]); + React.useEffect(() => { + if (container) { + focusScopesStack.add(focusScope); + const previouslyFocusedElement = document.activeElement; + const hasFocusedCandidate = container.contains(previouslyFocusedElement); + if (!hasFocusedCandidate) { + const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + container.dispatchEvent(mountEvent); + if (!mountEvent.defaultPrevented) { + focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); + if (document.activeElement === previouslyFocusedElement) { + focus(container); + } + } + } + return () => { + container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + setTimeout(() => { + const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + container.dispatchEvent(unmountEvent); + if (!unmountEvent.defaultPrevented) { + focus(previouslyFocusedElement ?? document.body, { select: true }); + } + container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + focusScopesStack.remove(focusScope); + }, 0); + }; + } + }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); + const handleKeyDown = React.useCallback( + (event) => { + if (!loop && !trapped) return; + if (focusScope.paused) return; + const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; + const focusedElement = document.activeElement; + if (isTabKey && focusedElement) { + const container2 = event.currentTarget; + const [first, last] = getTabbableEdges(container2); + const hasTabbableElementsInside = first && last; + if (!hasTabbableElementsInside) { + if (focusedElement === container2) event.preventDefault(); + } else { + if (!event.shiftKey && focusedElement === last) { + event.preventDefault(); + if (loop) focus(first, { select: true }); + } else if (event.shiftKey && focusedElement === first) { + event.preventDefault(); + if (loop) focus(last, { select: true }); + } + } + } + }, + [loop, trapped, focusScope.paused] + ); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); +}); +FocusScope.displayName = FOCUS_SCOPE_NAME; +function focusFirst(candidates, { select = false } = {}) { + const previouslyFocusedElement = document.activeElement; + for (const candidate of candidates) { + focus(candidate, { select }); + if (document.activeElement !== previouslyFocusedElement) return; + } +} +function getTabbableEdges(container) { + const candidates = getTabbableCandidates(container); + const first = findVisible(candidates, container); + const last = findVisible(candidates.reverse(), container); + return [first, last]; +} +function getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +function findVisible(elements, container) { + for (const element of elements) { + if (!isHidden(element, { upTo: container })) return element; + } +} +function isHidden(node, { upTo }) { + if (getComputedStyle(node).visibility === "hidden") return true; + while (node) { + if (upTo !== void 0 && node === upTo) return false; + if (getComputedStyle(node).display === "none") return true; + node = node.parentElement; + } + return false; +} +function isSelectableInput(element) { + return element instanceof HTMLInputElement && "select" in element; +} +function focus(element, { select = false } = {}) { + if (element && element.focus) { + const previouslyFocusedElement = document.activeElement; + element.focus({ preventScroll: true }); + if (element !== previouslyFocusedElement && isSelectableInput(element) && select) + element.select(); + } +} +var focusScopesStack = createFocusScopesStack(); +function createFocusScopesStack() { + let stack = []; + return { + add(focusScope) { + const activeFocusScope = stack[0]; + if (focusScope !== activeFocusScope) { + activeFocusScope?.pause(); + } + stack = arrayRemove(stack, focusScope); + stack.unshift(focusScope); + }, + remove(focusScope) { + stack = arrayRemove(stack, focusScope); + stack[0]?.resume(); + } + }; +} +function arrayRemove(array, item) { + const updatedArray = [...array]; + const index = updatedArray.indexOf(item); + if (index !== -1) { + updatedArray.splice(index, 1); + } + return updatedArray; +} +function removeLinks(items) { + return items.filter((item) => item.tagName !== "A"); +} +var Root = FocusScope; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..41c6ed0dfe90d5dd1da97e24d37603b08133f04f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/focus-scope.tsx"], + "sourcesContent": ["'use client';\nexport {\n FocusScope,\n //\n Root,\n} from './focus-scope';\nexport type { FocusScopeProps } from './focus-scope';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused],\n );\n\n return (\n \n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,gCAAgC;AAChC,6BAA0B;AAC1B,oCAA+B;AAwM3B;AAtMJ,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB,EAAE,SAAS,OAAO,YAAY,KAAK;AAQzD,IAAM,mBAAmB;AAgCzB,IAAM,aAAmB,iBAA+C,CAAC,OAAO,iBAAiB;AAC/F,QAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB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,MAAI,QAAyB,CAAC;AAE9B,SAAO;AAAA,IACL,IAAI,YAA2B;AAE7B,YAAM,mBAAmB,MAAM,CAAC;AAChC,UAAI,eAAe,kBAAkB;AACnC,0BAAkB,MAAM;AAAA,MAC1B;AAEA,cAAQ,YAAY,OAAO,UAAU;AACrC,YAAM,QAAQ,UAAU;AAAA,IAC1B;AAAA,IAEA,OAAO,YAA2B;AAChC,cAAQ,YAAY,OAAO,UAAU;AACrC,YAAM,CAAC,GAAG,OAAO;AAAA,IACnB;AAAA,EACF;AACF;AAEA,SAAS,YAAe,OAAY,MAAS;AAC3C,QAAM,eAAe,CAAC,GAAG,KAAK;AAC9B,QAAM,QAAQ,aAAa,QAAQ,IAAI;AACvC,MAAI,UAAU,IAAI;AAChB,iBAAa,OAAO,OAAO,CAAC;AAAA,EAC9B;AACA,SAAO;AACT;AAEA,SAAS,YAAY,OAAsB;AACzC,SAAO,MAAM,OAAO,CAAC,SAAS,KAAK,YAAY,GAAG;AACpD;AAEA,IAAM,OAAO;", + "names": ["handleFocusIn", "handleFocusOut", "handleMutations", "container"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e39d5c9105b3f8060d037bf5490843d20d1c859a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.mjs @@ -0,0 +1,214 @@ +"use client"; + +// src/focus-scope.tsx +import * as React from "react"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { jsx } from "react/jsx-runtime"; +var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; +var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var FOCUS_SCOPE_NAME = "FocusScope"; +var FocusScope = React.forwardRef((props, forwardedRef) => { + const { + loop = false, + trapped = false, + onMountAutoFocus: onMountAutoFocusProp, + onUnmountAutoFocus: onUnmountAutoFocusProp, + ...scopeProps + } = props; + const [container, setContainer] = React.useState(null); + const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp); + const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp); + const lastFocusedElementRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node)); + const focusScope = React.useRef({ + paused: false, + pause() { + this.paused = true; + }, + resume() { + this.paused = false; + } + }).current; + React.useEffect(() => { + if (trapped) { + let handleFocusIn2 = function(event) { + if (focusScope.paused || !container) return; + const target = event.target; + if (container.contains(target)) { + lastFocusedElementRef.current = target; + } else { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleFocusOut2 = function(event) { + if (focusScope.paused || !container) return; + const relatedTarget = event.relatedTarget; + if (relatedTarget === null) return; + if (!container.contains(relatedTarget)) { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleMutations2 = function(mutations) { + const focusedElement = document.activeElement; + if (focusedElement !== document.body) return; + for (const mutation of mutations) { + if (mutation.removedNodes.length > 0) focus(container); + } + }; + var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2; + document.addEventListener("focusin", handleFocusIn2); + document.addEventListener("focusout", handleFocusOut2); + const mutationObserver = new MutationObserver(handleMutations2); + if (container) mutationObserver.observe(container, { childList: true, subtree: true }); + return () => { + document.removeEventListener("focusin", handleFocusIn2); + document.removeEventListener("focusout", handleFocusOut2); + mutationObserver.disconnect(); + }; + } + }, [trapped, container, focusScope.paused]); + React.useEffect(() => { + if (container) { + focusScopesStack.add(focusScope); + const previouslyFocusedElement = document.activeElement; + const hasFocusedCandidate = container.contains(previouslyFocusedElement); + if (!hasFocusedCandidate) { + const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + container.dispatchEvent(mountEvent); + if (!mountEvent.defaultPrevented) { + focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); + if (document.activeElement === previouslyFocusedElement) { + focus(container); + } + } + } + return () => { + container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + setTimeout(() => { + const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + container.dispatchEvent(unmountEvent); + if (!unmountEvent.defaultPrevented) { + focus(previouslyFocusedElement ?? document.body, { select: true }); + } + container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + focusScopesStack.remove(focusScope); + }, 0); + }; + } + }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); + const handleKeyDown = React.useCallback( + (event) => { + if (!loop && !trapped) return; + if (focusScope.paused) return; + const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; + const focusedElement = document.activeElement; + if (isTabKey && focusedElement) { + const container2 = event.currentTarget; + const [first, last] = getTabbableEdges(container2); + const hasTabbableElementsInside = first && last; + if (!hasTabbableElementsInside) { + if (focusedElement === container2) event.preventDefault(); + } else { + if (!event.shiftKey && focusedElement === last) { + event.preventDefault(); + if (loop) focus(first, { select: true }); + } else if (event.shiftKey && focusedElement === first) { + event.preventDefault(); + if (loop) focus(last, { select: true }); + } + } + } + }, + [loop, trapped, focusScope.paused] + ); + return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); +}); +FocusScope.displayName = FOCUS_SCOPE_NAME; +function focusFirst(candidates, { select = false } = {}) { + const previouslyFocusedElement = document.activeElement; + for (const candidate of candidates) { + focus(candidate, { select }); + if (document.activeElement !== previouslyFocusedElement) return; + } +} +function getTabbableEdges(container) { + const candidates = getTabbableCandidates(container); + const first = findVisible(candidates, container); + const last = findVisible(candidates.reverse(), container); + return [first, last]; +} +function getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +function findVisible(elements, container) { + for (const element of elements) { + if (!isHidden(element, { upTo: container })) return element; + } +} +function isHidden(node, { upTo }) { + if (getComputedStyle(node).visibility === "hidden") return true; + while (node) { + if (upTo !== void 0 && node === upTo) return false; + if (getComputedStyle(node).display === "none") return true; + node = node.parentElement; + } + return false; +} +function isSelectableInput(element) { + return element instanceof HTMLInputElement && "select" in element; +} +function focus(element, { select = false } = {}) { + if (element && element.focus) { + const previouslyFocusedElement = document.activeElement; + element.focus({ preventScroll: true }); + if (element !== previouslyFocusedElement && isSelectableInput(element) && select) + element.select(); + } +} +var focusScopesStack = createFocusScopesStack(); +function createFocusScopesStack() { + let stack = []; + return { + add(focusScope) { + const activeFocusScope = stack[0]; + if (focusScope !== activeFocusScope) { + activeFocusScope?.pause(); + } + stack = arrayRemove(stack, focusScope); + stack.unshift(focusScope); + }, + remove(focusScope) { + stack = arrayRemove(stack, focusScope); + stack[0]?.resume(); + } + }; +} +function arrayRemove(array, item) { + const updatedArray = [...array]; + const index = updatedArray.indexOf(item); + if (index !== -1) { + updatedArray.splice(index, 1); + } + return updatedArray; +} +function removeLinks(items) { + return items.filter((item) => item.tagName !== "A"); +} +var Root = FocusScope; +export { + FocusScope, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..ec205274ccee535a2cf98c8195d5ed1205130474 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/focus-scope.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused],\n );\n\n return (\n \n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAwM3B;AAtMJ,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB,EAAE,SAAS,OAAO,YAAY,KAAK;AAQzD,IAAM,mBAAmB;AAgCzB,IAAM,aAAmB,iBAA+C,CAAC,OAAO,iBAAiB;AAC/F,QAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,WAAW,YAAY,IAAU,eAA6B,IAAI;AACzE,QAAM,mBAAmB,eAAe,oBAAoB;AAC5D,QAAM,qBAAqB,eAAe,sBAAsB;AAChE,QAAM,wBAA8B,aAA2B,IAAI;AACnE,QAAM,eAAe,gBAAgB,cAAc,CAAC,SAAS,aAAa,IAAI,CAAC;AAE/E,QAAM,aAAmB,aAAO;AAAA,IAC9B,QAAQ;AAAA,IACR,QAAQ;AACN,WAAK,SAAS;AAAA,IAChB;AAAA,IACA,SAAS;AACP,WAAK,SAAS;AAAA,IAChB;AAAA,EACF,CAAC,EAAE;AAGH,EAAM,gBAAU,MAAM;AACpB,QAAI,SAAS;AACX,UAASA,iBAAT,SAAuB,OAAmB;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EAC9B;AACA,SAAO;AACT;AAEA,SAAS,YAAY,OAAsB;AACzC,SAAO,MAAM,OAAO,CAAC,SAAS,KAAK,YAAY,GAAG;AACpD;AAEA,IAAM,OAAO;", + "names": ["handleFocusIn", "handleFocusOut", "handleMutations", "container"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/package.json new file mode 100644 index 0000000000000000000000000000000000000000..da880aa181382786ec8202f4995112226a7a40e3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-focus-scope/package.json @@ -0,0 +1,70 @@ +{ + "name": "@radix-ui/react-focus-scope", + "version": "1.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.3" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/focus-scope" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9a4a0e4bd36a69d98171019edaff00bc532deebe --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/README.md @@ -0,0 +1,3 @@ +# `react-form` + +View docs [here](https://radix-ui.com/primitives/docs/components/form). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..457a7138ad75cc8234c532cf5401ecc745695bca --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.d.mts @@ -0,0 +1,69 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Label as Label$1 } from '@radix-ui/react-label'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeForm?: Scope; +}; +declare const createFormScope: _radix_ui_react_context.CreateScope; +type PrimitiveFormProps = React.ComponentPropsWithoutRef; +interface FormProps extends PrimitiveFormProps { + onClearServerErrors?(): void; +} +declare const Form: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface FormFieldProps extends PrimitiveDivProps { + name: string; + serverInvalid?: boolean; +} +declare const FormField: React.ForwardRefExoticComponent>; +type LabelProps = React.ComponentPropsWithoutRef; +interface FormLabelProps extends LabelProps { +} +declare const FormLabel: React.ForwardRefExoticComponent>; +type PrimitiveInputProps = React.ComponentPropsWithoutRef; +interface FormControlProps extends PrimitiveInputProps { +} +declare const FormControl: React.ForwardRefExoticComponent>; +declare const _validityMatchers: readonly ["badInput", "patternMismatch", "rangeOverflow", "rangeUnderflow", "stepMismatch", "tooLong", "tooShort", "typeMismatch", "valid", "valueMissing"]; +type ValidityMatcher = (typeof _validityMatchers)[number]; +interface FormMessageProps extends Omit { + match?: ValidityMatcher | CustomMatcher; + forceMatch?: boolean; + name?: string; +} +declare const FormMessage: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface FormMessageImplProps extends PrimitiveSpanProps { + name: string; +} +interface FormValidityStateProps { + children(validity: ValidityState | undefined): React.ReactNode; + name?: string; +} +declare const FormValidityState: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface FormSubmitProps extends PrimitiveButtonProps { +} +declare const FormSubmit: React.ForwardRefExoticComponent>; +type SyncCustomMatcher = (value: string, formData: FormData) => boolean; +type AsyncCustomMatcher = (value: string, formData: FormData) => Promise; +type CustomMatcher = SyncCustomMatcher | AsyncCustomMatcher; +declare const Root: React.ForwardRefExoticComponent>; +declare const Field: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Control: React.ForwardRefExoticComponent>; +declare const Message: React.ForwardRefExoticComponent>; +declare const ValidityState: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +declare const Submit: React.ForwardRefExoticComponent>; + +export { Control, Field, Form, FormControl, type FormControlProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, FormSubmit, type FormSubmitProps, FormValidityState, type FormValidityStateProps, Label, Message, Root, Submit, ValidityState, createFormScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..457a7138ad75cc8234c532cf5401ecc745695bca --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.d.ts @@ -0,0 +1,69 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Label as Label$1 } from '@radix-ui/react-label'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeForm?: Scope; +}; +declare const createFormScope: _radix_ui_react_context.CreateScope; +type PrimitiveFormProps = React.ComponentPropsWithoutRef; +interface FormProps extends PrimitiveFormProps { + onClearServerErrors?(): void; +} +declare const Form: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface FormFieldProps extends PrimitiveDivProps { + name: string; + serverInvalid?: boolean; +} +declare const FormField: React.ForwardRefExoticComponent>; +type LabelProps = React.ComponentPropsWithoutRef; +interface FormLabelProps extends LabelProps { +} +declare const FormLabel: React.ForwardRefExoticComponent>; +type PrimitiveInputProps = React.ComponentPropsWithoutRef; +interface FormControlProps extends PrimitiveInputProps { +} +declare const FormControl: React.ForwardRefExoticComponent>; +declare const _validityMatchers: readonly ["badInput", "patternMismatch", "rangeOverflow", "rangeUnderflow", "stepMismatch", "tooLong", "tooShort", "typeMismatch", "valid", "valueMissing"]; +type ValidityMatcher = (typeof _validityMatchers)[number]; +interface FormMessageProps extends Omit { + match?: ValidityMatcher | CustomMatcher; + forceMatch?: boolean; + name?: string; +} +declare const FormMessage: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface FormMessageImplProps extends PrimitiveSpanProps { + name: string; +} +interface FormValidityStateProps { + children(validity: ValidityState | undefined): React.ReactNode; + name?: string; +} +declare const FormValidityState: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface FormSubmitProps extends PrimitiveButtonProps { +} +declare const FormSubmit: React.ForwardRefExoticComponent>; +type SyncCustomMatcher = (value: string, formData: FormData) => boolean; +type AsyncCustomMatcher = (value: string, formData: FormData) => Promise; +type CustomMatcher = SyncCustomMatcher | AsyncCustomMatcher; +declare const Root: React.ForwardRefExoticComponent>; +declare const Field: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Control: React.ForwardRefExoticComponent>; +declare const Message: React.ForwardRefExoticComponent>; +declare const ValidityState: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +declare const Submit: React.ForwardRefExoticComponent>; + +export { Control, Field, Form, FormControl, type FormControlProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, FormSubmit, type FormSubmitProps, FormValidityState, type FormValidityStateProps, Label, Message, Root, Submit, ValidityState, createFormScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0a0813d5da1f7df1fed9d66e222a513d8906f3a9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.js @@ -0,0 +1,483 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Control: () => Control, + Field: () => Field, + Form: () => Form, + FormControl: () => FormControl, + FormField: () => FormField, + FormLabel: () => FormLabel, + FormMessage: () => FormMessage, + FormSubmit: () => FormSubmit, + FormValidityState: () => FormValidityState, + Label: () => Label, + Message: () => Message, + Root: () => Root, + Submit: () => Submit, + ValidityState: () => ValidityState, + createFormScope: () => createFormScope +}); +module.exports = __toCommonJS(index_exports); + +// src/form.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_label = require("@radix-ui/react-label"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var [createFormContext, createFormScope] = (0, import_react_context.createContextScope)("Form"); +var FORM_NAME = "Form"; +var [ValidationProvider, useValidationContext] = createFormContext(FORM_NAME); +var [AriaDescriptionProvider, useAriaDescriptionContext] = createFormContext(FORM_NAME); +var Form = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, onClearServerErrors = () => { + }, ...rootProps } = props; + const formRef = React.useRef(null); + const composedFormRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, formRef); + const [validityMap, setValidityMap] = React.useState({}); + const getFieldValidity = React.useCallback( + (fieldName) => validityMap[fieldName], + [validityMap] + ); + const handleFieldValidityChange = React.useCallback( + (fieldName, validity) => setValidityMap((prevValidityMap) => ({ + ...prevValidityMap, + [fieldName]: { ...prevValidityMap[fieldName] ?? {}, ...validity } + })), + [] + ); + const handleFieldValiditionClear = React.useCallback((fieldName) => { + setValidityMap((prevValidityMap) => ({ ...prevValidityMap, [fieldName]: void 0 })); + setCustomErrorsMap((prevCustomErrorsMap) => ({ ...prevCustomErrorsMap, [fieldName]: {} })); + }, []); + const [customMatcherEntriesMap, setCustomMatcherEntriesMap] = React.useState({}); + const getFieldCustomMatcherEntries = React.useCallback( + (fieldName) => customMatcherEntriesMap[fieldName] ?? [], + [customMatcherEntriesMap] + ); + const handleFieldCustomMatcherAdd = React.useCallback((fieldName, matcherEntry) => { + setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({ + ...prevCustomMatcherEntriesMap, + [fieldName]: [...prevCustomMatcherEntriesMap[fieldName] ?? [], matcherEntry] + })); + }, []); + const handleFieldCustomMatcherRemove = React.useCallback((fieldName, matcherEntryId) => { + setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({ + ...prevCustomMatcherEntriesMap, + [fieldName]: (prevCustomMatcherEntriesMap[fieldName] ?? []).filter( + (matcherEntry) => matcherEntry.id !== matcherEntryId + ) + })); + }, []); + const [customErrorsMap, setCustomErrorsMap] = React.useState({}); + const getFieldCustomErrors = React.useCallback( + (fieldName) => customErrorsMap[fieldName] ?? {}, + [customErrorsMap] + ); + const handleFieldCustomErrorsChange = React.useCallback((fieldName, customErrors) => { + setCustomErrorsMap((prevCustomErrorsMap) => ({ + ...prevCustomErrorsMap, + [fieldName]: { ...prevCustomErrorsMap[fieldName] ?? {}, ...customErrors } + })); + }, []); + const [messageIdsMap, setMessageIdsMap] = React.useState({}); + const handleFieldMessageIdAdd = React.useCallback((fieldName, id) => { + setMessageIdsMap((prevMessageIdsMap) => { + const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]).add(id); + return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds }; + }); + }, []); + const handleFieldMessageIdRemove = React.useCallback((fieldName, id) => { + setMessageIdsMap((prevMessageIdsMap) => { + const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]); + fieldDescriptionIds.delete(id); + return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds }; + }); + }, []); + const getFieldDescription = React.useCallback( + (fieldName) => Array.from(messageIdsMap[fieldName] ?? []).join(" ") || void 0, + [messageIdsMap] + ); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ValidationProvider, + { + scope: __scopeForm, + getFieldValidity, + onFieldValidityChange: handleFieldValidityChange, + getFieldCustomMatcherEntries, + onFieldCustomMatcherEntryAdd: handleFieldCustomMatcherAdd, + onFieldCustomMatcherEntryRemove: handleFieldCustomMatcherRemove, + getFieldCustomErrors, + onFieldCustomErrorsChange: handleFieldCustomErrorsChange, + onFieldValiditionClear: handleFieldValiditionClear, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + AriaDescriptionProvider, + { + scope: __scopeForm, + onFieldMessageIdAdd: handleFieldMessageIdAdd, + onFieldMessageIdRemove: handleFieldMessageIdRemove, + getFieldDescription, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.form, + { + ...rootProps, + ref: composedFormRef, + onInvalid: (0, import_primitive.composeEventHandlers)(props.onInvalid, (event) => { + const firstInvalidControl = getFirstInvalidControl(event.currentTarget); + if (firstInvalidControl === event.target) firstInvalidControl.focus(); + event.preventDefault(); + }), + onSubmit: (0, import_primitive.composeEventHandlers)(props.onSubmit, onClearServerErrors, { + checkForDefaultPrevented: false + }), + onReset: (0, import_primitive.composeEventHandlers)(props.onReset, onClearServerErrors) + } + ) + } + ) + } + ); + } +); +Form.displayName = FORM_NAME; +var FIELD_NAME = "FormField"; +var [FormFieldProvider, useFormFieldContext] = createFormContext(FIELD_NAME); +var FormField = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, name, serverInvalid = false, ...fieldProps } = props; + const validationContext = useValidationContext(FIELD_NAME, __scopeForm); + const validity = validationContext.getFieldValidity(name); + const id = (0, import_react_id.useId)(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormFieldProvider, { scope: __scopeForm, id, name, serverInvalid, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-valid": getValidAttribute(validity, serverInvalid), + "data-invalid": getInvalidAttribute(validity, serverInvalid), + ...fieldProps, + ref: forwardedRef + } + ) }); + } +); +FormField.displayName = FIELD_NAME; +var LABEL_NAME = "FormLabel"; +var FormLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, ...labelProps } = props; + const validationContext = useValidationContext(LABEL_NAME, __scopeForm); + const fieldContext = useFormFieldContext(LABEL_NAME, __scopeForm); + const htmlFor = labelProps.htmlFor || fieldContext.id; + const validity = validationContext.getFieldValidity(fieldContext.name); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_label.Label, + { + "data-valid": getValidAttribute(validity, fieldContext.serverInvalid), + "data-invalid": getInvalidAttribute(validity, fieldContext.serverInvalid), + ...labelProps, + ref: forwardedRef, + htmlFor + } + ); + } +); +FormLabel.displayName = LABEL_NAME; +var CONTROL_NAME = "FormControl"; +var FormControl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, ...controlProps } = props; + const validationContext = useValidationContext(CONTROL_NAME, __scopeForm); + const fieldContext = useFormFieldContext(CONTROL_NAME, __scopeForm); + const ariaDescriptionContext = useAriaDescriptionContext(CONTROL_NAME, __scopeForm); + const ref = React.useRef(null); + const composedRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const name = controlProps.name || fieldContext.name; + const id = controlProps.id || fieldContext.id; + const customMatcherEntries = validationContext.getFieldCustomMatcherEntries(name); + const { onFieldValidityChange, onFieldCustomErrorsChange, onFieldValiditionClear } = validationContext; + const updateControlValidity = React.useCallback( + async (control) => { + if (hasBuiltInError(control.validity)) { + const controlValidity2 = validityStateToObject(control.validity); + onFieldValidityChange(name, controlValidity2); + return; + } + const formData = control.form ? new FormData(control.form) : new FormData(); + const matcherArgs = [control.value, formData]; + const syncCustomMatcherEntries = []; + const ayncCustomMatcherEntries = []; + customMatcherEntries.forEach((customMatcherEntry) => { + if (isAsyncCustomMatcherEntry(customMatcherEntry, matcherArgs)) { + ayncCustomMatcherEntries.push(customMatcherEntry); + } else if (isSyncCustomMatcherEntry(customMatcherEntry)) { + syncCustomMatcherEntries.push(customMatcherEntry); + } + }); + const syncCustomErrors = syncCustomMatcherEntries.map(({ id: id2, match }) => { + return [id2, match(...matcherArgs)]; + }); + const syncCustomErrorsById = Object.fromEntries(syncCustomErrors); + const hasSyncCustomErrors = Object.values(syncCustomErrorsById).some(Boolean); + const hasCustomError = hasSyncCustomErrors; + control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : ""); + const controlValidity = validityStateToObject(control.validity); + onFieldValidityChange(name, controlValidity); + onFieldCustomErrorsChange(name, syncCustomErrorsById); + if (!hasSyncCustomErrors && ayncCustomMatcherEntries.length > 0) { + const promisedCustomErrors = ayncCustomMatcherEntries.map( + ({ id: id2, match }) => match(...matcherArgs).then((matches) => [id2, matches]) + ); + const asyncCustomErrors = await Promise.all(promisedCustomErrors); + const asyncCustomErrorsById = Object.fromEntries(asyncCustomErrors); + const hasAsyncCustomErrors = Object.values(asyncCustomErrorsById).some(Boolean); + const hasCustomError2 = hasAsyncCustomErrors; + control.setCustomValidity(hasCustomError2 ? DEFAULT_INVALID_MESSAGE : ""); + const controlValidity2 = validityStateToObject(control.validity); + onFieldValidityChange(name, controlValidity2); + onFieldCustomErrorsChange(name, asyncCustomErrorsById); + } + }, + [customMatcherEntries, name, onFieldCustomErrorsChange, onFieldValidityChange] + ); + React.useEffect(() => { + const control = ref.current; + if (control) { + const handleChange = () => updateControlValidity(control); + control.addEventListener("change", handleChange); + return () => control.removeEventListener("change", handleChange); + } + }, [updateControlValidity]); + const resetControlValidity = React.useCallback(() => { + const control = ref.current; + if (control) { + control.setCustomValidity(""); + onFieldValiditionClear(name); + } + }, [name, onFieldValiditionClear]); + React.useEffect(() => { + const form = ref.current?.form; + if (form) { + form.addEventListener("reset", resetControlValidity); + return () => form.removeEventListener("reset", resetControlValidity); + } + }, [resetControlValidity]); + React.useEffect(() => { + const control = ref.current; + const form = control?.closest("form"); + if (form && fieldContext.serverInvalid) { + const firstInvalidControl = getFirstInvalidControl(form); + if (firstInvalidControl === control) firstInvalidControl.focus(); + } + }, [fieldContext.serverInvalid]); + const validity = validationContext.getFieldValidity(name); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.input, + { + "data-valid": getValidAttribute(validity, fieldContext.serverInvalid), + "data-invalid": getInvalidAttribute(validity, fieldContext.serverInvalid), + "aria-invalid": fieldContext.serverInvalid ? true : void 0, + "aria-describedby": ariaDescriptionContext.getFieldDescription(name), + title: "", + ...controlProps, + ref: composedRef, + id, + name, + onInvalid: (0, import_primitive.composeEventHandlers)(props.onInvalid, (event) => { + const control = event.currentTarget; + updateControlValidity(control); + }), + onChange: (0, import_primitive.composeEventHandlers)(props.onChange, (_event) => { + resetControlValidity(); + }) + } + ); + } +); +FormControl.displayName = CONTROL_NAME; +var DEFAULT_INVALID_MESSAGE = "This value is not valid"; +var DEFAULT_BUILT_IN_MESSAGES = { + badInput: DEFAULT_INVALID_MESSAGE, + patternMismatch: "This value does not match the required pattern", + rangeOverflow: "This value is too large", + rangeUnderflow: "This value is too small", + stepMismatch: "This value does not match the required step", + tooLong: "This value is too long", + tooShort: "This value is too short", + typeMismatch: "This value does not match the required type", + valid: void 0, + valueMissing: "This value is missing" +}; +var MESSAGE_NAME = "FormMessage"; +var FormMessage = React.forwardRef( + (props, forwardedRef) => { + const { match, name: nameProp, ...messageProps } = props; + const fieldContext = useFormFieldContext(MESSAGE_NAME, props.__scopeForm); + const name = nameProp ?? fieldContext.name; + if (match === void 0) { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormMessageImpl, { ...messageProps, ref: forwardedRef, name, children: props.children || DEFAULT_INVALID_MESSAGE }); + } else if (typeof match === "function") { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormCustomMessage, { match, ...messageProps, ref: forwardedRef, name }); + } else { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormBuiltInMessage, { match, ...messageProps, ref: forwardedRef, name }); + } + } +); +FormMessage.displayName = MESSAGE_NAME; +var FormBuiltInMessage = React.forwardRef( + (props, forwardedRef) => { + const { match, forceMatch = false, name, children, ...messageProps } = props; + const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm); + const validity = validationContext.getFieldValidity(name); + const matches = forceMatch || validity?.[match]; + if (matches) { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormMessageImpl, { ref: forwardedRef, ...messageProps, name, children: children ?? DEFAULT_BUILT_IN_MESSAGES[match] }); + } + return null; + } +); +var FormCustomMessage = React.forwardRef( + (props, forwardedRef) => { + const { match, forceMatch = false, name, id: idProp, children, ...messageProps } = props; + const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm); + const ref = React.useRef(null); + const composedRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const _id = (0, import_react_id.useId)(); + const id = idProp ?? _id; + const customMatcherEntry = React.useMemo(() => ({ id, match }), [id, match]); + const { onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove } = validationContext; + React.useEffect(() => { + onFieldCustomMatcherEntryAdd(name, customMatcherEntry); + return () => onFieldCustomMatcherEntryRemove(name, customMatcherEntry.id); + }, [customMatcherEntry, name, onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove]); + const validity = validationContext.getFieldValidity(name); + const customErrors = validationContext.getFieldCustomErrors(name); + const hasMatchingCustomError = customErrors[id]; + const matches = forceMatch || validity && !hasBuiltInError(validity) && hasMatchingCustomError; + if (matches) { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormMessageImpl, { id, ref: composedRef, ...messageProps, name, children: children ?? DEFAULT_INVALID_MESSAGE }); + } + return null; + } +); +var FormMessageImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, id: idProp, name, ...messageProps } = props; + const ariaDescriptionContext = useAriaDescriptionContext(MESSAGE_NAME, __scopeForm); + const _id = (0, import_react_id.useId)(); + const id = idProp ?? _id; + const { onFieldMessageIdAdd, onFieldMessageIdRemove } = ariaDescriptionContext; + React.useEffect(() => { + onFieldMessageIdAdd(name, id); + return () => onFieldMessageIdRemove(name, id); + }, [name, id, onFieldMessageIdAdd, onFieldMessageIdRemove]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.span, { id, ...messageProps, ref: forwardedRef }); + } +); +var VALIDITY_STATE_NAME = "FormValidityState"; +var FormValidityState = (props) => { + const { __scopeForm, name: nameProp, children } = props; + const validationContext = useValidationContext(VALIDITY_STATE_NAME, __scopeForm); + const fieldContext = useFormFieldContext(VALIDITY_STATE_NAME, __scopeForm); + const name = nameProp ?? fieldContext.name; + const validity = validationContext.getFieldValidity(name); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: children(validity) }); +}; +FormValidityState.displayName = VALIDITY_STATE_NAME; +var SUBMIT_NAME = "FormSubmit"; +var FormSubmit = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, ...submitProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.button, { type: "submit", ...submitProps, ref: forwardedRef }); + } +); +FormSubmit.displayName = SUBMIT_NAME; +function validityStateToObject(validity) { + const object = {}; + for (const key in validity) { + object[key] = validity[key]; + } + return object; +} +function isHTMLElement(element) { + return element instanceof HTMLElement; +} +function isFormControl(element) { + return "validity" in element; +} +function isInvalid(control) { + return isFormControl(control) && (control.validity.valid === false || control.getAttribute("aria-invalid") === "true"); +} +function getFirstInvalidControl(form) { + const elements = form.elements; + const [firstInvalidControl] = Array.from(elements).filter(isHTMLElement).filter(isInvalid); + return firstInvalidControl; +} +function isAsyncCustomMatcherEntry(entry, args) { + return entry.match.constructor.name === "AsyncFunction" || returnsPromise(entry.match, args); +} +function isSyncCustomMatcherEntry(entry) { + return entry.match.constructor.name === "Function"; +} +function returnsPromise(func, args) { + return func(...args) instanceof Promise; +} +function hasBuiltInError(validity) { + let error = false; + for (const validityKey in validity) { + const key = validityKey; + if (key !== "valid" && key !== "customError" && validity[key]) { + error = true; + break; + } + } + return error; +} +function getValidAttribute(validity, serverInvalid) { + if (validity?.valid === true && !serverInvalid) return true; + return void 0; +} +function getInvalidAttribute(validity, serverInvalid) { + if (validity?.valid === false || serverInvalid) return true; + return void 0; +} +var Root = Form; +var Field = FormField; +var Label = FormLabel; +var Control = FormControl; +var Message = FormMessage; +var ValidityState = FormValidityState; +var Submit = FormSubmit; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..591b34791c96fc48087704c23264dd39444bca70 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/form.tsx"], + "sourcesContent": ["'use client';\nexport {\n createFormScope,\n //\n Form,\n FormField,\n FormLabel,\n FormControl,\n FormMessage,\n FormValidityState,\n FormSubmit,\n //\n Root,\n Field,\n Label,\n Control,\n Message,\n ValidityState,\n Submit,\n} from './form';\n\nexport type {\n FormProps,\n FormFieldProps,\n FormLabelProps,\n FormControlProps,\n FormMessageProps,\n FormValidityStateProps,\n FormSubmitProps,\n} from './form';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Label as LabelPrimitive } from '@radix-ui/react-label';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype ScopedProps

= P & { __scopeForm?: Scope };\nconst [createFormContext, createFormScope] = createContextScope('Form');\n\n/* -------------------------------------------------------------------------------------------------\n * Form\n * -----------------------------------------------------------------------------------------------*/\n\nconst FORM_NAME = 'Form';\n\ntype ValidityMap = { [fieldName: string]: ValidityState | undefined };\ntype CustomMatcherEntriesMap = { [fieldName: string]: CustomMatcherEntry[] };\ntype CustomErrorsMap = { [fieldName: string]: Record };\n\ntype ValidationContextValue = {\n getFieldValidity(fieldName: string): ValidityState | undefined;\n onFieldValidityChange(fieldName: string, validity: ValidityState): void;\n\n getFieldCustomMatcherEntries(fieldName: string): CustomMatcherEntry[];\n onFieldCustomMatcherEntryAdd(fieldName: string, matcherEntry: CustomMatcherEntry): void;\n onFieldCustomMatcherEntryRemove(fieldName: string, matcherEntryId: string): void;\n\n getFieldCustomErrors(fieldName: string): Record;\n onFieldCustomErrorsChange(fieldName: string, errors: Record): void;\n\n onFieldValiditionClear(fieldName: string): void;\n};\nconst [ValidationProvider, useValidationContext] =\n createFormContext(FORM_NAME);\n\ntype MessageIdsMap = { [fieldName: string]: Set };\n\ntype AriaDescriptionContextValue = {\n onFieldMessageIdAdd(fieldName: string, id: string): void;\n onFieldMessageIdRemove(fieldName: string, id: string): void;\n getFieldDescription(fieldName: string): string | undefined;\n};\nconst [AriaDescriptionProvider, useAriaDescriptionContext] =\n createFormContext(FORM_NAME);\n\ntype FormElement = React.ComponentRef;\ntype PrimitiveFormProps = React.ComponentPropsWithoutRef;\ninterface FormProps extends PrimitiveFormProps {\n onClearServerErrors?(): void;\n}\n\nconst Form = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, onClearServerErrors = () => {}, ...rootProps } = props;\n const formRef = React.useRef(null);\n const composedFormRef = useComposedRefs(forwardedRef, formRef);\n\n // native validity per field\n const [validityMap, setValidityMap] = React.useState({});\n const getFieldValidity: ValidationContextValue['getFieldValidity'] = React.useCallback(\n (fieldName) => validityMap[fieldName],\n [validityMap],\n );\n const handleFieldValidityChange: ValidationContextValue['onFieldValidityChange'] =\n React.useCallback(\n (fieldName, validity) =>\n setValidityMap((prevValidityMap) => ({\n ...prevValidityMap,\n [fieldName]: { ...(prevValidityMap[fieldName] ?? {}), ...validity },\n })),\n [],\n );\n const handleFieldValiditionClear: ValidationContextValue['onFieldValiditionClear'] =\n React.useCallback((fieldName) => {\n setValidityMap((prevValidityMap) => ({ ...prevValidityMap, [fieldName]: undefined }));\n setCustomErrorsMap((prevCustomErrorsMap) => ({ ...prevCustomErrorsMap, [fieldName]: {} }));\n }, []);\n\n // custom matcher entries per field\n const [customMatcherEntriesMap, setCustomMatcherEntriesMap] =\n React.useState({});\n const getFieldCustomMatcherEntries: ValidationContextValue['getFieldCustomMatcherEntries'] =\n React.useCallback(\n (fieldName) => customMatcherEntriesMap[fieldName] ?? [],\n [customMatcherEntriesMap],\n );\n const handleFieldCustomMatcherAdd: ValidationContextValue['onFieldCustomMatcherEntryAdd'] =\n React.useCallback((fieldName, matcherEntry) => {\n setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({\n ...prevCustomMatcherEntriesMap,\n [fieldName]: [...(prevCustomMatcherEntriesMap[fieldName] ?? []), matcherEntry],\n }));\n }, []);\n const handleFieldCustomMatcherRemove: ValidationContextValue['onFieldCustomMatcherEntryRemove'] =\n React.useCallback((fieldName, matcherEntryId) => {\n setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({\n ...prevCustomMatcherEntriesMap,\n [fieldName]: (prevCustomMatcherEntriesMap[fieldName] ?? []).filter(\n (matcherEntry) => matcherEntry.id !== matcherEntryId,\n ),\n }));\n }, []);\n\n // custom errors per field\n const [customErrorsMap, setCustomErrorsMap] = React.useState({});\n const getFieldCustomErrors: ValidationContextValue['getFieldCustomErrors'] = React.useCallback(\n (fieldName) => customErrorsMap[fieldName] ?? {},\n [customErrorsMap],\n );\n const handleFieldCustomErrorsChange: ValidationContextValue['onFieldCustomErrorsChange'] =\n React.useCallback((fieldName, customErrors) => {\n setCustomErrorsMap((prevCustomErrorsMap) => ({\n ...prevCustomErrorsMap,\n [fieldName]: { ...(prevCustomErrorsMap[fieldName] ?? {}), ...customErrors },\n }));\n }, []);\n\n // messageIds per field\n const [messageIdsMap, setMessageIdsMap] = React.useState({});\n const handleFieldMessageIdAdd: AriaDescriptionContextValue['onFieldMessageIdAdd'] =\n React.useCallback((fieldName, id) => {\n setMessageIdsMap((prevMessageIdsMap) => {\n const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]).add(id);\n return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds };\n });\n }, []);\n const handleFieldMessageIdRemove: AriaDescriptionContextValue['onFieldMessageIdRemove'] =\n React.useCallback((fieldName, id) => {\n setMessageIdsMap((prevMessageIdsMap) => {\n const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]);\n fieldDescriptionIds.delete(id);\n return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds };\n });\n }, []);\n const getFieldDescription: AriaDescriptionContextValue['getFieldDescription'] =\n React.useCallback(\n (fieldName) => Array.from(messageIdsMap[fieldName] ?? []).join(' ') || undefined,\n [messageIdsMap],\n );\n\n return (\n \n \n {\n const firstInvalidControl = getFirstInvalidControl(event.currentTarget);\n if (firstInvalidControl === event.target) firstInvalidControl.focus();\n\n // prevent default browser UI for form validation\n event.preventDefault();\n })}\n // clear server errors when the form is re-submitted\n onSubmit={composeEventHandlers(props.onSubmit, onClearServerErrors, {\n checkForDefaultPrevented: false,\n })}\n // clear server errors when the form is reset\n onReset={composeEventHandlers(props.onReset, onClearServerErrors)}\n />\n \n \n );\n },\n);\n\nForm.displayName = FORM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormField\n * -----------------------------------------------------------------------------------------------*/\n\nconst FIELD_NAME = 'FormField';\n\ntype FormFieldContextValue = {\n id: string;\n name: string;\n serverInvalid: boolean;\n};\nconst [FormFieldProvider, useFormFieldContext] =\n createFormContext(FIELD_NAME);\n\ntype FormFieldElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface FormFieldProps extends PrimitiveDivProps {\n name: string;\n serverInvalid?: boolean;\n}\n\nconst FormField = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, name, serverInvalid = false, ...fieldProps } = props;\n const validationContext = useValidationContext(FIELD_NAME, __scopeForm);\n const validity = validationContext.getFieldValidity(name);\n const id = useId();\n\n return (\n \n \n \n );\n },\n);\n\nFormField.displayName = FIELD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'FormLabel';\n\ntype FormLabelElement = React.ComponentRef;\ntype LabelProps = React.ComponentPropsWithoutRef;\ninterface FormLabelProps extends LabelProps {}\n\nconst FormLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, ...labelProps } = props;\n const validationContext = useValidationContext(LABEL_NAME, __scopeForm);\n const fieldContext = useFormFieldContext(LABEL_NAME, __scopeForm);\n const htmlFor = labelProps.htmlFor || fieldContext.id;\n const validity = validationContext.getFieldValidity(fieldContext.name);\n\n return (\n \n );\n },\n);\n\nFormLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormControl\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTROL_NAME = 'FormControl';\n\ntype FormControlElement = React.ComponentRef;\ntype PrimitiveInputProps = React.ComponentPropsWithoutRef;\ninterface FormControlProps extends PrimitiveInputProps {}\n\nconst FormControl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, ...controlProps } = props;\n\n const validationContext = useValidationContext(CONTROL_NAME, __scopeForm);\n const fieldContext = useFormFieldContext(CONTROL_NAME, __scopeForm);\n const ariaDescriptionContext = useAriaDescriptionContext(CONTROL_NAME, __scopeForm);\n\n const ref = React.useRef(null);\n const composedRef = useComposedRefs(forwardedRef, ref);\n const name = controlProps.name || fieldContext.name;\n const id = controlProps.id || fieldContext.id;\n const customMatcherEntries = validationContext.getFieldCustomMatcherEntries(name);\n\n const { onFieldValidityChange, onFieldCustomErrorsChange, onFieldValiditionClear } =\n validationContext;\n const updateControlValidity = React.useCallback(\n async (control: FormControlElement) => {\n //------------------------------------------------------------------------------------------\n // 1. first, if we have built-in errors we stop here\n\n if (hasBuiltInError(control.validity)) {\n const controlValidity = validityStateToObject(control.validity);\n onFieldValidityChange(name, controlValidity);\n return;\n }\n\n //------------------------------------------------------------------------------------------\n // 2. then gather the form data to give to custom matchers for cross-comparisons\n\n const formData = control.form ? new FormData(control.form) : new FormData();\n const matcherArgs: CustomMatcherArgs = [control.value, formData];\n\n //------------------------------------------------------------------------------------------\n // 3. split sync and async custom matcher entries\n\n const syncCustomMatcherEntries: Array = [];\n const ayncCustomMatcherEntries: Array = [];\n customMatcherEntries.forEach((customMatcherEntry) => {\n if (isAsyncCustomMatcherEntry(customMatcherEntry, matcherArgs)) {\n ayncCustomMatcherEntries.push(customMatcherEntry);\n } else if (isSyncCustomMatcherEntry(customMatcherEntry)) {\n syncCustomMatcherEntries.push(customMatcherEntry);\n }\n });\n\n //------------------------------------------------------------------------------------------\n // 4. run sync custom matchers and update control validity / internal validity + errors\n\n const syncCustomErrors = syncCustomMatcherEntries.map(({ id, match }) => {\n return [id, match(...matcherArgs)] as const;\n });\n const syncCustomErrorsById = Object.fromEntries(syncCustomErrors);\n const hasSyncCustomErrors = Object.values(syncCustomErrorsById).some(Boolean);\n const hasCustomError = hasSyncCustomErrors;\n control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : '');\n const controlValidity = validityStateToObject(control.validity);\n onFieldValidityChange(name, controlValidity);\n onFieldCustomErrorsChange(name, syncCustomErrorsById);\n\n //------------------------------------------------------------------------------------------\n // 5. run async custom matchers and update control validity / internal validity + errors\n\n if (!hasSyncCustomErrors && ayncCustomMatcherEntries.length > 0) {\n const promisedCustomErrors = ayncCustomMatcherEntries.map(({ id, match }) =>\n match(...matcherArgs).then((matches) => [id, matches] as const),\n );\n const asyncCustomErrors = await Promise.all(promisedCustomErrors);\n const asyncCustomErrorsById = Object.fromEntries(asyncCustomErrors);\n const hasAsyncCustomErrors = Object.values(asyncCustomErrorsById).some(Boolean);\n const hasCustomError = hasAsyncCustomErrors;\n control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : '');\n const controlValidity = validityStateToObject(control.validity);\n onFieldValidityChange(name, controlValidity);\n onFieldCustomErrorsChange(name, asyncCustomErrorsById);\n }\n },\n [customMatcherEntries, name, onFieldCustomErrorsChange, onFieldValidityChange],\n );\n\n React.useEffect(() => {\n const control = ref.current;\n if (control) {\n // We only want validate on change (native `change` event, not React's `onChange`). This is primarily\n // a UX decision, we don't want to validate on every keystroke and React's `onChange` is the `input` event.\n const handleChange = () => updateControlValidity(control);\n control.addEventListener('change', handleChange);\n return () => control.removeEventListener('change', handleChange);\n }\n }, [updateControlValidity]);\n\n const resetControlValidity = React.useCallback(() => {\n const control = ref.current;\n if (control) {\n control.setCustomValidity('');\n onFieldValiditionClear(name);\n }\n }, [name, onFieldValiditionClear]);\n\n // reset validity and errors when the form is reset\n React.useEffect(() => {\n const form = ref.current?.form;\n if (form) {\n form.addEventListener('reset', resetControlValidity);\n return () => form.removeEventListener('reset', resetControlValidity);\n }\n }, [resetControlValidity]);\n\n // focus first invalid control when fields are set as invalid by server\n React.useEffect(() => {\n const control = ref.current;\n const form = control?.closest('form');\n if (form && fieldContext.serverInvalid) {\n const firstInvalidControl = getFirstInvalidControl(form);\n if (firstInvalidControl === control) firstInvalidControl.focus();\n }\n }, [fieldContext.serverInvalid]);\n\n const validity = validationContext.getFieldValidity(name);\n\n return (\n {\n const control = event.currentTarget;\n updateControlValidity(control);\n })}\n onChange={composeEventHandlers(props.onChange, (_event) => {\n // reset validity when user changes value\n resetControlValidity();\n })}\n />\n );\n },\n);\n\nFormControl.displayName = CONTROL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormMessage\n * -----------------------------------------------------------------------------------------------*/\n\nconst _validityMatchers = [\n 'badInput',\n 'patternMismatch',\n 'rangeOverflow',\n 'rangeUnderflow',\n 'stepMismatch',\n 'tooLong',\n 'tooShort',\n 'typeMismatch',\n 'valid',\n 'valueMissing',\n] as const;\ntype ValidityMatcher = (typeof _validityMatchers)[number];\n\nconst DEFAULT_INVALID_MESSAGE = 'This value is not valid';\nconst DEFAULT_BUILT_IN_MESSAGES: Record = {\n badInput: DEFAULT_INVALID_MESSAGE,\n patternMismatch: 'This value does not match the required pattern',\n rangeOverflow: 'This value is too large',\n rangeUnderflow: 'This value is too small',\n stepMismatch: 'This value does not match the required step',\n tooLong: 'This value is too long',\n tooShort: 'This value is too short',\n typeMismatch: 'This value does not match the required type',\n valid: undefined,\n valueMissing: 'This value is missing',\n};\n\nconst MESSAGE_NAME = 'FormMessage';\n\ntype FormMessageElement = FormMessageImplElement;\ninterface FormMessageProps extends Omit {\n match?: ValidityMatcher | CustomMatcher;\n forceMatch?: boolean;\n name?: string;\n}\n\nconst FormMessage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { match, name: nameProp, ...messageProps } = props;\n const fieldContext = useFormFieldContext(MESSAGE_NAME, props.__scopeForm);\n const name = nameProp ?? fieldContext.name;\n\n if (match === undefined) {\n return (\n \n {props.children || DEFAULT_INVALID_MESSAGE}\n \n );\n } else if (typeof match === 'function') {\n return ;\n } else {\n return ;\n }\n },\n);\n\nFormMessage.displayName = MESSAGE_NAME;\n\ntype FormBuiltInMessageElement = FormMessageImplElement;\ninterface FormBuiltInMessageProps extends FormMessageImplProps {\n match: ValidityMatcher;\n forceMatch?: boolean;\n name: string;\n}\n\nconst FormBuiltInMessage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { match, forceMatch = false, name, children, ...messageProps } = props;\n const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm);\n const validity = validationContext.getFieldValidity(name);\n const matches = forceMatch || validity?.[match];\n\n if (matches) {\n return (\n \n {children ?? DEFAULT_BUILT_IN_MESSAGES[match]}\n \n );\n }\n\n return null;\n },\n);\n\ntype FormCustomMessageElement = React.ComponentRef;\ninterface FormCustomMessageProps extends React.ComponentPropsWithoutRef {\n match: CustomMatcher;\n forceMatch?: boolean;\n name: string;\n}\n\nconst FormCustomMessage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { match, forceMatch = false, name, id: idProp, children, ...messageProps } = props;\n const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm);\n const ref = React.useRef(null);\n const composedRef = useComposedRefs(forwardedRef, ref);\n const _id = useId();\n const id = idProp ?? _id;\n\n const customMatcherEntry = React.useMemo(() => ({ id, match }), [id, match]);\n const { onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove } = validationContext;\n React.useEffect(() => {\n onFieldCustomMatcherEntryAdd(name, customMatcherEntry);\n return () => onFieldCustomMatcherEntryRemove(name, customMatcherEntry.id);\n }, [customMatcherEntry, name, onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove]);\n\n const validity = validationContext.getFieldValidity(name);\n const customErrors = validationContext.getFieldCustomErrors(name);\n const hasMatchingCustomError = customErrors[id];\n const matches =\n forceMatch || (validity && !hasBuiltInError(validity) && hasMatchingCustomError);\n\n if (matches) {\n return (\n \n {children ?? DEFAULT_INVALID_MESSAGE}\n \n );\n }\n\n return null;\n },\n);\n\ntype FormMessageImplElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface FormMessageImplProps extends PrimitiveSpanProps {\n name: string;\n}\n\nconst FormMessageImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, id: idProp, name, ...messageProps } = props;\n const ariaDescriptionContext = useAriaDescriptionContext(MESSAGE_NAME, __scopeForm);\n const _id = useId();\n const id = idProp ?? _id;\n\n const { onFieldMessageIdAdd, onFieldMessageIdRemove } = ariaDescriptionContext;\n React.useEffect(() => {\n onFieldMessageIdAdd(name, id);\n return () => onFieldMessageIdRemove(name, id);\n }, [name, id, onFieldMessageIdAdd, onFieldMessageIdRemove]);\n\n return ;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * FormValidityState\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALIDITY_STATE_NAME = 'FormValidityState';\n\ninterface FormValidityStateProps {\n children(validity: ValidityState | undefined): React.ReactNode;\n name?: string;\n}\n\nconst FormValidityState = (props: ScopedProps) => {\n const { __scopeForm, name: nameProp, children } = props;\n const validationContext = useValidationContext(VALIDITY_STATE_NAME, __scopeForm);\n const fieldContext = useFormFieldContext(VALIDITY_STATE_NAME, __scopeForm);\n const name = nameProp ?? fieldContext.name;\n const validity = validationContext.getFieldValidity(name);\n return <>{children(validity)};\n};\n\nFormValidityState.displayName = VALIDITY_STATE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormSubmit\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUBMIT_NAME = 'FormSubmit';\n\ntype FormSubmitElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface FormSubmitProps extends PrimitiveButtonProps {}\n\nconst FormSubmit = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, ...submitProps } = props;\n return ;\n },\n);\n\nFormSubmit.displayName = SUBMIT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ValidityStateKey = keyof ValidityState;\ntype SyncCustomMatcher = (value: string, formData: FormData) => boolean;\ntype AsyncCustomMatcher = (value: string, formData: FormData) => Promise;\ntype CustomMatcher = SyncCustomMatcher | AsyncCustomMatcher;\ntype CustomMatcherEntry = { id: string; match: CustomMatcher };\ntype SyncCustomMatcherEntry = { id: string; match: SyncCustomMatcher };\ntype AsyncCustomMatcherEntry = { id: string; match: AsyncCustomMatcher };\ntype CustomMatcherArgs = [string, FormData];\n\nfunction validityStateToObject(validity: ValidityState) {\n const object: any = {};\n for (const key in validity) {\n object[key] = validity[key as ValidityStateKey];\n }\n return object as Record;\n}\n\nfunction isHTMLElement(element: any): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\nfunction isFormControl(element: any): element is { validity: ValidityState } {\n return 'validity' in element;\n}\n\nfunction isInvalid(control: HTMLElement) {\n return (\n isFormControl(control) &&\n (control.validity.valid === false || control.getAttribute('aria-invalid') === 'true')\n );\n}\n\nfunction getFirstInvalidControl(form: HTMLFormElement): HTMLElement | undefined {\n const elements = form.elements;\n const [firstInvalidControl] = Array.from(elements).filter(isHTMLElement).filter(isInvalid);\n return firstInvalidControl;\n}\n\nfunction isAsyncCustomMatcherEntry(\n entry: CustomMatcherEntry,\n args: CustomMatcherArgs,\n): entry is AsyncCustomMatcherEntry {\n return entry.match.constructor.name === 'AsyncFunction' || returnsPromise(entry.match, args);\n}\n\nfunction isSyncCustomMatcherEntry(entry: CustomMatcherEntry): entry is SyncCustomMatcherEntry {\n return entry.match.constructor.name === 'Function';\n}\n\nfunction returnsPromise(func: Function, args: Array) {\n return func(...args) instanceof Promise;\n}\n\nfunction hasBuiltInError(validity: ValidityState) {\n let error = false;\n for (const validityKey in validity) {\n const key = validityKey as ValidityStateKey;\n if (key !== 'valid' && key !== 'customError' && validity[key]) {\n error = true;\n break;\n }\n }\n return error;\n}\n\nfunction getValidAttribute(validity: ValidityState | undefined, serverInvalid: boolean) {\n if (validity?.valid === true && !serverInvalid) return true;\n return undefined;\n}\nfunction getInvalidAttribute(validity: ValidityState | undefined, serverInvalid: boolean) {\n if (validity?.valid === false || serverInvalid) return true;\n return undefined;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Form;\nconst Field = FormField;\nconst Label = FormLabel;\nconst Control = FormControl;\nconst Message = FormMessage;\nconst ValidityState = FormValidityState;\nconst Submit = FormSubmit;\n\nexport {\n createFormScope,\n //\n Form,\n FormField,\n FormLabel,\n FormControl,\n FormMessage,\n FormValidityState,\n FormSubmit,\n //\n Root,\n Field,\n Label,\n Control,\n Message,\n ValidityState,\n Submit,\n};\n\nexport type {\n FormProps,\n FormFieldProps,\n FormLabelProps,\n FormControlProps,\n FormMessageProps,\n FormValidityStateProps,\n FormSubmitProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,sBAAsB;AACtB,yBAAwC;AACx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AwB;AACxF,MAAI,UAAU,UAAU,SAAS,cAAe,QAAO;AACvD,SAAO;AACT;AAIA,IAAM,OAAO;AACb,IAAM,QAAQ;AACd,IAAM,QAAQ;AACd,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,gBAAgB;AACtB,IAAM,SAAS;", + "names": ["LabelPrimitive", "controlValidity", "id", "hasCustomError"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a863140aaefec4a8022357a29ac2bcb80e91a5dd --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.mjs @@ -0,0 +1,451 @@ +"use client"; + +// src/form.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useId } from "@radix-ui/react-id"; +import { Label as LabelPrimitive } from "@radix-ui/react-label"; +import { Primitive } from "@radix-ui/react-primitive"; +import { Fragment, jsx } from "react/jsx-runtime"; +var [createFormContext, createFormScope] = createContextScope("Form"); +var FORM_NAME = "Form"; +var [ValidationProvider, useValidationContext] = createFormContext(FORM_NAME); +var [AriaDescriptionProvider, useAriaDescriptionContext] = createFormContext(FORM_NAME); +var Form = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, onClearServerErrors = () => { + }, ...rootProps } = props; + const formRef = React.useRef(null); + const composedFormRef = useComposedRefs(forwardedRef, formRef); + const [validityMap, setValidityMap] = React.useState({}); + const getFieldValidity = React.useCallback( + (fieldName) => validityMap[fieldName], + [validityMap] + ); + const handleFieldValidityChange = React.useCallback( + (fieldName, validity) => setValidityMap((prevValidityMap) => ({ + ...prevValidityMap, + [fieldName]: { ...prevValidityMap[fieldName] ?? {}, ...validity } + })), + [] + ); + const handleFieldValiditionClear = React.useCallback((fieldName) => { + setValidityMap((prevValidityMap) => ({ ...prevValidityMap, [fieldName]: void 0 })); + setCustomErrorsMap((prevCustomErrorsMap) => ({ ...prevCustomErrorsMap, [fieldName]: {} })); + }, []); + const [customMatcherEntriesMap, setCustomMatcherEntriesMap] = React.useState({}); + const getFieldCustomMatcherEntries = React.useCallback( + (fieldName) => customMatcherEntriesMap[fieldName] ?? [], + [customMatcherEntriesMap] + ); + const handleFieldCustomMatcherAdd = React.useCallback((fieldName, matcherEntry) => { + setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({ + ...prevCustomMatcherEntriesMap, + [fieldName]: [...prevCustomMatcherEntriesMap[fieldName] ?? [], matcherEntry] + })); + }, []); + const handleFieldCustomMatcherRemove = React.useCallback((fieldName, matcherEntryId) => { + setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({ + ...prevCustomMatcherEntriesMap, + [fieldName]: (prevCustomMatcherEntriesMap[fieldName] ?? []).filter( + (matcherEntry) => matcherEntry.id !== matcherEntryId + ) + })); + }, []); + const [customErrorsMap, setCustomErrorsMap] = React.useState({}); + const getFieldCustomErrors = React.useCallback( + (fieldName) => customErrorsMap[fieldName] ?? {}, + [customErrorsMap] + ); + const handleFieldCustomErrorsChange = React.useCallback((fieldName, customErrors) => { + setCustomErrorsMap((prevCustomErrorsMap) => ({ + ...prevCustomErrorsMap, + [fieldName]: { ...prevCustomErrorsMap[fieldName] ?? {}, ...customErrors } + })); + }, []); + const [messageIdsMap, setMessageIdsMap] = React.useState({}); + const handleFieldMessageIdAdd = React.useCallback((fieldName, id) => { + setMessageIdsMap((prevMessageIdsMap) => { + const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]).add(id); + return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds }; + }); + }, []); + const handleFieldMessageIdRemove = React.useCallback((fieldName, id) => { + setMessageIdsMap((prevMessageIdsMap) => { + const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]); + fieldDescriptionIds.delete(id); + return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds }; + }); + }, []); + const getFieldDescription = React.useCallback( + (fieldName) => Array.from(messageIdsMap[fieldName] ?? []).join(" ") || void 0, + [messageIdsMap] + ); + return /* @__PURE__ */ jsx( + ValidationProvider, + { + scope: __scopeForm, + getFieldValidity, + onFieldValidityChange: handleFieldValidityChange, + getFieldCustomMatcherEntries, + onFieldCustomMatcherEntryAdd: handleFieldCustomMatcherAdd, + onFieldCustomMatcherEntryRemove: handleFieldCustomMatcherRemove, + getFieldCustomErrors, + onFieldCustomErrorsChange: handleFieldCustomErrorsChange, + onFieldValiditionClear: handleFieldValiditionClear, + children: /* @__PURE__ */ jsx( + AriaDescriptionProvider, + { + scope: __scopeForm, + onFieldMessageIdAdd: handleFieldMessageIdAdd, + onFieldMessageIdRemove: handleFieldMessageIdRemove, + getFieldDescription, + children: /* @__PURE__ */ jsx( + Primitive.form, + { + ...rootProps, + ref: composedFormRef, + onInvalid: composeEventHandlers(props.onInvalid, (event) => { + const firstInvalidControl = getFirstInvalidControl(event.currentTarget); + if (firstInvalidControl === event.target) firstInvalidControl.focus(); + event.preventDefault(); + }), + onSubmit: composeEventHandlers(props.onSubmit, onClearServerErrors, { + checkForDefaultPrevented: false + }), + onReset: composeEventHandlers(props.onReset, onClearServerErrors) + } + ) + } + ) + } + ); + } +); +Form.displayName = FORM_NAME; +var FIELD_NAME = "FormField"; +var [FormFieldProvider, useFormFieldContext] = createFormContext(FIELD_NAME); +var FormField = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, name, serverInvalid = false, ...fieldProps } = props; + const validationContext = useValidationContext(FIELD_NAME, __scopeForm); + const validity = validationContext.getFieldValidity(name); + const id = useId(); + return /* @__PURE__ */ jsx(FormFieldProvider, { scope: __scopeForm, id, name, serverInvalid, children: /* @__PURE__ */ jsx( + Primitive.div, + { + "data-valid": getValidAttribute(validity, serverInvalid), + "data-invalid": getInvalidAttribute(validity, serverInvalid), + ...fieldProps, + ref: forwardedRef + } + ) }); + } +); +FormField.displayName = FIELD_NAME; +var LABEL_NAME = "FormLabel"; +var FormLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, ...labelProps } = props; + const validationContext = useValidationContext(LABEL_NAME, __scopeForm); + const fieldContext = useFormFieldContext(LABEL_NAME, __scopeForm); + const htmlFor = labelProps.htmlFor || fieldContext.id; + const validity = validationContext.getFieldValidity(fieldContext.name); + return /* @__PURE__ */ jsx( + LabelPrimitive, + { + "data-valid": getValidAttribute(validity, fieldContext.serverInvalid), + "data-invalid": getInvalidAttribute(validity, fieldContext.serverInvalid), + ...labelProps, + ref: forwardedRef, + htmlFor + } + ); + } +); +FormLabel.displayName = LABEL_NAME; +var CONTROL_NAME = "FormControl"; +var FormControl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, ...controlProps } = props; + const validationContext = useValidationContext(CONTROL_NAME, __scopeForm); + const fieldContext = useFormFieldContext(CONTROL_NAME, __scopeForm); + const ariaDescriptionContext = useAriaDescriptionContext(CONTROL_NAME, __scopeForm); + const ref = React.useRef(null); + const composedRef = useComposedRefs(forwardedRef, ref); + const name = controlProps.name || fieldContext.name; + const id = controlProps.id || fieldContext.id; + const customMatcherEntries = validationContext.getFieldCustomMatcherEntries(name); + const { onFieldValidityChange, onFieldCustomErrorsChange, onFieldValiditionClear } = validationContext; + const updateControlValidity = React.useCallback( + async (control) => { + if (hasBuiltInError(control.validity)) { + const controlValidity2 = validityStateToObject(control.validity); + onFieldValidityChange(name, controlValidity2); + return; + } + const formData = control.form ? new FormData(control.form) : new FormData(); + const matcherArgs = [control.value, formData]; + const syncCustomMatcherEntries = []; + const ayncCustomMatcherEntries = []; + customMatcherEntries.forEach((customMatcherEntry) => { + if (isAsyncCustomMatcherEntry(customMatcherEntry, matcherArgs)) { + ayncCustomMatcherEntries.push(customMatcherEntry); + } else if (isSyncCustomMatcherEntry(customMatcherEntry)) { + syncCustomMatcherEntries.push(customMatcherEntry); + } + }); + const syncCustomErrors = syncCustomMatcherEntries.map(({ id: id2, match }) => { + return [id2, match(...matcherArgs)]; + }); + const syncCustomErrorsById = Object.fromEntries(syncCustomErrors); + const hasSyncCustomErrors = Object.values(syncCustomErrorsById).some(Boolean); + const hasCustomError = hasSyncCustomErrors; + control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : ""); + const controlValidity = validityStateToObject(control.validity); + onFieldValidityChange(name, controlValidity); + onFieldCustomErrorsChange(name, syncCustomErrorsById); + if (!hasSyncCustomErrors && ayncCustomMatcherEntries.length > 0) { + const promisedCustomErrors = ayncCustomMatcherEntries.map( + ({ id: id2, match }) => match(...matcherArgs).then((matches) => [id2, matches]) + ); + const asyncCustomErrors = await Promise.all(promisedCustomErrors); + const asyncCustomErrorsById = Object.fromEntries(asyncCustomErrors); + const hasAsyncCustomErrors = Object.values(asyncCustomErrorsById).some(Boolean); + const hasCustomError2 = hasAsyncCustomErrors; + control.setCustomValidity(hasCustomError2 ? DEFAULT_INVALID_MESSAGE : ""); + const controlValidity2 = validityStateToObject(control.validity); + onFieldValidityChange(name, controlValidity2); + onFieldCustomErrorsChange(name, asyncCustomErrorsById); + } + }, + [customMatcherEntries, name, onFieldCustomErrorsChange, onFieldValidityChange] + ); + React.useEffect(() => { + const control = ref.current; + if (control) { + const handleChange = () => updateControlValidity(control); + control.addEventListener("change", handleChange); + return () => control.removeEventListener("change", handleChange); + } + }, [updateControlValidity]); + const resetControlValidity = React.useCallback(() => { + const control = ref.current; + if (control) { + control.setCustomValidity(""); + onFieldValiditionClear(name); + } + }, [name, onFieldValiditionClear]); + React.useEffect(() => { + const form = ref.current?.form; + if (form) { + form.addEventListener("reset", resetControlValidity); + return () => form.removeEventListener("reset", resetControlValidity); + } + }, [resetControlValidity]); + React.useEffect(() => { + const control = ref.current; + const form = control?.closest("form"); + if (form && fieldContext.serverInvalid) { + const firstInvalidControl = getFirstInvalidControl(form); + if (firstInvalidControl === control) firstInvalidControl.focus(); + } + }, [fieldContext.serverInvalid]); + const validity = validationContext.getFieldValidity(name); + return /* @__PURE__ */ jsx( + Primitive.input, + { + "data-valid": getValidAttribute(validity, fieldContext.serverInvalid), + "data-invalid": getInvalidAttribute(validity, fieldContext.serverInvalid), + "aria-invalid": fieldContext.serverInvalid ? true : void 0, + "aria-describedby": ariaDescriptionContext.getFieldDescription(name), + title: "", + ...controlProps, + ref: composedRef, + id, + name, + onInvalid: composeEventHandlers(props.onInvalid, (event) => { + const control = event.currentTarget; + updateControlValidity(control); + }), + onChange: composeEventHandlers(props.onChange, (_event) => { + resetControlValidity(); + }) + } + ); + } +); +FormControl.displayName = CONTROL_NAME; +var DEFAULT_INVALID_MESSAGE = "This value is not valid"; +var DEFAULT_BUILT_IN_MESSAGES = { + badInput: DEFAULT_INVALID_MESSAGE, + patternMismatch: "This value does not match the required pattern", + rangeOverflow: "This value is too large", + rangeUnderflow: "This value is too small", + stepMismatch: "This value does not match the required step", + tooLong: "This value is too long", + tooShort: "This value is too short", + typeMismatch: "This value does not match the required type", + valid: void 0, + valueMissing: "This value is missing" +}; +var MESSAGE_NAME = "FormMessage"; +var FormMessage = React.forwardRef( + (props, forwardedRef) => { + const { match, name: nameProp, ...messageProps } = props; + const fieldContext = useFormFieldContext(MESSAGE_NAME, props.__scopeForm); + const name = nameProp ?? fieldContext.name; + if (match === void 0) { + return /* @__PURE__ */ jsx(FormMessageImpl, { ...messageProps, ref: forwardedRef, name, children: props.children || DEFAULT_INVALID_MESSAGE }); + } else if (typeof match === "function") { + return /* @__PURE__ */ jsx(FormCustomMessage, { match, ...messageProps, ref: forwardedRef, name }); + } else { + return /* @__PURE__ */ jsx(FormBuiltInMessage, { match, ...messageProps, ref: forwardedRef, name }); + } + } +); +FormMessage.displayName = MESSAGE_NAME; +var FormBuiltInMessage = React.forwardRef( + (props, forwardedRef) => { + const { match, forceMatch = false, name, children, ...messageProps } = props; + const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm); + const validity = validationContext.getFieldValidity(name); + const matches = forceMatch || validity?.[match]; + if (matches) { + return /* @__PURE__ */ jsx(FormMessageImpl, { ref: forwardedRef, ...messageProps, name, children: children ?? DEFAULT_BUILT_IN_MESSAGES[match] }); + } + return null; + } +); +var FormCustomMessage = React.forwardRef( + (props, forwardedRef) => { + const { match, forceMatch = false, name, id: idProp, children, ...messageProps } = props; + const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm); + const ref = React.useRef(null); + const composedRef = useComposedRefs(forwardedRef, ref); + const _id = useId(); + const id = idProp ?? _id; + const customMatcherEntry = React.useMemo(() => ({ id, match }), [id, match]); + const { onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove } = validationContext; + React.useEffect(() => { + onFieldCustomMatcherEntryAdd(name, customMatcherEntry); + return () => onFieldCustomMatcherEntryRemove(name, customMatcherEntry.id); + }, [customMatcherEntry, name, onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove]); + const validity = validationContext.getFieldValidity(name); + const customErrors = validationContext.getFieldCustomErrors(name); + const hasMatchingCustomError = customErrors[id]; + const matches = forceMatch || validity && !hasBuiltInError(validity) && hasMatchingCustomError; + if (matches) { + return /* @__PURE__ */ jsx(FormMessageImpl, { id, ref: composedRef, ...messageProps, name, children: children ?? DEFAULT_INVALID_MESSAGE }); + } + return null; + } +); +var FormMessageImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, id: idProp, name, ...messageProps } = props; + const ariaDescriptionContext = useAriaDescriptionContext(MESSAGE_NAME, __scopeForm); + const _id = useId(); + const id = idProp ?? _id; + const { onFieldMessageIdAdd, onFieldMessageIdRemove } = ariaDescriptionContext; + React.useEffect(() => { + onFieldMessageIdAdd(name, id); + return () => onFieldMessageIdRemove(name, id); + }, [name, id, onFieldMessageIdAdd, onFieldMessageIdRemove]); + return /* @__PURE__ */ jsx(Primitive.span, { id, ...messageProps, ref: forwardedRef }); + } +); +var VALIDITY_STATE_NAME = "FormValidityState"; +var FormValidityState = (props) => { + const { __scopeForm, name: nameProp, children } = props; + const validationContext = useValidationContext(VALIDITY_STATE_NAME, __scopeForm); + const fieldContext = useFormFieldContext(VALIDITY_STATE_NAME, __scopeForm); + const name = nameProp ?? fieldContext.name; + const validity = validationContext.getFieldValidity(name); + return /* @__PURE__ */ jsx(Fragment, { children: children(validity) }); +}; +FormValidityState.displayName = VALIDITY_STATE_NAME; +var SUBMIT_NAME = "FormSubmit"; +var FormSubmit = React.forwardRef( + (props, forwardedRef) => { + const { __scopeForm, ...submitProps } = props; + return /* @__PURE__ */ jsx(Primitive.button, { type: "submit", ...submitProps, ref: forwardedRef }); + } +); +FormSubmit.displayName = SUBMIT_NAME; +function validityStateToObject(validity) { + const object = {}; + for (const key in validity) { + object[key] = validity[key]; + } + return object; +} +function isHTMLElement(element) { + return element instanceof HTMLElement; +} +function isFormControl(element) { + return "validity" in element; +} +function isInvalid(control) { + return isFormControl(control) && (control.validity.valid === false || control.getAttribute("aria-invalid") === "true"); +} +function getFirstInvalidControl(form) { + const elements = form.elements; + const [firstInvalidControl] = Array.from(elements).filter(isHTMLElement).filter(isInvalid); + return firstInvalidControl; +} +function isAsyncCustomMatcherEntry(entry, args) { + return entry.match.constructor.name === "AsyncFunction" || returnsPromise(entry.match, args); +} +function isSyncCustomMatcherEntry(entry) { + return entry.match.constructor.name === "Function"; +} +function returnsPromise(func, args) { + return func(...args) instanceof Promise; +} +function hasBuiltInError(validity) { + let error = false; + for (const validityKey in validity) { + const key = validityKey; + if (key !== "valid" && key !== "customError" && validity[key]) { + error = true; + break; + } + } + return error; +} +function getValidAttribute(validity, serverInvalid) { + if (validity?.valid === true && !serverInvalid) return true; + return void 0; +} +function getInvalidAttribute(validity, serverInvalid) { + if (validity?.valid === false || serverInvalid) return true; + return void 0; +} +var Root = Form; +var Field = FormField; +var Label = FormLabel; +var Control = FormControl; +var Message = FormMessage; +var ValidityState = FormValidityState; +var Submit = FormSubmit; +export { + Control, + Field, + Form, + FormControl, + FormField, + FormLabel, + FormMessage, + FormSubmit, + FormValidityState, + Label, + Message, + Root, + Submit, + ValidityState, + createFormScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..b0adc8a8202fbcb56e1f42d4d3e30085310b715c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/form.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Label as LabelPrimitive } from '@radix-ui/react-label';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype ScopedProps

= P & { __scopeForm?: Scope };\nconst [createFormContext, createFormScope] = createContextScope('Form');\n\n/* -------------------------------------------------------------------------------------------------\n * Form\n * -----------------------------------------------------------------------------------------------*/\n\nconst FORM_NAME = 'Form';\n\ntype ValidityMap = { [fieldName: string]: ValidityState | undefined };\ntype CustomMatcherEntriesMap = { [fieldName: string]: CustomMatcherEntry[] };\ntype CustomErrorsMap = { [fieldName: string]: Record };\n\ntype ValidationContextValue = {\n getFieldValidity(fieldName: string): ValidityState | undefined;\n onFieldValidityChange(fieldName: string, validity: ValidityState): void;\n\n getFieldCustomMatcherEntries(fieldName: string): CustomMatcherEntry[];\n onFieldCustomMatcherEntryAdd(fieldName: string, matcherEntry: CustomMatcherEntry): void;\n onFieldCustomMatcherEntryRemove(fieldName: string, matcherEntryId: string): void;\n\n getFieldCustomErrors(fieldName: string): Record;\n onFieldCustomErrorsChange(fieldName: string, errors: Record): void;\n\n onFieldValiditionClear(fieldName: string): void;\n};\nconst [ValidationProvider, useValidationContext] =\n createFormContext(FORM_NAME);\n\ntype MessageIdsMap = { [fieldName: string]: Set };\n\ntype AriaDescriptionContextValue = {\n onFieldMessageIdAdd(fieldName: string, id: string): void;\n onFieldMessageIdRemove(fieldName: string, id: string): void;\n getFieldDescription(fieldName: string): string | undefined;\n};\nconst [AriaDescriptionProvider, useAriaDescriptionContext] =\n createFormContext(FORM_NAME);\n\ntype FormElement = React.ComponentRef;\ntype PrimitiveFormProps = React.ComponentPropsWithoutRef;\ninterface FormProps extends PrimitiveFormProps {\n onClearServerErrors?(): void;\n}\n\nconst Form = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, onClearServerErrors = () => {}, ...rootProps } = props;\n const formRef = React.useRef(null);\n const composedFormRef = useComposedRefs(forwardedRef, formRef);\n\n // native validity per field\n const [validityMap, setValidityMap] = React.useState({});\n const getFieldValidity: ValidationContextValue['getFieldValidity'] = React.useCallback(\n (fieldName) => validityMap[fieldName],\n [validityMap],\n );\n const handleFieldValidityChange: ValidationContextValue['onFieldValidityChange'] =\n React.useCallback(\n (fieldName, validity) =>\n setValidityMap((prevValidityMap) => ({\n ...prevValidityMap,\n [fieldName]: { ...(prevValidityMap[fieldName] ?? {}), ...validity },\n })),\n [],\n );\n const handleFieldValiditionClear: ValidationContextValue['onFieldValiditionClear'] =\n React.useCallback((fieldName) => {\n setValidityMap((prevValidityMap) => ({ ...prevValidityMap, [fieldName]: undefined }));\n setCustomErrorsMap((prevCustomErrorsMap) => ({ ...prevCustomErrorsMap, [fieldName]: {} }));\n }, []);\n\n // custom matcher entries per field\n const [customMatcherEntriesMap, setCustomMatcherEntriesMap] =\n React.useState({});\n const getFieldCustomMatcherEntries: ValidationContextValue['getFieldCustomMatcherEntries'] =\n React.useCallback(\n (fieldName) => customMatcherEntriesMap[fieldName] ?? [],\n [customMatcherEntriesMap],\n );\n const handleFieldCustomMatcherAdd: ValidationContextValue['onFieldCustomMatcherEntryAdd'] =\n React.useCallback((fieldName, matcherEntry) => {\n setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({\n ...prevCustomMatcherEntriesMap,\n [fieldName]: [...(prevCustomMatcherEntriesMap[fieldName] ?? []), matcherEntry],\n }));\n }, []);\n const handleFieldCustomMatcherRemove: ValidationContextValue['onFieldCustomMatcherEntryRemove'] =\n React.useCallback((fieldName, matcherEntryId) => {\n setCustomMatcherEntriesMap((prevCustomMatcherEntriesMap) => ({\n ...prevCustomMatcherEntriesMap,\n [fieldName]: (prevCustomMatcherEntriesMap[fieldName] ?? []).filter(\n (matcherEntry) => matcherEntry.id !== matcherEntryId,\n ),\n }));\n }, []);\n\n // custom errors per field\n const [customErrorsMap, setCustomErrorsMap] = React.useState({});\n const getFieldCustomErrors: ValidationContextValue['getFieldCustomErrors'] = React.useCallback(\n (fieldName) => customErrorsMap[fieldName] ?? {},\n [customErrorsMap],\n );\n const handleFieldCustomErrorsChange: ValidationContextValue['onFieldCustomErrorsChange'] =\n React.useCallback((fieldName, customErrors) => {\n setCustomErrorsMap((prevCustomErrorsMap) => ({\n ...prevCustomErrorsMap,\n [fieldName]: { ...(prevCustomErrorsMap[fieldName] ?? {}), ...customErrors },\n }));\n }, []);\n\n // messageIds per field\n const [messageIdsMap, setMessageIdsMap] = React.useState({});\n const handleFieldMessageIdAdd: AriaDescriptionContextValue['onFieldMessageIdAdd'] =\n React.useCallback((fieldName, id) => {\n setMessageIdsMap((prevMessageIdsMap) => {\n const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]).add(id);\n return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds };\n });\n }, []);\n const handleFieldMessageIdRemove: AriaDescriptionContextValue['onFieldMessageIdRemove'] =\n React.useCallback((fieldName, id) => {\n setMessageIdsMap((prevMessageIdsMap) => {\n const fieldDescriptionIds = new Set(prevMessageIdsMap[fieldName]);\n fieldDescriptionIds.delete(id);\n return { ...prevMessageIdsMap, [fieldName]: fieldDescriptionIds };\n });\n }, []);\n const getFieldDescription: AriaDescriptionContextValue['getFieldDescription'] =\n React.useCallback(\n (fieldName) => Array.from(messageIdsMap[fieldName] ?? []).join(' ') || undefined,\n [messageIdsMap],\n );\n\n return (\n \n \n {\n const firstInvalidControl = getFirstInvalidControl(event.currentTarget);\n if (firstInvalidControl === event.target) firstInvalidControl.focus();\n\n // prevent default browser UI for form validation\n event.preventDefault();\n })}\n // clear server errors when the form is re-submitted\n onSubmit={composeEventHandlers(props.onSubmit, onClearServerErrors, {\n checkForDefaultPrevented: false,\n })}\n // clear server errors when the form is reset\n onReset={composeEventHandlers(props.onReset, onClearServerErrors)}\n />\n \n \n );\n },\n);\n\nForm.displayName = FORM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormField\n * -----------------------------------------------------------------------------------------------*/\n\nconst FIELD_NAME = 'FormField';\n\ntype FormFieldContextValue = {\n id: string;\n name: string;\n serverInvalid: boolean;\n};\nconst [FormFieldProvider, useFormFieldContext] =\n createFormContext(FIELD_NAME);\n\ntype FormFieldElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface FormFieldProps extends PrimitiveDivProps {\n name: string;\n serverInvalid?: boolean;\n}\n\nconst FormField = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, name, serverInvalid = false, ...fieldProps } = props;\n const validationContext = useValidationContext(FIELD_NAME, __scopeForm);\n const validity = validationContext.getFieldValidity(name);\n const id = useId();\n\n return (\n \n \n \n );\n },\n);\n\nFormField.displayName = FIELD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'FormLabel';\n\ntype FormLabelElement = React.ComponentRef;\ntype LabelProps = React.ComponentPropsWithoutRef;\ninterface FormLabelProps extends LabelProps {}\n\nconst FormLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, ...labelProps } = props;\n const validationContext = useValidationContext(LABEL_NAME, __scopeForm);\n const fieldContext = useFormFieldContext(LABEL_NAME, __scopeForm);\n const htmlFor = labelProps.htmlFor || fieldContext.id;\n const validity = validationContext.getFieldValidity(fieldContext.name);\n\n return (\n \n );\n },\n);\n\nFormLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormControl\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTROL_NAME = 'FormControl';\n\ntype FormControlElement = React.ComponentRef;\ntype PrimitiveInputProps = React.ComponentPropsWithoutRef;\ninterface FormControlProps extends PrimitiveInputProps {}\n\nconst FormControl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, ...controlProps } = props;\n\n const validationContext = useValidationContext(CONTROL_NAME, __scopeForm);\n const fieldContext = useFormFieldContext(CONTROL_NAME, __scopeForm);\n const ariaDescriptionContext = useAriaDescriptionContext(CONTROL_NAME, __scopeForm);\n\n const ref = React.useRef(null);\n const composedRef = useComposedRefs(forwardedRef, ref);\n const name = controlProps.name || fieldContext.name;\n const id = controlProps.id || fieldContext.id;\n const customMatcherEntries = validationContext.getFieldCustomMatcherEntries(name);\n\n const { onFieldValidityChange, onFieldCustomErrorsChange, onFieldValiditionClear } =\n validationContext;\n const updateControlValidity = React.useCallback(\n async (control: FormControlElement) => {\n //------------------------------------------------------------------------------------------\n // 1. first, if we have built-in errors we stop here\n\n if (hasBuiltInError(control.validity)) {\n const controlValidity = validityStateToObject(control.validity);\n onFieldValidityChange(name, controlValidity);\n return;\n }\n\n //------------------------------------------------------------------------------------------\n // 2. then gather the form data to give to custom matchers for cross-comparisons\n\n const formData = control.form ? new FormData(control.form) : new FormData();\n const matcherArgs: CustomMatcherArgs = [control.value, formData];\n\n //------------------------------------------------------------------------------------------\n // 3. split sync and async custom matcher entries\n\n const syncCustomMatcherEntries: Array = [];\n const ayncCustomMatcherEntries: Array = [];\n customMatcherEntries.forEach((customMatcherEntry) => {\n if (isAsyncCustomMatcherEntry(customMatcherEntry, matcherArgs)) {\n ayncCustomMatcherEntries.push(customMatcherEntry);\n } else if (isSyncCustomMatcherEntry(customMatcherEntry)) {\n syncCustomMatcherEntries.push(customMatcherEntry);\n }\n });\n\n //------------------------------------------------------------------------------------------\n // 4. run sync custom matchers and update control validity / internal validity + errors\n\n const syncCustomErrors = syncCustomMatcherEntries.map(({ id, match }) => {\n return [id, match(...matcherArgs)] as const;\n });\n const syncCustomErrorsById = Object.fromEntries(syncCustomErrors);\n const hasSyncCustomErrors = Object.values(syncCustomErrorsById).some(Boolean);\n const hasCustomError = hasSyncCustomErrors;\n control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : '');\n const controlValidity = validityStateToObject(control.validity);\n onFieldValidityChange(name, controlValidity);\n onFieldCustomErrorsChange(name, syncCustomErrorsById);\n\n //------------------------------------------------------------------------------------------\n // 5. run async custom matchers and update control validity / internal validity + errors\n\n if (!hasSyncCustomErrors && ayncCustomMatcherEntries.length > 0) {\n const promisedCustomErrors = ayncCustomMatcherEntries.map(({ id, match }) =>\n match(...matcherArgs).then((matches) => [id, matches] as const),\n );\n const asyncCustomErrors = await Promise.all(promisedCustomErrors);\n const asyncCustomErrorsById = Object.fromEntries(asyncCustomErrors);\n const hasAsyncCustomErrors = Object.values(asyncCustomErrorsById).some(Boolean);\n const hasCustomError = hasAsyncCustomErrors;\n control.setCustomValidity(hasCustomError ? DEFAULT_INVALID_MESSAGE : '');\n const controlValidity = validityStateToObject(control.validity);\n onFieldValidityChange(name, controlValidity);\n onFieldCustomErrorsChange(name, asyncCustomErrorsById);\n }\n },\n [customMatcherEntries, name, onFieldCustomErrorsChange, onFieldValidityChange],\n );\n\n React.useEffect(() => {\n const control = ref.current;\n if (control) {\n // We only want validate on change (native `change` event, not React's `onChange`). This is primarily\n // a UX decision, we don't want to validate on every keystroke and React's `onChange` is the `input` event.\n const handleChange = () => updateControlValidity(control);\n control.addEventListener('change', handleChange);\n return () => control.removeEventListener('change', handleChange);\n }\n }, [updateControlValidity]);\n\n const resetControlValidity = React.useCallback(() => {\n const control = ref.current;\n if (control) {\n control.setCustomValidity('');\n onFieldValiditionClear(name);\n }\n }, [name, onFieldValiditionClear]);\n\n // reset validity and errors when the form is reset\n React.useEffect(() => {\n const form = ref.current?.form;\n if (form) {\n form.addEventListener('reset', resetControlValidity);\n return () => form.removeEventListener('reset', resetControlValidity);\n }\n }, [resetControlValidity]);\n\n // focus first invalid control when fields are set as invalid by server\n React.useEffect(() => {\n const control = ref.current;\n const form = control?.closest('form');\n if (form && fieldContext.serverInvalid) {\n const firstInvalidControl = getFirstInvalidControl(form);\n if (firstInvalidControl === control) firstInvalidControl.focus();\n }\n }, [fieldContext.serverInvalid]);\n\n const validity = validationContext.getFieldValidity(name);\n\n return (\n {\n const control = event.currentTarget;\n updateControlValidity(control);\n })}\n onChange={composeEventHandlers(props.onChange, (_event) => {\n // reset validity when user changes value\n resetControlValidity();\n })}\n />\n );\n },\n);\n\nFormControl.displayName = CONTROL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormMessage\n * -----------------------------------------------------------------------------------------------*/\n\nconst _validityMatchers = [\n 'badInput',\n 'patternMismatch',\n 'rangeOverflow',\n 'rangeUnderflow',\n 'stepMismatch',\n 'tooLong',\n 'tooShort',\n 'typeMismatch',\n 'valid',\n 'valueMissing',\n] as const;\ntype ValidityMatcher = (typeof _validityMatchers)[number];\n\nconst DEFAULT_INVALID_MESSAGE = 'This value is not valid';\nconst DEFAULT_BUILT_IN_MESSAGES: Record = {\n badInput: DEFAULT_INVALID_MESSAGE,\n patternMismatch: 'This value does not match the required pattern',\n rangeOverflow: 'This value is too large',\n rangeUnderflow: 'This value is too small',\n stepMismatch: 'This value does not match the required step',\n tooLong: 'This value is too long',\n tooShort: 'This value is too short',\n typeMismatch: 'This value does not match the required type',\n valid: undefined,\n valueMissing: 'This value is missing',\n};\n\nconst MESSAGE_NAME = 'FormMessage';\n\ntype FormMessageElement = FormMessageImplElement;\ninterface FormMessageProps extends Omit {\n match?: ValidityMatcher | CustomMatcher;\n forceMatch?: boolean;\n name?: string;\n}\n\nconst FormMessage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { match, name: nameProp, ...messageProps } = props;\n const fieldContext = useFormFieldContext(MESSAGE_NAME, props.__scopeForm);\n const name = nameProp ?? fieldContext.name;\n\n if (match === undefined) {\n return (\n \n {props.children || DEFAULT_INVALID_MESSAGE}\n \n );\n } else if (typeof match === 'function') {\n return ;\n } else {\n return ;\n }\n },\n);\n\nFormMessage.displayName = MESSAGE_NAME;\n\ntype FormBuiltInMessageElement = FormMessageImplElement;\ninterface FormBuiltInMessageProps extends FormMessageImplProps {\n match: ValidityMatcher;\n forceMatch?: boolean;\n name: string;\n}\n\nconst FormBuiltInMessage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { match, forceMatch = false, name, children, ...messageProps } = props;\n const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm);\n const validity = validationContext.getFieldValidity(name);\n const matches = forceMatch || validity?.[match];\n\n if (matches) {\n return (\n \n {children ?? DEFAULT_BUILT_IN_MESSAGES[match]}\n \n );\n }\n\n return null;\n },\n);\n\ntype FormCustomMessageElement = React.ComponentRef;\ninterface FormCustomMessageProps extends React.ComponentPropsWithoutRef {\n match: CustomMatcher;\n forceMatch?: boolean;\n name: string;\n}\n\nconst FormCustomMessage = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { match, forceMatch = false, name, id: idProp, children, ...messageProps } = props;\n const validationContext = useValidationContext(MESSAGE_NAME, messageProps.__scopeForm);\n const ref = React.useRef(null);\n const composedRef = useComposedRefs(forwardedRef, ref);\n const _id = useId();\n const id = idProp ?? _id;\n\n const customMatcherEntry = React.useMemo(() => ({ id, match }), [id, match]);\n const { onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove } = validationContext;\n React.useEffect(() => {\n onFieldCustomMatcherEntryAdd(name, customMatcherEntry);\n return () => onFieldCustomMatcherEntryRemove(name, customMatcherEntry.id);\n }, [customMatcherEntry, name, onFieldCustomMatcherEntryAdd, onFieldCustomMatcherEntryRemove]);\n\n const validity = validationContext.getFieldValidity(name);\n const customErrors = validationContext.getFieldCustomErrors(name);\n const hasMatchingCustomError = customErrors[id];\n const matches =\n forceMatch || (validity && !hasBuiltInError(validity) && hasMatchingCustomError);\n\n if (matches) {\n return (\n \n {children ?? DEFAULT_INVALID_MESSAGE}\n \n );\n }\n\n return null;\n },\n);\n\ntype FormMessageImplElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface FormMessageImplProps extends PrimitiveSpanProps {\n name: string;\n}\n\nconst FormMessageImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, id: idProp, name, ...messageProps } = props;\n const ariaDescriptionContext = useAriaDescriptionContext(MESSAGE_NAME, __scopeForm);\n const _id = useId();\n const id = idProp ?? _id;\n\n const { onFieldMessageIdAdd, onFieldMessageIdRemove } = ariaDescriptionContext;\n React.useEffect(() => {\n onFieldMessageIdAdd(name, id);\n return () => onFieldMessageIdRemove(name, id);\n }, [name, id, onFieldMessageIdAdd, onFieldMessageIdRemove]);\n\n return ;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * FormValidityState\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALIDITY_STATE_NAME = 'FormValidityState';\n\ninterface FormValidityStateProps {\n children(validity: ValidityState | undefined): React.ReactNode;\n name?: string;\n}\n\nconst FormValidityState = (props: ScopedProps) => {\n const { __scopeForm, name: nameProp, children } = props;\n const validationContext = useValidationContext(VALIDITY_STATE_NAME, __scopeForm);\n const fieldContext = useFormFieldContext(VALIDITY_STATE_NAME, __scopeForm);\n const name = nameProp ?? fieldContext.name;\n const validity = validationContext.getFieldValidity(name);\n return <>{children(validity)};\n};\n\nFormValidityState.displayName = VALIDITY_STATE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * FormSubmit\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUBMIT_NAME = 'FormSubmit';\n\ntype FormSubmitElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface FormSubmitProps extends PrimitiveButtonProps {}\n\nconst FormSubmit = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeForm, ...submitProps } = props;\n return ;\n },\n);\n\nFormSubmit.displayName = SUBMIT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ValidityStateKey = keyof ValidityState;\ntype SyncCustomMatcher = (value: string, formData: FormData) => boolean;\ntype AsyncCustomMatcher = (value: string, formData: FormData) => Promise;\ntype CustomMatcher = SyncCustomMatcher | AsyncCustomMatcher;\ntype CustomMatcherEntry = { id: string; match: CustomMatcher };\ntype SyncCustomMatcherEntry = { id: string; match: SyncCustomMatcher };\ntype AsyncCustomMatcherEntry = { id: string; match: AsyncCustomMatcher };\ntype CustomMatcherArgs = [string, FormData];\n\nfunction validityStateToObject(validity: ValidityState) {\n const object: any = {};\n for (const key in validity) {\n object[key] = validity[key as ValidityStateKey];\n }\n return object as Record;\n}\n\nfunction isHTMLElement(element: any): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\nfunction isFormControl(element: any): element is { validity: ValidityState } {\n return 'validity' in element;\n}\n\nfunction isInvalid(control: HTMLElement) {\n return (\n isFormControl(control) &&\n (control.validity.valid === false || control.getAttribute('aria-invalid') === 'true')\n );\n}\n\nfunction getFirstInvalidControl(form: HTMLFormElement): HTMLElement | undefined {\n const elements = form.elements;\n const [firstInvalidControl] = Array.from(elements).filter(isHTMLElement).filter(isInvalid);\n return firstInvalidControl;\n}\n\nfunction isAsyncCustomMatcherEntry(\n entry: CustomMatcherEntry,\n args: CustomMatcherArgs,\n): entry is AsyncCustomMatcherEntry {\n return entry.match.constructor.name === 'AsyncFunction' || returnsPromise(entry.match, args);\n}\n\nfunction isSyncCustomMatcherEntry(entry: CustomMatcherEntry): entry is SyncCustomMatcherEntry {\n return entry.match.constructor.name === 'Function';\n}\n\nfunction returnsPromise(func: Function, args: Array) {\n return func(...args) instanceof Promise;\n}\n\nfunction hasBuiltInError(validity: ValidityState) {\n let error = false;\n for (const validityKey in validity) {\n const key = validityKey as ValidityStateKey;\n if (key !== 'valid' && key !== 'customError' && validity[key]) {\n error = true;\n break;\n }\n }\n return error;\n}\n\nfunction getValidAttribute(validity: ValidityState | undefined, serverInvalid: boolean) {\n if (validity?.valid === true && !serverInvalid) return true;\n return undefined;\n}\nfunction getInvalidAttribute(validity: ValidityState | undefined, serverInvalid: boolean) {\n if (validity?.valid === false || serverInvalid) return true;\n return undefined;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Form;\nconst Field = FormField;\nconst Label = FormLabel;\nconst Control = FormControl;\nconst Message = FormMessage;\nconst ValidityState = FormValidityState;\nconst Submit = FormSubmit;\n\nexport {\n createFormScope,\n //\n Form,\n FormField,\n FormLabel,\n FormControl,\n FormMessage,\n FormValidityState,\n FormSubmit,\n //\n Root,\n Field,\n Label,\n Control,\n Message,\n ValidityState,\n Submit,\n};\n\nexport type {\n FormProps,\n FormFieldProps,\n FormLabelProps,\n FormControlProps,\n FormMessageProps,\n FormValidityStateProps,\n FormSubmitProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,aAAa;AACtB,SAAS,SAAS,sBAAsB;AACxC,SAAS,iBAAiB;AA4JhB,SA4aD,UA5aC;AAvJV,IAAM,CAAC,mBAAmB,eAAe,IAAI,mBAAmB,MAAM;AAMtE,IAAM,YAAY;AAmBlB,IAAM,CAAC,oBAAoB,oBAAoB,IAC7C,kBAA0C,SAAS;AASrD,IAAM,CAAC,yBAAyB,yBAAyB,IACvD,kBAA+C,SAAS;AAQ1D,IAAM,OAAa;AAAA,EACjB,CAAC,OAA+B,iBAAiB;AAC/C,UAAM,EAAE,aAAa,sBAAsB,MAAM;AAAA,IAAC,GAAG,GAAG,UAAU,IAAI;AACtE,UAAM,UAAgB,aAAwB,IAAI;AAClD,UAAM,k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ACE,cAAc,OAAO,MACpB,QAAQ,SAAS,UAAU,SAAS,QAAQ,aAAa,cAAc,MAAM;AAElF;AAEA,SAAS,uBAAuB,MAAgD;AAC9E,QAAM,WAAW,KAAK;AACtB,QAAM,CAAC,mBAAmB,IAAI,MAAM,KAAK,QAAQ,EAAE,OAAO,aAAa,EAAE,OAAO,SAAS;AACzF,SAAO;AACT;AAEA,SAAS,0BACP,OACA,MACkC;AAClC,SAAO,MAAM,MAAM,YAAY,SAAS,mBAAmB,eAAe,MAAM,OAAO,IAAI;AAC7F;AAEA,SAAS,yBAAyB,OAA4D;AAC5F,SAAO,MAAM,MAAM,YAAY,SAAS;AAC1C;AAEA,SAAS,eAAe,MAAgB,MAAsB;AAC5D,SAAO,KAAK,GAAG,IAAI,aAAa;AAClC;AAEA,SAAS,gBAAgB,UAAyB;AAChD,MAAI,QAAQ;AACZ,aAAW,eAAe,UAAU;AAClC,UAAM,MAAM;AACZ,QAAI,QAAQ,WAAW,QAAQ,iBAAiB,SAAS,GAAG,GAAG;AAC7D,cAAQ;AACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,kBAAkB,UAAqC,eAAwB;AACtF,MAAI,UAAU,UAAU,QAAQ,CAAC,cAAe,QAAO;AACvD,SAAO;AACT;AACA,SAAS,oBAAoB,UAAqC,eAAwB;AACxF,MAAI,UAAU,UAAU,SAAS,cAAe,QAAO;AACvD,SAAO;AACT;AAIA,IAAM,OAAO;AACb,IAAM,QAAQ;AACd,IAAM,QAAQ;AACd,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,gBAAgB;AACtB,IAAM,SAAS;", + "names": ["controlValidity", "id", "hasCustomError"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/package.json new file mode 100644 index 0000000000000000000000000000000000000000..778d9484fd5c5552287d4ec56a93aefe23a72b6c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-form/package.json @@ -0,0 +1,73 @@ +{ + "name": "@radix-ui/react-form", + "version": "0.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-label": "2.1.10" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/form" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9045f9090d3d27192249b1019ad3e5607ca710e8 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/README.md @@ -0,0 +1,3 @@ +# `react-hover-card` + +View docs [here](https://radix-ui.com/primitives/docs/components/hover-card). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..242d39a9cde72fa1a09f8f1ec9469183c463e7fc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.d.mts @@ -0,0 +1,79 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; + +declare const createHoverCardScope: _radix_ui_react_context.CreateScope; +interface HoverCardProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?: (open: boolean) => void; + openDelay?: number; + closeDelay?: number; +} +declare const HoverCard: React.FC; +type PrimitiveLinkProps = React.ComponentPropsWithoutRef; +interface HoverCardTriggerProps extends PrimitiveLinkProps { +} +declare const HoverCardTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface HoverCardPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const HoverCardPortal: React.FC; +interface HoverCardContentProps extends HoverCardContentImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const HoverCardContent: React.ForwardRefExoticComponent>; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type PopperContentProps = React.ComponentPropsWithoutRef; +interface HoverCardContentImplProps extends Omit { + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; + /** + * Event handler called when the a `pointerdown` event happens outside of the `HoverCard`. + * Can be prevented. + */ + onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; + /** + * Event handler called when the focus moves outside of the `HoverCard`. + * Can be prevented. + */ + onFocusOutside?: DismissableLayerProps['onFocusOutside']; + /** + * Event handler called when an interaction happens outside the `HoverCard`. + * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. + * Can be prevented. + */ + onInteractOutside?: DismissableLayerProps['onInteractOutside']; +} +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface HoverCardArrowProps extends PopperArrowProps { +} +declare const HoverCardArrow: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; + +export { Arrow, Content, HoverCard, HoverCardArrow, type HoverCardArrowProps, HoverCardContent, type HoverCardContentProps, HoverCardPortal, type HoverCardPortalProps, type HoverCardProps, HoverCardTrigger, type HoverCardTriggerProps, Portal, Root, Trigger, createHoverCardScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..242d39a9cde72fa1a09f8f1ec9469183c463e7fc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.d.ts @@ -0,0 +1,79 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; + +declare const createHoverCardScope: _radix_ui_react_context.CreateScope; +interface HoverCardProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?: (open: boolean) => void; + openDelay?: number; + closeDelay?: number; +} +declare const HoverCard: React.FC; +type PrimitiveLinkProps = React.ComponentPropsWithoutRef; +interface HoverCardTriggerProps extends PrimitiveLinkProps { +} +declare const HoverCardTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface HoverCardPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const HoverCardPortal: React.FC; +interface HoverCardContentProps extends HoverCardContentImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const HoverCardContent: React.ForwardRefExoticComponent>; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type PopperContentProps = React.ComponentPropsWithoutRef; +interface HoverCardContentImplProps extends Omit { + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; + /** + * Event handler called when the a `pointerdown` event happens outside of the `HoverCard`. + * Can be prevented. + */ + onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; + /** + * Event handler called when the focus moves outside of the `HoverCard`. + * Can be prevented. + */ + onFocusOutside?: DismissableLayerProps['onFocusOutside']; + /** + * Event handler called when an interaction happens outside the `HoverCard`. + * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. + * Can be prevented. + */ + onInteractOutside?: DismissableLayerProps['onInteractOutside']; +} +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface HoverCardArrowProps extends PopperArrowProps { +} +declare const HoverCardArrow: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; + +export { Arrow, Content, HoverCard, HoverCardArrow, type HoverCardArrowProps, HoverCardContent, type HoverCardContentProps, HoverCardPortal, type HoverCardPortalProps, type HoverCardProps, HoverCardTrigger, type HoverCardTriggerProps, Portal, Root, Trigger, createHoverCardScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..594bebff0521f5fbc3fbac52411a692226bf53d3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.js @@ -0,0 +1,294 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Arrow: () => Arrow2, + Content: () => Content2, + HoverCard: () => HoverCard, + HoverCardArrow: () => HoverCardArrow, + HoverCardContent: () => HoverCardContent, + HoverCardPortal: () => HoverCardPortal, + HoverCardTrigger: () => HoverCardTrigger, + Portal: () => Portal, + Root: () => Root2, + Trigger: () => Trigger, + createHoverCardScope: () => createHoverCardScope +}); +module.exports = __toCommonJS(index_exports); + +// src/hover-card.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var PopperPrimitive = __toESM(require("@radix-ui/react-popper")); +var import_react_popper = require("@radix-ui/react-popper"); +var import_react_portal = require("@radix-ui/react-portal"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_jsx_runtime = require("react/jsx-runtime"); +var originalBodyUserSelect; +var HOVERCARD_NAME = "HoverCard"; +var [createHoverCardContext, createHoverCardScope] = (0, import_react_context.createContextScope)(HOVERCARD_NAME, [ + import_react_popper.createPopperScope +]); +var usePopperScope = (0, import_react_popper.createPopperScope)(); +var [HoverCardProvider, useHoverCardContext] = createHoverCardContext(HOVERCARD_NAME); +var HoverCard = (props) => { + const { + __scopeHoverCard, + children, + open: openProp, + defaultOpen, + onOpenChange, + openDelay = 700, + closeDelay = 300 + } = props; + const popperScope = usePopperScope(__scopeHoverCard); + const openTimerRef = React.useRef(0); + const closeTimerRef = React.useRef(0); + const hasSelectionRef = React.useRef(false); + const isPointerDownOnContentRef = React.useRef(false); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: HOVERCARD_NAME + }); + const handleOpen = React.useCallback(() => { + clearTimeout(closeTimerRef.current); + openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay); + }, [openDelay, setOpen]); + const handleClose = React.useCallback(() => { + clearTimeout(openTimerRef.current); + if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) { + closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay); + } + }, [closeDelay, setOpen]); + const handleDismiss = React.useCallback(() => setOpen(false), [setOpen]); + React.useEffect(() => { + return () => { + clearTimeout(openTimerRef.current); + clearTimeout(closeTimerRef.current); + }; + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + HoverCardProvider, + { + scope: __scopeHoverCard, + open, + onOpenChange: setOpen, + onOpen: handleOpen, + onClose: handleClose, + onDismiss: handleDismiss, + hasSelectionRef, + isPointerDownOnContentRef, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children }) + } + ); +}; +HoverCard.displayName = HOVERCARD_NAME; +var TRIGGER_NAME = "HoverCardTrigger"; +var HoverCardTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeHoverCard, ...triggerProps } = props; + const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard); + const popperScope = usePopperScope(__scopeHoverCard); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.a, + { + "data-state": context.open ? "open" : "closed", + ...triggerProps, + ref: forwardedRef, + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, excludeTouch(context.onOpen)), + onPointerLeave: (0, import_primitive.composeEventHandlers)(props.onPointerLeave, excludeTouch(context.onClose)), + onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, context.onOpen), + onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, context.onClose), + onTouchStart: (0, import_primitive.composeEventHandlers)(props.onTouchStart, (event) => event.preventDefault()) + } + ) }); + } +); +HoverCardTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "HoverCardPortal"; +var [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME, { + forceMount: void 0 +}); +var HoverCardPortal = (props) => { + const { __scopeHoverCard, forceMount, children, container } = props; + const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeHoverCard, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children }) }) }); +}; +HoverCardPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "HoverCardContent"; +var HoverCardContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + HoverCardContentImpl, + { + "data-state": context.open ? "open" : "closed", + ...contentProps, + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, excludeTouch(context.onOpen)), + onPointerLeave: (0, import_primitive.composeEventHandlers)(props.onPointerLeave, excludeTouch(context.onClose)), + ref: forwardedRef + } + ) }); + } +); +HoverCardContent.displayName = CONTENT_NAME; +var HoverCardContentImpl = React.forwardRef((props, forwardedRef) => { + const { + __scopeHoverCard, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + ...contentProps + } = props; + const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard); + const popperScope = usePopperScope(__scopeHoverCard); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const [containSelection, setContainSelection] = React.useState(false); + React.useEffect(() => { + if (containSelection) { + const body = document.body; + originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect; + body.style.userSelect = "none"; + body.style.webkitUserSelect = "none"; + return () => { + body.style.userSelect = originalBodyUserSelect; + body.style.webkitUserSelect = originalBodyUserSelect; + }; + } + }, [containSelection]); + React.useEffect(() => { + if (ref.current) { + const handlePointerUp = () => { + setContainSelection(false); + context.isPointerDownOnContentRef.current = false; + setTimeout(() => { + const hasSelection = document.getSelection()?.toString() !== ""; + if (hasSelection) context.hasSelectionRef.current = true; + }); + }; + document.addEventListener("pointerup", handlePointerUp); + return () => { + document.removeEventListener("pointerup", handlePointerUp); + context.hasSelectionRef.current = false; + context.isPointerDownOnContentRef.current = false; + }; + } + }, [context.isPointerDownOnContentRef, context.hasSelectionRef]); + React.useEffect(() => { + if (ref.current) { + const tabbables = getTabbableNodes(ref.current); + tabbables.forEach((tabbable) => tabbable.setAttribute("tabindex", "-1")); + } + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents: false, + onInteractOutside, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside: (0, import_primitive.composeEventHandlers)(onFocusOutside, (event) => { + event.preventDefault(); + }), + onDismiss: context.onDismiss, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopperPrimitive.Content, + { + ...popperScope, + ...contentProps, + onPointerDown: (0, import_primitive.composeEventHandlers)(contentProps.onPointerDown, (event) => { + if (event.currentTarget.contains(event.target)) { + setContainSelection(true); + } + context.hasSelectionRef.current = false; + context.isPointerDownOnContentRef.current = true; + }), + ref: composedRefs, + style: { + ...contentProps.style, + userSelect: containSelection ? "text" : void 0, + // Safari requires prefix + WebkitUserSelect: containSelection ? "text" : void 0, + // re-namespace exposed content custom properties + ...{ + "--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-hover-card-content-available-width": "var(--radix-popper-available-width)", + "--radix-hover-card-content-available-height": "var(--radix-popper-available-height)", + "--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ) + } + ); +}); +var ARROW_NAME = "HoverCardArrow"; +var HoverCardArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeHoverCard, ...arrowProps } = props; + const popperScope = usePopperScope(__scopeHoverCard); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); + } +); +HoverCardArrow.displayName = ARROW_NAME; +function excludeTouch(eventHandler) { + return (event) => event.pointerType === "touch" ? void 0 : eventHandler(); +} +function getTabbableNodes(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +var Root2 = HoverCard; +var Trigger = HoverCardTrigger; +var Portal = HoverCardPortal; +var Content2 = HoverCardContent; +var Arrow2 = HoverCardArrow; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2da1165b1d8a151ce7e39f60ae5af4b2a5b96adc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/hover-card.tsx"], + "sourcesContent": ["'use client';\nexport {\n createHoverCardScope,\n //\n HoverCard,\n HoverCardTrigger,\n HoverCardPortal,\n HoverCardContent,\n HoverCardArrow,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n} from './hover-card';\nexport type {\n HoverCardProps,\n HoverCardTriggerProps,\n HoverCardPortalProps,\n HoverCardContentProps,\n HoverCardArrowProps,\n} from './hover-card';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCard\n * -----------------------------------------------------------------------------------------------*/\n\nlet originalBodyUserSelect: string;\n\nconst HOVERCARD_NAME = 'HoverCard';\n\ntype ScopedProps

= P & { __scopeHoverCard?: Scope };\nconst [createHoverCardContext, createHoverCardScope] = createContextScope(HOVERCARD_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype HoverCardContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpen(): void;\n onClose(): void;\n onDismiss(): void;\n hasSelectionRef: React.MutableRefObject;\n isPointerDownOnContentRef: React.MutableRefObject;\n};\n\nconst [HoverCardProvider, useHoverCardContext] =\n createHoverCardContext(HOVERCARD_NAME);\n\ninterface HoverCardProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openDelay?: number;\n closeDelay?: number;\n}\n\nconst HoverCard: React.FC = (props: ScopedProps) => {\n const {\n __scopeHoverCard,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n openDelay = 700,\n closeDelay = 300,\n } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const hasSelectionRef = React.useRef(false);\n const isPointerDownOnContentRef = React.useRef(false);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: HOVERCARD_NAME,\n });\n\n const handleOpen = React.useCallback(() => {\n clearTimeout(closeTimerRef.current);\n openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay);\n }, [openDelay, setOpen]);\n\n const handleClose = React.useCallback(() => {\n clearTimeout(openTimerRef.current);\n if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) {\n closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay);\n }\n }, [closeDelay, setOpen]);\n\n const handleDismiss = React.useCallback(() => setOpen(false), [setOpen]);\n\n // cleanup any queued state updates on unmount\n React.useEffect(() => {\n return () => {\n clearTimeout(openTimerRef.current);\n clearTimeout(closeTimerRef.current);\n };\n }, []);\n\n return (\n \n {children}\n \n );\n};\n\nHoverCard.displayName = HOVERCARD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'HoverCardTrigger';\n\ntype HoverCardTriggerElement = React.ComponentRef;\ntype PrimitiveLinkProps = React.ComponentPropsWithoutRef;\ninterface HoverCardTriggerProps extends PrimitiveLinkProps {}\n\nconst HoverCardTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeHoverCard, ...triggerProps } = props;\n const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n return (\n \n event.preventDefault())}\n />\n \n );\n },\n);\n\nHoverCardTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'HoverCardPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface HoverCardPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst HoverCardPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeHoverCard, forceMount, children, container } = props;\n const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard);\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nHoverCardPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'HoverCardContent';\n\ntype HoverCardContentElement = HoverCardContentImplElement;\ninterface HoverCardContentProps extends HoverCardContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst HoverCardContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard);\n return (\n \n \n \n );\n },\n);\n\nHoverCardContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype HoverCardContentImplElement = React.ComponentRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ninterface HoverCardContentImplProps extends Omit {\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `HoverCard`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n /**\n * Event handler called when the focus moves outside of the `HoverCard`.\n * Can be prevented.\n */\n onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n /**\n * Event handler called when an interaction happens outside the `HoverCard`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst HoverCardContentImpl = React.forwardRef<\n HoverCardContentImplElement,\n HoverCardContentImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeHoverCard,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [containSelection, setContainSelection] = React.useState(false);\n\n React.useEffect(() => {\n if (containSelection) {\n const body = document.body;\n\n // Safari requires prefix\n originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;\n\n body.style.userSelect = 'none';\n body.style.webkitUserSelect = 'none';\n return () => {\n body.style.userSelect = originalBodyUserSelect;\n body.style.webkitUserSelect = originalBodyUserSelect;\n };\n }\n }, [containSelection]);\n\n React.useEffect(() => {\n if (ref.current) {\n const handlePointerUp = () => {\n setContainSelection(false);\n context.isPointerDownOnContentRef.current = false;\n\n // Delay a frame to ensure we always access the latest selection\n setTimeout(() => {\n const hasSelection = document.getSelection()?.toString() !== '';\n if (hasSelection) context.hasSelectionRef.current = true;\n });\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n context.hasSelectionRef.current = false;\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n context.isPointerDownOnContentRef.current = false;\n };\n }\n }, [context.isPointerDownOnContentRef, context.hasSelectionRef]);\n\n React.useEffect(() => {\n if (ref.current) {\n const tabbables = getTabbableNodes(ref.current);\n tabbables.forEach((tabbable) => tabbable.setAttribute('tabindex', '-1'));\n }\n });\n\n return (\n {\n event.preventDefault();\n })}\n onDismiss={context.onDismiss}\n >\n {\n // Contain selection to current layer\n if (event.currentTarget.contains(event.target as HTMLElement)) {\n setContainSelection(true);\n }\n context.hasSelectionRef.current = false;\n context.isPointerDownOnContentRef.current = true;\n })}\n ref={composedRefs}\n style={{\n ...contentProps.style,\n userSelect: containSelection ? 'text' : undefined,\n // Safari requires prefix\n WebkitUserSelect: containSelection ? 'text' : undefined,\n // re-namespace exposed content custom properties\n ...{\n '--radix-hover-card-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-hover-card-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-hover-card-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-hover-card-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-hover-card-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'HoverCardArrow';\n\ntype HoverCardArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface HoverCardArrowProps extends PopperArrowProps {}\n\nconst HoverCardArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeHoverCard, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n return ;\n },\n);\n\nHoverCardArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction excludeTouch(eventHandler: () => void) {\n return (event: React.PointerEvent) =>\n event.pointerType === 'touch' ? undefined : eventHandler();\n}\n\n/**\n * Returns a list of nodes that can be in the tab sequence.\n * @see: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n */\nfunction getTabbableNodes(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n return nodes;\n}\n\nconst Root = HoverCard;\nconst Trigger = HoverCardTrigger;\nconst Portal = HoverCardPortal;\nconst Content = HoverCardContent;\nconst Arrow = HoverCardArrow;\n\nexport {\n createHoverCardScope,\n //\n HoverCard,\n HoverCardTrigger,\n HoverCardPortal,\n HoverCardContent,\n HoverCardArrow,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n};\nexport type {\n HoverCardProps,\n HoverCardTriggerProps,\n HoverCardPortalProps,\n HoverCardContentProps,\n HoverCardArrowProps,\n};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AAAA,IAC3E,YAAY,CAAC,SAAc;AAIzB,aAAO,KAAK,YAAY,IAAI,WAAW,gBAAgB,WAAW;AAAA,IACpE;AAAA,EACF,CAAC;AACD,SAAO,OAAO,SAAS,EAAG,OAAM,KAAK,OAAO,WAA0B;AACtE,SAAO;AACT;AAEA,IAAMC,QAAO;AACb,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;", + "names": ["Arrow", "Content", "Root", "PortalPrimitive", "Root", "Content", "Arrow"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..94fae527ca03dcf51f3047be555545ac016072ab --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.mjs @@ -0,0 +1,262 @@ +"use client"; + +// src/hover-card.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { createContextScope } from "@radix-ui/react-context"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import * as PopperPrimitive from "@radix-ui/react-popper"; +import { createPopperScope } from "@radix-ui/react-popper"; +import { Portal as PortalPrimitive } from "@radix-ui/react-portal"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive } from "@radix-ui/react-primitive"; +import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; +import { jsx } from "react/jsx-runtime"; +var originalBodyUserSelect; +var HOVERCARD_NAME = "HoverCard"; +var [createHoverCardContext, createHoverCardScope] = createContextScope(HOVERCARD_NAME, [ + createPopperScope +]); +var usePopperScope = createPopperScope(); +var [HoverCardProvider, useHoverCardContext] = createHoverCardContext(HOVERCARD_NAME); +var HoverCard = (props) => { + const { + __scopeHoverCard, + children, + open: openProp, + defaultOpen, + onOpenChange, + openDelay = 700, + closeDelay = 300 + } = props; + const popperScope = usePopperScope(__scopeHoverCard); + const openTimerRef = React.useRef(0); + const closeTimerRef = React.useRef(0); + const hasSelectionRef = React.useRef(false); + const isPointerDownOnContentRef = React.useRef(false); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: HOVERCARD_NAME + }); + const handleOpen = React.useCallback(() => { + clearTimeout(closeTimerRef.current); + openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay); + }, [openDelay, setOpen]); + const handleClose = React.useCallback(() => { + clearTimeout(openTimerRef.current); + if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) { + closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay); + } + }, [closeDelay, setOpen]); + const handleDismiss = React.useCallback(() => setOpen(false), [setOpen]); + React.useEffect(() => { + return () => { + clearTimeout(openTimerRef.current); + clearTimeout(closeTimerRef.current); + }; + }, []); + return /* @__PURE__ */ jsx( + HoverCardProvider, + { + scope: __scopeHoverCard, + open, + onOpenChange: setOpen, + onOpen: handleOpen, + onClose: handleClose, + onDismiss: handleDismiss, + hasSelectionRef, + isPointerDownOnContentRef, + children: /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children }) + } + ); +}; +HoverCard.displayName = HOVERCARD_NAME; +var TRIGGER_NAME = "HoverCardTrigger"; +var HoverCardTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeHoverCard, ...triggerProps } = props; + const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard); + const popperScope = usePopperScope(__scopeHoverCard); + return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx( + Primitive.a, + { + "data-state": context.open ? "open" : "closed", + ...triggerProps, + ref: forwardedRef, + onPointerEnter: composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)), + onPointerLeave: composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)), + onFocus: composeEventHandlers(props.onFocus, context.onOpen), + onBlur: composeEventHandlers(props.onBlur, context.onClose), + onTouchStart: composeEventHandlers(props.onTouchStart, (event) => event.preventDefault()) + } + ) }); + } +); +HoverCardTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "HoverCardPortal"; +var [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME, { + forceMount: void 0 +}); +var HoverCardPortal = (props) => { + const { __scopeHoverCard, forceMount, children, container } = props; + const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard); + return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeHoverCard, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) }); +}; +HoverCardPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "HoverCardContent"; +var HoverCardContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx( + HoverCardContentImpl, + { + "data-state": context.open ? "open" : "closed", + ...contentProps, + onPointerEnter: composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)), + onPointerLeave: composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)), + ref: forwardedRef + } + ) }); + } +); +HoverCardContent.displayName = CONTENT_NAME; +var HoverCardContentImpl = React.forwardRef((props, forwardedRef) => { + const { + __scopeHoverCard, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + ...contentProps + } = props; + const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard); + const popperScope = usePopperScope(__scopeHoverCard); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + const [containSelection, setContainSelection] = React.useState(false); + React.useEffect(() => { + if (containSelection) { + const body = document.body; + originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect; + body.style.userSelect = "none"; + body.style.webkitUserSelect = "none"; + return () => { + body.style.userSelect = originalBodyUserSelect; + body.style.webkitUserSelect = originalBodyUserSelect; + }; + } + }, [containSelection]); + React.useEffect(() => { + if (ref.current) { + const handlePointerUp = () => { + setContainSelection(false); + context.isPointerDownOnContentRef.current = false; + setTimeout(() => { + const hasSelection = document.getSelection()?.toString() !== ""; + if (hasSelection) context.hasSelectionRef.current = true; + }); + }; + document.addEventListener("pointerup", handlePointerUp); + return () => { + document.removeEventListener("pointerup", handlePointerUp); + context.hasSelectionRef.current = false; + context.isPointerDownOnContentRef.current = false; + }; + } + }, [context.isPointerDownOnContentRef, context.hasSelectionRef]); + React.useEffect(() => { + if (ref.current) { + const tabbables = getTabbableNodes(ref.current); + tabbables.forEach((tabbable) => tabbable.setAttribute("tabindex", "-1")); + } + }); + return /* @__PURE__ */ jsx( + DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents: false, + onInteractOutside, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside: composeEventHandlers(onFocusOutside, (event) => { + event.preventDefault(); + }), + onDismiss: context.onDismiss, + children: /* @__PURE__ */ jsx( + PopperPrimitive.Content, + { + ...popperScope, + ...contentProps, + onPointerDown: composeEventHandlers(contentProps.onPointerDown, (event) => { + if (event.currentTarget.contains(event.target)) { + setContainSelection(true); + } + context.hasSelectionRef.current = false; + context.isPointerDownOnContentRef.current = true; + }), + ref: composedRefs, + style: { + ...contentProps.style, + userSelect: containSelection ? "text" : void 0, + // Safari requires prefix + WebkitUserSelect: containSelection ? "text" : void 0, + // re-namespace exposed content custom properties + ...{ + "--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-hover-card-content-available-width": "var(--radix-popper-available-width)", + "--radix-hover-card-content-available-height": "var(--radix-popper-available-height)", + "--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ) + } + ); +}); +var ARROW_NAME = "HoverCardArrow"; +var HoverCardArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeHoverCard, ...arrowProps } = props; + const popperScope = usePopperScope(__scopeHoverCard); + return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); + } +); +HoverCardArrow.displayName = ARROW_NAME; +function excludeTouch(eventHandler) { + return (event) => event.pointerType === "touch" ? void 0 : eventHandler(); +} +function getTabbableNodes(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +var Root2 = HoverCard; +var Trigger = HoverCardTrigger; +var Portal = HoverCardPortal; +var Content2 = HoverCardContent; +var Arrow2 = HoverCardArrow; +export { + Arrow2 as Arrow, + Content2 as Content, + HoverCard, + HoverCardArrow, + HoverCardContent, + HoverCardPortal, + HoverCardTrigger, + Portal, + Root2 as Root, + Trigger, + createHoverCardScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..535bb8f09e2b39b54eccaaffecee3b58b1d73903 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/hover-card.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCard\n * -----------------------------------------------------------------------------------------------*/\n\nlet originalBodyUserSelect: string;\n\nconst HOVERCARD_NAME = 'HoverCard';\n\ntype ScopedProps

= P & { __scopeHoverCard?: Scope };\nconst [createHoverCardContext, createHoverCardScope] = createContextScope(HOVERCARD_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype HoverCardContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpen(): void;\n onClose(): void;\n onDismiss(): void;\n hasSelectionRef: React.MutableRefObject;\n isPointerDownOnContentRef: React.MutableRefObject;\n};\n\nconst [HoverCardProvider, useHoverCardContext] =\n createHoverCardContext(HOVERCARD_NAME);\n\ninterface HoverCardProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openDelay?: number;\n closeDelay?: number;\n}\n\nconst HoverCard: React.FC = (props: ScopedProps) => {\n const {\n __scopeHoverCard,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n openDelay = 700,\n closeDelay = 300,\n } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const hasSelectionRef = React.useRef(false);\n const isPointerDownOnContentRef = React.useRef(false);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: HOVERCARD_NAME,\n });\n\n const handleOpen = React.useCallback(() => {\n clearTimeout(closeTimerRef.current);\n openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay);\n }, [openDelay, setOpen]);\n\n const handleClose = React.useCallback(() => {\n clearTimeout(openTimerRef.current);\n if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) {\n closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay);\n }\n }, [closeDelay, setOpen]);\n\n const handleDismiss = React.useCallback(() => setOpen(false), [setOpen]);\n\n // cleanup any queued state updates on unmount\n React.useEffect(() => {\n return () => {\n clearTimeout(openTimerRef.current);\n clearTimeout(closeTimerRef.current);\n };\n }, []);\n\n return (\n \n {children}\n \n );\n};\n\nHoverCard.displayName = HOVERCARD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'HoverCardTrigger';\n\ntype HoverCardTriggerElement = React.ComponentRef;\ntype PrimitiveLinkProps = React.ComponentPropsWithoutRef;\ninterface HoverCardTriggerProps extends PrimitiveLinkProps {}\n\nconst HoverCardTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeHoverCard, ...triggerProps } = props;\n const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n return (\n \n event.preventDefault())}\n />\n \n );\n },\n);\n\nHoverCardTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'HoverCardPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface HoverCardPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst HoverCardPortal: React.FC = (\n props: ScopedProps,\n) => {\n const { __scopeHoverCard, forceMount, children, container } = props;\n const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard);\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nHoverCardPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'HoverCardContent';\n\ntype HoverCardContentElement = HoverCardContentImplElement;\ninterface HoverCardContentProps extends HoverCardContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst HoverCardContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard);\n return (\n \n \n \n );\n },\n);\n\nHoverCardContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype HoverCardContentImplElement = React.ComponentRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ninterface HoverCardContentImplProps extends Omit {\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `HoverCard`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n /**\n * Event handler called when the focus moves outside of the `HoverCard`.\n * Can be prevented.\n */\n onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n /**\n * Event handler called when an interaction happens outside the `HoverCard`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst HoverCardContentImpl = React.forwardRef<\n HoverCardContentImplElement,\n HoverCardContentImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeHoverCard,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [containSelection, setContainSelection] = React.useState(false);\n\n React.useEffect(() => {\n if (containSelection) {\n const body = document.body;\n\n // Safari requires prefix\n originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;\n\n body.style.userSelect = 'none';\n body.style.webkitUserSelect = 'none';\n return () => {\n body.style.userSelect = originalBodyUserSelect;\n body.style.webkitUserSelect = originalBodyUserSelect;\n };\n }\n }, [containSelection]);\n\n React.useEffect(() => {\n if (ref.current) {\n const handlePointerUp = () => {\n setContainSelection(false);\n context.isPointerDownOnContentRef.current = false;\n\n // Delay a frame to ensure we always access the latest selection\n setTimeout(() => {\n const hasSelection = document.getSelection()?.toString() !== '';\n if (hasSelection) context.hasSelectionRef.current = true;\n });\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n context.hasSelectionRef.current = false;\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n context.isPointerDownOnContentRef.current = false;\n };\n }\n }, [context.isPointerDownOnContentRef, context.hasSelectionRef]);\n\n React.useEffect(() => {\n if (ref.current) {\n const tabbables = getTabbableNodes(ref.current);\n tabbables.forEach((tabbable) => tabbable.setAttribute('tabindex', '-1'));\n }\n });\n\n return (\n {\n event.preventDefault();\n })}\n onDismiss={context.onDismiss}\n >\n {\n // Contain selection to current layer\n if (event.currentTarget.contains(event.target as HTMLElement)) {\n setContainSelection(true);\n }\n context.hasSelectionRef.current = false;\n context.isPointerDownOnContentRef.current = true;\n })}\n ref={composedRefs}\n style={{\n ...contentProps.style,\n userSelect: containSelection ? 'text' : undefined,\n // Safari requires prefix\n WebkitUserSelect: containSelection ? 'text' : undefined,\n // re-namespace exposed content custom properties\n ...{\n '--radix-hover-card-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-hover-card-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-hover-card-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-hover-card-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-hover-card-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'HoverCardArrow';\n\ntype HoverCardArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface HoverCardArrowProps extends PopperArrowProps {}\n\nconst HoverCardArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeHoverCard, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n return ;\n },\n);\n\nHoverCardArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction excludeTouch(eventHandler: () => void) {\n return (event: React.PointerEvent) =>\n event.pointerType === 'touch' ? undefined : eventHandler();\n}\n\n/**\n * Returns a list of nodes that can be in the tab sequence.\n * @see: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n */\nfunction getTabbableNodes(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n return nodes;\n}\n\nconst Root = HoverCard;\nconst Trigger = HoverCardTrigger;\nconst Portal = HoverCardPortal;\nconst Content = HoverCardContent;\nconst Arrow = HoverCardArrow;\n\nexport {\n createHoverCardScope,\n //\n HoverCard,\n HoverCardTrigger,\n HoverCardPortal,\n HoverCardContent,\n HoverCardArrow,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n};\nexport type {\n HoverCardProps,\n HoverCardTriggerProps,\n HoverCardPortalProps,\n HoverCardContentProps,\n HoverCardArrowProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAgG3B;AAxFN,IAAI;AAEJ,IAAM,iBAAiB;AAGvB,IAAM,CAAC,wBAAwB,oBAAoB,IAAI,mBAAmB,gBAAgB;AAAA,EACxF;AACF,CAAC;AACD,IAAM,iBAAiB,kBAAkB;AAYzC,IAAM,CAAC,mBAAmB,mBAAmB,IAC3C,uBAA8C,cAAc;AAW9D,IAAM,YAAsC,CAAC,UAAuC;AAClF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,EACf,IAAI;AACJ,QAAM,cAAc,eAAe,gBAAgB;AACnD,QAAM,eAAqB,aAAO,CAAC;AACnC,QAAM,gBAAsB,aAAO,CAAC;AACpC,QAAM,kBAAwB,aAAO,KAAK;AAC1C,QAAM,4BAAkC,aAAO,KAAK;AAEpD,QAAM,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAAA,IAC3C,MAAM;AAAA,IACN,aAAa,eAAe;AAAA,IAC5B,UAAU;AAAA,IACV,QAAQ;AAAA,EACV,CAAC;AAED,QAAM,aAAmB,kBAAY,MAAM;AACzC,iBAAa,cAAc,OAAO;AAClC,iBAAa,UAAU,O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aAAa;AAC7D;AAMA,SAAS,iBAAiB,WAAwB;AAChD,QAAM,QAAuB,CAAC;AAC9B,QAAM,SAAS,SAAS,iBAAiB,WAAW,WAAW,cAAc;AAAA,IAC3E,YAAY,CAAC,SAAc;AAIzB,aAAO,KAAK,YAAY,IAAI,WAAW,gBAAgB,WAAW;AAAA,IACpE;AAAA,EACF,CAAC;AACD,SAAO,OAAO,SAAS,EAAG,OAAM,KAAK,OAAO,WAA0B;AACtE,SAAO;AACT;AAEA,IAAMA,QAAO;AACb,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;", + "names": ["Root", "Content", "Arrow"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/package.json new file mode 100644 index 0000000000000000000000000000000000000000..38c3589a315bf60e5e4af96bac4bc31d79655e18 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-hover-card/package.json @@ -0,0 +1,76 @@ +{ + "name": "@radix-ui/react-hover-card", + "version": "1.1.17", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-context": "1.1.4", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-popper": "1.3.1", + "@radix-ui/react-portal": "1.1.12", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-dismissable-layer": "1.1.13", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-controllable-state": "1.2.3" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/hover-card" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b4b5cfbd4cfd2a1b93ee7ee12064176b200ead30 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/README.md @@ -0,0 +1,3 @@ +# `react-id` + +View docs [here](https://radix-ui.com/primitives/docs/utilities/id-provider). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..411b3336d2b8894d6fc67a27b47f5488f7bacd13 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.d.mts @@ -0,0 +1,3 @@ +declare function useId(deterministicId?: string): string; + +export { useId }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..411b3336d2b8894d6fc67a27b47f5488f7bacd13 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.d.ts @@ -0,0 +1,3 @@ +declare function useId(deterministicId?: string): string; + +export { useId }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cba72ecc556b95c78b77df19d05f2b80b5c3eccc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.js @@ -0,0 +1,49 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + useId: () => useId +}); +module.exports = __toCommonJS(index_exports); + +// src/id.tsx +var React = __toESM(require("react")); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var useReactId = React[" useId ".trim().toString()] || (() => void 0); +var count = 0; +function useId(deterministicId) { + const [id, setId] = React.useState(useReactId()); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (!deterministicId) setId((reactId) => reactId ?? String(count++)); + }, [deterministicId]); + return deterministicId || (id ? `radix-${id}` : ""); +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..6cc584993944a77e0135a8b21f748ef0e4507222 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/id.tsx"], + "sourcesContent": ["export { useId } from './id';\n", "import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// We spaces with `.trim().toString()` to prevent bundlers from trying to `import { useId } from 'react';`\nconst useReactId = (React as any)[' useId '.trim().toString()] || (() => undefined);\nlet count = 0;\n\nfunction useId(deterministicId?: string): string {\n const [id, setId] = React.useState(useReactId());\n // React versions older than 18 will have client-side ids only.\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\nexport { useId };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,qCAAgC;AAGhC,IAAM,aAAc,MAAc,UAAU,KAAK,EAAE,SAAS,CAAC,MAAM,MAAM;AACzE,IAAI,QAAQ;AAEZ,SAAS,MAAM,iBAAkC;AAC/C,QAAM,CAAC,IAAI,KAAK,IAAU,eAA6B,WAAW,CAAC;AAEnE,sDAAgB,MAAM;AACpB,QAAI,CAAC,gBAAiB,OAAM,CAAC,YAAY,WAAW,OAAO,OAAO,CAAC;AAAA,EACrE,GAAG,CAAC,eAAe,CAAC;AACpB,SAAO,oBAAoB,KAAK,SAAS,EAAE,KAAK;AAClD;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..439ac06c85c679a5920f47ff09045e166fe801ab --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.mjs @@ -0,0 +1,16 @@ +// src/id.tsx +import * as React from "react"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; +var useReactId = React[" useId ".trim().toString()] || (() => void 0); +var count = 0; +function useId(deterministicId) { + const [id, setId] = React.useState(useReactId()); + useLayoutEffect(() => { + if (!deterministicId) setId((reactId) => reactId ?? String(count++)); + }, [deterministicId]); + return deterministicId || (id ? `radix-${id}` : ""); +} +export { + useId +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..42b7e1f6c7c96f980b08be6670460a347fa117e4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/id.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// We spaces with `.trim().toString()` to prevent bundlers from trying to `import { useId } from 'react';`\nconst useReactId = (React as any)[' useId '.trim().toString()] || (() => undefined);\nlet count = 0;\n\nfunction useId(deterministicId?: string): string {\n const [id, setId] = React.useState(useReactId());\n // React versions older than 18 will have client-side ids only.\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\nexport { useId };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAGhC,IAAM,aAAc,MAAc,UAAU,KAAK,EAAE,SAAS,CAAC,MAAM,MAAM;AACzE,IAAI,QAAQ;AAEZ,SAAS,MAAM,iBAAkC;AAC/C,QAAM,CAAC,IAAI,KAAK,IAAU,eAA6B,WAAW,CAAC;AAEnE,kBAAgB,MAAM;AACpB,QAAI,CAAC,gBAAiB,OAAM,CAAC,YAAY,WAAW,OAAO,OAAO,CAAC;AAAA,EACrE,GAAG,CAAC,eAAe,CAAC;AACpB,SAAO,oBAAoB,KAAK,SAAS,EAAE,KAAK;AAClD;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f9367e553852f7403c821a5af8ac3c77ae6f4576 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-id/package.json @@ -0,0 +1,63 @@ +{ + "name": "@radix-ui/react-id", + "version": "1.1.2", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/id" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/README.md new file mode 100644 index 0000000000000000000000000000000000000000..939fd9151edd673c3ff5f3beb40f68576e3e38a4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/README.md @@ -0,0 +1,3 @@ +# `react-label` + +View docs [here](https://radix-ui.com/primitives/docs/utilities/label). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b37e26cf74939d3029689b0dc74d85e0100b0717 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.d.mts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveLabelProps = React.ComponentPropsWithoutRef; +interface LabelProps extends PrimitiveLabelProps { +} +declare const Label: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { Label, type LabelProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b37e26cf74939d3029689b0dc74d85e0100b0717 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveLabelProps = React.ComponentPropsWithoutRef; +interface LabelProps extends PrimitiveLabelProps { +} +declare const Label: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { Label, type LabelProps, Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0bfc39b61b43c628141fed8cf7349b7d1fac29ef --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.js @@ -0,0 +1,61 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Label: () => Label, + Root: () => Root +}); +module.exports = __toCommonJS(index_exports); + +// src/label.tsx +var React = __toESM(require("react")); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var NAME = "Label"; +var Label = React.forwardRef((props, forwardedRef) => { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.label, + { + ...props, + ref: forwardedRef, + onMouseDown: (event) => { + const target = event.target; + if (target.closest("button, input, select, textarea")) return; + props.onMouseDown?.(event); + if (!event.defaultPrevented && event.detail > 1) event.preventDefault(); + } + } + ); +}); +Label.displayName = NAME; +var Root = Label; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b3ff8dadd28b2de86892d1052b904e2fee79aad3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/label.tsx"], + "sourcesContent": ["'use client';\nexport {\n Label,\n //\n Root,\n} from './label';\nexport type { LabelProps } from './label';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Label\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Label';\n\ntype LabelElement = React.ComponentRef;\ntype PrimitiveLabelProps = React.ComponentPropsWithoutRef;\ninterface LabelProps extends PrimitiveLabelProps {}\n\nconst Label = React.forwardRef((props, forwardedRef) => {\n return (\n {\n // only prevent text selection if clicking inside the label itself\n const target = event.target as HTMLElement;\n if (target.closest('button, input, select, textarea')) return;\n\n props.onMouseDown?.(event);\n // prevent text selection when double clicking label\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }}\n />\n );\n});\n\nLabel.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Label;\n\nexport {\n Label,\n //\n Root,\n};\nexport type { LabelProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AActB;AARJ,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,aAAa,CAAC,UAAU;AAEtB,cAAM,SAAS,MAAM;AACrB,YAAI,OAAO,QAAQ,iCAAiC,EAAG;AAEvD,cAAM,cAAc,KAAK;AAEzB,YAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,EAAG,OAAM,eAAe;AAAA,MACxE;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e346c4e7d0136be56178baa884ff160f58a4a8e9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.mjs @@ -0,0 +1,29 @@ +"use client"; + +// src/label.tsx +import * as React from "react"; +import { Primitive } from "@radix-ui/react-primitive"; +import { jsx } from "react/jsx-runtime"; +var NAME = "Label"; +var Label = React.forwardRef((props, forwardedRef) => { + return /* @__PURE__ */ jsx( + Primitive.label, + { + ...props, + ref: forwardedRef, + onMouseDown: (event) => { + const target = event.target; + if (target.closest("button, input, select, textarea")) return; + props.onMouseDown?.(event); + if (!event.defaultPrevented && event.detail > 1) event.preventDefault(); + } + } + ); +}); +Label.displayName = NAME; +var Root = Label; +export { + Label, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..705d34925588c0b11d8330043f0577dbd1114167 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/label.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Label\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Label';\n\ntype LabelElement = React.ComponentRef;\ntype PrimitiveLabelProps = React.ComponentPropsWithoutRef;\ninterface LabelProps extends PrimitiveLabelProps {}\n\nconst Label = React.forwardRef((props, forwardedRef) => {\n return (\n {\n // only prevent text selection if clicking inside the label itself\n const target = event.target as HTMLElement;\n if (target.closest('button, input, select, textarea')) return;\n\n props.onMouseDown?.(event);\n // prevent text selection when double clicking label\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }}\n />\n );\n});\n\nLabel.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Label;\n\nexport {\n Label,\n //\n Root,\n};\nexport type { LabelProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AActB;AARJ,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,aAAa,CAAC,UAAU;AAEtB,cAAM,SAAS,MAAM;AACrB,YAAI,OAAO,QAAQ,iCAAiC,EAAG;AAEvD,cAAM,cAAc,KAAK;AAEzB,YAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,EAAG,OAAM,eAAe;AAAA,MACxE;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/package.json new file mode 100644 index 0000000000000000000000000000000000000000..87d90f7daa0bb2af30c14beeb44a4eddaff6c457 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-label/package.json @@ -0,0 +1,68 @@ +{ + "name": "@radix-ui/react-label", + "version": "2.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-primitive": "2.1.6" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/label" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9b13105179be45b0a4402f3bc231fa89836bbeb1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/README.md @@ -0,0 +1,3 @@ +# `react-menu` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..17fe602502883f456c04247dd56b285c81a16e99 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.d.mts @@ -0,0 +1,175 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; + +type Direction = 'ltr' | 'rtl'; +declare const createMenuScope: _radix_ui_react_context.CreateScope; +interface MenuProps { + children?: React.ReactNode; + open?: boolean; + onOpenChange?(open: boolean): void; + dir?: Direction; + modal?: boolean; +} +declare const Menu: React.FC; +type PopperAnchorProps = React.ComponentPropsWithoutRef; +interface MenuAnchorProps extends PopperAnchorProps { +} +declare const MenuAnchor: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface MenuPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const MenuPortal: React.FC; +/** + * We purposefully don't union MenuRootContent and MenuSubContent props here because + * they have conflicting prop types. We agreed that we would allow MenuSubContent to + * accept props that it would just ignore. + */ +interface MenuContentProps extends MenuRootContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const MenuContent: React.ForwardRefExoticComponent>; +interface MenuRootContentTypeProps extends Omit { +} +type FocusScopeProps = React.ComponentPropsWithoutRef; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type RovingFocusGroupProps = React.ComponentPropsWithoutRef; +type PopperContentProps = React.ComponentPropsWithoutRef; +type MenuContentImplPrivateProps = { + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + onDismiss?: DismissableLayerProps['onDismiss']; + disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents']; + /** + * Whether scrolling outside the `MenuContent` should be prevented + * (default: `false`) + */ + disableOutsideScroll?: boolean; + /** + * Whether focus should be trapped within the `MenuContent` + * (default: false) + */ + trapFocus?: FocusScopeProps['trapped']; +}; +interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit { + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; + /** + * Whether keyboard navigation should loop around + * @defaultValue false + */ + loop?: RovingFocusGroupProps['loop']; + onEntryFocus?: RovingFocusGroupProps['onEntryFocus']; + onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; + onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; + onFocusOutside?: DismissableLayerProps['onFocusOutside']; + onInteractOutside?: DismissableLayerProps['onInteractOutside']; +} +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface MenuGroupProps extends PrimitiveDivProps { +} +declare const MenuGroup: React.ForwardRefExoticComponent>; +interface MenuLabelProps extends PrimitiveDivProps { +} +declare const MenuLabel: React.ForwardRefExoticComponent>; +interface MenuItemProps extends Omit { + onSelect?: (event: Event) => void; +} +declare const MenuItem: React.ForwardRefExoticComponent>; +interface MenuItemImplProps extends PrimitiveDivProps { + disabled?: boolean; + textValue?: string; +} +type CheckedState = boolean | 'indeterminate'; +interface MenuCheckboxItemProps extends MenuItemProps { + checked?: CheckedState; + onCheckedChange?: (checked: boolean) => void; +} +declare const MenuCheckboxItem: React.ForwardRefExoticComponent>; +interface MenuRadioGroupProps extends MenuGroupProps { + value?: string; + onValueChange?: (value: string) => void; +} +declare const MenuRadioGroup: React.ForwardRefExoticComponent>; +interface MenuRadioItemProps extends MenuItemProps { + value: string; +} +declare const MenuRadioItem: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface MenuItemIndicatorProps extends PrimitiveSpanProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const MenuItemIndicator: React.ForwardRefExoticComponent>; +interface MenuSeparatorProps extends PrimitiveDivProps { +} +declare const MenuSeparator: React.ForwardRefExoticComponent>; +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface MenuArrowProps extends PopperArrowProps { +} +declare const MenuArrow: React.ForwardRefExoticComponent>; +interface MenuSubProps { + children?: React.ReactNode; + open?: boolean; + onOpenChange?(open: boolean): void; +} +declare const MenuSub: React.FC; +interface MenuSubTriggerProps extends MenuItemImplProps { +} +declare const MenuSubTrigger: React.ForwardRefExoticComponent>; +type AlignSubContent = Exclude<(typeof PopperPrimitive.ALIGN_OPTIONS)[number], 'center'>; +interface MenuSubContentProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; + /** + * Controls the direction the subcontent appears from its anchor menu item + * Default: start + */ + align?: AlignSubContent; +} +declare const MenuSubContent: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Anchor: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Group: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const CheckboxItem: React.ForwardRefExoticComponent>; +declare const RadioGroup: React.ForwardRefExoticComponent>; +declare const RadioItem: React.ForwardRefExoticComponent>; +declare const ItemIndicator: React.ForwardRefExoticComponent>; +declare const Separator: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Sub: React.FC; +declare const SubTrigger: React.ForwardRefExoticComponent>; +declare const SubContent: React.ForwardRefExoticComponent>; + +export { Anchor, Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, MenuAnchor, type MenuAnchorProps, MenuArrow, type MenuArrowProps, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, type MenuGroupProps, MenuItem, MenuItemIndicator, type MenuItemIndicatorProps, type MenuItemProps, MenuLabel, type MenuLabelProps, MenuPortal, type MenuPortalProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuSub, MenuSubContent, type MenuSubContentProps, type MenuSubProps, MenuSubTrigger, type MenuSubTriggerProps, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, createMenuScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..17fe602502883f456c04247dd56b285c81a16e99 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.d.ts @@ -0,0 +1,175 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; + +type Direction = 'ltr' | 'rtl'; +declare const createMenuScope: _radix_ui_react_context.CreateScope; +interface MenuProps { + children?: React.ReactNode; + open?: boolean; + onOpenChange?(open: boolean): void; + dir?: Direction; + modal?: boolean; +} +declare const Menu: React.FC; +type PopperAnchorProps = React.ComponentPropsWithoutRef; +interface MenuAnchorProps extends PopperAnchorProps { +} +declare const MenuAnchor: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface MenuPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const MenuPortal: React.FC; +/** + * We purposefully don't union MenuRootContent and MenuSubContent props here because + * they have conflicting prop types. We agreed that we would allow MenuSubContent to + * accept props that it would just ignore. + */ +interface MenuContentProps extends MenuRootContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const MenuContent: React.ForwardRefExoticComponent>; +interface MenuRootContentTypeProps extends Omit { +} +type FocusScopeProps = React.ComponentPropsWithoutRef; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type RovingFocusGroupProps = React.ComponentPropsWithoutRef; +type PopperContentProps = React.ComponentPropsWithoutRef; +type MenuContentImplPrivateProps = { + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + onDismiss?: DismissableLayerProps['onDismiss']; + disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents']; + /** + * Whether scrolling outside the `MenuContent` should be prevented + * (default: `false`) + */ + disableOutsideScroll?: boolean; + /** + * Whether focus should be trapped within the `MenuContent` + * (default: false) + */ + trapFocus?: FocusScopeProps['trapped']; +}; +interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit { + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; + /** + * Whether keyboard navigation should loop around + * @defaultValue false + */ + loop?: RovingFocusGroupProps['loop']; + onEntryFocus?: RovingFocusGroupProps['onEntryFocus']; + onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; + onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; + onFocusOutside?: DismissableLayerProps['onFocusOutside']; + onInteractOutside?: DismissableLayerProps['onInteractOutside']; +} +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface MenuGroupProps extends PrimitiveDivProps { +} +declare const MenuGroup: React.ForwardRefExoticComponent>; +interface MenuLabelProps extends PrimitiveDivProps { +} +declare const MenuLabel: React.ForwardRefExoticComponent>; +interface MenuItemProps extends Omit { + onSelect?: (event: Event) => void; +} +declare const MenuItem: React.ForwardRefExoticComponent>; +interface MenuItemImplProps extends PrimitiveDivProps { + disabled?: boolean; + textValue?: string; +} +type CheckedState = boolean | 'indeterminate'; +interface MenuCheckboxItemProps extends MenuItemProps { + checked?: CheckedState; + onCheckedChange?: (checked: boolean) => void; +} +declare const MenuCheckboxItem: React.ForwardRefExoticComponent>; +interface MenuRadioGroupProps extends MenuGroupProps { + value?: string; + onValueChange?: (value: string) => void; +} +declare const MenuRadioGroup: React.ForwardRefExoticComponent>; +interface MenuRadioItemProps extends MenuItemProps { + value: string; +} +declare const MenuRadioItem: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface MenuItemIndicatorProps extends PrimitiveSpanProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const MenuItemIndicator: React.ForwardRefExoticComponent>; +interface MenuSeparatorProps extends PrimitiveDivProps { +} +declare const MenuSeparator: React.ForwardRefExoticComponent>; +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface MenuArrowProps extends PopperArrowProps { +} +declare const MenuArrow: React.ForwardRefExoticComponent>; +interface MenuSubProps { + children?: React.ReactNode; + open?: boolean; + onOpenChange?(open: boolean): void; +} +declare const MenuSub: React.FC; +interface MenuSubTriggerProps extends MenuItemImplProps { +} +declare const MenuSubTrigger: React.ForwardRefExoticComponent>; +type AlignSubContent = Exclude<(typeof PopperPrimitive.ALIGN_OPTIONS)[number], 'center'>; +interface MenuSubContentProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; + /** + * Controls the direction the subcontent appears from its anchor menu item + * Default: start + */ + align?: AlignSubContent; +} +declare const MenuSubContent: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Anchor: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Group: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const CheckboxItem: React.ForwardRefExoticComponent>; +declare const RadioGroup: React.ForwardRefExoticComponent>; +declare const RadioItem: React.ForwardRefExoticComponent>; +declare const ItemIndicator: React.ForwardRefExoticComponent>; +declare const Separator: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Sub: React.FC; +declare const SubTrigger: React.ForwardRefExoticComponent>; +declare const SubContent: React.ForwardRefExoticComponent>; + +export { Anchor, Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, MenuAnchor, type MenuAnchorProps, MenuArrow, type MenuArrowProps, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, type MenuGroupProps, MenuItem, MenuItemIndicator, type MenuItemIndicatorProps, type MenuItemProps, MenuLabel, type MenuLabelProps, MenuPortal, type MenuPortalProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuSub, MenuSubContent, type MenuSubContentProps, type MenuSubProps, MenuSubTrigger, type MenuSubTriggerProps, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, createMenuScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..172ba1927c00e9b6f563f2f584315b497214bfbc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.js @@ -0,0 +1,912 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Anchor: () => Anchor2, + Arrow: () => Arrow2, + CheckboxItem: () => CheckboxItem, + Content: () => Content2, + Group: () => Group, + Item: () => Item2, + ItemIndicator: () => ItemIndicator, + Label: () => Label, + Menu: () => Menu, + MenuAnchor: () => MenuAnchor, + MenuArrow: () => MenuArrow, + MenuCheckboxItem: () => MenuCheckboxItem, + MenuContent: () => MenuContent, + MenuGroup: () => MenuGroup, + MenuItem: () => MenuItem, + MenuItemIndicator: () => MenuItemIndicator, + MenuLabel: () => MenuLabel, + MenuPortal: () => MenuPortal, + MenuRadioGroup: () => MenuRadioGroup, + MenuRadioItem: () => MenuRadioItem, + MenuSeparator: () => MenuSeparator, + MenuSub: () => MenuSub, + MenuSubContent: () => MenuSubContent, + MenuSubTrigger: () => MenuSubTrigger, + Portal: () => Portal, + RadioGroup: () => RadioGroup, + RadioItem: () => RadioItem, + Root: () => Root3, + Separator: () => Separator, + Sub: () => Sub, + SubContent: () => SubContent, + SubTrigger: () => SubTrigger, + createMenuScope: () => createMenuScope +}); +module.exports = __toCommonJS(index_exports); + +// src/menu.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_collection = require("@radix-ui/react-collection"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_react_focus_guards = require("@radix-ui/react-focus-guards"); +var import_react_focus_scope = require("@radix-ui/react-focus-scope"); +var import_react_id = require("@radix-ui/react-id"); +var PopperPrimitive = __toESM(require("@radix-ui/react-popper")); +var import_react_popper = require("@radix-ui/react-popper"); +var import_react_portal = require("@radix-ui/react-portal"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus")); +var import_react_roving_focus = require("@radix-ui/react-roving-focus"); +var import_react_slot = require("@radix-ui/react-slot"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_aria_hidden = require("aria-hidden"); +var import_react_remove_scroll = require("react-remove-scroll"); +var import_jsx_runtime = require("react/jsx-runtime"); +var SELECTION_KEYS = ["Enter", " "]; +var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"]; +var LAST_KEYS = ["ArrowUp", "PageDown", "End"]; +var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]; +var SUB_OPEN_KEYS = { + ltr: [...SELECTION_KEYS, "ArrowRight"], + rtl: [...SELECTION_KEYS, "ArrowLeft"] +}; +var SUB_CLOSE_KEYS = { + ltr: ["ArrowLeft"], + rtl: ["ArrowRight"] +}; +var MENU_NAME = "Menu"; +var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(MENU_NAME); +var [createMenuContext, createMenuScope] = (0, import_react_context.createContextScope)(MENU_NAME, [ + createCollectionScope, + import_react_popper.createPopperScope, + import_react_roving_focus.createRovingFocusGroupScope +]); +var usePopperScope = (0, import_react_popper.createPopperScope)(); +var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)(); +var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME); +var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME); +var Menu = (props) => { + const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props; + const popperScope = usePopperScope(__scopeMenu); + const [content, setContent] = React.useState(null); + const isUsingKeyboardRef = React.useRef(false); + const handleOpenChange = (0, import_react_use_callback_ref.useCallbackRef)(onOpenChange); + const direction = (0, import_react_direction.useDirection)(dir); + React.useEffect(() => { + const handleKeyDown = () => { + isUsingKeyboardRef.current = true; + document.addEventListener("pointerdown", handlePointer, { capture: true, once: true }); + document.addEventListener("pointermove", handlePointer, { capture: true, once: true }); + }; + const handlePointer = () => isUsingKeyboardRef.current = false; + document.addEventListener("keydown", handleKeyDown, { capture: true }); + return () => { + document.removeEventListener("keydown", handleKeyDown, { capture: true }); + document.removeEventListener("pointerdown", handlePointer, { capture: true }); + document.removeEventListener("pointermove", handlePointer, { capture: true }); + }; + }, []); + React.useEffect(() => { + if (!open) { + return; + } + const handleBlur = () => handleOpenChange(false); + window.addEventListener("blur", handleBlur); + return () => window.removeEventListener("blur", handleBlur); + }, [open, handleOpenChange]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuProvider, + { + scope: __scopeMenu, + open, + onOpenChange: handleOpenChange, + content, + onContentChange: setContent, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuRootProvider, + { + scope: __scopeMenu, + onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]), + isUsingKeyboardRef, + dir: direction, + modal, + children + } + ) + } + ) }); +}; +Menu.displayName = MENU_NAME; +var ANCHOR_NAME = "MenuAnchor"; +var MenuAnchor = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...anchorProps } = props; + const popperScope = usePopperScope(__scopeMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef }); + } +); +MenuAnchor.displayName = ANCHOR_NAME; +var PORTAL_NAME = "MenuPortal"; +var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, { + forceMount: void 0 +}); +var MenuPortal = (props) => { + const { __scopeMenu, forceMount, children, container } = props; + const context = useMenuContext(PORTAL_NAME, __scopeMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children }) }) }); +}; +MenuPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "MenuContent"; +var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME); +var MenuContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) }); + } +); +var MenuRootContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + React.useEffect(() => { + const content = ref.current; + if (content) return (0, import_aria_hidden.hideOthers)(content); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: context.open, + disableOutsideScroll: true, + onFocusOutside: (0, import_primitive.composeEventHandlers)( + props.onFocusOutside, + (event) => event.preventDefault(), + { checkForDefaultPrevented: false } + ), + onDismiss: () => context.onOpenChange(false) + } + ); + } +); +var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => { + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + disableOutsideScroll: false, + onDismiss: () => context.onOpenChange(false) + } + ); +}); +var Slot = (0, import_react_slot.createSlot)("MenuContent.ScrollLock"); +var MenuContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeMenu, + loop = false, + trapFocus, + onOpenAutoFocus, + onCloseAutoFocus, + disableOutsidePointerEvents, + onEntryFocus, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + disableOutsideScroll, + ...contentProps + } = props; + const context = useMenuContext(CONTENT_NAME, __scopeMenu); + const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu); + const popperScope = usePopperScope(__scopeMenu); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu); + const getItems = useCollection(__scopeMenu); + const [currentItemId, setCurrentItemId] = React.useState(null); + const contentRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef, context.onContentChange); + const timerRef = React.useRef(0); + const searchRef = React.useRef(""); + const pointerGraceTimerRef = React.useRef(0); + const pointerGraceIntentRef = React.useRef(null); + const pointerDirRef = React.useRef("right"); + const lastPointerXRef = React.useRef(0); + const ScrollLockWrapper = disableOutsideScroll ? import_react_remove_scroll.RemoveScroll : React.Fragment; + const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0; + const handleTypeaheadSearch = (key) => { + const search = searchRef.current + key; + const items = getItems().filter((item) => !item.disabled); + const currentItem = document.activeElement; + const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue; + const values = items.map((item) => item.textValue); + const nextMatch = getNextMatch(values, search, currentMatch); + const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current; + (function updateSearch(value) { + searchRef.current = value; + window.clearTimeout(timerRef.current); + if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3); + })(search); + if (newItem) { + setTimeout(() => newItem.focus()); + } + }; + React.useEffect(() => { + return () => window.clearTimeout(timerRef.current); + }, []); + (0, import_react_focus_guards.useFocusGuards)(); + const isPointerMovingToSubmenu = React.useCallback((event) => { + const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side; + return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuContentProvider, + { + scope: __scopeMenu, + searchRef, + onItemEnter: React.useCallback( + (event) => { + if (isPointerMovingToSubmenu(event)) event.preventDefault(); + }, + [isPointerMovingToSubmenu] + ), + onItemLeave: React.useCallback( + (event) => { + if (isPointerMovingToSubmenu(event)) return; + contentRef.current?.focus(); + setCurrentItemId(null); + }, + [isPointerMovingToSubmenu] + ), + onTriggerLeave: React.useCallback( + (event) => { + if (isPointerMovingToSubmenu(event)) event.preventDefault(); + }, + [isPointerMovingToSubmenu] + ), + pointerGraceTimerRef, + onPointerGraceIntentChange: React.useCallback((intent) => { + pointerGraceIntentRef.current = intent; + }, []), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_focus_scope.FocusScope, + { + asChild: true, + trapped: trapFocus, + onMountAutoFocus: (0, import_primitive.composeEventHandlers)(onOpenAutoFocus, (event) => { + event.preventDefault(); + contentRef.current?.focus({ preventScroll: true }); + }), + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + dir: rootContext.dir, + orientation: "vertical", + loop, + currentTabStopId: currentItemId, + onCurrentTabStopIdChange: setCurrentItemId, + onEntryFocus: (0, import_primitive.composeEventHandlers)(onEntryFocus, (event) => { + if (!rootContext.isUsingKeyboardRef.current) event.preventDefault(); + }), + preventScrollOnEntryFocus: true, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopperPrimitive.Content, + { + role: "menu", + "aria-orientation": "vertical", + "data-state": getOpenState(context.open), + "data-radix-menu-content": "", + dir: rootContext.dir, + ...popperScope, + ...contentProps, + ref: composedRefs, + style: { outline: "none", ...contentProps.style }, + onKeyDown: (0, import_primitive.composeEventHandlers)(contentProps.onKeyDown, (event) => { + const target = event.target; + const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget; + const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; + const isCharacterKey = event.key.length === 1; + if (isKeyDownInside) { + if (event.key === "Tab") event.preventDefault(); + if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key); + } + const content = contentRef.current; + if (event.target !== content) return; + if (!FIRST_LAST_KEYS.includes(event.key)) return; + event.preventDefault(); + const items = getItems().filter((item) => !item.disabled); + const candidateNodes = items.map((item) => item.ref.current); + if (LAST_KEYS.includes(event.key)) candidateNodes.reverse(); + focusFirst(candidateNodes); + }), + onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, (event) => { + if (!event.currentTarget.contains(event.target)) { + window.clearTimeout(timerRef.current); + searchRef.current = ""; + } + }), + onPointerMove: (0, import_primitive.composeEventHandlers)( + props.onPointerMove, + whenMouse((event) => { + const target = event.target; + const pointerXHasChanged = lastPointerXRef.current !== event.clientX; + if (event.currentTarget.contains(target) && pointerXHasChanged) { + const newDir = event.clientX > lastPointerXRef.current ? "right" : "left"; + pointerDirRef.current = newDir; + lastPointerXRef.current = event.clientX; + } + }) + ) + } + ) + } + ) + } + ) + } + ) }) + } + ); + } +); +MenuContent.displayName = CONTENT_NAME; +var GROUP_NAME = "MenuGroup"; +var MenuGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...groupProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { role: "group", ...groupProps, ref: forwardedRef }); + } +); +MenuGroup.displayName = GROUP_NAME; +var LABEL_NAME = "MenuLabel"; +var MenuLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...labelProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...labelProps, ref: forwardedRef }); + } +); +MenuLabel.displayName = LABEL_NAME; +var ITEM_NAME = "MenuItem"; +var ITEM_SELECT = "menu.itemSelect"; +var MenuItem = React.forwardRef( + (props, forwardedRef) => { + const { disabled = false, onSelect, ...itemProps } = props; + const ref = React.useRef(null); + const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu); + const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const isPointerDownRef = React.useRef(false); + const handleSelect = () => { + const menuItem = ref.current; + if (!disabled && menuItem) { + const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true }); + menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true }); + (0, import_react_primitive.dispatchDiscreteCustomEvent)(menuItem, itemSelectEvent); + if (itemSelectEvent.defaultPrevented) { + isPointerDownRef.current = false; + } else { + rootContext.onClose(); + } + } + }; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuItemImpl, + { + ...itemProps, + ref: composedRefs, + disabled, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, handleSelect), + onPointerDown: (event) => { + props.onPointerDown?.(event); + isPointerDownRef.current = true; + }, + onPointerUp: (0, import_primitive.composeEventHandlers)(props.onPointerUp, (event) => { + if (!isPointerDownRef.current) event.currentTarget?.click(); + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + const isTypingAhead = contentContext.searchRef.current !== ""; + if (disabled || isTypingAhead && event.key === " ") return; + if (SELECTION_KEYS.includes(event.key)) { + event.currentTarget.click(); + event.preventDefault(); + } + }) + } + ); + } +); +MenuItem.displayName = ITEM_NAME; +var MenuItemImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, disabled = false, textValue, ...itemProps } = props; + const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const [isFocused, setIsFocused] = React.useState(false); + const [textContent, setTextContent] = React.useState(""); + React.useEffect(() => { + const menuItem = ref.current; + if (menuItem) { + setTextContent((menuItem.textContent ?? "").trim()); + } + }, [itemProps.children]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + Collection.ItemSlot, + { + scope: __scopeMenu, + disabled, + textValue: textValue ?? textContent, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + role: "menuitem", + "data-highlighted": isFocused ? "" : void 0, + "aria-disabled": disabled || void 0, + "data-disabled": disabled ? "" : void 0, + ...itemProps, + ref: composedRefs, + onPointerMove: (0, import_primitive.composeEventHandlers)( + props.onPointerMove, + whenMouse((event) => { + if (disabled) { + contentContext.onItemLeave(event); + } else { + contentContext.onItemEnter(event); + if (!event.defaultPrevented) { + const item = event.currentTarget; + item.focus({ preventScroll: true }); + } + } + }) + ), + onPointerLeave: (0, import_primitive.composeEventHandlers)( + props.onPointerLeave, + whenMouse((event) => contentContext.onItemLeave(event)) + ), + onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => setIsFocused(true)), + onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, () => setIsFocused(false)) + } + ) }) + } + ); + } +); +var CHECKBOX_ITEM_NAME = "MenuCheckboxItem"; +var MenuCheckboxItem = React.forwardRef( + (props, forwardedRef) => { + const { checked = false, onCheckedChange, ...checkboxItemProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuItem, + { + role: "menuitemcheckbox", + "aria-checked": isIndeterminate(checked) ? "mixed" : checked, + ...checkboxItemProps, + ref: forwardedRef, + "data-state": getCheckedState(checked), + onSelect: (0, import_primitive.composeEventHandlers)( + checkboxItemProps.onSelect, + () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked), + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "MenuRadioGroup"; +var [RadioGroupProvider, useRadioGroupContext] = createMenuContext( + RADIO_GROUP_NAME, + { value: void 0, onValueChange: () => { + } } +); +var MenuRadioGroup = React.forwardRef( + (props, forwardedRef) => { + const { value, onValueChange, ...groupProps } = props; + const handleValueChange = (0, import_react_use_callback_ref.useCallbackRef)(onValueChange); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuGroup, { ...groupProps, ref: forwardedRef }) }); + } +); +MenuRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "MenuRadioItem"; +var MenuRadioItem = React.forwardRef( + (props, forwardedRef) => { + const { value, ...radioItemProps } = props; + const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu); + const checked = value === context.value; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuItem, + { + role: "menuitemradio", + "aria-checked": checked, + ...radioItemProps, + ref: forwardedRef, + "data-state": getCheckedState(checked), + onSelect: (0, import_primitive.composeEventHandlers)( + radioItemProps.onSelect, + () => context.onValueChange?.(value), + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +MenuRadioItem.displayName = RADIO_ITEM_NAME; +var ITEM_INDICATOR_NAME = "MenuItemIndicator"; +var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext( + ITEM_INDICATOR_NAME, + { checked: false } +); +var MenuItemIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, forceMount, ...itemIndicatorProps } = props; + const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_presence.Presence, + { + present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.span, + { + ...itemIndicatorProps, + ref: forwardedRef, + "data-state": getCheckedState(indicatorContext.checked) + } + ) + } + ); + } +); +MenuItemIndicator.displayName = ITEM_INDICATOR_NAME; +var SEPARATOR_NAME = "MenuSeparator"; +var MenuSeparator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...separatorProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + role: "separator", + "aria-orientation": "horizontal", + ...separatorProps, + ref: forwardedRef + } + ); + } +); +MenuSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "MenuArrow"; +var MenuArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...arrowProps } = props; + const popperScope = usePopperScope(__scopeMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); + } +); +MenuArrow.displayName = ARROW_NAME; +var SUB_NAME = "MenuSub"; +var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME); +var MenuSub = (props) => { + const { __scopeMenu, children, open = false, onOpenChange } = props; + const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu); + const popperScope = usePopperScope(__scopeMenu); + const [trigger, setTrigger] = React.useState(null); + const [content, setContent] = React.useState(null); + const handleOpenChange = (0, import_react_use_callback_ref.useCallbackRef)(onOpenChange); + React.useEffect(() => { + if (parentMenuContext.open === false) handleOpenChange(false); + return () => handleOpenChange(false); + }, [parentMenuContext.open, handleOpenChange]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuProvider, + { + scope: __scopeMenu, + open, + onOpenChange: handleOpenChange, + content, + onContentChange: setContent, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuSubProvider, + { + scope: __scopeMenu, + contentId: (0, import_react_id.useId)(), + triggerId: (0, import_react_id.useId)(), + trigger, + onTriggerChange: setTrigger, + children + } + ) + } + ) }); +}; +MenuSub.displayName = SUB_NAME; +var SUB_TRIGGER_NAME = "MenuSubTrigger"; +var MenuSubTrigger = React.forwardRef( + (props, forwardedRef) => { + const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const openTimerRef = React.useRef(null); + const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext; + const scope = { __scopeMenu: props.__scopeMenu }; + const clearOpenTimer = React.useCallback(() => { + if (openTimerRef.current) window.clearTimeout(openTimerRef.current); + openTimerRef.current = null; + }, []); + React.useEffect(() => clearOpenTimer, [clearOpenTimer]); + React.useEffect(() => { + const pointerGraceTimer = pointerGraceTimerRef.current; + return () => { + window.clearTimeout(pointerGraceTimer); + onPointerGraceIntentChange(null); + }; + }, [pointerGraceTimerRef, onPointerGraceIntentChange]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuItemImpl, + { + id: subContext.triggerId, + "aria-haspopup": "menu", + "aria-expanded": context.open, + "aria-controls": context.open ? subContext.contentId : void 0, + "data-state": getOpenState(context.open), + ...props, + ref: (0, import_react_compose_refs.composeRefs)(forwardedRef, subContext.onTriggerChange), + onClick: (event) => { + props.onClick?.(event); + if (props.disabled || event.defaultPrevented) return; + event.currentTarget.focus(); + if (!context.open) context.onOpenChange(true); + }, + onPointerMove: (0, import_primitive.composeEventHandlers)( + props.onPointerMove, + whenMouse((event) => { + contentContext.onItemEnter(event); + if (event.defaultPrevented) return; + if (!props.disabled && !context.open && !openTimerRef.current) { + contentContext.onPointerGraceIntentChange(null); + openTimerRef.current = window.setTimeout(() => { + context.onOpenChange(true); + clearOpenTimer(); + }, 100); + } + }) + ), + onPointerLeave: (0, import_primitive.composeEventHandlers)( + props.onPointerLeave, + whenMouse((event) => { + clearOpenTimer(); + const contentRect = context.content?.getBoundingClientRect(); + if (contentRect) { + const side = context.content?.dataset.side; + const rightSide = side === "right"; + const bleed = rightSide ? -5 : 5; + const contentNearEdge = contentRect[rightSide ? "left" : "right"]; + const contentFarEdge = contentRect[rightSide ? "right" : "left"]; + contentContext.onPointerGraceIntentChange({ + area: [ + // Apply a bleed on clientX to ensure that our exit point is + // consistently within polygon bounds + { x: event.clientX + bleed, y: event.clientY }, + { x: contentNearEdge, y: contentRect.top }, + { x: contentFarEdge, y: contentRect.top }, + { x: contentFarEdge, y: contentRect.bottom }, + { x: contentNearEdge, y: contentRect.bottom } + ], + side + }); + window.clearTimeout(pointerGraceTimerRef.current); + pointerGraceTimerRef.current = window.setTimeout( + () => contentContext.onPointerGraceIntentChange(null), + 300 + ); + } else { + contentContext.onTriggerLeave(event); + if (event.defaultPrevented) return; + contentContext.onPointerGraceIntentChange(null); + } + }) + ), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + const isTypingAhead = contentContext.searchRef.current !== ""; + if (props.disabled || isTypingAhead && event.key === " ") return; + if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) { + context.onOpenChange(true); + context.content?.focus(); + event.preventDefault(); + } + }) + } + ) }); + } +); +MenuSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "MenuSubContent"; +var MenuSubContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu); + const { forceMount = portalContext.forceMount, align = "start", ...subContentProps } = props; + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu); + const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuContentImpl, + { + id: subContext.contentId, + "aria-labelledby": subContext.triggerId, + ...subContentProps, + ref: composedRefs, + align, + side: rootContext.dir === "rtl" ? "left" : "right", + disableOutsidePointerEvents: false, + disableOutsideScroll: false, + trapFocus: false, + onOpenAutoFocus: (event) => { + if (rootContext.isUsingKeyboardRef.current) ref.current?.focus(); + event.preventDefault(); + }, + onCloseAutoFocus: (event) => event.preventDefault(), + onFocusOutside: (0, import_primitive.composeEventHandlers)(props.onFocusOutside, (event) => { + if (event.target !== subContext.trigger) context.onOpenChange(false); + }), + onEscapeKeyDown: (0, import_primitive.composeEventHandlers)(props.onEscapeKeyDown, (event) => { + rootContext.onClose(); + event.preventDefault(); + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + const isKeyDownInside = event.currentTarget.contains(event.target); + const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key); + if (isKeyDownInside && isCloseKey) { + context.onOpenChange(false); + subContext.trigger?.focus(); + event.preventDefault(); + } + }) + } + ) }) }) }); + } +); +MenuSubContent.displayName = SUB_CONTENT_NAME; +function getOpenState(open) { + return open ? "open" : "closed"; +} +function isIndeterminate(checked) { + return checked === "indeterminate"; +} +function getCheckedState(checked) { + return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; +} +function focusFirst(candidates) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus(); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +function getNextMatch(values, search, currentMatch) { + const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); + const normalizedSearch = isRepeated ? search[0] : search; + const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; + let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0)); + const excludeCurrentMatch = normalizedSearch.length === 1; + if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch); + const nextMatch = wrappedValues.find( + (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()) + ); + return nextMatch !== currentMatch ? nextMatch : void 0; +} +function isPointInPolygon(point, polygon) { + const { x, y } = point; + let inside = false; + for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { + const ii = polygon[i]; + const jj = polygon[j]; + const xi = ii.x; + const yi = ii.y; + const xj = jj.x; + const yj = jj.y; + const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; + if (intersect) inside = !inside; + } + return inside; +} +function isPointerInGraceArea(event, area) { + if (!area) return false; + const cursorPos = { x: event.clientX, y: event.clientY }; + return isPointInPolygon(cursorPos, area); +} +function whenMouse(handler) { + return (event) => event.pointerType === "mouse" ? handler(event) : void 0; +} +var Root3 = Menu; +var Anchor2 = MenuAnchor; +var Portal = MenuPortal; +var Content2 = MenuContent; +var Group = MenuGroup; +var Label = MenuLabel; +var Item2 = MenuItem; +var CheckboxItem = MenuCheckboxItem; +var RadioGroup = MenuRadioGroup; +var RadioItem = MenuRadioItem; +var ItemIndicator = MenuItemIndicator; +var Separator = MenuSeparator; +var Arrow2 = MenuArrow; +var Sub = MenuSub; +var SubTrigger = MenuSubTrigger; +var SubContent = MenuSubContent; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c5daa9b0503ab64aad70153507c4c3d6d492979d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/menu.tsx"], + "sourcesContent": ["'use client';\nexport {\n createMenuScope,\n //\n Menu,\n MenuAnchor,\n MenuPortal,\n MenuContent,\n MenuGroup,\n MenuLabel,\n MenuItem,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuItemIndicator,\n MenuSeparator,\n MenuArrow,\n MenuSub,\n MenuSubTrigger,\n MenuSubContent,\n //\n Root,\n Anchor,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n} from './menu';\nexport type {\n MenuProps,\n MenuAnchorProps,\n MenuPortalProps,\n MenuContentProps,\n MenuGroupProps,\n MenuLabelProps,\n MenuItemProps,\n MenuCheckboxItemProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuItemIndicatorProps,\n MenuSeparatorProps,\n MenuArrowProps,\n MenuSubProps,\n MenuSubTriggerProps,\n MenuSubContentProps,\n} from './menu';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs, composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst SELECTION_KEYS = ['Enter', ' '];\nconst FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nconst LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS: Record = {\n ltr: [...SELECTION_KEYS, 'ArrowRight'],\n rtl: [...SELECTION_KEYS, 'ArrowLeft'],\n};\nconst SUB_CLOSE_KEYS: Record = {\n ltr: ['ArrowLeft'],\n rtl: ['ArrowRight'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'Menu';\n\ntype ItemData = { disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n MenuItemElement,\n ItemData\n>(MENU_NAME);\n\ntype ScopedProps

= P & { __scopeMenu?: Scope };\nconst [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope,\n]);\nconst usePopperScope = createPopperScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n content: MenuContentElement | null;\n onContentChange(content: MenuContentElement | null): void;\n};\n\nconst [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\n\ntype MenuRootContextValue = {\n onClose(): void;\n isUsingKeyboardRef: React.RefObject;\n dir: Direction;\n modal: boolean;\n};\n\nconst [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\n\ninterface MenuProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst Menu: React.FC = (props: ScopedProps) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n\n React.useEffect(() => {\n // Capture phase ensures we set the boolean before any side effects execute\n // in response to the key or pointer event as they might depend on this value.\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener('pointerdown', handlePointer, { capture: true, once: true });\n document.addEventListener('pointermove', handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => (isUsingKeyboardRef.current = false);\n document.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener('keydown', handleKeyDown, { capture: true });\n document.removeEventListener('pointerdown', handlePointer, { capture: true });\n document.removeEventListener('pointermove', handlePointer, { capture: true });\n };\n }, []);\n\n // Close the menu (and any open submenus) when the window loses focus, e.g. when\n // switching to another browser tab or application. Without this, submenus would\n // remain open when the page is re-focused, leaving the menu in an inconsistent state.\n // See: https://github.com/radix-ui/primitives/issues/3257\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const handleBlur = () => handleOpenChange(false);\n window.addEventListener('blur', handleBlur);\n return () => window.removeEventListener('blur', handleBlur);\n }, [open, handleOpenChange]);\n\n return (\n \n \n handleOpenChange(false), [handleOpenChange])}\n isUsingKeyboardRef={isUsingKeyboardRef}\n dir={direction}\n modal={modal}\n >\n {children}\n \n \n \n );\n};\n\nMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'MenuAnchor';\n\ntype MenuAnchorElement = React.ComponentRef;\ntype PopperAnchorProps = React.ComponentPropsWithoutRef;\ninterface MenuAnchorProps extends PopperAnchorProps {}\n\nconst MenuAnchor = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return ;\n },\n);\n\nMenuAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenuPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface MenuPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuPortal: React.FC = (props: ScopedProps) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenuContent';\n\ntype MenuContentContextValue = {\n onItemEnter(event: React.PointerEvent): void;\n onItemLeave(event: React.PointerEvent): void;\n onTriggerLeave(event: React.PointerEvent): void;\n searchRef: React.RefObject;\n pointerGraceTimerRef: React.MutableRefObject;\n onPointerGraceIntentChange(intent: GraceIntent | null): void;\n};\nconst [MenuContentProvider, useMenuContentContext] =\n createMenuContext(CONTENT_NAME);\n\ntype MenuContentElement = MenuRootContentTypeElement;\n/**\n * We purposefully don't union MenuRootContent and MenuSubContent props here because\n * they have conflicting prop types. We agreed that we would allow MenuSubContent to\n * accept props that it would just ignore.\n */\ninterface MenuContentProps extends MenuRootContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n\n return (\n \n \n \n {rootContext.modal ? (\n \n ) : (\n \n )}\n \n \n \n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuRootContentTypeElement = MenuContentImplElement;\ninterface MenuRootContentTypeProps extends Omit<\n MenuContentImplProps,\n keyof MenuContentImplPrivateProps\n> {}\n\nconst MenuRootContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n // Hide everything from ARIA except the `MenuContent`\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n event.preventDefault(),\n { checkForDefaultPrevented: false },\n )}\n onDismiss={() => context.onOpenChange(false)}\n />\n );\n },\n);\n\nconst MenuRootContentNonModal = React.forwardRef<\n MenuRootContentTypeElement,\n MenuRootContentTypeProps\n>((props: ScopedProps, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return (\n context.onOpenChange(false)}\n />\n );\n});\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuContentImplElement = React.ComponentRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ntype MenuContentImplPrivateProps = {\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n onDismiss?: DismissableLayerProps['onDismiss'];\n disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];\n\n /**\n * Whether scrolling outside the `MenuContent` should be prevented\n * (default: `false`)\n */\n disableOutsideScroll?: boolean;\n\n /**\n * Whether focus should be trapped within the `MenuContent`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped'];\n};\ninterface MenuContentImplProps\n extends MenuContentImplPrivateProps, Omit {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: RovingFocusGroupProps['loop'];\n\n onEntryFocus?: RovingFocusGroupProps['onEntryFocus'];\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst Slot = createSlot('MenuContent.ScrollLock');\n\nconst MenuContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef('');\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef('right');\n const lastPointerXRef = React.useRef(0);\n\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll\n ? { as: Slot, allowPinchZoom: true }\n : undefined;\n\n const handleTypeaheadSearch = (key: string) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n\n // Reset `searchRef` 1 second after it was last updated\n (function updateSearch(value: string) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n })(search);\n\n if (newItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => (newItem as HTMLElement).focus());\n }\n };\n\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n\n // Make sure the whole tree has focus guards as our `MenuContent` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const isPointerMovingToSubmenu = React.useCallback((event: React.PointerEvent) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n\n return (\n {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu],\n )}\n onItemLeave={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu],\n )}\n onTriggerLeave={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu],\n )}\n pointerGraceTimerRef={pointerGraceTimerRef}\n onPointerGraceIntentChange={React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, [])}\n >\n \n {\n // when opening, explicitly focus the content area only and leave\n // `onEntryFocus` in control of focusing first item\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n })}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n \n {\n // only focus first item when using keyboard\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n })}\n preventScrollOnEntryFocus\n >\n {\n // submenu key events bubble through portals. We only care about keys in this menu.\n const target = event.target as HTMLElement;\n const isKeyDownInside =\n target.closest('[data-radix-menu-content]') === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n // menus should not be navigated using tab key so we prevent it\n if (event.key === 'Tab') event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n // focus first/last item based on key pressed\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current!);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n })}\n onBlur={composeEventHandlers(props.onBlur, (event) => {\n // clear search buffer when leaving the menu\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = '';\n }\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target as HTMLElement;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n\n // We don't use `event.movementX` for this check because Safari will\n // always return `0` on a pointer event.\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n }),\n )}\n />\n \n \n \n \n \n );\n },\n);\n\nMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenuGroup';\n\ntype MenuGroupElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface MenuGroupProps extends PrimitiveDivProps {}\n\nconst MenuGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return ;\n },\n);\n\nMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenuLabel';\n\ntype MenuLabelElement = React.ComponentRef;\ninterface MenuLabelProps extends PrimitiveDivProps {}\n\nconst MenuLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return ;\n },\n);\n\nMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenuItem';\nconst ITEM_SELECT = 'menu.itemSelect';\n\ntype MenuItemElement = MenuItemImplElement;\ninterface MenuItemProps extends Omit {\n onSelect?: (event: Event) => void;\n}\n\nconst MenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n\n return (\n {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n }}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n // Pointer down can move to a different menu item which should activate it on pointer up.\n // We dispatch a click for selection to allow composition with click based triggers and to\n // prevent Firefox from getting stuck in text selection mode when the menu closes.\n if (!isPointerDownRef.current) event.currentTarget?.click();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== '';\n if (disabled || (isTypingAhead && event.key === ' ')) return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n /**\n * We prevent default browser behaviour for selection keys as they should trigger\n * a selection only:\n * - prevents space from scrolling the page.\n * - if keydown causes focus to move, prevents keydown from firing on the new target.\n */\n event.preventDefault();\n }\n })}\n />\n );\n },\n);\n\nMenuItem.displayName = ITEM_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuItemImplElement = React.ComponentRef;\ninterface MenuItemImplProps extends PrimitiveDivProps {\n disabled?: boolean;\n textValue?: string;\n}\n\nconst MenuItemImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n\n // get the item's `.textContent` as default strategy for typeahead `textValue`\n const [textContent, setTextContent] = React.useState('');\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? '').trim());\n }\n }, [itemProps.children]);\n\n return (\n \n \n {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n }),\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event)),\n )}\n onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n />\n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\n\ntype MenuCheckboxItemElement = MenuItemElement;\n\ntype CheckedState = boolean | 'indeterminate';\n\ninterface MenuCheckboxItemProps extends MenuItemProps {\n checked?: CheckedState;\n // `onCheckedChange` can never be called with `\"indeterminate\"` from the inside\n onCheckedChange?: (checked: boolean) => void;\n}\n\nconst MenuCheckboxItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return (\n \n onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenuRadioGroup';\n\nconst [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: undefined, onValueChange: () => {} },\n);\n\ntype MenuRadioGroupElement = React.ComponentRef;\ninterface MenuRadioGroupProps extends MenuGroupProps {\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\nconst MenuRadioGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return (\n \n \n \n );\n },\n);\n\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenuRadioItem';\n\ntype MenuRadioItemElement = React.ComponentRef;\ninterface MenuRadioItemProps extends MenuItemProps {\n value: string;\n}\n\nconst MenuRadioItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return (\n \n context.onValueChange?.(value),\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'MenuItemIndicator';\n\ntype CheckboxContextValue = { checked: CheckedState };\n\nconst [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false },\n);\n\ntype MenuItemIndicatorElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface MenuItemIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuItemIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return (\n \n \n \n );\n },\n);\n\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenuSeparator';\n\ntype MenuSeparatorElement = React.ComponentRef;\ninterface MenuSeparatorProps extends PrimitiveDivProps {}\n\nconst MenuSeparator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return (\n \n );\n },\n);\n\nMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenuArrow';\n\ntype MenuArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface MenuArrowProps extends PopperArrowProps {}\n\nconst MenuArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return ;\n },\n);\n\nMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenuSub';\n\ntype MenuSubContextValue = {\n contentId: string;\n triggerId: string;\n trigger: MenuSubTriggerElement | null;\n onTriggerChange(trigger: MenuSubTriggerElement | null): void;\n};\n\nconst [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\n\ninterface MenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst MenuSub: React.FC = (props: ScopedProps) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n\n // Prevent the parent menu from reopening with open submenus.\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenuSubTrigger';\n\ntype MenuSubTriggerElement = MenuItemImplElement;\ninterface MenuSubTriggerProps extends MenuItemImplProps {}\n\nconst MenuSubTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n\n return (\n \n {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n /**\n * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n * and we rely heavily on `onFocusOutside` for submenus to close when switching\n * between separate submenus.\n */\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n }}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n }),\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n // TODO: make sure to update this when we change positioning logic\n const side = context.content?.dataset.side as Side;\n const rightSide = side === 'right';\n const bleed = rightSide ? -5 : +5;\n const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom },\n ],\n side,\n });\n\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300,\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n\n // There's 100ms where the user may leave an item before the submenu was opened.\n contentContext.onPointerGraceIntentChange(null);\n }\n }),\n )}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== '';\n if (props.disabled || (isTypingAhead && event.key === ' ')) return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n // The trigger may hold focus if opened via pointer interaction\n // so we ensure content is given focus again when switching to keyboard.\n context.content?.focus();\n // prevent window from scrolling\n event.preventDefault();\n }\n })}\n />\n \n );\n },\n);\n\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenuSubContent';\n\ntype AlignSubContent = Exclude<(typeof PopperPrimitive.ALIGN_OPTIONS)[number], 'center'>;\n\ntype MenuSubContentElement = MenuContentImplElement;\ninterface MenuSubContentProps extends Omit<\n MenuContentImplProps,\n keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'\n> {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n\n /**\n * Controls the direction the subcontent appears from its anchor menu item\n * Default: start\n */\n align?: AlignSubContent;\n}\n\nconst MenuSubContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, align = 'start', ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return (\n \n \n \n {\n // when opening a submenu, focus content for keyboard users only\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n }}\n // The menu might close because of focusing another menu item in the parent menu. We\n // don't want it to refocus the trigger in that case so we handle trigger focus ourselves.\n onCloseAutoFocus={(event) => event.preventDefault()}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n // on pointer interaction.\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n // ensure pressing escape in submenu doesn't escape full screen mode\n event.preventDefault();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n // Submenu key events bubble through portals. We only care about keys in this menu.\n const isKeyDownInside = event.currentTarget.contains(event.target as HTMLElement);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n // We focus manually because we prevented it in `onCloseAutoFocus`\n subContext.trigger?.focus();\n // prevent window from scrolling\n event.preventDefault();\n }\n })}\n />\n \n \n \n );\n },\n);\n\nMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getOpenState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getCheckedState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]!);\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction getNextMatch(values: string[], search: string, currentMatch?: string) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0]! : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find((value) =>\n value.toLowerCase().startsWith(normalizedSearch.toLowerCase()),\n );\n return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\ntype Side = 'left' | 'right';\ntype GraceIntent = { area: Polygon; side: Side };\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i]!;\n const jj = polygon[j]!;\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\nfunction isPointerInGraceArea(event: React.PointerEvent, area?: Polygon) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\n\nfunction whenMouse(handler: React.PointerEventHandler): React.PointerEventHandler {\n return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = Menu;\nconst Anchor = MenuAnchor;\nconst Portal = MenuPortal;\nconst Content = MenuContent;\nconst Group = MenuGroup;\nconst Label = MenuLabel;\nconst Item = MenuItem;\nconst CheckboxItem = MenuCheckboxItem;\nconst RadioGroup = MenuRadioGroup;\nconst RadioItem = MenuRadioItem;\nconst ItemIndicator = MenuItemIndicator;\nconst Separator = MenuSeparator;\nconst Arrow = MenuArrow;\nconst Sub = MenuSub;\nconst SubTrigger = MenuSubTrigger;\nconst SubContent = MenuSubContent;\n\nexport {\n createMenuScope,\n //\n Menu,\n MenuAnchor,\n MenuPortal,\n MenuContent,\n MenuGroup,\n MenuLabel,\n MenuItem,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuItemIndicator,\n MenuSeparator,\n MenuArrow,\n MenuSub,\n MenuSubTrigger,\n MenuSubContent,\n //\n Root,\n Anchor,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n MenuProps,\n MenuAnchorProps,\n MenuPortalProps,\n MenuContentProps,\n MenuGroupProps,\n MenuLabelProps,\n MenuItemProps,\n MenuCheckboxItemProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuItemIndicatorProps,\n MenuSeparatorProps,\n MenuArrowProps,\n MenuSubProps,\n MenuSubTriggerProps,\n MenuSubContentProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA,aAAAC;AAAA,EAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,8BAAiC;AACjC,gCAA6C;AAC7C,2BAAmC;AACnC,6BAA6B;AAC7B,qCAAiC;AACjC,gCAA+B;AAC/B,+BAA2B;AAC3B,sBAAsB;AACtB,sBAAiC;AACjC,0BAAkC;AAClC,0BAA0C;AAC1C,4BAAyB;AACzB,6BAAuD;AACvD,uBAAkC;AAClC,gCAA4C;AAC5C,wBAA2B;AAC3B,oCAA+B;AAC/B,yBAA2B;AAC3B,iCAA6B;AAiHrB;AA3GR,IAAM,iBAAiB,CAAC,SAAS,GAAG;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AAM,aAAa;AACnB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAClB,IAAMC,SAAQ;AACd,IAAM,MAAM;AACZ,IAAM,aAAa;AACnB,IAAM,aAAa;", + "names": ["Anchor", "Arrow", "Content", "Item", "Root", "PortalPrimitive", "Root", "Anchor", "Content", "Item", "Arrow"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..52b73650ae5fe99e0198ccff292912dd884e0785 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.mjs @@ -0,0 +1,880 @@ +"use client"; + +// src/menu.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { createCollection } from "@radix-ui/react-collection"; +import { useComposedRefs, composeRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useDirection } from "@radix-ui/react-direction"; +import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; +import { useFocusGuards } from "@radix-ui/react-focus-guards"; +import { FocusScope } from "@radix-ui/react-focus-scope"; +import { useId } from "@radix-ui/react-id"; +import * as PopperPrimitive from "@radix-ui/react-popper"; +import { createPopperScope } from "@radix-ui/react-popper"; +import { Portal as PortalPrimitive } from "@radix-ui/react-portal"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive, dispatchDiscreteCustomEvent } from "@radix-ui/react-primitive"; +import * as RovingFocusGroup from "@radix-ui/react-roving-focus"; +import { createRovingFocusGroupScope } from "@radix-ui/react-roving-focus"; +import { createSlot } from "@radix-ui/react-slot"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { hideOthers } from "aria-hidden"; +import { RemoveScroll } from "react-remove-scroll"; +import { jsx } from "react/jsx-runtime"; +var SELECTION_KEYS = ["Enter", " "]; +var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"]; +var LAST_KEYS = ["ArrowUp", "PageDown", "End"]; +var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]; +var SUB_OPEN_KEYS = { + ltr: [...SELECTION_KEYS, "ArrowRight"], + rtl: [...SELECTION_KEYS, "ArrowLeft"] +}; +var SUB_CLOSE_KEYS = { + ltr: ["ArrowLeft"], + rtl: ["ArrowRight"] +}; +var MENU_NAME = "Menu"; +var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME); +var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [ + createCollectionScope, + createPopperScope, + createRovingFocusGroupScope +]); +var usePopperScope = createPopperScope(); +var useRovingFocusGroupScope = createRovingFocusGroupScope(); +var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME); +var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME); +var Menu = (props) => { + const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props; + const popperScope = usePopperScope(__scopeMenu); + const [content, setContent] = React.useState(null); + const isUsingKeyboardRef = React.useRef(false); + const handleOpenChange = useCallbackRef(onOpenChange); + const direction = useDirection(dir); + React.useEffect(() => { + const handleKeyDown = () => { + isUsingKeyboardRef.current = true; + document.addEventListener("pointerdown", handlePointer, { capture: true, once: true }); + document.addEventListener("pointermove", handlePointer, { capture: true, once: true }); + }; + const handlePointer = () => isUsingKeyboardRef.current = false; + document.addEventListener("keydown", handleKeyDown, { capture: true }); + return () => { + document.removeEventListener("keydown", handleKeyDown, { capture: true }); + document.removeEventListener("pointerdown", handlePointer, { capture: true }); + document.removeEventListener("pointermove", handlePointer, { capture: true }); + }; + }, []); + React.useEffect(() => { + if (!open) { + return; + } + const handleBlur = () => handleOpenChange(false); + window.addEventListener("blur", handleBlur); + return () => window.removeEventListener("blur", handleBlur); + }, [open, handleOpenChange]); + return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx( + MenuProvider, + { + scope: __scopeMenu, + open, + onOpenChange: handleOpenChange, + content, + onContentChange: setContent, + children: /* @__PURE__ */ jsx( + MenuRootProvider, + { + scope: __scopeMenu, + onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]), + isUsingKeyboardRef, + dir: direction, + modal, + children + } + ) + } + ) }); +}; +Menu.displayName = MENU_NAME; +var ANCHOR_NAME = "MenuAnchor"; +var MenuAnchor = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...anchorProps } = props; + const popperScope = usePopperScope(__scopeMenu); + return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef }); + } +); +MenuAnchor.displayName = ANCHOR_NAME; +var PORTAL_NAME = "MenuPortal"; +var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, { + forceMount: void 0 +}); +var MenuPortal = (props) => { + const { __scopeMenu, forceMount, children, container } = props; + const context = useMenuContext(PORTAL_NAME, __scopeMenu); + return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) }); +}; +MenuPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "MenuContent"; +var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME); +var MenuContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu); + return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) }); + } +); +var MenuRootContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + React.useEffect(() => { + const content = ref.current; + if (content) return hideOthers(content); + }, []); + return /* @__PURE__ */ jsx( + MenuContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: context.open, + disableOutsideScroll: true, + onFocusOutside: composeEventHandlers( + props.onFocusOutside, + (event) => event.preventDefault(), + { checkForDefaultPrevented: false } + ), + onDismiss: () => context.onOpenChange(false) + } + ); + } +); +var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => { + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + return /* @__PURE__ */ jsx( + MenuContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + disableOutsideScroll: false, + onDismiss: () => context.onOpenChange(false) + } + ); +}); +var Slot = createSlot("MenuContent.ScrollLock"); +var MenuContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeMenu, + loop = false, + trapFocus, + onOpenAutoFocus, + onCloseAutoFocus, + disableOutsidePointerEvents, + onEntryFocus, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + disableOutsideScroll, + ...contentProps + } = props; + const context = useMenuContext(CONTENT_NAME, __scopeMenu); + const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu); + const popperScope = usePopperScope(__scopeMenu); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu); + const getItems = useCollection(__scopeMenu); + const [currentItemId, setCurrentItemId] = React.useState(null); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange); + const timerRef = React.useRef(0); + const searchRef = React.useRef(""); + const pointerGraceTimerRef = React.useRef(0); + const pointerGraceIntentRef = React.useRef(null); + const pointerDirRef = React.useRef("right"); + const lastPointerXRef = React.useRef(0); + const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment; + const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0; + const handleTypeaheadSearch = (key) => { + const search = searchRef.current + key; + const items = getItems().filter((item) => !item.disabled); + const currentItem = document.activeElement; + const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue; + const values = items.map((item) => item.textValue); + const nextMatch = getNextMatch(values, search, currentMatch); + const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current; + (function updateSearch(value) { + searchRef.current = value; + window.clearTimeout(timerRef.current); + if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3); + })(search); + if (newItem) { + setTimeout(() => newItem.focus()); + } + }; + React.useEffect(() => { + return () => window.clearTimeout(timerRef.current); + }, []); + useFocusGuards(); + const isPointerMovingToSubmenu = React.useCallback((event) => { + const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side; + return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area); + }, []); + return /* @__PURE__ */ jsx( + MenuContentProvider, + { + scope: __scopeMenu, + searchRef, + onItemEnter: React.useCallback( + (event) => { + if (isPointerMovingToSubmenu(event)) event.preventDefault(); + }, + [isPointerMovingToSubmenu] + ), + onItemLeave: React.useCallback( + (event) => { + if (isPointerMovingToSubmenu(event)) return; + contentRef.current?.focus(); + setCurrentItemId(null); + }, + [isPointerMovingToSubmenu] + ), + onTriggerLeave: React.useCallback( + (event) => { + if (isPointerMovingToSubmenu(event)) event.preventDefault(); + }, + [isPointerMovingToSubmenu] + ), + pointerGraceTimerRef, + onPointerGraceIntentChange: React.useCallback((intent) => { + pointerGraceIntentRef.current = intent; + }, []), + children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx( + FocusScope, + { + asChild: true, + trapped: trapFocus, + onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => { + event.preventDefault(); + contentRef.current?.focus({ preventScroll: true }); + }), + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ jsx( + DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + children: /* @__PURE__ */ jsx( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + dir: rootContext.dir, + orientation: "vertical", + loop, + currentTabStopId: currentItemId, + onCurrentTabStopIdChange: setCurrentItemId, + onEntryFocus: composeEventHandlers(onEntryFocus, (event) => { + if (!rootContext.isUsingKeyboardRef.current) event.preventDefault(); + }), + preventScrollOnEntryFocus: true, + children: /* @__PURE__ */ jsx( + PopperPrimitive.Content, + { + role: "menu", + "aria-orientation": "vertical", + "data-state": getOpenState(context.open), + "data-radix-menu-content": "", + dir: rootContext.dir, + ...popperScope, + ...contentProps, + ref: composedRefs, + style: { outline: "none", ...contentProps.style }, + onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => { + const target = event.target; + const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget; + const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; + const isCharacterKey = event.key.length === 1; + if (isKeyDownInside) { + if (event.key === "Tab") event.preventDefault(); + if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key); + } + const content = contentRef.current; + if (event.target !== content) return; + if (!FIRST_LAST_KEYS.includes(event.key)) return; + event.preventDefault(); + const items = getItems().filter((item) => !item.disabled); + const candidateNodes = items.map((item) => item.ref.current); + if (LAST_KEYS.includes(event.key)) candidateNodes.reverse(); + focusFirst(candidateNodes); + }), + onBlur: composeEventHandlers(props.onBlur, (event) => { + if (!event.currentTarget.contains(event.target)) { + window.clearTimeout(timerRef.current); + searchRef.current = ""; + } + }), + onPointerMove: composeEventHandlers( + props.onPointerMove, + whenMouse((event) => { + const target = event.target; + const pointerXHasChanged = lastPointerXRef.current !== event.clientX; + if (event.currentTarget.contains(target) && pointerXHasChanged) { + const newDir = event.clientX > lastPointerXRef.current ? "right" : "left"; + pointerDirRef.current = newDir; + lastPointerXRef.current = event.clientX; + } + }) + ) + } + ) + } + ) + } + ) + } + ) }) + } + ); + } +); +MenuContent.displayName = CONTENT_NAME; +var GROUP_NAME = "MenuGroup"; +var MenuGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...groupProps } = props; + return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef }); + } +); +MenuGroup.displayName = GROUP_NAME; +var LABEL_NAME = "MenuLabel"; +var MenuLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...labelProps } = props; + return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef }); + } +); +MenuLabel.displayName = LABEL_NAME; +var ITEM_NAME = "MenuItem"; +var ITEM_SELECT = "menu.itemSelect"; +var MenuItem = React.forwardRef( + (props, forwardedRef) => { + const { disabled = false, onSelect, ...itemProps } = props; + const ref = React.useRef(null); + const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu); + const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu); + const composedRefs = useComposedRefs(forwardedRef, ref); + const isPointerDownRef = React.useRef(false); + const handleSelect = () => { + const menuItem = ref.current; + if (!disabled && menuItem) { + const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true }); + menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true }); + dispatchDiscreteCustomEvent(menuItem, itemSelectEvent); + if (itemSelectEvent.defaultPrevented) { + isPointerDownRef.current = false; + } else { + rootContext.onClose(); + } + } + }; + return /* @__PURE__ */ jsx( + MenuItemImpl, + { + ...itemProps, + ref: composedRefs, + disabled, + onClick: composeEventHandlers(props.onClick, handleSelect), + onPointerDown: (event) => { + props.onPointerDown?.(event); + isPointerDownRef.current = true; + }, + onPointerUp: composeEventHandlers(props.onPointerUp, (event) => { + if (!isPointerDownRef.current) event.currentTarget?.click(); + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + const isTypingAhead = contentContext.searchRef.current !== ""; + if (disabled || isTypingAhead && event.key === " ") return; + if (SELECTION_KEYS.includes(event.key)) { + event.currentTarget.click(); + event.preventDefault(); + } + }) + } + ); + } +); +MenuItem.displayName = ITEM_NAME; +var MenuItemImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, disabled = false, textValue, ...itemProps } = props; + const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + const [isFocused, setIsFocused] = React.useState(false); + const [textContent, setTextContent] = React.useState(""); + React.useEffect(() => { + const menuItem = ref.current; + if (menuItem) { + setTextContent((menuItem.textContent ?? "").trim()); + } + }, [itemProps.children]); + return /* @__PURE__ */ jsx( + Collection.ItemSlot, + { + scope: __scopeMenu, + disabled, + textValue: textValue ?? textContent, + children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx( + Primitive.div, + { + role: "menuitem", + "data-highlighted": isFocused ? "" : void 0, + "aria-disabled": disabled || void 0, + "data-disabled": disabled ? "" : void 0, + ...itemProps, + ref: composedRefs, + onPointerMove: composeEventHandlers( + props.onPointerMove, + whenMouse((event) => { + if (disabled) { + contentContext.onItemLeave(event); + } else { + contentContext.onItemEnter(event); + if (!event.defaultPrevented) { + const item = event.currentTarget; + item.focus({ preventScroll: true }); + } + } + }) + ), + onPointerLeave: composeEventHandlers( + props.onPointerLeave, + whenMouse((event) => contentContext.onItemLeave(event)) + ), + onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)), + onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false)) + } + ) }) + } + ); + } +); +var CHECKBOX_ITEM_NAME = "MenuCheckboxItem"; +var MenuCheckboxItem = React.forwardRef( + (props, forwardedRef) => { + const { checked = false, onCheckedChange, ...checkboxItemProps } = props; + return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx( + MenuItem, + { + role: "menuitemcheckbox", + "aria-checked": isIndeterminate(checked) ? "mixed" : checked, + ...checkboxItemProps, + ref: forwardedRef, + "data-state": getCheckedState(checked), + onSelect: composeEventHandlers( + checkboxItemProps.onSelect, + () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked), + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "MenuRadioGroup"; +var [RadioGroupProvider, useRadioGroupContext] = createMenuContext( + RADIO_GROUP_NAME, + { value: void 0, onValueChange: () => { + } } +); +var MenuRadioGroup = React.forwardRef( + (props, forwardedRef) => { + const { value, onValueChange, ...groupProps } = props; + const handleValueChange = useCallbackRef(onValueChange); + return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) }); + } +); +MenuRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "MenuRadioItem"; +var MenuRadioItem = React.forwardRef( + (props, forwardedRef) => { + const { value, ...radioItemProps } = props; + const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu); + const checked = value === context.value; + return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx( + MenuItem, + { + role: "menuitemradio", + "aria-checked": checked, + ...radioItemProps, + ref: forwardedRef, + "data-state": getCheckedState(checked), + onSelect: composeEventHandlers( + radioItemProps.onSelect, + () => context.onValueChange?.(value), + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +MenuRadioItem.displayName = RADIO_ITEM_NAME; +var ITEM_INDICATOR_NAME = "MenuItemIndicator"; +var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext( + ITEM_INDICATOR_NAME, + { checked: false } +); +var MenuItemIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, forceMount, ...itemIndicatorProps } = props; + const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu); + return /* @__PURE__ */ jsx( + Presence, + { + present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true, + children: /* @__PURE__ */ jsx( + Primitive.span, + { + ...itemIndicatorProps, + ref: forwardedRef, + "data-state": getCheckedState(indicatorContext.checked) + } + ) + } + ); + } +); +MenuItemIndicator.displayName = ITEM_INDICATOR_NAME; +var SEPARATOR_NAME = "MenuSeparator"; +var MenuSeparator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...separatorProps } = props; + return /* @__PURE__ */ jsx( + Primitive.div, + { + role: "separator", + "aria-orientation": "horizontal", + ...separatorProps, + ref: forwardedRef + } + ); + } +); +MenuSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "MenuArrow"; +var MenuArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenu, ...arrowProps } = props; + const popperScope = usePopperScope(__scopeMenu); + return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); + } +); +MenuArrow.displayName = ARROW_NAME; +var SUB_NAME = "MenuSub"; +var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME); +var MenuSub = (props) => { + const { __scopeMenu, children, open = false, onOpenChange } = props; + const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu); + const popperScope = usePopperScope(__scopeMenu); + const [trigger, setTrigger] = React.useState(null); + const [content, setContent] = React.useState(null); + const handleOpenChange = useCallbackRef(onOpenChange); + React.useEffect(() => { + if (parentMenuContext.open === false) handleOpenChange(false); + return () => handleOpenChange(false); + }, [parentMenuContext.open, handleOpenChange]); + return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx( + MenuProvider, + { + scope: __scopeMenu, + open, + onOpenChange: handleOpenChange, + content, + onContentChange: setContent, + children: /* @__PURE__ */ jsx( + MenuSubProvider, + { + scope: __scopeMenu, + contentId: useId(), + triggerId: useId(), + trigger, + onTriggerChange: setTrigger, + children + } + ) + } + ) }); +}; +MenuSub.displayName = SUB_NAME; +var SUB_TRIGGER_NAME = "MenuSubTrigger"; +var MenuSubTrigger = React.forwardRef( + (props, forwardedRef) => { + const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu); + const openTimerRef = React.useRef(null); + const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext; + const scope = { __scopeMenu: props.__scopeMenu }; + const clearOpenTimer = React.useCallback(() => { + if (openTimerRef.current) window.clearTimeout(openTimerRef.current); + openTimerRef.current = null; + }, []); + React.useEffect(() => clearOpenTimer, [clearOpenTimer]); + React.useEffect(() => { + const pointerGraceTimer = pointerGraceTimerRef.current; + return () => { + window.clearTimeout(pointerGraceTimer); + onPointerGraceIntentChange(null); + }; + }, [pointerGraceTimerRef, onPointerGraceIntentChange]); + return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx( + MenuItemImpl, + { + id: subContext.triggerId, + "aria-haspopup": "menu", + "aria-expanded": context.open, + "aria-controls": context.open ? subContext.contentId : void 0, + "data-state": getOpenState(context.open), + ...props, + ref: composeRefs(forwardedRef, subContext.onTriggerChange), + onClick: (event) => { + props.onClick?.(event); + if (props.disabled || event.defaultPrevented) return; + event.currentTarget.focus(); + if (!context.open) context.onOpenChange(true); + }, + onPointerMove: composeEventHandlers( + props.onPointerMove, + whenMouse((event) => { + contentContext.onItemEnter(event); + if (event.defaultPrevented) return; + if (!props.disabled && !context.open && !openTimerRef.current) { + contentContext.onPointerGraceIntentChange(null); + openTimerRef.current = window.setTimeout(() => { + context.onOpenChange(true); + clearOpenTimer(); + }, 100); + } + }) + ), + onPointerLeave: composeEventHandlers( + props.onPointerLeave, + whenMouse((event) => { + clearOpenTimer(); + const contentRect = context.content?.getBoundingClientRect(); + if (contentRect) { + const side = context.content?.dataset.side; + const rightSide = side === "right"; + const bleed = rightSide ? -5 : 5; + const contentNearEdge = contentRect[rightSide ? "left" : "right"]; + const contentFarEdge = contentRect[rightSide ? "right" : "left"]; + contentContext.onPointerGraceIntentChange({ + area: [ + // Apply a bleed on clientX to ensure that our exit point is + // consistently within polygon bounds + { x: event.clientX + bleed, y: event.clientY }, + { x: contentNearEdge, y: contentRect.top }, + { x: contentFarEdge, y: contentRect.top }, + { x: contentFarEdge, y: contentRect.bottom }, + { x: contentNearEdge, y: contentRect.bottom } + ], + side + }); + window.clearTimeout(pointerGraceTimerRef.current); + pointerGraceTimerRef.current = window.setTimeout( + () => contentContext.onPointerGraceIntentChange(null), + 300 + ); + } else { + contentContext.onTriggerLeave(event); + if (event.defaultPrevented) return; + contentContext.onPointerGraceIntentChange(null); + } + }) + ), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + const isTypingAhead = contentContext.searchRef.current !== ""; + if (props.disabled || isTypingAhead && event.key === " ") return; + if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) { + context.onOpenChange(true); + context.content?.focus(); + event.preventDefault(); + } + }) + } + ) }); + } +); +MenuSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "MenuSubContent"; +var MenuSubContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu); + const { forceMount = portalContext.forceMount, align = "start", ...subContentProps } = props; + const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); + const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu); + const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx( + MenuContentImpl, + { + id: subContext.contentId, + "aria-labelledby": subContext.triggerId, + ...subContentProps, + ref: composedRefs, + align, + side: rootContext.dir === "rtl" ? "left" : "right", + disableOutsidePointerEvents: false, + disableOutsideScroll: false, + trapFocus: false, + onOpenAutoFocus: (event) => { + if (rootContext.isUsingKeyboardRef.current) ref.current?.focus(); + event.preventDefault(); + }, + onCloseAutoFocus: (event) => event.preventDefault(), + onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => { + if (event.target !== subContext.trigger) context.onOpenChange(false); + }), + onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => { + rootContext.onClose(); + event.preventDefault(); + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + const isKeyDownInside = event.currentTarget.contains(event.target); + const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key); + if (isKeyDownInside && isCloseKey) { + context.onOpenChange(false); + subContext.trigger?.focus(); + event.preventDefault(); + } + }) + } + ) }) }) }); + } +); +MenuSubContent.displayName = SUB_CONTENT_NAME; +function getOpenState(open) { + return open ? "open" : "closed"; +} +function isIndeterminate(checked) { + return checked === "indeterminate"; +} +function getCheckedState(checked) { + return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; +} +function focusFirst(candidates) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus(); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +function getNextMatch(values, search, currentMatch) { + const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); + const normalizedSearch = isRepeated ? search[0] : search; + const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; + let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0)); + const excludeCurrentMatch = normalizedSearch.length === 1; + if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch); + const nextMatch = wrappedValues.find( + (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()) + ); + return nextMatch !== currentMatch ? nextMatch : void 0; +} +function isPointInPolygon(point, polygon) { + const { x, y } = point; + let inside = false; + for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { + const ii = polygon[i]; + const jj = polygon[j]; + const xi = ii.x; + const yi = ii.y; + const xj = jj.x; + const yj = jj.y; + const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; + if (intersect) inside = !inside; + } + return inside; +} +function isPointerInGraceArea(event, area) { + if (!area) return false; + const cursorPos = { x: event.clientX, y: event.clientY }; + return isPointInPolygon(cursorPos, area); +} +function whenMouse(handler) { + return (event) => event.pointerType === "mouse" ? handler(event) : void 0; +} +var Root3 = Menu; +var Anchor2 = MenuAnchor; +var Portal = MenuPortal; +var Content2 = MenuContent; +var Group = MenuGroup; +var Label = MenuLabel; +var Item2 = MenuItem; +var CheckboxItem = MenuCheckboxItem; +var RadioGroup = MenuRadioGroup; +var RadioItem = MenuRadioItem; +var ItemIndicator = MenuItemIndicator; +var Separator = MenuSeparator; +var Arrow2 = MenuArrow; +var Sub = MenuSub; +var SubTrigger = MenuSubTrigger; +var SubContent = MenuSubContent; +export { + Anchor2 as Anchor, + Arrow2 as Arrow, + CheckboxItem, + Content2 as Content, + Group, + Item2 as Item, + ItemIndicator, + Label, + Menu, + MenuAnchor, + MenuArrow, + MenuCheckboxItem, + MenuContent, + MenuGroup, + MenuItem, + MenuItemIndicator, + MenuLabel, + MenuPortal, + MenuRadioGroup, + MenuRadioItem, + MenuSeparator, + MenuSub, + MenuSubContent, + MenuSubTrigger, + Portal, + RadioGroup, + RadioItem, + Root3 as Root, + Separator, + Sub, + SubContent, + SubTrigger, + createMenuScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..6d5219a52c66a6bf45aa3b0dfc4a9940675386ca --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/menu.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs, composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst SELECTION_KEYS = ['Enter', ' '];\nconst FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nconst LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS: Record = {\n ltr: [...SELECTION_KEYS, 'ArrowRight'],\n rtl: [...SELECTION_KEYS, 'ArrowLeft'],\n};\nconst SUB_CLOSE_KEYS: Record = {\n ltr: ['ArrowLeft'],\n rtl: ['ArrowRight'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'Menu';\n\ntype ItemData = { disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n MenuItemElement,\n ItemData\n>(MENU_NAME);\n\ntype ScopedProps

= P & { __scopeMenu?: Scope };\nconst [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope,\n]);\nconst usePopperScope = createPopperScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n content: MenuContentElement | null;\n onContentChange(content: MenuContentElement | null): void;\n};\n\nconst [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\n\ntype MenuRootContextValue = {\n onClose(): void;\n isUsingKeyboardRef: React.RefObject;\n dir: Direction;\n modal: boolean;\n};\n\nconst [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\n\ninterface MenuProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst Menu: React.FC = (props: ScopedProps) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n\n React.useEffect(() => {\n // Capture phase ensures we set the boolean before any side effects execute\n // in response to the key or pointer event as they might depend on this value.\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener('pointerdown', handlePointer, { capture: true, once: true });\n document.addEventListener('pointermove', handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => (isUsingKeyboardRef.current = false);\n document.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener('keydown', handleKeyDown, { capture: true });\n document.removeEventListener('pointerdown', handlePointer, { capture: true });\n document.removeEventListener('pointermove', handlePointer, { capture: true });\n };\n }, []);\n\n // Close the menu (and any open submenus) when the window loses focus, e.g. when\n // switching to another browser tab or application. Without this, submenus would\n // remain open when the page is re-focused, leaving the menu in an inconsistent state.\n // See: https://github.com/radix-ui/primitives/issues/3257\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const handleBlur = () => handleOpenChange(false);\n window.addEventListener('blur', handleBlur);\n return () => window.removeEventListener('blur', handleBlur);\n }, [open, handleOpenChange]);\n\n return (\n \n \n handleOpenChange(false), [handleOpenChange])}\n isUsingKeyboardRef={isUsingKeyboardRef}\n dir={direction}\n modal={modal}\n >\n {children}\n \n \n \n );\n};\n\nMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'MenuAnchor';\n\ntype MenuAnchorElement = React.ComponentRef;\ntype PopperAnchorProps = React.ComponentPropsWithoutRef;\ninterface MenuAnchorProps extends PopperAnchorProps {}\n\nconst MenuAnchor = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return ;\n },\n);\n\nMenuAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenuPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface MenuPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuPortal: React.FC = (props: ScopedProps) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenuContent';\n\ntype MenuContentContextValue = {\n onItemEnter(event: React.PointerEvent): void;\n onItemLeave(event: React.PointerEvent): void;\n onTriggerLeave(event: React.PointerEvent): void;\n searchRef: React.RefObject;\n pointerGraceTimerRef: React.MutableRefObject;\n onPointerGraceIntentChange(intent: GraceIntent | null): void;\n};\nconst [MenuContentProvider, useMenuContentContext] =\n createMenuContext(CONTENT_NAME);\n\ntype MenuContentElement = MenuRootContentTypeElement;\n/**\n * We purposefully don't union MenuRootContent and MenuSubContent props here because\n * they have conflicting prop types. We agreed that we would allow MenuSubContent to\n * accept props that it would just ignore.\n */\ninterface MenuContentProps extends MenuRootContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n\n return (\n \n \n \n {rootContext.modal ? (\n \n ) : (\n \n )}\n \n \n \n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuRootContentTypeElement = MenuContentImplElement;\ninterface MenuRootContentTypeProps extends Omit<\n MenuContentImplProps,\n keyof MenuContentImplPrivateProps\n> {}\n\nconst MenuRootContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n // Hide everything from ARIA except the `MenuContent`\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n event.preventDefault(),\n { checkForDefaultPrevented: false },\n )}\n onDismiss={() => context.onOpenChange(false)}\n />\n );\n },\n);\n\nconst MenuRootContentNonModal = React.forwardRef<\n MenuRootContentTypeElement,\n MenuRootContentTypeProps\n>((props: ScopedProps, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return (\n context.onOpenChange(false)}\n />\n );\n});\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuContentImplElement = React.ComponentRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ntype MenuContentImplPrivateProps = {\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n onDismiss?: DismissableLayerProps['onDismiss'];\n disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];\n\n /**\n * Whether scrolling outside the `MenuContent` should be prevented\n * (default: `false`)\n */\n disableOutsideScroll?: boolean;\n\n /**\n * Whether focus should be trapped within the `MenuContent`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped'];\n};\ninterface MenuContentImplProps\n extends MenuContentImplPrivateProps, Omit {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: RovingFocusGroupProps['loop'];\n\n onEntryFocus?: RovingFocusGroupProps['onEntryFocus'];\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst Slot = createSlot('MenuContent.ScrollLock');\n\nconst MenuContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef('');\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef('right');\n const lastPointerXRef = React.useRef(0);\n\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll\n ? { as: Slot, allowPinchZoom: true }\n : undefined;\n\n const handleTypeaheadSearch = (key: string) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n\n // Reset `searchRef` 1 second after it was last updated\n (function updateSearch(value: string) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n })(search);\n\n if (newItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => (newItem as HTMLElement).focus());\n }\n };\n\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n\n // Make sure the whole tree has focus guards as our `MenuContent` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const isPointerMovingToSubmenu = React.useCallback((event: React.PointerEvent) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n\n return (\n {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu],\n )}\n onItemLeave={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu],\n )}\n onTriggerLeave={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu],\n )}\n pointerGraceTimerRef={pointerGraceTimerRef}\n onPointerGraceIntentChange={React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, [])}\n >\n \n {\n // when opening, explicitly focus the content area only and leave\n // `onEntryFocus` in control of focusing first item\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n })}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n \n {\n // only focus first item when using keyboard\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n })}\n preventScrollOnEntryFocus\n >\n {\n // submenu key events bubble through portals. We only care about keys in this menu.\n const target = event.target as HTMLElement;\n const isKeyDownInside =\n target.closest('[data-radix-menu-content]') === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n // menus should not be navigated using tab key so we prevent it\n if (event.key === 'Tab') event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n // focus first/last item based on key pressed\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current!);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n })}\n onBlur={composeEventHandlers(props.onBlur, (event) => {\n // clear search buffer when leaving the menu\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = '';\n }\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target as HTMLElement;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n\n // We don't use `event.movementX` for this check because Safari will\n // always return `0` on a pointer event.\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n }),\n )}\n />\n \n \n \n \n \n );\n },\n);\n\nMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenuGroup';\n\ntype MenuGroupElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface MenuGroupProps extends PrimitiveDivProps {}\n\nconst MenuGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return ;\n },\n);\n\nMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenuLabel';\n\ntype MenuLabelElement = React.ComponentRef;\ninterface MenuLabelProps extends PrimitiveDivProps {}\n\nconst MenuLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return ;\n },\n);\n\nMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenuItem';\nconst ITEM_SELECT = 'menu.itemSelect';\n\ntype MenuItemElement = MenuItemImplElement;\ninterface MenuItemProps extends Omit {\n onSelect?: (event: Event) => void;\n}\n\nconst MenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n\n return (\n {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n }}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n // Pointer down can move to a different menu item which should activate it on pointer up.\n // We dispatch a click for selection to allow composition with click based triggers and to\n // prevent Firefox from getting stuck in text selection mode when the menu closes.\n if (!isPointerDownRef.current) event.currentTarget?.click();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== '';\n if (disabled || (isTypingAhead && event.key === ' ')) return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n /**\n * We prevent default browser behaviour for selection keys as they should trigger\n * a selection only:\n * - prevents space from scrolling the page.\n * - if keydown causes focus to move, prevents keydown from firing on the new target.\n */\n event.preventDefault();\n }\n })}\n />\n );\n },\n);\n\nMenuItem.displayName = ITEM_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuItemImplElement = React.ComponentRef;\ninterface MenuItemImplProps extends PrimitiveDivProps {\n disabled?: boolean;\n textValue?: string;\n}\n\nconst MenuItemImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n\n // get the item's `.textContent` as default strategy for typeahead `textValue`\n const [textContent, setTextContent] = React.useState('');\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? '').trim());\n }\n }, [itemProps.children]);\n\n return (\n \n \n {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n }),\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event)),\n )}\n onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n />\n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\n\ntype MenuCheckboxItemElement = MenuItemElement;\n\ntype CheckedState = boolean | 'indeterminate';\n\ninterface MenuCheckboxItemProps extends MenuItemProps {\n checked?: CheckedState;\n // `onCheckedChange` can never be called with `\"indeterminate\"` from the inside\n onCheckedChange?: (checked: boolean) => void;\n}\n\nconst MenuCheckboxItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return (\n \n onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenuRadioGroup';\n\nconst [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: undefined, onValueChange: () => {} },\n);\n\ntype MenuRadioGroupElement = React.ComponentRef;\ninterface MenuRadioGroupProps extends MenuGroupProps {\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\nconst MenuRadioGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return (\n \n \n \n );\n },\n);\n\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenuRadioItem';\n\ntype MenuRadioItemElement = React.ComponentRef;\ninterface MenuRadioItemProps extends MenuItemProps {\n value: string;\n}\n\nconst MenuRadioItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return (\n \n context.onValueChange?.(value),\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'MenuItemIndicator';\n\ntype CheckboxContextValue = { checked: CheckedState };\n\nconst [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false },\n);\n\ntype MenuItemIndicatorElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface MenuItemIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuItemIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return (\n \n \n \n );\n },\n);\n\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenuSeparator';\n\ntype MenuSeparatorElement = React.ComponentRef;\ninterface MenuSeparatorProps extends PrimitiveDivProps {}\n\nconst MenuSeparator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return (\n \n );\n },\n);\n\nMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenuArrow';\n\ntype MenuArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface MenuArrowProps extends PopperArrowProps {}\n\nconst MenuArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return ;\n },\n);\n\nMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenuSub';\n\ntype MenuSubContextValue = {\n contentId: string;\n triggerId: string;\n trigger: MenuSubTriggerElement | null;\n onTriggerChange(trigger: MenuSubTriggerElement | null): void;\n};\n\nconst [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\n\ninterface MenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst MenuSub: React.FC = (props: ScopedProps) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n\n // Prevent the parent menu from reopening with open submenus.\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenuSubTrigger';\n\ntype MenuSubTriggerElement = MenuItemImplElement;\ninterface MenuSubTriggerProps extends MenuItemImplProps {}\n\nconst MenuSubTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n\n return (\n \n {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n /**\n * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n * and we rely heavily on `onFocusOutside` for submenus to close when switching\n * between separate submenus.\n */\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n }}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n }),\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n // TODO: make sure to update this when we change positioning logic\n const side = context.content?.dataset.side as Side;\n const rightSide = side === 'right';\n const bleed = rightSide ? -5 : +5;\n const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom },\n ],\n side,\n });\n\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300,\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n\n // There's 100ms where the user may leave an item before the submenu was opened.\n contentContext.onPointerGraceIntentChange(null);\n }\n }),\n )}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== '';\n if (props.disabled || (isTypingAhead && event.key === ' ')) return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n // The trigger may hold focus if opened via pointer interaction\n // so we ensure content is given focus again when switching to keyboard.\n context.content?.focus();\n // prevent window from scrolling\n event.preventDefault();\n }\n })}\n />\n \n );\n },\n);\n\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenuSubContent';\n\ntype AlignSubContent = Exclude<(typeof PopperPrimitive.ALIGN_OPTIONS)[number], 'center'>;\n\ntype MenuSubContentElement = MenuContentImplElement;\ninterface MenuSubContentProps extends Omit<\n MenuContentImplProps,\n keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'\n> {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n\n /**\n * Controls the direction the subcontent appears from its anchor menu item\n * Default: start\n */\n align?: AlignSubContent;\n}\n\nconst MenuSubContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, align = 'start', ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return (\n \n \n \n {\n // when opening a submenu, focus content for keyboard users only\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n }}\n // The menu might close because of focusing another menu item in the parent menu. We\n // don't want it to refocus the trigger in that case so we handle trigger focus ourselves.\n onCloseAutoFocus={(event) => event.preventDefault()}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n // on pointer interaction.\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n // ensure pressing escape in submenu doesn't escape full screen mode\n event.preventDefault();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n // Submenu key events bubble through portals. We only care about keys in this menu.\n const isKeyDownInside = event.currentTarget.contains(event.target as HTMLElement);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n // We focus manually because we prevented it in `onCloseAutoFocus`\n subContext.trigger?.focus();\n // prevent window from scrolling\n event.preventDefault();\n }\n })}\n />\n \n \n \n );\n },\n);\n\nMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getOpenState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getCheckedState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]!);\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction getNextMatch(values: string[], search: string, currentMatch?: string) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0]! : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find((value) =>\n value.toLowerCase().startsWith(normalizedSearch.toLowerCase()),\n );\n return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\ntype Side = 'left' | 'right';\ntype GraceIntent = { area: Polygon; side: Side };\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i]!;\n const jj = polygon[j]!;\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\nfunction isPointerInGraceArea(event: React.PointerEvent, area?: Polygon) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\n\nfunction whenMouse(handler: React.PointerEventHandler): React.PointerEventHandler {\n return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = Menu;\nconst Anchor = MenuAnchor;\nconst Portal = MenuPortal;\nconst Content = MenuContent;\nconst Group = MenuGroup;\nconst Label = MenuLabel;\nconst Item = MenuItem;\nconst CheckboxItem = MenuCheckboxItem;\nconst RadioGroup = MenuRadioGroup;\nconst RadioItem = MenuRadioItem;\nconst ItemIndicator = MenuItemIndicator;\nconst Separator = MenuSeparator;\nconst Arrow = MenuArrow;\nconst Sub = MenuSub;\nconst SubTrigger = MenuSubTrigger;\nconst SubContent = MenuSubContent;\n\nexport {\n createMenuScope,\n //\n Menu,\n MenuAnchor,\n MenuPortal,\n MenuContent,\n MenuGroup,\n MenuLabel,\n MenuItem,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuItemIndicator,\n MenuSeparator,\n MenuArrow,\n MenuSub,\n MenuSubTrigger,\n MenuSubContent,\n //\n Root,\n Anchor,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n MenuProps,\n MenuAnchorProps,\n MenuPortalProps,\n MenuContentProps,\n MenuGroupProps,\n MenuLabelProps,\n MenuItemProps,\n MenuCheckboxItemProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuItemIndicatorProps,\n MenuSeparatorProps,\n MenuArrowProps,\n MenuSubProps,\n MenuSubTriggerProps,\n MenuSubContentProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,iBAAiB,mBAAmB;AAC7C,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,WAAW,mCAAmC;AACvD,YAAY,sBAAsB;AAClC,SAAS,mCAAmC;AAC5C,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAiHrB;AA3GR,IAAM,iBAAiB,CAAC,SAAS,GAAG;AACpC,IAAM,aAAa,CAAC,aAAa,UAAU,MAAM;AACjD,IAAM,YAAY,CAAC,WAAW,YAAY,KAAK;AAC/C,IAAM,kBAAkB,CAAC,GAAG,YAAY,GAAG,SAAS;AACpD,IAAM,gBAA6C;AAAA,EACjD,KAAK,CAAC,GAAG,gBAAgB,YAAY;AAAA,EACrC,KAAK,CAAC,GAAG,gBAAgB,WAAW;AACtC;AACA,IAAM,iBAA8C;AAAA,EAClD,KAAK,CAAC,WAAW;AAAA,EACjB,KAAK,CAAC,YAAY;AACpB;AAMA,IAAM,YAAY;AAGlB,IAAM,CAAC,YAAY,eAAe,qBAAqB,IAAI,iBAGzD,SAAS;AAGX,IAAM,CAAC,mBAAmB,eAAe,IAAI,mBAAmB,WAAW;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACD,IAAM,iBAAiB,kBAAkB;AACzC,IAAM,2BAA2B,4BAA4B;AAS7D,IAAM,C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,UAAM,KAAK,GAAG;AACd,UAAM,KAAK,GAAG;AAGd,UAAM,YAAc,KAAK,MAAQ,KAAK,KAAQ,KAAK,KAAK,OAAO,IAAI,OAAO,KAAK,MAAM;AACrF,QAAI,UAAW,UAAS,CAAC;AAAA,EAC3B;AAEA,SAAO;AACT;AAEA,SAAS,qBAAqB,OAA2B,MAAgB;AACvE,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,YAAY,EAAE,GAAG,MAAM,SAAS,GAAG,MAAM,QAAQ;AACvD,SAAO,iBAAiB,WAAW,IAAI;AACzC;AAEA,SAAS,UAAa,SAAqE;AACzF,SAAO,CAAC,UAAW,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI;AACtE;AAEA,IAAMA,QAAO;AACb,IAAMC,UAAS;AACf,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAM,QAAQ;AACd,IAAM,QAAQ;AACd,IAAMC,QAAO;AACb,IAAM,eAAe;AACrB,IAAM,aAAa;AACnB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAClB,IAAMC,SAAQ;AACd,IAAM,MAAM;AACZ,IAAM,aAAa;AACnB,IAAM,aAAa;", + "names": ["Root", "Anchor", "Content", "Item", "Arrow"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b0c0bc6f7698f39e137e612f73ba985637666d58 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menu/package.json @@ -0,0 +1,86 @@ +{ + "name": "@radix-ui/react-menu", + "version": "2.1.18", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-dismissable-layer": "1.1.13", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-focus-scope": "1.1.10", + "@radix-ui/react-collection": "1.1.10", + "@radix-ui/react-portal": "1.1.12", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-popper": "1.3.1", + "@radix-ui/react-roving-focus": "1.1.13", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-callback-ref": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/test-data": "0.0.0", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/menu" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c3114db5d21fe1e9e1000e0124eb8fd0edc04e73 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/README.md @@ -0,0 +1,3 @@ +# `react-menubar` + +View docs [here](https://radix-ui.com/primitives/docs/components/menubar). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..5e358d0771a00a75b47755e46ac3495dbdf16f73 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.d.mts @@ -0,0 +1,115 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import * as MenuPrimitive from '@radix-ui/react-menu'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeMenubar?: Scope; +}; +declare const createMenubarScope: _radix_ui_react_context.CreateScope; +type RovingFocusGroupProps = React.ComponentPropsWithoutRef; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface MenubarProps extends PrimitiveDivProps { + value?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + loop?: RovingFocusGroupProps['loop']; + dir?: RovingFocusGroupProps['dir']; +} +declare const Menubar: React.ForwardRefExoticComponent>; +interface MenubarMenuProps { + value?: string; + children?: React.ReactNode; +} +declare const MenubarMenu: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface MenubarTriggerProps extends PrimitiveButtonProps { +} +declare const MenubarTrigger: React.ForwardRefExoticComponent>; +type MenuPortalProps = React.ComponentPropsWithoutRef; +interface MenubarPortalProps extends MenuPortalProps { +} +declare const MenubarPortal: React.FC; +type MenuContentProps = React.ComponentPropsWithoutRef; +interface MenubarContentProps extends Omit { +} +declare const MenubarContent: React.ForwardRefExoticComponent>; +type MenuGroupProps = React.ComponentPropsWithoutRef; +interface MenubarGroupProps extends MenuGroupProps { +} +declare const MenubarGroup: React.ForwardRefExoticComponent>; +type MenuLabelProps = React.ComponentPropsWithoutRef; +interface MenubarLabelProps extends MenuLabelProps { +} +declare const MenubarLabel: React.ForwardRefExoticComponent>; +type MenuItemProps = React.ComponentPropsWithoutRef; +interface MenubarItemProps extends MenuItemProps { +} +declare const MenubarItem: React.ForwardRefExoticComponent>; +type MenuCheckboxItemProps = React.ComponentPropsWithoutRef; +interface MenubarCheckboxItemProps extends MenuCheckboxItemProps { +} +declare const MenubarCheckboxItem: React.ForwardRefExoticComponent>; +type MenuRadioGroupProps = React.ComponentPropsWithoutRef; +interface MenubarRadioGroupProps extends MenuRadioGroupProps { +} +declare const MenubarRadioGroup: React.ForwardRefExoticComponent>; +type MenuRadioItemProps = React.ComponentPropsWithoutRef; +interface MenubarRadioItemProps extends MenuRadioItemProps { +} +declare const MenubarRadioItem: React.ForwardRefExoticComponent>; +type MenuItemIndicatorProps = React.ComponentPropsWithoutRef; +interface MenubarItemIndicatorProps extends MenuItemIndicatorProps { +} +declare const MenubarItemIndicator: React.ForwardRefExoticComponent>; +type MenuSeparatorProps = React.ComponentPropsWithoutRef; +interface MenubarSeparatorProps extends MenuSeparatorProps { +} +declare const MenubarSeparator: React.ForwardRefExoticComponent>; +type MenuArrowProps = React.ComponentPropsWithoutRef; +interface MenubarArrowProps extends MenuArrowProps { +} +declare const MenubarArrow: React.ForwardRefExoticComponent>; +interface MenubarSubProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; +} +declare const MenubarSub: React.FC; +type MenuSubTriggerProps = React.ComponentPropsWithoutRef; +interface MenubarSubTriggerProps extends MenuSubTriggerProps { +} +declare const MenubarSubTrigger: React.ForwardRefExoticComponent>; +type MenuSubContentProps = React.ComponentPropsWithoutRef; +interface MenubarSubContentProps extends MenuSubContentProps { +} +declare const MenubarSubContent: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Menu: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Group: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const CheckboxItem: React.ForwardRefExoticComponent>; +declare const RadioGroup: React.ForwardRefExoticComponent>; +declare const RadioItem: React.ForwardRefExoticComponent>; +declare const ItemIndicator: React.ForwardRefExoticComponent>; +declare const Separator: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Sub: React.FC; +declare const SubTrigger: React.ForwardRefExoticComponent>; +declare const SubContent: React.ForwardRefExoticComponent>; + +export { Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, Menubar, MenubarArrow, type MenubarArrowProps, MenubarCheckboxItem, type MenubarCheckboxItemProps, MenubarContent, type MenubarContentProps, MenubarGroup, type MenubarGroupProps, MenubarItem, MenubarItemIndicator, type MenubarItemIndicatorProps, type MenubarItemProps, MenubarLabel, type MenubarLabelProps, MenubarMenu, type MenubarMenuProps, MenubarPortal, type MenubarPortalProps, type MenubarProps, MenubarRadioGroup, type MenubarRadioGroupProps, MenubarRadioItem, type MenubarRadioItemProps, MenubarSeparator, type MenubarSeparatorProps, MenubarSub, MenubarSubContent, type MenubarSubContentProps, type MenubarSubProps, MenubarSubTrigger, type MenubarSubTriggerProps, MenubarTrigger, type MenubarTriggerProps, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger, createMenubarScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e358d0771a00a75b47755e46ac3495dbdf16f73 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.d.ts @@ -0,0 +1,115 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import * as MenuPrimitive from '@radix-ui/react-menu'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; +import { Primitive } from '@radix-ui/react-primitive'; + +type ScopedProps

= P & { + __scopeMenubar?: Scope; +}; +declare const createMenubarScope: _radix_ui_react_context.CreateScope; +type RovingFocusGroupProps = React.ComponentPropsWithoutRef; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface MenubarProps extends PrimitiveDivProps { + value?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + loop?: RovingFocusGroupProps['loop']; + dir?: RovingFocusGroupProps['dir']; +} +declare const Menubar: React.ForwardRefExoticComponent>; +interface MenubarMenuProps { + value?: string; + children?: React.ReactNode; +} +declare const MenubarMenu: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface MenubarTriggerProps extends PrimitiveButtonProps { +} +declare const MenubarTrigger: React.ForwardRefExoticComponent>; +type MenuPortalProps = React.ComponentPropsWithoutRef; +interface MenubarPortalProps extends MenuPortalProps { +} +declare const MenubarPortal: React.FC; +type MenuContentProps = React.ComponentPropsWithoutRef; +interface MenubarContentProps extends Omit { +} +declare const MenubarContent: React.ForwardRefExoticComponent>; +type MenuGroupProps = React.ComponentPropsWithoutRef; +interface MenubarGroupProps extends MenuGroupProps { +} +declare const MenubarGroup: React.ForwardRefExoticComponent>; +type MenuLabelProps = React.ComponentPropsWithoutRef; +interface MenubarLabelProps extends MenuLabelProps { +} +declare const MenubarLabel: React.ForwardRefExoticComponent>; +type MenuItemProps = React.ComponentPropsWithoutRef; +interface MenubarItemProps extends MenuItemProps { +} +declare const MenubarItem: React.ForwardRefExoticComponent>; +type MenuCheckboxItemProps = React.ComponentPropsWithoutRef; +interface MenubarCheckboxItemProps extends MenuCheckboxItemProps { +} +declare const MenubarCheckboxItem: React.ForwardRefExoticComponent>; +type MenuRadioGroupProps = React.ComponentPropsWithoutRef; +interface MenubarRadioGroupProps extends MenuRadioGroupProps { +} +declare const MenubarRadioGroup: React.ForwardRefExoticComponent>; +type MenuRadioItemProps = React.ComponentPropsWithoutRef; +interface MenubarRadioItemProps extends MenuRadioItemProps { +} +declare const MenubarRadioItem: React.ForwardRefExoticComponent>; +type MenuItemIndicatorProps = React.ComponentPropsWithoutRef; +interface MenubarItemIndicatorProps extends MenuItemIndicatorProps { +} +declare const MenubarItemIndicator: React.ForwardRefExoticComponent>; +type MenuSeparatorProps = React.ComponentPropsWithoutRef; +interface MenubarSeparatorProps extends MenuSeparatorProps { +} +declare const MenubarSeparator: React.ForwardRefExoticComponent>; +type MenuArrowProps = React.ComponentPropsWithoutRef; +interface MenubarArrowProps extends MenuArrowProps { +} +declare const MenubarArrow: React.ForwardRefExoticComponent>; +interface MenubarSubProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; +} +declare const MenubarSub: React.FC; +type MenuSubTriggerProps = React.ComponentPropsWithoutRef; +interface MenubarSubTriggerProps extends MenuSubTriggerProps { +} +declare const MenubarSubTrigger: React.ForwardRefExoticComponent>; +type MenuSubContentProps = React.ComponentPropsWithoutRef; +interface MenubarSubContentProps extends MenuSubContentProps { +} +declare const MenubarSubContent: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Menu: { + (props: ScopedProps): react_jsx_runtime.JSX.Element; + displayName: string; +}; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Group: React.ForwardRefExoticComponent>; +declare const Label: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const CheckboxItem: React.ForwardRefExoticComponent>; +declare const RadioGroup: React.ForwardRefExoticComponent>; +declare const RadioItem: React.ForwardRefExoticComponent>; +declare const ItemIndicator: React.ForwardRefExoticComponent>; +declare const Separator: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; +declare const Sub: React.FC; +declare const SubTrigger: React.ForwardRefExoticComponent>; +declare const SubContent: React.ForwardRefExoticComponent>; + +export { Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Menu, Menubar, MenubarArrow, type MenubarArrowProps, MenubarCheckboxItem, type MenubarCheckboxItemProps, MenubarContent, type MenubarContentProps, MenubarGroup, type MenubarGroupProps, MenubarItem, MenubarItemIndicator, type MenubarItemIndicatorProps, type MenubarItemProps, MenubarLabel, type MenubarLabelProps, MenubarMenu, type MenubarMenuProps, MenubarPortal, type MenubarPortalProps, type MenubarProps, MenubarRadioGroup, type MenubarRadioGroupProps, MenubarRadioItem, type MenubarRadioItemProps, MenubarSeparator, type MenubarSeparatorProps, MenubarSub, MenubarSubContent, type MenubarSubContentProps, type MenubarSubProps, MenubarSubTrigger, type MenubarSubTriggerProps, MenubarTrigger, type MenubarTriggerProps, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger, createMenubarScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..86a52a0df095a304435e1d5eb8a40cb0f76e96c4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.js @@ -0,0 +1,502 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Arrow: () => Arrow2, + CheckboxItem: () => CheckboxItem2, + Content: () => Content2, + Group: () => Group2, + Item: () => Item3, + ItemIndicator: () => ItemIndicator2, + Label: () => Label2, + Menu: () => Menu, + Menubar: () => Menubar, + MenubarArrow: () => MenubarArrow, + MenubarCheckboxItem: () => MenubarCheckboxItem, + MenubarContent: () => MenubarContent, + MenubarGroup: () => MenubarGroup, + MenubarItem: () => MenubarItem, + MenubarItemIndicator: () => MenubarItemIndicator, + MenubarLabel: () => MenubarLabel, + MenubarMenu: () => MenubarMenu, + MenubarPortal: () => MenubarPortal, + MenubarRadioGroup: () => MenubarRadioGroup, + MenubarRadioItem: () => MenubarRadioItem, + MenubarSeparator: () => MenubarSeparator, + MenubarSub: () => MenubarSub, + MenubarSubContent: () => MenubarSubContent, + MenubarSubTrigger: () => MenubarSubTrigger, + MenubarTrigger: () => MenubarTrigger, + Portal: () => Portal2, + RadioGroup: () => RadioGroup2, + RadioItem: () => RadioItem2, + Root: () => Root3, + Separator: () => Separator2, + Sub: () => Sub2, + SubContent: () => SubContent2, + SubTrigger: () => SubTrigger2, + Trigger: () => Trigger, + createMenubarScope: () => createMenubarScope +}); +module.exports = __toCommonJS(index_exports); + +// src/menubar.tsx +var React = __toESM(require("react")); +var import_react_collection = require("@radix-ui/react-collection"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_id = require("@radix-ui/react-id"); +var MenuPrimitive = __toESM(require("@radix-ui/react-menu")); +var import_react_menu = require("@radix-ui/react-menu"); +var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus")); +var import_react_roving_focus = require("@radix-ui/react-roving-focus"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_jsx_runtime = require("react/jsx-runtime"); +var MENUBAR_NAME = "Menubar"; +var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(MENUBAR_NAME); +var [createMenubarContext, createMenubarScope] = (0, import_react_context.createContextScope)(MENUBAR_NAME, [ + createCollectionScope, + import_react_roving_focus.createRovingFocusGroupScope +]); +var useMenuScope = (0, import_react_menu.createMenuScope)(); +var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)(); +var [MenubarContextProvider, useMenubarContext] = createMenubarContext(MENUBAR_NAME); +var Menubar = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeMenubar, + value: valueProp, + onValueChange, + defaultValue, + loop = true, + dir, + ...menubarProps + } = props; + const direction = (0, import_react_direction.useDirection)(dir); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar); + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + onChange: onValueChange, + defaultProp: defaultValue ?? "", + caller: MENUBAR_NAME + }); + const [currentTabStopId, setCurrentTabStopId] = React.useState(null); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenubarContextProvider, + { + scope: __scopeMenubar, + value, + onMenuOpen: React.useCallback( + (value2) => { + setValue(value2); + setCurrentTabStopId(value2); + }, + [setValue] + ), + onMenuClose: React.useCallback(() => setValue(""), [setValue]), + onMenuToggle: React.useCallback( + (value2) => { + setValue((prevValue) => prevValue ? "" : value2); + setCurrentTabStopId(value2); + }, + [setValue] + ), + dir: direction, + loop, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: __scopeMenubar, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeMenubar, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation: "horizontal", + loop, + dir: direction, + currentTabStopId, + onCurrentTabStopIdChange: setCurrentTabStopId, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { role: "menubar", ...menubarProps, ref: forwardedRef }) + } + ) }) }) + } + ); + } +); +Menubar.displayName = MENUBAR_NAME; +var MENU_NAME = "MenubarMenu"; +var [MenubarMenuProvider, useMenubarMenuContext] = createMenubarContext(MENU_NAME); +var MenubarMenu = (props) => { + const { __scopeMenubar, value: valueProp, ...menuProps } = props; + const autoValue = (0, import_react_id.useId)(); + const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE"; + const context = useMenubarContext(MENU_NAME, __scopeMenubar); + const menuScope = useMenuScope(__scopeMenubar); + const triggerRef = React.useRef(null); + const wasKeyboardTriggerOpenRef = React.useRef(false); + const open = context.value === value; + React.useEffect(() => { + if (!open) wasKeyboardTriggerOpenRef.current = false; + }, [open]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenubarMenuProvider, + { + scope: __scopeMenubar, + value, + triggerId: (0, import_react_id.useId)(), + triggerRef, + contentId: (0, import_react_id.useId)(), + wasKeyboardTriggerOpenRef, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuPrimitive.Root, + { + ...menuScope, + open, + onOpenChange: (open2) => { + if (!open2) context.onMenuClose(); + }, + modal: false, + dir: context.dir, + ...menuProps + } + ) + } + ); +}; +MenubarMenu.displayName = MENU_NAME; +var TRIGGER_NAME = "MenubarTrigger"; +var MenubarTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, disabled = false, ...triggerProps } = props; + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar); + const menuScope = useMenuScope(__scopeMenubar); + const context = useMenubarContext(TRIGGER_NAME, __scopeMenubar); + const menuContext = useMenubarMenuContext(TRIGGER_NAME, __scopeMenubar); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref, menuContext.triggerRef); + const [isFocused, setIsFocused] = React.useState(false); + const open = context.value === menuContext.value; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, { scope: __scopeMenubar, value: menuContext.value, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RovingFocusGroup.Item, + { + asChild: true, + ...rovingFocusGroupScope, + focusable: !disabled, + tabStopId: menuContext.value, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + role: "menuitem", + id: menuContext.triggerId, + "aria-haspopup": "menu", + "aria-expanded": open, + "aria-controls": open ? menuContext.contentId : void 0, + "data-highlighted": isFocused ? "" : void 0, + "data-state": open ? "open" : "closed", + "data-disabled": disabled ? "" : void 0, + disabled, + ...triggerProps, + ref: composedRefs, + onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => { + if (!disabled && event.button === 0 && event.ctrlKey === false) { + context.onMenuOpen(menuContext.value); + if (!open) event.preventDefault(); + } + }), + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, () => { + const menubarOpen = Boolean(context.value); + if (menubarOpen && !open) { + context.onMenuOpen(menuContext.value); + ref.current?.focus(); + } + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + if (disabled) return; + if (["Enter", " "].includes(event.key)) context.onMenuToggle(menuContext.value); + if (event.key === "ArrowDown") context.onMenuOpen(menuContext.value); + if (["Enter", " ", "ArrowDown"].includes(event.key)) { + menuContext.wasKeyboardTriggerOpenRef.current = true; + event.preventDefault(); + } + }), + onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => setIsFocused(true)), + onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, () => setIsFocused(false)) + } + ) }) + } + ) }); + } +); +MenubarTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "MenubarPortal"; +var MenubarPortal = (props) => { + const { __scopeMenubar, ...portalProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Portal, { ...menuScope, ...portalProps }); +}; +MenubarPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "MenubarContent"; +var MenubarContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, align = "start", ...contentProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + const context = useMenubarContext(CONTENT_NAME, __scopeMenubar); + const menuContext = useMenubarMenuContext(CONTENT_NAME, __scopeMenubar); + const getItems = useCollection(__scopeMenubar); + const hasInteractedOutsideRef = React.useRef(false); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuPrimitive.Content, + { + id: menuContext.contentId, + "aria-labelledby": menuContext.triggerId, + "data-radix-menubar-content": "", + ...menuScope, + ...contentProps, + ref: forwardedRef, + align, + onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => { + const menubarOpen = Boolean(context.value); + if (!menubarOpen && !hasInteractedOutsideRef.current) { + menuContext.triggerRef.current?.focus(); + } + hasInteractedOutsideRef.current = false; + event.preventDefault(); + }), + onFocusOutside: (0, import_primitive.composeEventHandlers)(props.onFocusOutside, (event) => { + const target = event.target; + const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target)); + if (isMenubarTrigger) event.preventDefault(); + }), + onInteractOutside: (0, import_primitive.composeEventHandlers)(props.onInteractOutside, () => { + hasInteractedOutsideRef.current = true; + }), + onEntryFocus: (event) => { + if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault(); + }, + onKeyDown: (0, import_primitive.composeEventHandlers)( + props.onKeyDown, + (event) => { + if (["ArrowRight", "ArrowLeft"].includes(event.key)) { + const target = event.target; + const targetIsSubTrigger = target.hasAttribute("data-radix-menubar-subtrigger"); + const isKeyDownInsideSubMenu = target.closest("[data-radix-menubar-content]") !== event.currentTarget; + const prevMenuKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft"; + const isPrevKey = prevMenuKey === event.key; + const isNextKey = !isPrevKey; + if (isNextKey && targetIsSubTrigger) return; + if (isKeyDownInsideSubMenu && isPrevKey) return; + const items = getItems().filter((item) => !item.disabled); + let candidateValues = items.map((item) => item.value); + if (isPrevKey) candidateValues.reverse(); + const currentIndex = candidateValues.indexOf(menuContext.value); + candidateValues = context.loop ? wrapArray(candidateValues, currentIndex + 1) : candidateValues.slice(currentIndex + 1); + const [nextValue] = candidateValues; + if (nextValue) context.onMenuOpen(nextValue); + } + }, + { checkForDefaultPrevented: false } + ), + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-menubar-content-available-width": "var(--radix-popper-available-width)", + "--radix-menubar-content-available-height": "var(--radix-popper-available-height)", + "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +MenubarContent.displayName = CONTENT_NAME; +var GROUP_NAME = "MenubarGroup"; +var MenubarGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...groupProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef }); + } +); +MenubarGroup.displayName = GROUP_NAME; +var LABEL_NAME = "MenubarLabel"; +var MenubarLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...labelProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef }); + } +); +MenubarLabel.displayName = LABEL_NAME; +var ITEM_NAME = "MenubarItem"; +var MenubarItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...itemProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef }); + } +); +MenubarItem.displayName = ITEM_NAME; +var CHECKBOX_ITEM_NAME = "MenubarCheckboxItem"; +var MenubarCheckboxItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...checkboxItemProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef }); + } +); +MenubarCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "MenubarRadioGroup"; +var MenubarRadioGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...radioGroupProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef }); + } +); +MenubarRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "MenubarRadioItem"; +var MenubarRadioItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...radioItemProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef }); + } +); +MenubarRadioItem.displayName = RADIO_ITEM_NAME; +var INDICATOR_NAME = "MenubarItemIndicator"; +var MenubarItemIndicator = React.forwardRef((props, forwardedRef) => { + const { __scopeMenubar, ...itemIndicatorProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef }); +}); +MenubarItemIndicator.displayName = INDICATOR_NAME; +var SEPARATOR_NAME = "MenubarSeparator"; +var MenubarSeparator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...separatorProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef }); + } +); +MenubarSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "MenubarArrow"; +var MenubarArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...arrowProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef }); + } +); +MenubarArrow.displayName = ARROW_NAME; +var SUB_NAME = "MenubarSub"; +var MenubarSub = (props) => { + const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props; + const menuScope = useMenuScope(__scopeMenubar); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: SUB_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children }); +}; +MenubarSub.displayName = SUB_NAME; +var SUB_TRIGGER_NAME = "MenubarSubTrigger"; +var MenubarSubTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...subTriggerProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuPrimitive.SubTrigger, + { + "data-radix-menubar-subtrigger": "", + ...menuScope, + ...subTriggerProps, + ref: forwardedRef + } + ); + } +); +MenubarSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "MenubarSubContent"; +var MenubarSubContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...subContentProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + MenuPrimitive.SubContent, + { + ...menuScope, + "data-radix-menubar-content": "", + ...subContentProps, + ref: forwardedRef, + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-menubar-content-available-width": "var(--radix-popper-available-width)", + "--radix-menubar-content-available-height": "var(--radix-popper-available-height)", + "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +MenubarSubContent.displayName = SUB_CONTENT_NAME; +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +var Root3 = Menubar; +var Menu = MenubarMenu; +var Trigger = MenubarTrigger; +var Portal2 = MenubarPortal; +var Content2 = MenubarContent; +var Group2 = MenubarGroup; +var Label2 = MenubarLabel; +var Item3 = MenubarItem; +var CheckboxItem2 = MenubarCheckboxItem; +var RadioGroup2 = MenubarRadioGroup; +var RadioItem2 = MenubarRadioItem; +var ItemIndicator2 = MenubarItemIndicator; +var Separator2 = MenubarSeparator; +var Arrow2 = MenubarArrow; +var Sub2 = MenubarSub; +var SubTrigger2 = MenubarSubTrigger; +var SubContent2 = MenubarSubContent; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5dd703b58c802331d7e63ed4292e8669b59dba19 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/menubar.tsx"], + "sourcesContent": ["'use client';\nexport {\n createMenubarScope,\n //\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarPortal,\n MenubarContent,\n MenubarGroup,\n MenubarLabel,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarItemIndicator,\n MenubarSeparator,\n MenubarArrow,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n //\n Root,\n Menu,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n} from './menubar';\nexport type {\n MenubarProps,\n MenubarMenuProps,\n MenubarTriggerProps,\n MenubarPortalProps,\n MenubarContentProps,\n MenubarGroupProps,\n MenubarLabelProps,\n MenubarItemProps,\n MenubarCheckboxItemProps,\n MenubarRadioGroupProps,\n MenubarRadioItemProps,\n MenubarItemIndicatorProps,\n MenubarSeparatorProps,\n MenubarArrowProps,\n MenubarSubProps,\n MenubarSubTriggerProps,\n MenubarSubContentProps,\n} from './menubar';\n", "import * as React from 'react';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * Menubar\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENUBAR_NAME = 'Menubar';\n\ntype ItemData = { value: string; disabled: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n MenubarTriggerElement,\n ItemData\n>(MENUBAR_NAME);\n\ntype ScopedProps

= P & { __scopeMenubar?: Scope };\nconst [createMenubarContext, createMenubarScope] = createContextScope(MENUBAR_NAME, [\n createCollectionScope,\n createRovingFocusGroupScope,\n]);\n\nconst useMenuScope = createMenuScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenubarContextValue = {\n value: string;\n dir: Direction;\n loop: boolean;\n onMenuOpen(value: string): void;\n onMenuClose(): void;\n onMenuToggle(value: string): void;\n};\n\nconst [MenubarContextProvider, useMenubarContext] =\n createMenubarContext(MENUBAR_NAME);\n\ntype MenubarElement = React.ComponentRef;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface MenubarProps extends PrimitiveDivProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n loop?: RovingFocusGroupProps['loop'];\n dir?: RovingFocusGroupProps['dir'];\n}\n\nconst Menubar = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeMenubar,\n value: valueProp,\n onValueChange,\n defaultValue,\n loop = true,\n dir,\n ...menubarProps\n } = props;\n const direction = useDirection(dir);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue ?? '',\n caller: MENUBAR_NAME,\n });\n\n // We need to manage tab stop id manually as `RovingFocusGroup` updates the stop\n // based on focus, and in some situations our triggers won't ever be given focus\n // (e.g. click to open and then outside to close)\n const [currentTabStopId, setCurrentTabStopId] = React.useState(null);\n\n return (\n {\n setValue(value);\n setCurrentTabStopId(value);\n },\n [setValue],\n )}\n onMenuClose={React.useCallback(() => setValue(''), [setValue])}\n onMenuToggle={React.useCallback(\n (value) => {\n setValue((prevValue) => (prevValue ? '' : value));\n // `openMenuOpen` and `onMenuToggle` are called exclusively so we\n // need to update the id in either case.\n setCurrentTabStopId(value);\n },\n [setValue],\n )}\n dir={direction}\n loop={loop}\n >\n \n \n \n \n \n \n \n \n );\n },\n);\n\nMenubar.displayName = MENUBAR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'MenubarMenu';\n\ntype MenubarMenuContextValue = {\n value: string;\n triggerId: string;\n triggerRef: React.RefObject;\n contentId: string;\n wasKeyboardTriggerOpenRef: React.MutableRefObject;\n};\n\nconst [MenubarMenuProvider, useMenubarMenuContext] =\n createMenubarContext(MENU_NAME);\n\ninterface MenubarMenuProps {\n value?: string;\n children?: React.ReactNode;\n}\n\nconst MenubarMenu = (props: ScopedProps) => {\n const { __scopeMenubar, value: valueProp, ...menuProps } = props;\n const autoValue = useId();\n // We need to provide an initial deterministic value as `useId` will return\n // empty string on the first render and we don't want to match our internal \"closed\" value.\n const value = valueProp || autoValue || 'LEGACY_REACT_AUTO_VALUE';\n const context = useMenubarContext(MENU_NAME, __scopeMenubar);\n const menuScope = useMenuScope(__scopeMenubar);\n const triggerRef = React.useRef(null);\n const wasKeyboardTriggerOpenRef = React.useRef(false);\n const open = context.value === value;\n\n React.useEffect(() => {\n if (!open) wasKeyboardTriggerOpenRef.current = false;\n }, [open]);\n\n return (\n \n {\n // Menu only calls `onOpenChange` when dismissing so we\n // want to close our MenuBar based on the same events.\n if (!open) context.onMenuClose();\n }}\n modal={false}\n dir={context.dir}\n {...menuProps}\n />\n \n );\n};\n\nMenubarMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'MenubarTrigger';\n\ntype MenubarTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface MenubarTriggerProps extends PrimitiveButtonProps {}\n\nconst MenubarTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, disabled = false, ...triggerProps } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);\n const menuScope = useMenuScope(__scopeMenubar);\n const context = useMenubarContext(TRIGGER_NAME, __scopeMenubar);\n const menuContext = useMenubarMenuContext(TRIGGER_NAME, __scopeMenubar);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, menuContext.triggerRef);\n const [isFocused, setIsFocused] = React.useState(false);\n const open = context.value === menuContext.value;\n\n return (\n \n \n \n {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onMenuOpen(menuContext.value);\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!open) event.preventDefault();\n }\n })}\n onPointerEnter={composeEventHandlers(props.onPointerEnter, () => {\n const menubarOpen = Boolean(context.value);\n if (menubarOpen && !open) {\n context.onMenuOpen(menuContext.value);\n ref.current?.focus();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onMenuToggle(menuContext.value);\n if (event.key === 'ArrowDown') context.onMenuOpen(menuContext.value);\n // prevent keydown from scrolling window / first focused item to execute\n // that keydown (inadvertently closing the menu)\n if (['Enter', ' ', 'ArrowDown'].includes(event.key)) {\n menuContext.wasKeyboardTriggerOpenRef.current = true;\n event.preventDefault();\n }\n })}\n onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n />\n \n \n \n );\n },\n);\n\nMenubarTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenubarPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef;\ninterface MenubarPortalProps extends MenuPortalProps {}\n\nconst MenubarPortal: React.FC = (props: ScopedProps) => {\n const { __scopeMenubar, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n};\n\nMenubarPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenubarContent';\n\ntype MenubarContentElement = React.ComponentRef;\ntype MenuContentProps = React.ComponentPropsWithoutRef;\ninterface MenubarContentProps extends Omit {}\n\nconst MenubarContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, align = 'start', ...contentProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n const context = useMenubarContext(CONTENT_NAME, __scopeMenubar);\n const menuContext = useMenubarMenuContext(CONTENT_NAME, __scopeMenubar);\n const getItems = useCollection(__scopeMenubar);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n {\n const menubarOpen = Boolean(context.value);\n if (!menubarOpen && !hasInteractedOutsideRef.current) {\n menuContext.triggerRef.current?.focus();\n }\n\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n const target = event.target as HTMLElement;\n const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target));\n if (isMenubarTrigger) event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, () => {\n hasInteractedOutsideRef.current = true;\n })}\n onEntryFocus={(event) => {\n if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault();\n }}\n onKeyDown={composeEventHandlers(\n props.onKeyDown,\n (event) => {\n if (['ArrowRight', 'ArrowLeft'].includes(event.key)) {\n const target = event.target as HTMLElement;\n const targetIsSubTrigger = target.hasAttribute('data-radix-menubar-subtrigger');\n const isKeyDownInsideSubMenu =\n target.closest('[data-radix-menubar-content]') !== event.currentTarget;\n\n const prevMenuKey = context.dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n const isPrevKey = prevMenuKey === event.key;\n const isNextKey = !isPrevKey;\n\n // Prevent navigation when we're opening a submenu\n if (isNextKey && targetIsSubTrigger) return;\n // or we're inside a submenu and are moving backwards to close it\n if (isKeyDownInsideSubMenu && isPrevKey) return;\n\n const items = getItems().filter((item) => !item.disabled);\n let candidateValues = items.map((item) => item.value);\n if (isPrevKey) candidateValues.reverse();\n\n const currentIndex = candidateValues.indexOf(menuContext.value);\n\n candidateValues = context.loop\n ? wrapArray(candidateValues, currentIndex + 1)\n : candidateValues.slice(currentIndex + 1);\n\n const [nextValue] = candidateValues;\n if (nextValue) context.onMenuOpen(nextValue);\n }\n },\n { checkForDefaultPrevented: false },\n )}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-menubar-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-menubar-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-menubar-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-menubar-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-menubar-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nMenubarContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenubarGroup';\n\ntype MenubarGroupElement = React.ComponentRef;\ntype MenuGroupProps = React.ComponentPropsWithoutRef;\ninterface MenubarGroupProps extends MenuGroupProps {}\n\nconst MenubarGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenubarLabel';\n\ntype MenubarLabelElement = React.ComponentRef;\ntype MenuLabelProps = React.ComponentPropsWithoutRef;\ninterface MenubarLabelProps extends MenuLabelProps {}\n\nconst MenubarLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenubarItem';\n\ntype MenubarItemElement = React.ComponentRef;\ntype MenuItemProps = React.ComponentPropsWithoutRef;\ninterface MenubarItemProps extends MenuItemProps {}\n\nconst MenubarItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenubarCheckboxItem';\n\ntype MenubarCheckboxItemElement = React.ComponentRef;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef;\ninterface MenubarCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst MenubarCheckboxItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenubarRadioGroup';\n\ntype MenubarRadioGroupElement = React.ComponentRef;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef;\ninterface MenubarRadioGroupProps extends MenuRadioGroupProps {}\n\nconst MenubarRadioGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenubarRadioItem';\n\ntype MenubarRadioItemElement = React.ComponentRef;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef;\ninterface MenubarRadioItemProps extends MenuRadioItemProps {}\n\nconst MenubarRadioItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'MenubarItemIndicator';\n\ntype MenubarItemIndicatorElement = React.ComponentRef;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef;\ninterface MenubarItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst MenubarItemIndicator = React.forwardRef<\n MenubarItemIndicatorElement,\n MenubarItemIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n});\n\nMenubarItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenubarSeparator';\n\ntype MenubarSeparatorElement = React.ComponentRef;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef;\ninterface MenubarSeparatorProps extends MenuSeparatorProps {}\n\nconst MenubarSeparator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenubarArrow';\n\ntype MenubarArrowElement = React.ComponentRef;\ntype MenuArrowProps = React.ComponentPropsWithoutRef;\ninterface MenubarArrowProps extends MenuArrowProps {}\n\nconst MenubarArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenubarSub';\n\ninterface MenubarSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst MenubarSub: React.FC = (props: ScopedProps) => {\n const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SUB_NAME,\n });\n\n return (\n \n {children}\n \n );\n};\n\nMenubarSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenubarSubTrigger';\n\ntype MenubarSubTriggerElement = React.ComponentRef;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef;\ninterface MenubarSubTriggerProps extends MenuSubTriggerProps {}\n\nconst MenubarSubTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return (\n \n );\n },\n);\n\nMenubarSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenubarSubContent';\n\ntype MenubarSubContentElement = React.ComponentRef;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef;\ninterface MenubarSubContentProps extends MenuSubContentProps {}\n\nconst MenubarSubContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n\n return (\n \n );\n },\n);\n\nMenubarSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = Menubar;\nconst Menu = MenubarMenu;\nconst Trigger = MenubarTrigger;\nconst Portal = MenubarPortal;\nconst Content = MenubarContent;\nconst Group = MenubarGroup;\nconst Label = MenubarLabel;\nconst Item = MenubarItem;\nconst CheckboxItem = MenubarCheckboxItem;\nconst RadioGroup = MenubarRadioGroup;\nconst RadioItem = MenubarRadioItem;\nconst ItemIndicator = MenubarItemIndicator;\nconst Separator = MenubarSeparator;\nconst Arrow = MenubarArrow;\nconst Sub = MenubarSub;\nconst SubTrigger = MenubarSubTrigger;\nconst SubContent = MenubarSubContent;\n\nexport {\n createMenubarScope,\n //\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarPortal,\n MenubarContent,\n MenubarGroup,\n MenubarLabel,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarItemIndicator,\n MenubarSeparator,\n MenubarArrow,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n //\n Root,\n Menu,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n MenubarProps,\n MenubarMenuProps,\n MenubarTriggerProps,\n MenubarPortalProps,\n MenubarContentProps,\n MenubarGroupProps,\n MenubarLabelProps,\n MenubarItemProps,\n MenubarCheckboxItemProps,\n MenubarRadioGroupProps,\n MenubarRadioItemProps,\n MenubarItemIndicatorProps,\n MenubarSeparatorProps,\n MenubarArrowProps,\n MenubarSubProps,\n MenubarSubTriggerProps,\n MenubarSubContentProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA,oBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,iBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,iBAAAC;AAAA,EAAA,WAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,8BAAiC;AACjC,6BAA6B;AAC7B,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,sBAAsB;AACtB,oBAA+B;AAC/B,wBAAgC;AAChC,uBAAkC;AAClC,gCAA4C;AAC5C,6BAA0B;AAC1B,0CAAqC;AA8GvB;AApGd,IAAM,eAAe;AAGrB,IAAM,CAAC,YAAY,eAAe,qBAAqB,QAAI,0CAGzD,YAAY;AAGd,IAAM,CAAC,sBAAsB,kBAAkB,QAAI,yCAAmB,cAAc;AAAA,EAClF;AAAA,EACA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;AAC/C,UAAM,YAAY,aAAa,cAAc;AAE7C,WACE;AAAA,MAAe;AAAA,MAAd;AAAA,QACE,GAAG;AAAA,QACJ,8BAA2B;AAAA,QAC1B,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,OAAO;AAAA,UACL,GAAG,MAAM;AAAA;AAAA,UAET,GAAG;AAAA,YACD,4CAA4C;AAAA,YAC5C,2CAA2C;AAAA,YAC3C,4CAA4C;AAAA,YAC5C,iCAAiC;AAAA,YACjC,kCAAkC;AAAA,UACpC;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAQhC,SAAS,UAAa,OAAY,YAAoB;AACpD,SAAO,MAAM,IAAO,CAAC,GAAG,UAAU,OAAO,aAAa,SAAS,MAAM,MAAM,CAAE;AAC/E;AAEA,IAAMC,QAAO;AACb,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;AACd,IAAMC,SAAQ;AACd,IAAMC,QAAO;AACb,IAAMC,gBAAe;AACrB,IAAMC,cAAa;AACnB,IAAMC,aAAY;AAClB,IAAMC,iBAAgB;AACtB,IAAMC,aAAY;AAClB,IAAMC,SAAQ;AACd,IAAMC,OAAM;AACZ,IAAMC,cAAa;AACnB,IAAMC,cAAa;", + "names": ["Arrow", "CheckboxItem", "Content", "Group", "Item", "ItemIndicator", "Label", "Portal", "RadioGroup", "RadioItem", "Root", "Separator", "Sub", "SubContent", "SubTrigger", "value", "open", "Root", "Portal", "Content", "Group", "Label", "Item", "CheckboxItem", "RadioGroup", "RadioItem", "ItemIndicator", "Separator", "Arrow", "Sub", "SubTrigger", "SubContent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2118076113a8bb89fda0e21d3e846027f15c341f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.mjs @@ -0,0 +1,470 @@ +"use client"; + +// src/menubar.tsx +import * as React from "react"; +import { createCollection } from "@radix-ui/react-collection"; +import { useDirection } from "@radix-ui/react-direction"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useId } from "@radix-ui/react-id"; +import * as MenuPrimitive from "@radix-ui/react-menu"; +import { createMenuScope } from "@radix-ui/react-menu"; +import * as RovingFocusGroup from "@radix-ui/react-roving-focus"; +import { createRovingFocusGroupScope } from "@radix-ui/react-roving-focus"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { jsx } from "react/jsx-runtime"; +var MENUBAR_NAME = "Menubar"; +var [Collection, useCollection, createCollectionScope] = createCollection(MENUBAR_NAME); +var [createMenubarContext, createMenubarScope] = createContextScope(MENUBAR_NAME, [ + createCollectionScope, + createRovingFocusGroupScope +]); +var useMenuScope = createMenuScope(); +var useRovingFocusGroupScope = createRovingFocusGroupScope(); +var [MenubarContextProvider, useMenubarContext] = createMenubarContext(MENUBAR_NAME); +var Menubar = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeMenubar, + value: valueProp, + onValueChange, + defaultValue, + loop = true, + dir, + ...menubarProps + } = props; + const direction = useDirection(dir); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar); + const [value, setValue] = useControllableState({ + prop: valueProp, + onChange: onValueChange, + defaultProp: defaultValue ?? "", + caller: MENUBAR_NAME + }); + const [currentTabStopId, setCurrentTabStopId] = React.useState(null); + return /* @__PURE__ */ jsx( + MenubarContextProvider, + { + scope: __scopeMenubar, + value, + onMenuOpen: React.useCallback( + (value2) => { + setValue(value2); + setCurrentTabStopId(value2); + }, + [setValue] + ), + onMenuClose: React.useCallback(() => setValue(""), [setValue]), + onMenuToggle: React.useCallback( + (value2) => { + setValue((prevValue) => prevValue ? "" : value2); + setCurrentTabStopId(value2); + }, + [setValue] + ), + dir: direction, + loop, + children: /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeMenubar, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeMenubar, children: /* @__PURE__ */ jsx( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation: "horizontal", + loop, + dir: direction, + currentTabStopId, + onCurrentTabStopIdChange: setCurrentTabStopId, + children: /* @__PURE__ */ jsx(Primitive.div, { role: "menubar", ...menubarProps, ref: forwardedRef }) + } + ) }) }) + } + ); + } +); +Menubar.displayName = MENUBAR_NAME; +var MENU_NAME = "MenubarMenu"; +var [MenubarMenuProvider, useMenubarMenuContext] = createMenubarContext(MENU_NAME); +var MenubarMenu = (props) => { + const { __scopeMenubar, value: valueProp, ...menuProps } = props; + const autoValue = useId(); + const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE"; + const context = useMenubarContext(MENU_NAME, __scopeMenubar); + const menuScope = useMenuScope(__scopeMenubar); + const triggerRef = React.useRef(null); + const wasKeyboardTriggerOpenRef = React.useRef(false); + const open = context.value === value; + React.useEffect(() => { + if (!open) wasKeyboardTriggerOpenRef.current = false; + }, [open]); + return /* @__PURE__ */ jsx( + MenubarMenuProvider, + { + scope: __scopeMenubar, + value, + triggerId: useId(), + triggerRef, + contentId: useId(), + wasKeyboardTriggerOpenRef, + children: /* @__PURE__ */ jsx( + MenuPrimitive.Root, + { + ...menuScope, + open, + onOpenChange: (open2) => { + if (!open2) context.onMenuClose(); + }, + modal: false, + dir: context.dir, + ...menuProps + } + ) + } + ); +}; +MenubarMenu.displayName = MENU_NAME; +var TRIGGER_NAME = "MenubarTrigger"; +var MenubarTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, disabled = false, ...triggerProps } = props; + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar); + const menuScope = useMenuScope(__scopeMenubar); + const context = useMenubarContext(TRIGGER_NAME, __scopeMenubar); + const menuContext = useMenubarMenuContext(TRIGGER_NAME, __scopeMenubar); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref, menuContext.triggerRef); + const [isFocused, setIsFocused] = React.useState(false); + const open = context.value === menuContext.value; + return /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeMenubar, value: menuContext.value, disabled, children: /* @__PURE__ */ jsx( + RovingFocusGroup.Item, + { + asChild: true, + ...rovingFocusGroupScope, + focusable: !disabled, + tabStopId: menuContext.value, + children: /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + role: "menuitem", + id: menuContext.triggerId, + "aria-haspopup": "menu", + "aria-expanded": open, + "aria-controls": open ? menuContext.contentId : void 0, + "data-highlighted": isFocused ? "" : void 0, + "data-state": open ? "open" : "closed", + "data-disabled": disabled ? "" : void 0, + disabled, + ...triggerProps, + ref: composedRefs, + onPointerDown: composeEventHandlers(props.onPointerDown, (event) => { + if (!disabled && event.button === 0 && event.ctrlKey === false) { + context.onMenuOpen(menuContext.value); + if (!open) event.preventDefault(); + } + }), + onPointerEnter: composeEventHandlers(props.onPointerEnter, () => { + const menubarOpen = Boolean(context.value); + if (menubarOpen && !open) { + context.onMenuOpen(menuContext.value); + ref.current?.focus(); + } + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + if (disabled) return; + if (["Enter", " "].includes(event.key)) context.onMenuToggle(menuContext.value); + if (event.key === "ArrowDown") context.onMenuOpen(menuContext.value); + if (["Enter", " ", "ArrowDown"].includes(event.key)) { + menuContext.wasKeyboardTriggerOpenRef.current = true; + event.preventDefault(); + } + }), + onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)), + onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false)) + } + ) }) + } + ) }); + } +); +MenubarTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "MenubarPortal"; +var MenubarPortal = (props) => { + const { __scopeMenubar, ...portalProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps }); +}; +MenubarPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "MenubarContent"; +var MenubarContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, align = "start", ...contentProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + const context = useMenubarContext(CONTENT_NAME, __scopeMenubar); + const menuContext = useMenubarMenuContext(CONTENT_NAME, __scopeMenubar); + const getItems = useCollection(__scopeMenubar); + const hasInteractedOutsideRef = React.useRef(false); + return /* @__PURE__ */ jsx( + MenuPrimitive.Content, + { + id: menuContext.contentId, + "aria-labelledby": menuContext.triggerId, + "data-radix-menubar-content": "", + ...menuScope, + ...contentProps, + ref: forwardedRef, + align, + onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { + const menubarOpen = Boolean(context.value); + if (!menubarOpen && !hasInteractedOutsideRef.current) { + menuContext.triggerRef.current?.focus(); + } + hasInteractedOutsideRef.current = false; + event.preventDefault(); + }), + onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => { + const target = event.target; + const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target)); + if (isMenubarTrigger) event.preventDefault(); + }), + onInteractOutside: composeEventHandlers(props.onInteractOutside, () => { + hasInteractedOutsideRef.current = true; + }), + onEntryFocus: (event) => { + if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault(); + }, + onKeyDown: composeEventHandlers( + props.onKeyDown, + (event) => { + if (["ArrowRight", "ArrowLeft"].includes(event.key)) { + const target = event.target; + const targetIsSubTrigger = target.hasAttribute("data-radix-menubar-subtrigger"); + const isKeyDownInsideSubMenu = target.closest("[data-radix-menubar-content]") !== event.currentTarget; + const prevMenuKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft"; + const isPrevKey = prevMenuKey === event.key; + const isNextKey = !isPrevKey; + if (isNextKey && targetIsSubTrigger) return; + if (isKeyDownInsideSubMenu && isPrevKey) return; + const items = getItems().filter((item) => !item.disabled); + let candidateValues = items.map((item) => item.value); + if (isPrevKey) candidateValues.reverse(); + const currentIndex = candidateValues.indexOf(menuContext.value); + candidateValues = context.loop ? wrapArray(candidateValues, currentIndex + 1) : candidateValues.slice(currentIndex + 1); + const [nextValue] = candidateValues; + if (nextValue) context.onMenuOpen(nextValue); + } + }, + { checkForDefaultPrevented: false } + ), + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-menubar-content-available-width": "var(--radix-popper-available-width)", + "--radix-menubar-content-available-height": "var(--radix-popper-available-height)", + "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +MenubarContent.displayName = CONTENT_NAME; +var GROUP_NAME = "MenubarGroup"; +var MenubarGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...groupProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef }); + } +); +MenubarGroup.displayName = GROUP_NAME; +var LABEL_NAME = "MenubarLabel"; +var MenubarLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...labelProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef }); + } +); +MenubarLabel.displayName = LABEL_NAME; +var ITEM_NAME = "MenubarItem"; +var MenubarItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...itemProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef }); + } +); +MenubarItem.displayName = ITEM_NAME; +var CHECKBOX_ITEM_NAME = "MenubarCheckboxItem"; +var MenubarCheckboxItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...checkboxItemProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef }); + } +); +MenubarCheckboxItem.displayName = CHECKBOX_ITEM_NAME; +var RADIO_GROUP_NAME = "MenubarRadioGroup"; +var MenubarRadioGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...radioGroupProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef }); + } +); +MenubarRadioGroup.displayName = RADIO_GROUP_NAME; +var RADIO_ITEM_NAME = "MenubarRadioItem"; +var MenubarRadioItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...radioItemProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef }); + } +); +MenubarRadioItem.displayName = RADIO_ITEM_NAME; +var INDICATOR_NAME = "MenubarItemIndicator"; +var MenubarItemIndicator = React.forwardRef((props, forwardedRef) => { + const { __scopeMenubar, ...itemIndicatorProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef }); +}); +MenubarItemIndicator.displayName = INDICATOR_NAME; +var SEPARATOR_NAME = "MenubarSeparator"; +var MenubarSeparator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...separatorProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef }); + } +); +MenubarSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "MenubarArrow"; +var MenubarArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...arrowProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef }); + } +); +MenubarArrow.displayName = ARROW_NAME; +var SUB_NAME = "MenubarSub"; +var MenubarSub = (props) => { + const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props; + const menuScope = useMenuScope(__scopeMenubar); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: SUB_NAME + }); + return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children }); +}; +MenubarSub.displayName = SUB_NAME; +var SUB_TRIGGER_NAME = "MenubarSubTrigger"; +var MenubarSubTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...subTriggerProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx( + MenuPrimitive.SubTrigger, + { + "data-radix-menubar-subtrigger": "", + ...menuScope, + ...subTriggerProps, + ref: forwardedRef + } + ); + } +); +MenubarSubTrigger.displayName = SUB_TRIGGER_NAME; +var SUB_CONTENT_NAME = "MenubarSubContent"; +var MenubarSubContent = React.forwardRef( + (props, forwardedRef) => { + const { __scopeMenubar, ...subContentProps } = props; + const menuScope = useMenuScope(__scopeMenubar); + return /* @__PURE__ */ jsx( + MenuPrimitive.SubContent, + { + ...menuScope, + "data-radix-menubar-content": "", + ...subContentProps, + ref: forwardedRef, + style: { + ...props.style, + // re-namespace exposed content custom properties + ...{ + "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-menubar-content-available-width": "var(--radix-popper-available-width)", + "--radix-menubar-content-available-height": "var(--radix-popper-available-height)", + "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); + } +); +MenubarSubContent.displayName = SUB_CONTENT_NAME; +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +var Root3 = Menubar; +var Menu = MenubarMenu; +var Trigger = MenubarTrigger; +var Portal2 = MenubarPortal; +var Content2 = MenubarContent; +var Group2 = MenubarGroup; +var Label2 = MenubarLabel; +var Item3 = MenubarItem; +var CheckboxItem2 = MenubarCheckboxItem; +var RadioGroup2 = MenubarRadioGroup; +var RadioItem2 = MenubarRadioItem; +var ItemIndicator2 = MenubarItemIndicator; +var Separator2 = MenubarSeparator; +var Arrow2 = MenubarArrow; +var Sub2 = MenubarSub; +var SubTrigger2 = MenubarSubTrigger; +var SubContent2 = MenubarSubContent; +export { + Arrow2 as Arrow, + CheckboxItem2 as CheckboxItem, + Content2 as Content, + Group2 as Group, + Item3 as Item, + ItemIndicator2 as ItemIndicator, + Label2 as Label, + Menu, + Menubar, + MenubarArrow, + MenubarCheckboxItem, + MenubarContent, + MenubarGroup, + MenubarItem, + MenubarItemIndicator, + MenubarLabel, + MenubarMenu, + MenubarPortal, + MenubarRadioGroup, + MenubarRadioItem, + MenubarSeparator, + MenubarSub, + MenubarSubContent, + MenubarSubTrigger, + MenubarTrigger, + Portal2 as Portal, + RadioGroup2 as RadioGroup, + RadioItem2 as RadioItem, + Root3 as Root, + Separator2 as Separator, + Sub2 as Sub, + SubContent2 as SubContent, + SubTrigger2 as SubTrigger, + Trigger, + createMenubarScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..6a85769bdee31db86d72a13aa5f0c16d2bea19b1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/menubar.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * Menubar\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENUBAR_NAME = 'Menubar';\n\ntype ItemData = { value: string; disabled: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n MenubarTriggerElement,\n ItemData\n>(MENUBAR_NAME);\n\ntype ScopedProps

= P & { __scopeMenubar?: Scope };\nconst [createMenubarContext, createMenubarScope] = createContextScope(MENUBAR_NAME, [\n createCollectionScope,\n createRovingFocusGroupScope,\n]);\n\nconst useMenuScope = createMenuScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenubarContextValue = {\n value: string;\n dir: Direction;\n loop: boolean;\n onMenuOpen(value: string): void;\n onMenuClose(): void;\n onMenuToggle(value: string): void;\n};\n\nconst [MenubarContextProvider, useMenubarContext] =\n createMenubarContext(MENUBAR_NAME);\n\ntype MenubarElement = React.ComponentRef;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface MenubarProps extends PrimitiveDivProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n loop?: RovingFocusGroupProps['loop'];\n dir?: RovingFocusGroupProps['dir'];\n}\n\nconst Menubar = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeMenubar,\n value: valueProp,\n onValueChange,\n defaultValue,\n loop = true,\n dir,\n ...menubarProps\n } = props;\n const direction = useDirection(dir);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue ?? '',\n caller: MENUBAR_NAME,\n });\n\n // We need to manage tab stop id manually as `RovingFocusGroup` updates the stop\n // based on focus, and in some situations our triggers won't ever be given focus\n // (e.g. click to open and then outside to close)\n const [currentTabStopId, setCurrentTabStopId] = React.useState(null);\n\n return (\n {\n setValue(value);\n setCurrentTabStopId(value);\n },\n [setValue],\n )}\n onMenuClose={React.useCallback(() => setValue(''), [setValue])}\n onMenuToggle={React.useCallback(\n (value) => {\n setValue((prevValue) => (prevValue ? '' : value));\n // `openMenuOpen` and `onMenuToggle` are called exclusively so we\n // need to update the id in either case.\n setCurrentTabStopId(value);\n },\n [setValue],\n )}\n dir={direction}\n loop={loop}\n >\n \n \n \n \n \n \n \n \n );\n },\n);\n\nMenubar.displayName = MENUBAR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'MenubarMenu';\n\ntype MenubarMenuContextValue = {\n value: string;\n triggerId: string;\n triggerRef: React.RefObject;\n contentId: string;\n wasKeyboardTriggerOpenRef: React.MutableRefObject;\n};\n\nconst [MenubarMenuProvider, useMenubarMenuContext] =\n createMenubarContext(MENU_NAME);\n\ninterface MenubarMenuProps {\n value?: string;\n children?: React.ReactNode;\n}\n\nconst MenubarMenu = (props: ScopedProps) => {\n const { __scopeMenubar, value: valueProp, ...menuProps } = props;\n const autoValue = useId();\n // We need to provide an initial deterministic value as `useId` will return\n // empty string on the first render and we don't want to match our internal \"closed\" value.\n const value = valueProp || autoValue || 'LEGACY_REACT_AUTO_VALUE';\n const context = useMenubarContext(MENU_NAME, __scopeMenubar);\n const menuScope = useMenuScope(__scopeMenubar);\n const triggerRef = React.useRef(null);\n const wasKeyboardTriggerOpenRef = React.useRef(false);\n const open = context.value === value;\n\n React.useEffect(() => {\n if (!open) wasKeyboardTriggerOpenRef.current = false;\n }, [open]);\n\n return (\n \n {\n // Menu only calls `onOpenChange` when dismissing so we\n // want to close our MenuBar based on the same events.\n if (!open) context.onMenuClose();\n }}\n modal={false}\n dir={context.dir}\n {...menuProps}\n />\n \n );\n};\n\nMenubarMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'MenubarTrigger';\n\ntype MenubarTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface MenubarTriggerProps extends PrimitiveButtonProps {}\n\nconst MenubarTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, disabled = false, ...triggerProps } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);\n const menuScope = useMenuScope(__scopeMenubar);\n const context = useMenubarContext(TRIGGER_NAME, __scopeMenubar);\n const menuContext = useMenubarMenuContext(TRIGGER_NAME, __scopeMenubar);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, menuContext.triggerRef);\n const [isFocused, setIsFocused] = React.useState(false);\n const open = context.value === menuContext.value;\n\n return (\n \n \n \n {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onMenuOpen(menuContext.value);\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!open) event.preventDefault();\n }\n })}\n onPointerEnter={composeEventHandlers(props.onPointerEnter, () => {\n const menubarOpen = Boolean(context.value);\n if (menubarOpen && !open) {\n context.onMenuOpen(menuContext.value);\n ref.current?.focus();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onMenuToggle(menuContext.value);\n if (event.key === 'ArrowDown') context.onMenuOpen(menuContext.value);\n // prevent keydown from scrolling window / first focused item to execute\n // that keydown (inadvertently closing the menu)\n if (['Enter', ' ', 'ArrowDown'].includes(event.key)) {\n menuContext.wasKeyboardTriggerOpenRef.current = true;\n event.preventDefault();\n }\n })}\n onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n />\n \n \n \n );\n },\n);\n\nMenubarTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenubarPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef;\ninterface MenubarPortalProps extends MenuPortalProps {}\n\nconst MenubarPortal: React.FC = (props: ScopedProps) => {\n const { __scopeMenubar, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n};\n\nMenubarPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenubarContent';\n\ntype MenubarContentElement = React.ComponentRef;\ntype MenuContentProps = React.ComponentPropsWithoutRef;\ninterface MenubarContentProps extends Omit {}\n\nconst MenubarContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, align = 'start', ...contentProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n const context = useMenubarContext(CONTENT_NAME, __scopeMenubar);\n const menuContext = useMenubarMenuContext(CONTENT_NAME, __scopeMenubar);\n const getItems = useCollection(__scopeMenubar);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n {\n const menubarOpen = Boolean(context.value);\n if (!menubarOpen && !hasInteractedOutsideRef.current) {\n menuContext.triggerRef.current?.focus();\n }\n\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n const target = event.target as HTMLElement;\n const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target));\n if (isMenubarTrigger) event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, () => {\n hasInteractedOutsideRef.current = true;\n })}\n onEntryFocus={(event) => {\n if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault();\n }}\n onKeyDown={composeEventHandlers(\n props.onKeyDown,\n (event) => {\n if (['ArrowRight', 'ArrowLeft'].includes(event.key)) {\n const target = event.target as HTMLElement;\n const targetIsSubTrigger = target.hasAttribute('data-radix-menubar-subtrigger');\n const isKeyDownInsideSubMenu =\n target.closest('[data-radix-menubar-content]') !== event.currentTarget;\n\n const prevMenuKey = context.dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n const isPrevKey = prevMenuKey === event.key;\n const isNextKey = !isPrevKey;\n\n // Prevent navigation when we're opening a submenu\n if (isNextKey && targetIsSubTrigger) return;\n // or we're inside a submenu and are moving backwards to close it\n if (isKeyDownInsideSubMenu && isPrevKey) return;\n\n const items = getItems().filter((item) => !item.disabled);\n let candidateValues = items.map((item) => item.value);\n if (isPrevKey) candidateValues.reverse();\n\n const currentIndex = candidateValues.indexOf(menuContext.value);\n\n candidateValues = context.loop\n ? wrapArray(candidateValues, currentIndex + 1)\n : candidateValues.slice(currentIndex + 1);\n\n const [nextValue] = candidateValues;\n if (nextValue) context.onMenuOpen(nextValue);\n }\n },\n { checkForDefaultPrevented: false },\n )}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-menubar-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-menubar-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-menubar-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-menubar-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-menubar-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\nMenubarContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenubarGroup';\n\ntype MenubarGroupElement = React.ComponentRef;\ntype MenuGroupProps = React.ComponentPropsWithoutRef;\ninterface MenubarGroupProps extends MenuGroupProps {}\n\nconst MenubarGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenubarLabel';\n\ntype MenubarLabelElement = React.ComponentRef;\ntype MenuLabelProps = React.ComponentPropsWithoutRef;\ninterface MenubarLabelProps extends MenuLabelProps {}\n\nconst MenubarLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenubarItem';\n\ntype MenubarItemElement = React.ComponentRef;\ntype MenuItemProps = React.ComponentPropsWithoutRef;\ninterface MenubarItemProps extends MenuItemProps {}\n\nconst MenubarItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenubarCheckboxItem';\n\ntype MenubarCheckboxItemElement = React.ComponentRef;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef;\ninterface MenubarCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst MenubarCheckboxItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenubarRadioGroup';\n\ntype MenubarRadioGroupElement = React.ComponentRef;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef;\ninterface MenubarRadioGroupProps extends MenuRadioGroupProps {}\n\nconst MenubarRadioGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenubarRadioItem';\n\ntype MenubarRadioItemElement = React.ComponentRef;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef;\ninterface MenubarRadioItemProps extends MenuRadioItemProps {}\n\nconst MenubarRadioItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'MenubarItemIndicator';\n\ntype MenubarItemIndicatorElement = React.ComponentRef;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef;\ninterface MenubarItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst MenubarItemIndicator = React.forwardRef<\n MenubarItemIndicatorElement,\n MenubarItemIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n});\n\nMenubarItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenubarSeparator';\n\ntype MenubarSeparatorElement = React.ComponentRef;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef;\ninterface MenubarSeparatorProps extends MenuSeparatorProps {}\n\nconst MenubarSeparator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenubarArrow';\n\ntype MenubarArrowElement = React.ComponentRef;\ntype MenuArrowProps = React.ComponentPropsWithoutRef;\ninterface MenubarArrowProps extends MenuArrowProps {}\n\nconst MenubarArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return ;\n },\n);\n\nMenubarArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenubarSub';\n\ninterface MenubarSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst MenubarSub: React.FC = (props: ScopedProps) => {\n const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SUB_NAME,\n });\n\n return (\n \n {children}\n \n );\n};\n\nMenubarSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenubarSubTrigger';\n\ntype MenubarSubTriggerElement = React.ComponentRef;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef;\ninterface MenubarSubTriggerProps extends MenuSubTriggerProps {}\n\nconst MenubarSubTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n return (\n \n );\n },\n);\n\nMenubarSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenubarSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenubarSubContent';\n\ntype MenubarSubContentElement = React.ComponentRef;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef;\ninterface MenubarSubContentProps extends MenuSubContentProps {}\n\nconst MenubarSubContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeMenubar, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeMenubar);\n\n return (\n \n );\n },\n);\n\nMenubarSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = Menubar;\nconst Menu = MenubarMenu;\nconst Trigger = MenubarTrigger;\nconst Portal = MenubarPortal;\nconst Content = MenubarContent;\nconst Group = MenubarGroup;\nconst Label = MenubarLabel;\nconst Item = MenubarItem;\nconst CheckboxItem = MenubarCheckboxItem;\nconst RadioGroup = MenubarRadioGroup;\nconst RadioItem = MenubarRadioItem;\nconst ItemIndicator = MenubarItemIndicator;\nconst Separator = MenubarSeparator;\nconst Arrow = MenubarArrow;\nconst Sub = MenubarSub;\nconst SubTrigger = MenubarSubTrigger;\nconst SubContent = MenubarSubContent;\n\nexport {\n createMenubarScope,\n //\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarPortal,\n MenubarContent,\n MenubarGroup,\n MenubarLabel,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarItemIndicator,\n MenubarSeparator,\n MenubarArrow,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n //\n Root,\n Menu,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n MenubarProps,\n MenubarMenuProps,\n MenubarTriggerProps,\n MenubarPortalProps,\n MenubarContentProps,\n MenubarGroupProps,\n MenubarLabelProps,\n MenubarItemProps,\n MenubarCheckboxItemProps,\n MenubarRadioGroupProps,\n MenubarRadioItemProps,\n MenubarItemIndicatorProps,\n MenubarSeparatorProps,\n MenubarArrowProps,\n MenubarSubProps,\n MenubarSubTriggerProps,\n MenubarSubContentProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,aAAa;AACtB,YAAY,mBAAmB;AAC/B,SAAS,uBAAuB;AAChC,YAAY,sBAAsB;AAClC,SAAS,mCAAmC;AAC5C,SAAS,iBAAiB;AAC1B,SAAS,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,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAMhC,IAAM,mBAAmB;AAMzB,IAAM,oBAA0B;AAAA,EAC9B,CAAC,OAA4C,iBAAiB;AAC5D,UAAM,EAAE,gBAAgB,GAAG,gBAAgB,IAAI;AAC/C,UAAM,YAAY,aAAa,cAAc;AAE7C,WACE;AAAA,MAAe;AAAA,MAAd;AAAA,QACE,GAAG;AAAA,QACJ,8BAA2B;AAAA,QAC1B,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,OAAO;AAAA,UACL,GAAG,MAAM;AAAA;AAAA,UAET,GAAG;AAAA,YACD,4CAA4C;AAAA,YAC5C,2CAA2C;AAAA,YAC3C,4CAA4C;AAAA,YAC5C,iCAAiC;AAAA,YACjC,kCAAkC;AAAA,UACpC;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAQhC,SAAS,UAAa,OAAY,YAAoB;AACpD,SAAO,MAAM,IAAO,CAAC,GAAG,UAAU,OAAO,aAAa,SAAS,MAAM,MAAM,CAAE;AAC/E;AAEA,IAAMC,QAAO;AACb,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAMC,UAAS;AACf,IAAMC,WAAU;AAChB,IAAMC,SAAQ;AACd,IAAMC,SAAQ;AACd,IAAMC,QAAO;AACb,IAAMC,gBAAe;AACrB,IAAMC,cAAa;AACnB,IAAMC,aAAY;AAClB,IAAMC,iBAAgB;AACtB,IAAMC,aAAY;AAClB,IAAMC,SAAQ;AACd,IAAMC,OAAM;AACZ,IAAMC,cAAa;AACnB,IAAMC,cAAa;", + "names": ["value", "open", "Root", "Portal", "Content", "Group", "Label", "Item", "CheckboxItem", "RadioGroup", "RadioItem", "ItemIndicator", "Separator", "Arrow", "Sub", "SubTrigger", "SubContent"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9162e20c0200fae894ad05789085c709668ee799 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-menubar/package.json @@ -0,0 +1,78 @@ +{ + "name": "@radix-ui/react-menubar", + "version": "1.1.18", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-collection": "1.1.10", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-menu": "2.1.18", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-roving-focus": "1.1.13" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/test-data": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/menubar" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ae8b266f069a4b81e29d22d5cbcce3ab40893654 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/README.md @@ -0,0 +1,3 @@ +# `react-navigation-menu` + +View docs [here](https://radix-ui.com/primitives/docs/components/navigation-menu). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..874b78eb5ffbbbc831d71ba032ec24d4dcfb0df5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.d.mts @@ -0,0 +1,126 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden'; + +type Orientation = 'vertical' | 'horizontal'; +type Direction = 'ltr' | 'rtl'; +declare const createNavigationMenuScope: _radix_ui_react_context.CreateScope; +type NavigationMenuElement = React.ComponentRef; +type PrimitiveNavProps = React.ComponentPropsWithoutRef; +interface NavigationMenuProps extends Omit, PrimitiveNavProps { + value?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + dir?: Direction; + orientation?: Orientation; + /** + * The duration from when the pointer enters the trigger until the tooltip gets opened. + * @defaultValue 200 + */ + delayDuration?: number; + /** + * How much time a user has to enter another trigger without incurring a delay again. + * @defaultValue 300 + */ + skipDelayDuration?: number; +} +declare const NavigationMenu: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface NavigationMenuSubProps extends Omit, PrimitiveDivProps { + value?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + orientation?: Orientation; +} +declare const NavigationMenuSub: React.ForwardRefExoticComponent>; +interface NavigationMenuProviderPrivateProps { + isRootMenu: boolean; + scope: Scope; + children: React.ReactNode; + orientation: Orientation; + dir: Direction; + rootNavigationMenu: NavigationMenuElement | null; + value: string; + onTriggerEnter(itemValue: string): void; + onTriggerLeave?(): void; + onContentEnter?(): void; + onContentLeave?(): void; + onItemSelect(itemValue: string): void; + onItemDismiss(): void; +} +interface NavigationMenuProviderProps extends NavigationMenuProviderPrivateProps { +} +type PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef; +interface NavigationMenuListProps extends PrimitiveUnorderedListProps { +} +declare const NavigationMenuList: React.ForwardRefExoticComponent>; +type FocusProxyElement = React.ComponentRef; +type PrimitiveListItemProps = React.ComponentPropsWithoutRef; +interface NavigationMenuItemProps extends PrimitiveListItemProps { + value?: string; +} +declare const NavigationMenuItem: React.ForwardRefExoticComponent>; +type NavigationMenuTriggerElement = React.ComponentRef; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface NavigationMenuTriggerProps extends PrimitiveButtonProps { +} +declare const NavigationMenuTrigger: React.ForwardRefExoticComponent>; +type PrimitiveLinkProps = React.ComponentPropsWithoutRef; +interface NavigationMenuLinkProps extends Omit { + active?: boolean; + onSelect?: (event: Event) => void; +} +declare const NavigationMenuLink: React.ForwardRefExoticComponent>; +interface NavigationMenuIndicatorProps extends NavigationMenuIndicatorImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const NavigationMenuIndicator: React.ForwardRefExoticComponent>; +interface NavigationMenuIndicatorImplProps extends PrimitiveDivProps { +} +interface NavigationMenuContentProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const NavigationMenuContent: React.ForwardRefExoticComponent>; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +interface NavigationMenuContentImplPrivateProps { + value: string; + triggerRef: React.RefObject; + focusProxyRef: React.RefObject; + wasEscapeCloseRef: React.MutableRefObject; + onContentFocusOutside(): void; + onRootContentClose(): void; +} +interface NavigationMenuContentImplProps extends Omit, NavigationMenuContentImplPrivateProps { +} +interface NavigationMenuViewportProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const NavigationMenuViewport: React.ForwardRefExoticComponent>; +interface NavigationMenuViewportImplProps extends PrimitiveDivProps { +} +declare const Root: React.ForwardRefExoticComponent>; +declare const Sub: React.ForwardRefExoticComponent>; +declare const List: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Link: React.ForwardRefExoticComponent>; +declare const Indicator: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Viewport: React.ForwardRefExoticComponent>; + +export { Content, Indicator, Item, Link, List, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuSub, type NavigationMenuSubProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, Root, Sub, Trigger, Viewport, createNavigationMenuScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..874b78eb5ffbbbc831d71ba032ec24d4dcfb0df5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.d.ts @@ -0,0 +1,126 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden'; + +type Orientation = 'vertical' | 'horizontal'; +type Direction = 'ltr' | 'rtl'; +declare const createNavigationMenuScope: _radix_ui_react_context.CreateScope; +type NavigationMenuElement = React.ComponentRef; +type PrimitiveNavProps = React.ComponentPropsWithoutRef; +interface NavigationMenuProps extends Omit, PrimitiveNavProps { + value?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + dir?: Direction; + orientation?: Orientation; + /** + * The duration from when the pointer enters the trigger until the tooltip gets opened. + * @defaultValue 200 + */ + delayDuration?: number; + /** + * How much time a user has to enter another trigger without incurring a delay again. + * @defaultValue 300 + */ + skipDelayDuration?: number; +} +declare const NavigationMenu: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface NavigationMenuSubProps extends Omit, PrimitiveDivProps { + value?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + orientation?: Orientation; +} +declare const NavigationMenuSub: React.ForwardRefExoticComponent>; +interface NavigationMenuProviderPrivateProps { + isRootMenu: boolean; + scope: Scope; + children: React.ReactNode; + orientation: Orientation; + dir: Direction; + rootNavigationMenu: NavigationMenuElement | null; + value: string; + onTriggerEnter(itemValue: string): void; + onTriggerLeave?(): void; + onContentEnter?(): void; + onContentLeave?(): void; + onItemSelect(itemValue: string): void; + onItemDismiss(): void; +} +interface NavigationMenuProviderProps extends NavigationMenuProviderPrivateProps { +} +type PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef; +interface NavigationMenuListProps extends PrimitiveUnorderedListProps { +} +declare const NavigationMenuList: React.ForwardRefExoticComponent>; +type FocusProxyElement = React.ComponentRef; +type PrimitiveListItemProps = React.ComponentPropsWithoutRef; +interface NavigationMenuItemProps extends PrimitiveListItemProps { + value?: string; +} +declare const NavigationMenuItem: React.ForwardRefExoticComponent>; +type NavigationMenuTriggerElement = React.ComponentRef; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface NavigationMenuTriggerProps extends PrimitiveButtonProps { +} +declare const NavigationMenuTrigger: React.ForwardRefExoticComponent>; +type PrimitiveLinkProps = React.ComponentPropsWithoutRef; +interface NavigationMenuLinkProps extends Omit { + active?: boolean; + onSelect?: (event: Event) => void; +} +declare const NavigationMenuLink: React.ForwardRefExoticComponent>; +interface NavigationMenuIndicatorProps extends NavigationMenuIndicatorImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const NavigationMenuIndicator: React.ForwardRefExoticComponent>; +interface NavigationMenuIndicatorImplProps extends PrimitiveDivProps { +} +interface NavigationMenuContentProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const NavigationMenuContent: React.ForwardRefExoticComponent>; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +interface NavigationMenuContentImplPrivateProps { + value: string; + triggerRef: React.RefObject; + focusProxyRef: React.RefObject; + wasEscapeCloseRef: React.MutableRefObject; + onContentFocusOutside(): void; + onRootContentClose(): void; +} +interface NavigationMenuContentImplProps extends Omit, NavigationMenuContentImplPrivateProps { +} +interface NavigationMenuViewportProps extends Omit { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const NavigationMenuViewport: React.ForwardRefExoticComponent>; +interface NavigationMenuViewportImplProps extends PrimitiveDivProps { +} +declare const Root: React.ForwardRefExoticComponent>; +declare const Sub: React.ForwardRefExoticComponent>; +declare const List: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Link: React.ForwardRefExoticComponent>; +declare const Indicator: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Viewport: React.ForwardRefExoticComponent>; + +export { Content, Indicator, Item, Link, List, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuSub, type NavigationMenuSubProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, Root, Sub, Trigger, Viewport, createNavigationMenuScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a8f61b8e46153583b854514458fdcac77280ad2c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.js @@ -0,0 +1,838 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Content: () => Content, + Indicator: () => Indicator, + Item: () => Item, + Link: () => Link, + List: () => List, + NavigationMenu: () => NavigationMenu, + NavigationMenuContent: () => NavigationMenuContent, + NavigationMenuIndicator: () => NavigationMenuIndicator, + NavigationMenuItem: () => NavigationMenuItem, + NavigationMenuLink: () => NavigationMenuLink, + NavigationMenuList: () => NavigationMenuList, + NavigationMenuSub: () => NavigationMenuSub, + NavigationMenuTrigger: () => NavigationMenuTrigger, + NavigationMenuViewport: () => NavigationMenuViewport, + Root: () => Root2, + Sub: () => Sub, + Trigger: () => Trigger, + Viewport: () => Viewport, + createNavigationMenuScope: () => createNavigationMenuScope +}); +module.exports = __toCommonJS(index_exports); + +// src/navigation-menu.tsx +var React = __toESM(require("react")); +var ReactDOM = __toESM(require("react-dom")); +var import_react_context = require("@radix-ui/react-context"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_collection = require("@radix-ui/react-collection"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_react_use_previous = require("@radix-ui/react-use-previous"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var VisuallyHiddenPrimitive = __toESM(require("@radix-ui/react-visually-hidden")); +var import_jsx_runtime = require("react/jsx-runtime"); +var NAVIGATION_MENU_NAME = "NavigationMenu"; +var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(NAVIGATION_MENU_NAME); +var [FocusGroupCollection, useFocusGroupCollection, createFocusGroupCollectionScope] = (0, import_react_collection.createCollection)(NAVIGATION_MENU_NAME); +var [createNavigationMenuContext, createNavigationMenuScope] = (0, import_react_context.createContextScope)( + NAVIGATION_MENU_NAME, + [createCollectionScope, createFocusGroupCollectionScope] +); +var [NavigationMenuProviderImpl, useNavigationMenuContext] = createNavigationMenuContext(NAVIGATION_MENU_NAME); +var [ViewportContentProvider, useViewportContentContext] = createNavigationMenuContext(NAVIGATION_MENU_NAME); +var NavigationMenu = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeNavigationMenu, + value: valueProp, + onValueChange, + defaultValue, + delayDuration = 200, + skipDelayDuration = 300, + orientation = "horizontal", + dir, + ...NavigationMenuProps + } = props; + const [navigationMenu, setNavigationMenu] = React.useState(null); + const composedRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setNavigationMenu(node)); + const direction = (0, import_react_direction.useDirection)(dir); + const openTimerRef = React.useRef(0); + const closeTimerRef = React.useRef(0); + const skipDelayTimerRef = React.useRef(0); + const [isOpenDelayed, setIsOpenDelayed] = React.useState(true); + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + onChange: (value2) => { + const isOpen = value2 !== ""; + const hasSkipDelayDuration = skipDelayDuration > 0; + if (isOpen) { + window.clearTimeout(skipDelayTimerRef.current); + if (hasSkipDelayDuration) setIsOpenDelayed(false); + } else { + window.clearTimeout(skipDelayTimerRef.current); + skipDelayTimerRef.current = window.setTimeout( + () => setIsOpenDelayed(true), + skipDelayDuration + ); + } + onValueChange?.(value2); + }, + defaultProp: defaultValue ?? "", + caller: NAVIGATION_MENU_NAME + }); + const startCloseTimer = React.useCallback(() => { + window.clearTimeout(closeTimerRef.current); + closeTimerRef.current = window.setTimeout(() => setValue(""), 150); + }, [setValue]); + const handleOpen = React.useCallback( + (itemValue) => { + window.clearTimeout(closeTimerRef.current); + setValue(itemValue); + }, + [setValue] + ); + const handleDelayedOpen = React.useCallback( + (itemValue) => { + const isOpenItem = value === itemValue; + if (isOpenItem) { + window.clearTimeout(closeTimerRef.current); + } else { + openTimerRef.current = window.setTimeout(() => { + window.clearTimeout(closeTimerRef.current); + setValue(itemValue); + }, delayDuration); + } + }, + [value, setValue, delayDuration] + ); + React.useEffect(() => { + return () => { + window.clearTimeout(openTimerRef.current); + window.clearTimeout(closeTimerRef.current); + window.clearTimeout(skipDelayTimerRef.current); + }; + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + NavigationMenuProvider, + { + scope: __scopeNavigationMenu, + isRootMenu: true, + value, + dir: direction, + orientation, + rootNavigationMenu: navigationMenu, + onTriggerEnter: (itemValue) => { + window.clearTimeout(openTimerRef.current); + if (isOpenDelayed) handleDelayedOpen(itemValue); + else handleOpen(itemValue); + }, + onTriggerLeave: () => { + window.clearTimeout(openTimerRef.current); + startCloseTimer(); + }, + onContentEnter: () => window.clearTimeout(closeTimerRef.current), + onContentLeave: startCloseTimer, + onItemSelect: (itemValue) => { + setValue((prevValue) => prevValue === itemValue ? "" : itemValue); + }, + onItemDismiss: () => setValue(""), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.nav, + { + "aria-label": "Main", + "data-orientation": orientation, + dir: direction, + ...NavigationMenuProps, + ref: composedRef + } + ) + } + ); + } +); +NavigationMenu.displayName = NAVIGATION_MENU_NAME; +var SUB_NAME = "NavigationMenuSub"; +var NavigationMenuSub = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeNavigationMenu, + value: valueProp, + onValueChange, + defaultValue, + orientation = "horizontal", + ...subProps + } = props; + const context = useNavigationMenuContext(SUB_NAME, __scopeNavigationMenu); + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + onChange: onValueChange, + defaultProp: defaultValue ?? "", + caller: SUB_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + NavigationMenuProvider, + { + scope: __scopeNavigationMenu, + isRootMenu: false, + value, + dir: context.dir, + orientation, + rootNavigationMenu: context.rootNavigationMenu, + onTriggerEnter: (itemValue) => setValue(itemValue), + onItemSelect: (itemValue) => setValue(itemValue), + onItemDismiss: () => setValue(""), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { "data-orientation": orientation, ...subProps, ref: forwardedRef }) + } + ); + } +); +NavigationMenuSub.displayName = SUB_NAME; +var NavigationMenuProvider = (props) => { + const { + scope, + isRootMenu, + rootNavigationMenu, + dir, + orientation, + children, + value, + onItemSelect, + onItemDismiss, + onTriggerEnter, + onTriggerLeave, + onContentEnter, + onContentLeave + } = props; + const [viewport, setViewport] = React.useState(null); + const [viewportContent, setViewportContent] = React.useState(/* @__PURE__ */ new Map()); + const [indicatorTrack, setIndicatorTrack] = React.useState(null); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + NavigationMenuProviderImpl, + { + scope, + isRootMenu, + rootNavigationMenu, + value, + previousValue: (0, import_react_use_previous.usePrevious)(value), + baseId: (0, import_react_id.useId)(), + dir, + orientation, + viewport, + onViewportChange: setViewport, + indicatorTrack, + onIndicatorTrackChange: setIndicatorTrack, + onTriggerEnter: (0, import_react_use_callback_ref.useCallbackRef)(onTriggerEnter), + onTriggerLeave: (0, import_react_use_callback_ref.useCallbackRef)(onTriggerLeave), + onContentEnter: (0, import_react_use_callback_ref.useCallbackRef)(onContentEnter), + onContentLeave: (0, import_react_use_callback_ref.useCallbackRef)(onContentLeave), + onItemSelect: (0, import_react_use_callback_ref.useCallbackRef)(onItemSelect), + onItemDismiss: (0, import_react_use_callback_ref.useCallbackRef)(onItemDismiss), + onViewportContentChange: React.useCallback((contentValue, contentData) => { + setViewportContent((prevContent) => { + prevContent.set(contentValue, contentData); + return new Map(prevContent); + }); + }, []), + onViewportContentRemove: React.useCallback((contentValue) => { + setViewportContent((prevContent) => { + if (!prevContent.has(contentValue)) return prevContent; + prevContent.delete(contentValue); + return new Map(prevContent); + }); + }, []), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewportContentProvider, { scope, items: viewportContent, children }) }) + } + ); +}; +var LIST_NAME = "NavigationMenuList"; +var NavigationMenuList = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, ...listProps } = props; + const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu); + const list = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.ul, { "data-orientation": context.orientation, ...listProps, ref: forwardedRef }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { style: { position: "relative" }, ref: context.onIndicatorTrackChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeNavigationMenu, children: context.isRootMenu ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroup, { asChild: true, children: list }) : list }) }); + } +); +NavigationMenuList.displayName = LIST_NAME; +var ITEM_NAME = "NavigationMenuItem"; +var [NavigationMenuItemContextProvider, useNavigationMenuItemContext] = createNavigationMenuContext(ITEM_NAME); +var NavigationMenuItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props; + const autoValue = (0, import_react_id.useId)(); + const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE"; + const contentRef = React.useRef(null); + const triggerRef = React.useRef(null); + const focusProxyRef = React.useRef(null); + const restoreContentTabOrderRef = React.useRef(() => { + }); + const wasEscapeCloseRef = React.useRef(false); + const handleContentEntry = React.useCallback((side = "start") => { + if (contentRef.current) { + restoreContentTabOrderRef.current(); + const candidates = getTabbableCandidates(contentRef.current); + if (candidates.length) focusFirst(side === "start" ? candidates : candidates.reverse()); + } + }, []); + const handleContentExit = React.useCallback(() => { + if (contentRef.current) { + const candidates = getTabbableCandidates(contentRef.current); + if (candidates.length) restoreContentTabOrderRef.current = removeFromTabOrder(candidates); + } + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + NavigationMenuItemContextProvider, + { + scope: __scopeNavigationMenu, + value, + triggerRef, + contentRef, + focusProxyRef, + wasEscapeCloseRef, + onEntryKeyDown: handleContentEntry, + onFocusProxyEnter: handleContentEntry, + onRootContentClose: handleContentExit, + onContentFocusOutside: handleContentExit, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.li, { ...itemProps, ref: forwardedRef }) + } + ); + } +); +NavigationMenuItem.displayName = ITEM_NAME; +var TRIGGER_NAME = "NavigationMenuTrigger"; +var NavigationMenuTrigger = React.forwardRef((props, forwardedRef) => { + const { __scopeNavigationMenu, disabled, ...triggerProps } = props; + const context = useNavigationMenuContext(TRIGGER_NAME, props.__scopeNavigationMenu); + const itemContext = useNavigationMenuItemContext(TRIGGER_NAME, props.__scopeNavigationMenu); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(ref, itemContext.triggerRef, forwardedRef); + const triggerId = makeTriggerId(context.baseId, itemContext.value); + const contentId = makeContentId(context.baseId, itemContext.value); + const hasPointerMoveOpenedRef = React.useRef(false); + const wasClickCloseRef = React.useRef(false); + const open = itemContext.value === context.value; + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, { scope: __scopeNavigationMenu, value: itemContext.value, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + id: triggerId, + disabled, + "data-disabled": disabled ? "" : void 0, + "data-state": getOpenState(open), + "aria-expanded": open, + "aria-controls": open ? contentId : void 0, + ...triggerProps, + ref: composedRefs, + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, () => { + wasClickCloseRef.current = false; + itemContext.wasEscapeCloseRef.current = false; + }), + onPointerMove: (0, import_primitive.composeEventHandlers)( + props.onPointerMove, + whenMouse(() => { + if (disabled || wasClickCloseRef.current || itemContext.wasEscapeCloseRef.current || hasPointerMoveOpenedRef.current) + return; + context.onTriggerEnter(itemContext.value); + hasPointerMoveOpenedRef.current = true; + }) + ), + onPointerLeave: (0, import_primitive.composeEventHandlers)( + props.onPointerLeave, + whenMouse(() => { + if (disabled) return; + context.onTriggerLeave(); + hasPointerMoveOpenedRef.current = false; + }) + ), + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => { + context.onItemSelect(itemContext.value); + wasClickCloseRef.current = open; + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + const verticalEntryKey = context.dir === "rtl" ? "ArrowLeft" : "ArrowRight"; + const entryKey = { horizontal: "ArrowDown", vertical: verticalEntryKey }[context.orientation]; + if (open && event.key === entryKey) { + itemContext.onEntryKeyDown(); + event.preventDefault(); + } + }) + } + ) }) }), + open && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + VisuallyHiddenPrimitive.Root, + { + "aria-hidden": true, + tabIndex: 0, + ref: itemContext.focusProxyRef, + onFocus: (event) => { + const content = itemContext.contentRef.current; + const prevFocusedElement = event.relatedTarget; + const wasTriggerFocused = prevFocusedElement === ref.current; + const wasFocusFromContent = content?.contains(prevFocusedElement); + if (wasTriggerFocused || !wasFocusFromContent) { + itemContext.onFocusProxyEnter(wasTriggerFocused ? "start" : "end"); + } + } + } + ), + context.viewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-owns": contentId }) + ] }) + ] }); +}); +NavigationMenuTrigger.displayName = TRIGGER_NAME; +var LINK_NAME = "NavigationMenuLink"; +var LINK_SELECT = "navigationMenu.linkSelect"; +var NavigationMenuLink = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.a, + { + "data-active": active ? "" : void 0, + "aria-current": active ? "page" : void 0, + ...linkProps, + ref: forwardedRef, + onClick: (0, import_primitive.composeEventHandlers)( + props.onClick, + (event) => { + const target = event.target; + const linkSelectEvent = new CustomEvent(LINK_SELECT, { + bubbles: true, + cancelable: true + }); + target.addEventListener(LINK_SELECT, (event2) => onSelect?.(event2), { once: true }); + (0, import_react_primitive.dispatchDiscreteCustomEvent)(target, linkSelectEvent); + if (!linkSelectEvent.defaultPrevented && !event.metaKey) { + const rootContentDismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, { + bubbles: true, + cancelable: true + }); + (0, import_react_primitive.dispatchDiscreteCustomEvent)(target, rootContentDismissEvent); + } + }, + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +NavigationMenuLink.displayName = LINK_NAME; +var INDICATOR_NAME = "NavigationMenuIndicator"; +var NavigationMenuIndicator = React.forwardRef((props, forwardedRef) => { + const { forceMount, ...indicatorProps } = props; + const context = useNavigationMenuContext(INDICATOR_NAME, props.__scopeNavigationMenu); + const isVisible = Boolean(context.value); + return context.indicatorTrack ? ReactDOM.createPortal( + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationMenuIndicatorImpl, { ...indicatorProps, ref: forwardedRef }) }), + context.indicatorTrack + ) : null; +}); +NavigationMenuIndicator.displayName = INDICATOR_NAME; +var NavigationMenuIndicatorImpl = React.forwardRef((props, forwardedRef) => { + const { __scopeNavigationMenu, ...indicatorProps } = props; + const context = useNavigationMenuContext(INDICATOR_NAME, __scopeNavigationMenu); + const getItems = useCollection(__scopeNavigationMenu); + const [activeTrigger, setActiveTrigger] = React.useState( + null + ); + const [position, setPosition] = React.useState(null); + const isHorizontal = context.orientation === "horizontal"; + const isVisible = Boolean(context.value); + React.useEffect(() => { + const items = getItems(); + const triggerNode = items.find((item) => item.value === context.value)?.ref.current; + if (triggerNode) setActiveTrigger(triggerNode); + }, [getItems, context.value]); + const handlePositionChange = () => { + if (activeTrigger) { + setPosition({ + size: isHorizontal ? activeTrigger.offsetWidth : activeTrigger.offsetHeight, + offset: isHorizontal ? activeTrigger.offsetLeft : activeTrigger.offsetTop + }); + } + }; + useResizeObserver(activeTrigger, handlePositionChange); + useResizeObserver(context.indicatorTrack, handlePositionChange); + return position ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "aria-hidden": true, + "data-state": isVisible ? "visible" : "hidden", + "data-orientation": context.orientation, + ...indicatorProps, + ref: forwardedRef, + style: { + position: "absolute", + ...isHorizontal ? { + left: 0, + width: position.size + "px", + transform: `translateX(${position.offset}px)` + } : { + top: 0, + height: position.size + "px", + transform: `translateY(${position.offset}px)` + }, + ...indicatorProps.style + } + } + ) : null; +}); +var CONTENT_NAME = "NavigationMenuContent"; +var NavigationMenuContent = React.forwardRef((props, forwardedRef) => { + const { forceMount, ...contentProps } = props; + const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu); + const itemContext = useNavigationMenuItemContext(CONTENT_NAME, props.__scopeNavigationMenu); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(itemContext.contentRef, forwardedRef); + const open = itemContext.value === context.value; + const commonProps = { + value: itemContext.value, + triggerRef: itemContext.triggerRef, + focusProxyRef: itemContext.focusProxyRef, + wasEscapeCloseRef: itemContext.wasEscapeCloseRef, + onContentFocusOutside: itemContext.onContentFocusOutside, + onRootContentClose: itemContext.onRootContentClose, + ...contentProps + }; + return !context.viewport ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + NavigationMenuContentImpl, + { + "data-state": getOpenState(open), + ...commonProps, + ref: composedRefs, + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, context.onContentEnter), + onPointerLeave: (0, import_primitive.composeEventHandlers)( + props.onPointerLeave, + whenMouse(context.onContentLeave) + ), + style: { + // Prevent interaction when animating out + pointerEvents: !open && context.isRootMenu ? "none" : void 0, + ...commonProps.style + } + } + ) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewportContentMounter, { forceMount, ...commonProps, ref: composedRefs }); +}); +NavigationMenuContent.displayName = CONTENT_NAME; +var ViewportContentMounter = React.forwardRef((props, forwardedRef) => { + const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu); + const { onViewportContentChange, onViewportContentRemove } = context; + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + onViewportContentChange(props.value, { + ref: forwardedRef, + ...props + }); + }, [props, forwardedRef, onViewportContentChange]); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + return () => onViewportContentRemove(props.value); + }, [props.value, onViewportContentRemove]); + return null; +}); +var ROOT_CONTENT_DISMISS = "navigationMenu.rootContentDismiss"; +var NavigationMenuContentImpl = React.forwardRef((props, forwardedRef) => { + const { + __scopeNavigationMenu, + value, + triggerRef, + focusProxyRef, + wasEscapeCloseRef, + onRootContentClose, + onContentFocusOutside, + ...contentProps + } = props; + const context = useNavigationMenuContext(CONTENT_NAME, __scopeNavigationMenu); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(ref, forwardedRef); + const triggerId = makeTriggerId(context.baseId, value); + const contentId = makeContentId(context.baseId, value); + const getItems = useCollection(__scopeNavigationMenu); + const prevMotionAttributeRef = React.useRef(null); + const { onItemDismiss } = context; + React.useEffect(() => { + const content = ref.current; + if (context.isRootMenu && content) { + const handleClose = () => { + onItemDismiss(); + onRootContentClose(); + if (content.contains(document.activeElement)) triggerRef.current?.focus(); + }; + content.addEventListener(ROOT_CONTENT_DISMISS, handleClose); + return () => content.removeEventListener(ROOT_CONTENT_DISMISS, handleClose); + } + }, [context.isRootMenu, props.value, triggerRef, onItemDismiss, onRootContentClose]); + const motionAttribute = React.useMemo(() => { + const items = getItems(); + const values = items.map((item) => item.value); + if (context.dir === "rtl") values.reverse(); + const index = values.indexOf(context.value); + const prevIndex = values.indexOf(context.previousValue); + const isSelected = value === context.value; + const wasSelected = prevIndex === values.indexOf(value); + if (!isSelected && !wasSelected) return prevMotionAttributeRef.current; + const attribute = (() => { + if (index !== prevIndex) { + if (isSelected && prevIndex !== -1) return index > prevIndex ? "from-end" : "from-start"; + if (wasSelected && index !== -1) return index > prevIndex ? "to-start" : "to-end"; + } + return null; + })(); + prevMotionAttributeRef.current = attribute; + return attribute; + }, [context.previousValue, context.value, context.dir, getItems, value]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroup, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + id: contentId, + "aria-labelledby": triggerId, + "data-motion": motionAttribute, + "data-orientation": context.orientation, + ...contentProps, + ref: composedRefs, + disableOutsidePointerEvents: false, + onDismiss: () => { + const rootContentDismissEvent = new Event(ROOT_CONTENT_DISMISS, { + bubbles: true, + cancelable: true + }); + ref.current?.dispatchEvent(rootContentDismissEvent); + }, + onFocusOutside: (0, import_primitive.composeEventHandlers)(props.onFocusOutside, (event) => { + onContentFocusOutside(); + const target = event.target; + if (context.rootNavigationMenu?.contains(target)) event.preventDefault(); + }), + onPointerDownOutside: (0, import_primitive.composeEventHandlers)(props.onPointerDownOutside, (event) => { + const target = event.target; + const isTrigger = getItems().some((item) => item.ref.current?.contains(target)); + const isRootViewport = context.isRootMenu && context.viewport?.contains(target); + if (isTrigger || isRootViewport || !context.isRootMenu) event.preventDefault(); + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; + const isTabKey = event.key === "Tab" && !isMetaKey; + if (isTabKey) { + const candidates = getTabbableCandidates(event.currentTarget); + const focusedElement = document.activeElement; + const index = candidates.findIndex((candidate) => candidate === focusedElement); + const isMovingBackwards = event.shiftKey; + const nextCandidates = isMovingBackwards ? candidates.slice(0, index).reverse() : candidates.slice(index + 1, candidates.length); + if (focusFirst(nextCandidates)) { + event.preventDefault(); + } else { + focusProxyRef.current?.focus(); + } + } + }), + onEscapeKeyDown: (0, import_primitive.composeEventHandlers)(props.onEscapeKeyDown, (_event) => { + wasEscapeCloseRef.current = true; + }) + } + ) }); +}); +var VIEWPORT_NAME = "NavigationMenuViewport"; +var NavigationMenuViewport = React.forwardRef((props, forwardedRef) => { + const { forceMount, ...viewportProps } = props; + const context = useNavigationMenuContext(VIEWPORT_NAME, props.__scopeNavigationMenu); + const open = Boolean(context.value); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationMenuViewportImpl, { ...viewportProps, ref: forwardedRef }) }); +}); +NavigationMenuViewport.displayName = VIEWPORT_NAME; +var NavigationMenuViewportImpl = React.forwardRef((props, forwardedRef) => { + const { __scopeNavigationMenu, children, ...viewportImplProps } = props; + const context = useNavigationMenuContext(VIEWPORT_NAME, __scopeNavigationMenu); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.onViewportChange); + const viewportContentContext = useViewportContentContext( + CONTENT_NAME, + props.__scopeNavigationMenu + ); + const [size, setSize] = React.useState(null); + const [content, setContent] = React.useState(null); + const viewportWidth = size ? size?.width + "px" : void 0; + const viewportHeight = size ? size?.height + "px" : void 0; + const open = Boolean(context.value); + const activeContentValue = open ? context.value : context.previousValue; + const handleSizeChange = () => { + if (content) setSize({ width: content.offsetWidth, height: content.offsetHeight }); + }; + useResizeObserver(content, handleSizeChange); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-state": getOpenState(open), + "data-orientation": context.orientation, + ...viewportImplProps, + ref: composedRefs, + style: { + // Prevent interaction when animating out + pointerEvents: !open && context.isRootMenu ? "none" : void 0, + "--radix-navigation-menu-viewport-width": viewportWidth, + "--radix-navigation-menu-viewport-height": viewportHeight, + ...viewportImplProps.style + }, + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, context.onContentEnter), + onPointerLeave: (0, import_primitive.composeEventHandlers)(props.onPointerLeave, whenMouse(context.onContentLeave)), + children: Array.from(viewportContentContext.items).map(([value, { ref, forceMount, ...props2 }]) => { + const isActive = activeContentValue === value; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || isActive, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + NavigationMenuContentImpl, + { + ...props2, + ref: (0, import_react_compose_refs.composeRefs)(ref, (node) => { + if (isActive && node) setContent(node); + }) + } + ) }, value); + }) + } + ); +}); +var FOCUS_GROUP_NAME = "FocusGroup"; +var FocusGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, ...groupProps } = props; + const context = useNavigationMenuContext(FOCUS_GROUP_NAME, __scopeNavigationMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroupCollection.Provider, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroupCollection.Slot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { dir: context.dir, ...groupProps, ref: forwardedRef }) }) }); + } +); +var ARROW_KEYS = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"]; +var FOCUS_GROUP_ITEM_NAME = "FocusGroupItem"; +var FocusGroupItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, ...groupProps } = props; + const getItems = useFocusGroupCollection(__scopeNavigationMenu); + const context = useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGroupCollection.ItemSlot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + ...groupProps, + ref: forwardedRef, + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + const isFocusNavigationKey = ["Home", "End", ...ARROW_KEYS].includes(event.key); + if (isFocusNavigationKey) { + let candidateNodes = getItems().map((item) => item.ref.current); + const prevItemKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft"; + const prevKeys = [prevItemKey, "ArrowUp", "End"]; + if (prevKeys.includes(event.key)) candidateNodes.reverse(); + if (ARROW_KEYS.includes(event.key)) { + const currentIndex = candidateNodes.indexOf(event.currentTarget); + candidateNodes = candidateNodes.slice(currentIndex + 1); + } + setTimeout(() => focusFirst(candidateNodes)); + event.preventDefault(); + } + }) + } + ) }); + } +); +function getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +function focusFirst(candidates) { + const previouslyFocusedElement = document.activeElement; + return candidates.some((candidate) => { + if (candidate === previouslyFocusedElement) return true; + candidate.focus(); + return document.activeElement !== previouslyFocusedElement; + }); +} +function removeFromTabOrder(candidates) { + candidates.forEach((candidate) => { + candidate.dataset.tabindex = candidate.getAttribute("tabindex") || ""; + candidate.setAttribute("tabindex", "-1"); + }); + return () => { + candidates.forEach((candidate) => { + const prevTabIndex = candidate.dataset.tabindex; + candidate.setAttribute("tabindex", prevTabIndex); + }); + }; +} +function useResizeObserver(element, onResize) { + const handleResize = (0, import_react_use_callback_ref.useCallbackRef)(onResize); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + let rAF = 0; + if (element) { + const resizeObserver = new ResizeObserver(() => { + cancelAnimationFrame(rAF); + rAF = window.requestAnimationFrame(handleResize); + }); + resizeObserver.observe(element); + return () => { + window.cancelAnimationFrame(rAF); + resizeObserver.unobserve(element); + }; + } + }, [element, handleResize]); +} +function getOpenState(open) { + return open ? "open" : "closed"; +} +function makeTriggerId(baseId, value) { + return `${baseId}-trigger-${value}`; +} +function makeContentId(baseId, value) { + return `${baseId}-content-${value}`; +} +function whenMouse(handler) { + return (event) => event.pointerType === "mouse" ? handler(event) : void 0; +} +var Root2 = NavigationMenu; +var Sub = NavigationMenuSub; +var List = NavigationMenuList; +var Item = NavigationMenuItem; +var Trigger = NavigationMenuTrigger; +var Link = NavigationMenuLink; +var Indicator = NavigationMenuIndicator; +var Content = NavigationMenuContent; +var Viewport = NavigationMenuViewport; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e8f7f8d19e91061443e30dee9dd7e7b433ceb49c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/navigation-menu.tsx"], + "sourcesContent": ["'use client';\nexport {\n createNavigationMenuScope,\n //\n NavigationMenu,\n NavigationMenuSub,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuContent,\n NavigationMenuViewport,\n //\n Root,\n Sub,\n List,\n Item,\n Trigger,\n Link,\n Indicator,\n Content,\n Viewport,\n} from './navigation-menu';\nexport type {\n NavigationMenuProps,\n NavigationMenuSubProps,\n NavigationMenuListProps,\n NavigationMenuItemProps,\n NavigationMenuTriggerProps,\n NavigationMenuLinkProps,\n NavigationMenuIndicatorProps,\n NavigationMenuContentProps,\n NavigationMenuViewportProps,\n} from './navigation-menu';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { composeRefs, useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Presence } from '@radix-ui/react-presence';\nimport { useId } from '@radix-ui/react-id';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Orientation = 'vertical' | 'horizontal';\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAVIGATION_MENU_NAME = 'NavigationMenu';\n\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n NavigationMenuTriggerElement,\n { value: string }\n>(NAVIGATION_MENU_NAME);\n\nconst [FocusGroupCollection, useFocusGroupCollection, createFocusGroupCollectionScope] =\n createCollection(NAVIGATION_MENU_NAME);\n\ntype ScopedProps

= P & { __scopeNavigationMenu?: Scope };\nconst [createNavigationMenuContext, createNavigationMenuScope] = createContextScope(\n NAVIGATION_MENU_NAME,\n [createCollectionScope, createFocusGroupCollectionScope],\n);\n\ntype ContentData = {\n ref?: React.Ref;\n} & ViewportContentMounterProps;\n\ntype NavigationMenuContextValue = {\n isRootMenu: boolean;\n value: string;\n previousValue: string;\n baseId: string;\n dir: Direction;\n orientation: Orientation;\n rootNavigationMenu: NavigationMenuElement | null;\n indicatorTrack: HTMLDivElement | null;\n onIndicatorTrackChange(indicatorTrack: HTMLDivElement | null): void;\n viewport: NavigationMenuViewportElement | null;\n onViewportChange(viewport: NavigationMenuViewportElement | null): void;\n onViewportContentChange(contentValue: string, contentData: ContentData): void;\n onViewportContentRemove(contentValue: string): void;\n onTriggerEnter(itemValue: string): void;\n onTriggerLeave(): void;\n onContentEnter(): void;\n onContentLeave(): void;\n onItemSelect(itemValue: string): void;\n onItemDismiss(): void;\n};\n\nconst [NavigationMenuProviderImpl, useNavigationMenuContext] =\n createNavigationMenuContext(NAVIGATION_MENU_NAME);\n\nconst [ViewportContentProvider, useViewportContentContext] = createNavigationMenuContext<{\n items: Map;\n}>(NAVIGATION_MENU_NAME);\n\ntype NavigationMenuElement = React.ComponentRef;\ntype PrimitiveNavProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuProps\n extends\n Omit,\n PrimitiveNavProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n dir?: Direction;\n orientation?: Orientation;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened.\n * @defaultValue 200\n */\n delayDuration?: number;\n /**\n * How much time a user has to enter another trigger without incurring a delay again.\n * @defaultValue 300\n */\n skipDelayDuration?: number;\n}\n\nconst NavigationMenu = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value: valueProp,\n onValueChange,\n defaultValue,\n delayDuration = 200,\n skipDelayDuration = 300,\n orientation = 'horizontal',\n dir,\n ...NavigationMenuProps\n } = props;\n const [navigationMenu, setNavigationMenu] = React.useState(null);\n const composedRef = useComposedRefs(forwardedRef, (node) => setNavigationMenu(node));\n const direction = useDirection(dir);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const skipDelayTimerRef = React.useRef(0);\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: (value) => {\n const isOpen = value !== '';\n const hasSkipDelayDuration = skipDelayDuration > 0;\n\n if (isOpen) {\n window.clearTimeout(skipDelayTimerRef.current);\n if (hasSkipDelayDuration) setIsOpenDelayed(false);\n } else {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration,\n );\n }\n\n onValueChange?.(value);\n },\n defaultProp: defaultValue ?? '',\n caller: NAVIGATION_MENU_NAME,\n });\n\n const startCloseTimer = React.useCallback(() => {\n window.clearTimeout(closeTimerRef.current);\n closeTimerRef.current = window.setTimeout(() => setValue(''), 150);\n }, [setValue]);\n\n const handleOpen = React.useCallback(\n (itemValue: string) => {\n window.clearTimeout(closeTimerRef.current);\n setValue(itemValue);\n },\n [setValue],\n );\n\n const handleDelayedOpen = React.useCallback(\n (itemValue: string) => {\n const isOpenItem = value === itemValue;\n if (isOpenItem) {\n // If the item is already open (e.g. we're transitioning from the content to the trigger)\n // then we want to clear the close timer immediately.\n window.clearTimeout(closeTimerRef.current);\n } else {\n openTimerRef.current = window.setTimeout(() => {\n window.clearTimeout(closeTimerRef.current);\n setValue(itemValue);\n }, delayDuration);\n }\n },\n [value, setValue, delayDuration],\n );\n\n React.useEffect(() => {\n return () => {\n window.clearTimeout(openTimerRef.current);\n window.clearTimeout(closeTimerRef.current);\n window.clearTimeout(skipDelayTimerRef.current);\n };\n }, []);\n\n return (\n {\n window.clearTimeout(openTimerRef.current);\n if (isOpenDelayed) handleDelayedOpen(itemValue);\n else handleOpen(itemValue);\n }}\n onTriggerLeave={() => {\n window.clearTimeout(openTimerRef.current);\n startCloseTimer();\n }}\n onContentEnter={() => window.clearTimeout(closeTimerRef.current)}\n onContentLeave={startCloseTimer}\n onItemSelect={(itemValue) => {\n setValue((prevValue) => (prevValue === itemValue ? '' : itemValue));\n }}\n onItemDismiss={() => setValue('')}\n >\n \n \n );\n },\n);\n\nNavigationMenu.displayName = NAVIGATION_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'NavigationMenuSub';\n\ntype NavigationMenuSubElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuSubProps\n extends\n Omit,\n PrimitiveDivProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n orientation?: Orientation;\n}\n\nconst NavigationMenuSub = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = 'horizontal',\n ...subProps\n } = props;\n const context = useNavigationMenuContext(SUB_NAME, __scopeNavigationMenu);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue ?? '',\n caller: SUB_NAME,\n });\n\n return (\n setValue(itemValue)}\n onItemSelect={(itemValue) => setValue(itemValue)}\n onItemDismiss={() => setValue('')}\n >\n \n \n );\n },\n);\n\nNavigationMenuSub.displayName = SUB_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ninterface NavigationMenuProviderPrivateProps {\n isRootMenu: boolean;\n scope: Scope;\n children: React.ReactNode;\n orientation: Orientation;\n dir: Direction;\n rootNavigationMenu: NavigationMenuElement | null;\n value: string;\n onTriggerEnter(itemValue: string): void;\n onTriggerLeave?(): void;\n onContentEnter?(): void;\n onContentLeave?(): void;\n onItemSelect(itemValue: string): void;\n onItemDismiss(): void;\n}\n\ninterface NavigationMenuProviderProps extends NavigationMenuProviderPrivateProps {}\n\nconst NavigationMenuProvider: React.FC = (\n props: ScopedProps,\n) => {\n const {\n scope,\n isRootMenu,\n rootNavigationMenu,\n dir,\n orientation,\n children,\n value,\n onItemSelect,\n onItemDismiss,\n onTriggerEnter,\n onTriggerLeave,\n onContentEnter,\n onContentLeave,\n } = props;\n const [viewport, setViewport] = React.useState(null);\n const [viewportContent, setViewportContent] = React.useState>(new Map());\n const [indicatorTrack, setIndicatorTrack] = React.useState(null);\n\n return (\n {\n setViewportContent((prevContent) => {\n prevContent.set(contentValue, contentData);\n return new Map(prevContent);\n });\n }, [])}\n onViewportContentRemove={React.useCallback((contentValue) => {\n setViewportContent((prevContent) => {\n if (!prevContent.has(contentValue)) return prevContent;\n prevContent.delete(contentValue);\n return new Map(prevContent);\n });\n }, [])}\n >\n \n \n {children}\n \n \n \n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuList\n * -----------------------------------------------------------------------------------------------*/\n\nconst LIST_NAME = 'NavigationMenuList';\n\ntype NavigationMenuListElement = React.ComponentRef;\ntype PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuListProps extends PrimitiveUnorderedListProps {}\n\nconst NavigationMenuList = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...listProps } = props;\n const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu);\n\n const list = (\n \n );\n\n return (\n \n \n {context.isRootMenu ? {list} : list}\n \n \n );\n },\n);\n\nNavigationMenuList.displayName = LIST_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'NavigationMenuItem';\n\ntype FocusProxyElement = React.ComponentRef;\n\ntype NavigationMenuItemContextValue = {\n value: string;\n triggerRef: React.RefObject;\n contentRef: React.RefObject;\n focusProxyRef: React.RefObject;\n wasEscapeCloseRef: React.MutableRefObject;\n onEntryKeyDown(): void;\n onFocusProxyEnter(side: 'start' | 'end'): void;\n onRootContentClose(): void;\n onContentFocusOutside(): void;\n};\n\nconst [NavigationMenuItemContextProvider, useNavigationMenuItemContext] =\n createNavigationMenuContext(ITEM_NAME);\n\ntype NavigationMenuItemElement = React.ComponentRef;\ntype PrimitiveListItemProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuItemProps extends PrimitiveListItemProps {\n value?: string;\n}\n\nconst NavigationMenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props;\n const autoValue = useId();\n // We need to provide an initial deterministic value as `useId` will return\n // empty string on the first render and we don't want to match our internal \"closed\" value.\n const value = valueProp || autoValue || 'LEGACY_REACT_AUTO_VALUE';\n const contentRef = React.useRef(null);\n const triggerRef = React.useRef(null);\n const focusProxyRef = React.useRef(null);\n const restoreContentTabOrderRef = React.useRef(() => {});\n const wasEscapeCloseRef = React.useRef(false);\n\n const handleContentEntry = React.useCallback((side = 'start') => {\n if (contentRef.current) {\n restoreContentTabOrderRef.current();\n const candidates = getTabbableCandidates(contentRef.current);\n if (candidates.length) focusFirst(side === 'start' ? candidates : candidates.reverse());\n }\n }, []);\n\n const handleContentExit = React.useCallback(() => {\n if (contentRef.current) {\n const candidates = getTabbableCandidates(contentRef.current);\n if (candidates.length) restoreContentTabOrderRef.current = removeFromTabOrder(candidates);\n }\n }, []);\n\n return (\n \n \n \n );\n },\n);\n\nNavigationMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'NavigationMenuTrigger';\n\ntype NavigationMenuTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst NavigationMenuTrigger = React.forwardRef<\n NavigationMenuTriggerElement,\n NavigationMenuTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, disabled, ...triggerProps } = props;\n const context = useNavigationMenuContext(TRIGGER_NAME, props.__scopeNavigationMenu);\n const itemContext = useNavigationMenuItemContext(TRIGGER_NAME, props.__scopeNavigationMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, itemContext.triggerRef, forwardedRef);\n const triggerId = makeTriggerId(context.baseId, itemContext.value);\n const contentId = makeContentId(context.baseId, itemContext.value);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const wasClickCloseRef = React.useRef(false);\n const open = itemContext.value === context.value;\n\n return (\n <>\n \n \n {\n wasClickCloseRef.current = false;\n itemContext.wasEscapeCloseRef.current = false;\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse(() => {\n if (\n disabled ||\n wasClickCloseRef.current ||\n itemContext.wasEscapeCloseRef.current ||\n hasPointerMoveOpenedRef.current\n )\n return;\n context.onTriggerEnter(itemContext.value);\n hasPointerMoveOpenedRef.current = true;\n }),\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse(() => {\n if (disabled) return;\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n }),\n )}\n onClick={composeEventHandlers(props.onClick, () => {\n context.onItemSelect(itemContext.value);\n wasClickCloseRef.current = open;\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const verticalEntryKey = context.dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const entryKey = { horizontal: 'ArrowDown', vertical: verticalEntryKey }[\n context.orientation\n ];\n if (open && event.key === entryKey) {\n itemContext.onEntryKeyDown();\n // Prevent FocusGroupItem from handling the event\n event.preventDefault();\n }\n })}\n />\n \n \n\n {/* Proxy tab order between trigger and content */}\n {open && (\n <>\n {\n const content = itemContext.contentRef.current;\n const prevFocusedElement = event.relatedTarget as HTMLElement | null;\n const wasTriggerFocused = prevFocusedElement === ref.current;\n const wasFocusFromContent = content?.contains(prevFocusedElement);\n\n if (wasTriggerFocused || !wasFocusFromContent) {\n itemContext.onFocusProxyEnter(wasTriggerFocused ? 'start' : 'end');\n }\n }}\n />\n\n {/* Restructure a11y tree to make content accessible to screen reader when using the viewport */}\n {context.viewport && }\n \n )}\n \n );\n});\n\nNavigationMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuLink\n * -----------------------------------------------------------------------------------------------*/\n\nconst LINK_NAME = 'NavigationMenuLink';\nconst LINK_SELECT = 'navigationMenu.linkSelect';\n\ntype NavigationMenuLinkElement = React.ComponentRef;\ntype PrimitiveLinkProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuLinkProps extends Omit {\n active?: boolean;\n onSelect?: (event: Event) => void;\n}\n\nconst NavigationMenuLink = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props;\n\n return (\n \n {\n const target = event.target as HTMLElement;\n const linkSelectEvent = new CustomEvent(LINK_SELECT, {\n bubbles: true,\n cancelable: true,\n });\n target.addEventListener(LINK_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(target, linkSelectEvent);\n\n if (!linkSelectEvent.defaultPrevented && !event.metaKey) {\n const rootContentDismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true,\n });\n dispatchDiscreteCustomEvent(target, rootContentDismissEvent);\n }\n },\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nNavigationMenuLink.displayName = LINK_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'NavigationMenuIndicator';\n\ntype NavigationMenuIndicatorElement = NavigationMenuIndicatorImplElement;\ninterface NavigationMenuIndicatorProps extends NavigationMenuIndicatorImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuIndicator = React.forwardRef<\n NavigationMenuIndicatorElement,\n NavigationMenuIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...indicatorProps } = props;\n const context = useNavigationMenuContext(INDICATOR_NAME, props.__scopeNavigationMenu);\n const isVisible = Boolean(context.value);\n\n return context.indicatorTrack\n ? ReactDOM.createPortal(\n \n \n ,\n context.indicatorTrack,\n )\n : null;\n});\n\nNavigationMenuIndicator.displayName = INDICATOR_NAME;\n\ntype NavigationMenuIndicatorImplElement = React.ComponentRef;\ninterface NavigationMenuIndicatorImplProps extends PrimitiveDivProps {}\n\nconst NavigationMenuIndicatorImpl = React.forwardRef<\n NavigationMenuIndicatorImplElement,\n NavigationMenuIndicatorImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...indicatorProps } = props;\n const context = useNavigationMenuContext(INDICATOR_NAME, __scopeNavigationMenu);\n const getItems = useCollection(__scopeNavigationMenu);\n const [activeTrigger, setActiveTrigger] = React.useState(\n null,\n );\n const [position, setPosition] = React.useState<{ size: number; offset: number } | null>(null);\n const isHorizontal = context.orientation === 'horizontal';\n const isVisible = Boolean(context.value);\n\n React.useEffect(() => {\n const items = getItems();\n const triggerNode = items.find((item) => item.value === context.value)?.ref.current;\n if (triggerNode) setActiveTrigger(triggerNode);\n }, [getItems, context.value]);\n\n /**\n * Update position when the indicator or parent track size changes\n */\n const handlePositionChange = () => {\n if (activeTrigger) {\n setPosition({\n size: isHorizontal ? activeTrigger.offsetWidth : activeTrigger.offsetHeight,\n offset: isHorizontal ? activeTrigger.offsetLeft : activeTrigger.offsetTop,\n });\n }\n };\n useResizeObserver(activeTrigger, handlePositionChange);\n useResizeObserver(context.indicatorTrack, handlePositionChange);\n\n // We need to wait for the indicator position to be available before rendering to\n // snap immediately into position rather than transitioning from initial\n return position ? (\n \n ) : null;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'NavigationMenuContent';\n\ntype NavigationMenuContentElement = NavigationMenuContentImplElement;\ninterface NavigationMenuContentProps extends Omit<\n NavigationMenuContentImplProps,\n keyof NavigationMenuContentImplPrivateProps\n> {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuContent = React.forwardRef<\n NavigationMenuContentElement,\n NavigationMenuContentProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu);\n const itemContext = useNavigationMenuItemContext(CONTENT_NAME, props.__scopeNavigationMenu);\n const composedRefs = useComposedRefs(itemContext.contentRef, forwardedRef);\n const open = itemContext.value === context.value;\n\n const commonProps = {\n value: itemContext.value,\n triggerRef: itemContext.triggerRef,\n focusProxyRef: itemContext.focusProxyRef,\n wasEscapeCloseRef: itemContext.wasEscapeCloseRef,\n onContentFocusOutside: itemContext.onContentFocusOutside,\n onRootContentClose: itemContext.onRootContentClose,\n ...contentProps,\n };\n\n return !context.viewport ? (\n \n \n \n ) : (\n \n );\n});\n\nNavigationMenuContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ViewportContentMounterElement = NavigationMenuContentImplElement;\ninterface ViewportContentMounterProps extends NavigationMenuContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst ViewportContentMounter = React.forwardRef<\n ViewportContentMounterElement,\n ViewportContentMounterProps\n>((props: ScopedProps, forwardedRef) => {\n const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu);\n const { onViewportContentChange, onViewportContentRemove } = context;\n\n useLayoutEffect(() => {\n onViewportContentChange(props.value, {\n ref: forwardedRef,\n ...props,\n });\n }, [props, forwardedRef, onViewportContentChange]);\n\n useLayoutEffect(() => {\n return () => onViewportContentRemove(props.value);\n }, [props.value, onViewportContentRemove]);\n\n // Content is proxied into the viewport\n return null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss';\n\ntype MotionAttribute = 'to-start' | 'to-end' | 'from-start' | 'from-end';\ntype NavigationMenuContentImplElement = React.ComponentRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\n\ninterface NavigationMenuContentImplPrivateProps {\n value: string;\n triggerRef: React.RefObject;\n focusProxyRef: React.RefObject;\n wasEscapeCloseRef: React.MutableRefObject;\n onContentFocusOutside(): void;\n onRootContentClose(): void;\n}\ninterface NavigationMenuContentImplProps\n extends\n Omit,\n NavigationMenuContentImplPrivateProps {}\n\nconst NavigationMenuContentImpl = React.forwardRef<\n NavigationMenuContentImplElement,\n NavigationMenuContentImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value,\n triggerRef,\n focusProxyRef,\n wasEscapeCloseRef,\n onRootContentClose,\n onContentFocusOutside,\n ...contentProps\n } = props;\n const context = useNavigationMenuContext(CONTENT_NAME, __scopeNavigationMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const getItems = useCollection(__scopeNavigationMenu);\n const prevMotionAttributeRef = React.useRef(null);\n\n const { onItemDismiss } = context;\n\n React.useEffect(() => {\n const content = ref.current;\n\n // Bubble dismiss to the root content node and focus its trigger\n if (context.isRootMenu && content) {\n const handleClose = () => {\n onItemDismiss();\n onRootContentClose();\n if (content.contains(document.activeElement)) triggerRef.current?.focus();\n };\n content.addEventListener(ROOT_CONTENT_DISMISS, handleClose);\n return () => content.removeEventListener(ROOT_CONTENT_DISMISS, handleClose);\n }\n }, [context.isRootMenu, props.value, triggerRef, onItemDismiss, onRootContentClose]);\n\n const motionAttribute = React.useMemo(() => {\n const items = getItems();\n const values = items.map((item) => item.value);\n if (context.dir === 'rtl') values.reverse();\n const index = values.indexOf(context.value);\n const prevIndex = values.indexOf(context.previousValue);\n const isSelected = value === context.value;\n const wasSelected = prevIndex === values.indexOf(value);\n\n // We only want to update selected and the last selected content\n // this avoids animations being interrupted outside of that range\n if (!isSelected && !wasSelected) return prevMotionAttributeRef.current;\n\n const attribute = (() => {\n // Don't provide a direction on the initial open\n if (index !== prevIndex) {\n // If we're moving to this item from another\n if (isSelected && prevIndex !== -1) return index > prevIndex ? 'from-end' : 'from-start';\n // If we're leaving this item for another\n if (wasSelected && index !== -1) return index > prevIndex ? 'to-start' : 'to-end';\n }\n // Otherwise we're entering from closed or leaving the list\n // entirely and should not animate in any direction\n return null;\n })();\n\n prevMotionAttributeRef.current = attribute;\n return attribute;\n }, [context.previousValue, context.value, context.dir, getItems, value]);\n\n return (\n \n {\n const rootContentDismissEvent = new Event(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true,\n });\n ref.current?.dispatchEvent(rootContentDismissEvent);\n }}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n onContentFocusOutside();\n const target = event.target as HTMLElement;\n // Only dismiss content when focus moves outside of the menu\n if (context.rootNavigationMenu?.contains(target)) event.preventDefault();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const target = event.target as HTMLElement;\n const isTrigger = getItems().some((item) => item.ref.current?.contains(target));\n const isRootViewport = context.isRootMenu && context.viewport?.contains(target);\n if (isTrigger || isRootViewport || !context.isRootMenu) event.preventDefault();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === 'Tab' && !isMetaKey;\n if (isTabKey) {\n const candidates = getTabbableCandidates(event.currentTarget);\n const focusedElement = document.activeElement;\n const index = candidates.findIndex((candidate) => candidate === focusedElement);\n const isMovingBackwards = event.shiftKey;\n const nextCandidates = isMovingBackwards\n ? candidates.slice(0, index).reverse()\n : candidates.slice(index + 1, candidates.length);\n\n if (focusFirst(nextCandidates)) {\n // prevent browser tab keydown because we've handled focus\n event.preventDefault();\n } else {\n // If we can't focus that means we're at the edges\n // so focus the proxy and let browser handle\n // tab/shift+tab keypress on the proxy instead\n focusProxyRef.current?.focus();\n }\n }\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (_event) => {\n // prevent the dropdown from reopening\n // after the escape key has been pressed\n wasEscapeCloseRef.current = true;\n })}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = 'NavigationMenuViewport';\n\ntype NavigationMenuViewportElement = NavigationMenuViewportImplElement;\ninterface NavigationMenuViewportProps extends Omit<\n NavigationMenuViewportImplProps,\n 'activeContentValue'\n> {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuViewport = React.forwardRef<\n NavigationMenuViewportElement,\n NavigationMenuViewportProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...viewportProps } = props;\n const context = useNavigationMenuContext(VIEWPORT_NAME, props.__scopeNavigationMenu);\n const open = Boolean(context.value);\n\n return (\n \n \n \n );\n});\n\nNavigationMenuViewport.displayName = VIEWPORT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype NavigationMenuViewportImplElement = React.ComponentRef;\ninterface NavigationMenuViewportImplProps extends PrimitiveDivProps {}\n\nconst NavigationMenuViewportImpl = React.forwardRef<\n NavigationMenuViewportImplElement,\n NavigationMenuViewportImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, children, ...viewportImplProps } = props;\n const context = useNavigationMenuContext(VIEWPORT_NAME, __scopeNavigationMenu);\n const composedRefs = useComposedRefs(forwardedRef, context.onViewportChange);\n const viewportContentContext = useViewportContentContext(\n CONTENT_NAME,\n props.__scopeNavigationMenu,\n );\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n const [content, setContent] = React.useState(null);\n const viewportWidth = size ? size?.width + 'px' : undefined;\n const viewportHeight = size ? size?.height + 'px' : undefined;\n const open = Boolean(context.value);\n // We persist the last active content value as the viewport may be animating out\n // and we want the content to remain mounted for the lifecycle of the viewport.\n const activeContentValue = open ? context.value : context.previousValue;\n\n /**\n * Update viewport size to match the active content node.\n * We prefer offset dimensions over `getBoundingClientRect` as the latter respects CSS transform.\n * For example, if content animates in from `scale(0.5)` the dimensions would be anything\n * from `0.5` to `1` of the intended size.\n */\n const handleSizeChange = () => {\n if (content) setSize({ width: content.offsetWidth, height: content.offsetHeight });\n };\n useResizeObserver(content, handleSizeChange);\n\n return (\n \n {Array.from(viewportContentContext.items).map(([value, { ref, forceMount, ...props }]) => {\n const isActive = activeContentValue === value;\n return (\n \n {\n // We only want to update the stored node when another is available\n // as we need to smoothly transition between them.\n if (isActive && node) setContent(node);\n })}\n />\n \n );\n })}\n \n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_GROUP_NAME = 'FocusGroup';\n\ntype FocusGroupElement = React.ComponentRef;\ninterface FocusGroupProps extends PrimitiveDivProps {}\n\nconst FocusGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...groupProps } = props;\n const context = useNavigationMenuContext(FOCUS_GROUP_NAME, __scopeNavigationMenu);\n\n return (\n \n \n \n \n \n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_KEYS = ['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'];\nconst FOCUS_GROUP_ITEM_NAME = 'FocusGroupItem';\n\ntype FocusGroupItemElement = React.ComponentRef;\ninterface FocusGroupItemProps extends PrimitiveButtonProps {}\n\nconst FocusGroupItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...groupProps } = props;\n const getItems = useFocusGroupCollection(__scopeNavigationMenu);\n const context = useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu);\n\n return (\n \n {\n const isFocusNavigationKey = ['Home', 'End', ...ARROW_KEYS].includes(event.key);\n if (isFocusNavigationKey) {\n let candidateNodes = getItems().map((item) => item.ref.current!);\n const prevItemKey = context.dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n const prevKeys = [prevItemKey, 'ArrowUp', 'End'];\n if (prevKeys.includes(event.key)) candidateNodes.reverse();\n if (ARROW_KEYS.includes(event.key)) {\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n // Prevent page scroll while navigating\n event.preventDefault();\n }\n })}\n />\n \n );\n },\n);\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\n\nfunction removeFromTabOrder(candidates: HTMLElement[]) {\n candidates.forEach((candidate) => {\n candidate.dataset.tabindex = candidate.getAttribute('tabindex') || '';\n candidate.setAttribute('tabindex', '-1');\n });\n return () => {\n candidates.forEach((candidate) => {\n const prevTabIndex = candidate.dataset.tabindex as string;\n candidate.setAttribute('tabindex', prevTabIndex);\n });\n };\n}\n\nfunction useResizeObserver(element: HTMLElement | null, onResize: () => void) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\n\nfunction getOpenState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nfunction makeTriggerId(baseId: string, value: string) {\n return `${baseId}-trigger-${value}`;\n}\n\nfunction makeContentId(baseId: string, value: string) {\n return `${baseId}-content-${value}`;\n}\n\nfunction whenMouse(handler: React.PointerEventHandler): React.PointerEventHandler {\n return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = NavigationMenu;\nconst Sub = NavigationMenuSub;\nconst List = NavigationMenuList;\nconst Item = NavigationMenuItem;\nconst Trigger = NavigationMenuTrigger;\nconst Link = NavigationMenuLink;\nconst Indicator = NavigationMenuIndicator;\nconst Content = NavigationMenuContent;\nconst Viewport = NavigationMenuViewport;\n\nexport {\n createNavigationMenuScope,\n //\n NavigationMenu,\n NavigationMenuSub,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuContent,\n NavigationMenuViewport,\n //\n Root,\n Sub,\n List,\n Item,\n Trigger,\n Link,\n Indicator,\n Content,\n Viewport,\n};\nexport type {\n NavigationMenuProps,\n NavigationMenuSubProps,\n NavigationMenuListProps,\n NavigationMenuItemProps,\n NavigationMenuTriggerProps,\n NavigationMenuLinkProps,\n NavigationMenuIndicatorProps,\n NavigationMenuContentProps,\n NavigationMenuViewportProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,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,SAAS,UAAa,SAAqE;AACzF,SAAO,CAAC,UAAW,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI;AACtE;AAIA,IAAMC,QAAO;AACb,IAAM,MAAM;AACZ,IAAM,OAAO;AACb,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAM,OAAO;AACb,IAAM,YAAY;AAClB,IAAM,UAAU;AAChB,IAAM,WAAW;", + "names": ["Root", "value", "event", "props", "Root"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..15226cd3a13a0f783b47b3f9432d49a27ea12589 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs @@ -0,0 +1,806 @@ +"use client"; + +// src/navigation-menu.tsx +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import { createContextScope } from "@radix-ui/react-context"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { Primitive, dispatchDiscreteCustomEvent } from "@radix-ui/react-primitive"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { composeRefs, useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useDirection } from "@radix-ui/react-direction"; +import { Presence } from "@radix-ui/react-presence"; +import { useId } from "@radix-ui/react-id"; +import { createCollection } from "@radix-ui/react-collection"; +import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; +import { usePrevious } from "@radix-ui/react-use-previous"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import * as VisuallyHiddenPrimitive from "@radix-ui/react-visually-hidden"; +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var NAVIGATION_MENU_NAME = "NavigationMenu"; +var [Collection, useCollection, createCollectionScope] = createCollection(NAVIGATION_MENU_NAME); +var [FocusGroupCollection, useFocusGroupCollection, createFocusGroupCollectionScope] = createCollection(NAVIGATION_MENU_NAME); +var [createNavigationMenuContext, createNavigationMenuScope] = createContextScope( + NAVIGATION_MENU_NAME, + [createCollectionScope, createFocusGroupCollectionScope] +); +var [NavigationMenuProviderImpl, useNavigationMenuContext] = createNavigationMenuContext(NAVIGATION_MENU_NAME); +var [ViewportContentProvider, useViewportContentContext] = createNavigationMenuContext(NAVIGATION_MENU_NAME); +var NavigationMenu = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeNavigationMenu, + value: valueProp, + onValueChange, + defaultValue, + delayDuration = 200, + skipDelayDuration = 300, + orientation = "horizontal", + dir, + ...NavigationMenuProps + } = props; + const [navigationMenu, setNavigationMenu] = React.useState(null); + const composedRef = useComposedRefs(forwardedRef, (node) => setNavigationMenu(node)); + const direction = useDirection(dir); + const openTimerRef = React.useRef(0); + const closeTimerRef = React.useRef(0); + const skipDelayTimerRef = React.useRef(0); + const [isOpenDelayed, setIsOpenDelayed] = React.useState(true); + const [value, setValue] = useControllableState({ + prop: valueProp, + onChange: (value2) => { + const isOpen = value2 !== ""; + const hasSkipDelayDuration = skipDelayDuration > 0; + if (isOpen) { + window.clearTimeout(skipDelayTimerRef.current); + if (hasSkipDelayDuration) setIsOpenDelayed(false); + } else { + window.clearTimeout(skipDelayTimerRef.current); + skipDelayTimerRef.current = window.setTimeout( + () => setIsOpenDelayed(true), + skipDelayDuration + ); + } + onValueChange?.(value2); + }, + defaultProp: defaultValue ?? "", + caller: NAVIGATION_MENU_NAME + }); + const startCloseTimer = React.useCallback(() => { + window.clearTimeout(closeTimerRef.current); + closeTimerRef.current = window.setTimeout(() => setValue(""), 150); + }, [setValue]); + const handleOpen = React.useCallback( + (itemValue) => { + window.clearTimeout(closeTimerRef.current); + setValue(itemValue); + }, + [setValue] + ); + const handleDelayedOpen = React.useCallback( + (itemValue) => { + const isOpenItem = value === itemValue; + if (isOpenItem) { + window.clearTimeout(closeTimerRef.current); + } else { + openTimerRef.current = window.setTimeout(() => { + window.clearTimeout(closeTimerRef.current); + setValue(itemValue); + }, delayDuration); + } + }, + [value, setValue, delayDuration] + ); + React.useEffect(() => { + return () => { + window.clearTimeout(openTimerRef.current); + window.clearTimeout(closeTimerRef.current); + window.clearTimeout(skipDelayTimerRef.current); + }; + }, []); + return /* @__PURE__ */ jsx( + NavigationMenuProvider, + { + scope: __scopeNavigationMenu, + isRootMenu: true, + value, + dir: direction, + orientation, + rootNavigationMenu: navigationMenu, + onTriggerEnter: (itemValue) => { + window.clearTimeout(openTimerRef.current); + if (isOpenDelayed) handleDelayedOpen(itemValue); + else handleOpen(itemValue); + }, + onTriggerLeave: () => { + window.clearTimeout(openTimerRef.current); + startCloseTimer(); + }, + onContentEnter: () => window.clearTimeout(closeTimerRef.current), + onContentLeave: startCloseTimer, + onItemSelect: (itemValue) => { + setValue((prevValue) => prevValue === itemValue ? "" : itemValue); + }, + onItemDismiss: () => setValue(""), + children: /* @__PURE__ */ jsx( + Primitive.nav, + { + "aria-label": "Main", + "data-orientation": orientation, + dir: direction, + ...NavigationMenuProps, + ref: composedRef + } + ) + } + ); + } +); +NavigationMenu.displayName = NAVIGATION_MENU_NAME; +var SUB_NAME = "NavigationMenuSub"; +var NavigationMenuSub = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeNavigationMenu, + value: valueProp, + onValueChange, + defaultValue, + orientation = "horizontal", + ...subProps + } = props; + const context = useNavigationMenuContext(SUB_NAME, __scopeNavigationMenu); + const [value, setValue] = useControllableState({ + prop: valueProp, + onChange: onValueChange, + defaultProp: defaultValue ?? "", + caller: SUB_NAME + }); + return /* @__PURE__ */ jsx( + NavigationMenuProvider, + { + scope: __scopeNavigationMenu, + isRootMenu: false, + value, + dir: context.dir, + orientation, + rootNavigationMenu: context.rootNavigationMenu, + onTriggerEnter: (itemValue) => setValue(itemValue), + onItemSelect: (itemValue) => setValue(itemValue), + onItemDismiss: () => setValue(""), + children: /* @__PURE__ */ jsx(Primitive.div, { "data-orientation": orientation, ...subProps, ref: forwardedRef }) + } + ); + } +); +NavigationMenuSub.displayName = SUB_NAME; +var NavigationMenuProvider = (props) => { + const { + scope, + isRootMenu, + rootNavigationMenu, + dir, + orientation, + children, + value, + onItemSelect, + onItemDismiss, + onTriggerEnter, + onTriggerLeave, + onContentEnter, + onContentLeave + } = props; + const [viewport, setViewport] = React.useState(null); + const [viewportContent, setViewportContent] = React.useState(/* @__PURE__ */ new Map()); + const [indicatorTrack, setIndicatorTrack] = React.useState(null); + return /* @__PURE__ */ jsx( + NavigationMenuProviderImpl, + { + scope, + isRootMenu, + rootNavigationMenu, + value, + previousValue: usePrevious(value), + baseId: useId(), + dir, + orientation, + viewport, + onViewportChange: setViewport, + indicatorTrack, + onIndicatorTrackChange: setIndicatorTrack, + onTriggerEnter: useCallbackRef(onTriggerEnter), + onTriggerLeave: useCallbackRef(onTriggerLeave), + onContentEnter: useCallbackRef(onContentEnter), + onContentLeave: useCallbackRef(onContentLeave), + onItemSelect: useCallbackRef(onItemSelect), + onItemDismiss: useCallbackRef(onItemDismiss), + onViewportContentChange: React.useCallback((contentValue, contentData) => { + setViewportContent((prevContent) => { + prevContent.set(contentValue, contentData); + return new Map(prevContent); + }); + }, []), + onViewportContentRemove: React.useCallback((contentValue) => { + setViewportContent((prevContent) => { + if (!prevContent.has(contentValue)) return prevContent; + prevContent.delete(contentValue); + return new Map(prevContent); + }); + }, []), + children: /* @__PURE__ */ jsx(Collection.Provider, { scope, children: /* @__PURE__ */ jsx(ViewportContentProvider, { scope, items: viewportContent, children }) }) + } + ); +}; +var LIST_NAME = "NavigationMenuList"; +var NavigationMenuList = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, ...listProps } = props; + const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu); + const list = /* @__PURE__ */ jsx(Primitive.ul, { "data-orientation": context.orientation, ...listProps, ref: forwardedRef }); + return /* @__PURE__ */ jsx(Primitive.div, { style: { position: "relative" }, ref: context.onIndicatorTrackChange, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeNavigationMenu, children: context.isRootMenu ? /* @__PURE__ */ jsx(FocusGroup, { asChild: true, children: list }) : list }) }); + } +); +NavigationMenuList.displayName = LIST_NAME; +var ITEM_NAME = "NavigationMenuItem"; +var [NavigationMenuItemContextProvider, useNavigationMenuItemContext] = createNavigationMenuContext(ITEM_NAME); +var NavigationMenuItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props; + const autoValue = useId(); + const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE"; + const contentRef = React.useRef(null); + const triggerRef = React.useRef(null); + const focusProxyRef = React.useRef(null); + const restoreContentTabOrderRef = React.useRef(() => { + }); + const wasEscapeCloseRef = React.useRef(false); + const handleContentEntry = React.useCallback((side = "start") => { + if (contentRef.current) { + restoreContentTabOrderRef.current(); + const candidates = getTabbableCandidates(contentRef.current); + if (candidates.length) focusFirst(side === "start" ? candidates : candidates.reverse()); + } + }, []); + const handleContentExit = React.useCallback(() => { + if (contentRef.current) { + const candidates = getTabbableCandidates(contentRef.current); + if (candidates.length) restoreContentTabOrderRef.current = removeFromTabOrder(candidates); + } + }, []); + return /* @__PURE__ */ jsx( + NavigationMenuItemContextProvider, + { + scope: __scopeNavigationMenu, + value, + triggerRef, + contentRef, + focusProxyRef, + wasEscapeCloseRef, + onEntryKeyDown: handleContentEntry, + onFocusProxyEnter: handleContentEntry, + onRootContentClose: handleContentExit, + onContentFocusOutside: handleContentExit, + children: /* @__PURE__ */ jsx(Primitive.li, { ...itemProps, ref: forwardedRef }) + } + ); + } +); +NavigationMenuItem.displayName = ITEM_NAME; +var TRIGGER_NAME = "NavigationMenuTrigger"; +var NavigationMenuTrigger = React.forwardRef((props, forwardedRef) => { + const { __scopeNavigationMenu, disabled, ...triggerProps } = props; + const context = useNavigationMenuContext(TRIGGER_NAME, props.__scopeNavigationMenu); + const itemContext = useNavigationMenuItemContext(TRIGGER_NAME, props.__scopeNavigationMenu); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(ref, itemContext.triggerRef, forwardedRef); + const triggerId = makeTriggerId(context.baseId, itemContext.value); + const contentId = makeContentId(context.baseId, itemContext.value); + const hasPointerMoveOpenedRef = React.useRef(false); + const wasClickCloseRef = React.useRef(false); + const open = itemContext.value === context.value; + return /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeNavigationMenu, value: itemContext.value, children: /* @__PURE__ */ jsx(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ jsx( + Primitive.button, + { + id: triggerId, + disabled, + "data-disabled": disabled ? "" : void 0, + "data-state": getOpenState(open), + "aria-expanded": open, + "aria-controls": open ? contentId : void 0, + ...triggerProps, + ref: composedRefs, + onPointerEnter: composeEventHandlers(props.onPointerEnter, () => { + wasClickCloseRef.current = false; + itemContext.wasEscapeCloseRef.current = false; + }), + onPointerMove: composeEventHandlers( + props.onPointerMove, + whenMouse(() => { + if (disabled || wasClickCloseRef.current || itemContext.wasEscapeCloseRef.current || hasPointerMoveOpenedRef.current) + return; + context.onTriggerEnter(itemContext.value); + hasPointerMoveOpenedRef.current = true; + }) + ), + onPointerLeave: composeEventHandlers( + props.onPointerLeave, + whenMouse(() => { + if (disabled) return; + context.onTriggerLeave(); + hasPointerMoveOpenedRef.current = false; + }) + ), + onClick: composeEventHandlers(props.onClick, () => { + context.onItemSelect(itemContext.value); + wasClickCloseRef.current = open; + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + const verticalEntryKey = context.dir === "rtl" ? "ArrowLeft" : "ArrowRight"; + const entryKey = { horizontal: "ArrowDown", vertical: verticalEntryKey }[context.orientation]; + if (open && event.key === entryKey) { + itemContext.onEntryKeyDown(); + event.preventDefault(); + } + }) + } + ) }) }), + open && /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx( + VisuallyHiddenPrimitive.Root, + { + "aria-hidden": true, + tabIndex: 0, + ref: itemContext.focusProxyRef, + onFocus: (event) => { + const content = itemContext.contentRef.current; + const prevFocusedElement = event.relatedTarget; + const wasTriggerFocused = prevFocusedElement === ref.current; + const wasFocusFromContent = content?.contains(prevFocusedElement); + if (wasTriggerFocused || !wasFocusFromContent) { + itemContext.onFocusProxyEnter(wasTriggerFocused ? "start" : "end"); + } + } + } + ), + context.viewport && /* @__PURE__ */ jsx("span", { "aria-owns": contentId }) + ] }) + ] }); +}); +NavigationMenuTrigger.displayName = TRIGGER_NAME; +var LINK_NAME = "NavigationMenuLink"; +var LINK_SELECT = "navigationMenu.linkSelect"; +var NavigationMenuLink = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props; + return /* @__PURE__ */ jsx(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ jsx( + Primitive.a, + { + "data-active": active ? "" : void 0, + "aria-current": active ? "page" : void 0, + ...linkProps, + ref: forwardedRef, + onClick: composeEventHandlers( + props.onClick, + (event) => { + const target = event.target; + const linkSelectEvent = new CustomEvent(LINK_SELECT, { + bubbles: true, + cancelable: true + }); + target.addEventListener(LINK_SELECT, (event2) => onSelect?.(event2), { once: true }); + dispatchDiscreteCustomEvent(target, linkSelectEvent); + if (!linkSelectEvent.defaultPrevented && !event.metaKey) { + const rootContentDismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, { + bubbles: true, + cancelable: true + }); + dispatchDiscreteCustomEvent(target, rootContentDismissEvent); + } + }, + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +NavigationMenuLink.displayName = LINK_NAME; +var INDICATOR_NAME = "NavigationMenuIndicator"; +var NavigationMenuIndicator = React.forwardRef((props, forwardedRef) => { + const { forceMount, ...indicatorProps } = props; + const context = useNavigationMenuContext(INDICATOR_NAME, props.__scopeNavigationMenu); + const isVisible = Boolean(context.value); + return context.indicatorTrack ? ReactDOM.createPortal( + /* @__PURE__ */ jsx(Presence, { present: forceMount || isVisible, children: /* @__PURE__ */ jsx(NavigationMenuIndicatorImpl, { ...indicatorProps, ref: forwardedRef }) }), + context.indicatorTrack + ) : null; +}); +NavigationMenuIndicator.displayName = INDICATOR_NAME; +var NavigationMenuIndicatorImpl = React.forwardRef((props, forwardedRef) => { + const { __scopeNavigationMenu, ...indicatorProps } = props; + const context = useNavigationMenuContext(INDICATOR_NAME, __scopeNavigationMenu); + const getItems = useCollection(__scopeNavigationMenu); + const [activeTrigger, setActiveTrigger] = React.useState( + null + ); + const [position, setPosition] = React.useState(null); + const isHorizontal = context.orientation === "horizontal"; + const isVisible = Boolean(context.value); + React.useEffect(() => { + const items = getItems(); + const triggerNode = items.find((item) => item.value === context.value)?.ref.current; + if (triggerNode) setActiveTrigger(triggerNode); + }, [getItems, context.value]); + const handlePositionChange = () => { + if (activeTrigger) { + setPosition({ + size: isHorizontal ? activeTrigger.offsetWidth : activeTrigger.offsetHeight, + offset: isHorizontal ? activeTrigger.offsetLeft : activeTrigger.offsetTop + }); + } + }; + useResizeObserver(activeTrigger, handlePositionChange); + useResizeObserver(context.indicatorTrack, handlePositionChange); + return position ? /* @__PURE__ */ jsx( + Primitive.div, + { + "aria-hidden": true, + "data-state": isVisible ? "visible" : "hidden", + "data-orientation": context.orientation, + ...indicatorProps, + ref: forwardedRef, + style: { + position: "absolute", + ...isHorizontal ? { + left: 0, + width: position.size + "px", + transform: `translateX(${position.offset}px)` + } : { + top: 0, + height: position.size + "px", + transform: `translateY(${position.offset}px)` + }, + ...indicatorProps.style + } + } + ) : null; +}); +var CONTENT_NAME = "NavigationMenuContent"; +var NavigationMenuContent = React.forwardRef((props, forwardedRef) => { + const { forceMount, ...contentProps } = props; + const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu); + const itemContext = useNavigationMenuItemContext(CONTENT_NAME, props.__scopeNavigationMenu); + const composedRefs = useComposedRefs(itemContext.contentRef, forwardedRef); + const open = itemContext.value === context.value; + const commonProps = { + value: itemContext.value, + triggerRef: itemContext.triggerRef, + focusProxyRef: itemContext.focusProxyRef, + wasEscapeCloseRef: itemContext.wasEscapeCloseRef, + onContentFocusOutside: itemContext.onContentFocusOutside, + onRootContentClose: itemContext.onRootContentClose, + ...contentProps + }; + return !context.viewport ? /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx( + NavigationMenuContentImpl, + { + "data-state": getOpenState(open), + ...commonProps, + ref: composedRefs, + onPointerEnter: composeEventHandlers(props.onPointerEnter, context.onContentEnter), + onPointerLeave: composeEventHandlers( + props.onPointerLeave, + whenMouse(context.onContentLeave) + ), + style: { + // Prevent interaction when animating out + pointerEvents: !open && context.isRootMenu ? "none" : void 0, + ...commonProps.style + } + } + ) }) : /* @__PURE__ */ jsx(ViewportContentMounter, { forceMount, ...commonProps, ref: composedRefs }); +}); +NavigationMenuContent.displayName = CONTENT_NAME; +var ViewportContentMounter = React.forwardRef((props, forwardedRef) => { + const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu); + const { onViewportContentChange, onViewportContentRemove } = context; + useLayoutEffect(() => { + onViewportContentChange(props.value, { + ref: forwardedRef, + ...props + }); + }, [props, forwardedRef, onViewportContentChange]); + useLayoutEffect(() => { + return () => onViewportContentRemove(props.value); + }, [props.value, onViewportContentRemove]); + return null; +}); +var ROOT_CONTENT_DISMISS = "navigationMenu.rootContentDismiss"; +var NavigationMenuContentImpl = React.forwardRef((props, forwardedRef) => { + const { + __scopeNavigationMenu, + value, + triggerRef, + focusProxyRef, + wasEscapeCloseRef, + onRootContentClose, + onContentFocusOutside, + ...contentProps + } = props; + const context = useNavigationMenuContext(CONTENT_NAME, __scopeNavigationMenu); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(ref, forwardedRef); + const triggerId = makeTriggerId(context.baseId, value); + const contentId = makeContentId(context.baseId, value); + const getItems = useCollection(__scopeNavigationMenu); + const prevMotionAttributeRef = React.useRef(null); + const { onItemDismiss } = context; + React.useEffect(() => { + const content = ref.current; + if (context.isRootMenu && content) { + const handleClose = () => { + onItemDismiss(); + onRootContentClose(); + if (content.contains(document.activeElement)) triggerRef.current?.focus(); + }; + content.addEventListener(ROOT_CONTENT_DISMISS, handleClose); + return () => content.removeEventListener(ROOT_CONTENT_DISMISS, handleClose); + } + }, [context.isRootMenu, props.value, triggerRef, onItemDismiss, onRootContentClose]); + const motionAttribute = React.useMemo(() => { + const items = getItems(); + const values = items.map((item) => item.value); + if (context.dir === "rtl") values.reverse(); + const index = values.indexOf(context.value); + const prevIndex = values.indexOf(context.previousValue); + const isSelected = value === context.value; + const wasSelected = prevIndex === values.indexOf(value); + if (!isSelected && !wasSelected) return prevMotionAttributeRef.current; + const attribute = (() => { + if (index !== prevIndex) { + if (isSelected && prevIndex !== -1) return index > prevIndex ? "from-end" : "from-start"; + if (wasSelected && index !== -1) return index > prevIndex ? "to-start" : "to-end"; + } + return null; + })(); + prevMotionAttributeRef.current = attribute; + return attribute; + }, [context.previousValue, context.value, context.dir, getItems, value]); + return /* @__PURE__ */ jsx(FocusGroup, { asChild: true, children: /* @__PURE__ */ jsx( + DismissableLayer, + { + id: contentId, + "aria-labelledby": triggerId, + "data-motion": motionAttribute, + "data-orientation": context.orientation, + ...contentProps, + ref: composedRefs, + disableOutsidePointerEvents: false, + onDismiss: () => { + const rootContentDismissEvent = new Event(ROOT_CONTENT_DISMISS, { + bubbles: true, + cancelable: true + }); + ref.current?.dispatchEvent(rootContentDismissEvent); + }, + onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => { + onContentFocusOutside(); + const target = event.target; + if (context.rootNavigationMenu?.contains(target)) event.preventDefault(); + }), + onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => { + const target = event.target; + const isTrigger = getItems().some((item) => item.ref.current?.contains(target)); + const isRootViewport = context.isRootMenu && context.viewport?.contains(target); + if (isTrigger || isRootViewport || !context.isRootMenu) event.preventDefault(); + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; + const isTabKey = event.key === "Tab" && !isMetaKey; + if (isTabKey) { + const candidates = getTabbableCandidates(event.currentTarget); + const focusedElement = document.activeElement; + const index = candidates.findIndex((candidate) => candidate === focusedElement); + const isMovingBackwards = event.shiftKey; + const nextCandidates = isMovingBackwards ? candidates.slice(0, index).reverse() : candidates.slice(index + 1, candidates.length); + if (focusFirst(nextCandidates)) { + event.preventDefault(); + } else { + focusProxyRef.current?.focus(); + } + } + }), + onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (_event) => { + wasEscapeCloseRef.current = true; + }) + } + ) }); +}); +var VIEWPORT_NAME = "NavigationMenuViewport"; +var NavigationMenuViewport = React.forwardRef((props, forwardedRef) => { + const { forceMount, ...viewportProps } = props; + const context = useNavigationMenuContext(VIEWPORT_NAME, props.__scopeNavigationMenu); + const open = Boolean(context.value); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(NavigationMenuViewportImpl, { ...viewportProps, ref: forwardedRef }) }); +}); +NavigationMenuViewport.displayName = VIEWPORT_NAME; +var NavigationMenuViewportImpl = React.forwardRef((props, forwardedRef) => { + const { __scopeNavigationMenu, children, ...viewportImplProps } = props; + const context = useNavigationMenuContext(VIEWPORT_NAME, __scopeNavigationMenu); + const composedRefs = useComposedRefs(forwardedRef, context.onViewportChange); + const viewportContentContext = useViewportContentContext( + CONTENT_NAME, + props.__scopeNavigationMenu + ); + const [size, setSize] = React.useState(null); + const [content, setContent] = React.useState(null); + const viewportWidth = size ? size?.width + "px" : void 0; + const viewportHeight = size ? size?.height + "px" : void 0; + const open = Boolean(context.value); + const activeContentValue = open ? context.value : context.previousValue; + const handleSizeChange = () => { + if (content) setSize({ width: content.offsetWidth, height: content.offsetHeight }); + }; + useResizeObserver(content, handleSizeChange); + return /* @__PURE__ */ jsx( + Primitive.div, + { + "data-state": getOpenState(open), + "data-orientation": context.orientation, + ...viewportImplProps, + ref: composedRefs, + style: { + // Prevent interaction when animating out + pointerEvents: !open && context.isRootMenu ? "none" : void 0, + "--radix-navigation-menu-viewport-width": viewportWidth, + "--radix-navigation-menu-viewport-height": viewportHeight, + ...viewportImplProps.style + }, + onPointerEnter: composeEventHandlers(props.onPointerEnter, context.onContentEnter), + onPointerLeave: composeEventHandlers(props.onPointerLeave, whenMouse(context.onContentLeave)), + children: Array.from(viewportContentContext.items).map(([value, { ref, forceMount, ...props2 }]) => { + const isActive = activeContentValue === value; + return /* @__PURE__ */ jsx(Presence, { present: forceMount || isActive, children: /* @__PURE__ */ jsx( + NavigationMenuContentImpl, + { + ...props2, + ref: composeRefs(ref, (node) => { + if (isActive && node) setContent(node); + }) + } + ) }, value); + }) + } + ); +}); +var FOCUS_GROUP_NAME = "FocusGroup"; +var FocusGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, ...groupProps } = props; + const context = useNavigationMenuContext(FOCUS_GROUP_NAME, __scopeNavigationMenu); + return /* @__PURE__ */ jsx(FocusGroupCollection.Provider, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(FocusGroupCollection.Slot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(Primitive.div, { dir: context.dir, ...groupProps, ref: forwardedRef }) }) }); + } +); +var ARROW_KEYS = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"]; +var FOCUS_GROUP_ITEM_NAME = "FocusGroupItem"; +var FocusGroupItem = React.forwardRef( + (props, forwardedRef) => { + const { __scopeNavigationMenu, ...groupProps } = props; + const getItems = useFocusGroupCollection(__scopeNavigationMenu); + const context = useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu); + return /* @__PURE__ */ jsx(FocusGroupCollection.ItemSlot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx( + Primitive.button, + { + ...groupProps, + ref: forwardedRef, + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + const isFocusNavigationKey = ["Home", "End", ...ARROW_KEYS].includes(event.key); + if (isFocusNavigationKey) { + let candidateNodes = getItems().map((item) => item.ref.current); + const prevItemKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft"; + const prevKeys = [prevItemKey, "ArrowUp", "End"]; + if (prevKeys.includes(event.key)) candidateNodes.reverse(); + if (ARROW_KEYS.includes(event.key)) { + const currentIndex = candidateNodes.indexOf(event.currentTarget); + candidateNodes = candidateNodes.slice(currentIndex + 1); + } + setTimeout(() => focusFirst(candidateNodes)); + event.preventDefault(); + } + }) + } + ) }); + } +); +function getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +function focusFirst(candidates) { + const previouslyFocusedElement = document.activeElement; + return candidates.some((candidate) => { + if (candidate === previouslyFocusedElement) return true; + candidate.focus(); + return document.activeElement !== previouslyFocusedElement; + }); +} +function removeFromTabOrder(candidates) { + candidates.forEach((candidate) => { + candidate.dataset.tabindex = candidate.getAttribute("tabindex") || ""; + candidate.setAttribute("tabindex", "-1"); + }); + return () => { + candidates.forEach((candidate) => { + const prevTabIndex = candidate.dataset.tabindex; + candidate.setAttribute("tabindex", prevTabIndex); + }); + }; +} +function useResizeObserver(element, onResize) { + const handleResize = useCallbackRef(onResize); + useLayoutEffect(() => { + let rAF = 0; + if (element) { + const resizeObserver = new ResizeObserver(() => { + cancelAnimationFrame(rAF); + rAF = window.requestAnimationFrame(handleResize); + }); + resizeObserver.observe(element); + return () => { + window.cancelAnimationFrame(rAF); + resizeObserver.unobserve(element); + }; + } + }, [element, handleResize]); +} +function getOpenState(open) { + return open ? "open" : "closed"; +} +function makeTriggerId(baseId, value) { + return `${baseId}-trigger-${value}`; +} +function makeContentId(baseId, value) { + return `${baseId}-content-${value}`; +} +function whenMouse(handler) { + return (event) => event.pointerType === "mouse" ? handler(event) : void 0; +} +var Root2 = NavigationMenu; +var Sub = NavigationMenuSub; +var List = NavigationMenuList; +var Item = NavigationMenuItem; +var Trigger = NavigationMenuTrigger; +var Link = NavigationMenuLink; +var Indicator = NavigationMenuIndicator; +var Content = NavigationMenuContent; +var Viewport = NavigationMenuViewport; +export { + Content, + Indicator, + Item, + Link, + List, + NavigationMenu, + NavigationMenuContent, + NavigationMenuIndicator, + NavigationMenuItem, + NavigationMenuLink, + NavigationMenuList, + NavigationMenuSub, + NavigationMenuTrigger, + NavigationMenuViewport, + Root2 as Root, + Sub, + Trigger, + Viewport, + createNavigationMenuScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..f3d0f55f52b7ee5f207ea5dbb797a0bee16fe56c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/navigation-menu.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { composeRefs, useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Presence } from '@radix-ui/react-presence';\nimport { useId } from '@radix-ui/react-id';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Orientation = 'vertical' | 'horizontal';\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAVIGATION_MENU_NAME = 'NavigationMenu';\n\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n NavigationMenuTriggerElement,\n { value: string }\n>(NAVIGATION_MENU_NAME);\n\nconst [FocusGroupCollection, useFocusGroupCollection, createFocusGroupCollectionScope] =\n createCollection(NAVIGATION_MENU_NAME);\n\ntype ScopedProps

= P & { __scopeNavigationMenu?: Scope };\nconst [createNavigationMenuContext, createNavigationMenuScope] = createContextScope(\n NAVIGATION_MENU_NAME,\n [createCollectionScope, createFocusGroupCollectionScope],\n);\n\ntype ContentData = {\n ref?: React.Ref;\n} & ViewportContentMounterProps;\n\ntype NavigationMenuContextValue = {\n isRootMenu: boolean;\n value: string;\n previousValue: string;\n baseId: string;\n dir: Direction;\n orientation: Orientation;\n rootNavigationMenu: NavigationMenuElement | null;\n indicatorTrack: HTMLDivElement | null;\n onIndicatorTrackChange(indicatorTrack: HTMLDivElement | null): void;\n viewport: NavigationMenuViewportElement | null;\n onViewportChange(viewport: NavigationMenuViewportElement | null): void;\n onViewportContentChange(contentValue: string, contentData: ContentData): void;\n onViewportContentRemove(contentValue: string): void;\n onTriggerEnter(itemValue: string): void;\n onTriggerLeave(): void;\n onContentEnter(): void;\n onContentLeave(): void;\n onItemSelect(itemValue: string): void;\n onItemDismiss(): void;\n};\n\nconst [NavigationMenuProviderImpl, useNavigationMenuContext] =\n createNavigationMenuContext(NAVIGATION_MENU_NAME);\n\nconst [ViewportContentProvider, useViewportContentContext] = createNavigationMenuContext<{\n items: Map;\n}>(NAVIGATION_MENU_NAME);\n\ntype NavigationMenuElement = React.ComponentRef;\ntype PrimitiveNavProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuProps\n extends\n Omit,\n PrimitiveNavProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n dir?: Direction;\n orientation?: Orientation;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened.\n * @defaultValue 200\n */\n delayDuration?: number;\n /**\n * How much time a user has to enter another trigger without incurring a delay again.\n * @defaultValue 300\n */\n skipDelayDuration?: number;\n}\n\nconst NavigationMenu = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value: valueProp,\n onValueChange,\n defaultValue,\n delayDuration = 200,\n skipDelayDuration = 300,\n orientation = 'horizontal',\n dir,\n ...NavigationMenuProps\n } = props;\n const [navigationMenu, setNavigationMenu] = React.useState(null);\n const composedRef = useComposedRefs(forwardedRef, (node) => setNavigationMenu(node));\n const direction = useDirection(dir);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const skipDelayTimerRef = React.useRef(0);\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: (value) => {\n const isOpen = value !== '';\n const hasSkipDelayDuration = skipDelayDuration > 0;\n\n if (isOpen) {\n window.clearTimeout(skipDelayTimerRef.current);\n if (hasSkipDelayDuration) setIsOpenDelayed(false);\n } else {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration,\n );\n }\n\n onValueChange?.(value);\n },\n defaultProp: defaultValue ?? '',\n caller: NAVIGATION_MENU_NAME,\n });\n\n const startCloseTimer = React.useCallback(() => {\n window.clearTimeout(closeTimerRef.current);\n closeTimerRef.current = window.setTimeout(() => setValue(''), 150);\n }, [setValue]);\n\n const handleOpen = React.useCallback(\n (itemValue: string) => {\n window.clearTimeout(closeTimerRef.current);\n setValue(itemValue);\n },\n [setValue],\n );\n\n const handleDelayedOpen = React.useCallback(\n (itemValue: string) => {\n const isOpenItem = value === itemValue;\n if (isOpenItem) {\n // If the item is already open (e.g. we're transitioning from the content to the trigger)\n // then we want to clear the close timer immediately.\n window.clearTimeout(closeTimerRef.current);\n } else {\n openTimerRef.current = window.setTimeout(() => {\n window.clearTimeout(closeTimerRef.current);\n setValue(itemValue);\n }, delayDuration);\n }\n },\n [value, setValue, delayDuration],\n );\n\n React.useEffect(() => {\n return () => {\n window.clearTimeout(openTimerRef.current);\n window.clearTimeout(closeTimerRef.current);\n window.clearTimeout(skipDelayTimerRef.current);\n };\n }, []);\n\n return (\n {\n window.clearTimeout(openTimerRef.current);\n if (isOpenDelayed) handleDelayedOpen(itemValue);\n else handleOpen(itemValue);\n }}\n onTriggerLeave={() => {\n window.clearTimeout(openTimerRef.current);\n startCloseTimer();\n }}\n onContentEnter={() => window.clearTimeout(closeTimerRef.current)}\n onContentLeave={startCloseTimer}\n onItemSelect={(itemValue) => {\n setValue((prevValue) => (prevValue === itemValue ? '' : itemValue));\n }}\n onItemDismiss={() => setValue('')}\n >\n \n \n );\n },\n);\n\nNavigationMenu.displayName = NAVIGATION_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'NavigationMenuSub';\n\ntype NavigationMenuSubElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuSubProps\n extends\n Omit,\n PrimitiveDivProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n orientation?: Orientation;\n}\n\nconst NavigationMenuSub = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = 'horizontal',\n ...subProps\n } = props;\n const context = useNavigationMenuContext(SUB_NAME, __scopeNavigationMenu);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue ?? '',\n caller: SUB_NAME,\n });\n\n return (\n setValue(itemValue)}\n onItemSelect={(itemValue) => setValue(itemValue)}\n onItemDismiss={() => setValue('')}\n >\n \n \n );\n },\n);\n\nNavigationMenuSub.displayName = SUB_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ninterface NavigationMenuProviderPrivateProps {\n isRootMenu: boolean;\n scope: Scope;\n children: React.ReactNode;\n orientation: Orientation;\n dir: Direction;\n rootNavigationMenu: NavigationMenuElement | null;\n value: string;\n onTriggerEnter(itemValue: string): void;\n onTriggerLeave?(): void;\n onContentEnter?(): void;\n onContentLeave?(): void;\n onItemSelect(itemValue: string): void;\n onItemDismiss(): void;\n}\n\ninterface NavigationMenuProviderProps extends NavigationMenuProviderPrivateProps {}\n\nconst NavigationMenuProvider: React.FC = (\n props: ScopedProps,\n) => {\n const {\n scope,\n isRootMenu,\n rootNavigationMenu,\n dir,\n orientation,\n children,\n value,\n onItemSelect,\n onItemDismiss,\n onTriggerEnter,\n onTriggerLeave,\n onContentEnter,\n onContentLeave,\n } = props;\n const [viewport, setViewport] = React.useState(null);\n const [viewportContent, setViewportContent] = React.useState>(new Map());\n const [indicatorTrack, setIndicatorTrack] = React.useState(null);\n\n return (\n {\n setViewportContent((prevContent) => {\n prevContent.set(contentValue, contentData);\n return new Map(prevContent);\n });\n }, [])}\n onViewportContentRemove={React.useCallback((contentValue) => {\n setViewportContent((prevContent) => {\n if (!prevContent.has(contentValue)) return prevContent;\n prevContent.delete(contentValue);\n return new Map(prevContent);\n });\n }, [])}\n >\n \n \n {children}\n \n \n \n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuList\n * -----------------------------------------------------------------------------------------------*/\n\nconst LIST_NAME = 'NavigationMenuList';\n\ntype NavigationMenuListElement = React.ComponentRef;\ntype PrimitiveUnorderedListProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuListProps extends PrimitiveUnorderedListProps {}\n\nconst NavigationMenuList = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...listProps } = props;\n const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu);\n\n const list = (\n \n );\n\n return (\n \n \n {context.isRootMenu ? {list} : list}\n \n \n );\n },\n);\n\nNavigationMenuList.displayName = LIST_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'NavigationMenuItem';\n\ntype FocusProxyElement = React.ComponentRef;\n\ntype NavigationMenuItemContextValue = {\n value: string;\n triggerRef: React.RefObject;\n contentRef: React.RefObject;\n focusProxyRef: React.RefObject;\n wasEscapeCloseRef: React.MutableRefObject;\n onEntryKeyDown(): void;\n onFocusProxyEnter(side: 'start' | 'end'): void;\n onRootContentClose(): void;\n onContentFocusOutside(): void;\n};\n\nconst [NavigationMenuItemContextProvider, useNavigationMenuItemContext] =\n createNavigationMenuContext(ITEM_NAME);\n\ntype NavigationMenuItemElement = React.ComponentRef;\ntype PrimitiveListItemProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuItemProps extends PrimitiveListItemProps {\n value?: string;\n}\n\nconst NavigationMenuItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props;\n const autoValue = useId();\n // We need to provide an initial deterministic value as `useId` will return\n // empty string on the first render and we don't want to match our internal \"closed\" value.\n const value = valueProp || autoValue || 'LEGACY_REACT_AUTO_VALUE';\n const contentRef = React.useRef(null);\n const triggerRef = React.useRef(null);\n const focusProxyRef = React.useRef(null);\n const restoreContentTabOrderRef = React.useRef(() => {});\n const wasEscapeCloseRef = React.useRef(false);\n\n const handleContentEntry = React.useCallback((side = 'start') => {\n if (contentRef.current) {\n restoreContentTabOrderRef.current();\n const candidates = getTabbableCandidates(contentRef.current);\n if (candidates.length) focusFirst(side === 'start' ? candidates : candidates.reverse());\n }\n }, []);\n\n const handleContentExit = React.useCallback(() => {\n if (contentRef.current) {\n const candidates = getTabbableCandidates(contentRef.current);\n if (candidates.length) restoreContentTabOrderRef.current = removeFromTabOrder(candidates);\n }\n }, []);\n\n return (\n \n \n \n );\n },\n);\n\nNavigationMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'NavigationMenuTrigger';\n\ntype NavigationMenuTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst NavigationMenuTrigger = React.forwardRef<\n NavigationMenuTriggerElement,\n NavigationMenuTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, disabled, ...triggerProps } = props;\n const context = useNavigationMenuContext(TRIGGER_NAME, props.__scopeNavigationMenu);\n const itemContext = useNavigationMenuItemContext(TRIGGER_NAME, props.__scopeNavigationMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, itemContext.triggerRef, forwardedRef);\n const triggerId = makeTriggerId(context.baseId, itemContext.value);\n const contentId = makeContentId(context.baseId, itemContext.value);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const wasClickCloseRef = React.useRef(false);\n const open = itemContext.value === context.value;\n\n return (\n <>\n \n \n {\n wasClickCloseRef.current = false;\n itemContext.wasEscapeCloseRef.current = false;\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse(() => {\n if (\n disabled ||\n wasClickCloseRef.current ||\n itemContext.wasEscapeCloseRef.current ||\n hasPointerMoveOpenedRef.current\n )\n return;\n context.onTriggerEnter(itemContext.value);\n hasPointerMoveOpenedRef.current = true;\n }),\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse(() => {\n if (disabled) return;\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n }),\n )}\n onClick={composeEventHandlers(props.onClick, () => {\n context.onItemSelect(itemContext.value);\n wasClickCloseRef.current = open;\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const verticalEntryKey = context.dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const entryKey = { horizontal: 'ArrowDown', vertical: verticalEntryKey }[\n context.orientation\n ];\n if (open && event.key === entryKey) {\n itemContext.onEntryKeyDown();\n // Prevent FocusGroupItem from handling the event\n event.preventDefault();\n }\n })}\n />\n \n \n\n {/* Proxy tab order between trigger and content */}\n {open && (\n <>\n {\n const content = itemContext.contentRef.current;\n const prevFocusedElement = event.relatedTarget as HTMLElement | null;\n const wasTriggerFocused = prevFocusedElement === ref.current;\n const wasFocusFromContent = content?.contains(prevFocusedElement);\n\n if (wasTriggerFocused || !wasFocusFromContent) {\n itemContext.onFocusProxyEnter(wasTriggerFocused ? 'start' : 'end');\n }\n }}\n />\n\n {/* Restructure a11y tree to make content accessible to screen reader when using the viewport */}\n {context.viewport && }\n \n )}\n \n );\n});\n\nNavigationMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuLink\n * -----------------------------------------------------------------------------------------------*/\n\nconst LINK_NAME = 'NavigationMenuLink';\nconst LINK_SELECT = 'navigationMenu.linkSelect';\n\ntype NavigationMenuLinkElement = React.ComponentRef;\ntype PrimitiveLinkProps = React.ComponentPropsWithoutRef;\ninterface NavigationMenuLinkProps extends Omit {\n active?: boolean;\n onSelect?: (event: Event) => void;\n}\n\nconst NavigationMenuLink = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props;\n\n return (\n \n {\n const target = event.target as HTMLElement;\n const linkSelectEvent = new CustomEvent(LINK_SELECT, {\n bubbles: true,\n cancelable: true,\n });\n target.addEventListener(LINK_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(target, linkSelectEvent);\n\n if (!linkSelectEvent.defaultPrevented && !event.metaKey) {\n const rootContentDismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true,\n });\n dispatchDiscreteCustomEvent(target, rootContentDismissEvent);\n }\n },\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nNavigationMenuLink.displayName = LINK_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'NavigationMenuIndicator';\n\ntype NavigationMenuIndicatorElement = NavigationMenuIndicatorImplElement;\ninterface NavigationMenuIndicatorProps extends NavigationMenuIndicatorImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuIndicator = React.forwardRef<\n NavigationMenuIndicatorElement,\n NavigationMenuIndicatorProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...indicatorProps } = props;\n const context = useNavigationMenuContext(INDICATOR_NAME, props.__scopeNavigationMenu);\n const isVisible = Boolean(context.value);\n\n return context.indicatorTrack\n ? ReactDOM.createPortal(\n \n \n ,\n context.indicatorTrack,\n )\n : null;\n});\n\nNavigationMenuIndicator.displayName = INDICATOR_NAME;\n\ntype NavigationMenuIndicatorImplElement = React.ComponentRef;\ninterface NavigationMenuIndicatorImplProps extends PrimitiveDivProps {}\n\nconst NavigationMenuIndicatorImpl = React.forwardRef<\n NavigationMenuIndicatorImplElement,\n NavigationMenuIndicatorImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...indicatorProps } = props;\n const context = useNavigationMenuContext(INDICATOR_NAME, __scopeNavigationMenu);\n const getItems = useCollection(__scopeNavigationMenu);\n const [activeTrigger, setActiveTrigger] = React.useState(\n null,\n );\n const [position, setPosition] = React.useState<{ size: number; offset: number } | null>(null);\n const isHorizontal = context.orientation === 'horizontal';\n const isVisible = Boolean(context.value);\n\n React.useEffect(() => {\n const items = getItems();\n const triggerNode = items.find((item) => item.value === context.value)?.ref.current;\n if (triggerNode) setActiveTrigger(triggerNode);\n }, [getItems, context.value]);\n\n /**\n * Update position when the indicator or parent track size changes\n */\n const handlePositionChange = () => {\n if (activeTrigger) {\n setPosition({\n size: isHorizontal ? activeTrigger.offsetWidth : activeTrigger.offsetHeight,\n offset: isHorizontal ? activeTrigger.offsetLeft : activeTrigger.offsetTop,\n });\n }\n };\n useResizeObserver(activeTrigger, handlePositionChange);\n useResizeObserver(context.indicatorTrack, handlePositionChange);\n\n // We need to wait for the indicator position to be available before rendering to\n // snap immediately into position rather than transitioning from initial\n return position ? (\n \n ) : null;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'NavigationMenuContent';\n\ntype NavigationMenuContentElement = NavigationMenuContentImplElement;\ninterface NavigationMenuContentProps extends Omit<\n NavigationMenuContentImplProps,\n keyof NavigationMenuContentImplPrivateProps\n> {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuContent = React.forwardRef<\n NavigationMenuContentElement,\n NavigationMenuContentProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu);\n const itemContext = useNavigationMenuItemContext(CONTENT_NAME, props.__scopeNavigationMenu);\n const composedRefs = useComposedRefs(itemContext.contentRef, forwardedRef);\n const open = itemContext.value === context.value;\n\n const commonProps = {\n value: itemContext.value,\n triggerRef: itemContext.triggerRef,\n focusProxyRef: itemContext.focusProxyRef,\n wasEscapeCloseRef: itemContext.wasEscapeCloseRef,\n onContentFocusOutside: itemContext.onContentFocusOutside,\n onRootContentClose: itemContext.onRootContentClose,\n ...contentProps,\n };\n\n return !context.viewport ? (\n \n \n \n ) : (\n \n );\n});\n\nNavigationMenuContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ViewportContentMounterElement = NavigationMenuContentImplElement;\ninterface ViewportContentMounterProps extends NavigationMenuContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst ViewportContentMounter = React.forwardRef<\n ViewportContentMounterElement,\n ViewportContentMounterProps\n>((props: ScopedProps, forwardedRef) => {\n const context = useNavigationMenuContext(CONTENT_NAME, props.__scopeNavigationMenu);\n const { onViewportContentChange, onViewportContentRemove } = context;\n\n useLayoutEffect(() => {\n onViewportContentChange(props.value, {\n ref: forwardedRef,\n ...props,\n });\n }, [props, forwardedRef, onViewportContentChange]);\n\n useLayoutEffect(() => {\n return () => onViewportContentRemove(props.value);\n }, [props.value, onViewportContentRemove]);\n\n // Content is proxied into the viewport\n return null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_CONTENT_DISMISS = 'navigationMenu.rootContentDismiss';\n\ntype MotionAttribute = 'to-start' | 'to-end' | 'from-start' | 'from-end';\ntype NavigationMenuContentImplElement = React.ComponentRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\n\ninterface NavigationMenuContentImplPrivateProps {\n value: string;\n triggerRef: React.RefObject;\n focusProxyRef: React.RefObject;\n wasEscapeCloseRef: React.MutableRefObject;\n onContentFocusOutside(): void;\n onRootContentClose(): void;\n}\ninterface NavigationMenuContentImplProps\n extends\n Omit,\n NavigationMenuContentImplPrivateProps {}\n\nconst NavigationMenuContentImpl = React.forwardRef<\n NavigationMenuContentImplElement,\n NavigationMenuContentImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeNavigationMenu,\n value,\n triggerRef,\n focusProxyRef,\n wasEscapeCloseRef,\n onRootContentClose,\n onContentFocusOutside,\n ...contentProps\n } = props;\n const context = useNavigationMenuContext(CONTENT_NAME, __scopeNavigationMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const getItems = useCollection(__scopeNavigationMenu);\n const prevMotionAttributeRef = React.useRef(null);\n\n const { onItemDismiss } = context;\n\n React.useEffect(() => {\n const content = ref.current;\n\n // Bubble dismiss to the root content node and focus its trigger\n if (context.isRootMenu && content) {\n const handleClose = () => {\n onItemDismiss();\n onRootContentClose();\n if (content.contains(document.activeElement)) triggerRef.current?.focus();\n };\n content.addEventListener(ROOT_CONTENT_DISMISS, handleClose);\n return () => content.removeEventListener(ROOT_CONTENT_DISMISS, handleClose);\n }\n }, [context.isRootMenu, props.value, triggerRef, onItemDismiss, onRootContentClose]);\n\n const motionAttribute = React.useMemo(() => {\n const items = getItems();\n const values = items.map((item) => item.value);\n if (context.dir === 'rtl') values.reverse();\n const index = values.indexOf(context.value);\n const prevIndex = values.indexOf(context.previousValue);\n const isSelected = value === context.value;\n const wasSelected = prevIndex === values.indexOf(value);\n\n // We only want to update selected and the last selected content\n // this avoids animations being interrupted outside of that range\n if (!isSelected && !wasSelected) return prevMotionAttributeRef.current;\n\n const attribute = (() => {\n // Don't provide a direction on the initial open\n if (index !== prevIndex) {\n // If we're moving to this item from another\n if (isSelected && prevIndex !== -1) return index > prevIndex ? 'from-end' : 'from-start';\n // If we're leaving this item for another\n if (wasSelected && index !== -1) return index > prevIndex ? 'to-start' : 'to-end';\n }\n // Otherwise we're entering from closed or leaving the list\n // entirely and should not animate in any direction\n return null;\n })();\n\n prevMotionAttributeRef.current = attribute;\n return attribute;\n }, [context.previousValue, context.value, context.dir, getItems, value]);\n\n return (\n \n {\n const rootContentDismissEvent = new Event(ROOT_CONTENT_DISMISS, {\n bubbles: true,\n cancelable: true,\n });\n ref.current?.dispatchEvent(rootContentDismissEvent);\n }}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n onContentFocusOutside();\n const target = event.target as HTMLElement;\n // Only dismiss content when focus moves outside of the menu\n if (context.rootNavigationMenu?.contains(target)) event.preventDefault();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const target = event.target as HTMLElement;\n const isTrigger = getItems().some((item) => item.ref.current?.contains(target));\n const isRootViewport = context.isRootMenu && context.viewport?.contains(target);\n if (isTrigger || isRootViewport || !context.isRootMenu) event.preventDefault();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === 'Tab' && !isMetaKey;\n if (isTabKey) {\n const candidates = getTabbableCandidates(event.currentTarget);\n const focusedElement = document.activeElement;\n const index = candidates.findIndex((candidate) => candidate === focusedElement);\n const isMovingBackwards = event.shiftKey;\n const nextCandidates = isMovingBackwards\n ? candidates.slice(0, index).reverse()\n : candidates.slice(index + 1, candidates.length);\n\n if (focusFirst(nextCandidates)) {\n // prevent browser tab keydown because we've handled focus\n event.preventDefault();\n } else {\n // If we can't focus that means we're at the edges\n // so focus the proxy and let browser handle\n // tab/shift+tab keypress on the proxy instead\n focusProxyRef.current?.focus();\n }\n }\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (_event) => {\n // prevent the dropdown from reopening\n // after the escape key has been pressed\n wasEscapeCloseRef.current = true;\n })}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * NavigationMenuViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = 'NavigationMenuViewport';\n\ntype NavigationMenuViewportElement = NavigationMenuViewportImplElement;\ninterface NavigationMenuViewportProps extends Omit<\n NavigationMenuViewportImplProps,\n 'activeContentValue'\n> {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst NavigationMenuViewport = React.forwardRef<\n NavigationMenuViewportElement,\n NavigationMenuViewportProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...viewportProps } = props;\n const context = useNavigationMenuContext(VIEWPORT_NAME, props.__scopeNavigationMenu);\n const open = Boolean(context.value);\n\n return (\n \n \n \n );\n});\n\nNavigationMenuViewport.displayName = VIEWPORT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype NavigationMenuViewportImplElement = React.ComponentRef;\ninterface NavigationMenuViewportImplProps extends PrimitiveDivProps {}\n\nconst NavigationMenuViewportImpl = React.forwardRef<\n NavigationMenuViewportImplElement,\n NavigationMenuViewportImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, children, ...viewportImplProps } = props;\n const context = useNavigationMenuContext(VIEWPORT_NAME, __scopeNavigationMenu);\n const composedRefs = useComposedRefs(forwardedRef, context.onViewportChange);\n const viewportContentContext = useViewportContentContext(\n CONTENT_NAME,\n props.__scopeNavigationMenu,\n );\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n const [content, setContent] = React.useState(null);\n const viewportWidth = size ? size?.width + 'px' : undefined;\n const viewportHeight = size ? size?.height + 'px' : undefined;\n const open = Boolean(context.value);\n // We persist the last active content value as the viewport may be animating out\n // and we want the content to remain mounted for the lifecycle of the viewport.\n const activeContentValue = open ? context.value : context.previousValue;\n\n /**\n * Update viewport size to match the active content node.\n * We prefer offset dimensions over `getBoundingClientRect` as the latter respects CSS transform.\n * For example, if content animates in from `scale(0.5)` the dimensions would be anything\n * from `0.5` to `1` of the intended size.\n */\n const handleSizeChange = () => {\n if (content) setSize({ width: content.offsetWidth, height: content.offsetHeight });\n };\n useResizeObserver(content, handleSizeChange);\n\n return (\n \n {Array.from(viewportContentContext.items).map(([value, { ref, forceMount, ...props }]) => {\n const isActive = activeContentValue === value;\n return (\n \n {\n // We only want to update the stored node when another is available\n // as we need to smoothly transition between them.\n if (isActive && node) setContent(node);\n })}\n />\n \n );\n })}\n \n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_GROUP_NAME = 'FocusGroup';\n\ntype FocusGroupElement = React.ComponentRef;\ninterface FocusGroupProps extends PrimitiveDivProps {}\n\nconst FocusGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...groupProps } = props;\n const context = useNavigationMenuContext(FOCUS_GROUP_NAME, __scopeNavigationMenu);\n\n return (\n \n \n \n \n \n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_KEYS = ['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'];\nconst FOCUS_GROUP_ITEM_NAME = 'FocusGroupItem';\n\ntype FocusGroupItemElement = React.ComponentRef;\ninterface FocusGroupItemProps extends PrimitiveButtonProps {}\n\nconst FocusGroupItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeNavigationMenu, ...groupProps } = props;\n const getItems = useFocusGroupCollection(__scopeNavigationMenu);\n const context = useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu);\n\n return (\n \n {\n const isFocusNavigationKey = ['Home', 'End', ...ARROW_KEYS].includes(event.key);\n if (isFocusNavigationKey) {\n let candidateNodes = getItems().map((item) => item.ref.current!);\n const prevItemKey = context.dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n const prevKeys = [prevItemKey, 'ArrowUp', 'End'];\n if (prevKeys.includes(event.key)) candidateNodes.reverse();\n if (ARROW_KEYS.includes(event.key)) {\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n // Prevent page scroll while navigating\n event.preventDefault();\n }\n })}\n />\n \n );\n },\n);\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\n\nfunction removeFromTabOrder(candidates: HTMLElement[]) {\n candidates.forEach((candidate) => {\n candidate.dataset.tabindex = candidate.getAttribute('tabindex') || '';\n candidate.setAttribute('tabindex', '-1');\n });\n return () => {\n candidates.forEach((candidate) => {\n const prevTabIndex = candidate.dataset.tabindex as string;\n candidate.setAttribute('tabindex', prevTabIndex);\n });\n };\n}\n\nfunction useResizeObserver(element: HTMLElement | null, onResize: () => void) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\n\nfunction getOpenState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nfunction makeTriggerId(baseId: string, value: string) {\n return `${baseId}-trigger-${value}`;\n}\n\nfunction makeContentId(baseId: string, value: string) {\n return `${baseId}-content-${value}`;\n}\n\nfunction whenMouse(handler: React.PointerEventHandler): React.PointerEventHandler {\n return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = NavigationMenu;\nconst Sub = NavigationMenuSub;\nconst List = NavigationMenuList;\nconst Item = NavigationMenuItem;\nconst Trigger = NavigationMenuTrigger;\nconst Link = NavigationMenuLink;\nconst Indicator = NavigationMenuIndicator;\nconst Content = NavigationMenuContent;\nconst Viewport = NavigationMenuViewport;\n\nexport {\n createNavigationMenuScope,\n //\n NavigationMenu,\n NavigationMenuSub,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuContent,\n NavigationMenuViewport,\n //\n Root,\n Sub,\n List,\n Item,\n Trigger,\n Link,\n Indicator,\n Content,\n Viewport,\n};\nexport type {\n NavigationMenuProps,\n NavigationMenuSubProps,\n NavigationMenuListProps,\n NavigationMenuItemProps,\n NavigationMenuTriggerProps,\n NavigationMenuLinkProps,\n NavigationMenuIndicatorProps,\n NavigationMenuContentProps,\n NavigationMenuViewportProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,YAAY,cAAc;AAC1B,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,SAAS,WAAW,mCAAmC;AACvD,SAAS,4BAA4B;AACrC,SAAS,aAAa,uBAAuB;AAC7C,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS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Y;AAClB,IAAM,UAAU;AAChB,IAAM,WAAW;", + "names": ["value", "event", "props", "Root"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9483ec482548558bec931e0be04439292bacd171 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-navigation-menu/package.json @@ -0,0 +1,81 @@ +{ + "name": "@radix-ui/react-navigation-menu", + "version": "1.2.16", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-collection": "1.1.10", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-dismissable-layer": "1.1.13", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-previous": "1.1.2", + "@radix-ui/react-visually-hidden": "1.2.6", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/typescript-config": "0.0.0", + "@repo/builder": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/navigation-menu" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/README.md new file mode 100644 index 0000000000000000000000000000000000000000..33707abe5ad74587b20e887fdc2b733f64aadafb --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/README.md @@ -0,0 +1,13 @@ +# `react-one-time-password-field` + +## Installation + +```sh +$ yarn add radix-ui +# or +$ npm install radix-ui +``` + +## Usage + +View docs [here](https://radix-ui.com/primitives/docs/components/one-time-password-field). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..79b95a213ab22478f1fb08d930f1960bd225282b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.d.mts @@ -0,0 +1,136 @@ +import * as Primitive from '@radix-ui/react-primitive'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; +import * as React from 'react'; + +type InputValidationType = 'alpha' | 'numeric' | 'alphanumeric' | 'none'; +type RovingFocusGroupProps = RovingFocusGroup.RovingFocusGroupProps; +interface OneTimePasswordFieldOwnProps { + /** + * Specifies what—if any—permission the user agent has to provide automated + * assistance in filling out form field values, as well as guidance to the + * browser as to the type of information expected in the field. Allows + * `"one-time-code"` or `"off"`. + * + * @defaultValue `"one-time-code"` + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete + */ + autoComplete?: AutoComplete; + /** + * Whether or not the first fillable input should be focused on page-load. + * + * @defaultValue `false` + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autofocus + */ + autoFocus?: boolean; + /** + * Whether or not the component should attempt to automatically submit when + * all fields are filled. If the field is associated with an HTML `form` + * element, the form's `requestSubmit` method will be called. + * + * @defaultValue `false` + */ + autoSubmit?: boolean; + /** + * The initial value of the uncontrolled field. + */ + defaultValue?: string; + /** + * Indicates the horizontal directionality of the parent element's text. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir + */ + dir?: RovingFocusGroupProps['dir']; + /** + * Whether or not the the field's input elements are disabled. + */ + disabled?: boolean; + /** + * A string specifying the `form` element with which the input is associated. + * This string's value, if present, must match the id of a `form` element in + * the same document. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form + */ + form?: string | undefined; + /** + * A string specifying a name for the input control. This name is submitted + * along with the control's value when the form data is submitted. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name + */ + name?: string | undefined; + /** + * When the `autoSubmit` prop is set to `true`, this callback will be fired + * before attempting to submit the associated form. It will be called whether + * or not a form is located, or if submission is not allowed. + */ + onAutoSubmit?: (value: string) => void; + /** + * A callback fired when the field's value changes. When the component is + * controlled, this should update the state passed to the `value` prop. + */ + onValueChange?: (value: string) => void; + /** + * Indicates the vertical directionality of the input elements. + * + * @defaultValue `"horizontal"` + */ + orientation?: RovingFocusGroupProps['orientation']; + /** + * Defines the text displayed in a form control when the control has no value. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder + */ + placeholder?: string | undefined; + /** + * Whether or not the input elements can be updated by the user. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/readonly + */ + readOnly?: boolean; + /** + * Function for custom sanitization when `validationType` is set to `"none"`. + * This function will be called before updating values in response to user + * interactions. + */ + sanitizeValue?: (value: string) => string; + /** + * The input type of the field's input elements. Can be `"password"` or `"text"`. + */ + type?: InputType; + /** + * Specifies the type of input validation to be used. Can be `"alpha"`, + * `"numeric"`, `"alphanumeric"` or `"none"`. + * + * @defaultValue `"numeric"` + */ + validationType?: InputValidationType; + /** + * The controlled value of the field. + */ + value?: string; +} +interface OneTimePasswordFieldProps extends OneTimePasswordFieldOwnProps, Omit, keyof OneTimePasswordFieldOwnProps> { +} +declare const OneTimePasswordField: React.ForwardRefExoticComponent & React.RefAttributes>; +interface OneTimePasswordFieldHiddenInputProps extends Omit, keyof 'value' | 'defaultValue' | 'type' | 'onChange' | 'readOnly' | 'disabled' | 'autoComplete' | 'autoFocus'> { +} +declare const OneTimePasswordFieldHiddenInput: React.ForwardRefExoticComponent & React.RefAttributes>; +interface OneTimePasswordFieldInputProps extends Omit, 'value' | 'defaultValue' | 'disabled' | 'readOnly' | 'autoComplete' | 'autoFocus' | 'form' | 'name' | 'placeholder' | 'type'> { + /** + * Callback fired when the user input fails native HTML input validation. + */ + onInvalidChange?: (character: string) => void; + /** + * User-provided index to determine the order of the inputs. This is useful if + * you need certain index-based attributes to be set on the initial render, + * often to prevent flickering after hydration. + */ + index?: number; +} +declare const OneTimePasswordFieldInput: React.ForwardRefExoticComponent & React.RefAttributes>; + +type InputType = 'password' | 'text'; +type AutoComplete = 'off' | 'one-time-code'; + +export { OneTimePasswordFieldHiddenInput as HiddenInput, OneTimePasswordFieldInput as Input, type InputValidationType, OneTimePasswordField, OneTimePasswordFieldHiddenInput, type OneTimePasswordFieldHiddenInputProps, OneTimePasswordFieldInput, type OneTimePasswordFieldInputProps, type OneTimePasswordFieldProps, OneTimePasswordField as Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..79b95a213ab22478f1fb08d930f1960bd225282b --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.d.ts @@ -0,0 +1,136 @@ +import * as Primitive from '@radix-ui/react-primitive'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; +import * as React from 'react'; + +type InputValidationType = 'alpha' | 'numeric' | 'alphanumeric' | 'none'; +type RovingFocusGroupProps = RovingFocusGroup.RovingFocusGroupProps; +interface OneTimePasswordFieldOwnProps { + /** + * Specifies what—if any—permission the user agent has to provide automated + * assistance in filling out form field values, as well as guidance to the + * browser as to the type of information expected in the field. Allows + * `"one-time-code"` or `"off"`. + * + * @defaultValue `"one-time-code"` + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete + */ + autoComplete?: AutoComplete; + /** + * Whether or not the first fillable input should be focused on page-load. + * + * @defaultValue `false` + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autofocus + */ + autoFocus?: boolean; + /** + * Whether or not the component should attempt to automatically submit when + * all fields are filled. If the field is associated with an HTML `form` + * element, the form's `requestSubmit` method will be called. + * + * @defaultValue `false` + */ + autoSubmit?: boolean; + /** + * The initial value of the uncontrolled field. + */ + defaultValue?: string; + /** + * Indicates the horizontal directionality of the parent element's text. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir + */ + dir?: RovingFocusGroupProps['dir']; + /** + * Whether or not the the field's input elements are disabled. + */ + disabled?: boolean; + /** + * A string specifying the `form` element with which the input is associated. + * This string's value, if present, must match the id of a `form` element in + * the same document. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form + */ + form?: string | undefined; + /** + * A string specifying a name for the input control. This name is submitted + * along with the control's value when the form data is submitted. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name + */ + name?: string | undefined; + /** + * When the `autoSubmit` prop is set to `true`, this callback will be fired + * before attempting to submit the associated form. It will be called whether + * or not a form is located, or if submission is not allowed. + */ + onAutoSubmit?: (value: string) => void; + /** + * A callback fired when the field's value changes. When the component is + * controlled, this should update the state passed to the `value` prop. + */ + onValueChange?: (value: string) => void; + /** + * Indicates the vertical directionality of the input elements. + * + * @defaultValue `"horizontal"` + */ + orientation?: RovingFocusGroupProps['orientation']; + /** + * Defines the text displayed in a form control when the control has no value. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder + */ + placeholder?: string | undefined; + /** + * Whether or not the input elements can be updated by the user. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/readonly + */ + readOnly?: boolean; + /** + * Function for custom sanitization when `validationType` is set to `"none"`. + * This function will be called before updating values in response to user + * interactions. + */ + sanitizeValue?: (value: string) => string; + /** + * The input type of the field's input elements. Can be `"password"` or `"text"`. + */ + type?: InputType; + /** + * Specifies the type of input validation to be used. Can be `"alpha"`, + * `"numeric"`, `"alphanumeric"` or `"none"`. + * + * @defaultValue `"numeric"` + */ + validationType?: InputValidationType; + /** + * The controlled value of the field. + */ + value?: string; +} +interface OneTimePasswordFieldProps extends OneTimePasswordFieldOwnProps, Omit, keyof OneTimePasswordFieldOwnProps> { +} +declare const OneTimePasswordField: React.ForwardRefExoticComponent & React.RefAttributes>; +interface OneTimePasswordFieldHiddenInputProps extends Omit, keyof 'value' | 'defaultValue' | 'type' | 'onChange' | 'readOnly' | 'disabled' | 'autoComplete' | 'autoFocus'> { +} +declare const OneTimePasswordFieldHiddenInput: React.ForwardRefExoticComponent & React.RefAttributes>; +interface OneTimePasswordFieldInputProps extends Omit, 'value' | 'defaultValue' | 'disabled' | 'readOnly' | 'autoComplete' | 'autoFocus' | 'form' | 'name' | 'placeholder' | 'type'> { + /** + * Callback fired when the user input fails native HTML input validation. + */ + onInvalidChange?: (character: string) => void; + /** + * User-provided index to determine the order of the inputs. This is useful if + * you need certain index-based attributes to be set on the initial render, + * often to prevent flickering after hydration. + */ + index?: number; +} +declare const OneTimePasswordFieldInput: React.ForwardRefExoticComponent & React.RefAttributes>; + +type InputType = 'password' | 'text'; +type AutoComplete = 'off' | 'one-time-code'; + +export { OneTimePasswordFieldHiddenInput as HiddenInput, OneTimePasswordFieldInput as Input, type InputValidationType, OneTimePasswordField, OneTimePasswordFieldHiddenInput, type OneTimePasswordFieldHiddenInputProps, OneTimePasswordFieldInput, type OneTimePasswordFieldInputProps, type OneTimePasswordFieldProps, OneTimePasswordField as Root }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..96af30c841af6164ffd7bee9df30a7cc2877186c --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.js @@ -0,0 +1,636 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + HiddenInput: () => OneTimePasswordFieldHiddenInput, + Input: () => OneTimePasswordFieldInput, + OneTimePasswordField: () => OneTimePasswordField, + OneTimePasswordFieldHiddenInput: () => OneTimePasswordFieldHiddenInput, + OneTimePasswordFieldInput: () => OneTimePasswordFieldInput, + Root: () => OneTimePasswordField +}); +module.exports = __toCommonJS(index_exports); + +// src/one-time-password-field.tsx +var Primitive = __toESM(require("@radix-ui/react-primitive")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_collection = require("@radix-ui/react-collection"); +var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus")); +var import_react_roving_focus = require("@radix-ui/react-roving-focus"); +var import_react_use_is_hydrated = require("@radix-ui/react-use-is-hydrated"); +var React = __toESM(require("react")); +var import_react_dom = require("react-dom"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_number = require("@radix-ui/number"); +var import_jsx_runtime = require("react/jsx-runtime"); +var INPUT_VALIDATION_MAP = { + numeric: { + type: "numeric", + regexp: /[^\d]/g, + pattern: "\\d{1}", + inputMode: "numeric" + }, + alpha: { + type: "alpha", + regexp: /[^a-zA-Z]/g, + pattern: "[a-zA-Z]{1}", + inputMode: "text" + }, + alphanumeric: { + type: "alphanumeric", + regexp: /[^a-zA-Z0-9]/g, + pattern: "[a-zA-Z0-9]{1}", + inputMode: "text" + }, + none: null +}; +var ONE_TIME_PASSWORD_FIELD_NAME = "OneTimePasswordField"; +var [Collection, { useCollection, createCollectionScope, useInitCollection }] = (0, import_react_collection.unstable_createCollection)(ONE_TIME_PASSWORD_FIELD_NAME); +var [createOneTimePasswordFieldContext] = (0, import_react_context.createContextScope)(ONE_TIME_PASSWORD_FIELD_NAME, [ + createCollectionScope, + import_react_roving_focus.createRovingFocusGroupScope +]); +var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)(); +var [OneTimePasswordFieldContext, useOneTimePasswordFieldContext] = createOneTimePasswordFieldContext(ONE_TIME_PASSWORD_FIELD_NAME); +var OneTimePasswordField = React.forwardRef( + function OneTimePasswordFieldImpl({ + __scopeOneTimePasswordField, + defaultValue, + value: valueProp, + onValueChange, + autoSubmit = false, + children, + onPaste, + onAutoSubmit, + disabled = false, + readOnly = false, + autoComplete = "one-time-code", + autoFocus = false, + form, + name, + placeholder, + type = "text", + // TODO: Change default to vertical when inputs use vertical writing mode + orientation = "horizontal", + dir, + validationType = "numeric", + sanitizeValue: sanitizeValueProp, + ...domProps + }, forwardedRef) { + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField); + const direction = (0, import_react_direction.useDirection)(dir); + const collectionState = useInitCollection(); + const [collection] = collectionState; + const validation = INPUT_VALIDATION_MAP[validationType] ? INPUT_VALIDATION_MAP[validationType] : null; + const sanitizeValue = React.useCallback( + (value2) => { + if (Array.isArray(value2)) { + value2 = value2.map(removeWhitespace).join(""); + } else { + value2 = removeWhitespace(value2); + } + if (validation) { + const regexp = new RegExp(validation.regexp); + value2 = value2.replace(regexp, ""); + } else if (sanitizeValueProp) { + value2 = sanitizeValueProp(value2); + } + return value2.split(""); + }, + [validation, sanitizeValueProp] + ); + const controlledValue = React.useMemo(() => { + return valueProp != null ? sanitizeValue(valueProp) : void 0; + }, [valueProp, sanitizeValue]); + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + caller: "OneTimePasswordField", + prop: controlledValue, + defaultProp: defaultValue != null ? sanitizeValue(defaultValue) : [], + onChange: React.useCallback( + (value2) => onValueChange?.(value2.join("")), + [onValueChange] + ) + }); + const latestValueRef = React.useRef(value); + latestValueRef.current = value; + const dispatch = React.useCallback( + (action) => { + const value2 = latestValueRef.current; + switch (action.type) { + case "SET_CHAR": { + const { index, char } = action; + const currentTarget = collection.at(index)?.element; + if (value2[index] === char) { + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + return; + } + if (char === "") { + return; + } + if (validation) { + const regexp = new RegExp(validation.regexp); + const clean = char.replace(regexp, ""); + if (clean !== char) { + return; + } + } + if (value2.length >= collection.size) { + const newValue2 = [...value2]; + newValue2[index] = char; + (0, import_react_dom.flushSync)(() => setValue(newValue2)); + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + return; + } + const newValue = [...value2]; + newValue[index] = char; + const lastElement = collection.at(-1)?.element; + (0, import_react_dom.flushSync)(() => setValue(newValue)); + if (currentTarget !== lastElement) { + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + } else { + currentTarget?.select(); + } + return; + } + case "CLEAR_CHAR": { + const { index, reason } = action; + if (!value2[index]) { + return; + } + const newValue = value2.filter((_, i) => i !== index); + const currentTarget = collection.at(index)?.element; + const previous = currentTarget && collection.from(currentTarget, -1)?.element; + (0, import_react_dom.flushSync)(() => setValue(newValue)); + if (reason === "Backspace") { + focusInput(previous); + } else if (reason === "Delete" || reason === "Cut") { + focusInput(currentTarget); + } + return; + } + case "CLEAR": { + if (value2.length === 0) { + return; + } + if (action.reason === "Backspace" || action.reason === "Delete") { + (0, import_react_dom.flushSync)(() => setValue([])); + focusInput(collection.at(0)?.element); + } else { + setValue([]); + } + return; + } + case "PASTE": { + const { value: pastedValue } = action; + const sanitizedValue = sanitizeValue(pastedValue); + if (!sanitizedValue) { + return; + } + const value3 = sanitizedValue.slice(0, collection.size); + (0, import_react_dom.flushSync)(() => setValue(value3)); + focusInput(collection.at(value3.length - 1)?.element); + return; + } + } + }, + [collection, sanitizeValue, setValue, validation] + ); + const validationTypeRef = React.useRef(validation); + React.useEffect(() => { + if (!validation) { + return; + } + if (validationTypeRef.current?.type !== validation.type) { + validationTypeRef.current = validation; + setValue(sanitizeValue(value.join(""))); + } + }, [sanitizeValue, setValue, validation, value]); + const hiddenInputRef = React.useRef(null); + const userActionRef = React.useRef(null); + const rootRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, rootRef); + const firstInput = collection.at(0)?.element; + const locateForm = React.useCallback(() => { + let formElement; + if (form) { + const associatedElement = (rootRef.current?.ownerDocument ?? document).getElementById(form); + if (isFormElement(associatedElement)) { + formElement = associatedElement; + } + } else if (hiddenInputRef.current) { + formElement = hiddenInputRef.current.form; + } else if (firstInput) { + formElement = firstInput.form; + } + return formElement ?? null; + }, [form, firstInput]); + const attemptSubmit = React.useCallback(() => { + const formElement = locateForm(); + formElement?.requestSubmit(); + }, [locateForm]); + React.useEffect(() => { + const form2 = locateForm(); + if (form2) { + const reset = () => dispatch({ type: "CLEAR", reason: "Reset" }); + form2.addEventListener("reset", reset); + return () => form2.removeEventListener("reset", reset); + } + }, [dispatch, locateForm]); + const currentValue = value.join(""); + const valueRef = React.useRef(currentValue); + const length = collection.size; + React.useEffect(() => { + const previousValue = valueRef.current; + valueRef.current = currentValue; + if (previousValue === currentValue) { + return; + } + if (autoSubmit && value.every((char) => char !== "") && value.length === length) { + onAutoSubmit?.(value.join("")); + attemptSubmit(); + } + }, [attemptSubmit, autoSubmit, currentValue, length, onAutoSubmit, value]); + const isHydrated = (0, import_react_use_is_hydrated.useIsHydrated)(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + OneTimePasswordFieldContext, + { + scope: __scopeOneTimePasswordField, + value, + attemptSubmit, + disabled, + readOnly, + autoComplete, + autoFocus, + form, + name, + placeholder, + type, + hiddenInputRef, + userActionRef, + dispatch, + validationType, + orientation, + isHydrated, + sanitizeValue, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: __scopeOneTimePasswordField, state: collectionState, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeOneTimePasswordField, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation, + dir: direction, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + Primitive.Root.div, + { + ...domProps, + role: "group", + ref: composedRefs, + onPaste: (0, import_primitive.composeEventHandlers)( + onPaste, + (event) => { + event.preventDefault(); + const pastedValue = event.clipboardData.getData("text/plain"); + dispatch({ type: "PASTE", value: pastedValue }); + } + ), + children + } + ) + } + ) }) }) + } + ); + } +); +var OneTimePasswordFieldHiddenInput = React.forwardRef(function OneTimePasswordFieldHiddenInput2({ __scopeOneTimePasswordField, ...props }, forwardedRef) { + const { value, hiddenInputRef, name } = useOneTimePasswordFieldContext( + "OneTimePasswordFieldHiddenInput", + __scopeOneTimePasswordField + ); + const ref = (0, import_react_compose_refs.useComposedRefs)(hiddenInputRef, forwardedRef); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "input", + { + ref, + name, + value: value.join("").trim(), + autoComplete: "off", + autoFocus: false, + autoCapitalize: "off", + autoCorrect: "off", + autoSave: "off", + spellCheck: false, + ...props, + type: "hidden", + readOnly: true + } + ); +}); +var OneTimePasswordFieldInput = React.forwardRef(function OneTimePasswordFieldInput2({ + __scopeOneTimePasswordField, + onInvalidChange, + index: indexProp, + ...props +}, forwardedRef) { + const { + value: _value, + defaultValue: _defaultValue, + disabled: _disabled, + readOnly: _readOnly, + autoComplete: _autoComplete, + autoFocus: _autoFocus, + form: _form, + name: _name, + placeholder: _placeholder, + type: _type, + ...domProps + } = props; + const context = useOneTimePasswordFieldContext( + "OneTimePasswordFieldInput", + __scopeOneTimePasswordField + ); + const { dispatch, userActionRef, validationType, isHydrated, disabled } = context; + const collection = useCollection(__scopeOneTimePasswordField); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField); + const inputRef = React.useRef(null); + const [element, setElement] = React.useState(null); + const index = indexProp ?? (element ? collection.indexOf(element) : -1); + const canSetPlaceholder = indexProp != null || isHydrated; + let placeholder; + if (canSetPlaceholder && context.placeholder && context.value.length === 0) { + placeholder = context.placeholder[index]; + } + const composedInputRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, inputRef, setElement); + const char = context.value[index] ?? ""; + const keyboardActionTimeoutRef = React.useRef(null); + React.useEffect(() => { + return () => { + if (keyboardActionTimeoutRef.current) { + window.clearTimeout(keyboardActionTimeoutRef.current); + } + }; + }, []); + const totalValue = context.value.join("").trim(); + const lastSelectableIndex = (0, import_number.clamp)(totalValue.length, [0, collection.size - 1]); + const isFocusable = index <= lastSelectableIndex; + const validation = validationType in INPUT_VALIDATION_MAP ? INPUT_VALIDATION_MAP[validationType] : void 0; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, { scope: __scopeOneTimePasswordField, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RovingFocusGroup.Item, + { + ...rovingFocusGroupScope, + asChild: true, + focusable: !context.disabled && isFocusable, + active: index === lastSelectableIndex, + children: ({ hasTabStop, isCurrentTabStop }) => { + const supportsAutoComplete = hasTabStop ? isCurrentTabStop : index === 0; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + Primitive.Root.input, + { + ref: composedInputRef, + type: context.type, + disabled, + "aria-label": `Character ${index + 1} of ${collection.size}`, + autoComplete: supportsAutoComplete ? context.autoComplete : "off", + "data-1p-ignore": supportsAutoComplete ? void 0 : "true", + "data-lpignore": supportsAutoComplete ? void 0 : "true", + "data-protonpass-ignore": supportsAutoComplete ? void 0 : "true", + "data-bwignore": supportsAutoComplete ? void 0 : "true", + inputMode: validation?.inputMode, + maxLength: supportsAutoComplete ? collection.size : 1, + pattern: validation?.pattern, + readOnly: context.readOnly, + value: char, + placeholder, + "data-radix-otp-input": "", + "data-radix-index": index, + ...domProps, + onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, (event) => { + event.currentTarget.select(); + }), + onCut: (0, import_primitive.composeEventHandlers)(props.onCut, (event) => { + const currentValue = event.currentTarget.value; + if (currentValue !== "") { + userActionRef.current = { type: "cut" }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + }), + onInput: (0, import_primitive.composeEventHandlers)(props.onInput, (event) => { + const value = event.currentTarget.value; + if (value.length > 1) { + event.preventDefault(); + userActionRef.current = { type: "autocomplete-paste" }; + dispatch({ type: "PASTE", value }); + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + }), + onChange: (0, import_primitive.composeEventHandlers)(props.onChange, (event) => { + const value = event.target.value; + event.preventDefault(); + const action = userActionRef.current; + userActionRef.current = null; + if (action) { + switch (action.type) { + case "cut": + dispatch({ type: "CLEAR_CHAR", index, reason: "Cut" }); + return; + case "autocomplete-paste": + return; + case "keydown": { + if (action.key === "Char") { + return; + } + const isClearing = action.key === "Backspace" && (action.metaKey || action.ctrlKey); + if (action.key === "Clear" || isClearing) { + dispatch({ type: "CLEAR", reason: "Backspace" }); + } else { + dispatch({ type: "CLEAR_CHAR", index, reason: action.key }); + } + return; + } + default: + action; + return; + } + } + if (event.target.validity.valid) { + if (value === "") { + let reason = "Backspace"; + if (isInputEvent(event.nativeEvent)) { + const inputType = event.nativeEvent.inputType; + if (inputType === "deleteContentBackward") { + reason = "Backspace"; + } else if (inputType === "deleteByCut") { + reason = "Cut"; + } + } + dispatch({ type: "CLEAR_CHAR", index, reason }); + } else { + dispatch({ type: "SET_CHAR", char: value, index, event }); + } + } else { + const element2 = event.target; + onInvalidChange?.(element2.value); + requestAnimationFrame(() => { + if (element2.ownerDocument.activeElement === element2) { + element2.select(); + } + }); + } + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + switch (event.key) { + case "Clear": + case "Delete": + case "Backspace": { + const currentValue = event.currentTarget.value; + if (currentValue === "") { + if (event.key === "Delete") return; + const isClearing = event.key === "Clear" || event.metaKey || event.ctrlKey; + if (isClearing) { + dispatch({ type: "CLEAR", reason: "Backspace" }); + } else { + const element2 = event.currentTarget; + requestAnimationFrame(() => { + focusInput(collection.from(element2, -1)?.element); + }); + } + } else { + userActionRef.current = { + type: "keydown", + key: event.key, + metaKey: event.metaKey, + ctrlKey: event.ctrlKey + }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + return; + } + case "Enter": { + event.preventDefault(); + context.attemptSubmit(); + return; + } + case "ArrowDown": + case "ArrowUp": { + if (context.orientation === "horizontal") { + event.preventDefault(); + } + return; + } + // TODO: Handle left/right arrow keys in vertical writing mode + default: { + if (event.currentTarget.value === event.key) { + const element2 = event.currentTarget; + event.preventDefault(); + focusInput(collection.from(element2, 1)?.element); + return; + } else if ( + // input already has a value, but... + event.currentTarget.value && // the value is not selected + !(event.currentTarget.selectionStart === 0 && event.currentTarget.selectionEnd != null && event.currentTarget.selectionEnd > 0) + ) { + const attemptedValue = event.key; + if (event.key.length > 1 || event.key === " ") { + return; + } else { + const nextInput = collection.from(event.currentTarget, 1)?.element; + const lastInput = collection.at(-1)?.element; + if (nextInput !== lastInput && event.currentTarget !== lastInput) { + if (event.currentTarget.selectionStart === 0) { + dispatch({ type: "SET_CHAR", char: attemptedValue, index, event }); + } else { + dispatch({ + type: "SET_CHAR", + char: attemptedValue, + index: index + 1, + event + }); + } + userActionRef.current = { + type: "keydown", + key: "Char", + metaKey: event.metaKey, + ctrlKey: event.ctrlKey + }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + } + } + } + } + }), + onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => { + event.preventDefault(); + const indexToFocus = Math.min(index, lastSelectableIndex); + const element2 = collection.at(indexToFocus)?.element; + focusInput(element2); + }) + } + ); + } + } + ) }); +}); +function isFormElement(element) { + return element?.tagName === "FORM"; +} +function removeWhitespace(value) { + return value.replace(/\s/g, ""); +} +function focusInput(element) { + if (!element) return; + if (element.ownerDocument.activeElement === element) { + window.requestAnimationFrame(() => { + element.select?.(); + }); + } else { + element.focus(); + } +} +function isInputEvent(event) { + return event.type === "input"; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..aa45feea851b09ffb9bacfd537118ea743416e62 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/one-time-password-field.tsx"], + "sourcesContent": ["'use client';\nexport type {\n OneTimePasswordFieldProps,\n OneTimePasswordFieldInputProps,\n OneTimePasswordFieldHiddenInputProps,\n InputValidationType,\n} from './one-time-password-field';\nexport {\n OneTimePasswordField,\n OneTimePasswordFieldInput,\n OneTimePasswordFieldHiddenInput,\n //\n Root,\n Input,\n HiddenInput,\n} from './one-time-password-field';\n", "import * as Primitive from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { unstable_createCollection as createCollection } from '@radix-ui/react-collection';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useIsHydrated } from '@radix-ui/react-use-is-hydrated';\nimport * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { clamp } from '@radix-ui/number';\n\ntype InputValidationType = 'alpha' | 'numeric' | 'alphanumeric' | 'none';\n\nconst INPUT_VALIDATION_MAP = {\n numeric: {\n type: 'numeric',\n regexp: /[^\\d]/g,\n pattern: '\\\\d{1}',\n inputMode: 'numeric',\n },\n alpha: {\n type: 'alpha',\n regexp: /[^a-zA-Z]/g,\n pattern: '[a-zA-Z]{1}',\n inputMode: 'text',\n },\n alphanumeric: {\n type: 'alphanumeric',\n regexp: /[^a-zA-Z0-9]/g,\n pattern: '[a-zA-Z0-9]{1}',\n inputMode: 'text',\n },\n none: null,\n} satisfies InputValidation;\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordFieldProvider\n * -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupProps = RovingFocusGroup.RovingFocusGroupProps;\n\ninterface OneTimePasswordFieldContextValue {\n attemptSubmit: () => void;\n autoComplete: AutoComplete;\n autoFocus: boolean;\n disabled: boolean;\n dispatch: Dispatcher;\n form: string | undefined;\n hiddenInputRef: React.RefObject;\n isHydrated: boolean;\n name: string | undefined;\n orientation: Exclude;\n placeholder: string | undefined;\n readOnly: boolean;\n type: InputType;\n userActionRef: React.RefObject;\n validationType: InputValidationType;\n value: string[];\n sanitizeValue: (arg: string | string[]) => string[];\n}\n\nconst ONE_TIME_PASSWORD_FIELD_NAME = 'OneTimePasswordField';\nconst [Collection, { useCollection, createCollectionScope, useInitCollection }] =\n createCollection(ONE_TIME_PASSWORD_FIELD_NAME);\nconst [createOneTimePasswordFieldContext] = createContextScope(ONE_TIME_PASSWORD_FIELD_NAME, [\n createCollectionScope,\n createRovingFocusGroupScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\nconst [OneTimePasswordFieldContext, useOneTimePasswordFieldContext] =\n createOneTimePasswordFieldContext(ONE_TIME_PASSWORD_FIELD_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordField\n * -----------------------------------------------------------------------------------------------*/\n\ninterface OneTimePasswordFieldOwnProps {\n /**\n * Specifies what\u2014if any\u2014permission the user agent has to provide automated\n * assistance in filling out form field values, as well as guidance to the\n * browser as to the type of information expected in the field. Allows\n * `\"one-time-code\"` or `\"off\"`.\n *\n * @defaultValue `\"one-time-code\"`\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete\n */\n autoComplete?: AutoComplete;\n /**\n * Whether or not the first fillable input should be focused on page-load.\n *\n * @defaultValue `false`\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autofocus\n */\n autoFocus?: boolean;\n /**\n * Whether or not the component should attempt to automatically submit when\n * all fields are filled. If the field is associated with an HTML `form`\n * element, the form's `requestSubmit` method will be called.\n *\n * @defaultValue `false`\n */\n autoSubmit?: boolean;\n /**\n * The initial value of the uncontrolled field.\n */\n defaultValue?: string;\n /**\n * Indicates the horizontal directionality of the parent element's text.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir\n */\n dir?: RovingFocusGroupProps['dir'];\n /**\n * Whether or not the the field's input elements are disabled.\n */\n disabled?: boolean;\n /**\n * A string specifying the `form` element with which the input is associated.\n * This string's value, if present, must match the id of a `form` element in\n * the same document.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form\n */\n form?: string | undefined;\n /**\n * A string specifying a name for the input control. This name is submitted\n * along with the control's value when the form data is submitted.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name\n */\n name?: string | undefined;\n /**\n * When the `autoSubmit` prop is set to `true`, this callback will be fired\n * before attempting to submit the associated form. It will be called whether\n * or not a form is located, or if submission is not allowed.\n */\n onAutoSubmit?: (value: string) => void;\n /**\n * A callback fired when the field's value changes. When the component is\n * controlled, this should update the state passed to the `value` prop.\n */\n onValueChange?: (value: string) => void;\n /**\n * Indicates the vertical directionality of the input elements.\n *\n * @defaultValue `\"horizontal\"`\n */\n orientation?: RovingFocusGroupProps['orientation'];\n /**\n * Defines the text displayed in a form control when the control has no value.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder\n */\n placeholder?: string | undefined;\n /**\n * Whether or not the input elements can be updated by the user.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/readonly\n */\n readOnly?: boolean;\n /**\n * Function for custom sanitization when `validationType` is set to `\"none\"`.\n * This function will be called before updating values in response to user\n * interactions.\n */\n sanitizeValue?: (value: string) => string;\n /**\n * The input type of the field's input elements. Can be `\"password\"` or `\"text\"`.\n */\n type?: InputType;\n /**\n * Specifies the type of input validation to be used. Can be `\"alpha\"`,\n * `\"numeric\"`, `\"alphanumeric\"` or `\"none\"`.\n *\n * @defaultValue `\"numeric\"`\n */\n validationType?: InputValidationType;\n /**\n * The controlled value of the field.\n */\n value?: string;\n}\n\ntype ScopedProps

= P & { __scopeOneTimePasswordField?: Scope };\n\ninterface OneTimePasswordFieldProps\n extends\n OneTimePasswordFieldOwnProps,\n Omit, keyof OneTimePasswordFieldOwnProps> {}\n\nconst OneTimePasswordField = React.forwardRef(\n function OneTimePasswordFieldImpl(\n {\n __scopeOneTimePasswordField,\n defaultValue,\n value: valueProp,\n onValueChange,\n autoSubmit = false,\n children,\n onPaste,\n onAutoSubmit,\n disabled = false,\n readOnly = false,\n autoComplete = 'one-time-code',\n autoFocus = false,\n form,\n name,\n placeholder,\n type = 'text',\n // TODO: Change default to vertical when inputs use vertical writing mode\n orientation = 'horizontal',\n dir,\n validationType = 'numeric',\n sanitizeValue: sanitizeValueProp,\n ...domProps\n }: ScopedProps,\n forwardedRef,\n ) {\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField);\n const direction = useDirection(dir);\n const collectionState = useInitCollection();\n const [collection] = collectionState;\n\n const validation = INPUT_VALIDATION_MAP[validationType]\n ? INPUT_VALIDATION_MAP[validationType as keyof InputValidation]\n : null;\n\n const sanitizeValue = React.useCallback(\n (value: string | string[]) => {\n if (Array.isArray(value)) {\n value = value.map(removeWhitespace).join('');\n } else {\n value = removeWhitespace(value);\n }\n\n if (validation) {\n // global regexp is stateful, so we clone it for each call\n const regexp = new RegExp(validation.regexp);\n value = value.replace(regexp, '');\n } else if (sanitizeValueProp) {\n value = sanitizeValueProp(value);\n }\n\n return value.split('');\n },\n [validation, sanitizeValueProp],\n );\n\n const controlledValue = React.useMemo(() => {\n return valueProp != null ? sanitizeValue(valueProp) : undefined;\n }, [valueProp, sanitizeValue]);\n\n const [value, setValue] = useControllableState({\n caller: 'OneTimePasswordField',\n prop: controlledValue,\n defaultProp: defaultValue != null ? sanitizeValue(defaultValue) : [],\n onChange: React.useCallback(\n (value: string[]) => onValueChange?.(value.join('')),\n [onValueChange],\n ),\n });\n\n // Use a ref so dispatch always reads the latest value without needing\n // value in its dependency array (which would change its identity every\n // keystroke and cause cascading effect re-runs).\n const latestValueRef = React.useRef(value);\n latestValueRef.current = value;\n\n // Update function *specifically* for event handlers.\n const dispatch = React.useCallback(\n (action) => {\n const value = latestValueRef.current;\n switch (action.type) {\n case 'SET_CHAR': {\n const { index, char } = action;\n const currentTarget = collection.at(index)?.element;\n if (value[index] === char) {\n const next = currentTarget && collection.from(currentTarget, 1)?.element;\n focusInput(next);\n return;\n }\n\n // empty values should be handled in the CLEAR_CHAR action\n if (char === '') {\n return;\n }\n\n if (validation) {\n const regexp = new RegExp(validation.regexp);\n const clean = char.replace(regexp, '');\n if (clean !== char) {\n // not valid; ignore\n return;\n }\n }\n\n // no more space\n if (value.length >= collection.size) {\n // replace current value; move to next input\n const newValue = [...value];\n newValue[index] = char;\n flushSync(() => setValue(newValue));\n const next = currentTarget && collection.from(currentTarget, 1)?.element;\n focusInput(next);\n return;\n }\n\n const newValue = [...value];\n newValue[index] = char;\n\n const lastElement = collection.at(-1)?.element;\n flushSync(() => setValue(newValue));\n if (currentTarget !== lastElement) {\n const next = currentTarget && collection.from(currentTarget, 1)?.element;\n focusInput(next);\n } else {\n currentTarget?.select();\n }\n return;\n }\n\n case 'CLEAR_CHAR': {\n const { index, reason } = action;\n if (!value[index]) {\n return;\n }\n\n const newValue = value.filter((_, i) => i !== index);\n const currentTarget = collection.at(index)?.element;\n const previous = currentTarget && collection.from(currentTarget, -1)?.element;\n\n flushSync(() => setValue(newValue));\n if (reason === 'Backspace') {\n focusInput(previous);\n } else if (reason === 'Delete' || reason === 'Cut') {\n focusInput(currentTarget);\n }\n return;\n }\n\n case 'CLEAR': {\n if (value.length === 0) {\n return;\n }\n\n if (action.reason === 'Backspace' || action.reason === 'Delete') {\n flushSync(() => setValue([]));\n focusInput(collection.at(0)?.element);\n } else {\n setValue([]);\n }\n return;\n }\n\n case 'PASTE': {\n const { value: pastedValue } = action;\n const sanitizedValue = sanitizeValue(pastedValue);\n if (!sanitizedValue) {\n return;\n }\n\n const value = sanitizedValue.slice(0, collection.size);\n\n flushSync(() => setValue(value));\n focusInput(collection.at(value.length - 1)?.element);\n return;\n }\n }\n },\n [collection, sanitizeValue, setValue, validation],\n );\n\n // re-validate when the validation type changes\n const validationTypeRef = React.useRef(validation);\n React.useEffect(() => {\n if (!validation) {\n return;\n }\n\n if (validationTypeRef.current?.type !== validation.type) {\n validationTypeRef.current = validation;\n setValue(sanitizeValue(value.join('')));\n }\n }, [sanitizeValue, setValue, validation, value]);\n\n const hiddenInputRef = React.useRef(null);\n\n const userActionRef = React.useRef(null);\n const rootRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, rootRef);\n\n const firstInput = collection.at(0)?.element;\n const locateForm = React.useCallback(() => {\n let formElement: HTMLFormElement | null | undefined;\n if (form) {\n const associatedElement = (rootRef.current?.ownerDocument ?? document).getElementById(form);\n if (isFormElement(associatedElement)) {\n formElement = associatedElement;\n }\n } else if (hiddenInputRef.current) {\n formElement = hiddenInputRef.current.form;\n } else if (firstInput) {\n formElement = firstInput.form;\n }\n\n return formElement ?? null;\n }, [form, firstInput]);\n\n const attemptSubmit = React.useCallback(() => {\n const formElement = locateForm();\n formElement?.requestSubmit();\n }, [locateForm]);\n\n React.useEffect(() => {\n const form = locateForm();\n if (form) {\n const reset = () => dispatch({ type: 'CLEAR', reason: 'Reset' });\n form.addEventListener('reset', reset);\n return () => form.removeEventListener('reset', reset);\n }\n }, [dispatch, locateForm]);\n\n const currentValue = value.join('');\n const valueRef = React.useRef(currentValue);\n const length = collection.size;\n React.useEffect(() => {\n const previousValue = valueRef.current;\n valueRef.current = currentValue;\n if (previousValue === currentValue) {\n return;\n }\n\n if (autoSubmit && value.every((char) => char !== '') && value.length === length) {\n onAutoSubmit?.(value.join(''));\n attemptSubmit();\n }\n }, [attemptSubmit, autoSubmit, currentValue, length, onAutoSubmit, value]);\n const isHydrated = useIsHydrated();\n\n return (\n \n \n \n \n ) => {\n event.preventDefault();\n const pastedValue = event.clipboardData.getData('text/plain');\n dispatch({ type: 'PASTE', value: pastedValue });\n },\n )}\n >\n {children}\n \n \n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordFieldHiddenInput\n * -----------------------------------------------------------------------------------------------*/\n\ninterface OneTimePasswordFieldHiddenInputProps extends Omit<\n React.ComponentProps<'input'>,\n | keyof 'value'\n | 'defaultValue'\n | 'type'\n | 'onChange'\n | 'readOnly'\n | 'disabled'\n | 'autoComplete'\n | 'autoFocus'\n> {}\n\nconst OneTimePasswordFieldHiddenInput = React.forwardRef<\n HTMLInputElement,\n OneTimePasswordFieldHiddenInputProps\n>(function OneTimePasswordFieldHiddenInput(\n { __scopeOneTimePasswordField, ...props }: ScopedProps,\n forwardedRef,\n) {\n const { value, hiddenInputRef, name } = useOneTimePasswordFieldContext(\n 'OneTimePasswordFieldHiddenInput',\n __scopeOneTimePasswordField,\n );\n const ref = useComposedRefs(hiddenInputRef, forwardedRef);\n return (\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordFieldInput\n * -----------------------------------------------------------------------------------------------*/\n\ninterface OneTimePasswordFieldInputProps extends Omit<\n Primitive.PrimitivePropsWithRef<'input'>,\n | 'value'\n | 'defaultValue'\n | 'disabled'\n | 'readOnly'\n | 'autoComplete'\n | 'autoFocus'\n | 'form'\n | 'name'\n | 'placeholder'\n | 'type'\n> {\n /**\n * Callback fired when the user input fails native HTML input validation.\n */\n onInvalidChange?: (character: string) => void;\n /**\n * User-provided index to determine the order of the inputs. This is useful if\n * you need certain index-based attributes to be set on the initial render,\n * often to prevent flickering after hydration.\n */\n index?: number;\n}\n\nconst OneTimePasswordFieldInput = React.forwardRef<\n HTMLInputElement,\n OneTimePasswordFieldInputProps\n>(function OneTimePasswordFieldInput(\n {\n __scopeOneTimePasswordField,\n onInvalidChange,\n index: indexProp,\n ...props\n }: ScopedProps,\n forwardedRef,\n) {\n // TODO: warn if these values are passed\n const {\n value: _value,\n defaultValue: _defaultValue,\n disabled: _disabled,\n readOnly: _readOnly,\n autoComplete: _autoComplete,\n autoFocus: _autoFocus,\n form: _form,\n name: _name,\n placeholder: _placeholder,\n type: _type,\n ...domProps\n } = props as Primitive.PrimitivePropsWithRef<'input'>;\n\n const context = useOneTimePasswordFieldContext(\n 'OneTimePasswordFieldInput',\n __scopeOneTimePasswordField,\n );\n const { dispatch, userActionRef, validationType, isHydrated, disabled } = context;\n const collection = useCollection(__scopeOneTimePasswordField);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField);\n\n const inputRef = React.useRef(null);\n const [element, setElement] = React.useState(null);\n\n const index = indexProp ?? (element ? collection.indexOf(element) : -1);\n const canSetPlaceholder = indexProp != null || isHydrated;\n let placeholder: string | undefined;\n if (canSetPlaceholder && context.placeholder && context.value.length === 0) {\n // only set placeholder after hydration to prevent flickering when indices\n // are re-calculated\n placeholder = context.placeholder[index];\n }\n\n const composedInputRef = useComposedRefs(forwardedRef, inputRef, setElement);\n const char = context.value[index] ?? '';\n\n const keyboardActionTimeoutRef = React.useRef(null);\n React.useEffect(() => {\n return () => {\n if (keyboardActionTimeoutRef.current) {\n window.clearTimeout(keyboardActionTimeoutRef.current);\n }\n };\n }, []);\n\n const totalValue = context.value.join('').trim();\n const lastSelectableIndex = clamp(totalValue.length, [0, collection.size - 1]);\n const isFocusable = index <= lastSelectableIndex;\n\n const validation =\n validationType in INPUT_VALIDATION_MAP\n ? INPUT_VALIDATION_MAP[validationType as keyof InputValidation]\n : undefined;\n\n return (\n \n \n {({ hasTabStop, isCurrentTabStop }) => {\n const supportsAutoComplete = hasTabStop ? isCurrentTabStop : index === 0;\n return (\n {\n event.currentTarget.select();\n })}\n onCut={composeEventHandlers(props.onCut, (event) => {\n const currentValue = event.currentTarget.value;\n if (currentValue !== '') {\n // In this case the value will be cleared, but we don't want to\n // set it directly because the user may want to prevent default\n // behavior in the onChange handler. The userActionRef will\n // be set temporarily so the change handler can behave correctly\n // in response to the action.\n userActionRef.current = { type: 'cut' };\n // Set a short timeout to clear the action tracker after the change\n // handler has had time to complete.\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n })}\n onInput={composeEventHandlers(props.onInput, (event) => {\n const value = event.currentTarget.value;\n if (value.length > 1) {\n // Password managers may try to insert the code into a single\n // input, in which case form validation will fail to prevent\n // additional input. Handle this the same as if a user were\n // pasting a value.\n event.preventDefault();\n userActionRef.current = { type: 'autocomplete-paste' };\n dispatch({ type: 'PASTE', value });\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n })}\n onChange={composeEventHandlers(props.onChange, (event) => {\n const value = event.target.value;\n event.preventDefault();\n const action = userActionRef.current;\n userActionRef.current = null;\n\n if (action) {\n switch (action.type) {\n case 'cut':\n // TODO: do we want to assume the user wants to clear the\n // entire value here and copy the code to the clipboard instead\n // of just the value of the given input?\n dispatch({ type: 'CLEAR_CHAR', index, reason: 'Cut' });\n return;\n case 'autocomplete-paste':\n // the PASTE handler will already set the value and focus the final\n // input; we want to skip focusing the wrong element if the browser fires\n // onChange for the first input. This sometimes happens during autocomplete.\n return;\n case 'keydown': {\n if (action.key === 'Char') {\n // update resulting from a keydown event that set a value\n // directly. Ignore.\n return;\n }\n\n const isClearing =\n action.key === 'Backspace' && (action.metaKey || action.ctrlKey);\n if (action.key === 'Clear' || isClearing) {\n dispatch({ type: 'CLEAR', reason: 'Backspace' });\n } else {\n dispatch({ type: 'CLEAR_CHAR', index, reason: action.key });\n }\n return;\n }\n default:\n action satisfies never;\n return;\n }\n }\n\n // Only update the value if it matches the input pattern\n if (event.target.validity.valid) {\n if (value === '') {\n let reason: 'Backspace' | 'Delete' | 'Cut' = 'Backspace';\n if (isInputEvent(event.nativeEvent)) {\n const inputType = event.nativeEvent.inputType;\n if (inputType === 'deleteContentBackward') {\n reason = 'Backspace';\n } else if (inputType === 'deleteByCut') {\n reason = 'Cut';\n }\n }\n dispatch({ type: 'CLEAR_CHAR', index, reason });\n } else {\n dispatch({ type: 'SET_CHAR', char: value, index, event });\n }\n } else {\n const element = event.target;\n onInvalidChange?.(element.value);\n requestAnimationFrame(() => {\n if (element.ownerDocument.activeElement === element) {\n element.select();\n }\n });\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n switch (event.key) {\n case 'Clear':\n case 'Delete':\n case 'Backspace': {\n const currentValue = event.currentTarget.value;\n // if current value is empty, no change event will fire\n if (currentValue === '') {\n // if the user presses delete when there is no value, noop\n if (event.key === 'Delete') return;\n\n const isClearing = event.key === 'Clear' || event.metaKey || event.ctrlKey;\n if (isClearing) {\n dispatch({ type: 'CLEAR', reason: 'Backspace' });\n } else {\n const element = event.currentTarget;\n requestAnimationFrame(() => {\n focusInput(collection.from(element, -1)?.element);\n });\n }\n } else {\n // In this case the value will be cleared, but we don't want\n // to set it directly because the user may want to prevent\n // default behavior in the onChange handler. The userActionRef\n // will is set temporarily so the change handler can behave\n // correctly in response to the key vs. clearing the value by\n // setting state externally.\n userActionRef.current = {\n type: 'keydown',\n key: event.key,\n metaKey: event.metaKey,\n ctrlKey: event.ctrlKey,\n };\n // Set a short timeout to clear the action tracker after the change\n // handler has had time to complete.\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n\n return;\n }\n case 'Enter': {\n event.preventDefault();\n context.attemptSubmit();\n return;\n }\n case 'ArrowDown':\n case 'ArrowUp': {\n if (context.orientation === 'horizontal') {\n // in horizontal orientation, the up/down will de-select the\n // input instead of moving focus\n event.preventDefault();\n }\n return;\n }\n // TODO: Handle left/right arrow keys in vertical writing mode\n default: {\n if (event.currentTarget.value === event.key) {\n // if current value is same as the key press, no change event\n // will fire. Focus the next input.\n const element = event.currentTarget;\n event.preventDefault();\n focusInput(collection.from(element, 1)?.element);\n return;\n } else if (\n // input already has a value, but...\n event.currentTarget.value &&\n // the value is not selected\n !(\n event.currentTarget.selectionStart === 0 &&\n event.currentTarget.selectionEnd != null &&\n event.currentTarget.selectionEnd > 0\n )\n ) {\n const attemptedValue = event.key;\n if (event.key.length > 1 || event.key === ' ') {\n // not a character; do nothing\n return;\n } else {\n // user is attempting to enter a character, but the input\n // will not update by default since it's limited to a single\n // character.\n const nextInput = collection.from(event.currentTarget, 1)?.element;\n const lastInput = collection.at(-1)?.element;\n if (nextInput !== lastInput && event.currentTarget !== lastInput) {\n // if selection is before the value, set the value of the\n // current input. Otherwise set the value of the next\n // input.\n if (event.currentTarget.selectionStart === 0) {\n dispatch({ type: 'SET_CHAR', char: attemptedValue, index, event });\n } else {\n dispatch({\n type: 'SET_CHAR',\n char: attemptedValue,\n index: index + 1,\n event,\n });\n }\n\n userActionRef.current = {\n type: 'keydown',\n key: 'Char',\n metaKey: event.metaKey,\n ctrlKey: event.ctrlKey,\n };\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n }\n }\n }\n }\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n event.preventDefault();\n const indexToFocus = Math.min(index, lastSelectableIndex);\n const element = collection.at(indexToFocus)?.element;\n focusInput(element);\n })}\n />\n );\n }}\n \n \n );\n});\n\nexport {\n OneTimePasswordField,\n OneTimePasswordFieldInput,\n OneTimePasswordFieldHiddenInput,\n //\n OneTimePasswordField as Root,\n OneTimePasswordFieldInput as Input,\n OneTimePasswordFieldHiddenInput as HiddenInput,\n};\nexport type {\n OneTimePasswordFieldProps,\n OneTimePasswordFieldInputProps,\n OneTimePasswordFieldHiddenInputProps,\n InputValidationType,\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isFormElement(element: Element | null | undefined): element is HTMLFormElement {\n return element?.tagName === 'FORM';\n}\n\nfunction removeWhitespace(value: string) {\n return value.replace(/\\s/g, '');\n}\n\nfunction focusInput(element: HTMLInputElement | null | undefined) {\n if (!element) return;\n if (element.ownerDocument.activeElement === element) {\n // if the element is already focused, select the value in the next\n // animation frame\n window.requestAnimationFrame(() => {\n element.select?.();\n });\n } else {\n element.focus();\n }\n}\n\nfunction isInputEvent(event: Event): event is InputEvent {\n return event.type === 'input';\n}\n\ntype InputType = 'password' | 'text';\ntype AutoComplete = 'off' | 'one-time-code';\ntype KeyboardActionDetails =\n | {\n type: 'keydown';\n key: 'Backspace' | 'Delete' | 'Clear' | 'Char';\n metaKey: boolean;\n ctrlKey: boolean;\n }\n | { type: 'cut' }\n | { type: 'autocomplete-paste' };\n\ntype UpdateAction =\n | {\n type: 'SET_CHAR';\n char: string;\n index: number;\n event: React.KeyboardEvent | React.ChangeEvent;\n }\n | { type: 'CLEAR_CHAR'; index: number; reason: 'Backspace' | 'Delete' | 'Cut' }\n | { type: 'CLEAR'; reason: 'Reset' | 'Backspace' | 'Delete' | 'Clear' }\n | { type: 'PASTE'; value: string };\ntype Dispatcher = React.Dispatch;\ntype InputValidation = Record<\n InputValidationType,\n {\n type: InputValidationType;\n regexp: RegExp;\n pattern: string;\n inputMode: 'text' | 'numeric';\n } | null\n>;\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,gBAA2B;AAC3B,gCAAgC;AAChC,0CAAqC;AACrC,uBAAqC;AACrC,8BAA8D;AAC9D,uBAAkC;AAClC,gCAA4C;AAC5C,mCAA8B;AAC9B,YAAuB;AACvB,uBAA0B;AAE1B,2BAAmC;AACnC,6BAA6B;AAC7B,oBAAsB;AA4cR;AAxcd,IAAM,uBAAuB;AAAA,EAC3B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AACR;AA4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D,WAAO,sBAAsB,MAAM;AACjC,cAAQ,SAAS;AAAA,IACnB,CAAC;AAAA,EACH,OAAO;AACL,YAAQ,MAAM;AAAA,EAChB;AACF;AAEA,SAAS,aAAa,OAAmC;AACvD,SAAO,MAAM,SAAS;AACxB;", + "names": ["createCollection", "value", "newValue", "form", "OneTimePasswordFieldHiddenInput", "OneTimePasswordFieldInput", "element"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..13c98b837df3e738d085c0d7345543531ac12ad4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.mjs @@ -0,0 +1,604 @@ +"use client"; + +// src/one-time-password-field.tsx +import * as Primitive from "@radix-ui/react-primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { unstable_createCollection as createCollection } from "@radix-ui/react-collection"; +import * as RovingFocusGroup from "@radix-ui/react-roving-focus"; +import { createRovingFocusGroupScope } from "@radix-ui/react-roving-focus"; +import { useIsHydrated } from "@radix-ui/react-use-is-hydrated"; +import * as React from "react"; +import { flushSync } from "react-dom"; +import { createContextScope } from "@radix-ui/react-context"; +import { useDirection } from "@radix-ui/react-direction"; +import { clamp } from "@radix-ui/number"; +import { jsx } from "react/jsx-runtime"; +var INPUT_VALIDATION_MAP = { + numeric: { + type: "numeric", + regexp: /[^\d]/g, + pattern: "\\d{1}", + inputMode: "numeric" + }, + alpha: { + type: "alpha", + regexp: /[^a-zA-Z]/g, + pattern: "[a-zA-Z]{1}", + inputMode: "text" + }, + alphanumeric: { + type: "alphanumeric", + regexp: /[^a-zA-Z0-9]/g, + pattern: "[a-zA-Z0-9]{1}", + inputMode: "text" + }, + none: null +}; +var ONE_TIME_PASSWORD_FIELD_NAME = "OneTimePasswordField"; +var [Collection, { useCollection, createCollectionScope, useInitCollection }] = createCollection(ONE_TIME_PASSWORD_FIELD_NAME); +var [createOneTimePasswordFieldContext] = createContextScope(ONE_TIME_PASSWORD_FIELD_NAME, [ + createCollectionScope, + createRovingFocusGroupScope +]); +var useRovingFocusGroupScope = createRovingFocusGroupScope(); +var [OneTimePasswordFieldContext, useOneTimePasswordFieldContext] = createOneTimePasswordFieldContext(ONE_TIME_PASSWORD_FIELD_NAME); +var OneTimePasswordField = React.forwardRef( + function OneTimePasswordFieldImpl({ + __scopeOneTimePasswordField, + defaultValue, + value: valueProp, + onValueChange, + autoSubmit = false, + children, + onPaste, + onAutoSubmit, + disabled = false, + readOnly = false, + autoComplete = "one-time-code", + autoFocus = false, + form, + name, + placeholder, + type = "text", + // TODO: Change default to vertical when inputs use vertical writing mode + orientation = "horizontal", + dir, + validationType = "numeric", + sanitizeValue: sanitizeValueProp, + ...domProps + }, forwardedRef) { + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField); + const direction = useDirection(dir); + const collectionState = useInitCollection(); + const [collection] = collectionState; + const validation = INPUT_VALIDATION_MAP[validationType] ? INPUT_VALIDATION_MAP[validationType] : null; + const sanitizeValue = React.useCallback( + (value2) => { + if (Array.isArray(value2)) { + value2 = value2.map(removeWhitespace).join(""); + } else { + value2 = removeWhitespace(value2); + } + if (validation) { + const regexp = new RegExp(validation.regexp); + value2 = value2.replace(regexp, ""); + } else if (sanitizeValueProp) { + value2 = sanitizeValueProp(value2); + } + return value2.split(""); + }, + [validation, sanitizeValueProp] + ); + const controlledValue = React.useMemo(() => { + return valueProp != null ? sanitizeValue(valueProp) : void 0; + }, [valueProp, sanitizeValue]); + const [value, setValue] = useControllableState({ + caller: "OneTimePasswordField", + prop: controlledValue, + defaultProp: defaultValue != null ? sanitizeValue(defaultValue) : [], + onChange: React.useCallback( + (value2) => onValueChange?.(value2.join("")), + [onValueChange] + ) + }); + const latestValueRef = React.useRef(value); + latestValueRef.current = value; + const dispatch = React.useCallback( + (action) => { + const value2 = latestValueRef.current; + switch (action.type) { + case "SET_CHAR": { + const { index, char } = action; + const currentTarget = collection.at(index)?.element; + if (value2[index] === char) { + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + return; + } + if (char === "") { + return; + } + if (validation) { + const regexp = new RegExp(validation.regexp); + const clean = char.replace(regexp, ""); + if (clean !== char) { + return; + } + } + if (value2.length >= collection.size) { + const newValue2 = [...value2]; + newValue2[index] = char; + flushSync(() => setValue(newValue2)); + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + return; + } + const newValue = [...value2]; + newValue[index] = char; + const lastElement = collection.at(-1)?.element; + flushSync(() => setValue(newValue)); + if (currentTarget !== lastElement) { + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + } else { + currentTarget?.select(); + } + return; + } + case "CLEAR_CHAR": { + const { index, reason } = action; + if (!value2[index]) { + return; + } + const newValue = value2.filter((_, i) => i !== index); + const currentTarget = collection.at(index)?.element; + const previous = currentTarget && collection.from(currentTarget, -1)?.element; + flushSync(() => setValue(newValue)); + if (reason === "Backspace") { + focusInput(previous); + } else if (reason === "Delete" || reason === "Cut") { + focusInput(currentTarget); + } + return; + } + case "CLEAR": { + if (value2.length === 0) { + return; + } + if (action.reason === "Backspace" || action.reason === "Delete") { + flushSync(() => setValue([])); + focusInput(collection.at(0)?.element); + } else { + setValue([]); + } + return; + } + case "PASTE": { + const { value: pastedValue } = action; + const sanitizedValue = sanitizeValue(pastedValue); + if (!sanitizedValue) { + return; + } + const value3 = sanitizedValue.slice(0, collection.size); + flushSync(() => setValue(value3)); + focusInput(collection.at(value3.length - 1)?.element); + return; + } + } + }, + [collection, sanitizeValue, setValue, validation] + ); + const validationTypeRef = React.useRef(validation); + React.useEffect(() => { + if (!validation) { + return; + } + if (validationTypeRef.current?.type !== validation.type) { + validationTypeRef.current = validation; + setValue(sanitizeValue(value.join(""))); + } + }, [sanitizeValue, setValue, validation, value]); + const hiddenInputRef = React.useRef(null); + const userActionRef = React.useRef(null); + const rootRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, rootRef); + const firstInput = collection.at(0)?.element; + const locateForm = React.useCallback(() => { + let formElement; + if (form) { + const associatedElement = (rootRef.current?.ownerDocument ?? document).getElementById(form); + if (isFormElement(associatedElement)) { + formElement = associatedElement; + } + } else if (hiddenInputRef.current) { + formElement = hiddenInputRef.current.form; + } else if (firstInput) { + formElement = firstInput.form; + } + return formElement ?? null; + }, [form, firstInput]); + const attemptSubmit = React.useCallback(() => { + const formElement = locateForm(); + formElement?.requestSubmit(); + }, [locateForm]); + React.useEffect(() => { + const form2 = locateForm(); + if (form2) { + const reset = () => dispatch({ type: "CLEAR", reason: "Reset" }); + form2.addEventListener("reset", reset); + return () => form2.removeEventListener("reset", reset); + } + }, [dispatch, locateForm]); + const currentValue = value.join(""); + const valueRef = React.useRef(currentValue); + const length = collection.size; + React.useEffect(() => { + const previousValue = valueRef.current; + valueRef.current = currentValue; + if (previousValue === currentValue) { + return; + } + if (autoSubmit && value.every((char) => char !== "") && value.length === length) { + onAutoSubmit?.(value.join("")); + attemptSubmit(); + } + }, [attemptSubmit, autoSubmit, currentValue, length, onAutoSubmit, value]); + const isHydrated = useIsHydrated(); + return /* @__PURE__ */ jsx( + OneTimePasswordFieldContext, + { + scope: __scopeOneTimePasswordField, + value, + attemptSubmit, + disabled, + readOnly, + autoComplete, + autoFocus, + form, + name, + placeholder, + type, + hiddenInputRef, + userActionRef, + dispatch, + validationType, + orientation, + isHydrated, + sanitizeValue, + children: /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeOneTimePasswordField, state: collectionState, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeOneTimePasswordField, children: /* @__PURE__ */ jsx( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation, + dir: direction, + children: /* @__PURE__ */ jsx( + Primitive.Root.div, + { + ...domProps, + role: "group", + ref: composedRefs, + onPaste: composeEventHandlers( + onPaste, + (event) => { + event.preventDefault(); + const pastedValue = event.clipboardData.getData("text/plain"); + dispatch({ type: "PASTE", value: pastedValue }); + } + ), + children + } + ) + } + ) }) }) + } + ); + } +); +var OneTimePasswordFieldHiddenInput = React.forwardRef(function OneTimePasswordFieldHiddenInput2({ __scopeOneTimePasswordField, ...props }, forwardedRef) { + const { value, hiddenInputRef, name } = useOneTimePasswordFieldContext( + "OneTimePasswordFieldHiddenInput", + __scopeOneTimePasswordField + ); + const ref = useComposedRefs(hiddenInputRef, forwardedRef); + return /* @__PURE__ */ jsx( + "input", + { + ref, + name, + value: value.join("").trim(), + autoComplete: "off", + autoFocus: false, + autoCapitalize: "off", + autoCorrect: "off", + autoSave: "off", + spellCheck: false, + ...props, + type: "hidden", + readOnly: true + } + ); +}); +var OneTimePasswordFieldInput = React.forwardRef(function OneTimePasswordFieldInput2({ + __scopeOneTimePasswordField, + onInvalidChange, + index: indexProp, + ...props +}, forwardedRef) { + const { + value: _value, + defaultValue: _defaultValue, + disabled: _disabled, + readOnly: _readOnly, + autoComplete: _autoComplete, + autoFocus: _autoFocus, + form: _form, + name: _name, + placeholder: _placeholder, + type: _type, + ...domProps + } = props; + const context = useOneTimePasswordFieldContext( + "OneTimePasswordFieldInput", + __scopeOneTimePasswordField + ); + const { dispatch, userActionRef, validationType, isHydrated, disabled } = context; + const collection = useCollection(__scopeOneTimePasswordField); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField); + const inputRef = React.useRef(null); + const [element, setElement] = React.useState(null); + const index = indexProp ?? (element ? collection.indexOf(element) : -1); + const canSetPlaceholder = indexProp != null || isHydrated; + let placeholder; + if (canSetPlaceholder && context.placeholder && context.value.length === 0) { + placeholder = context.placeholder[index]; + } + const composedInputRef = useComposedRefs(forwardedRef, inputRef, setElement); + const char = context.value[index] ?? ""; + const keyboardActionTimeoutRef = React.useRef(null); + React.useEffect(() => { + return () => { + if (keyboardActionTimeoutRef.current) { + window.clearTimeout(keyboardActionTimeoutRef.current); + } + }; + }, []); + const totalValue = context.value.join("").trim(); + const lastSelectableIndex = clamp(totalValue.length, [0, collection.size - 1]); + const isFocusable = index <= lastSelectableIndex; + const validation = validationType in INPUT_VALIDATION_MAP ? INPUT_VALIDATION_MAP[validationType] : void 0; + return /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeOneTimePasswordField, children: /* @__PURE__ */ jsx( + RovingFocusGroup.Item, + { + ...rovingFocusGroupScope, + asChild: true, + focusable: !context.disabled && isFocusable, + active: index === lastSelectableIndex, + children: ({ hasTabStop, isCurrentTabStop }) => { + const supportsAutoComplete = hasTabStop ? isCurrentTabStop : index === 0; + return /* @__PURE__ */ jsx( + Primitive.Root.input, + { + ref: composedInputRef, + type: context.type, + disabled, + "aria-label": `Character ${index + 1} of ${collection.size}`, + autoComplete: supportsAutoComplete ? context.autoComplete : "off", + "data-1p-ignore": supportsAutoComplete ? void 0 : "true", + "data-lpignore": supportsAutoComplete ? void 0 : "true", + "data-protonpass-ignore": supportsAutoComplete ? void 0 : "true", + "data-bwignore": supportsAutoComplete ? void 0 : "true", + inputMode: validation?.inputMode, + maxLength: supportsAutoComplete ? collection.size : 1, + pattern: validation?.pattern, + readOnly: context.readOnly, + value: char, + placeholder, + "data-radix-otp-input": "", + "data-radix-index": index, + ...domProps, + onFocus: composeEventHandlers(props.onFocus, (event) => { + event.currentTarget.select(); + }), + onCut: composeEventHandlers(props.onCut, (event) => { + const currentValue = event.currentTarget.value; + if (currentValue !== "") { + userActionRef.current = { type: "cut" }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + }), + onInput: composeEventHandlers(props.onInput, (event) => { + const value = event.currentTarget.value; + if (value.length > 1) { + event.preventDefault(); + userActionRef.current = { type: "autocomplete-paste" }; + dispatch({ type: "PASTE", value }); + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + }), + onChange: composeEventHandlers(props.onChange, (event) => { + const value = event.target.value; + event.preventDefault(); + const action = userActionRef.current; + userActionRef.current = null; + if (action) { + switch (action.type) { + case "cut": + dispatch({ type: "CLEAR_CHAR", index, reason: "Cut" }); + return; + case "autocomplete-paste": + return; + case "keydown": { + if (action.key === "Char") { + return; + } + const isClearing = action.key === "Backspace" && (action.metaKey || action.ctrlKey); + if (action.key === "Clear" || isClearing) { + dispatch({ type: "CLEAR", reason: "Backspace" }); + } else { + dispatch({ type: "CLEAR_CHAR", index, reason: action.key }); + } + return; + } + default: + action; + return; + } + } + if (event.target.validity.valid) { + if (value === "") { + let reason = "Backspace"; + if (isInputEvent(event.nativeEvent)) { + const inputType = event.nativeEvent.inputType; + if (inputType === "deleteContentBackward") { + reason = "Backspace"; + } else if (inputType === "deleteByCut") { + reason = "Cut"; + } + } + dispatch({ type: "CLEAR_CHAR", index, reason }); + } else { + dispatch({ type: "SET_CHAR", char: value, index, event }); + } + } else { + const element2 = event.target; + onInvalidChange?.(element2.value); + requestAnimationFrame(() => { + if (element2.ownerDocument.activeElement === element2) { + element2.select(); + } + }); + } + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + switch (event.key) { + case "Clear": + case "Delete": + case "Backspace": { + const currentValue = event.currentTarget.value; + if (currentValue === "") { + if (event.key === "Delete") return; + const isClearing = event.key === "Clear" || event.metaKey || event.ctrlKey; + if (isClearing) { + dispatch({ type: "CLEAR", reason: "Backspace" }); + } else { + const element2 = event.currentTarget; + requestAnimationFrame(() => { + focusInput(collection.from(element2, -1)?.element); + }); + } + } else { + userActionRef.current = { + type: "keydown", + key: event.key, + metaKey: event.metaKey, + ctrlKey: event.ctrlKey + }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + return; + } + case "Enter": { + event.preventDefault(); + context.attemptSubmit(); + return; + } + case "ArrowDown": + case "ArrowUp": { + if (context.orientation === "horizontal") { + event.preventDefault(); + } + return; + } + // TODO: Handle left/right arrow keys in vertical writing mode + default: { + if (event.currentTarget.value === event.key) { + const element2 = event.currentTarget; + event.preventDefault(); + focusInput(collection.from(element2, 1)?.element); + return; + } else if ( + // input already has a value, but... + event.currentTarget.value && // the value is not selected + !(event.currentTarget.selectionStart === 0 && event.currentTarget.selectionEnd != null && event.currentTarget.selectionEnd > 0) + ) { + const attemptedValue = event.key; + if (event.key.length > 1 || event.key === " ") { + return; + } else { + const nextInput = collection.from(event.currentTarget, 1)?.element; + const lastInput = collection.at(-1)?.element; + if (nextInput !== lastInput && event.currentTarget !== lastInput) { + if (event.currentTarget.selectionStart === 0) { + dispatch({ type: "SET_CHAR", char: attemptedValue, index, event }); + } else { + dispatch({ + type: "SET_CHAR", + char: attemptedValue, + index: index + 1, + event + }); + } + userActionRef.current = { + type: "keydown", + key: "Char", + metaKey: event.metaKey, + ctrlKey: event.ctrlKey + }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + } + } + } + } + }), + onPointerDown: composeEventHandlers(props.onPointerDown, (event) => { + event.preventDefault(); + const indexToFocus = Math.min(index, lastSelectableIndex); + const element2 = collection.at(indexToFocus)?.element; + focusInput(element2); + }) + } + ); + } + } + ) }); +}); +function isFormElement(element) { + return element?.tagName === "FORM"; +} +function removeWhitespace(value) { + return value.replace(/\s/g, ""); +} +function focusInput(element) { + if (!element) return; + if (element.ownerDocument.activeElement === element) { + window.requestAnimationFrame(() => { + element.select?.(); + }); + } else { + element.focus(); + } +} +function isInputEvent(event) { + return event.type === "input"; +} +export { + OneTimePasswordFieldHiddenInput as HiddenInput, + OneTimePasswordFieldInput as Input, + OneTimePasswordField, + OneTimePasswordFieldHiddenInput, + OneTimePasswordFieldInput, + OneTimePasswordField as Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..f548e992809a393e390b33f2702000a5b4cbbc26 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/one-time-password-field.tsx"], + "sourcesContent": ["import * as Primitive from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { unstable_createCollection as createCollection } from '@radix-ui/react-collection';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useIsHydrated } from '@radix-ui/react-use-is-hydrated';\nimport * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { clamp } from '@radix-ui/number';\n\ntype InputValidationType = 'alpha' | 'numeric' | 'alphanumeric' | 'none';\n\nconst INPUT_VALIDATION_MAP = {\n numeric: {\n type: 'numeric',\n regexp: /[^\\d]/g,\n pattern: '\\\\d{1}',\n inputMode: 'numeric',\n },\n alpha: {\n type: 'alpha',\n regexp: /[^a-zA-Z]/g,\n pattern: '[a-zA-Z]{1}',\n inputMode: 'text',\n },\n alphanumeric: {\n type: 'alphanumeric',\n regexp: /[^a-zA-Z0-9]/g,\n pattern: '[a-zA-Z0-9]{1}',\n inputMode: 'text',\n },\n none: null,\n} satisfies InputValidation;\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordFieldProvider\n * -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupProps = RovingFocusGroup.RovingFocusGroupProps;\n\ninterface OneTimePasswordFieldContextValue {\n attemptSubmit: () => void;\n autoComplete: AutoComplete;\n autoFocus: boolean;\n disabled: boolean;\n dispatch: Dispatcher;\n form: string | undefined;\n hiddenInputRef: React.RefObject;\n isHydrated: boolean;\n name: string | undefined;\n orientation: Exclude;\n placeholder: string | undefined;\n readOnly: boolean;\n type: InputType;\n userActionRef: React.RefObject;\n validationType: InputValidationType;\n value: string[];\n sanitizeValue: (arg: string | string[]) => string[];\n}\n\nconst ONE_TIME_PASSWORD_FIELD_NAME = 'OneTimePasswordField';\nconst [Collection, { useCollection, createCollectionScope, useInitCollection }] =\n createCollection(ONE_TIME_PASSWORD_FIELD_NAME);\nconst [createOneTimePasswordFieldContext] = createContextScope(ONE_TIME_PASSWORD_FIELD_NAME, [\n createCollectionScope,\n createRovingFocusGroupScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\nconst [OneTimePasswordFieldContext, useOneTimePasswordFieldContext] =\n createOneTimePasswordFieldContext(ONE_TIME_PASSWORD_FIELD_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordField\n * -----------------------------------------------------------------------------------------------*/\n\ninterface OneTimePasswordFieldOwnProps {\n /**\n * Specifies what\u2014if any\u2014permission the user agent has to provide automated\n * assistance in filling out form field values, as well as guidance to the\n * browser as to the type of information expected in the field. Allows\n * `\"one-time-code\"` or `\"off\"`.\n *\n * @defaultValue `\"one-time-code\"`\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete\n */\n autoComplete?: AutoComplete;\n /**\n * Whether or not the first fillable input should be focused on page-load.\n *\n * @defaultValue `false`\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autofocus\n */\n autoFocus?: boolean;\n /**\n * Whether or not the component should attempt to automatically submit when\n * all fields are filled. If the field is associated with an HTML `form`\n * element, the form's `requestSubmit` method will be called.\n *\n * @defaultValue `false`\n */\n autoSubmit?: boolean;\n /**\n * The initial value of the uncontrolled field.\n */\n defaultValue?: string;\n /**\n * Indicates the horizontal directionality of the parent element's text.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir\n */\n dir?: RovingFocusGroupProps['dir'];\n /**\n * Whether or not the the field's input elements are disabled.\n */\n disabled?: boolean;\n /**\n * A string specifying the `form` element with which the input is associated.\n * This string's value, if present, must match the id of a `form` element in\n * the same document.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form\n */\n form?: string | undefined;\n /**\n * A string specifying a name for the input control. This name is submitted\n * along with the control's value when the form data is submitted.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name\n */\n name?: string | undefined;\n /**\n * When the `autoSubmit` prop is set to `true`, this callback will be fired\n * before attempting to submit the associated form. It will be called whether\n * or not a form is located, or if submission is not allowed.\n */\n onAutoSubmit?: (value: string) => void;\n /**\n * A callback fired when the field's value changes. When the component is\n * controlled, this should update the state passed to the `value` prop.\n */\n onValueChange?: (value: string) => void;\n /**\n * Indicates the vertical directionality of the input elements.\n *\n * @defaultValue `\"horizontal\"`\n */\n orientation?: RovingFocusGroupProps['orientation'];\n /**\n * Defines the text displayed in a form control when the control has no value.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder\n */\n placeholder?: string | undefined;\n /**\n * Whether or not the input elements can be updated by the user.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/readonly\n */\n readOnly?: boolean;\n /**\n * Function for custom sanitization when `validationType` is set to `\"none\"`.\n * This function will be called before updating values in response to user\n * interactions.\n */\n sanitizeValue?: (value: string) => string;\n /**\n * The input type of the field's input elements. Can be `\"password\"` or `\"text\"`.\n */\n type?: InputType;\n /**\n * Specifies the type of input validation to be used. Can be `\"alpha\"`,\n * `\"numeric\"`, `\"alphanumeric\"` or `\"none\"`.\n *\n * @defaultValue `\"numeric\"`\n */\n validationType?: InputValidationType;\n /**\n * The controlled value of the field.\n */\n value?: string;\n}\n\ntype ScopedProps

= P & { __scopeOneTimePasswordField?: Scope };\n\ninterface OneTimePasswordFieldProps\n extends\n OneTimePasswordFieldOwnProps,\n Omit, keyof OneTimePasswordFieldOwnProps> {}\n\nconst OneTimePasswordField = React.forwardRef(\n function OneTimePasswordFieldImpl(\n {\n __scopeOneTimePasswordField,\n defaultValue,\n value: valueProp,\n onValueChange,\n autoSubmit = false,\n children,\n onPaste,\n onAutoSubmit,\n disabled = false,\n readOnly = false,\n autoComplete = 'one-time-code',\n autoFocus = false,\n form,\n name,\n placeholder,\n type = 'text',\n // TODO: Change default to vertical when inputs use vertical writing mode\n orientation = 'horizontal',\n dir,\n validationType = 'numeric',\n sanitizeValue: sanitizeValueProp,\n ...domProps\n }: ScopedProps,\n forwardedRef,\n ) {\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField);\n const direction = useDirection(dir);\n const collectionState = useInitCollection();\n const [collection] = collectionState;\n\n const validation = INPUT_VALIDATION_MAP[validationType]\n ? INPUT_VALIDATION_MAP[validationType as keyof InputValidation]\n : null;\n\n const sanitizeValue = React.useCallback(\n (value: string | string[]) => {\n if (Array.isArray(value)) {\n value = value.map(removeWhitespace).join('');\n } else {\n value = removeWhitespace(value);\n }\n\n if (validation) {\n // global regexp is stateful, so we clone it for each call\n const regexp = new RegExp(validation.regexp);\n value = value.replace(regexp, '');\n } else if (sanitizeValueProp) {\n value = sanitizeValueProp(value);\n }\n\n return value.split('');\n },\n [validation, sanitizeValueProp],\n );\n\n const controlledValue = React.useMemo(() => {\n return valueProp != null ? sanitizeValue(valueProp) : undefined;\n }, [valueProp, sanitizeValue]);\n\n const [value, setValue] = useControllableState({\n caller: 'OneTimePasswordField',\n prop: controlledValue,\n defaultProp: defaultValue != null ? sanitizeValue(defaultValue) : [],\n onChange: React.useCallback(\n (value: string[]) => onValueChange?.(value.join('')),\n [onValueChange],\n ),\n });\n\n // Use a ref so dispatch always reads the latest value without needing\n // value in its dependency array (which would change its identity every\n // keystroke and cause cascading effect re-runs).\n const latestValueRef = React.useRef(value);\n latestValueRef.current = value;\n\n // Update function *specifically* for event handlers.\n const dispatch = React.useCallback(\n (action) => {\n const value = latestValueRef.current;\n switch (action.type) {\n case 'SET_CHAR': {\n const { index, char } = action;\n const currentTarget = collection.at(index)?.element;\n if (value[index] === char) {\n const next = currentTarget && collection.from(currentTarget, 1)?.element;\n focusInput(next);\n return;\n }\n\n // empty values should be handled in the CLEAR_CHAR action\n if (char === '') {\n return;\n }\n\n if (validation) {\n const regexp = new RegExp(validation.regexp);\n const clean = char.replace(regexp, '');\n if (clean !== char) {\n // not valid; ignore\n return;\n }\n }\n\n // no more space\n if (value.length >= collection.size) {\n // replace current value; move to next input\n const newValue = [...value];\n newValue[index] = char;\n flushSync(() => setValue(newValue));\n const next = currentTarget && collection.from(currentTarget, 1)?.element;\n focusInput(next);\n return;\n }\n\n const newValue = [...value];\n newValue[index] = char;\n\n const lastElement = collection.at(-1)?.element;\n flushSync(() => setValue(newValue));\n if (currentTarget !== lastElement) {\n const next = currentTarget && collection.from(currentTarget, 1)?.element;\n focusInput(next);\n } else {\n currentTarget?.select();\n }\n return;\n }\n\n case 'CLEAR_CHAR': {\n const { index, reason } = action;\n if (!value[index]) {\n return;\n }\n\n const newValue = value.filter((_, i) => i !== index);\n const currentTarget = collection.at(index)?.element;\n const previous = currentTarget && collection.from(currentTarget, -1)?.element;\n\n flushSync(() => setValue(newValue));\n if (reason === 'Backspace') {\n focusInput(previous);\n } else if (reason === 'Delete' || reason === 'Cut') {\n focusInput(currentTarget);\n }\n return;\n }\n\n case 'CLEAR': {\n if (value.length === 0) {\n return;\n }\n\n if (action.reason === 'Backspace' || action.reason === 'Delete') {\n flushSync(() => setValue([]));\n focusInput(collection.at(0)?.element);\n } else {\n setValue([]);\n }\n return;\n }\n\n case 'PASTE': {\n const { value: pastedValue } = action;\n const sanitizedValue = sanitizeValue(pastedValue);\n if (!sanitizedValue) {\n return;\n }\n\n const value = sanitizedValue.slice(0, collection.size);\n\n flushSync(() => setValue(value));\n focusInput(collection.at(value.length - 1)?.element);\n return;\n }\n }\n },\n [collection, sanitizeValue, setValue, validation],\n );\n\n // re-validate when the validation type changes\n const validationTypeRef = React.useRef(validation);\n React.useEffect(() => {\n if (!validation) {\n return;\n }\n\n if (validationTypeRef.current?.type !== validation.type) {\n validationTypeRef.current = validation;\n setValue(sanitizeValue(value.join('')));\n }\n }, [sanitizeValue, setValue, validation, value]);\n\n const hiddenInputRef = React.useRef(null);\n\n const userActionRef = React.useRef(null);\n const rootRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, rootRef);\n\n const firstInput = collection.at(0)?.element;\n const locateForm = React.useCallback(() => {\n let formElement: HTMLFormElement | null | undefined;\n if (form) {\n const associatedElement = (rootRef.current?.ownerDocument ?? document).getElementById(form);\n if (isFormElement(associatedElement)) {\n formElement = associatedElement;\n }\n } else if (hiddenInputRef.current) {\n formElement = hiddenInputRef.current.form;\n } else if (firstInput) {\n formElement = firstInput.form;\n }\n\n return formElement ?? null;\n }, [form, firstInput]);\n\n const attemptSubmit = React.useCallback(() => {\n const formElement = locateForm();\n formElement?.requestSubmit();\n }, [locateForm]);\n\n React.useEffect(() => {\n const form = locateForm();\n if (form) {\n const reset = () => dispatch({ type: 'CLEAR', reason: 'Reset' });\n form.addEventListener('reset', reset);\n return () => form.removeEventListener('reset', reset);\n }\n }, [dispatch, locateForm]);\n\n const currentValue = value.join('');\n const valueRef = React.useRef(currentValue);\n const length = collection.size;\n React.useEffect(() => {\n const previousValue = valueRef.current;\n valueRef.current = currentValue;\n if (previousValue === currentValue) {\n return;\n }\n\n if (autoSubmit && value.every((char) => char !== '') && value.length === length) {\n onAutoSubmit?.(value.join(''));\n attemptSubmit();\n }\n }, [attemptSubmit, autoSubmit, currentValue, length, onAutoSubmit, value]);\n const isHydrated = useIsHydrated();\n\n return (\n \n \n \n \n ) => {\n event.preventDefault();\n const pastedValue = event.clipboardData.getData('text/plain');\n dispatch({ type: 'PASTE', value: pastedValue });\n },\n )}\n >\n {children}\n \n \n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordFieldHiddenInput\n * -----------------------------------------------------------------------------------------------*/\n\ninterface OneTimePasswordFieldHiddenInputProps extends Omit<\n React.ComponentProps<'input'>,\n | keyof 'value'\n | 'defaultValue'\n | 'type'\n | 'onChange'\n | 'readOnly'\n | 'disabled'\n | 'autoComplete'\n | 'autoFocus'\n> {}\n\nconst OneTimePasswordFieldHiddenInput = React.forwardRef<\n HTMLInputElement,\n OneTimePasswordFieldHiddenInputProps\n>(function OneTimePasswordFieldHiddenInput(\n { __scopeOneTimePasswordField, ...props }: ScopedProps,\n forwardedRef,\n) {\n const { value, hiddenInputRef, name } = useOneTimePasswordFieldContext(\n 'OneTimePasswordFieldHiddenInput',\n __scopeOneTimePasswordField,\n );\n const ref = useComposedRefs(hiddenInputRef, forwardedRef);\n return (\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * OneTimePasswordFieldInput\n * -----------------------------------------------------------------------------------------------*/\n\ninterface OneTimePasswordFieldInputProps extends Omit<\n Primitive.PrimitivePropsWithRef<'input'>,\n | 'value'\n | 'defaultValue'\n | 'disabled'\n | 'readOnly'\n | 'autoComplete'\n | 'autoFocus'\n | 'form'\n | 'name'\n | 'placeholder'\n | 'type'\n> {\n /**\n * Callback fired when the user input fails native HTML input validation.\n */\n onInvalidChange?: (character: string) => void;\n /**\n * User-provided index to determine the order of the inputs. This is useful if\n * you need certain index-based attributes to be set on the initial render,\n * often to prevent flickering after hydration.\n */\n index?: number;\n}\n\nconst OneTimePasswordFieldInput = React.forwardRef<\n HTMLInputElement,\n OneTimePasswordFieldInputProps\n>(function OneTimePasswordFieldInput(\n {\n __scopeOneTimePasswordField,\n onInvalidChange,\n index: indexProp,\n ...props\n }: ScopedProps,\n forwardedRef,\n) {\n // TODO: warn if these values are passed\n const {\n value: _value,\n defaultValue: _defaultValue,\n disabled: _disabled,\n readOnly: _readOnly,\n autoComplete: _autoComplete,\n autoFocus: _autoFocus,\n form: _form,\n name: _name,\n placeholder: _placeholder,\n type: _type,\n ...domProps\n } = props as Primitive.PrimitivePropsWithRef<'input'>;\n\n const context = useOneTimePasswordFieldContext(\n 'OneTimePasswordFieldInput',\n __scopeOneTimePasswordField,\n );\n const { dispatch, userActionRef, validationType, isHydrated, disabled } = context;\n const collection = useCollection(__scopeOneTimePasswordField);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField);\n\n const inputRef = React.useRef(null);\n const [element, setElement] = React.useState(null);\n\n const index = indexProp ?? (element ? collection.indexOf(element) : -1);\n const canSetPlaceholder = indexProp != null || isHydrated;\n let placeholder: string | undefined;\n if (canSetPlaceholder && context.placeholder && context.value.length === 0) {\n // only set placeholder after hydration to prevent flickering when indices\n // are re-calculated\n placeholder = context.placeholder[index];\n }\n\n const composedInputRef = useComposedRefs(forwardedRef, inputRef, setElement);\n const char = context.value[index] ?? '';\n\n const keyboardActionTimeoutRef = React.useRef(null);\n React.useEffect(() => {\n return () => {\n if (keyboardActionTimeoutRef.current) {\n window.clearTimeout(keyboardActionTimeoutRef.current);\n }\n };\n }, []);\n\n const totalValue = context.value.join('').trim();\n const lastSelectableIndex = clamp(totalValue.length, [0, collection.size - 1]);\n const isFocusable = index <= lastSelectableIndex;\n\n const validation =\n validationType in INPUT_VALIDATION_MAP\n ? INPUT_VALIDATION_MAP[validationType as keyof InputValidation]\n : undefined;\n\n return (\n \n \n {({ hasTabStop, isCurrentTabStop }) => {\n const supportsAutoComplete = hasTabStop ? isCurrentTabStop : index === 0;\n return (\n {\n event.currentTarget.select();\n })}\n onCut={composeEventHandlers(props.onCut, (event) => {\n const currentValue = event.currentTarget.value;\n if (currentValue !== '') {\n // In this case the value will be cleared, but we don't want to\n // set it directly because the user may want to prevent default\n // behavior in the onChange handler. The userActionRef will\n // be set temporarily so the change handler can behave correctly\n // in response to the action.\n userActionRef.current = { type: 'cut' };\n // Set a short timeout to clear the action tracker after the change\n // handler has had time to complete.\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n })}\n onInput={composeEventHandlers(props.onInput, (event) => {\n const value = event.currentTarget.value;\n if (value.length > 1) {\n // Password managers may try to insert the code into a single\n // input, in which case form validation will fail to prevent\n // additional input. Handle this the same as if a user were\n // pasting a value.\n event.preventDefault();\n userActionRef.current = { type: 'autocomplete-paste' };\n dispatch({ type: 'PASTE', value });\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n })}\n onChange={composeEventHandlers(props.onChange, (event) => {\n const value = event.target.value;\n event.preventDefault();\n const action = userActionRef.current;\n userActionRef.current = null;\n\n if (action) {\n switch (action.type) {\n case 'cut':\n // TODO: do we want to assume the user wants to clear the\n // entire value here and copy the code to the clipboard instead\n // of just the value of the given input?\n dispatch({ type: 'CLEAR_CHAR', index, reason: 'Cut' });\n return;\n case 'autocomplete-paste':\n // the PASTE handler will already set the value and focus the final\n // input; we want to skip focusing the wrong element if the browser fires\n // onChange for the first input. This sometimes happens during autocomplete.\n return;\n case 'keydown': {\n if (action.key === 'Char') {\n // update resulting from a keydown event that set a value\n // directly. Ignore.\n return;\n }\n\n const isClearing =\n action.key === 'Backspace' && (action.metaKey || action.ctrlKey);\n if (action.key === 'Clear' || isClearing) {\n dispatch({ type: 'CLEAR', reason: 'Backspace' });\n } else {\n dispatch({ type: 'CLEAR_CHAR', index, reason: action.key });\n }\n return;\n }\n default:\n action satisfies never;\n return;\n }\n }\n\n // Only update the value if it matches the input pattern\n if (event.target.validity.valid) {\n if (value === '') {\n let reason: 'Backspace' | 'Delete' | 'Cut' = 'Backspace';\n if (isInputEvent(event.nativeEvent)) {\n const inputType = event.nativeEvent.inputType;\n if (inputType === 'deleteContentBackward') {\n reason = 'Backspace';\n } else if (inputType === 'deleteByCut') {\n reason = 'Cut';\n }\n }\n dispatch({ type: 'CLEAR_CHAR', index, reason });\n } else {\n dispatch({ type: 'SET_CHAR', char: value, index, event });\n }\n } else {\n const element = event.target;\n onInvalidChange?.(element.value);\n requestAnimationFrame(() => {\n if (element.ownerDocument.activeElement === element) {\n element.select();\n }\n });\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n switch (event.key) {\n case 'Clear':\n case 'Delete':\n case 'Backspace': {\n const currentValue = event.currentTarget.value;\n // if current value is empty, no change event will fire\n if (currentValue === '') {\n // if the user presses delete when there is no value, noop\n if (event.key === 'Delete') return;\n\n const isClearing = event.key === 'Clear' || event.metaKey || event.ctrlKey;\n if (isClearing) {\n dispatch({ type: 'CLEAR', reason: 'Backspace' });\n } else {\n const element = event.currentTarget;\n requestAnimationFrame(() => {\n focusInput(collection.from(element, -1)?.element);\n });\n }\n } else {\n // In this case the value will be cleared, but we don't want\n // to set it directly because the user may want to prevent\n // default behavior in the onChange handler. The userActionRef\n // will is set temporarily so the change handler can behave\n // correctly in response to the key vs. clearing the value by\n // setting state externally.\n userActionRef.current = {\n type: 'keydown',\n key: event.key,\n metaKey: event.metaKey,\n ctrlKey: event.ctrlKey,\n };\n // Set a short timeout to clear the action tracker after the change\n // handler has had time to complete.\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n\n return;\n }\n case 'Enter': {\n event.preventDefault();\n context.attemptSubmit();\n return;\n }\n case 'ArrowDown':\n case 'ArrowUp': {\n if (context.orientation === 'horizontal') {\n // in horizontal orientation, the up/down will de-select the\n // input instead of moving focus\n event.preventDefault();\n }\n return;\n }\n // TODO: Handle left/right arrow keys in vertical writing mode\n default: {\n if (event.currentTarget.value === event.key) {\n // if current value is same as the key press, no change event\n // will fire. Focus the next input.\n const element = event.currentTarget;\n event.preventDefault();\n focusInput(collection.from(element, 1)?.element);\n return;\n } else if (\n // input already has a value, but...\n event.currentTarget.value &&\n // the value is not selected\n !(\n event.currentTarget.selectionStart === 0 &&\n event.currentTarget.selectionEnd != null &&\n event.currentTarget.selectionEnd > 0\n )\n ) {\n const attemptedValue = event.key;\n if (event.key.length > 1 || event.key === ' ') {\n // not a character; do nothing\n return;\n } else {\n // user is attempting to enter a character, but the input\n // will not update by default since it's limited to a single\n // character.\n const nextInput = collection.from(event.currentTarget, 1)?.element;\n const lastInput = collection.at(-1)?.element;\n if (nextInput !== lastInput && event.currentTarget !== lastInput) {\n // if selection is before the value, set the value of the\n // current input. Otherwise set the value of the next\n // input.\n if (event.currentTarget.selectionStart === 0) {\n dispatch({ type: 'SET_CHAR', char: attemptedValue, index, event });\n } else {\n dispatch({\n type: 'SET_CHAR',\n char: attemptedValue,\n index: index + 1,\n event,\n });\n }\n\n userActionRef.current = {\n type: 'keydown',\n key: 'Char',\n metaKey: event.metaKey,\n ctrlKey: event.ctrlKey,\n };\n keyboardActionTimeoutRef.current = window.setTimeout(() => {\n userActionRef.current = null;\n }, 10);\n }\n }\n }\n }\n }\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n event.preventDefault();\n const indexToFocus = Math.min(index, lastSelectableIndex);\n const element = collection.at(indexToFocus)?.element;\n focusInput(element);\n })}\n />\n );\n }}\n \n \n );\n});\n\nexport {\n OneTimePasswordField,\n OneTimePasswordFieldInput,\n OneTimePasswordFieldHiddenInput,\n //\n OneTimePasswordField as Root,\n OneTimePasswordFieldInput as Input,\n OneTimePasswordFieldHiddenInput as HiddenInput,\n};\nexport type {\n OneTimePasswordFieldProps,\n OneTimePasswordFieldInputProps,\n OneTimePasswordFieldHiddenInputProps,\n InputValidationType,\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isFormElement(element: Element | null | undefined): element is HTMLFormElement {\n return element?.tagName === 'FORM';\n}\n\nfunction removeWhitespace(value: string) {\n return value.replace(/\\s/g, '');\n}\n\nfunction focusInput(element: HTMLInputElement | null | undefined) {\n if (!element) return;\n if (element.ownerDocument.activeElement === element) {\n // if the element is already focused, select the value in the next\n // animation frame\n window.requestAnimationFrame(() => {\n element.select?.();\n });\n } else {\n element.focus();\n }\n}\n\nfunction isInputEvent(event: Event): event is InputEvent {\n return event.type === 'input';\n}\n\ntype InputType = 'password' | 'text';\ntype AutoComplete = 'off' | 'one-time-code';\ntype KeyboardActionDetails =\n | {\n type: 'keydown';\n key: 'Backspace' | 'Delete' | 'Clear' | 'Char';\n metaKey: boolean;\n ctrlKey: boolean;\n }\n | { type: 'cut' }\n | { type: 'autocomplete-paste' };\n\ntype UpdateAction =\n | {\n type: 'SET_CHAR';\n char: string;\n index: number;\n event: React.KeyboardEvent | React.ChangeEvent;\n }\n | { type: 'CLEAR_CHAR'; index: number; reason: 'Backspace' | 'Delete' | 'Cut' }\n | { type: 'CLEAR'; reason: 'Reset' | 'Backspace' | 'Delete' | 'Clear' }\n | { type: 'PASTE'; value: string };\ntype Dispatcher = React.Dispatch;\ntype InputValidation = Record<\n InputValidationType,\n {\n type: InputValidationType;\n regexp: RegExp;\n pattern: string;\n inputMode: 'text' | 'numeric';\n } | null\n>;\n"], + "mappings": ";;;AAAA,YAAY,eAAe;AAC3B,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,6BAA6B,wBAAwB;AAC9D,YAAY,sBAAsB;AAClC,SAAS,mCAAmC;AAC5C,SAAS,qBAAqB;AAC9B,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAE1B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AA4cR;AAxcd,IAAM,uBAAuB;AAAA,EAC3B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AACR;AA4BA,IAAM,+BAA+B;AACrC,IAAM,CAAC,YAAY,EAAE,eAAe,uBAAuB,kBAAkB,C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MAAM;AAAA,EAChB;AACF;AAEA,SAAS,aAAa,OAAmC;AACvD,SAAO,MAAM,SAAS;AACxB;", + "names": ["value", "newValue", "form", "OneTimePasswordFieldHiddenInput", "OneTimePasswordFieldInput", "element"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/package.json new file mode 100644 index 0000000000000000000000000000000000000000..20acecc0e71b3f28c6a07a6e1c741668f99a9ccc --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/package.json @@ -0,0 +1,80 @@ +{ + "name": "@radix-ui/react-one-time-password-field", + "version": "0.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "src", + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-collection": "1.1.10", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/number": "1.1.2", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-use-effect-event": "0.0.3", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-roving-focus": "1.1.13", + "@radix-ui/react-use-is-hydrated": "0.1.1", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/one-time-password-field" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/index.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..548cc70a99e29bffc7391f97e7227c54bf7cfccd --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/index.ts @@ -0,0 +1,16 @@ +'use client'; +export type { + OneTimePasswordFieldProps, + OneTimePasswordFieldInputProps, + OneTimePasswordFieldHiddenInputProps, + InputValidationType, +} from './one-time-password-field'; +export { + OneTimePasswordField, + OneTimePasswordFieldInput, + OneTimePasswordFieldHiddenInput, + // + Root, + Input, + HiddenInput, +} from './one-time-password-field'; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/one-time-password-field.test.tsx b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/one-time-password-field.test.tsx new file mode 100644 index 0000000000000000000000000000000000000000..bf1f287b85443a248ad866f0a74bb6afcbe33979 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/one-time-password-field.test.tsx @@ -0,0 +1,118 @@ +import { axe } from 'vitest-axe'; +import type { RenderResult } from '@testing-library/react'; +import { act, cleanup, render, screen } from '@testing-library/react'; +import * as OneTimePasswordField from './one-time-password-field'; +import { afterEach, describe, it, beforeEach, expect } from 'vitest'; +import { userEvent, type UserEvent } from '@testing-library/user-event'; + +describe('given a default OneTimePasswordField', () => { + let rendered: RenderResult; + let user: UserEvent; + + afterEach(cleanup); + + beforeEach(() => { + user = userEvent.setup(); + rendered = render( + + + + + + + + + , + ); + }); + + afterEach(cleanup); + + it('should have no accessibility violations', async () => { + expect(await axe(rendered.container)).toHaveNoViolations(); + }); + + it('should mask input value when type is password', async () => { + rendered.rerender( + + + + , + ); + + const input = rendered.container.querySelector( + 'input:not([type="hidden"])', + ) as HTMLInputElement; + + await userEvent.type(input, '1'); + expect(input.type).toBe('password'); + + const hiddenInput = rendered.container.querySelector( + 'input[type="hidden"]', + ) as HTMLInputElement; + expect(hiddenInput.value).toBe('1'); + }); + + it('should disable all inputs when Root is disabled', () => { + rendered.rerender( + + + + + , + ); + + const inputs = rendered.container.querySelectorAll('input:not([type="hidden"])'); + inputs.forEach((input) => { + expect(input).toBeDisabled(); + }); + }); + + it('should type digits and advance focus', async () => { + const inputs = screen.getAllByRole('textbox', { hidden: false }); + await user.click(inputs[0]!); + await user.keyboard('1'); + expect(inputs[0]!.value).toBe('1'); + // focus should have moved to second input + expect(document.activeElement).toBe(inputs[1]); + await user.keyboard('2'); + expect(inputs[1]!.value).toBe('2'); + expect(document.activeElement).toBe(inputs[2]); + }); + + it('should navigate with arrow keys', async () => { + const inputs = screen.getAllByRole('textbox', { hidden: false }); + await user.click(inputs[0]!); + await user.keyboard('1'); + // now on input 1 + expect(document.activeElement).toBe(inputs[1]); + await user.keyboard('{ArrowLeft}'); + expect(document.activeElement).toBe(inputs[0]); + await user.keyboard('{ArrowRight}'); + expect(document.activeElement).toBe(inputs[1]); + }); + + it('pastes the code into the input', async () => { + const inputs = screen.getAllByRole('textbox', { + hidden: false, + }); + const firstInput = inputs[0]!; + await user.click(firstInput); + await act(async () => await user.paste('1,2,3,4,5,6')); + expect(getInputValues(inputs)).toBe('1,2,3,4,5,6'); + }); + + it('should truncate pasted characters to the number of inputs', async () => { + const inputs = screen.getAllByRole('textbox', { + hidden: false, + }); + const firstInput = inputs[0]!; + await user.click(firstInput); + await act(async () => await user.paste('123456789')); + expect(getInputValues(inputs)).toBe('1,2,3,4,5,6'); + }); +}); + +function getInputValues(inputs: HTMLInputElement[]) { + return inputs.map((input) => input.value).join(','); +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/one-time-password-field.tsx b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/one-time-password-field.tsx new file mode 100644 index 0000000000000000000000000000000000000000..af24f98ce7d39a34014df2156f0c2b4e085c5028 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-one-time-password-field/src/one-time-password-field.tsx @@ -0,0 +1,974 @@ +import * as Primitive from '@radix-ui/react-primitive'; +import { useComposedRefs } from '@radix-ui/react-compose-refs'; +import { useControllableState } from '@radix-ui/react-use-controllable-state'; +import { composeEventHandlers } from '@radix-ui/primitive'; +import { unstable_createCollection as createCollection } from '@radix-ui/react-collection'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; +import { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus'; +import { useIsHydrated } from '@radix-ui/react-use-is-hydrated'; +import * as React from 'react'; +import { flushSync } from 'react-dom'; +import type { Scope } from '@radix-ui/react-context'; +import { createContextScope } from '@radix-ui/react-context'; +import { useDirection } from '@radix-ui/react-direction'; +import { clamp } from '@radix-ui/number'; + +type InputValidationType = 'alpha' | 'numeric' | 'alphanumeric' | 'none'; + +const INPUT_VALIDATION_MAP = { + numeric: { + type: 'numeric', + regexp: /[^\d]/g, + pattern: '\\d{1}', + inputMode: 'numeric', + }, + alpha: { + type: 'alpha', + regexp: /[^a-zA-Z]/g, + pattern: '[a-zA-Z]{1}', + inputMode: 'text', + }, + alphanumeric: { + type: 'alphanumeric', + regexp: /[^a-zA-Z0-9]/g, + pattern: '[a-zA-Z0-9]{1}', + inputMode: 'text', + }, + none: null, +} satisfies InputValidation; + +/* ------------------------------------------------------------------------------------------------- + * OneTimePasswordFieldProvider + * -----------------------------------------------------------------------------------------------*/ + +type RovingFocusGroupProps = RovingFocusGroup.RovingFocusGroupProps; + +interface OneTimePasswordFieldContextValue { + attemptSubmit: () => void; + autoComplete: AutoComplete; + autoFocus: boolean; + disabled: boolean; + dispatch: Dispatcher; + form: string | undefined; + hiddenInputRef: React.RefObject; + isHydrated: boolean; + name: string | undefined; + orientation: Exclude; + placeholder: string | undefined; + readOnly: boolean; + type: InputType; + userActionRef: React.RefObject; + validationType: InputValidationType; + value: string[]; + sanitizeValue: (arg: string | string[]) => string[]; +} + +const ONE_TIME_PASSWORD_FIELD_NAME = 'OneTimePasswordField'; +const [Collection, { useCollection, createCollectionScope, useInitCollection }] = + createCollection(ONE_TIME_PASSWORD_FIELD_NAME); +const [createOneTimePasswordFieldContext] = createContextScope(ONE_TIME_PASSWORD_FIELD_NAME, [ + createCollectionScope, + createRovingFocusGroupScope, +]); +const useRovingFocusGroupScope = createRovingFocusGroupScope(); + +const [OneTimePasswordFieldContext, useOneTimePasswordFieldContext] = + createOneTimePasswordFieldContext(ONE_TIME_PASSWORD_FIELD_NAME); + +/* ------------------------------------------------------------------------------------------------- + * OneTimePasswordField + * -----------------------------------------------------------------------------------------------*/ + +interface OneTimePasswordFieldOwnProps { + /** + * Specifies what—if any—permission the user agent has to provide automated + * assistance in filling out form field values, as well as guidance to the + * browser as to the type of information expected in the field. Allows + * `"one-time-code"` or `"off"`. + * + * @defaultValue `"one-time-code"` + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete + */ + autoComplete?: AutoComplete; + /** + * Whether or not the first fillable input should be focused on page-load. + * + * @defaultValue `false` + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/autofocus + */ + autoFocus?: boolean; + /** + * Whether or not the component should attempt to automatically submit when + * all fields are filled. If the field is associated with an HTML `form` + * element, the form's `requestSubmit` method will be called. + * + * @defaultValue `false` + */ + autoSubmit?: boolean; + /** + * The initial value of the uncontrolled field. + */ + defaultValue?: string; + /** + * Indicates the horizontal directionality of the parent element's text. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir + */ + dir?: RovingFocusGroupProps['dir']; + /** + * Whether or not the the field's input elements are disabled. + */ + disabled?: boolean; + /** + * A string specifying the `form` element with which the input is associated. + * This string's value, if present, must match the id of a `form` element in + * the same document. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form + */ + form?: string | undefined; + /** + * A string specifying a name for the input control. This name is submitted + * along with the control's value when the form data is submitted. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name + */ + name?: string | undefined; + /** + * When the `autoSubmit` prop is set to `true`, this callback will be fired + * before attempting to submit the associated form. It will be called whether + * or not a form is located, or if submission is not allowed. + */ + onAutoSubmit?: (value: string) => void; + /** + * A callback fired when the field's value changes. When the component is + * controlled, this should update the state passed to the `value` prop. + */ + onValueChange?: (value: string) => void; + /** + * Indicates the vertical directionality of the input elements. + * + * @defaultValue `"horizontal"` + */ + orientation?: RovingFocusGroupProps['orientation']; + /** + * Defines the text displayed in a form control when the control has no value. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder + */ + placeholder?: string | undefined; + /** + * Whether or not the input elements can be updated by the user. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/readonly + */ + readOnly?: boolean; + /** + * Function for custom sanitization when `validationType` is set to `"none"`. + * This function will be called before updating values in response to user + * interactions. + */ + sanitizeValue?: (value: string) => string; + /** + * The input type of the field's input elements. Can be `"password"` or `"text"`. + */ + type?: InputType; + /** + * Specifies the type of input validation to be used. Can be `"alpha"`, + * `"numeric"`, `"alphanumeric"` or `"none"`. + * + * @defaultValue `"numeric"` + */ + validationType?: InputValidationType; + /** + * The controlled value of the field. + */ + value?: string; +} + +type ScopedProps

= P & { __scopeOneTimePasswordField?: Scope }; + +interface OneTimePasswordFieldProps + extends + OneTimePasswordFieldOwnProps, + Omit, keyof OneTimePasswordFieldOwnProps> {} + +const OneTimePasswordField = React.forwardRef( + function OneTimePasswordFieldImpl( + { + __scopeOneTimePasswordField, + defaultValue, + value: valueProp, + onValueChange, + autoSubmit = false, + children, + onPaste, + onAutoSubmit, + disabled = false, + readOnly = false, + autoComplete = 'one-time-code', + autoFocus = false, + form, + name, + placeholder, + type = 'text', + // TODO: Change default to vertical when inputs use vertical writing mode + orientation = 'horizontal', + dir, + validationType = 'numeric', + sanitizeValue: sanitizeValueProp, + ...domProps + }: ScopedProps, + forwardedRef, + ) { + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField); + const direction = useDirection(dir); + const collectionState = useInitCollection(); + const [collection] = collectionState; + + const validation = INPUT_VALIDATION_MAP[validationType] + ? INPUT_VALIDATION_MAP[validationType as keyof InputValidation] + : null; + + const sanitizeValue = React.useCallback( + (value: string | string[]) => { + if (Array.isArray(value)) { + value = value.map(removeWhitespace).join(''); + } else { + value = removeWhitespace(value); + } + + if (validation) { + // global regexp is stateful, so we clone it for each call + const regexp = new RegExp(validation.regexp); + value = value.replace(regexp, ''); + } else if (sanitizeValueProp) { + value = sanitizeValueProp(value); + } + + return value.split(''); + }, + [validation, sanitizeValueProp], + ); + + const controlledValue = React.useMemo(() => { + return valueProp != null ? sanitizeValue(valueProp) : undefined; + }, [valueProp, sanitizeValue]); + + const [value, setValue] = useControllableState({ + caller: 'OneTimePasswordField', + prop: controlledValue, + defaultProp: defaultValue != null ? sanitizeValue(defaultValue) : [], + onChange: React.useCallback( + (value: string[]) => onValueChange?.(value.join('')), + [onValueChange], + ), + }); + + // Use a ref so dispatch always reads the latest value without needing + // value in its dependency array (which would change its identity every + // keystroke and cause cascading effect re-runs). + const latestValueRef = React.useRef(value); + latestValueRef.current = value; + + // Update function *specifically* for event handlers. + const dispatch = React.useCallback( + (action) => { + const value = latestValueRef.current; + switch (action.type) { + case 'SET_CHAR': { + const { index, char } = action; + const currentTarget = collection.at(index)?.element; + if (value[index] === char) { + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + return; + } + + // empty values should be handled in the CLEAR_CHAR action + if (char === '') { + return; + } + + if (validation) { + const regexp = new RegExp(validation.regexp); + const clean = char.replace(regexp, ''); + if (clean !== char) { + // not valid; ignore + return; + } + } + + // no more space + if (value.length >= collection.size) { + // replace current value; move to next input + const newValue = [...value]; + newValue[index] = char; + flushSync(() => setValue(newValue)); + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + return; + } + + const newValue = [...value]; + newValue[index] = char; + + const lastElement = collection.at(-1)?.element; + flushSync(() => setValue(newValue)); + if (currentTarget !== lastElement) { + const next = currentTarget && collection.from(currentTarget, 1)?.element; + focusInput(next); + } else { + currentTarget?.select(); + } + return; + } + + case 'CLEAR_CHAR': { + const { index, reason } = action; + if (!value[index]) { + return; + } + + const newValue = value.filter((_, i) => i !== index); + const currentTarget = collection.at(index)?.element; + const previous = currentTarget && collection.from(currentTarget, -1)?.element; + + flushSync(() => setValue(newValue)); + if (reason === 'Backspace') { + focusInput(previous); + } else if (reason === 'Delete' || reason === 'Cut') { + focusInput(currentTarget); + } + return; + } + + case 'CLEAR': { + if (value.length === 0) { + return; + } + + if (action.reason === 'Backspace' || action.reason === 'Delete') { + flushSync(() => setValue([])); + focusInput(collection.at(0)?.element); + } else { + setValue([]); + } + return; + } + + case 'PASTE': { + const { value: pastedValue } = action; + const sanitizedValue = sanitizeValue(pastedValue); + if (!sanitizedValue) { + return; + } + + const value = sanitizedValue.slice(0, collection.size); + + flushSync(() => setValue(value)); + focusInput(collection.at(value.length - 1)?.element); + return; + } + } + }, + [collection, sanitizeValue, setValue, validation], + ); + + // re-validate when the validation type changes + const validationTypeRef = React.useRef(validation); + React.useEffect(() => { + if (!validation) { + return; + } + + if (validationTypeRef.current?.type !== validation.type) { + validationTypeRef.current = validation; + setValue(sanitizeValue(value.join(''))); + } + }, [sanitizeValue, setValue, validation, value]); + + const hiddenInputRef = React.useRef(null); + + const userActionRef = React.useRef(null); + const rootRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, rootRef); + + const firstInput = collection.at(0)?.element; + const locateForm = React.useCallback(() => { + let formElement: HTMLFormElement | null | undefined; + if (form) { + const associatedElement = (rootRef.current?.ownerDocument ?? document).getElementById(form); + if (isFormElement(associatedElement)) { + formElement = associatedElement; + } + } else if (hiddenInputRef.current) { + formElement = hiddenInputRef.current.form; + } else if (firstInput) { + formElement = firstInput.form; + } + + return formElement ?? null; + }, [form, firstInput]); + + const attemptSubmit = React.useCallback(() => { + const formElement = locateForm(); + formElement?.requestSubmit(); + }, [locateForm]); + + React.useEffect(() => { + const form = locateForm(); + if (form) { + const reset = () => dispatch({ type: 'CLEAR', reason: 'Reset' }); + form.addEventListener('reset', reset); + return () => form.removeEventListener('reset', reset); + } + }, [dispatch, locateForm]); + + const currentValue = value.join(''); + const valueRef = React.useRef(currentValue); + const length = collection.size; + React.useEffect(() => { + const previousValue = valueRef.current; + valueRef.current = currentValue; + if (previousValue === currentValue) { + return; + } + + if (autoSubmit && value.every((char) => char !== '') && value.length === length) { + onAutoSubmit?.(value.join('')); + attemptSubmit(); + } + }, [attemptSubmit, autoSubmit, currentValue, length, onAutoSubmit, value]); + const isHydrated = useIsHydrated(); + + return ( + + + + + ) => { + event.preventDefault(); + const pastedValue = event.clipboardData.getData('text/plain'); + dispatch({ type: 'PASTE', value: pastedValue }); + }, + )} + > + {children} + + + + + + ); + }, +); + +/* ------------------------------------------------------------------------------------------------- + * OneTimePasswordFieldHiddenInput + * -----------------------------------------------------------------------------------------------*/ + +interface OneTimePasswordFieldHiddenInputProps extends Omit< + React.ComponentProps<'input'>, + | keyof 'value' + | 'defaultValue' + | 'type' + | 'onChange' + | 'readOnly' + | 'disabled' + | 'autoComplete' + | 'autoFocus' +> {} + +const OneTimePasswordFieldHiddenInput = React.forwardRef< + HTMLInputElement, + OneTimePasswordFieldHiddenInputProps +>(function OneTimePasswordFieldHiddenInput( + { __scopeOneTimePasswordField, ...props }: ScopedProps, + forwardedRef, +) { + const { value, hiddenInputRef, name } = useOneTimePasswordFieldContext( + 'OneTimePasswordFieldHiddenInput', + __scopeOneTimePasswordField, + ); + const ref = useComposedRefs(hiddenInputRef, forwardedRef); + return ( + + ); +}); + +/* ------------------------------------------------------------------------------------------------- + * OneTimePasswordFieldInput + * -----------------------------------------------------------------------------------------------*/ + +interface OneTimePasswordFieldInputProps extends Omit< + Primitive.PrimitivePropsWithRef<'input'>, + | 'value' + | 'defaultValue' + | 'disabled' + | 'readOnly' + | 'autoComplete' + | 'autoFocus' + | 'form' + | 'name' + | 'placeholder' + | 'type' +> { + /** + * Callback fired when the user input fails native HTML input validation. + */ + onInvalidChange?: (character: string) => void; + /** + * User-provided index to determine the order of the inputs. This is useful if + * you need certain index-based attributes to be set on the initial render, + * often to prevent flickering after hydration. + */ + index?: number; +} + +const OneTimePasswordFieldInput = React.forwardRef< + HTMLInputElement, + OneTimePasswordFieldInputProps +>(function OneTimePasswordFieldInput( + { + __scopeOneTimePasswordField, + onInvalidChange, + index: indexProp, + ...props + }: ScopedProps, + forwardedRef, +) { + // TODO: warn if these values are passed + const { + value: _value, + defaultValue: _defaultValue, + disabled: _disabled, + readOnly: _readOnly, + autoComplete: _autoComplete, + autoFocus: _autoFocus, + form: _form, + name: _name, + placeholder: _placeholder, + type: _type, + ...domProps + } = props as Primitive.PrimitivePropsWithRef<'input'>; + + const context = useOneTimePasswordFieldContext( + 'OneTimePasswordFieldInput', + __scopeOneTimePasswordField, + ); + const { dispatch, userActionRef, validationType, isHydrated, disabled } = context; + const collection = useCollection(__scopeOneTimePasswordField); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeOneTimePasswordField); + + const inputRef = React.useRef(null); + const [element, setElement] = React.useState(null); + + const index = indexProp ?? (element ? collection.indexOf(element) : -1); + const canSetPlaceholder = indexProp != null || isHydrated; + let placeholder: string | undefined; + if (canSetPlaceholder && context.placeholder && context.value.length === 0) { + // only set placeholder after hydration to prevent flickering when indices + // are re-calculated + placeholder = context.placeholder[index]; + } + + const composedInputRef = useComposedRefs(forwardedRef, inputRef, setElement); + const char = context.value[index] ?? ''; + + const keyboardActionTimeoutRef = React.useRef(null); + React.useEffect(() => { + return () => { + if (keyboardActionTimeoutRef.current) { + window.clearTimeout(keyboardActionTimeoutRef.current); + } + }; + }, []); + + const totalValue = context.value.join('').trim(); + const lastSelectableIndex = clamp(totalValue.length, [0, collection.size - 1]); + const isFocusable = index <= lastSelectableIndex; + + const validation = + validationType in INPUT_VALIDATION_MAP + ? INPUT_VALIDATION_MAP[validationType as keyof InputValidation] + : undefined; + + return ( + + + {({ hasTabStop, isCurrentTabStop }) => { + const supportsAutoComplete = hasTabStop ? isCurrentTabStop : index === 0; + return ( + { + event.currentTarget.select(); + })} + onCut={composeEventHandlers(props.onCut, (event) => { + const currentValue = event.currentTarget.value; + if (currentValue !== '') { + // In this case the value will be cleared, but we don't want to + // set it directly because the user may want to prevent default + // behavior in the onChange handler. The userActionRef will + // be set temporarily so the change handler can behave correctly + // in response to the action. + userActionRef.current = { type: 'cut' }; + // Set a short timeout to clear the action tracker after the change + // handler has had time to complete. + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + })} + onInput={composeEventHandlers(props.onInput, (event) => { + const value = event.currentTarget.value; + if (value.length > 1) { + // Password managers may try to insert the code into a single + // input, in which case form validation will fail to prevent + // additional input. Handle this the same as if a user were + // pasting a value. + event.preventDefault(); + userActionRef.current = { type: 'autocomplete-paste' }; + dispatch({ type: 'PASTE', value }); + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + })} + onChange={composeEventHandlers(props.onChange, (event) => { + const value = event.target.value; + event.preventDefault(); + const action = userActionRef.current; + userActionRef.current = null; + + if (action) { + switch (action.type) { + case 'cut': + // TODO: do we want to assume the user wants to clear the + // entire value here and copy the code to the clipboard instead + // of just the value of the given input? + dispatch({ type: 'CLEAR_CHAR', index, reason: 'Cut' }); + return; + case 'autocomplete-paste': + // the PASTE handler will already set the value and focus the final + // input; we want to skip focusing the wrong element if the browser fires + // onChange for the first input. This sometimes happens during autocomplete. + return; + case 'keydown': { + if (action.key === 'Char') { + // update resulting from a keydown event that set a value + // directly. Ignore. + return; + } + + const isClearing = + action.key === 'Backspace' && (action.metaKey || action.ctrlKey); + if (action.key === 'Clear' || isClearing) { + dispatch({ type: 'CLEAR', reason: 'Backspace' }); + } else { + dispatch({ type: 'CLEAR_CHAR', index, reason: action.key }); + } + return; + } + default: + action satisfies never; + return; + } + } + + // Only update the value if it matches the input pattern + if (event.target.validity.valid) { + if (value === '') { + let reason: 'Backspace' | 'Delete' | 'Cut' = 'Backspace'; + if (isInputEvent(event.nativeEvent)) { + const inputType = event.nativeEvent.inputType; + if (inputType === 'deleteContentBackward') { + reason = 'Backspace'; + } else if (inputType === 'deleteByCut') { + reason = 'Cut'; + } + } + dispatch({ type: 'CLEAR_CHAR', index, reason }); + } else { + dispatch({ type: 'SET_CHAR', char: value, index, event }); + } + } else { + const element = event.target; + onInvalidChange?.(element.value); + requestAnimationFrame(() => { + if (element.ownerDocument.activeElement === element) { + element.select(); + } + }); + } + })} + onKeyDown={composeEventHandlers(props.onKeyDown, (event) => { + switch (event.key) { + case 'Clear': + case 'Delete': + case 'Backspace': { + const currentValue = event.currentTarget.value; + // if current value is empty, no change event will fire + if (currentValue === '') { + // if the user presses delete when there is no value, noop + if (event.key === 'Delete') return; + + const isClearing = event.key === 'Clear' || event.metaKey || event.ctrlKey; + if (isClearing) { + dispatch({ type: 'CLEAR', reason: 'Backspace' }); + } else { + const element = event.currentTarget; + requestAnimationFrame(() => { + focusInput(collection.from(element, -1)?.element); + }); + } + } else { + // In this case the value will be cleared, but we don't want + // to set it directly because the user may want to prevent + // default behavior in the onChange handler. The userActionRef + // will is set temporarily so the change handler can behave + // correctly in response to the key vs. clearing the value by + // setting state externally. + userActionRef.current = { + type: 'keydown', + key: event.key, + metaKey: event.metaKey, + ctrlKey: event.ctrlKey, + }; + // Set a short timeout to clear the action tracker after the change + // handler has had time to complete. + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + + return; + } + case 'Enter': { + event.preventDefault(); + context.attemptSubmit(); + return; + } + case 'ArrowDown': + case 'ArrowUp': { + if (context.orientation === 'horizontal') { + // in horizontal orientation, the up/down will de-select the + // input instead of moving focus + event.preventDefault(); + } + return; + } + // TODO: Handle left/right arrow keys in vertical writing mode + default: { + if (event.currentTarget.value === event.key) { + // if current value is same as the key press, no change event + // will fire. Focus the next input. + const element = event.currentTarget; + event.preventDefault(); + focusInput(collection.from(element, 1)?.element); + return; + } else if ( + // input already has a value, but... + event.currentTarget.value && + // the value is not selected + !( + event.currentTarget.selectionStart === 0 && + event.currentTarget.selectionEnd != null && + event.currentTarget.selectionEnd > 0 + ) + ) { + const attemptedValue = event.key; + if (event.key.length > 1 || event.key === ' ') { + // not a character; do nothing + return; + } else { + // user is attempting to enter a character, but the input + // will not update by default since it's limited to a single + // character. + const nextInput = collection.from(event.currentTarget, 1)?.element; + const lastInput = collection.at(-1)?.element; + if (nextInput !== lastInput && event.currentTarget !== lastInput) { + // if selection is before the value, set the value of the + // current input. Otherwise set the value of the next + // input. + if (event.currentTarget.selectionStart === 0) { + dispatch({ type: 'SET_CHAR', char: attemptedValue, index, event }); + } else { + dispatch({ + type: 'SET_CHAR', + char: attemptedValue, + index: index + 1, + event, + }); + } + + userActionRef.current = { + type: 'keydown', + key: 'Char', + metaKey: event.metaKey, + ctrlKey: event.ctrlKey, + }; + keyboardActionTimeoutRef.current = window.setTimeout(() => { + userActionRef.current = null; + }, 10); + } + } + } + } + } + })} + onPointerDown={composeEventHandlers(props.onPointerDown, (event) => { + event.preventDefault(); + const indexToFocus = Math.min(index, lastSelectableIndex); + const element = collection.at(indexToFocus)?.element; + focusInput(element); + })} + /> + ); + }} + + + ); +}); + +export { + OneTimePasswordField, + OneTimePasswordFieldInput, + OneTimePasswordFieldHiddenInput, + // + OneTimePasswordField as Root, + OneTimePasswordFieldInput as Input, + OneTimePasswordFieldHiddenInput as HiddenInput, +}; +export type { + OneTimePasswordFieldProps, + OneTimePasswordFieldInputProps, + OneTimePasswordFieldHiddenInputProps, + InputValidationType, +}; + +/* -----------------------------------------------------------------------------------------------*/ + +function isFormElement(element: Element | null | undefined): element is HTMLFormElement { + return element?.tagName === 'FORM'; +} + +function removeWhitespace(value: string) { + return value.replace(/\s/g, ''); +} + +function focusInput(element: HTMLInputElement | null | undefined) { + if (!element) return; + if (element.ownerDocument.activeElement === element) { + // if the element is already focused, select the value in the next + // animation frame + window.requestAnimationFrame(() => { + element.select?.(); + }); + } else { + element.focus(); + } +} + +function isInputEvent(event: Event): event is InputEvent { + return event.type === 'input'; +} + +type InputType = 'password' | 'text'; +type AutoComplete = 'off' | 'one-time-code'; +type KeyboardActionDetails = + | { + type: 'keydown'; + key: 'Backspace' | 'Delete' | 'Clear' | 'Char'; + metaKey: boolean; + ctrlKey: boolean; + } + | { type: 'cut' } + | { type: 'autocomplete-paste' }; + +type UpdateAction = + | { + type: 'SET_CHAR'; + char: string; + index: number; + event: React.KeyboardEvent | React.ChangeEvent; + } + | { type: 'CLEAR_CHAR'; index: number; reason: 'Backspace' | 'Delete' | 'Cut' } + | { type: 'CLEAR'; reason: 'Reset' | 'Backspace' | 'Delete' | 'Clear' } + | { type: 'PASTE'; value: string }; +type Dispatcher = React.Dispatch; +type InputValidation = Record< + InputValidationType, + { + type: InputValidationType; + regexp: RegExp; + pattern: string; + inputMode: 'text' | 'numeric'; + } | null +>; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e5ccc9ccd909237e60daa51a19a53819205d2833 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/README.md @@ -0,0 +1,13 @@ +# `react-password-toggle-field` + +## Installation + +```sh +$ yarn add radix-ui +# or +$ npm install radix-ui +``` + +## Usage + +View docs [here](https://radix-ui.com/primitives/docs/components/password-toggle-field). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..7572a8cae0d5e07b99c2f4826df8eb82cc513fdb --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.d.mts @@ -0,0 +1,42 @@ +import * as React from 'react'; +import { PrimitivePropsWithRef } from '@radix-ui/react-primitive'; + +interface PasswordToggleFieldProps { + id?: string; + visible?: boolean; + defaultVisible?: boolean; + onVisibilityChange?: (visible: boolean) => void; + children?: React.ReactNode; +} +declare const PasswordToggleField: React.FC; +type PrimitiveInputProps = PrimitivePropsWithRef<'input'>; +interface PasswordToggleFieldOwnProps { + autoComplete?: 'current-password' | 'new-password'; +} +interface PasswordToggleFieldInputProps extends PasswordToggleFieldOwnProps, Omit { + autoComplete?: 'current-password' | 'new-password'; +} +declare const PasswordToggleFieldInput: React.ForwardRefExoticComponent & React.RefAttributes>; +type PrimitiveButtonProps = PrimitivePropsWithRef<'button'>; +interface PasswordToggleFieldToggleProps extends Omit { +} +declare const PasswordToggleFieldToggle: React.ForwardRefExoticComponent & React.RefAttributes>; +interface PasswordToggleFieldSlotDeclarativeProps { + visible: React.ReactNode; + hidden: React.ReactNode; +} +interface PasswordToggleFieldSlotRenderProps { + render: (args: { + visible: boolean; + }) => React.ReactElement; +} +type PasswordToggleFieldSlotProps = PasswordToggleFieldSlotDeclarativeProps | PasswordToggleFieldSlotRenderProps; +declare const PasswordToggleFieldSlot: React.FC; +type PrimitiveSvgProps = PrimitivePropsWithRef<'svg'>; +interface PasswordToggleFieldIconProps extends Omit { + visible: React.ReactElement; + hidden: React.ReactElement; +} +declare const PasswordToggleFieldIcon: React.ForwardRefExoticComponent & React.RefAttributes>; + +export { PasswordToggleFieldIcon as Icon, PasswordToggleFieldInput as Input, PasswordToggleField, PasswordToggleFieldIcon, type PasswordToggleFieldIconProps, PasswordToggleFieldInput, type PasswordToggleFieldInputProps, type PasswordToggleFieldProps, PasswordToggleFieldSlot, type PasswordToggleFieldSlotProps, PasswordToggleFieldToggle, type PasswordToggleFieldToggleProps, PasswordToggleField as Root, PasswordToggleFieldSlot as Slot, PasswordToggleFieldToggle as Toggle }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7572a8cae0d5e07b99c2f4826df8eb82cc513fdb --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.d.ts @@ -0,0 +1,42 @@ +import * as React from 'react'; +import { PrimitivePropsWithRef } from '@radix-ui/react-primitive'; + +interface PasswordToggleFieldProps { + id?: string; + visible?: boolean; + defaultVisible?: boolean; + onVisibilityChange?: (visible: boolean) => void; + children?: React.ReactNode; +} +declare const PasswordToggleField: React.FC; +type PrimitiveInputProps = PrimitivePropsWithRef<'input'>; +interface PasswordToggleFieldOwnProps { + autoComplete?: 'current-password' | 'new-password'; +} +interface PasswordToggleFieldInputProps extends PasswordToggleFieldOwnProps, Omit { + autoComplete?: 'current-password' | 'new-password'; +} +declare const PasswordToggleFieldInput: React.ForwardRefExoticComponent & React.RefAttributes>; +type PrimitiveButtonProps = PrimitivePropsWithRef<'button'>; +interface PasswordToggleFieldToggleProps extends Omit { +} +declare const PasswordToggleFieldToggle: React.ForwardRefExoticComponent & React.RefAttributes>; +interface PasswordToggleFieldSlotDeclarativeProps { + visible: React.ReactNode; + hidden: React.ReactNode; +} +interface PasswordToggleFieldSlotRenderProps { + render: (args: { + visible: boolean; + }) => React.ReactElement; +} +type PasswordToggleFieldSlotProps = PasswordToggleFieldSlotDeclarativeProps | PasswordToggleFieldSlotRenderProps; +declare const PasswordToggleFieldSlot: React.FC; +type PrimitiveSvgProps = PrimitivePropsWithRef<'svg'>; +interface PasswordToggleFieldIconProps extends Omit { + visible: React.ReactElement; + hidden: React.ReactElement; +} +declare const PasswordToggleFieldIcon: React.ForwardRefExoticComponent & React.RefAttributes>; + +export { PasswordToggleFieldIcon as Icon, PasswordToggleFieldInput as Input, PasswordToggleField, PasswordToggleFieldIcon, type PasswordToggleFieldIconProps, PasswordToggleFieldInput, type PasswordToggleFieldInputProps, type PasswordToggleFieldProps, PasswordToggleFieldSlot, type PasswordToggleFieldSlotProps, PasswordToggleFieldToggle, type PasswordToggleFieldToggleProps, PasswordToggleField as Root, PasswordToggleFieldSlot as Slot, PasswordToggleFieldToggle as Toggle }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9fb34ba1efa1e1b66b0cb4600a9e5a493cae2410 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.js @@ -0,0 +1,356 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Icon: () => PasswordToggleFieldIcon, + Input: () => PasswordToggleFieldInput, + PasswordToggleField: () => PasswordToggleField, + PasswordToggleFieldIcon: () => PasswordToggleFieldIcon, + PasswordToggleFieldInput: () => PasswordToggleFieldInput, + PasswordToggleFieldSlot: () => PasswordToggleFieldSlot, + PasswordToggleFieldToggle: () => PasswordToggleFieldToggle, + Root: () => PasswordToggleField, + Slot: () => PasswordToggleFieldSlot, + Toggle: () => PasswordToggleFieldToggle +}); +module.exports = __toCommonJS(index_exports); + +// src/password-toggle-field.tsx +var React = __toESM(require("react")); +var import_react_dom = require("react-dom"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_use_is_hydrated = require("@radix-ui/react-use-is-hydrated"); +var import_react_use_effect_event = require("@radix-ui/react-use-effect-event"); +var import_react_context = require("@radix-ui/react-context"); +var import_jsx_runtime = require("react/jsx-runtime"); +var PASSWORD_TOGGLE_FIELD_NAME = "PasswordToggleField"; +var [createPasswordToggleFieldContext] = (0, import_react_context.createContextScope)(PASSWORD_TOGGLE_FIELD_NAME); +var [PasswordToggleFieldProvider, usePasswordToggleFieldContext] = createPasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_NAME); +var INITIAL_FOCUS_STATE = { + clickTriggered: false, + selectionStart: null, + selectionEnd: null +}; +var PasswordToggleField = ({ + __scopePasswordToggleField, + ...props +}) => { + const baseId = (0, import_react_id.useId)(props.id); + const defaultInputId = `${baseId}-input`; + const [inputIdState, setInputIdState] = React.useState(defaultInputId); + const inputId = inputIdState ?? defaultInputId; + const syncInputId = React.useCallback( + (providedId) => setInputIdState(providedId != null ? String(providedId) : null), + [] + ); + const { visible: visibleProp, defaultVisible, children } = props; + let onVisibilityChange = props.onVisibilityChange; + let shouldWarn = false; + if (!onVisibilityChange && "onVisiblityChange" in props && typeof props.onVisiblityChange === "function") { + shouldWarn = true; + onVisibilityChange = props.onVisiblityChange; + } else { + onVisibilityChange = props.onVisibilityChange; + } + if (true) { + React.useEffect(() => { + if (shouldWarn) { + console.warn( + "PasswordToggleField: The misspelled `onVisiblityChange` prop has been removed. Please use `onVisibilityChange` instead." + ); + } + }, [shouldWarn]); + } + const [visible = false, setVisible] = (0, import_react_use_controllable_state.useControllableState)({ + caller: PASSWORD_TOGGLE_FIELD_NAME, + prop: visibleProp, + defaultProp: defaultVisible ?? false, + onChange: onVisibilityChange + }); + const inputRef = React.useRef(null); + const focusState = React.useRef(INITIAL_FOCUS_STATE); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PasswordToggleFieldProvider, + { + scope: __scopePasswordToggleField, + inputId, + inputRef, + setVisible, + syncInputId, + visible, + focusState, + children + } + ); +}; +PasswordToggleField.displayName = PASSWORD_TOGGLE_FIELD_NAME; +var PASSWORD_TOGGLE_FIELD_INPUT_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Input"; +var PasswordToggleFieldInput = React.forwardRef( + ({ + __scopePasswordToggleField, + autoComplete = "current-password", + autoCapitalize = "off", + spellCheck = false, + id: idProp, + ...props + }, forwardedRef) => { + const { visible, inputRef, inputId, syncInputId, setVisible, focusState } = usePasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_INPUT_NAME, __scopePasswordToggleField); + React.useEffect(() => { + syncInputId(idProp); + }, [idProp, syncInputId]); + const _setVisible = (0, import_react_use_effect_event.useEffectEvent)(setVisible); + React.useEffect(() => { + const inputElement = inputRef.current; + const form = inputElement?.form; + if (!form) { + return; + } + const controller = new AbortController(); + form.addEventListener( + "reset", + (event) => { + if (!event.defaultPrevented) { + _setVisible(false); + } + }, + { signal: controller.signal } + ); + form.addEventListener( + "submit", + () => { + _setVisible(false); + }, + { signal: controller.signal } + ); + return () => { + controller.abort(); + }; + }, [inputRef]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.input, + { + ...props, + id: idProp ?? inputId, + autoCapitalize, + autoComplete, + ref: (0, import_react_compose_refs.useComposedRefs)(forwardedRef, inputRef), + spellCheck, + type: visible ? "text" : "password", + onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, (event) => { + const { selectionStart, selectionEnd } = event.currentTarget; + focusState.current.selectionStart = selectionStart; + focusState.current.selectionEnd = selectionEnd; + }) + } + ); + } +); +PasswordToggleFieldInput.displayName = PASSWORD_TOGGLE_FIELD_INPUT_NAME; +var PASSWORD_TOGGLE_FIELD_TOGGLE_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Toggle"; +var PasswordToggleFieldToggle = React.forwardRef( + ({ + __scopePasswordToggleField, + onClick, + onPointerDown, + onPointerCancel, + onPointerUp, + onFocus, + children, + "aria-label": ariaLabelProp, + "aria-controls": ariaControls, + "aria-hidden": ariaHidden, + tabIndex, + ...props + }, forwardedRef) => { + const { setVisible, visible, inputRef, inputId, focusState } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_TOGGLE_NAME, + __scopePasswordToggleField + ); + const [internalAriaLabel, setInternalAriaLabel] = React.useState(void 0); + const elementRef = React.useRef(null); + const ref = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, elementRef); + const isHydrated = (0, import_react_use_is_hydrated.useIsHydrated)(); + React.useEffect(() => { + const element = elementRef.current; + if (!element || ariaLabelProp) { + setInternalAriaLabel(void 0); + return; + } + const DEFAULT_ARIA_LABEL = visible ? "Hide password" : "Show password"; + function checkForInnerTextLabel(textContent) { + const text = textContent ? textContent : void 0; + setInternalAriaLabel(text ? void 0 : DEFAULT_ARIA_LABEL); + } + checkForInnerTextLabel(element.textContent); + const observer = new MutationObserver((entries) => { + let textContent; + for (const entry of entries) { + if (entry.type === "characterData") { + if (element.textContent) { + textContent = element.textContent; + } + } + } + checkForInnerTextLabel(textContent); + }); + observer.observe(element, { characterData: true, subtree: true }); + return () => { + observer.disconnect(); + }; + }, [visible, ariaLabelProp]); + const ariaLabel = ariaLabelProp || internalAriaLabel; + if (!isHydrated) { + ariaHidden ??= true; + tabIndex ??= -1; + } else { + ariaControls ??= inputId; + } + React.useEffect(() => { + let cleanup = () => { + }; + const ownerWindow = elementRef.current?.ownerDocument?.defaultView || window; + const reset = () => focusState.current.clickTriggered = false; + const handlePointerUp = () => cleanup = requestIdleCallback(ownerWindow, reset); + ownerWindow.addEventListener("pointerup", handlePointerUp); + return () => { + cleanup(); + ownerWindow.removeEventListener("pointerup", handlePointerUp); + }; + }, [focusState]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + "aria-controls": ariaControls, + "aria-hidden": ariaHidden, + "aria-label": ariaLabel, + ref, + id: inputId, + ...props, + onPointerDown: (0, import_primitive.composeEventHandlers)(onPointerDown, () => { + focusState.current.clickTriggered = true; + }), + onPointerCancel: (event) => { + onPointerCancel?.(event); + focusState.current = INITIAL_FOCUS_STATE; + }, + onClick: (event) => { + onClick?.(event); + if (event.defaultPrevented) { + focusState.current = INITIAL_FOCUS_STATE; + return; + } + (0, import_react_dom.flushSync)(() => { + setVisible((s) => !s); + }); + if (focusState.current.clickTriggered) { + const input = inputRef.current; + if (input) { + const { selectionStart, selectionEnd } = focusState.current; + input.focus(); + if (selectionStart !== null || selectionEnd !== null) { + requestAnimationFrame(() => { + if (input.ownerDocument.activeElement === input) { + input.selectionStart = selectionStart; + input.selectionEnd = selectionEnd; + } + }); + } + } + } + focusState.current = INITIAL_FOCUS_STATE; + }, + onPointerUp: (event) => { + onPointerUp?.(event); + setTimeout(() => { + focusState.current = INITIAL_FOCUS_STATE; + }, 50); + }, + type: "button", + children + } + ); + } +); +PasswordToggleFieldToggle.displayName = PASSWORD_TOGGLE_FIELD_TOGGLE_NAME; +var PASSWORD_TOGGLE_FIELD_SLOT_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Slot"; +var PasswordToggleFieldSlot = ({ + __scopePasswordToggleField, + ...props +}) => { + const { visible } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_SLOT_NAME, + __scopePasswordToggleField + ); + return "render" in props ? ( + // + props.render({ visible }) + ) : visible ? props.visible : props.hidden; +}; +PasswordToggleFieldSlot.displayName = PASSWORD_TOGGLE_FIELD_SLOT_NAME; +var PASSWORD_TOGGLE_FIELD_ICON_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Icon"; +var PasswordToggleFieldIcon = React.forwardRef( + ({ + __scopePasswordToggleField, + // @ts-expect-error + children, + ...props + }, forwardedRef) => { + const { visible } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_ICON_NAME, + __scopePasswordToggleField + ); + const { visible: visibleIcon, hidden: hiddenIcon, ...domProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.svg, { ...domProps, ref: forwardedRef, "aria-hidden": true, asChild: true, children: visible ? visibleIcon : hiddenIcon }); + } +); +PasswordToggleFieldIcon.displayName = PASSWORD_TOGGLE_FIELD_ICON_NAME; +function requestIdleCallback(window2, callback, options) { + if (window2.requestIdleCallback) { + const id2 = window2.requestIdleCallback(callback, options); + return () => { + window2.cancelIdleCallback(id2); + }; + } + const start = Date.now(); + const id = window2.setTimeout(() => { + const timeRemaining = () => Math.max(0, 50 - (Date.now() - start)); + callback({ didTimeout: false, timeRemaining }); + }, 1); + return () => { + window2.clearTimeout(id); + }; +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c0f7b3a761e5b40c767f398a98ddbfc477b6f4d4 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/password-toggle-field.tsx"], + "sourcesContent": ["'use client';\nexport type {\n PasswordToggleFieldProps,\n PasswordToggleFieldInputProps,\n PasswordToggleFieldToggleProps,\n PasswordToggleFieldIconProps,\n PasswordToggleFieldSlotProps,\n} from './password-toggle-field';\nexport {\n PasswordToggleField,\n PasswordToggleFieldInput,\n PasswordToggleFieldToggle,\n PasswordToggleFieldIcon,\n PasswordToggleFieldSlot,\n //\n Root,\n Input,\n Toggle,\n Icon,\n Slot,\n} from './password-toggle-field';\n", "import * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive, type PrimitivePropsWithRef } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useId } from '@radix-ui/react-id';\nimport { useIsHydrated } from '@radix-ui/react-use-is-hydrated';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\nimport type { Scope } from '@radix-ui/react-context';\nimport { createContextScope } from '@radix-ui/react-context';\n\nconst PASSWORD_TOGGLE_FIELD_NAME = 'PasswordToggleField';\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldProvider\n * -----------------------------------------------------------------------------------------------*/\n\ntype InternalFocusState = {\n clickTriggered: boolean;\n selectionStart: number | null;\n selectionEnd: number | null;\n};\n\ninterface PasswordToggleFieldContextValue {\n inputId: string;\n inputRef: React.RefObject;\n visible: boolean;\n setVisible: React.Dispatch>;\n syncInputId: (providedId: string | number | undefined) => void;\n focusState: React.RefObject;\n}\n\nconst [createPasswordToggleFieldContext] = createContextScope(PASSWORD_TOGGLE_FIELD_NAME);\nconst [PasswordToggleFieldProvider, usePasswordToggleFieldContext] =\n createPasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleField\n * -----------------------------------------------------------------------------------------------*/\n\ntype ScopedProps

= P & { __scopePasswordToggleField?: Scope };\n\ninterface PasswordToggleFieldProps {\n id?: string;\n visible?: boolean;\n defaultVisible?: boolean;\n onVisibilityChange?: (visible: boolean) => void;\n children?: React.ReactNode;\n}\n\nconst INITIAL_FOCUS_STATE: InternalFocusState = {\n clickTriggered: false,\n selectionStart: null,\n selectionEnd: null,\n};\n\nconst PasswordToggleField: React.FC = ({\n __scopePasswordToggleField,\n ...props\n}: ScopedProps) => {\n const baseId = useId(props.id);\n const defaultInputId = `${baseId}-input`;\n const [inputIdState, setInputIdState] = React.useState(defaultInputId);\n const inputId = inputIdState ?? defaultInputId;\n const syncInputId = React.useCallback(\n (providedId: string | number | undefined) =>\n setInputIdState(providedId != null ? String(providedId) : null),\n [],\n );\n\n const { visible: visibleProp, defaultVisible, children } = props;\n\n let onVisibilityChange = props.onVisibilityChange;\n let shouldWarn = false;\n if (\n !onVisibilityChange &&\n 'onVisiblityChange' in props &&\n typeof props.onVisiblityChange === 'function'\n ) {\n shouldWarn = true;\n onVisibilityChange = props.onVisiblityChange as (visible: boolean) => void;\n } else {\n onVisibilityChange = props.onVisibilityChange;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // oxlint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (shouldWarn) {\n console.warn(\n 'PasswordToggleField: The misspelled `onVisiblityChange` prop has been removed. Please use `onVisibilityChange` instead.',\n );\n }\n }, [shouldWarn]);\n }\n\n const [visible = false, setVisible] = useControllableState({\n caller: PASSWORD_TOGGLE_FIELD_NAME,\n prop: visibleProp,\n defaultProp: defaultVisible ?? false,\n onChange: onVisibilityChange,\n });\n\n const inputRef = React.useRef(null);\n const focusState = React.useRef(INITIAL_FOCUS_STATE);\n\n return (\n \n {children}\n \n );\n};\nPasswordToggleField.displayName = PASSWORD_TOGGLE_FIELD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_INPUT_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Input';\n\ntype PrimitiveInputProps = PrimitivePropsWithRef<'input'>;\n\ninterface PasswordToggleFieldOwnProps {\n autoComplete?: 'current-password' | 'new-password';\n}\n\ninterface PasswordToggleFieldInputProps\n extends\n PasswordToggleFieldOwnProps,\n Omit {\n autoComplete?: 'current-password' | 'new-password';\n}\n\nconst PasswordToggleFieldInput = React.forwardRef(\n (\n {\n __scopePasswordToggleField,\n autoComplete = 'current-password',\n autoCapitalize = 'off',\n spellCheck = false,\n id: idProp,\n ...props\n }: ScopedProps,\n forwardedRef,\n ) => {\n const { visible, inputRef, inputId, syncInputId, setVisible, focusState } =\n usePasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_INPUT_NAME, __scopePasswordToggleField);\n\n React.useEffect(() => {\n syncInputId(idProp);\n }, [idProp, syncInputId]);\n\n // We want to reset the visibility to `false` to revert the input to\n // `type=\"password\"` when:\n // - The form is reset (for consistency with other form controls)\n // - The form is submitted (to prevent the browser from remembering the\n // input's value.\n //\n // See \"Keeping things secure\":\n // https://technology.blog.gov.uk/2021/04/19/simple-things-are-complicated-making-a-show-password-option/)\n const _setVisible = useEffectEvent(setVisible);\n React.useEffect(() => {\n const inputElement = inputRef.current;\n const form = inputElement?.form;\n if (!form) {\n return;\n }\n\n const controller = new AbortController();\n form.addEventListener(\n 'reset',\n (event) => {\n if (!event.defaultPrevented) {\n _setVisible(false);\n }\n },\n { signal: controller.signal },\n );\n form.addEventListener(\n 'submit',\n () => {\n // always reset the visibility on submit regardless of whether the\n // default action is prevented\n _setVisible(false);\n },\n { signal: controller.signal },\n );\n return () => {\n controller.abort();\n };\n }, [inputRef]);\n\n return (\n {\n // get the cursor position\n const { selectionStart, selectionEnd } = event.currentTarget;\n focusState.current.selectionStart = selectionStart;\n focusState.current.selectionEnd = selectionEnd;\n })}\n />\n );\n },\n);\nPasswordToggleFieldInput.displayName = PASSWORD_TOGGLE_FIELD_INPUT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldToggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_TOGGLE_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Toggle';\n\ntype PrimitiveButtonProps = PrimitivePropsWithRef<'button'>;\n\ninterface PasswordToggleFieldToggleProps extends Omit {}\n\nconst PasswordToggleFieldToggle = React.forwardRef<\n HTMLButtonElement,\n PasswordToggleFieldToggleProps\n>(\n (\n {\n __scopePasswordToggleField,\n onClick,\n onPointerDown,\n onPointerCancel,\n onPointerUp,\n onFocus,\n children,\n 'aria-label': ariaLabelProp,\n 'aria-controls': ariaControls,\n 'aria-hidden': ariaHidden,\n tabIndex,\n ...props\n }: ScopedProps,\n forwardedRef,\n ) => {\n const { setVisible, visible, inputRef, inputId, focusState } = usePasswordToggleFieldContext(\n PASSWORD_TOGGLE_FIELD_TOGGLE_NAME,\n __scopePasswordToggleField,\n );\n const [internalAriaLabel, setInternalAriaLabel] = React.useState(undefined);\n const elementRef = React.useRef(null);\n const ref = useComposedRefs(forwardedRef, elementRef);\n const isHydrated = useIsHydrated();\n\n React.useEffect(() => {\n const element = elementRef.current;\n if (!element || ariaLabelProp) {\n setInternalAriaLabel(undefined);\n return;\n }\n\n const DEFAULT_ARIA_LABEL = visible ? 'Hide password' : 'Show password';\n\n function checkForInnerTextLabel(textContent: string | undefined | null) {\n const text = textContent ? textContent : undefined;\n // If the element has inner text, no need to force an aria-label.\n setInternalAriaLabel(text ? undefined : DEFAULT_ARIA_LABEL);\n }\n\n checkForInnerTextLabel(element.textContent);\n\n const observer = new MutationObserver((entries) => {\n let textContent: string | undefined;\n for (const entry of entries) {\n if (entry.type === 'characterData') {\n if (element.textContent) {\n textContent = element.textContent;\n }\n }\n }\n checkForInnerTextLabel(textContent);\n });\n observer.observe(element, { characterData: true, subtree: true });\n return () => {\n observer.disconnect();\n };\n }, [visible, ariaLabelProp]);\n\n const ariaLabel = ariaLabelProp || internalAriaLabel;\n\n // Before hydration the button will not work, but we want to render it\n // regardless to prevent potential layout shift. Hide it from assistive tech\n // by default. Post-hydration it will be visible, focusable and associated\n // with the input via aria-controls.\n if (!isHydrated) {\n ariaHidden ??= true;\n tabIndex ??= -1;\n } else {\n ariaControls ??= inputId;\n }\n\n React.useEffect(() => {\n let cleanup = () => {};\n const ownerWindow = elementRef.current?.ownerDocument?.defaultView || window;\n const reset = () => (focusState.current.clickTriggered = false);\n const handlePointerUp = () => (cleanup = requestIdleCallback(ownerWindow, reset));\n ownerWindow.addEventListener('pointerup', handlePointerUp);\n return () => {\n cleanup();\n ownerWindow.removeEventListener('pointerup', handlePointerUp);\n };\n }, [focusState]);\n\n return (\n {\n focusState.current.clickTriggered = true;\n })}\n onPointerCancel={(event) => {\n // do not use `composeEventHandlers` here because we always want to\n // reset the ref on cancellation, regardless of whether the user has\n // called preventDefault on the event\n onPointerCancel?.(event);\n focusState.current = INITIAL_FOCUS_STATE;\n }}\n // do not use `composeEventHandlers` here because we always want to\n // reset the ref after click, regardless of whether the user has\n // called preventDefault on the event\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) {\n focusState.current = INITIAL_FOCUS_STATE;\n return;\n }\n\n flushSync(() => {\n setVisible((s) => !s);\n });\n if (focusState.current.clickTriggered) {\n const input = inputRef.current;\n if (input) {\n const { selectionStart, selectionEnd } = focusState.current;\n input.focus();\n if (selectionStart !== null || selectionEnd !== null) {\n // wait a tick so that focus has settled, then restore select position\n requestAnimationFrame(() => {\n // make sure the input still has focus (developer may have\n // programatically moved focus elsewhere)\n if (input.ownerDocument.activeElement === input) {\n input.selectionStart = selectionStart;\n input.selectionEnd = selectionEnd;\n }\n });\n }\n }\n }\n focusState.current = INITIAL_FOCUS_STATE;\n }}\n onPointerUp={(event) => {\n onPointerUp?.(event);\n // if click handler hasn't been called at this point, it may have been\n // intercepted, in which case we still want to reset our internal\n // state\n setTimeout(() => {\n focusState.current = INITIAL_FOCUS_STATE;\n }, 50);\n }}\n type=\"button\"\n >\n {children}\n \n );\n },\n);\nPasswordToggleFieldToggle.displayName = PASSWORD_TOGGLE_FIELD_TOGGLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldSlot\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_SLOT_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Slot';\n\ninterface PasswordToggleFieldSlotDeclarativeProps {\n visible: React.ReactNode;\n hidden: React.ReactNode;\n}\n\ninterface PasswordToggleFieldSlotRenderProps {\n render: (args: { visible: boolean }) => React.ReactElement;\n}\n\ntype PasswordToggleFieldSlotProps =\n | PasswordToggleFieldSlotDeclarativeProps\n | PasswordToggleFieldSlotRenderProps;\n\nconst PasswordToggleFieldSlot: React.FC = ({\n __scopePasswordToggleField,\n ...props\n}: ScopedProps) => {\n const { visible } = usePasswordToggleFieldContext(\n PASSWORD_TOGGLE_FIELD_SLOT_NAME,\n __scopePasswordToggleField,\n );\n\n return 'render' in props\n ? //\n props.render({ visible })\n : visible\n ? props.visible\n : props.hidden;\n};\nPasswordToggleFieldSlot.displayName = PASSWORD_TOGGLE_FIELD_SLOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldIcon\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_ICON_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Icon';\n\ntype PrimitiveSvgProps = PrimitivePropsWithRef<'svg'>;\n\ninterface PasswordToggleFieldIconProps extends Omit {\n visible: React.ReactElement;\n hidden: React.ReactElement;\n}\n\nconst PasswordToggleFieldIcon = React.forwardRef(\n (\n {\n __scopePasswordToggleField,\n // @ts-expect-error\n children,\n ...props\n }: ScopedProps,\n forwardedRef,\n ) => {\n const { visible } = usePasswordToggleFieldContext(\n PASSWORD_TOGGLE_FIELD_ICON_NAME,\n __scopePasswordToggleField,\n );\n const { visible: visibleIcon, hidden: hiddenIcon, ...domProps } = props;\n return (\n \n {visible ? visibleIcon : hiddenIcon}\n \n );\n },\n);\nPasswordToggleFieldIcon.displayName = PASSWORD_TOGGLE_FIELD_ICON_NAME;\n\nexport {\n PasswordToggleField,\n PasswordToggleFieldInput,\n PasswordToggleFieldToggle,\n PasswordToggleFieldSlot,\n PasswordToggleFieldIcon,\n //\n PasswordToggleField as Root,\n PasswordToggleFieldInput as Input,\n PasswordToggleFieldToggle as Toggle,\n PasswordToggleFieldSlot as Slot,\n PasswordToggleFieldIcon as Icon,\n};\nexport type {\n PasswordToggleFieldProps,\n PasswordToggleFieldInputProps,\n PasswordToggleFieldToggleProps,\n PasswordToggleFieldIconProps,\n PasswordToggleFieldSlotProps,\n};\n\nfunction requestIdleCallback(\n window: Window,\n callback: IdleRequestCallback,\n options?: IdleRequestOptions,\n): () => void {\n if ((window as any).requestIdleCallback) {\n const id = window.requestIdleCallback(callback, options);\n return () => {\n window.cancelIdleCallback(id);\n };\n }\n const start = Date.now();\n const id = window.setTimeout(() => {\n const timeRemaining = () => Math.max(0, 50 - (Date.now() - start));\n callback({ didTimeout: false, timeRemaining });\n }, 1);\n return () => {\n window.clearTimeout(id);\n };\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAA0B;AAC1B,uBAAqC;AACrC,0CAAqC;AACrC,6BAAsD;AACtD,gCAAgC;AAChC,sBAAsB;AACtB,mCAA8B;AAC9B,oCAA+B;AAE/B,2BAAmC;AAkG/B;AAhGJ,IAAM,6BAA6B;AAqBnC,IAAM,CAAC,gCAAgC,QAAI,yCAAmB,0BAA0B;AACxF,IAAM,CAAC,6BAA6B,6BAA6B,IAC/D,iCAAkE,0BAA0B;AAgB9F,IAAM,sBAA0C;AAAA,EAC9C,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAEA,IAAM,sBAA0D,CAAC;AAAA,EAC/D;AAA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AAY,OAAO,cAAc,CAAC;AAAA,EAC/C,GAAG,CAAC;AACJ,SAAO,MAAM;AACX,IAAAA,QAAO,aAAa,EAAE;AAAA,EACxB;AACF;", + "names": ["window", "id"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..98c679bba2d06a4de38e1c508bf78676066c8901 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.mjs @@ -0,0 +1,324 @@ +"use client"; + +// src/password-toggle-field.tsx +import * as React from "react"; +import { flushSync } from "react-dom"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useId } from "@radix-ui/react-id"; +import { useIsHydrated } from "@radix-ui/react-use-is-hydrated"; +import { useEffectEvent } from "@radix-ui/react-use-effect-event"; +import { createContextScope } from "@radix-ui/react-context"; +import { jsx } from "react/jsx-runtime"; +var PASSWORD_TOGGLE_FIELD_NAME = "PasswordToggleField"; +var [createPasswordToggleFieldContext] = createContextScope(PASSWORD_TOGGLE_FIELD_NAME); +var [PasswordToggleFieldProvider, usePasswordToggleFieldContext] = createPasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_NAME); +var INITIAL_FOCUS_STATE = { + clickTriggered: false, + selectionStart: null, + selectionEnd: null +}; +var PasswordToggleField = ({ + __scopePasswordToggleField, + ...props +}) => { + const baseId = useId(props.id); + const defaultInputId = `${baseId}-input`; + const [inputIdState, setInputIdState] = React.useState(defaultInputId); + const inputId = inputIdState ?? defaultInputId; + const syncInputId = React.useCallback( + (providedId) => setInputIdState(providedId != null ? String(providedId) : null), + [] + ); + const { visible: visibleProp, defaultVisible, children } = props; + let onVisibilityChange = props.onVisibilityChange; + let shouldWarn = false; + if (!onVisibilityChange && "onVisiblityChange" in props && typeof props.onVisiblityChange === "function") { + shouldWarn = true; + onVisibilityChange = props.onVisiblityChange; + } else { + onVisibilityChange = props.onVisibilityChange; + } + if (true) { + React.useEffect(() => { + if (shouldWarn) { + console.warn( + "PasswordToggleField: The misspelled `onVisiblityChange` prop has been removed. Please use `onVisibilityChange` instead." + ); + } + }, [shouldWarn]); + } + const [visible = false, setVisible] = useControllableState({ + caller: PASSWORD_TOGGLE_FIELD_NAME, + prop: visibleProp, + defaultProp: defaultVisible ?? false, + onChange: onVisibilityChange + }); + const inputRef = React.useRef(null); + const focusState = React.useRef(INITIAL_FOCUS_STATE); + return /* @__PURE__ */ jsx( + PasswordToggleFieldProvider, + { + scope: __scopePasswordToggleField, + inputId, + inputRef, + setVisible, + syncInputId, + visible, + focusState, + children + } + ); +}; +PasswordToggleField.displayName = PASSWORD_TOGGLE_FIELD_NAME; +var PASSWORD_TOGGLE_FIELD_INPUT_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Input"; +var PasswordToggleFieldInput = React.forwardRef( + ({ + __scopePasswordToggleField, + autoComplete = "current-password", + autoCapitalize = "off", + spellCheck = false, + id: idProp, + ...props + }, forwardedRef) => { + const { visible, inputRef, inputId, syncInputId, setVisible, focusState } = usePasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_INPUT_NAME, __scopePasswordToggleField); + React.useEffect(() => { + syncInputId(idProp); + }, [idProp, syncInputId]); + const _setVisible = useEffectEvent(setVisible); + React.useEffect(() => { + const inputElement = inputRef.current; + const form = inputElement?.form; + if (!form) { + return; + } + const controller = new AbortController(); + form.addEventListener( + "reset", + (event) => { + if (!event.defaultPrevented) { + _setVisible(false); + } + }, + { signal: controller.signal } + ); + form.addEventListener( + "submit", + () => { + _setVisible(false); + }, + { signal: controller.signal } + ); + return () => { + controller.abort(); + }; + }, [inputRef]); + return /* @__PURE__ */ jsx( + Primitive.input, + { + ...props, + id: idProp ?? inputId, + autoCapitalize, + autoComplete, + ref: useComposedRefs(forwardedRef, inputRef), + spellCheck, + type: visible ? "text" : "password", + onBlur: composeEventHandlers(props.onBlur, (event) => { + const { selectionStart, selectionEnd } = event.currentTarget; + focusState.current.selectionStart = selectionStart; + focusState.current.selectionEnd = selectionEnd; + }) + } + ); + } +); +PasswordToggleFieldInput.displayName = PASSWORD_TOGGLE_FIELD_INPUT_NAME; +var PASSWORD_TOGGLE_FIELD_TOGGLE_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Toggle"; +var PasswordToggleFieldToggle = React.forwardRef( + ({ + __scopePasswordToggleField, + onClick, + onPointerDown, + onPointerCancel, + onPointerUp, + onFocus, + children, + "aria-label": ariaLabelProp, + "aria-controls": ariaControls, + "aria-hidden": ariaHidden, + tabIndex, + ...props + }, forwardedRef) => { + const { setVisible, visible, inputRef, inputId, focusState } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_TOGGLE_NAME, + __scopePasswordToggleField + ); + const [internalAriaLabel, setInternalAriaLabel] = React.useState(void 0); + const elementRef = React.useRef(null); + const ref = useComposedRefs(forwardedRef, elementRef); + const isHydrated = useIsHydrated(); + React.useEffect(() => { + const element = elementRef.current; + if (!element || ariaLabelProp) { + setInternalAriaLabel(void 0); + return; + } + const DEFAULT_ARIA_LABEL = visible ? "Hide password" : "Show password"; + function checkForInnerTextLabel(textContent) { + const text = textContent ? textContent : void 0; + setInternalAriaLabel(text ? void 0 : DEFAULT_ARIA_LABEL); + } + checkForInnerTextLabel(element.textContent); + const observer = new MutationObserver((entries) => { + let textContent; + for (const entry of entries) { + if (entry.type === "characterData") { + if (element.textContent) { + textContent = element.textContent; + } + } + } + checkForInnerTextLabel(textContent); + }); + observer.observe(element, { characterData: true, subtree: true }); + return () => { + observer.disconnect(); + }; + }, [visible, ariaLabelProp]); + const ariaLabel = ariaLabelProp || internalAriaLabel; + if (!isHydrated) { + ariaHidden ??= true; + tabIndex ??= -1; + } else { + ariaControls ??= inputId; + } + React.useEffect(() => { + let cleanup = () => { + }; + const ownerWindow = elementRef.current?.ownerDocument?.defaultView || window; + const reset = () => focusState.current.clickTriggered = false; + const handlePointerUp = () => cleanup = requestIdleCallback(ownerWindow, reset); + ownerWindow.addEventListener("pointerup", handlePointerUp); + return () => { + cleanup(); + ownerWindow.removeEventListener("pointerup", handlePointerUp); + }; + }, [focusState]); + return /* @__PURE__ */ jsx( + Primitive.button, + { + "aria-controls": ariaControls, + "aria-hidden": ariaHidden, + "aria-label": ariaLabel, + ref, + id: inputId, + ...props, + onPointerDown: composeEventHandlers(onPointerDown, () => { + focusState.current.clickTriggered = true; + }), + onPointerCancel: (event) => { + onPointerCancel?.(event); + focusState.current = INITIAL_FOCUS_STATE; + }, + onClick: (event) => { + onClick?.(event); + if (event.defaultPrevented) { + focusState.current = INITIAL_FOCUS_STATE; + return; + } + flushSync(() => { + setVisible((s) => !s); + }); + if (focusState.current.clickTriggered) { + const input = inputRef.current; + if (input) { + const { selectionStart, selectionEnd } = focusState.current; + input.focus(); + if (selectionStart !== null || selectionEnd !== null) { + requestAnimationFrame(() => { + if (input.ownerDocument.activeElement === input) { + input.selectionStart = selectionStart; + input.selectionEnd = selectionEnd; + } + }); + } + } + } + focusState.current = INITIAL_FOCUS_STATE; + }, + onPointerUp: (event) => { + onPointerUp?.(event); + setTimeout(() => { + focusState.current = INITIAL_FOCUS_STATE; + }, 50); + }, + type: "button", + children + } + ); + } +); +PasswordToggleFieldToggle.displayName = PASSWORD_TOGGLE_FIELD_TOGGLE_NAME; +var PASSWORD_TOGGLE_FIELD_SLOT_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Slot"; +var PasswordToggleFieldSlot = ({ + __scopePasswordToggleField, + ...props +}) => { + const { visible } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_SLOT_NAME, + __scopePasswordToggleField + ); + return "render" in props ? ( + // + props.render({ visible }) + ) : visible ? props.visible : props.hidden; +}; +PasswordToggleFieldSlot.displayName = PASSWORD_TOGGLE_FIELD_SLOT_NAME; +var PASSWORD_TOGGLE_FIELD_ICON_NAME = PASSWORD_TOGGLE_FIELD_NAME + "Icon"; +var PasswordToggleFieldIcon = React.forwardRef( + ({ + __scopePasswordToggleField, + // @ts-expect-error + children, + ...props + }, forwardedRef) => { + const { visible } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_ICON_NAME, + __scopePasswordToggleField + ); + const { visible: visibleIcon, hidden: hiddenIcon, ...domProps } = props; + return /* @__PURE__ */ jsx(Primitive.svg, { ...domProps, ref: forwardedRef, "aria-hidden": true, asChild: true, children: visible ? visibleIcon : hiddenIcon }); + } +); +PasswordToggleFieldIcon.displayName = PASSWORD_TOGGLE_FIELD_ICON_NAME; +function requestIdleCallback(window2, callback, options) { + if (window2.requestIdleCallback) { + const id2 = window2.requestIdleCallback(callback, options); + return () => { + window2.cancelIdleCallback(id2); + }; + } + const start = Date.now(); + const id = window2.setTimeout(() => { + const timeRemaining = () => Math.max(0, 50 - (Date.now() - start)); + callback({ didTimeout: false, timeRemaining }); + }, 1); + return () => { + window2.clearTimeout(id); + }; +} +export { + PasswordToggleFieldIcon as Icon, + PasswordToggleFieldInput as Input, + PasswordToggleField, + PasswordToggleFieldIcon, + PasswordToggleFieldInput, + PasswordToggleFieldSlot, + PasswordToggleFieldToggle, + PasswordToggleField as Root, + PasswordToggleFieldSlot as Slot, + PasswordToggleFieldToggle as Toggle +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..cf831f26050594fb51ecf608b2ae2b9bd53c0ce7 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/password-toggle-field.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive, type PrimitivePropsWithRef } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useId } from '@radix-ui/react-id';\nimport { useIsHydrated } from '@radix-ui/react-use-is-hydrated';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\nimport type { Scope } from '@radix-ui/react-context';\nimport { createContextScope } from '@radix-ui/react-context';\n\nconst PASSWORD_TOGGLE_FIELD_NAME = 'PasswordToggleField';\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldProvider\n * -----------------------------------------------------------------------------------------------*/\n\ntype InternalFocusState = {\n clickTriggered: boolean;\n selectionStart: number | null;\n selectionEnd: number | null;\n};\n\ninterface PasswordToggleFieldContextValue {\n inputId: string;\n inputRef: React.RefObject;\n visible: boolean;\n setVisible: React.Dispatch>;\n syncInputId: (providedId: string | number | undefined) => void;\n focusState: React.RefObject;\n}\n\nconst [createPasswordToggleFieldContext] = createContextScope(PASSWORD_TOGGLE_FIELD_NAME);\nconst [PasswordToggleFieldProvider, usePasswordToggleFieldContext] =\n createPasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleField\n * -----------------------------------------------------------------------------------------------*/\n\ntype ScopedProps

= P & { __scopePasswordToggleField?: Scope };\n\ninterface PasswordToggleFieldProps {\n id?: string;\n visible?: boolean;\n defaultVisible?: boolean;\n onVisibilityChange?: (visible: boolean) => void;\n children?: React.ReactNode;\n}\n\nconst INITIAL_FOCUS_STATE: InternalFocusState = {\n clickTriggered: false,\n selectionStart: null,\n selectionEnd: null,\n};\n\nconst PasswordToggleField: React.FC = ({\n __scopePasswordToggleField,\n ...props\n}: ScopedProps) => {\n const baseId = useId(props.id);\n const defaultInputId = `${baseId}-input`;\n const [inputIdState, setInputIdState] = React.useState(defaultInputId);\n const inputId = inputIdState ?? defaultInputId;\n const syncInputId = React.useCallback(\n (providedId: string | number | undefined) =>\n setInputIdState(providedId != null ? String(providedId) : null),\n [],\n );\n\n const { visible: visibleProp, defaultVisible, children } = props;\n\n let onVisibilityChange = props.onVisibilityChange;\n let shouldWarn = false;\n if (\n !onVisibilityChange &&\n 'onVisiblityChange' in props &&\n typeof props.onVisiblityChange === 'function'\n ) {\n shouldWarn = true;\n onVisibilityChange = props.onVisiblityChange as (visible: boolean) => void;\n } else {\n onVisibilityChange = props.onVisibilityChange;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // oxlint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (shouldWarn) {\n console.warn(\n 'PasswordToggleField: The misspelled `onVisiblityChange` prop has been removed. Please use `onVisibilityChange` instead.',\n );\n }\n }, [shouldWarn]);\n }\n\n const [visible = false, setVisible] = useControllableState({\n caller: PASSWORD_TOGGLE_FIELD_NAME,\n prop: visibleProp,\n defaultProp: defaultVisible ?? false,\n onChange: onVisibilityChange,\n });\n\n const inputRef = React.useRef(null);\n const focusState = React.useRef(INITIAL_FOCUS_STATE);\n\n return (\n \n {children}\n \n );\n};\nPasswordToggleField.displayName = PASSWORD_TOGGLE_FIELD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_INPUT_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Input';\n\ntype PrimitiveInputProps = PrimitivePropsWithRef<'input'>;\n\ninterface PasswordToggleFieldOwnProps {\n autoComplete?: 'current-password' | 'new-password';\n}\n\ninterface PasswordToggleFieldInputProps\n extends\n PasswordToggleFieldOwnProps,\n Omit {\n autoComplete?: 'current-password' | 'new-password';\n}\n\nconst PasswordToggleFieldInput = React.forwardRef(\n (\n {\n __scopePasswordToggleField,\n autoComplete = 'current-password',\n autoCapitalize = 'off',\n spellCheck = false,\n id: idProp,\n ...props\n }: ScopedProps,\n forwardedRef,\n ) => {\n const { visible, inputRef, inputId, syncInputId, setVisible, focusState } =\n usePasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_INPUT_NAME, __scopePasswordToggleField);\n\n React.useEffect(() => {\n syncInputId(idProp);\n }, [idProp, syncInputId]);\n\n // We want to reset the visibility to `false` to revert the input to\n // `type=\"password\"` when:\n // - The form is reset (for consistency with other form controls)\n // - The form is submitted (to prevent the browser from remembering the\n // input's value.\n //\n // See \"Keeping things secure\":\n // https://technology.blog.gov.uk/2021/04/19/simple-things-are-complicated-making-a-show-password-option/)\n const _setVisible = useEffectEvent(setVisible);\n React.useEffect(() => {\n const inputElement = inputRef.current;\n const form = inputElement?.form;\n if (!form) {\n return;\n }\n\n const controller = new AbortController();\n form.addEventListener(\n 'reset',\n (event) => {\n if (!event.defaultPrevented) {\n _setVisible(false);\n }\n },\n { signal: controller.signal },\n );\n form.addEventListener(\n 'submit',\n () => {\n // always reset the visibility on submit regardless of whether the\n // default action is prevented\n _setVisible(false);\n },\n { signal: controller.signal },\n );\n return () => {\n controller.abort();\n };\n }, [inputRef]);\n\n return (\n {\n // get the cursor position\n const { selectionStart, selectionEnd } = event.currentTarget;\n focusState.current.selectionStart = selectionStart;\n focusState.current.selectionEnd = selectionEnd;\n })}\n />\n );\n },\n);\nPasswordToggleFieldInput.displayName = PASSWORD_TOGGLE_FIELD_INPUT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldToggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_TOGGLE_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Toggle';\n\ntype PrimitiveButtonProps = PrimitivePropsWithRef<'button'>;\n\ninterface PasswordToggleFieldToggleProps extends Omit {}\n\nconst PasswordToggleFieldToggle = React.forwardRef<\n HTMLButtonElement,\n PasswordToggleFieldToggleProps\n>(\n (\n {\n __scopePasswordToggleField,\n onClick,\n onPointerDown,\n onPointerCancel,\n onPointerUp,\n onFocus,\n children,\n 'aria-label': ariaLabelProp,\n 'aria-controls': ariaControls,\n 'aria-hidden': ariaHidden,\n tabIndex,\n ...props\n }: ScopedProps,\n forwardedRef,\n ) => {\n const { setVisible, visible, inputRef, inputId, focusState } = usePasswordToggleFieldContext(\n PASSWORD_TOGGLE_FIELD_TOGGLE_NAME,\n __scopePasswordToggleField,\n );\n const [internalAriaLabel, setInternalAriaLabel] = React.useState(undefined);\n const elementRef = React.useRef(null);\n const ref = useComposedRefs(forwardedRef, elementRef);\n const isHydrated = useIsHydrated();\n\n React.useEffect(() => {\n const element = elementRef.current;\n if (!element || ariaLabelProp) {\n setInternalAriaLabel(undefined);\n return;\n }\n\n const DEFAULT_ARIA_LABEL = visible ? 'Hide password' : 'Show password';\n\n function checkForInnerTextLabel(textContent: string | undefined | null) {\n const text = textContent ? textContent : undefined;\n // If the element has inner text, no need to force an aria-label.\n setInternalAriaLabel(text ? undefined : DEFAULT_ARIA_LABEL);\n }\n\n checkForInnerTextLabel(element.textContent);\n\n const observer = new MutationObserver((entries) => {\n let textContent: string | undefined;\n for (const entry of entries) {\n if (entry.type === 'characterData') {\n if (element.textContent) {\n textContent = element.textContent;\n }\n }\n }\n checkForInnerTextLabel(textContent);\n });\n observer.observe(element, { characterData: true, subtree: true });\n return () => {\n observer.disconnect();\n };\n }, [visible, ariaLabelProp]);\n\n const ariaLabel = ariaLabelProp || internalAriaLabel;\n\n // Before hydration the button will not work, but we want to render it\n // regardless to prevent potential layout shift. Hide it from assistive tech\n // by default. Post-hydration it will be visible, focusable and associated\n // with the input via aria-controls.\n if (!isHydrated) {\n ariaHidden ??= true;\n tabIndex ??= -1;\n } else {\n ariaControls ??= inputId;\n }\n\n React.useEffect(() => {\n let cleanup = () => {};\n const ownerWindow = elementRef.current?.ownerDocument?.defaultView || window;\n const reset = () => (focusState.current.clickTriggered = false);\n const handlePointerUp = () => (cleanup = requestIdleCallback(ownerWindow, reset));\n ownerWindow.addEventListener('pointerup', handlePointerUp);\n return () => {\n cleanup();\n ownerWindow.removeEventListener('pointerup', handlePointerUp);\n };\n }, [focusState]);\n\n return (\n {\n focusState.current.clickTriggered = true;\n })}\n onPointerCancel={(event) => {\n // do not use `composeEventHandlers` here because we always want to\n // reset the ref on cancellation, regardless of whether the user has\n // called preventDefault on the event\n onPointerCancel?.(event);\n focusState.current = INITIAL_FOCUS_STATE;\n }}\n // do not use `composeEventHandlers` here because we always want to\n // reset the ref after click, regardless of whether the user has\n // called preventDefault on the event\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) {\n focusState.current = INITIAL_FOCUS_STATE;\n return;\n }\n\n flushSync(() => {\n setVisible((s) => !s);\n });\n if (focusState.current.clickTriggered) {\n const input = inputRef.current;\n if (input) {\n const { selectionStart, selectionEnd } = focusState.current;\n input.focus();\n if (selectionStart !== null || selectionEnd !== null) {\n // wait a tick so that focus has settled, then restore select position\n requestAnimationFrame(() => {\n // make sure the input still has focus (developer may have\n // programatically moved focus elsewhere)\n if (input.ownerDocument.activeElement === input) {\n input.selectionStart = selectionStart;\n input.selectionEnd = selectionEnd;\n }\n });\n }\n }\n }\n focusState.current = INITIAL_FOCUS_STATE;\n }}\n onPointerUp={(event) => {\n onPointerUp?.(event);\n // if click handler hasn't been called at this point, it may have been\n // intercepted, in which case we still want to reset our internal\n // state\n setTimeout(() => {\n focusState.current = INITIAL_FOCUS_STATE;\n }, 50);\n }}\n type=\"button\"\n >\n {children}\n \n );\n },\n);\nPasswordToggleFieldToggle.displayName = PASSWORD_TOGGLE_FIELD_TOGGLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldSlot\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_SLOT_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Slot';\n\ninterface PasswordToggleFieldSlotDeclarativeProps {\n visible: React.ReactNode;\n hidden: React.ReactNode;\n}\n\ninterface PasswordToggleFieldSlotRenderProps {\n render: (args: { visible: boolean }) => React.ReactElement;\n}\n\ntype PasswordToggleFieldSlotProps =\n | PasswordToggleFieldSlotDeclarativeProps\n | PasswordToggleFieldSlotRenderProps;\n\nconst PasswordToggleFieldSlot: React.FC = ({\n __scopePasswordToggleField,\n ...props\n}: ScopedProps) => {\n const { visible } = usePasswordToggleFieldContext(\n PASSWORD_TOGGLE_FIELD_SLOT_NAME,\n __scopePasswordToggleField,\n );\n\n return 'render' in props\n ? //\n props.render({ visible })\n : visible\n ? props.visible\n : props.hidden;\n};\nPasswordToggleFieldSlot.displayName = PASSWORD_TOGGLE_FIELD_SLOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PasswordToggleFieldIcon\n * -----------------------------------------------------------------------------------------------*/\n\nconst PASSWORD_TOGGLE_FIELD_ICON_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Icon';\n\ntype PrimitiveSvgProps = PrimitivePropsWithRef<'svg'>;\n\ninterface PasswordToggleFieldIconProps extends Omit {\n visible: React.ReactElement;\n hidden: React.ReactElement;\n}\n\nconst PasswordToggleFieldIcon = React.forwardRef(\n (\n {\n __scopePasswordToggleField,\n // @ts-expect-error\n children,\n ...props\n }: ScopedProps,\n forwardedRef,\n ) => {\n const { visible } = usePasswordToggleFieldContext(\n PASSWORD_TOGGLE_FIELD_ICON_NAME,\n __scopePasswordToggleField,\n );\n const { visible: visibleIcon, hidden: hiddenIcon, ...domProps } = props;\n return (\n \n {visible ? visibleIcon : hiddenIcon}\n \n );\n },\n);\nPasswordToggleFieldIcon.displayName = PASSWORD_TOGGLE_FIELD_ICON_NAME;\n\nexport {\n PasswordToggleField,\n PasswordToggleFieldInput,\n PasswordToggleFieldToggle,\n PasswordToggleFieldSlot,\n PasswordToggleFieldIcon,\n //\n PasswordToggleField as Root,\n PasswordToggleFieldInput as Input,\n PasswordToggleFieldToggle as Toggle,\n PasswordToggleFieldSlot as Slot,\n PasswordToggleFieldIcon as Icon,\n};\nexport type {\n PasswordToggleFieldProps,\n PasswordToggleFieldInputProps,\n PasswordToggleFieldToggleProps,\n PasswordToggleFieldIconProps,\n PasswordToggleFieldSlotProps,\n};\n\nfunction requestIdleCallback(\n window: Window,\n callback: IdleRequestCallback,\n options?: IdleRequestOptions,\n): () => void {\n if ((window as any).requestIdleCallback) {\n const id = window.requestIdleCallback(callback, options);\n return () => {\n window.cancelIdleCallback(id);\n };\n }\n const start = Date.now();\n const id = window.setTimeout(() => {\n const timeRemaining = () => Math.max(0, 50 - (Date.now() - start));\n callback({ didTimeout: false, timeRemaining });\n }, 1);\n return () => {\n window.clearTimeout(id);\n };\n}\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,iBAA6C;AACtD,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAE/B,SAAS,0BAA0B;AAkG/B;AAhGJ,IAAM,6BAA6B;AAqBnC,IAAM,CAAC,gCAAgC,IAAI,mBAAmB,0BAA0B;AACxF,IAAM,CAAC,6BAA6B,6BAA6B,IAC/D,iCAAkE,0BAA0B;AAgB9F,IAAM,sBAA0C;AAAA,EAC9C,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAEA,IAAM,sBAA0D,CAAC;AAAA,EAC/D;AAAA,EACA,GAAG;AACL,MAA6C;AAC3C,QAAM,SAAS,MAAM,MAAM,EAAE;AAC7B,QAAM,iBAAiB,GAAG,MAAM;AAChC,QAAM,CAAC,cAAc,eAAe,IAAU,eAAwB,cAAc;AACpF,QAAM,UAAU,gBAAgB;AAChC,QAAM,cAAoB;AAAA,IACxB,CAAC,eACC,gBAAgB,cAAc,OAAO,OAAO,UAAU,IAAI,IAAI;AAAA,IAChE,CAAC;AAAA,EACH;AAEA,QAAM,EAAE,SAAS,aAAa,gBAAgB,SAAS,IAAI;AAE3D,MAAI,qBAA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AO,YAAY;AAAA;AAAA,IAEf,MAAM,OAAO,EAAE,QAAQ,CAAC;AAAA,MACxB,UACE,MAAM,UACN,MAAM;AACd;AACA,wBAAwB,cAAc;AAMtC,IAAM,kCAAkC,6BAA6B;AASrE,IAAM,0BAAgC;AAAA,EACpC,CACE;AAAA,IACE;AAAA;AAAA,IAEA;AAAA,IACA,GAAG;AAAA,EACL,GACA,iBACG;AACH,UAAM,EAAE,QAAQ,IAAI;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AACA,UAAM,EAAE,SAAS,aAAa,QAAQ,YAAY,GAAG,SAAS,IAAI;AAClE,WACE,oBAAC,UAAU,KAAV,EAAe,GAAG,UAAU,KAAK,cAAc,eAAW,MAAC,SAAO,MAChE,oBAAU,cAAc,YAC3B;AAAA,EAEJ;AACF;AACA,wBAAwB,cAAc;AAuBtC,SAAS,oBACPA,SACA,UACA,SACY;AACZ,MAAKA,QAAe,qBAAqB;AACvC,UAAMC,MAAKD,QAAO,oBAAoB,UAAU,OAAO;AACvD,WAAO,MAAM;AACX,MAAAA,QAAO,mBAAmBC,GAAE;AAAA,IAC9B;AAAA,EACF;AACA,QAAM,QAAQ,KAAK,IAAI;AACvB,QAAM,KAAKD,QAAO,WAAW,MAAM;AACjC,UAAM,gBAAgB,MAAM,KAAK,IAAI,GAAG,MAAM,KAAK,IAAI,IAAI,MAAM;AACjE,aAAS,EAAE,YAAY,OAAO,cAAc,CAAC;AAAA,EAC/C,GAAG,CAAC;AACJ,SAAO,MAAM;AACX,IAAAA,QAAO,aAAa,EAAE;AAAA,EACxB;AACF;", + "names": ["window", "id"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/package.json new file mode 100644 index 0000000000000000000000000000000000000000..249f27d439550631603c7d20936e6efd77b43905 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/package.json @@ -0,0 +1,76 @@ +{ + "name": "@radix-ui/react-password-toggle-field", + "version": "0.1.5", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "src", + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-effect-event": "0.0.3", + "@radix-ui/react-use-is-hydrated": "0.1.1" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/password-toggle-field" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/index.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..f88e4524ed258425ad5414363ff01cfed2f40b3f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/index.ts @@ -0,0 +1,21 @@ +'use client'; +export type { + PasswordToggleFieldProps, + PasswordToggleFieldInputProps, + PasswordToggleFieldToggleProps, + PasswordToggleFieldIconProps, + PasswordToggleFieldSlotProps, +} from './password-toggle-field'; +export { + PasswordToggleField, + PasswordToggleFieldInput, + PasswordToggleFieldToggle, + PasswordToggleFieldIcon, + PasswordToggleFieldSlot, + // + Root, + Input, + Toggle, + Icon, + Slot, +} from './password-toggle-field'; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/password-toggle-field.test.tsx b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/password-toggle-field.test.tsx new file mode 100644 index 0000000000000000000000000000000000000000..82e4d5b9ab11e3546e9ba20e615cbda488547f09 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/password-toggle-field.test.tsx @@ -0,0 +1,219 @@ +import { axe } from 'vitest-axe'; +import type { RenderResult } from '@testing-library/react'; +import { act, cleanup, render, screen } from '@testing-library/react'; +import * as PasswordToggleField from './password-toggle-field'; +import { afterEach, describe, it, beforeEach, expect } from 'vitest'; +import { userEvent, type UserEvent } from '@testing-library/user-event'; + +describe('given a default PasswordToggleField', () => { + let rendered: RenderResult; + let user: UserEvent; + + afterEach(cleanup); + + beforeEach(() => { + user = userEvent.setup(); + rendered = render( + <> + + + + + + + , + ); + }); + + afterEach(cleanup); + + it('should have no accessibility violations', async () => { + expect(await axe(rendered.container)).toHaveNoViolations(); + }); + + it('should initially be hidden', () => { + const toggle = screen.getByRole('button', { name: 'Show' }); + expect(toggle.textContent).toBe('Show'); + }); + + it('toggles the children when clicked', async () => { + const toggle = screen.getByRole('button', { name: 'Show' }); + await act(async () => await user.click(toggle)); + expect(toggle.textContent).toBe('Hide'); + }); + + it('should initially render input as `type=password`', async () => { + const input = screen.getByLabelText('Password'); + expect(input.type).toBe('password'); + }); + + it('should initially render input as `type=text` when toggled', async () => { + const input = screen.getByLabelText('Password'); + const toggle = screen.getByRole('button', { name: 'Show' }); + await act(async () => await user.click(toggle)); + expect(input.type).toBe('text'); + }); + + it('should re-focus the input after toggling', async () => { + const input = screen.getByLabelText('Password'); + const toggle = screen.getByRole('button', { name: 'Show' }); + await act(async () => await user.click(toggle)); + expect(document.activeElement).toBe(input); + }); + + it("should restore the input's selection after toggling", async () => { + const input = screen.getByLabelText('Password'); + const toggle = screen.getByRole('button', { name: 'Show' }); + await act(async () => await user.click(input)); + await act(async () => await user.type(input, 'p')); + await act(async () => await user.click(toggle)); + // selection should be at the end of the input value + expect(input.selectionStart).toBe(1); + expect(input.selectionEnd).toBe(1); + + await act(async () => await user.type(input, 'assword')); + input.selectionStart = 0; + input.selectionEnd = 4; + + await act(async () => await user.click(toggle)); + expect(input.selectionStart).toBe(0); + expect(input.selectionEnd).toBe(4); + }); +}); + +describe('given a PasswordToggleField with an Icon', () => { + let rendered: RenderResult; + let user: UserEvent; + + afterEach(cleanup); + + beforeEach(() => { + user = userEvent.setup(); + rendered = render( + <> + + + + + } + hidden={} + /> + + + , + ); + }); + + afterEach(cleanup); + + it('should have no accessibility violations', async () => { + expect(await axe(rendered.container)).toHaveNoViolations(); + }); + + it('should initially be hidden', () => { + const icon = screen.getByTestId('closed'); + expect(icon).toBeVisible(); + expect(screen.queryByTestId('open')).not.toBeInTheDocument(); + }); + + it('toggles the icon when clicked', async () => { + const toggle = screen.getByRole('button', { name: 'Show password' }); + await act(async () => await user.click(toggle)); + expect(screen.getByTestId('open')).toBeVisible(); + expect(screen.queryByTestId('closed')).not.toBeInTheDocument(); + }); + + it('should initially render input as `type=password`', async () => { + const input = screen.getByLabelText('Password'); + expect(input.type).toBe('password'); + }); + + it('should initially render input as `type=text` when toggled', async () => { + const input = screen.getByLabelText('Password'); + const toggle = screen.getByRole('button', { name: 'Show password' }); + await act(async () => await user.click(toggle)); + expect(input.type).toBe('text'); + }); + + it('should retain its value when toggled', async () => { + const input = screen.getByLabelText('Password'); + const toggle = screen.getByRole('button', { name: 'Show password' }); + await act(async () => await user.type(input, 'pass123')); + await act(async () => await user.click(toggle)); + expect(input).toHaveValue('pass123'); + }); +}); + +describe('given a PasswordToggleField in a form', () => { + let user: UserEvent; + + afterEach(cleanup); + + beforeEach(() => { + user = userEvent.setup(); + render( +

e.preventDefault()}> + + + + + + + + , + ); + }); + + afterEach(cleanup); + + it('should reset visibility to hidden after submission', async () => { + const toggle = screen.getByRole('button', { name: 'Show' }); + const input = screen.getByLabelText('Password'); + await act(() => user.click(toggle)); + expect(input.type).toBe('text'); + const submitButton = screen.getByText('Submit'); + await act(() => user.click(submitButton)); + expect(input.type).toBe('password'); + }); +}); + +function EyeClosedIcon(props: React.SVGProps) { + return ( + + + + ); +} + +function EyeOpenIcon(props: React.SVGProps) { + return ( + + + + ); +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/password-toggle-field.tsx b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/password-toggle-field.tsx new file mode 100644 index 0000000000000000000000000000000000000000..da14fab46d07f4e99754f5fd2dd9e5a56e2bc6d1 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-password-toggle-field/src/password-toggle-field.tsx @@ -0,0 +1,505 @@ +import * as React from 'react'; +import { flushSync } from 'react-dom'; +import { composeEventHandlers } from '@radix-ui/primitive'; +import { useControllableState } from '@radix-ui/react-use-controllable-state'; +import { Primitive, type PrimitivePropsWithRef } from '@radix-ui/react-primitive'; +import { useComposedRefs } from '@radix-ui/react-compose-refs'; +import { useId } from '@radix-ui/react-id'; +import { useIsHydrated } from '@radix-ui/react-use-is-hydrated'; +import { useEffectEvent } from '@radix-ui/react-use-effect-event'; +import type { Scope } from '@radix-ui/react-context'; +import { createContextScope } from '@radix-ui/react-context'; + +const PASSWORD_TOGGLE_FIELD_NAME = 'PasswordToggleField'; + +/* ------------------------------------------------------------------------------------------------- + * PasswordToggleFieldProvider + * -----------------------------------------------------------------------------------------------*/ + +type InternalFocusState = { + clickTriggered: boolean; + selectionStart: number | null; + selectionEnd: number | null; +}; + +interface PasswordToggleFieldContextValue { + inputId: string; + inputRef: React.RefObject; + visible: boolean; + setVisible: React.Dispatch>; + syncInputId: (providedId: string | number | undefined) => void; + focusState: React.RefObject; +} + +const [createPasswordToggleFieldContext] = createContextScope(PASSWORD_TOGGLE_FIELD_NAME); +const [PasswordToggleFieldProvider, usePasswordToggleFieldContext] = + createPasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_NAME); + +/* ------------------------------------------------------------------------------------------------- + * PasswordToggleField + * -----------------------------------------------------------------------------------------------*/ + +type ScopedProps

= P & { __scopePasswordToggleField?: Scope }; + +interface PasswordToggleFieldProps { + id?: string; + visible?: boolean; + defaultVisible?: boolean; + onVisibilityChange?: (visible: boolean) => void; + children?: React.ReactNode; +} + +const INITIAL_FOCUS_STATE: InternalFocusState = { + clickTriggered: false, + selectionStart: null, + selectionEnd: null, +}; + +const PasswordToggleField: React.FC = ({ + __scopePasswordToggleField, + ...props +}: ScopedProps) => { + const baseId = useId(props.id); + const defaultInputId = `${baseId}-input`; + const [inputIdState, setInputIdState] = React.useState(defaultInputId); + const inputId = inputIdState ?? defaultInputId; + const syncInputId = React.useCallback( + (providedId: string | number | undefined) => + setInputIdState(providedId != null ? String(providedId) : null), + [], + ); + + const { visible: visibleProp, defaultVisible, children } = props; + + let onVisibilityChange = props.onVisibilityChange; + let shouldWarn = false; + if ( + !onVisibilityChange && + 'onVisiblityChange' in props && + typeof props.onVisiblityChange === 'function' + ) { + shouldWarn = true; + onVisibilityChange = props.onVisiblityChange as (visible: boolean) => void; + } else { + onVisibilityChange = props.onVisibilityChange; + } + + if (process.env.NODE_ENV !== 'production') { + // oxlint-disable-next-line react-hooks/rules-of-hooks + React.useEffect(() => { + if (shouldWarn) { + console.warn( + 'PasswordToggleField: The misspelled `onVisiblityChange` prop has been removed. Please use `onVisibilityChange` instead.', + ); + } + }, [shouldWarn]); + } + + const [visible = false, setVisible] = useControllableState({ + caller: PASSWORD_TOGGLE_FIELD_NAME, + prop: visibleProp, + defaultProp: defaultVisible ?? false, + onChange: onVisibilityChange, + }); + + const inputRef = React.useRef(null); + const focusState = React.useRef(INITIAL_FOCUS_STATE); + + return ( + + {children} + + ); +}; +PasswordToggleField.displayName = PASSWORD_TOGGLE_FIELD_NAME; + +/* ------------------------------------------------------------------------------------------------- + * PasswordToggleFieldInput + * -----------------------------------------------------------------------------------------------*/ + +const PASSWORD_TOGGLE_FIELD_INPUT_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Input'; + +type PrimitiveInputProps = PrimitivePropsWithRef<'input'>; + +interface PasswordToggleFieldOwnProps { + autoComplete?: 'current-password' | 'new-password'; +} + +interface PasswordToggleFieldInputProps + extends + PasswordToggleFieldOwnProps, + Omit { + autoComplete?: 'current-password' | 'new-password'; +} + +const PasswordToggleFieldInput = React.forwardRef( + ( + { + __scopePasswordToggleField, + autoComplete = 'current-password', + autoCapitalize = 'off', + spellCheck = false, + id: idProp, + ...props + }: ScopedProps, + forwardedRef, + ) => { + const { visible, inputRef, inputId, syncInputId, setVisible, focusState } = + usePasswordToggleFieldContext(PASSWORD_TOGGLE_FIELD_INPUT_NAME, __scopePasswordToggleField); + + React.useEffect(() => { + syncInputId(idProp); + }, [idProp, syncInputId]); + + // We want to reset the visibility to `false` to revert the input to + // `type="password"` when: + // - The form is reset (for consistency with other form controls) + // - The form is submitted (to prevent the browser from remembering the + // input's value. + // + // See "Keeping things secure": + // https://technology.blog.gov.uk/2021/04/19/simple-things-are-complicated-making-a-show-password-option/) + const _setVisible = useEffectEvent(setVisible); + React.useEffect(() => { + const inputElement = inputRef.current; + const form = inputElement?.form; + if (!form) { + return; + } + + const controller = new AbortController(); + form.addEventListener( + 'reset', + (event) => { + if (!event.defaultPrevented) { + _setVisible(false); + } + }, + { signal: controller.signal }, + ); + form.addEventListener( + 'submit', + () => { + // always reset the visibility on submit regardless of whether the + // default action is prevented + _setVisible(false); + }, + { signal: controller.signal }, + ); + return () => { + controller.abort(); + }; + }, [inputRef]); + + return ( + { + // get the cursor position + const { selectionStart, selectionEnd } = event.currentTarget; + focusState.current.selectionStart = selectionStart; + focusState.current.selectionEnd = selectionEnd; + })} + /> + ); + }, +); +PasswordToggleFieldInput.displayName = PASSWORD_TOGGLE_FIELD_INPUT_NAME; + +/* ------------------------------------------------------------------------------------------------- + * PasswordToggleFieldToggle + * -----------------------------------------------------------------------------------------------*/ + +const PASSWORD_TOGGLE_FIELD_TOGGLE_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Toggle'; + +type PrimitiveButtonProps = PrimitivePropsWithRef<'button'>; + +interface PasswordToggleFieldToggleProps extends Omit {} + +const PasswordToggleFieldToggle = React.forwardRef< + HTMLButtonElement, + PasswordToggleFieldToggleProps +>( + ( + { + __scopePasswordToggleField, + onClick, + onPointerDown, + onPointerCancel, + onPointerUp, + onFocus, + children, + 'aria-label': ariaLabelProp, + 'aria-controls': ariaControls, + 'aria-hidden': ariaHidden, + tabIndex, + ...props + }: ScopedProps, + forwardedRef, + ) => { + const { setVisible, visible, inputRef, inputId, focusState } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_TOGGLE_NAME, + __scopePasswordToggleField, + ); + const [internalAriaLabel, setInternalAriaLabel] = React.useState(undefined); + const elementRef = React.useRef(null); + const ref = useComposedRefs(forwardedRef, elementRef); + const isHydrated = useIsHydrated(); + + React.useEffect(() => { + const element = elementRef.current; + if (!element || ariaLabelProp) { + setInternalAriaLabel(undefined); + return; + } + + const DEFAULT_ARIA_LABEL = visible ? 'Hide password' : 'Show password'; + + function checkForInnerTextLabel(textContent: string | undefined | null) { + const text = textContent ? textContent : undefined; + // If the element has inner text, no need to force an aria-label. + setInternalAriaLabel(text ? undefined : DEFAULT_ARIA_LABEL); + } + + checkForInnerTextLabel(element.textContent); + + const observer = new MutationObserver((entries) => { + let textContent: string | undefined; + for (const entry of entries) { + if (entry.type === 'characterData') { + if (element.textContent) { + textContent = element.textContent; + } + } + } + checkForInnerTextLabel(textContent); + }); + observer.observe(element, { characterData: true, subtree: true }); + return () => { + observer.disconnect(); + }; + }, [visible, ariaLabelProp]); + + const ariaLabel = ariaLabelProp || internalAriaLabel; + + // Before hydration the button will not work, but we want to render it + // regardless to prevent potential layout shift. Hide it from assistive tech + // by default. Post-hydration it will be visible, focusable and associated + // with the input via aria-controls. + if (!isHydrated) { + ariaHidden ??= true; + tabIndex ??= -1; + } else { + ariaControls ??= inputId; + } + + React.useEffect(() => { + let cleanup = () => {}; + const ownerWindow = elementRef.current?.ownerDocument?.defaultView || window; + const reset = () => (focusState.current.clickTriggered = false); + const handlePointerUp = () => (cleanup = requestIdleCallback(ownerWindow, reset)); + ownerWindow.addEventListener('pointerup', handlePointerUp); + return () => { + cleanup(); + ownerWindow.removeEventListener('pointerup', handlePointerUp); + }; + }, [focusState]); + + return ( + { + focusState.current.clickTriggered = true; + })} + onPointerCancel={(event) => { + // do not use `composeEventHandlers` here because we always want to + // reset the ref on cancellation, regardless of whether the user has + // called preventDefault on the event + onPointerCancel?.(event); + focusState.current = INITIAL_FOCUS_STATE; + }} + // do not use `composeEventHandlers` here because we always want to + // reset the ref after click, regardless of whether the user has + // called preventDefault on the event + onClick={(event) => { + onClick?.(event); + if (event.defaultPrevented) { + focusState.current = INITIAL_FOCUS_STATE; + return; + } + + flushSync(() => { + setVisible((s) => !s); + }); + if (focusState.current.clickTriggered) { + const input = inputRef.current; + if (input) { + const { selectionStart, selectionEnd } = focusState.current; + input.focus(); + if (selectionStart !== null || selectionEnd !== null) { + // wait a tick so that focus has settled, then restore select position + requestAnimationFrame(() => { + // make sure the input still has focus (developer may have + // programatically moved focus elsewhere) + if (input.ownerDocument.activeElement === input) { + input.selectionStart = selectionStart; + input.selectionEnd = selectionEnd; + } + }); + } + } + } + focusState.current = INITIAL_FOCUS_STATE; + }} + onPointerUp={(event) => { + onPointerUp?.(event); + // if click handler hasn't been called at this point, it may have been + // intercepted, in which case we still want to reset our internal + // state + setTimeout(() => { + focusState.current = INITIAL_FOCUS_STATE; + }, 50); + }} + type="button" + > + {children} + + ); + }, +); +PasswordToggleFieldToggle.displayName = PASSWORD_TOGGLE_FIELD_TOGGLE_NAME; + +/* ------------------------------------------------------------------------------------------------- + * PasswordToggleFieldSlot + * -----------------------------------------------------------------------------------------------*/ + +const PASSWORD_TOGGLE_FIELD_SLOT_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Slot'; + +interface PasswordToggleFieldSlotDeclarativeProps { + visible: React.ReactNode; + hidden: React.ReactNode; +} + +interface PasswordToggleFieldSlotRenderProps { + render: (args: { visible: boolean }) => React.ReactElement; +} + +type PasswordToggleFieldSlotProps = + | PasswordToggleFieldSlotDeclarativeProps + | PasswordToggleFieldSlotRenderProps; + +const PasswordToggleFieldSlot: React.FC = ({ + __scopePasswordToggleField, + ...props +}: ScopedProps) => { + const { visible } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_SLOT_NAME, + __scopePasswordToggleField, + ); + + return 'render' in props + ? // + props.render({ visible }) + : visible + ? props.visible + : props.hidden; +}; +PasswordToggleFieldSlot.displayName = PASSWORD_TOGGLE_FIELD_SLOT_NAME; + +/* ------------------------------------------------------------------------------------------------- + * PasswordToggleFieldIcon + * -----------------------------------------------------------------------------------------------*/ + +const PASSWORD_TOGGLE_FIELD_ICON_NAME = PASSWORD_TOGGLE_FIELD_NAME + 'Icon'; + +type PrimitiveSvgProps = PrimitivePropsWithRef<'svg'>; + +interface PasswordToggleFieldIconProps extends Omit { + visible: React.ReactElement; + hidden: React.ReactElement; +} + +const PasswordToggleFieldIcon = React.forwardRef( + ( + { + __scopePasswordToggleField, + // @ts-expect-error + children, + ...props + }: ScopedProps, + forwardedRef, + ) => { + const { visible } = usePasswordToggleFieldContext( + PASSWORD_TOGGLE_FIELD_ICON_NAME, + __scopePasswordToggleField, + ); + const { visible: visibleIcon, hidden: hiddenIcon, ...domProps } = props; + return ( + + {visible ? visibleIcon : hiddenIcon} + + ); + }, +); +PasswordToggleFieldIcon.displayName = PASSWORD_TOGGLE_FIELD_ICON_NAME; + +export { + PasswordToggleField, + PasswordToggleFieldInput, + PasswordToggleFieldToggle, + PasswordToggleFieldSlot, + PasswordToggleFieldIcon, + // + PasswordToggleField as Root, + PasswordToggleFieldInput as Input, + PasswordToggleFieldToggle as Toggle, + PasswordToggleFieldSlot as Slot, + PasswordToggleFieldIcon as Icon, +}; +export type { + PasswordToggleFieldProps, + PasswordToggleFieldInputProps, + PasswordToggleFieldToggleProps, + PasswordToggleFieldIconProps, + PasswordToggleFieldSlotProps, +}; + +function requestIdleCallback( + window: Window, + callback: IdleRequestCallback, + options?: IdleRequestOptions, +): () => void { + if ((window as any).requestIdleCallback) { + const id = window.requestIdleCallback(callback, options); + return () => { + window.cancelIdleCallback(id); + }; + } + const start = Date.now(); + const id = window.setTimeout(() => { + const timeRemaining = () => Math.max(0, 50 - (Date.now() - start)); + callback({ didTimeout: false, timeRemaining }); + }, 1); + return () => { + window.clearTimeout(id); + }; +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/README.md new file mode 100644 index 0000000000000000000000000000000000000000..aae69b625c341062799387ca13addb41fd6c855d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/README.md @@ -0,0 +1,3 @@ +# `react-popover` + +View docs [here](https://radix-ui.com/primitives/docs/components/popover). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..83bdfa3cf595c498f57b1674cddfcc00d158cdd3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.d.mts @@ -0,0 +1,85 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createPopoverScope: _radix_ui_react_context.CreateScope; +interface PopoverProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?: (open: boolean) => void; + modal?: boolean; +} +declare const Popover: React.FC; +type PopperAnchorProps = React.ComponentPropsWithoutRef; +interface PopoverAnchorProps extends PopperAnchorProps { +} +declare const PopoverAnchor: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface PopoverTriggerProps extends PrimitiveButtonProps { +} +declare const PopoverTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface PopoverPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const PopoverPortal: React.FC; +interface PopoverContentProps extends PopoverContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const PopoverContent: React.ForwardRefExoticComponent>; +interface PopoverContentTypeProps extends Omit { +} +type FocusScopeProps = React.ComponentPropsWithoutRef; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type PopperContentProps = React.ComponentPropsWithoutRef; +interface PopoverContentImplProps extends Omit, Omit { + /** + * Whether focus should be trapped within the `Popover` + * (default: false) + */ + trapFocus?: FocusScopeProps['trapped']; + /** + * Event handler called when auto-focusing on open. + * Can be prevented. + */ + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; +} +interface PopoverCloseProps extends PrimitiveButtonProps { +} +declare const PopoverClose: React.ForwardRefExoticComponent>; +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface PopoverArrowProps extends PopperArrowProps { +} +declare const PopoverArrow: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Anchor: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Close: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; + +export { Anchor, Arrow, Close, Content, Popover, PopoverAnchor, type PopoverAnchorProps, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverPortalProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Portal, Root, Trigger, createPopoverScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..83bdfa3cf595c498f57b1674cddfcc00d158cdd3 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.d.ts @@ -0,0 +1,85 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createPopoverScope: _radix_ui_react_context.CreateScope; +interface PopoverProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?: (open: boolean) => void; + modal?: boolean; +} +declare const Popover: React.FC; +type PopperAnchorProps = React.ComponentPropsWithoutRef; +interface PopoverAnchorProps extends PopperAnchorProps { +} +declare const PopoverAnchor: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface PopoverTriggerProps extends PrimitiveButtonProps { +} +declare const PopoverTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface PopoverPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const PopoverPortal: React.FC; +interface PopoverContentProps extends PopoverContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const PopoverContent: React.ForwardRefExoticComponent>; +interface PopoverContentTypeProps extends Omit { +} +type FocusScopeProps = React.ComponentPropsWithoutRef; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type PopperContentProps = React.ComponentPropsWithoutRef; +interface PopoverContentImplProps extends Omit, Omit { + /** + * Whether focus should be trapped within the `Popover` + * (default: false) + */ + trapFocus?: FocusScopeProps['trapped']; + /** + * Event handler called when auto-focusing on open. + * Can be prevented. + */ + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; +} +interface PopoverCloseProps extends PrimitiveButtonProps { +} +declare const PopoverClose: React.ForwardRefExoticComponent>; +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface PopoverArrowProps extends PopperArrowProps { +} +declare const PopoverArrow: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Anchor: React.ForwardRefExoticComponent>; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Content: React.ForwardRefExoticComponent>; +declare const Close: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; + +export { Anchor, Arrow, Close, Content, Popover, PopoverAnchor, type PopoverAnchorProps, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverPortalProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Portal, Root, Trigger, createPopoverScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a935d35f01a2818c12cee6933a8a16bfe6a74bf8 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.js @@ -0,0 +1,353 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Anchor: () => Anchor2, + Arrow: () => Arrow2, + Close: () => Close, + Content: () => Content2, + Popover: () => Popover, + PopoverAnchor: () => PopoverAnchor, + PopoverArrow: () => PopoverArrow, + PopoverClose: () => PopoverClose, + PopoverContent: () => PopoverContent, + PopoverPortal: () => PopoverPortal, + PopoverTrigger: () => PopoverTrigger, + Portal: () => Portal, + Root: () => Root2, + Trigger: () => Trigger, + createPopoverScope: () => createPopoverScope +}); +module.exports = __toCommonJS(index_exports); + +// src/popover.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_react_focus_guards = require("@radix-ui/react-focus-guards"); +var import_react_focus_scope = require("@radix-ui/react-focus-scope"); +var import_react_id = require("@radix-ui/react-id"); +var PopperPrimitive = __toESM(require("@radix-ui/react-popper")); +var import_react_popper = require("@radix-ui/react-popper"); +var import_react_portal = require("@radix-ui/react-portal"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_slot = require("@radix-ui/react-slot"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_aria_hidden = require("aria-hidden"); +var import_react_remove_scroll = require("react-remove-scroll"); +var import_jsx_runtime = require("react/jsx-runtime"); +var POPOVER_NAME = "Popover"; +var [createPopoverContext, createPopoverScope] = (0, import_react_context.createContextScope)(POPOVER_NAME, [ + import_react_popper.createPopperScope +]); +var usePopperScope = (0, import_react_popper.createPopperScope)(); +var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME); +var Popover = (props) => { + const { + __scopePopover, + children, + open: openProp, + defaultOpen, + onOpenChange, + modal = false + } = props; + const popperScope = usePopperScope(__scopePopover); + const triggerRef = React.useRef(null); + const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: POPOVER_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopoverProvider, + { + scope: __scopePopover, + contentId: (0, import_react_id.useId)(), + triggerRef, + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + hasCustomAnchor, + onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []), + onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []), + modal, + children + } + ) }); +}; +Popover.displayName = POPOVER_NAME; +var ANCHOR_NAME = "PopoverAnchor"; +var PopoverAnchor = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...anchorProps } = props; + const context = usePopoverContext(ANCHOR_NAME, __scopePopover); + const popperScope = usePopperScope(__scopePopover); + const { onCustomAnchorAdd, onCustomAnchorRemove } = context; + React.useEffect(() => { + onCustomAnchorAdd(); + return () => onCustomAnchorRemove(); + }, [onCustomAnchorAdd, onCustomAnchorRemove]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef }); + } +); +PopoverAnchor.displayName = ANCHOR_NAME; +var TRIGGER_NAME = "PopoverTrigger"; +var PopoverTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...triggerProps } = props; + const context = usePopoverContext(TRIGGER_NAME, __scopePopover); + const popperScope = usePopperScope(__scopePopover); + const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef); + const trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : void 0, + "data-state": getState(context.open), + ...triggerProps, + ref: composedTriggerRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle) + } + ); + return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger }); + } +); +PopoverTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "PopoverPortal"; +var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, { + forceMount: void 0 +}); +var PopoverPortal = (props) => { + const { __scopePopover, forceMount, children, container } = props; + const context = usePopoverContext(PORTAL_NAME, __scopePopover); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children }) }) }); +}; +PopoverPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "PopoverContent"; +var PopoverContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) }); + } +); +PopoverContent.displayName = CONTENT_NAME; +var Slot = (0, import_react_slot.createSlot)("PopoverContent.RemoveScroll"); +var PopoverContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); + const contentRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef); + const isRightClickOutsideRef = React.useRef(false); + React.useEffect(() => { + const content = contentRef.current; + if (content) return (0, import_aria_hidden.hideOthers)(content); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopoverContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: true, + onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => { + event.preventDefault(); + if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus(); + }), + onPointerDownOutside: (0, import_primitive.composeEventHandlers)( + props.onPointerDownOutside, + (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + isRightClickOutsideRef.current = isRightClick; + }, + { checkForDefaultPrevented: false } + ), + onFocusOutside: (0, import_primitive.composeEventHandlers)( + props.onFocusOutside, + (event) => event.preventDefault(), + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +var PopoverContentNonModal = React.forwardRef( + (props, forwardedRef) => { + const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); + const hasInteractedOutsideRef = React.useRef(false); + const hasPointerDownOutsideRef = React.useRef(false); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopoverContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented) { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === "pointerdown") { + hasPointerDownOutsideRef.current = true; + } + } + const target = event.target; + const targetIsTrigger = context.triggerRef.current?.contains(target); + if (targetIsTrigger) event.preventDefault(); + if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { + event.preventDefault(); + } + } + } + ); + } +); +var PopoverContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { + __scopePopover, + trapFocus, + onOpenAutoFocus, + onCloseAutoFocus, + disableOutsidePointerEvents, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + ...contentProps + } = props; + const context = usePopoverContext(CONTENT_NAME, __scopePopover); + const popperScope = usePopperScope(__scopePopover); + (0, import_react_focus_guards.useFocusGuards)(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_focus_scope.FocusScope, + { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents, + onInteractOutside, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onDismiss: () => context.onOpenChange(false), + deferPointerDownOutside: true, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopperPrimitive.Content, + { + "data-state": getState(context.open), + role: "dialog", + id: context.contentId, + ...popperScope, + ...contentProps, + ref: forwardedRef, + style: { + ...contentProps.style, + // re-namespace exposed content custom properties + ...{ + "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-popover-content-available-width": "var(--radix-popper-available-width)", + "--radix-popover-content-available-height": "var(--radix-popper-available-height)", + "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ) + } + ) + } + ); + } +); +var CLOSE_NAME = "PopoverClose"; +var PopoverClose = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...closeProps } = props; + const context = usePopoverContext(CLOSE_NAME, __scopePopover); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + ...closeProps, + ref: forwardedRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false)) + } + ); + } +); +PopoverClose.displayName = CLOSE_NAME; +var ARROW_NAME = "PopoverArrow"; +var PopoverArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...arrowProps } = props; + const popperScope = usePopperScope(__scopePopover); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); + } +); +PopoverArrow.displayName = ARROW_NAME; +function getState(open) { + return open ? "open" : "closed"; +} +var Root2 = Popover; +var Anchor2 = PopoverAnchor; +var Trigger = PopoverTrigger; +var Portal = PopoverPortal; +var Content2 = PopoverContent; +var Close = PopoverClose; +var Arrow2 = PopoverArrow; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..22c1d3d8b5adfb3a1be4a225bc098869b5c6b0a7 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/popover.tsx"], + "sourcesContent": ["'use client';\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n} from './popover';\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n} from './popover';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Popover\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPOVER_NAME = 'Popover';\n\ntype ScopedProps

= P & { __scopePopover?: Scope };\nconst [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype PopoverContextValue = {\n triggerRef: React.RefObject;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n hasCustomAnchor: boolean;\n onCustomAnchorAdd(): void;\n onCustomAnchorRemove(): void;\n modal: boolean;\n};\n\nconst [PopoverProvider, usePopoverContext] =\n createPopoverContext(POPOVER_NAME);\n\ninterface PopoverProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\nconst Popover: React.FC = (props: ScopedProps) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false,\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: POPOVER_NAME,\n });\n\n return (\n \n setOpen((prevOpen) => !prevOpen), [setOpen])}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal={modal}\n >\n {children}\n \n \n );\n};\n\nPopover.displayName = POPOVER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopoverAnchor';\n\ntype PopoverAnchorElement = React.ComponentRef;\ntype PopperAnchorProps = React.ComponentPropsWithoutRef;\ninterface PopoverAnchorProps extends PopperAnchorProps {}\n\nconst PopoverAnchor = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\n return ;\n },\n);\n\nPopoverAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'PopoverTrigger';\n\ntype PopoverTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface PopoverTriggerProps extends PrimitiveButtonProps {}\n\nconst PopoverTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n\n const trigger = (\n \n );\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n \n {trigger}\n \n );\n },\n);\n\nPopoverTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'PopoverPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface PopoverPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverPortal: React.FC = (props: ScopedProps) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nPopoverPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopoverContent';\n\ninterface PopoverContentProps extends PopoverContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return (\n \n {context.modal ? (\n \n ) : (\n \n )}\n \n );\n },\n);\n\nPopoverContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Slot = createSlot('PopoverContent.RemoveScroll');\n\ntype PopoverContentTypeElement = PopoverContentImplElement;\ninterface PopoverContentTypeProps extends Omit<\n PopoverContentImplProps,\n 'trapFocus' | 'disableOutsidePointerEvents'\n> {}\n\nconst PopoverContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n \n {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false },\n )}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nconst PopoverContentNonModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentImplElement = React.ComponentRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ninterface PopoverContentImplProps\n extends Omit, Omit {\n /**\n * Whether focus should be trapped within the `Popover`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst PopoverContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n\n // Make sure the whole tree has focus guards as our `Popover` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n \n context.onOpenChange(false)}\n deferPointerDownOutside\n >\n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'PopoverClose';\n\ntype PopoverCloseElement = React.ComponentRef;\ninterface PopoverCloseProps extends PrimitiveButtonProps {}\n\nconst PopoverClose = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return (\n context.onOpenChange(false))}\n />\n );\n },\n);\n\nPopoverClose.displayName = CLOSE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopoverArrow';\n\ntype PopoverArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface PopoverArrowProps extends PopperArrowProps {}\n\nconst PopoverArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return ;\n },\n);\n\nPopoverArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Popover;\nconst Anchor = PopoverAnchor;\nconst Trigger = PopoverTrigger;\nconst Portal = PopoverPortal;\nconst Content = PopoverContent;\nconst Close = PopoverClose;\nconst Arrow = PopoverArrow;\n\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n};\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA,aAAAC;AAAA,EAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,qCAAiC;AACjC,gCAA+B;AAC/B,+BAA2B;AAC3B,sBAAsB;AACtB,sBAAiC;AACjC,0BAAkC;AAClC,0BAA0C;AAC1C,4BAAyB;AACzB,6BAA0B;AAC1B,wBAA2B;AAC3B,0CAAqC;AACrC,yBAA2B;AAC3B,iCAA6B;AA4DvB;AApDN,IAAM,eAAe;AAGrB,IAAM,CAAC,sBAAsB,kBAAkB,QAAI,yCAAmB,cAAc;AAAA,EAClF;AAC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AG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,uCAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAM3B,IAAM,aAAa;AAMnB,IAAM,eAAqB;AAAA,EACzB,CAAC,OAAuC,iBAAiB;AACvD,UAAM,EAAE,gBAAgB,GAAG,WAAW,IAAI;AAC1C,UAAM,cAAc,eAAe,cAAc;AACjD,WAAO,4CAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,YAAY,KAAK,cAAc;AAAA,EACpF;AACF;AAEA,aAAa,cAAc;AAI3B,SAAS,SAAS,MAAe;AAC/B,SAAO,OAAO,SAAS;AACzB;AAEA,IAAMC,QAAO;AACb,IAAMC,UAAS;AACf,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAM,QAAQ;AACd,IAAMC,SAAQ;", + "names": ["Anchor", "Arrow", "Content", "Root", "PortalPrimitive", "Root", "Anchor", "Content", "Arrow"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2577ab21b08f9d11781fd29e6ab23750df7a30a9 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.mjs @@ -0,0 +1,321 @@ +"use client"; + +// src/popover.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; +import { useFocusGuards } from "@radix-ui/react-focus-guards"; +import { FocusScope } from "@radix-ui/react-focus-scope"; +import { useId } from "@radix-ui/react-id"; +import * as PopperPrimitive from "@radix-ui/react-popper"; +import { createPopperScope } from "@radix-ui/react-popper"; +import { Portal as PortalPrimitive } from "@radix-ui/react-portal"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive } from "@radix-ui/react-primitive"; +import { createSlot } from "@radix-ui/react-slot"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { hideOthers } from "aria-hidden"; +import { RemoveScroll } from "react-remove-scroll"; +import { jsx } from "react/jsx-runtime"; +var POPOVER_NAME = "Popover"; +var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [ + createPopperScope +]); +var usePopperScope = createPopperScope(); +var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME); +var Popover = (props) => { + const { + __scopePopover, + children, + open: openProp, + defaultOpen, + onOpenChange, + modal = false + } = props; + const popperScope = usePopperScope(__scopePopover); + const triggerRef = React.useRef(null); + const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false); + const [open, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: POPOVER_NAME + }); + return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx( + PopoverProvider, + { + scope: __scopePopover, + contentId: useId(), + triggerRef, + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + hasCustomAnchor, + onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []), + onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []), + modal, + children + } + ) }); +}; +Popover.displayName = POPOVER_NAME; +var ANCHOR_NAME = "PopoverAnchor"; +var PopoverAnchor = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...anchorProps } = props; + const context = usePopoverContext(ANCHOR_NAME, __scopePopover); + const popperScope = usePopperScope(__scopePopover); + const { onCustomAnchorAdd, onCustomAnchorRemove } = context; + React.useEffect(() => { + onCustomAnchorAdd(); + return () => onCustomAnchorRemove(); + }, [onCustomAnchorAdd, onCustomAnchorRemove]); + return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef }); + } +); +PopoverAnchor.displayName = ANCHOR_NAME; +var TRIGGER_NAME = "PopoverTrigger"; +var PopoverTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...triggerProps } = props; + const context = usePopoverContext(TRIGGER_NAME, __scopePopover); + const popperScope = usePopperScope(__scopePopover); + const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef); + const trigger = /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : void 0, + "data-state": getState(context.open), + ...triggerProps, + ref: composedTriggerRef, + onClick: composeEventHandlers(props.onClick, context.onOpenToggle) + } + ); + return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger }); + } +); +PopoverTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "PopoverPortal"; +var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, { + forceMount: void 0 +}); +var PopoverPortal = (props) => { + const { __scopePopover, forceMount, children, container } = props; + const context = usePopoverContext(PORTAL_NAME, __scopePopover); + return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) }); +}; +PopoverPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "PopoverContent"; +var PopoverContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) }); + } +); +PopoverContent.displayName = CONTENT_NAME; +var Slot = createSlot("PopoverContent.RemoveScroll"); +var PopoverContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, contentRef); + const isRightClickOutsideRef = React.useRef(false); + React.useEffect(() => { + const content = contentRef.current; + if (content) return hideOthers(content); + }, []); + return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx( + PopoverContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: true, + onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { + event.preventDefault(); + if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus(); + }), + onPointerDownOutside: composeEventHandlers( + props.onPointerDownOutside, + (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + isRightClickOutsideRef.current = isRightClick; + }, + { checkForDefaultPrevented: false } + ), + onFocusOutside: composeEventHandlers( + props.onFocusOutside, + (event) => event.preventDefault(), + { checkForDefaultPrevented: false } + ) + } + ) }); + } +); +var PopoverContentNonModal = React.forwardRef( + (props, forwardedRef) => { + const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); + const hasInteractedOutsideRef = React.useRef(false); + const hasPointerDownOutsideRef = React.useRef(false); + return /* @__PURE__ */ jsx( + PopoverContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented) { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === "pointerdown") { + hasPointerDownOutsideRef.current = true; + } + } + const target = event.target; + const targetIsTrigger = context.triggerRef.current?.contains(target); + if (targetIsTrigger) event.preventDefault(); + if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { + event.preventDefault(); + } + } + } + ); + } +); +var PopoverContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { + __scopePopover, + trapFocus, + onOpenAutoFocus, + onCloseAutoFocus, + disableOutsidePointerEvents, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + ...contentProps + } = props; + const context = usePopoverContext(CONTENT_NAME, __scopePopover); + const popperScope = usePopperScope(__scopePopover); + useFocusGuards(); + return /* @__PURE__ */ jsx( + FocusScope, + { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ jsx( + DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents, + onInteractOutside, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onDismiss: () => context.onOpenChange(false), + deferPointerDownOutside: true, + children: /* @__PURE__ */ jsx( + PopperPrimitive.Content, + { + "data-state": getState(context.open), + role: "dialog", + id: context.contentId, + ...popperScope, + ...contentProps, + ref: forwardedRef, + style: { + ...contentProps.style, + // re-namespace exposed content custom properties + ...{ + "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-popover-content-available-width": "var(--radix-popper-available-width)", + "--radix-popover-content-available-height": "var(--radix-popper-available-height)", + "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ) + } + ) + } + ); + } +); +var CLOSE_NAME = "PopoverClose"; +var PopoverClose = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...closeProps } = props; + const context = usePopoverContext(CLOSE_NAME, __scopePopover); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + ...closeProps, + ref: forwardedRef, + onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false)) + } + ); + } +); +PopoverClose.displayName = CLOSE_NAME; +var ARROW_NAME = "PopoverArrow"; +var PopoverArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopover, ...arrowProps } = props; + const popperScope = usePopperScope(__scopePopover); + return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); + } +); +PopoverArrow.displayName = ARROW_NAME; +function getState(open) { + return open ? "open" : "closed"; +} +var Root2 = Popover; +var Anchor2 = PopoverAnchor; +var Trigger = PopoverTrigger; +var Portal = PopoverPortal; +var Content2 = PopoverContent; +var Close = PopoverClose; +var Arrow2 = PopoverArrow; +export { + Anchor2 as Anchor, + Arrow2 as Arrow, + Close, + Content2 as Content, + Popover, + PopoverAnchor, + PopoverArrow, + PopoverClose, + PopoverContent, + PopoverPortal, + PopoverTrigger, + Portal, + Root2 as Root, + Trigger, + createPopoverScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..51aa9cc418c788240651d090928aabd871de10d0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/popover.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Popover\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPOVER_NAME = 'Popover';\n\ntype ScopedProps

= P & { __scopePopover?: Scope };\nconst [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype PopoverContextValue = {\n triggerRef: React.RefObject;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n hasCustomAnchor: boolean;\n onCustomAnchorAdd(): void;\n onCustomAnchorRemove(): void;\n modal: boolean;\n};\n\nconst [PopoverProvider, usePopoverContext] =\n createPopoverContext(POPOVER_NAME);\n\ninterface PopoverProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\nconst Popover: React.FC = (props: ScopedProps) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false,\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: POPOVER_NAME,\n });\n\n return (\n \n setOpen((prevOpen) => !prevOpen), [setOpen])}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal={modal}\n >\n {children}\n \n \n );\n};\n\nPopover.displayName = POPOVER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopoverAnchor';\n\ntype PopoverAnchorElement = React.ComponentRef;\ntype PopperAnchorProps = React.ComponentPropsWithoutRef;\ninterface PopoverAnchorProps extends PopperAnchorProps {}\n\nconst PopoverAnchor = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\n return ;\n },\n);\n\nPopoverAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'PopoverTrigger';\n\ntype PopoverTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface PopoverTriggerProps extends PrimitiveButtonProps {}\n\nconst PopoverTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n\n const trigger = (\n \n );\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n \n {trigger}\n \n );\n },\n);\n\nPopoverTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'PopoverPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface PopoverPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverPortal: React.FC = (props: ScopedProps) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nPopoverPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopoverContent';\n\ninterface PopoverContentProps extends PopoverContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return (\n \n {context.modal ? (\n \n ) : (\n \n )}\n \n );\n },\n);\n\nPopoverContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Slot = createSlot('PopoverContent.RemoveScroll');\n\ntype PopoverContentTypeElement = PopoverContentImplElement;\ninterface PopoverContentTypeProps extends Omit<\n PopoverContentImplProps,\n 'trapFocus' | 'disableOutsidePointerEvents'\n> {}\n\nconst PopoverContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n \n {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false },\n )}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false },\n )}\n />\n \n );\n },\n);\n\nconst PopoverContentNonModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentImplElement = React.ComponentRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ninterface PopoverContentImplProps\n extends Omit, Omit {\n /**\n * Whether focus should be trapped within the `Popover`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst PopoverContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n\n // Make sure the whole tree has focus guards as our `Popover` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n \n context.onOpenChange(false)}\n deferPointerDownOutside\n >\n \n \n \n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'PopoverClose';\n\ntype PopoverCloseElement = React.ComponentRef;\ninterface PopoverCloseProps extends PrimitiveButtonProps {}\n\nconst PopoverClose = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return (\n context.onOpenChange(false))}\n />\n );\n },\n);\n\nPopoverClose.displayName = CLOSE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopoverArrow';\n\ntype PopoverArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface PopoverArrowProps extends PopperArrowProps {}\n\nconst PopoverArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return ;\n },\n);\n\nPopoverArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Popover;\nconst Anchor = PopoverAnchor;\nconst Trigger = PopoverTrigger;\nconst Portal = PopoverPortal;\nconst Content = PopoverContent;\nconst Close = PopoverClose;\nconst Arrow = PopoverArrow;\n\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n};\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC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gB,GAAG,WAAW,IAAI;AAC1C,UAAM,UAAU,kBAAkB,YAAY,cAAc;AAC5D,WACE;AAAA,MAAC,UAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACJ,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,SAAS,qBAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAM3B,IAAM,aAAa;AAMnB,IAAM,eAAqB;AAAA,EACzB,CAAC,OAAuC,iBAAiB;AACvD,UAAM,EAAE,gBAAgB,GAAG,WAAW,IAAI;AAC1C,UAAM,cAAc,eAAe,cAAc;AACjD,WAAO,oBAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,YAAY,KAAK,cAAc;AAAA,EACpF;AACF;AAEA,aAAa,cAAc;AAI3B,SAAS,SAAS,MAAe;AAC/B,SAAO,OAAO,SAAS;AACzB;AAEA,IAAMA,QAAO;AACb,IAAMC,UAAS;AACf,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAM,QAAQ;AACd,IAAMC,SAAQ;", + "names": ["Root", "Anchor", "Content", "Arrow"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c6cfff3b9b6bfb39d7894fa3f46e3d0cf90eb852 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popover/package.json @@ -0,0 +1,82 @@ +{ + "name": "@radix-ui/react-popover", + "version": "1.1.17", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.7.2", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-dismissable-layer": "1.1.13", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-focus-scope": "1.1.10", + "@radix-ui/react-focus-guards": "1.1.4", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-portal": "1.1.12", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-slot": "1.3.0", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-popper": "1.3.1" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/typescript-config": "0.0.0", + "@repo/builder": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/popover" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/README.md new file mode 100644 index 0000000000000000000000000000000000000000..187ada0533f0c3f9079ce91584112e30d6824323 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/README.md @@ -0,0 +1,3 @@ +# `react-popper` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..bffb3cd79339bf87dd2527967055423518ec7645 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.d.mts @@ -0,0 +1,46 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import * as ArrowPrimitive from '@radix-ui/react-arrow'; +import { Primitive } from '@radix-ui/react-primitive'; +import { Measurable } from '@radix-ui/rect'; + +declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"]; +declare const ALIGN_OPTIONS: readonly ["start", "center", "end"]; +type Side = (typeof SIDE_OPTIONS)[number]; +type Align = (typeof ALIGN_OPTIONS)[number]; +declare const createPopperScope: _radix_ui_react_context.CreateScope; +interface PopperProps { + children?: React.ReactNode; +} +declare const Popper: React.FC; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface PopperAnchorProps extends PrimitiveDivProps { + virtualRef?: React.RefObject; +} +declare const PopperAnchor: React.ForwardRefExoticComponent>; +type Boundary = Element | null; +interface PopperContentProps extends PrimitiveDivProps { + side?: Side; + sideOffset?: number; + align?: Align; + alignOffset?: number; + arrowPadding?: number; + avoidCollisions?: boolean; + collisionBoundary?: Boundary | Boundary[]; + collisionPadding?: number | Partial>; + sticky?: 'partial' | 'always'; + hideWhenDetached?: boolean; + updatePositionStrategy?: 'optimized' | 'always'; + onPlaced?: () => void; +} +declare const PopperContent: React.ForwardRefExoticComponent>; +type ArrowProps = React.ComponentPropsWithoutRef; +interface PopperArrowProps extends ArrowProps { +} +declare const PopperArrow: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Anchor: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; + +export { ALIGN_OPTIONS, Anchor, Arrow, Content, Popper, PopperAnchor, type PopperAnchorProps, PopperArrow, type PopperArrowProps, PopperContent, type PopperContentProps, type PopperProps, Root, SIDE_OPTIONS, createPopperScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bffb3cd79339bf87dd2527967055423518ec7645 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.d.ts @@ -0,0 +1,46 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import * as ArrowPrimitive from '@radix-ui/react-arrow'; +import { Primitive } from '@radix-ui/react-primitive'; +import { Measurable } from '@radix-ui/rect'; + +declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"]; +declare const ALIGN_OPTIONS: readonly ["start", "center", "end"]; +type Side = (typeof SIDE_OPTIONS)[number]; +type Align = (typeof ALIGN_OPTIONS)[number]; +declare const createPopperScope: _radix_ui_react_context.CreateScope; +interface PopperProps { + children?: React.ReactNode; +} +declare const Popper: React.FC; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface PopperAnchorProps extends PrimitiveDivProps { + virtualRef?: React.RefObject; +} +declare const PopperAnchor: React.ForwardRefExoticComponent>; +type Boundary = Element | null; +interface PopperContentProps extends PrimitiveDivProps { + side?: Side; + sideOffset?: number; + align?: Align; + alignOffset?: number; + arrowPadding?: number; + avoidCollisions?: boolean; + collisionBoundary?: Boundary | Boundary[]; + collisionPadding?: number | Partial>; + sticky?: 'partial' | 'always'; + hideWhenDetached?: boolean; + updatePositionStrategy?: 'optimized' | 'always'; + onPlaced?: () => void; +} +declare const PopperContent: React.ForwardRefExoticComponent>; +type ArrowProps = React.ComponentPropsWithoutRef; +interface PopperArrowProps extends ArrowProps { +} +declare const PopperArrow: React.ForwardRefExoticComponent>; +declare const Root: React.FC; +declare const Anchor: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Arrow: React.ForwardRefExoticComponent>; + +export { ALIGN_OPTIONS, Anchor, Arrow, Content, Popper, PopperAnchor, type PopperAnchorProps, PopperArrow, type PopperArrowProps, PopperContent, type PopperContentProps, type PopperProps, Root, SIDE_OPTIONS, createPopperScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cf80e2327b5459167c6d837469b7b7bc3107cc11 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.js @@ -0,0 +1,384 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + ALIGN_OPTIONS: () => ALIGN_OPTIONS, + Anchor: () => Anchor, + Arrow: () => Arrow, + Content: () => Content, + Popper: () => Popper, + PopperAnchor: () => PopperAnchor, + PopperArrow: () => PopperArrow, + PopperContent: () => PopperContent, + Root: () => Root2, + SIDE_OPTIONS: () => SIDE_OPTIONS, + createPopperScope: () => createPopperScope +}); +module.exports = __toCommonJS(index_exports); + +// src/popper.tsx +var React = __toESM(require("react")); +var import_react_dom = require("@floating-ui/react-dom"); +var ArrowPrimitive = __toESM(require("@radix-ui/react-arrow")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_react_use_size = require("@radix-ui/react-use-size"); +var import_jsx_runtime = require("react/jsx-runtime"); +var SIDE_OPTIONS = ["top", "right", "bottom", "left"]; +var ALIGN_OPTIONS = ["start", "center", "end"]; +var POPPER_NAME = "Popper"; +var [createPopperContext, createPopperScope] = (0, import_react_context.createContextScope)(POPPER_NAME); +var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME); +var Popper = (props) => { + const { __scopePopper, children } = props; + const [anchor, setAnchor] = React.useState(null); + const [placementState, setPlacementState] = React.useState(void 0); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopperProvider, + { + scope: __scopePopper, + anchor, + onAnchorChange: setAnchor, + placementState, + setPlacementState, + children + } + ); +}; +Popper.displayName = POPPER_NAME; +var ANCHOR_NAME = "PopperAnchor"; +var PopperAnchor = React.forwardRef( + (props, forwardedRef) => { + const { __scopePopper, virtualRef, ...anchorProps } = props; + const context = usePopperContext(ANCHOR_NAME, __scopePopper); + const ref = React.useRef(null); + const onAnchorChange = context.onAnchorChange; + const callbackRef = React.useCallback( + (node) => { + ref.current = node; + if (node) { + onAnchorChange(node); + } + }, + [onAnchorChange] + ); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, callbackRef); + const anchorRef = React.useRef(null); + React.useEffect(() => { + if (!virtualRef) { + return; + } + const previousAnchor = anchorRef.current; + anchorRef.current = virtualRef.current; + if (previousAnchor !== anchorRef.current) { + onAnchorChange(anchorRef.current); + } + }); + const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState); + const placedSide = sideAndAlign?.[0]; + const placedAlign = sideAndAlign?.[1]; + return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-radix-popper-side": placedSide, + "data-radix-popper-align": placedAlign, + ...anchorProps, + ref: composedRefs + } + ); + } +); +PopperAnchor.displayName = ANCHOR_NAME; +var CONTENT_NAME = "PopperContent"; +var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME); +var PopperContent = React.forwardRef( + (props, forwardedRef) => { + const { + __scopePopper, + side = "bottom", + sideOffset = 0, + align = "center", + alignOffset = 0, + arrowPadding = 0, + avoidCollisions = true, + collisionBoundary = [], + collisionPadding: collisionPaddingProp = 0, + sticky = "partial", + hideWhenDetached = false, + updatePositionStrategy = "optimized", + onPlaced, + ...contentProps + } = props; + const context = usePopperContext(CONTENT_NAME, __scopePopper); + const [content, setContent] = React.useState(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setContent(node)); + const [arrow, setArrow] = React.useState(null); + const arrowSize = (0, import_react_use_size.useSize)(arrow); + const arrowWidth = arrowSize?.width ?? 0; + const arrowHeight = arrowSize?.height ?? 0; + const desiredPlacement = side + (align !== "center" ? "-" + align : ""); + const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp }; + const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]; + const hasExplicitBoundaries = boundary.length > 0; + const detectOverflowOptions = { + padding: collisionPadding, + boundary: boundary.filter(isNotNull), + // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries + altBoundary: hasExplicitBoundaries + }; + const { refs, floatingStyles, placement, isPositioned, middlewareData } = (0, import_react_dom.useFloating)({ + // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues + strategy: "fixed", + placement: desiredPlacement, + whileElementsMounted: (...args) => { + const cleanup = (0, import_react_dom.autoUpdate)(...args, { + animationFrame: updatePositionStrategy === "always" + }); + return cleanup; + }, + elements: { + reference: context.anchor + }, + middleware: [ + (0, import_react_dom.offset)({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }), + avoidCollisions && (0, import_react_dom.shift)({ + mainAxis: true, + crossAxis: false, + limiter: sticky === "partial" ? (0, import_react_dom.limitShift)() : void 0, + ...detectOverflowOptions + }), + avoidCollisions && (0, import_react_dom.flip)({ ...detectOverflowOptions }), + (0, import_react_dom.size)({ + ...detectOverflowOptions, + apply: ({ elements, rects, availableWidth, availableHeight }) => { + const { width: anchorWidth, height: anchorHeight } = rects.reference; + const contentStyle = elements.floating.style; + contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`); + contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`); + contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`); + contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`); + } + }), + arrow && (0, import_react_dom.arrow)({ element: arrow, padding: arrowPadding }), + transformOrigin({ arrowWidth, arrowHeight }), + hideWhenDetached && (0, import_react_dom.hide)({ + strategy: "referenceHidden", + ...detectOverflowOptions, + // `hide` detects whether the anchor (reference) is clipped, so when + // no explicit `collisionBoundary` is set we fall back to Floating + // UI's default clipping ancestors (e.g. a scrollable menu). This + // lets an occluded submenu hide once its anchor scrolls out of view + // (#3237). The collision/size middlewares deliberately keep the + // viewport-based default to avoid clamping content rendered inside + // transformed or overflow-clipping portal containers. + boundary: hasExplicitBoundaries ? detectOverflowOptions.boundary : void 0 + }) + ] + }); + const setPlacementState = context.setPlacementState; + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + setPlacementState(placement); + return () => { + setPlacementState(void 0); + }; + }, [placement, setPlacementState]); + const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement); + const handlePlaced = (0, import_react_use_callback_ref.useCallbackRef)(onPlaced); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (isPositioned) { + handlePlaced?.(); + } + }, [isPositioned, handlePlaced]); + const arrowX = middlewareData.arrow?.x; + const arrowY = middlewareData.arrow?.y; + const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0; + const [contentZIndex, setContentZIndex] = React.useState(); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (content) setContentZIndex(window.getComputedStyle(content).zIndex); + }, [content]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "div", + { + ref: refs.setFloating, + "data-radix-popper-content-wrapper": "", + style: { + ...floatingStyles, + transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)", + // keep off the page when measuring + minWidth: "max-content", + zIndex: contentZIndex, + "--radix-popper-transform-origin": [ + middlewareData.transformOrigin?.x, + middlewareData.transformOrigin?.y + ].join(" "), + // hide the content if using the hide middleware and should be hidden + // set visibility to hidden and disable pointer events so the UI behaves + // as if the PopperContent isn't there at all + ...middlewareData.hide?.referenceHidden && { + visibility: "hidden", + pointerEvents: "none" + } + }, + dir: props.dir, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopperContentProvider, + { + scope: __scopePopper, + placedSide, + placedAlign, + onArrowChange: setArrow, + arrowX, + arrowY, + shouldHideArrow: cannotCenterArrow, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-side": placedSide, + "data-align": placedAlign, + ...contentProps, + ref: composedRefs, + style: { + ...contentProps.style, + // if the PopperContent hasn't been placed yet (not all measurements done) + // we prevent animations so that users's animation don't kick in too early referring wrong sides + animation: !isPositioned ? "none" : void 0 + } + } + ) + } + ) + } + ); + } +); +PopperContent.displayName = CONTENT_NAME; +var ARROW_NAME = "PopperArrow"; +var OPPOSITE_SIDE = { + top: "bottom", + right: "left", + bottom: "top", + left: "right" +}; +var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) { + const { __scopePopper, ...arrowProps } = props; + const contentContext = useContentContext(ARROW_NAME, __scopePopper); + const baseSide = OPPOSITE_SIDE[contentContext.placedSide]; + return ( + // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`) + // doesn't report size as we'd expect on SVG elements. + // it reports their bounding box which is effectively the largest path inside the SVG. + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "span", + { + ref: contentContext.onArrowChange, + style: { + position: "absolute", + left: contentContext.arrowX, + top: contentContext.arrowY, + [baseSide]: 0, + transformOrigin: { + top: "", + right: "0 0", + bottom: "center 0", + left: "100% 0" + }[contentContext.placedSide], + transform: { + top: "translateY(100%)", + right: "translateY(50%) rotate(90deg) translateX(-50%)", + bottom: `rotate(180deg)`, + left: "translateY(50%) rotate(-90deg) translateX(50%)" + }[contentContext.placedSide], + visibility: contentContext.shouldHideArrow ? "hidden" : void 0 + }, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ArrowPrimitive.Root, + { + ...arrowProps, + ref: forwardedRef, + style: { + ...arrowProps.style, + // ensures the element can be measured correctly (mostly for if SVG) + display: "block" + } + } + ) + } + ) + ); +}); +PopperArrow.displayName = ARROW_NAME; +function isNotNull(value) { + return value !== null; +} +var transformOrigin = (options) => ({ + name: "transformOrigin", + options, + fn(data) { + const { placement, rects, middlewareData } = data; + const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0; + const isArrowHidden = cannotCenterArrow; + const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; + const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; + const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement); + const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign]; + const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2; + const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2; + let x = ""; + let y = ""; + if (placedSide === "bottom") { + x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; + y = `${-arrowHeight}px`; + } else if (placedSide === "top") { + x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; + y = `${rects.floating.height + arrowHeight}px`; + } else if (placedSide === "right") { + x = `${-arrowHeight}px`; + y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; + } else if (placedSide === "left") { + x = `${rects.floating.width + arrowHeight}px`; + y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; + } + return { data: { x, y } }; + } +}); +function getSideAndAlignFromPlacement(placement) { + const [side, align = "center"] = placement.split("-"); + return [side, align]; +} +var Root2 = Popper; +var Anchor = PopperAnchor; +var Content = PopperContent; +var Arrow = PopperArrow; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..72bada8ee6435fef3b65c95a30b4dde0ee37e954 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-popper/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/popper.tsx"], + "sourcesContent": ["'use client';\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n //\n SIDE_OPTIONS,\n ALIGN_OPTIONS,\n} from './popper';\nexport type {\n PopperProps,\n PopperAnchorProps,\n PopperContentProps,\n PopperArrowProps,\n} from './popper';\n", "import * as React from 'react';\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size,\n} from '@floating-ui/react-dom';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useSize } from '@radix-ui/react-use-size';\n\nimport type { Placement, Middleware } from '@floating-ui/react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Measurable } from '@radix-ui/rect';\n\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\ntype Side = (typeof SIDE_OPTIONS)[number];\ntype Align = (typeof ALIGN_OPTIONS)[number];\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps

= P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n placementState: Placement | undefined;\n setPlacementState: React.Dispatch>;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC = (props: ScopedProps) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n const [placementState, setPlacementState] = React.useState(undefined);\n return (\n \n {children}\n \n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject;\n}\n\nconst PopperAnchor = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const onAnchorChange = context.onAnchorChange;\n\n // For DOM anchors, set the anchor from a callback ref rather than an\n // effect. React invokes callback refs during the commit phase which does\n // not count toward the nested update depth limit, so mounting many\n // Popper-based components at once doesn't trigger \"Maximum update depth\n // exceeded\"\n // see https://github.com/radix-ui/primitives/issues/3858\n const callbackRef = React.useCallback(\n (node: PopperAnchorElement | null) => {\n ref.current = node;\n if (node) {\n onAnchorChange(node);\n }\n },\n [onAnchorChange],\n );\n const composedRefs = useComposedRefs(forwardedRef, callbackRef);\n\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n if (!virtualRef) {\n return;\n }\n\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef.current;\n if (previousAnchor !== anchorRef.current) {\n onAnchorChange(anchorRef.current);\n }\n });\n\n const sideAndAlign =\n context.placementState && getSideAndAlignFromPlacement(context.placementState);\n const placedSide = sideAndAlign?.[0];\n const placedAlign = sideAndAlign?.[1];\n\n return virtualRef ? null : (\n \n );\n },\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n placedAlign: Align;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n updatePositionStrategy?: 'optimized' | 'always';\n onPlaced?: () => void;\n}\n\nconst PopperContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = 'partial',\n hideWhenDetached = false,\n updatePositionStrategy = 'optimized',\n onPlaced,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n\n const desiredPlacement = (side + (align !== 'center' ? '-' + align : '')) as Placement;\n\n const collisionPadding =\n typeof collisionPaddingProp === 'number'\n ? collisionPaddingProp\n : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries,\n };\n\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: 'fixed',\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === 'always',\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor,\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === 'partial' ? limitShift() : undefined,\n ...detectOverflowOptions,\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n },\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached &&\n hide({\n strategy: 'referenceHidden',\n ...detectOverflowOptions,\n // `hide` detects whether the anchor (reference) is clipped, so when\n // no explicit `collisionBoundary` is set we fall back to Floating\n // UI's default clipping ancestors (e.g. a scrollable menu). This\n // lets an occluded submenu hide once its anchor scrolls out of view\n // (#3237). The collision/size middlewares deliberately keep the\n // viewport-based default to avoid clamping content rendered inside\n // transformed or overflow-clipping portal containers.\n boundary: hasExplicitBoundaries ? detectOverflowOptions.boundary : undefined,\n }),\n ],\n });\n\n const setPlacementState = context.setPlacementState;\n useLayoutEffect(() => {\n setPlacementState(placement);\n return () => {\n setPlacementState(undefined);\n };\n }, [placement, setPlacementState]);\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n return (\n

= P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n placementState: Placement | undefined;\n setPlacementState: React.Dispatch>;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC = (props: ScopedProps) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n const [placementState, setPlacementState] = React.useState(undefined);\n return (\n \n {children}\n \n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject;\n}\n\nconst PopperAnchor = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const onAnchorChange = context.onAnchorChange;\n\n // For DOM anchors, set the anchor from a callback ref rather than an\n // effect. React invokes callback refs during the commit phase which does\n // not count toward the nested update depth limit, so mounting many\n // Popper-based components at once doesn't trigger \"Maximum update depth\n // exceeded\"\n // see https://github.com/radix-ui/primitives/issues/3858\n const callbackRef = React.useCallback(\n (node: PopperAnchorElement | null) => {\n ref.current = node;\n if (node) {\n onAnchorChange(node);\n }\n },\n [onAnchorChange],\n );\n const composedRefs = useComposedRefs(forwardedRef, callbackRef);\n\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n if (!virtualRef) {\n return;\n }\n\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef.current;\n if (previousAnchor !== anchorRef.current) {\n onAnchorChange(anchorRef.current);\n }\n });\n\n const sideAndAlign =\n context.placementState && getSideAndAlignFromPlacement(context.placementState);\n const placedSide = sideAndAlign?.[0];\n const placedAlign = sideAndAlign?.[1];\n\n return virtualRef ? null : (\n \n );\n },\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n placedAlign: Align;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n updatePositionStrategy?: 'optimized' | 'always';\n onPlaced?: () => void;\n}\n\nconst PopperContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = 'partial',\n hideWhenDetached = false,\n updatePositionStrategy = 'optimized',\n onPlaced,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n\n const desiredPlacement = (side + (align !== 'center' ? '-' + align : '')) as Placement;\n\n const collisionPadding =\n typeof collisionPaddingProp === 'number'\n ? collisionPaddingProp\n : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries,\n };\n\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: 'fixed',\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === 'always',\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor,\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === 'partial' ? limitShift() : undefined,\n ...detectOverflowOptions,\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n },\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached &&\n hide({\n strategy: 'referenceHidden',\n ...detectOverflowOptions,\n // `hide` detects whether the anchor (reference) is clipped, so when\n // no explicit `collisionBoundary` is set we fall back to Floating\n // UI's default clipping ancestors (e.g. a scrollable menu). This\n // lets an occluded submenu hide once its anchor scrolls out of view\n // (#3237). The collision/size middlewares deliberately keep the\n // viewport-based default to avoid clamping content rendered inside\n // transformed or overflow-clipping portal containers.\n boundary: hasExplicitBoundaries ? detectOverflowOptions.boundary : undefined,\n }),\n ],\n });\n\n const setPlacementState = context.setPlacementState;\n useLayoutEffect(() => {\n setPlacementState(placement);\n return () => {\n setPlacementState(undefined);\n };\n }, [placement, setPlacementState]);\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n return (\n

= P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext(PROGRESS_NAME);\n\ntype ProgressElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, 'Progress'));\n }\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, 'Progress'));\n }\n\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined;\n\n return (\n \n \n \n );\n },\n);\n\nProgress.displayName = PROGRESS_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ComponentRef;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n \n );\n },\n);\n\nProgressIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number';\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\n\nconst Root = Progress;\nconst Indicator = ProgressIndicator;\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n};\nexport type { ProgressProps, ProgressIndicatorProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,2BAAmC;AACnC,6BAA0B;AAoDlB;AA5CR,IAAM,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/C,UAAM,UAAU,mBAAmB,gBAAgB,eAAe;AAClE,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,cAAY,iBAAiB,QAAQ,OAAO,QAAQ,GAAG;AAAA,QACvD,cAAY,QAAQ,SAAS;AAAA,QAC7B,YAAU,QAAQ;AAAA,QACjB,GAAG;AAAA,QACJ,KAAK;AAAA;AAAA,IACP;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAIhC,SAAS,qBAAqB,OAAe,KAAa;AACxD,SAAO,GAAG,KAAK,MAAO,QAAQ,MAAO,GAAG,CAAC;AAC3C;AAEA,SAAS,iBAAiB,OAAkC,UAAiC;AAC3F,SAAO,SAAS,OAAO,kBAAkB,UAAU,WAAW,aAAa;AAC7E;AAEA,SAAS,SAAS,OAA6B;AAC7C,SAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,iBAAiB,KAAyB;AAEjD,SACE,SAAS,GAAG,KACZ,CAAC,MAAM,GAAG,KACV,MAAM;AAEV;AAEA,SAAS,mBAAmB,OAAY,KAA8B;AAEpE,SACE,SAAS,KAAK,KACd,CAAC,MAAM,KAAK,KACZ,SAAS,OACT,SAAS;AAEb;AAGA,SAAS,mBAAmB,WAAmB,eAAuB;AACpE,SAAO,mCAAmC,SAAS,oBAAoB,aAAa,yEAAyE,WAAW;AAC1K;AAEA,SAAS,qBAAqB,WAAmB,eAAuB;AACtE,SAAO,qCAAqC,SAAS,oBAAoB,aAAa;AAAA;AAAA,gDAExC,WAAW;AAAA;AAAA;AAAA;AAI3D;AAEA,IAAM,OAAO;AACb,IAAM,YAAY;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5183a128fd397282b7e19deb1b964d2616fa4da2 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/dist/index.mjs @@ -0,0 +1,101 @@ +"use client"; + +// src/progress.tsx +import * as React from "react"; +import { createContextScope } from "@radix-ui/react-context"; +import { Primitive } from "@radix-ui/react-primitive"; +import { jsx } from "react/jsx-runtime"; +var PROGRESS_NAME = "Progress"; +var DEFAULT_MAX = 100; +var [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME); +var [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME); +var Progress = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeProgress, + value: valueProp = null, + max: maxProp, + getValueLabel = defaultGetValueLabel, + ...progressProps + } = props; + if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) { + console.error(getInvalidMaxError(`${maxProp}`, "Progress")); + } + const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX; + if (valueProp !== null && !isValidValueNumber(valueProp, max)) { + console.error(getInvalidValueError(`${valueProp}`, "Progress")); + } + const value = isValidValueNumber(valueProp, max) ? valueProp : null; + const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0; + return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx( + Primitive.div, + { + "aria-valuemax": max, + "aria-valuemin": 0, + "aria-valuenow": isNumber(value) ? value : void 0, + "aria-valuetext": valueLabel, + role: "progressbar", + "data-state": getProgressState(value, max), + "data-value": value ?? void 0, + "data-max": max, + ...progressProps, + ref: forwardedRef + } + ) }); + } +); +Progress.displayName = PROGRESS_NAME; +var INDICATOR_NAME = "ProgressIndicator"; +var ProgressIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeProgress, ...indicatorProps } = props; + const context = useProgressContext(INDICATOR_NAME, __scopeProgress); + return /* @__PURE__ */ jsx( + Primitive.div, + { + "data-state": getProgressState(context.value, context.max), + "data-value": context.value ?? void 0, + "data-max": context.max, + ...indicatorProps, + ref: forwardedRef + } + ); + } +); +ProgressIndicator.displayName = INDICATOR_NAME; +function defaultGetValueLabel(value, max) { + return `${Math.round(value / max * 100)}%`; +} +function getProgressState(value, maxValue) { + return value == null ? "indeterminate" : value === maxValue ? "complete" : "loading"; +} +function isNumber(value) { + return typeof value === "number"; +} +function isValidMaxNumber(max) { + return isNumber(max) && !isNaN(max) && max > 0; +} +function isValidValueNumber(value, max) { + return isNumber(value) && !isNaN(value) && value <= max && value >= 0; +} +function getInvalidMaxError(propValue, componentName) { + return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`; +} +function getInvalidValueError(propValue, componentName) { + return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`; +} +var Root = Progress; +var Indicator = ProgressIndicator; +export { + Indicator, + Progress, + ProgressIndicator, + Root, + createProgressScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..29589b7184b57a379d9c9236ebadc8bf236163ed --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/progress.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROGRESS_NAME = 'Progress';\nconst DEFAULT_MAX = 100;\n\ntype ScopedProps

= P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext(PROGRESS_NAME);\n\ntype ProgressElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, 'Progress'));\n }\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, 'Progress'));\n }\n\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined;\n\n return (\n \n \n \n );\n },\n);\n\nProgress.displayName = PROGRESS_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ComponentRef;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n \n );\n },\n);\n\nProgressIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number';\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\n\nconst Root = Progress;\nconst Indicator = ProgressIndicator;\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n};\nexport type { ProgressProps, ProgressIndicatorProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAoDlB;AA5CR,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAGpB,IAAM,CAAC,uBAAuB,mBAAmB,IAAI,mBAAmB,aAAa;AAIrF,IAAM,CAAC,kBAAkB,kBAAkB,IACzC,sBAA4C,aAAa;AAU3D,IAAM,WAAiB;AAAA,EACrB,CAAC,OAAmC,iBAAiB;AACnD,UAAM;AAAA,MACJ;AAAA,MACA,OAAO,YAAY;AAAA,MACnB,KAAK;AAAA,MACL,gBAAgB;AAAA,MAChB,GAAG;AAAA,IACL,IAAI;AAEJ,SAAK,WAAW,YAAY,MAA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,QAAQ,MAAO,GAAG,CAAC;AAC3C;AAEA,SAAS,iBAAiB,OAAkC,UAAiC;AAC3F,SAAO,SAAS,OAAO,kBAAkB,UAAU,WAAW,aAAa;AAC7E;AAEA,SAAS,SAAS,OAA6B;AAC7C,SAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,iBAAiB,KAAyB;AAEjD,SACE,SAAS,GAAG,KACZ,CAAC,MAAM,GAAG,KACV,MAAM;AAEV;AAEA,SAAS,mBAAmB,OAAY,KAA8B;AAEpE,SACE,SAAS,KAAK,KACd,CAAC,MAAM,KAAK,KACZ,SAAS,OACT,SAAS;AAEb;AAGA,SAAS,mBAAmB,WAAmB,eAAuB;AACpE,SAAO,mCAAmC,SAAS,oBAAoB,aAAa,yEAAyE,WAAW;AAC1K;AAEA,SAAS,qBAAqB,WAAmB,eAAuB;AACtE,SAAO,qCAAqC,SAAS,oBAAoB,aAAa;AAAA;AAAA,gDAExC,WAAW;AAAA;AAAA;AAAA;AAI3D;AAEA,IAAM,OAAO;AACb,IAAM,YAAY;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d80cf7d27c7516187fdea3439e5da06b425a65ad --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-progress/package.json @@ -0,0 +1,69 @@ +{ + "name": "@radix-ui/react-progress", + "version": "1.1.10", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-primitive": "2.1.6" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/progress" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6f8f5362c478d44cd4b7cb44832d2547d3519c47 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/README.md @@ -0,0 +1,3 @@ +# `react-radio-group` + +View docs [here](https://radix-ui.com/primitives/docs/components/radio-group). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..84c383478d5f3bc710b5f9c7319c931a1046dca6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.d.mts @@ -0,0 +1,90 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; + +interface RadioProviderProps { + checked?: boolean; + required?: boolean; + disabled?: boolean; + name?: string; + form?: string; + value?: string | number | readonly string[]; + onCheck?(): void; + children?: React.ReactNode; +} +interface RadioTriggerProps extends Omit, keyof RadioProviderProps> { + children?: React.ReactNode; +} +declare const RadioTrigger: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface RadioProps$1 extends Omit { + checked?: boolean; + required?: boolean; + onCheck?(): void; +} +declare const Radio: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface RadioIndicatorProps$1 extends PrimitiveSpanProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const RadioIndicator: React.ForwardRefExoticComponent>; +type InputProps = React.ComponentPropsWithoutRef; +interface RadioBubbleInputProps extends Omit { +} +declare const RadioBubbleInput: React.ForwardRefExoticComponent>; + +type ScopedProps

= P & { + __scopeRadioGroup?: Scope; +}; +declare const createRadioGroupScope: _radix_ui_react_context.CreateScope; +type RadioGroupContextValue = { + name?: string; + required: boolean; + disabled: boolean; + value: string | null; + onValueChange(value: string): void; +}; +type RovingFocusGroupProps = React.ComponentPropsWithoutRef; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface RadioGroupProps extends PrimitiveDivProps { + name?: RadioGroupContextValue['name']; + required?: React.ComponentPropsWithoutRef['required']; + disabled?: React.ComponentPropsWithoutRef['disabled']; + dir?: RovingFocusGroupProps['dir']; + orientation?: RovingFocusGroupProps['orientation']; + loop?: RovingFocusGroupProps['loop']; + defaultValue?: string; + value?: string | null; + onValueChange?: RadioGroupContextValue['onValueChange']; +} +declare const RadioGroup: React.ForwardRefExoticComponent>; +interface RadioGroupItemProviderProps { + value: string; + disabled?: boolean; + children?: React.ReactNode; +} +declare function RadioGroupItemProvider(props: ScopedProps): react_jsx_runtime.JSX.Element; +interface RadioGroupItemTriggerProps extends React.ComponentPropsWithoutRef { +} +declare const RadioGroupItemTrigger: React.ForwardRefExoticComponent>; +type RadioProps = React.ComponentPropsWithoutRef; +interface RadioGroupItemProps extends Omit { + value: string; +} +declare const RadioGroupItem: React.ForwardRefExoticComponent>; +interface RadioGroupItemBubbleInputProps extends React.ComponentPropsWithoutRef { +} +declare const RadioGroupItemBubbleInput: React.ForwardRefExoticComponent>; +type RadioIndicatorProps = React.ComponentPropsWithoutRef; +interface RadioGroupIndicatorProps extends RadioIndicatorProps { +} +declare const RadioGroupIndicator: React.ForwardRefExoticComponent>; + +export { RadioGroupIndicator as Indicator, RadioGroupItem as Item, RadioGroup, RadioGroupIndicator, type RadioGroupIndicatorProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioGroup as Root, createRadioGroupScope, RadioGroupItemBubbleInput as unstable_ItemBubbleInput, RadioGroupItemProvider as unstable_ItemProvider, RadioGroupItemTrigger as unstable_ItemTrigger, RadioGroupItemBubbleInput as unstable_RadioGroupItemBubbleInput, type RadioGroupItemBubbleInputProps as unstable_RadioGroupItemBubbleInputProps, RadioGroupItemProvider as unstable_RadioGroupItemProvider, type RadioGroupItemProviderProps as unstable_RadioGroupItemProviderProps, RadioGroupItemTrigger as unstable_RadioGroupItemTrigger, type RadioGroupItemTriggerProps as unstable_RadioGroupItemTriggerProps }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84c383478d5f3bc710b5f9c7319c931a1046dca6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.d.ts @@ -0,0 +1,90 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; +import * as RovingFocusGroup from '@radix-ui/react-roving-focus'; + +interface RadioProviderProps { + checked?: boolean; + required?: boolean; + disabled?: boolean; + name?: string; + form?: string; + value?: string | number | readonly string[]; + onCheck?(): void; + children?: React.ReactNode; +} +interface RadioTriggerProps extends Omit, keyof RadioProviderProps> { + children?: React.ReactNode; +} +declare const RadioTrigger: React.ForwardRefExoticComponent>; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface RadioProps$1 extends Omit { + checked?: boolean; + required?: boolean; + onCheck?(): void; +} +declare const Radio: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface RadioIndicatorProps$1 extends PrimitiveSpanProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const RadioIndicator: React.ForwardRefExoticComponent>; +type InputProps = React.ComponentPropsWithoutRef; +interface RadioBubbleInputProps extends Omit { +} +declare const RadioBubbleInput: React.ForwardRefExoticComponent>; + +type ScopedProps

= P & { + __scopeRadioGroup?: Scope; +}; +declare const createRadioGroupScope: _radix_ui_react_context.CreateScope; +type RadioGroupContextValue = { + name?: string; + required: boolean; + disabled: boolean; + value: string | null; + onValueChange(value: string): void; +}; +type RovingFocusGroupProps = React.ComponentPropsWithoutRef; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface RadioGroupProps extends PrimitiveDivProps { + name?: RadioGroupContextValue['name']; + required?: React.ComponentPropsWithoutRef['required']; + disabled?: React.ComponentPropsWithoutRef['disabled']; + dir?: RovingFocusGroupProps['dir']; + orientation?: RovingFocusGroupProps['orientation']; + loop?: RovingFocusGroupProps['loop']; + defaultValue?: string; + value?: string | null; + onValueChange?: RadioGroupContextValue['onValueChange']; +} +declare const RadioGroup: React.ForwardRefExoticComponent>; +interface RadioGroupItemProviderProps { + value: string; + disabled?: boolean; + children?: React.ReactNode; +} +declare function RadioGroupItemProvider(props: ScopedProps): react_jsx_runtime.JSX.Element; +interface RadioGroupItemTriggerProps extends React.ComponentPropsWithoutRef { +} +declare const RadioGroupItemTrigger: React.ForwardRefExoticComponent>; +type RadioProps = React.ComponentPropsWithoutRef; +interface RadioGroupItemProps extends Omit { + value: string; +} +declare const RadioGroupItem: React.ForwardRefExoticComponent>; +interface RadioGroupItemBubbleInputProps extends React.ComponentPropsWithoutRef { +} +declare const RadioGroupItemBubbleInput: React.ForwardRefExoticComponent>; +type RadioIndicatorProps = React.ComponentPropsWithoutRef; +interface RadioGroupIndicatorProps extends RadioIndicatorProps { +} +declare const RadioGroupIndicator: React.ForwardRefExoticComponent>; + +export { RadioGroupIndicator as Indicator, RadioGroupItem as Item, RadioGroup, RadioGroupIndicator, type RadioGroupIndicatorProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioGroup as Root, createRadioGroupScope, RadioGroupItemBubbleInput as unstable_ItemBubbleInput, RadioGroupItemProvider as unstable_ItemProvider, RadioGroupItemTrigger as unstable_ItemTrigger, RadioGroupItemBubbleInput as unstable_RadioGroupItemBubbleInput, type RadioGroupItemBubbleInputProps as unstable_RadioGroupItemBubbleInputProps, RadioGroupItemProvider as unstable_RadioGroupItemProvider, type RadioGroupItemProviderProps as unstable_RadioGroupItemProviderProps, RadioGroupItemTrigger as unstable_RadioGroupItemTrigger, type RadioGroupItemTriggerProps as unstable_RadioGroupItemTriggerProps }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..84cef7b6974a9fe6f1ec551d41cc8ddfcdfb0db6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.js @@ -0,0 +1,470 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Indicator: () => RadioGroupIndicator, + Item: () => RadioGroupItem, + RadioGroup: () => RadioGroup, + RadioGroupIndicator: () => RadioGroupIndicator, + RadioGroupItem: () => RadioGroupItem, + Root: () => RadioGroup, + createRadioGroupScope: () => createRadioGroupScope, + unstable_ItemBubbleInput: () => RadioGroupItemBubbleInput, + unstable_ItemProvider: () => RadioGroupItemProvider, + unstable_ItemTrigger: () => RadioGroupItemTrigger, + unstable_RadioGroupItemBubbleInput: () => RadioGroupItemBubbleInput, + unstable_RadioGroupItemProvider: () => RadioGroupItemProvider, + unstable_RadioGroupItemTrigger: () => RadioGroupItemTrigger +}); +module.exports = __toCommonJS(index_exports); + +// src/radio-group.tsx +var React2 = __toESM(require("react")); +var import_primitive2 = require("@radix-ui/primitive"); +var import_react_compose_refs2 = require("@radix-ui/react-compose-refs"); +var import_react_context2 = require("@radix-ui/react-context"); +var import_react_primitive2 = require("@radix-ui/react-primitive"); +var RovingFocusGroup = __toESM(require("@radix-ui/react-roving-focus")); +var import_react_roving_focus = require("@radix-ui/react-roving-focus"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_direction = require("@radix-ui/react-direction"); + +// src/radio.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_use_size = require("@radix-ui/react-use-size"); +var import_react_use_previous = require("@radix-ui/react-use-previous"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_jsx_runtime = require("react/jsx-runtime"); +var RADIO_NAME = "Radio"; +var [createRadioContext, createRadioScope] = (0, import_react_context.createContextScope)(RADIO_NAME); +var [RadioProviderImpl, useRadioContext] = createRadioContext(RADIO_NAME); +function RadioProvider(props) { + const { + __scopeRadio, + checked = false, + children, + disabled, + form, + name, + onCheck, + required, + value = "on", + // @ts-expect-error + internal_do_not_use_render + } = props; + const [control, setControl] = React.useState(null); + const [bubbleInput, setBubbleInput] = React.useState(null); + const hasConsumerStoppedPropagationRef = React.useRef(false); + const isFormControl = control ? !!form || !!control.closest("form") : ( + // We set this to true by default so that events bubble to forms without JS (SSR) + true + ); + const context = { + checked, + disabled, + required, + name, + form, + value, + control, + setControl, + hasConsumerStoppedPropagationRef, + isFormControl, + bubbleInput, + setBubbleInput, + onCheck: () => onCheck?.() + }; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioProviderImpl, { scope: __scopeRadio, ...context, children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children }); +} +var TRIGGER_NAME = "RadioTrigger"; +var RadioTrigger = React.forwardRef( + ({ __scopeRadio, onClick, ...radioProps }, forwardedRef) => { + const { + checked, + disabled, + value, + setControl, + onCheck, + hasConsumerStoppedPropagationRef, + isFormControl, + bubbleInput + } = useRadioContext(TRIGGER_NAME, __scopeRadio); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, setControl); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + role: "radio", + "aria-checked": checked, + "data-state": getState(checked), + "data-disabled": disabled ? "" : void 0, + disabled, + value, + ...radioProps, + ref: composedRefs, + onClick: (0, import_primitive.composeEventHandlers)(onClick, (event) => { + if (!checked) onCheck(); + if (bubbleInput && isFormControl) { + hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(); + if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation(); + } + }) + } + ); + } +); +RadioTrigger.displayName = TRIGGER_NAME; +var Radio = React.forwardRef( + (props, forwardedRef) => { + const { __scopeRadio, name, checked, required, disabled, value, onCheck, form, ...radioProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RadioProvider, + { + __scopeRadio, + checked, + disabled, + required, + onCheck, + name, + form, + value, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RadioTrigger, + { + ...radioProps, + ref: forwardedRef, + __scopeRadio + } + ), + isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RadioBubbleInput, + { + __scopeRadio + } + ) + ] }) + } + ); + } +); +Radio.displayName = RADIO_NAME; +var INDICATOR_NAME = "RadioIndicator"; +var RadioIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeRadio, forceMount, ...indicatorProps } = props; + const context = useRadioContext(INDICATOR_NAME, __scopeRadio); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.span, + { + "data-state": getState(context.checked), + "data-disabled": context.disabled ? "" : void 0, + ...indicatorProps, + ref: forwardedRef + } + ) }); + } +); +RadioIndicator.displayName = INDICATOR_NAME; +var BUBBLE_INPUT_NAME = "RadioBubbleInput"; +var RadioBubbleInput = React.forwardRef( + ({ __scopeRadio, ...props }, forwardedRef) => { + const { + control, + checked, + required, + disabled, + name, + value, + form, + bubbleInput, + setBubbleInput, + hasConsumerStoppedPropagationRef + } = useRadioContext(BUBBLE_INPUT_NAME, __scopeRadio); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, setBubbleInput); + const prevChecked = (0, import_react_use_previous.usePrevious)(checked); + const controlSize = (0, import_react_use_size.useSize)(control); + React.useEffect(() => { + const input = bubbleInput; + if (!input) return; + const inputProto = window.HTMLInputElement.prototype; + const descriptor = Object.getOwnPropertyDescriptor( + inputProto, + "checked" + ); + const setChecked = descriptor.set; + const bubbles = !hasConsumerStoppedPropagationRef.current; + if (prevChecked !== checked && setChecked) { + const event = new Event("click", { bubbles }); + setChecked.call(input, checked); + input.dispatchEvent(event); + } + }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]); + const defaultCheckedRef = React.useRef(checked); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.input, + { + type: "radio", + "aria-hidden": true, + defaultChecked: defaultCheckedRef.current, + required, + disabled, + name, + value, + form, + ...props, + tabIndex: -1, + ref: composedRefs, + style: { + ...props.style, + ...controlSize, + position: "absolute", + pointerEvents: "none", + opacity: 0, + margin: 0, + // We transform because the input is absolutely positioned but we have + // rendered it **after** the button. This pulls it back to sit on top + // of the button. + transform: "translateX(-100%)" + } + } + ); + } +); +RadioBubbleInput.displayName = BUBBLE_INPUT_NAME; +function isFunction(value) { + return typeof value === "function"; +} +function getState(checked) { + return checked ? "checked" : "unchecked"; +} + +// src/radio-group.tsx +var import_jsx_runtime2 = require("react/jsx-runtime"); +var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]; +var RADIO_GROUP_NAME = "RadioGroup"; +var [createRadioGroupContext, createRadioGroupScope] = (0, import_react_context2.createContextScope)(RADIO_GROUP_NAME, [ + import_react_roving_focus.createRovingFocusGroupScope, + createRadioScope +]); +var useRovingFocusGroupScope = (0, import_react_roving_focus.createRovingFocusGroupScope)(); +var useRadioScope = createRadioScope(); +var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME); +var RadioGroup = React2.forwardRef( + (props, forwardedRef) => { + const { + __scopeRadioGroup, + name, + defaultValue, + value: valueProp, + required = false, + disabled = false, + orientation, + dir, + loop = true, + onValueChange, + ...groupProps + } = props; + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup); + const direction = (0, import_react_direction.useDirection)(dir); + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + defaultProp: defaultValue ?? null, + onChange: onValueChange, + caller: RADIO_GROUP_NAME + }); + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RadioGroupProvider, + { + scope: __scopeRadioGroup, + name, + required, + disabled, + value, + onValueChange: setValue, + children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation, + dir: direction, + loop, + children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + import_react_primitive2.Primitive.div, + { + role: "radiogroup", + "aria-required": required, + "aria-orientation": orientation, + "data-disabled": disabled ? "" : void 0, + dir: direction, + ...groupProps, + ref: forwardedRef + } + ) + } + ) + } + ); + } +); +RadioGroup.displayName = RADIO_GROUP_NAME; +var ITEM_NAME = "RadioGroupItem"; +var ITEM_PROVIDER_NAME = "RadioGroupItemProvider"; +var ITEM_TRIGGER_NAME = "RadioGroupItemTrigger"; +var ITEM_BUBBLE_INPUT_NAME = "RadioGroupItemBubbleInput"; +function RadioGroupItemProvider(props) { + const { + __scopeRadioGroup, + value, + disabled, + children, + // @ts-expect-error + internal_do_not_use_render + } = props; + const context = useRadioGroupContext(ITEM_PROVIDER_NAME, __scopeRadioGroup); + const radioScope = useRadioScope(__scopeRadioGroup); + const isDisabled = context.disabled || disabled; + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RadioProvider, + { + ...radioScope, + checked: context.value === value, + disabled: isDisabled, + required: context.required, + name: context.name, + value, + onCheck: () => context.onValueChange(value), + internal_do_not_use_render, + children + } + ); +} +var RadioGroupItemTrigger = React2.forwardRef((props, forwardedRef) => { + const { __scopeRadioGroup, ...triggerProps } = props; + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup); + const radioScope = useRadioScope(__scopeRadioGroup); + const { checked, disabled } = useRadioContext(ITEM_TRIGGER_NAME, radioScope.__scopeRadio); + const ref = React2.useRef(null); + const composedRefs = (0, import_react_compose_refs2.useComposedRefs)(forwardedRef, ref); + const isArrowKeyPressedRef = React2.useRef(false); + React2.useEffect(() => { + const handleKeyDown = (event) => { + if (ARROW_KEYS.includes(event.key)) { + isArrowKeyPressedRef.current = true; + } + }; + const handleKeyUp = () => isArrowKeyPressedRef.current = false; + document.addEventListener("keydown", handleKeyDown); + document.addEventListener("keyup", handleKeyUp); + return () => { + document.removeEventListener("keydown", handleKeyDown); + document.removeEventListener("keyup", handleKeyUp); + }; + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RovingFocusGroup.Item, + { + asChild: true, + ...rovingFocusGroupScope, + focusable: !disabled, + active: checked, + children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RadioTrigger, + { + ...radioScope, + ...triggerProps, + ref: composedRefs, + onKeyDown: (0, import_primitive2.composeEventHandlers)(triggerProps.onKeyDown, (event) => { + if (event.key === "Enter") event.preventDefault(); + }), + onFocus: (0, import_primitive2.composeEventHandlers)(triggerProps.onFocus, () => { + if (isArrowKeyPressedRef.current) { + ref.current?.click(); + } + }) + } + ) + } + ); +}); +RadioGroupItemTrigger.displayName = ITEM_TRIGGER_NAME; +var RadioGroupItem = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeRadioGroup, value, disabled, ...itemProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RadioGroupItemProvider, + { + __scopeRadioGroup, + value, + disabled, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RadioGroupItemTrigger, + { + ...itemProps, + ref: forwardedRef, + __scopeRadioGroup + } + ), + isFormControl && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( + RadioGroupItemBubbleInput, + { + __scopeRadioGroup + } + ) + ] }) + } + ); + } +); +RadioGroupItem.displayName = ITEM_NAME; +var RadioGroupItemBubbleInput = React2.forwardRef((props, forwardedRef) => { + const { __scopeRadioGroup, ...bubbleProps } = props; + const radioScope = useRadioScope(__scopeRadioGroup); + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioBubbleInput, { ...radioScope, ...bubbleProps, ref: forwardedRef }); +}); +RadioGroupItemBubbleInput.displayName = ITEM_BUBBLE_INPUT_NAME; +var INDICATOR_NAME2 = "RadioGroupIndicator"; +var RadioGroupIndicator = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeRadioGroup, ...indicatorProps } = props; + const radioScope = useRadioScope(__scopeRadioGroup); + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef }); + } +); +RadioGroupIndicator.displayName = INDICATOR_NAME2; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1b301970e2bd86a7e0e2435d679d88a2acef18b5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/radio-group.tsx", "../src/radio.tsx"], + "sourcesContent": ["'use client';\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemProvider as unstable_RadioGroupItemProvider,\n RadioGroupItemTrigger as unstable_RadioGroupItemTrigger,\n RadioGroupItemBubbleInput as unstable_RadioGroupItemBubbleInput,\n RadioGroupIndicator,\n //\n Root,\n Item,\n ItemProvider as unstable_ItemProvider,\n ItemTrigger as unstable_ItemTrigger,\n ItemBubbleInput as unstable_ItemBubbleInput,\n Indicator,\n} from './radio-group';\nexport type {\n RadioGroupProps,\n RadioGroupItemProps,\n RadioGroupItemProviderProps as unstable_RadioGroupItemProviderProps,\n RadioGroupItemTriggerProps as unstable_RadioGroupItemTriggerProps,\n RadioGroupItemBubbleInputProps as unstable_RadioGroupItemBubbleInputProps,\n RadioGroupIndicatorProps,\n} from './radio-group';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport {\n type Radio,\n RadioProvider,\n RadioTrigger,\n RadioBubbleInput,\n RadioIndicator,\n createRadioScope,\n useRadioContext,\n} from './radio';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps

= P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value: string | null;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ComponentRef;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef['required'];\n disabled?: React.ComponentPropsWithoutRef['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: string | null;\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeRadioGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? null,\n onChange: onValueChange as (value: string | null) => void,\n caller: RADIO_GROUP_NAME,\n });\n\n return (\n \n \n \n \n \n );\n },\n);\n\nRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemProvider\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RadioGroupItem';\nconst ITEM_PROVIDER_NAME = 'RadioGroupItemProvider';\nconst ITEM_TRIGGER_NAME = 'RadioGroupItemTrigger';\nconst ITEM_BUBBLE_INPUT_NAME = 'RadioGroupItemBubbleInput';\n\ninterface RadioGroupItemProviderProps {\n value: string;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nfunction RadioGroupItemProvider(props: ScopedProps) {\n const {\n __scopeRadioGroup,\n value,\n disabled,\n children,\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n const context = useRadioGroupContext(ITEM_PROVIDER_NAME, __scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n\n return (\n context.onValueChange(value)}\n // @ts-expect-error\n internal_do_not_use_render={internal_do_not_use_render}\n >\n {children}\n \n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemTrigger\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemTriggerElement = React.ComponentRef;\ninterface RadioGroupItemTriggerProps extends React.ComponentPropsWithoutRef {}\n\nconst RadioGroupItemTrigger = React.forwardRef<\n RadioGroupItemTriggerElement,\n RadioGroupItemTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, ...triggerProps } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const { checked, disabled } = useRadioContext(ITEM_TRIGGER_NAME, radioScope.__scopeRadio);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n \n {\n // According to WAI ARIA, radio groups don't activate items on enter\n // keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(triggerProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with\n * arrow keys and we need to \"check\" it in that case. We click it to\n * \"check\" it (instead of updating `context.value`) so that the radio\n * change event fires.\n */\n if (isArrowKeyPressedRef.current) {\n ref.current?.click();\n }\n })}\n />\n \n );\n});\n\nRadioGroupItemTrigger.displayName = ITEM_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemElement = React.ComponentRef;\ntype RadioProps = React.ComponentPropsWithoutRef;\ninterface RadioGroupItemProps extends Omit {\n value: string;\n}\n\nconst RadioGroupItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, value, disabled, ...itemProps } = props;\n\n return (\n (\n <>\n \n {isFormControl && (\n \n )}\n \n )}\n />\n );\n },\n);\n\nRadioGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemBubbleInputElement = React.ComponentRef;\ninterface RadioGroupItemBubbleInputProps extends React.ComponentPropsWithoutRef<\n typeof RadioBubbleInput\n> {}\n\nconst RadioGroupItemBubbleInput = React.forwardRef<\n RadioGroupItemBubbleInputElement,\n RadioGroupItemBubbleInputProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, ...bubbleProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return ;\n});\n\nRadioGroupItemBubbleInput.displayName = ITEM_BUBBLE_INPUT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioGroupIndicator';\n\ntype RadioGroupIndicatorElement = React.ComponentRef;\ntype RadioIndicatorProps = React.ComponentPropsWithoutRef;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return ;\n },\n);\n\nRadioGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemProvider,\n RadioGroupItemTrigger,\n RadioGroupItemBubbleInput,\n RadioGroupIndicator,\n //\n RadioGroup as Root,\n RadioGroupItem as Item,\n RadioGroupItemProvider as ItemProvider,\n RadioGroupItemTrigger as ItemTrigger,\n RadioGroupItemBubbleInput as ItemBubbleInput,\n RadioGroupIndicator as Indicator,\n};\nexport type {\n RadioGroupProps,\n RadioGroupItemProps,\n RadioGroupItemProviderProps,\n RadioGroupItemTriggerProps,\n RadioGroupItemBubbleInputProps,\n RadioGroupIndicatorProps,\n};\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst RADIO_NAME = 'Radio';\n\ntype ScopedProps

= P & { __scopeRadio?: Scope };\nconst [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);\n\ntype RadioContextValue = {\n checked: boolean;\n disabled: boolean | undefined;\n required: boolean | undefined;\n name: string | undefined;\n form: string | undefined;\n value: string | number | readonly string[];\n control: HTMLButtonElement | null;\n setControl: React.Dispatch>;\n hasConsumerStoppedPropagationRef: React.RefObject;\n isFormControl: boolean;\n bubbleInput: HTMLInputElement | null;\n setBubbleInput: React.Dispatch>;\n onCheck(): void;\n};\n\nconst [RadioProviderImpl, useRadioContext] = createRadioContext(RADIO_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * RadioProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RadioProviderProps {\n checked?: boolean;\n required?: boolean;\n disabled?: boolean;\n name?: string;\n form?: string;\n value?: string | number | readonly string[];\n onCheck?(): void;\n children?: React.ReactNode;\n}\n\nfunction RadioProvider(props: ScopedProps) {\n const {\n __scopeRadio,\n checked = false,\n children,\n disabled,\n form,\n name,\n onCheck,\n required,\n value = 'on',\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = control\n ? !!form || !!control.closest('form')\n : // We set this to true by default so that events bubble to forms without JS (SSR)\n true;\n\n const context: RadioContextValue = {\n checked,\n disabled,\n required,\n name,\n form,\n value,\n control,\n setControl,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n setBubbleInput,\n onCheck: () => onCheck?.(),\n };\n\n return (\n \n {isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children}\n \n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RadioTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'RadioTrigger';\n\ninterface RadioTriggerProps extends Omit<\n React.ComponentPropsWithoutRef,\n keyof RadioProviderProps\n> {\n children?: React.ReactNode;\n}\n\nconst RadioTrigger = React.forwardRef(\n ({ __scopeRadio, onClick, ...radioProps }: ScopedProps, forwardedRef) => {\n const {\n checked,\n disabled,\n value,\n setControl,\n onCheck,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n } = useRadioContext(TRIGGER_NAME, __scopeRadio);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n return (\n {\n // radios cannot be unchecked so we only communicate a checked state\n if (!checked) onCheck();\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if radio has a bubble input and is a form control, stop propagation\n // from the button so that we only propagate one click event (from the\n // input). We propagate changes from an input so that native form\n // validation works and form events reflect radio updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n );\n },\n);\n\nRadioTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Radio\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface RadioProps extends Omit {\n checked?: boolean;\n required?: boolean;\n onCheck?(): void;\n}\n\nconst Radio = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadio, name, checked, required, disabled, value, onCheck, form, ...radioProps } =\n props;\n\n return (\n (\n <>\n \n {isFormControl && (\n \n )}\n \n )}\n />\n );\n },\n);\n\nRadio.displayName = RADIO_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioIndicator';\n\ntype RadioIndicatorElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\nexport interface RadioIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst RadioIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadio, forceMount, ...indicatorProps } = props;\n const context = useRadioContext(INDICATOR_NAME, __scopeRadio);\n return (\n \n \n \n );\n },\n);\n\nRadioIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'RadioBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef;\ninterface RadioBubbleInputProps extends Omit {}\n\nconst RadioBubbleInput = React.forwardRef(\n ({ __scopeRadio, ...props }: ScopedProps, forwardedRef) => {\n const {\n control,\n checked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput,\n hasConsumerStoppedPropagationRef,\n } = useRadioContext(BUBBLE_INPUT_NAME, __scopeRadio);\n\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked',\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n\n const bubbles = !hasConsumerStoppedPropagationRef.current;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);\n\n const defaultCheckedRef = React.useRef(checked);\n return (\n \n );\n },\n);\n\nRadioBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createRadioScope,\n useRadioContext,\n //\n Radio,\n RadioProvider,\n RadioTrigger,\n RadioIndicator,\n RadioBubbleInput,\n};\nexport type { RadioProps, RadioProviderProps, RadioTriggerProps, RadioBubbleInputProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,IAAAC,oBAAqC;AACrC,IAAAC,6BAAgC;AAChC,IAAAC,wBAAmC;AACnC,IAAAC,0BAA0B;AAC1B,uBAAkC;AAClC,gCAA4C;AAC5C,0CAAqC;AACrC,6BAA6B;;;ACR7B,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAmC;AACnC,4BAAwB;AACxB,gCAA4B;AAC5B,4BAAyB;AACzB,6BAA0B;AAkFtB;AA9EJ,IAAM,aAAa;AAGnB,IAAM,CAAC,oBAAoB,gBAAgB,QAAI,yCAAmB,UAAU;AAkB5E,IAAM,CAAC,mBAAmB,eAAe,IAAI,mBAAsC,UAAU;AAiB7F,SAAS,cAAc,OAAwC;AAC7D,QAAM;AAAA,IACJ;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA;AAAA,IAER;AAAA,EAC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C,CAAC,OAA8C,iBAAiB;AAC9D,UAAM,EAAE,mBAAmB,GAAG,eAAe,IAAI;AACjD,UAAM,aAAa,cAAc,iBAAiB;AAClD,WAAO,6CAAC,kBAAgB,GAAG,YAAa,GAAG,gBAAgB,KAAK,cAAc;AAAA,EAChF;AACF;AAEA,oBAAoB,cAAcA;", + "names": ["React", "import_primitive", "import_react_compose_refs", "import_react_context", "import_react_primitive", "import_jsx_runtime", "INDICATOR_NAME"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8f53aa66b39f4d713d4e0024c22546b49bb86940 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.mjs @@ -0,0 +1,438 @@ +"use client"; + +// src/radio-group.tsx +import * as React2 from "react"; +import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive"; +import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs"; +import { createContextScope as createContextScope2 } from "@radix-ui/react-context"; +import { Primitive as Primitive2 } from "@radix-ui/react-primitive"; +import * as RovingFocusGroup from "@radix-ui/react-roving-focus"; +import { createRovingFocusGroupScope } from "@radix-ui/react-roving-focus"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { useDirection } from "@radix-ui/react-direction"; + +// src/radio.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useSize } from "@radix-ui/react-use-size"; +import { usePrevious } from "@radix-ui/react-use-previous"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive } from "@radix-ui/react-primitive"; +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var RADIO_NAME = "Radio"; +var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME); +var [RadioProviderImpl, useRadioContext] = createRadioContext(RADIO_NAME); +function RadioProvider(props) { + const { + __scopeRadio, + checked = false, + children, + disabled, + form, + name, + onCheck, + required, + value = "on", + // @ts-expect-error + internal_do_not_use_render + } = props; + const [control, setControl] = React.useState(null); + const [bubbleInput, setBubbleInput] = React.useState(null); + const hasConsumerStoppedPropagationRef = React.useRef(false); + const isFormControl = control ? !!form || !!control.closest("form") : ( + // We set this to true by default so that events bubble to forms without JS (SSR) + true + ); + const context = { + checked, + disabled, + required, + name, + form, + value, + control, + setControl, + hasConsumerStoppedPropagationRef, + isFormControl, + bubbleInput, + setBubbleInput, + onCheck: () => onCheck?.() + }; + return /* @__PURE__ */ jsx(RadioProviderImpl, { scope: __scopeRadio, ...context, children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children }); +} +var TRIGGER_NAME = "RadioTrigger"; +var RadioTrigger = React.forwardRef( + ({ __scopeRadio, onClick, ...radioProps }, forwardedRef) => { + const { + checked, + disabled, + value, + setControl, + onCheck, + hasConsumerStoppedPropagationRef, + isFormControl, + bubbleInput + } = useRadioContext(TRIGGER_NAME, __scopeRadio); + const composedRefs = useComposedRefs(forwardedRef, setControl); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + role: "radio", + "aria-checked": checked, + "data-state": getState(checked), + "data-disabled": disabled ? "" : void 0, + disabled, + value, + ...radioProps, + ref: composedRefs, + onClick: composeEventHandlers(onClick, (event) => { + if (!checked) onCheck(); + if (bubbleInput && isFormControl) { + hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(); + if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation(); + } + }) + } + ); + } +); +RadioTrigger.displayName = TRIGGER_NAME; +var Radio = React.forwardRef( + (props, forwardedRef) => { + const { __scopeRadio, name, checked, required, disabled, value, onCheck, form, ...radioProps } = props; + return /* @__PURE__ */ jsx( + RadioProvider, + { + __scopeRadio, + checked, + disabled, + required, + onCheck, + name, + form, + value, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx( + RadioTrigger, + { + ...radioProps, + ref: forwardedRef, + __scopeRadio + } + ), + isFormControl && /* @__PURE__ */ jsx( + RadioBubbleInput, + { + __scopeRadio + } + ) + ] }) + } + ); + } +); +Radio.displayName = RADIO_NAME; +var INDICATOR_NAME = "RadioIndicator"; +var RadioIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeRadio, forceMount, ...indicatorProps } = props; + const context = useRadioContext(INDICATOR_NAME, __scopeRadio); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ jsx( + Primitive.span, + { + "data-state": getState(context.checked), + "data-disabled": context.disabled ? "" : void 0, + ...indicatorProps, + ref: forwardedRef + } + ) }); + } +); +RadioIndicator.displayName = INDICATOR_NAME; +var BUBBLE_INPUT_NAME = "RadioBubbleInput"; +var RadioBubbleInput = React.forwardRef( + ({ __scopeRadio, ...props }, forwardedRef) => { + const { + control, + checked, + required, + disabled, + name, + value, + form, + bubbleInput, + setBubbleInput, + hasConsumerStoppedPropagationRef + } = useRadioContext(BUBBLE_INPUT_NAME, __scopeRadio); + const composedRefs = useComposedRefs(forwardedRef, setBubbleInput); + const prevChecked = usePrevious(checked); + const controlSize = useSize(control); + React.useEffect(() => { + const input = bubbleInput; + if (!input) return; + const inputProto = window.HTMLInputElement.prototype; + const descriptor = Object.getOwnPropertyDescriptor( + inputProto, + "checked" + ); + const setChecked = descriptor.set; + const bubbles = !hasConsumerStoppedPropagationRef.current; + if (prevChecked !== checked && setChecked) { + const event = new Event("click", { bubbles }); + setChecked.call(input, checked); + input.dispatchEvent(event); + } + }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]); + const defaultCheckedRef = React.useRef(checked); + return /* @__PURE__ */ jsx( + Primitive.input, + { + type: "radio", + "aria-hidden": true, + defaultChecked: defaultCheckedRef.current, + required, + disabled, + name, + value, + form, + ...props, + tabIndex: -1, + ref: composedRefs, + style: { + ...props.style, + ...controlSize, + position: "absolute", + pointerEvents: "none", + opacity: 0, + margin: 0, + // We transform because the input is absolutely positioned but we have + // rendered it **after** the button. This pulls it back to sit on top + // of the button. + transform: "translateX(-100%)" + } + } + ); + } +); +RadioBubbleInput.displayName = BUBBLE_INPUT_NAME; +function isFunction(value) { + return typeof value === "function"; +} +function getState(checked) { + return checked ? "checked" : "unchecked"; +} + +// src/radio-group.tsx +import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime"; +var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]; +var RADIO_GROUP_NAME = "RadioGroup"; +var [createRadioGroupContext, createRadioGroupScope] = createContextScope2(RADIO_GROUP_NAME, [ + createRovingFocusGroupScope, + createRadioScope +]); +var useRovingFocusGroupScope = createRovingFocusGroupScope(); +var useRadioScope = createRadioScope(); +var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME); +var RadioGroup = React2.forwardRef( + (props, forwardedRef) => { + const { + __scopeRadioGroup, + name, + defaultValue, + value: valueProp, + required = false, + disabled = false, + orientation, + dir, + loop = true, + onValueChange, + ...groupProps + } = props; + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup); + const direction = useDirection(dir); + const [value, setValue] = useControllableState({ + prop: valueProp, + defaultProp: defaultValue ?? null, + onChange: onValueChange, + caller: RADIO_GROUP_NAME + }); + return /* @__PURE__ */ jsx2( + RadioGroupProvider, + { + scope: __scopeRadioGroup, + name, + required, + disabled, + value, + onValueChange: setValue, + children: /* @__PURE__ */ jsx2( + RovingFocusGroup.Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation, + dir: direction, + loop, + children: /* @__PURE__ */ jsx2( + Primitive2.div, + { + role: "radiogroup", + "aria-required": required, + "aria-orientation": orientation, + "data-disabled": disabled ? "" : void 0, + dir: direction, + ...groupProps, + ref: forwardedRef + } + ) + } + ) + } + ); + } +); +RadioGroup.displayName = RADIO_GROUP_NAME; +var ITEM_NAME = "RadioGroupItem"; +var ITEM_PROVIDER_NAME = "RadioGroupItemProvider"; +var ITEM_TRIGGER_NAME = "RadioGroupItemTrigger"; +var ITEM_BUBBLE_INPUT_NAME = "RadioGroupItemBubbleInput"; +function RadioGroupItemProvider(props) { + const { + __scopeRadioGroup, + value, + disabled, + children, + // @ts-expect-error + internal_do_not_use_render + } = props; + const context = useRadioGroupContext(ITEM_PROVIDER_NAME, __scopeRadioGroup); + const radioScope = useRadioScope(__scopeRadioGroup); + const isDisabled = context.disabled || disabled; + return /* @__PURE__ */ jsx2( + RadioProvider, + { + ...radioScope, + checked: context.value === value, + disabled: isDisabled, + required: context.required, + name: context.name, + value, + onCheck: () => context.onValueChange(value), + internal_do_not_use_render, + children + } + ); +} +var RadioGroupItemTrigger = React2.forwardRef((props, forwardedRef) => { + const { __scopeRadioGroup, ...triggerProps } = props; + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup); + const radioScope = useRadioScope(__scopeRadioGroup); + const { checked, disabled } = useRadioContext(ITEM_TRIGGER_NAME, radioScope.__scopeRadio); + const ref = React2.useRef(null); + const composedRefs = useComposedRefs2(forwardedRef, ref); + const isArrowKeyPressedRef = React2.useRef(false); + React2.useEffect(() => { + const handleKeyDown = (event) => { + if (ARROW_KEYS.includes(event.key)) { + isArrowKeyPressedRef.current = true; + } + }; + const handleKeyUp = () => isArrowKeyPressedRef.current = false; + document.addEventListener("keydown", handleKeyDown); + document.addEventListener("keyup", handleKeyUp); + return () => { + document.removeEventListener("keydown", handleKeyDown); + document.removeEventListener("keyup", handleKeyUp); + }; + }, []); + return /* @__PURE__ */ jsx2( + RovingFocusGroup.Item, + { + asChild: true, + ...rovingFocusGroupScope, + focusable: !disabled, + active: checked, + children: /* @__PURE__ */ jsx2( + RadioTrigger, + { + ...radioScope, + ...triggerProps, + ref: composedRefs, + onKeyDown: composeEventHandlers2(triggerProps.onKeyDown, (event) => { + if (event.key === "Enter") event.preventDefault(); + }), + onFocus: composeEventHandlers2(triggerProps.onFocus, () => { + if (isArrowKeyPressedRef.current) { + ref.current?.click(); + } + }) + } + ) + } + ); +}); +RadioGroupItemTrigger.displayName = ITEM_TRIGGER_NAME; +var RadioGroupItem = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeRadioGroup, value, disabled, ...itemProps } = props; + return /* @__PURE__ */ jsx2( + RadioGroupItemProvider, + { + __scopeRadioGroup, + value, + disabled, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs2(Fragment2, { children: [ + /* @__PURE__ */ jsx2( + RadioGroupItemTrigger, + { + ...itemProps, + ref: forwardedRef, + __scopeRadioGroup + } + ), + isFormControl && /* @__PURE__ */ jsx2( + RadioGroupItemBubbleInput, + { + __scopeRadioGroup + } + ) + ] }) + } + ); + } +); +RadioGroupItem.displayName = ITEM_NAME; +var RadioGroupItemBubbleInput = React2.forwardRef((props, forwardedRef) => { + const { __scopeRadioGroup, ...bubbleProps } = props; + const radioScope = useRadioScope(__scopeRadioGroup); + return /* @__PURE__ */ jsx2(RadioBubbleInput, { ...radioScope, ...bubbleProps, ref: forwardedRef }); +}); +RadioGroupItemBubbleInput.displayName = ITEM_BUBBLE_INPUT_NAME; +var INDICATOR_NAME2 = "RadioGroupIndicator"; +var RadioGroupIndicator = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeRadioGroup, ...indicatorProps } = props; + const radioScope = useRadioScope(__scopeRadioGroup); + return /* @__PURE__ */ jsx2(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef }); + } +); +RadioGroupIndicator.displayName = INDICATOR_NAME2; +export { + RadioGroupIndicator as Indicator, + RadioGroupItem as Item, + RadioGroup, + RadioGroupIndicator, + RadioGroupItem, + RadioGroup as Root, + createRadioGroupScope, + RadioGroupItemBubbleInput as unstable_ItemBubbleInput, + RadioGroupItemProvider as unstable_ItemProvider, + RadioGroupItemTrigger as unstable_ItemTrigger, + RadioGroupItemBubbleInput as unstable_RadioGroupItemBubbleInput, + RadioGroupItemProvider as unstable_RadioGroupItemProvider, + RadioGroupItemTrigger as unstable_RadioGroupItemTrigger +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..890e62bc2fbb6cfa155ff1c320ed5668f1c47f1f --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/radio-group.tsx", "../src/radio.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport {\n type Radio,\n RadioProvider,\n RadioTrigger,\n RadioBubbleInput,\n RadioIndicator,\n createRadioScope,\n useRadioContext,\n} from './radio';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps

= P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value: string | null;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ComponentRef;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef['required'];\n disabled?: React.ComponentPropsWithoutRef['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: string | null;\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeRadioGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? null,\n onChange: onValueChange as (value: string | null) => void,\n caller: RADIO_GROUP_NAME,\n });\n\n return (\n \n \n \n \n \n );\n },\n);\n\nRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemProvider\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RadioGroupItem';\nconst ITEM_PROVIDER_NAME = 'RadioGroupItemProvider';\nconst ITEM_TRIGGER_NAME = 'RadioGroupItemTrigger';\nconst ITEM_BUBBLE_INPUT_NAME = 'RadioGroupItemBubbleInput';\n\ninterface RadioGroupItemProviderProps {\n value: string;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nfunction RadioGroupItemProvider(props: ScopedProps) {\n const {\n __scopeRadioGroup,\n value,\n disabled,\n children,\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n const context = useRadioGroupContext(ITEM_PROVIDER_NAME, __scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n\n return (\n context.onValueChange(value)}\n // @ts-expect-error\n internal_do_not_use_render={internal_do_not_use_render}\n >\n {children}\n \n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemTrigger\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemTriggerElement = React.ComponentRef;\ninterface RadioGroupItemTriggerProps extends React.ComponentPropsWithoutRef {}\n\nconst RadioGroupItemTrigger = React.forwardRef<\n RadioGroupItemTriggerElement,\n RadioGroupItemTriggerProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, ...triggerProps } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const { checked, disabled } = useRadioContext(ITEM_TRIGGER_NAME, radioScope.__scopeRadio);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n \n {\n // According to WAI ARIA, radio groups don't activate items on enter\n // keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(triggerProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with\n * arrow keys and we need to \"check\" it in that case. We click it to\n * \"check\" it (instead of updating `context.value`) so that the radio\n * change event fires.\n */\n if (isArrowKeyPressedRef.current) {\n ref.current?.click();\n }\n })}\n />\n \n );\n});\n\nRadioGroupItemTrigger.displayName = ITEM_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemElement = React.ComponentRef;\ntype RadioProps = React.ComponentPropsWithoutRef;\ninterface RadioGroupItemProps extends Omit {\n value: string;\n}\n\nconst RadioGroupItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, value, disabled, ...itemProps } = props;\n\n return (\n (\n <>\n \n {isFormControl && (\n \n )}\n \n )}\n />\n );\n },\n);\n\nRadioGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemBubbleInputElement = React.ComponentRef;\ninterface RadioGroupItemBubbleInputProps extends React.ComponentPropsWithoutRef<\n typeof RadioBubbleInput\n> {}\n\nconst RadioGroupItemBubbleInput = React.forwardRef<\n RadioGroupItemBubbleInputElement,\n RadioGroupItemBubbleInputProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, ...bubbleProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return ;\n});\n\nRadioGroupItemBubbleInput.displayName = ITEM_BUBBLE_INPUT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioGroupIndicator';\n\ntype RadioGroupIndicatorElement = React.ComponentRef;\ntype RadioIndicatorProps = React.ComponentPropsWithoutRef;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return ;\n },\n);\n\nRadioGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemProvider,\n RadioGroupItemTrigger,\n RadioGroupItemBubbleInput,\n RadioGroupIndicator,\n //\n RadioGroup as Root,\n RadioGroupItem as Item,\n RadioGroupItemProvider as ItemProvider,\n RadioGroupItemTrigger as ItemTrigger,\n RadioGroupItemBubbleInput as ItemBubbleInput,\n RadioGroupIndicator as Indicator,\n};\nexport type {\n RadioGroupProps,\n RadioGroupItemProps,\n RadioGroupItemProviderProps,\n RadioGroupItemTriggerProps,\n RadioGroupItemBubbleInputProps,\n RadioGroupIndicatorProps,\n};\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst RADIO_NAME = 'Radio';\n\ntype ScopedProps

= P & { __scopeRadio?: Scope };\nconst [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);\n\ntype RadioContextValue = {\n checked: boolean;\n disabled: boolean | undefined;\n required: boolean | undefined;\n name: string | undefined;\n form: string | undefined;\n value: string | number | readonly string[];\n control: HTMLButtonElement | null;\n setControl: React.Dispatch>;\n hasConsumerStoppedPropagationRef: React.RefObject;\n isFormControl: boolean;\n bubbleInput: HTMLInputElement | null;\n setBubbleInput: React.Dispatch>;\n onCheck(): void;\n};\n\nconst [RadioProviderImpl, useRadioContext] = createRadioContext(RADIO_NAME);\n\n/* -------------------------------------------------------------------------------------------------\n * RadioProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RadioProviderProps {\n checked?: boolean;\n required?: boolean;\n disabled?: boolean;\n name?: string;\n form?: string;\n value?: string | number | readonly string[];\n onCheck?(): void;\n children?: React.ReactNode;\n}\n\nfunction RadioProvider(props: ScopedProps) {\n const {\n __scopeRadio,\n checked = false,\n children,\n disabled,\n form,\n name,\n onCheck,\n required,\n value = 'on',\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const isFormControl = control\n ? !!form || !!control.closest('form')\n : // We set this to true by default so that events bubble to forms without JS (SSR)\n true;\n\n const context: RadioContextValue = {\n checked,\n disabled,\n required,\n name,\n form,\n value,\n control,\n setControl,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n setBubbleInput,\n onCheck: () => onCheck?.(),\n };\n\n return (\n \n {isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children}\n \n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RadioTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'RadioTrigger';\n\ninterface RadioTriggerProps extends Omit<\n React.ComponentPropsWithoutRef,\n keyof RadioProviderProps\n> {\n children?: React.ReactNode;\n}\n\nconst RadioTrigger = React.forwardRef(\n ({ __scopeRadio, onClick, ...radioProps }: ScopedProps, forwardedRef) => {\n const {\n checked,\n disabled,\n value,\n setControl,\n onCheck,\n hasConsumerStoppedPropagationRef,\n isFormControl,\n bubbleInput,\n } = useRadioContext(TRIGGER_NAME, __scopeRadio);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n return (\n {\n // radios cannot be unchecked so we only communicate a checked state\n if (!checked) onCheck();\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n // if radio has a bubble input and is a form control, stop propagation\n // from the button so that we only propagate one click event (from the\n // input). We propagate changes from an input so that native form\n // validation works and form events reflect radio updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })}\n />\n );\n },\n);\n\nRadioTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Radio\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface RadioProps extends Omit {\n checked?: boolean;\n required?: boolean;\n onCheck?(): void;\n}\n\nconst Radio = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadio, name, checked, required, disabled, value, onCheck, form, ...radioProps } =\n props;\n\n return (\n (\n <>\n \n {isFormControl && (\n \n )}\n \n )}\n />\n );\n },\n);\n\nRadio.displayName = RADIO_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'RadioIndicator';\n\ntype RadioIndicatorElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\nexport interface RadioIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst RadioIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeRadio, forceMount, ...indicatorProps } = props;\n const context = useRadioContext(INDICATOR_NAME, __scopeRadio);\n return (\n \n \n \n );\n },\n);\n\nRadioIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * RadioBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'RadioBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef;\ninterface RadioBubbleInputProps extends Omit {}\n\nconst RadioBubbleInput = React.forwardRef(\n ({ __scopeRadio, ...props }: ScopedProps, forwardedRef) => {\n const {\n control,\n checked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput,\n hasConsumerStoppedPropagationRef,\n } = useRadioContext(BUBBLE_INPUT_NAME, __scopeRadio);\n\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const prevChecked = usePrevious(checked);\n const controlSize = useSize(control);\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n 'checked',\n ) as PropertyDescriptor;\n const setChecked = descriptor.set;\n\n const bubbles = !hasConsumerStoppedPropagationRef.current;\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n }\n }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);\n\n const defaultCheckedRef = React.useRef(checked);\n return (\n \n );\n },\n);\n\nRadioBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked';\n}\n\nexport {\n createRadioScope,\n useRadioContext,\n //\n Radio,\n RadioProvider,\n RadioTrigger,\n RadioIndicator,\n RadioBubbleInput,\n};\nexport type { RadioProps, RadioProviderProps, RadioTriggerProps, RadioBubbleInputProps };\n"], + "mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,wBAAAC,6BAA4B;AACrC,SAAS,mBAAAC,wBAAuB;AAChC,SAAS,sBAAAC,2BAA0B;AACnC,SAAS,aAAAC,kBAAiB;AAC1B,YAAY,sBAAsB;AAClC,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;;;ACR7B,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAkFtB,SA4FM,UA5FN,KA4FM,YA5FN;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AAA,UACF;AAAA,UACC,iBACC,gBAAAA;AAAA,YAAC;AAAA;AAAA,cAEC;AAAA;AAAA,UACF;AAAA,WAEJ;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAW7B,IAAM,4BAAkC,kBAGtC,CAAC,OAAoD,iBAAiB;AACtE,QAAM,EAAE,mBAAmB,GAAG,YAAY,IAAI;AAC9C,QAAM,aAAa,cAAc,iBAAiB;AAClD,SAAO,gBAAAA,KAAC,oBAAkB,GAAG,YAAa,GAAG,aAAa,KAAK,cAAc;AAC/E,CAAC;AAED,0BAA0B,cAAc;AAMxC,IAAMM,kBAAiB;AAMvB,IAAM,sBAA4B;AAAA,EAChC,CAAC,OAA8C,iBAAiB;AAC9D,UAAM,EAAE,mBAAmB,GAAG,eAAe,IAAI;AACjD,UAAM,aAAa,cAAc,iBAAiB;AAClD,WAAO,gBAAAN,KAAC,kBAAgB,GAAG,YAAa,GAAG,gBAAgB,KAAK,cAAc;AAAA,EAChF;AACF;AAEA,oBAAoB,cAAcM;", + "names": ["React", "composeEventHandlers", "useComposedRefs", "createContextScope", "Primitive", "Fragment", "jsx", "jsxs", "createContextScope", "Primitive", "useComposedRefs", "composeEventHandlers", "INDICATOR_NAME"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4758c670121aea6e81a0f310942e88813d3eb0f6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-radio-group/package.json @@ -0,0 +1,77 @@ +{ + "name": "@radix-ui/react-radio-group", + "version": "1.4.1", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-previous": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-size": "1.1.2", + "@radix-ui/react-roving-focus": "1.1.13" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/radio-group" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bc1d8c035336ae4ca27bc783defa948b0cceb5f0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/README.md @@ -0,0 +1,3 @@ +# `react-roving-focus` + +This is an internal utility, not intended for public usage. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..7a81f796b48dc35d94d63603a0afffd55bccb8f6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.d.mts @@ -0,0 +1,49 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createRovingFocusGroupScope: _radix_ui_react_context.CreateScope; +type Orientation = React.AriaAttributes['aria-orientation']; +type Direction = 'ltr' | 'rtl'; +interface RovingFocusGroupOptions { + /** + * The orientation of the group. + * Mainly so arrow navigation is done accordingly (left & right vs. up & down) + */ + orientation?: Orientation; + /** + * The direction of navigation between items. + */ + dir?: Direction; + /** + * Whether keyboard navigation should loop around + * @defaultValue false + */ + loop?: boolean; +} +interface RovingFocusGroupProps extends RovingFocusGroupImplProps { +} +declare const RovingFocusGroup: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface RovingFocusGroupImplProps extends Omit, RovingFocusGroupOptions { + currentTabStopId?: string | null; + defaultCurrentTabStopId?: string; + onCurrentTabStopIdChange?: (tabStopId: string | null) => void; + onEntryFocus?: (event: Event) => void; + preventScrollOnEntryFocus?: boolean; +} +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface RovingFocusItemProps extends Omit { + tabStopId?: string; + focusable?: boolean; + active?: boolean; + children?: React.ReactNode | ((props: { + hasTabStop: boolean; + isCurrentTabStop: boolean; + }) => React.ReactNode); +} +declare const RovingFocusGroupItem: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; + +export { Item, Root, RovingFocusGroup, RovingFocusGroupItem, type RovingFocusGroupProps, type RovingFocusItemProps, createRovingFocusGroupScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a81f796b48dc35d94d63603a0afffd55bccb8f6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts @@ -0,0 +1,49 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createRovingFocusGroupScope: _radix_ui_react_context.CreateScope; +type Orientation = React.AriaAttributes['aria-orientation']; +type Direction = 'ltr' | 'rtl'; +interface RovingFocusGroupOptions { + /** + * The orientation of the group. + * Mainly so arrow navigation is done accordingly (left & right vs. up & down) + */ + orientation?: Orientation; + /** + * The direction of navigation between items. + */ + dir?: Direction; + /** + * Whether keyboard navigation should loop around + * @defaultValue false + */ + loop?: boolean; +} +interface RovingFocusGroupProps extends RovingFocusGroupImplProps { +} +declare const RovingFocusGroup: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface RovingFocusGroupImplProps extends Omit, RovingFocusGroupOptions { + currentTabStopId?: string | null; + defaultCurrentTabStopId?: string; + onCurrentTabStopIdChange?: (tabStopId: string | null) => void; + onEntryFocus?: (event: Event) => void; + preventScrollOnEntryFocus?: boolean; +} +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface RovingFocusItemProps extends Omit { + tabStopId?: string; + focusable?: boolean; + active?: boolean; + children?: React.ReactNode | ((props: { + hasTabStop: boolean; + isCurrentTabStop: boolean; + }) => React.ReactNode); +} +declare const RovingFocusGroupItem: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Item: React.ForwardRefExoticComponent>; + +export { Item, Root, RovingFocusGroup, RovingFocusGroupItem, type RovingFocusGroupProps, type RovingFocusItemProps, createRovingFocusGroupScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b49982f5a62521aaf0be8831ad7c86d661ab04a0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.js @@ -0,0 +1,263 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Item: () => Item, + Root: () => Root, + RovingFocusGroup: () => RovingFocusGroup, + RovingFocusGroupItem: () => RovingFocusGroupItem, + createRovingFocusGroupScope: () => createRovingFocusGroupScope +}); +module.exports = __toCommonJS(index_exports); + +// src/roving-focus-group.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_collection = require("@radix-ui/react-collection"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_jsx_runtime = require("react/jsx-runtime"); +var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var GROUP_NAME = "RovingFocusGroup"; +var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(GROUP_NAME); +var [createRovingFocusGroupContext, createRovingFocusGroupScope] = (0, import_react_context.createContextScope)( + GROUP_NAME, + [createCollectionScope] +); +var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME); +var RovingFocusGroup = React.forwardRef( + (props, forwardedRef) => { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) }); + } +); +RovingFocusGroup.displayName = GROUP_NAME; +var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => { + const { + __scopeRovingFocusGroup, + orientation, + loop = false, + dir, + currentTabStopId: currentTabStopIdProp, + defaultCurrentTabStopId, + onCurrentTabStopIdChange, + onEntryFocus, + preventScrollOnEntryFocus = false, + ...groupProps + } = props; + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const direction = (0, import_react_direction.useDirection)(dir); + const [currentTabStopId, setCurrentTabStopId] = (0, import_react_use_controllable_state.useControllableState)({ + prop: currentTabStopIdProp, + defaultProp: defaultCurrentTabStopId ?? null, + onChange: onCurrentTabStopIdChange, + caller: GROUP_NAME + }); + const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false); + const handleEntryFocus = (0, import_react_use_callback_ref.useCallbackRef)(onEntryFocus); + const getItems = useCollection(__scopeRovingFocusGroup); + const isClickFocusRef = React.useRef(false); + const [focusableItemsCount, setFocusableItemsCount] = React.useState(0); + React.useEffect(() => { + const node = ref.current; + if (node) { + node.addEventListener(ENTRY_FOCUS, handleEntryFocus); + return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus); + } + }, [handleEntryFocus]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + RovingFocusProvider, + { + scope: __scopeRovingFocusGroup, + orientation, + dir: direction, + loop, + currentTabStopId, + onItemFocus: React.useCallback( + (tabStopId) => setCurrentTabStopId(tabStopId), + [setCurrentTabStopId] + ), + onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []), + onFocusableItemAdd: React.useCallback( + () => setFocusableItemsCount((prevCount) => prevCount + 1), + [] + ), + onFocusableItemRemove: React.useCallback( + () => setFocusableItemsCount((prevCount) => prevCount - 1), + [] + ), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, + "data-orientation": orientation, + ...groupProps, + ref: composedRefs, + style: { outline: "none", ...props.style }, + onMouseDown: (0, import_primitive.composeEventHandlers)(props.onMouseDown, () => { + isClickFocusRef.current = true; + }), + onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, (event) => { + const isKeyboardFocus = !isClickFocusRef.current; + if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { + const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS); + event.currentTarget.dispatchEvent(entryFocusEvent); + if (!entryFocusEvent.defaultPrevented) { + const items = getItems().filter((item) => item.focusable); + const activeItem = items.find((item) => item.active); + const currentItem = items.find((item) => item.id === currentTabStopId); + const candidateItems = [activeItem, currentItem, ...items].filter( + Boolean + ); + const candidateNodes = candidateItems.map((item) => item.ref.current); + focusFirst(candidateNodes, preventScrollOnEntryFocus); + } + } + isClickFocusRef.current = false; + }), + onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, () => setIsTabbingBackOut(false)) + } + ) + } + ); +}); +var ITEM_NAME = "RovingFocusGroupItem"; +var RovingFocusGroupItem = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeRovingFocusGroup, + focusable = true, + active = false, + tabStopId, + children, + ...itemProps + } = props; + const autoId = (0, import_react_id.useId)(); + const id = tabStopId || autoId; + const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup); + const isCurrentTabStop = context.currentTabStopId === id; + const getItems = useCollection(__scopeRovingFocusGroup); + const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context; + React.useEffect(() => { + if (focusable) { + onFocusableItemAdd(); + return () => onFocusableItemRemove(); + } + }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + Collection.ItemSlot, + { + scope: __scopeRovingFocusGroup, + id, + focusable, + active, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.span, + { + tabIndex: isCurrentTabStop ? 0 : -1, + "data-orientation": context.orientation, + ...itemProps, + ref: forwardedRef, + onMouseDown: (0, import_primitive.composeEventHandlers)(props.onMouseDown, (event) => { + if (!focusable) event.preventDefault(); + else context.onItemFocus(id); + }), + onFocus: (0, import_primitive.composeEventHandlers)(props.onFocus, () => context.onItemFocus(id)), + onKeyDown: (0, import_primitive.composeEventHandlers)(props.onKeyDown, (event) => { + if (event.key === "Tab" && event.shiftKey) { + context.onItemShiftTab(); + return; + } + if (event.target !== event.currentTarget) return; + const focusIntent = getFocusIntent(event, context.orientation, context.dir); + if (focusIntent !== void 0) { + if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return; + event.preventDefault(); + const items = getItems().filter((item) => item.focusable); + let candidateNodes = items.map((item) => item.ref.current); + if (focusIntent === "last") candidateNodes.reverse(); + else if (focusIntent === "prev" || focusIntent === "next") { + if (focusIntent === "prev") candidateNodes.reverse(); + const currentIndex = candidateNodes.indexOf(event.currentTarget); + candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); + } + setTimeout(() => focusFirst(candidateNodes)); + } + }), + children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children + } + ) + } + ); + } +); +RovingFocusGroupItem.displayName = ITEM_NAME; +var MAP_KEY_TO_FOCUS_INTENT = { + ArrowLeft: "prev", + ArrowUp: "prev", + ArrowRight: "next", + ArrowDown: "next", + PageUp: "first", + Home: "first", + PageDown: "last", + End: "last" +}; +function getDirectionAwareKey(key, dir) { + if (dir !== "rtl") return key; + return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; +} +function getFocusIntent(event, orientation, dir) { + const key = getDirectionAwareKey(event.key, dir); + if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; + if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; + return MAP_KEY_TO_FOCUS_INTENT[key]; +} +function focusFirst(candidates, preventScroll = false) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus({ preventScroll }); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +var Root = RovingFocusGroup; +var Item = RovingFocusGroupItem; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..6f1f360c45032430f576335f1923e27cbc458811 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/roving-focus-group.tsx"], + "sourcesContent": ["'use client';\nexport {\n createRovingFocusGroupScope,\n //\n RovingFocusGroup,\n RovingFocusGroupItem,\n //\n Root,\n Item,\n} from './roving-focus-group';\nexport type { RovingFocusGroupProps, RovingFocusItemProps } from './roving-focus-group';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'RovingFocusGroup';\n\ntype ItemData = { id: string; focusable: boolean; active: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n HTMLSpanElement,\n ItemData\n>(GROUP_NAME);\n\ntype ScopedProps

= P & { __scopeRovingFocusGroup?: Scope };\nconst [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope],\n);\n\ntype Orientation = React.AriaAttributes['aria-orientation'];\ntype Direction = 'ltr' | 'rtl';\n\ninterface RovingFocusGroupOptions {\n /**\n * The orientation of the group.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n */\n orientation?: Orientation;\n /**\n * The direction of navigation between items.\n */\n dir?: Direction;\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: boolean;\n}\n\ntype RovingContextValue = RovingFocusGroupOptions & {\n currentTabStopId: string | null;\n onItemFocus(tabStopId: string): void;\n onItemShiftTab(): void;\n onFocusableItemAdd(): void;\n onFocusableItemRemove(): void;\n};\n\nconst [RovingFocusProvider, useRovingFocusContext] =\n createRovingFocusGroupContext(GROUP_NAME);\n\ntype RovingFocusGroupElement = RovingFocusGroupImplElement;\ninterface RovingFocusGroupProps extends RovingFocusGroupImplProps {}\n\nconst RovingFocusGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n return (\n \n \n \n \n \n );\n },\n);\n\nRovingFocusGroup.displayName = GROUP_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupImplElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface RovingFocusGroupImplProps\n extends Omit, RovingFocusGroupOptions {\n currentTabStopId?: string | null;\n defaultCurrentTabStopId?: string;\n onCurrentTabStopIdChange?: (tabStopId: string | null) => void;\n onEntryFocus?: (event: Event) => void;\n preventScrollOnEntryFocus?: boolean;\n}\n\nconst RovingFocusGroupImpl = React.forwardRef<\n RovingFocusGroupImplElement,\n RovingFocusGroupImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME,\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n\n return (\n setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId],\n )}\n onItemShiftTab={React.useCallback(() => setIsTabbingBackOut(true), [])}\n onFocusableItemAdd={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n [],\n )}\n onFocusableItemRemove={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n [],\n )}\n >\n {\n isClickFocusRef.current = true;\n })}\n onFocus={composeEventHandlers(props.onFocus, (event) => {\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !isClickFocusRef.current;\n\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean,\n ) as typeof items;\n const candidateNodes = candidateItems.map((item) => item.ref.current!);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n\n isClickFocusRef.current = false;\n })}\n onBlur={composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RovingFocusGroupItem';\n\ntype RovingFocusItemElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface RovingFocusItemProps extends Omit {\n tabStopId?: string;\n focusable?: boolean;\n active?: boolean;\n children?:\n | React.ReactNode\n | ((props: { hasTabStop: boolean; isCurrentTabStop: boolean }) => React.ReactNode);\n}\n\nconst RovingFocusGroupItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n\n return (\n \n {\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n if (!focusable) event.preventDefault();\n // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n else context.onItemFocus(id);\n })}\n onFocus={composeEventHandlers(props.onFocus, () => context.onItemFocus(id))}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === 'Tab' && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n\n if (event.target !== event.currentTarget) return;\n\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n\n if (focusIntent !== undefined) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (focusIntent === 'last') candidateNodes.reverse();\n else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop\n ? wrapArray(candidateNodes, currentIndex + 1)\n : candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n }\n })}\n >\n {typeof children === 'function'\n ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null })\n : children}\n \n \n );\n },\n);\n\nRovingFocusGroupItem.displayName = ITEM_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// prettier-ignore\nconst MAP_KEY_TO_FOCUS_INTENT: Record = {\n ArrowLeft: 'prev', ArrowUp: 'prev',\n ArrowRight: 'next', ArrowDown: 'next',\n PageUp: 'first', Home: 'first',\n PageDown: 'last', End: 'last',\n};\n\nfunction getDirectionAwareKey(key: string, dir?: Direction) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nfunction getFocusIntent(event: React.KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nfunction focusFirst(candidates: HTMLElement[], preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = RovingFocusGroup;\nconst Item = RovingFocusGroupItem;\n\nexport {\n createRovingFocusGroupScope,\n //\n RovingFocusGroup,\n RovingFocusGroupItem,\n //\n Root,\n Item,\n};\nexport type { RovingFocusGroupProps, RovingFocusItemProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB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aACjB,SAAS,EAAE,kBAAkB,YAAY,oBAAoB,KAAK,CAAC,IACnE;AAAA;AAAA,QACN;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,qBAAqB,cAAc;AAKnC,IAAM,0BAAuD;AAAA,EAC3D,WAAW;AAAA,EAAQ,SAAS;AAAA,EAC5B,YAAY;AAAA,EAAQ,WAAW;AAAA,EAC/B,QAAQ;AAAA,EAAS,MAAM;AAAA,EACvB,UAAU;AAAA,EAAQ,KAAK;AACzB;AAEA,SAAS,qBAAqB,KAAa,KAAiB;AAC1D,MAAI,QAAQ,MAAO,QAAO;AAC1B,SAAO,QAAQ,cAAc,eAAe,QAAQ,eAAe,cAAc;AACnF;AAIA,SAAS,eAAe,OAA4B,aAA2B,KAAiB;AAC9F,QAAM,MAAM,qBAAqB,MAAM,KAAK,GAAG;AAC/C,MAAI,gBAAgB,cAAc,CAAC,aAAa,YAAY,EAAE,SAAS,GAAG,EAAG,QAAO;AACpF,MAAI,gBAAgB,gBAAgB,CAAC,WAAW,WAAW,EAAE,SAAS,GAAG,EAAG,QAAO;AACnF,SAAO,wBAAwB,GAAG;AACpC;AAEA,SAAS,WAAW,YAA2B,gBAAgB,OAAO;AACpE,QAAM,6BAA6B,SAAS;AAC5C,aAAW,aAAa,YAAY;AAElC,QAAI,cAAc,2BAA4B;AAC9C,cAAU,MAAM,EAAE,cAAc,CAAC;AACjC,QAAI,SAAS,kBAAkB,2BAA4B;AAAA,EAC7D;AACF;AAMA,SAAS,UAAa,OAAY,YAAoB;AACpD,SAAO,MAAM,IAAO,CAAC,GAAG,UAAU,OAAO,aAAa,SAAS,MAAM,MAAM,CAAE;AAC/E;AAEA,IAAM,OAAO;AACb,IAAM,OAAO;", + "names": [] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..08aaabcdb5402c74bcbd935a34e2b7f4a50fdfc0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.mjs @@ -0,0 +1,231 @@ +"use client"; + +// src/roving-focus-group.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { createCollection } from "@radix-ui/react-collection"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContextScope } from "@radix-ui/react-context"; +import { useId } from "@radix-ui/react-id"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { useDirection } from "@radix-ui/react-direction"; +import { jsx } from "react/jsx-runtime"; +var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var GROUP_NAME = "RovingFocusGroup"; +var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME); +var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope( + GROUP_NAME, + [createCollectionScope] +); +var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME); +var RovingFocusGroup = React.forwardRef( + (props, forwardedRef) => { + return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) }); + } +); +RovingFocusGroup.displayName = GROUP_NAME; +var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => { + const { + __scopeRovingFocusGroup, + orientation, + loop = false, + dir, + currentTabStopId: currentTabStopIdProp, + defaultCurrentTabStopId, + onCurrentTabStopIdChange, + onEntryFocus, + preventScrollOnEntryFocus = false, + ...groupProps + } = props; + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + const direction = useDirection(dir); + const [currentTabStopId, setCurrentTabStopId] = useControllableState({ + prop: currentTabStopIdProp, + defaultProp: defaultCurrentTabStopId ?? null, + onChange: onCurrentTabStopIdChange, + caller: GROUP_NAME + }); + const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false); + const handleEntryFocus = useCallbackRef(onEntryFocus); + const getItems = useCollection(__scopeRovingFocusGroup); + const isClickFocusRef = React.useRef(false); + const [focusableItemsCount, setFocusableItemsCount] = React.useState(0); + React.useEffect(() => { + const node = ref.current; + if (node) { + node.addEventListener(ENTRY_FOCUS, handleEntryFocus); + return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus); + } + }, [handleEntryFocus]); + return /* @__PURE__ */ jsx( + RovingFocusProvider, + { + scope: __scopeRovingFocusGroup, + orientation, + dir: direction, + loop, + currentTabStopId, + onItemFocus: React.useCallback( + (tabStopId) => setCurrentTabStopId(tabStopId), + [setCurrentTabStopId] + ), + onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []), + onFocusableItemAdd: React.useCallback( + () => setFocusableItemsCount((prevCount) => prevCount + 1), + [] + ), + onFocusableItemRemove: React.useCallback( + () => setFocusableItemsCount((prevCount) => prevCount - 1), + [] + ), + children: /* @__PURE__ */ jsx( + Primitive.div, + { + tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, + "data-orientation": orientation, + ...groupProps, + ref: composedRefs, + style: { outline: "none", ...props.style }, + onMouseDown: composeEventHandlers(props.onMouseDown, () => { + isClickFocusRef.current = true; + }), + onFocus: composeEventHandlers(props.onFocus, (event) => { + const isKeyboardFocus = !isClickFocusRef.current; + if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { + const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS); + event.currentTarget.dispatchEvent(entryFocusEvent); + if (!entryFocusEvent.defaultPrevented) { + const items = getItems().filter((item) => item.focusable); + const activeItem = items.find((item) => item.active); + const currentItem = items.find((item) => item.id === currentTabStopId); + const candidateItems = [activeItem, currentItem, ...items].filter( + Boolean + ); + const candidateNodes = candidateItems.map((item) => item.ref.current); + focusFirst(candidateNodes, preventScrollOnEntryFocus); + } + } + isClickFocusRef.current = false; + }), + onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false)) + } + ) + } + ); +}); +var ITEM_NAME = "RovingFocusGroupItem"; +var RovingFocusGroupItem = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeRovingFocusGroup, + focusable = true, + active = false, + tabStopId, + children, + ...itemProps + } = props; + const autoId = useId(); + const id = tabStopId || autoId; + const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup); + const isCurrentTabStop = context.currentTabStopId === id; + const getItems = useCollection(__scopeRovingFocusGroup); + const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context; + React.useEffect(() => { + if (focusable) { + onFocusableItemAdd(); + return () => onFocusableItemRemove(); + } + }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); + return /* @__PURE__ */ jsx( + Collection.ItemSlot, + { + scope: __scopeRovingFocusGroup, + id, + focusable, + active, + children: /* @__PURE__ */ jsx( + Primitive.span, + { + tabIndex: isCurrentTabStop ? 0 : -1, + "data-orientation": context.orientation, + ...itemProps, + ref: forwardedRef, + onMouseDown: composeEventHandlers(props.onMouseDown, (event) => { + if (!focusable) event.preventDefault(); + else context.onItemFocus(id); + }), + onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + if (event.key === "Tab" && event.shiftKey) { + context.onItemShiftTab(); + return; + } + if (event.target !== event.currentTarget) return; + const focusIntent = getFocusIntent(event, context.orientation, context.dir); + if (focusIntent !== void 0) { + if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return; + event.preventDefault(); + const items = getItems().filter((item) => item.focusable); + let candidateNodes = items.map((item) => item.ref.current); + if (focusIntent === "last") candidateNodes.reverse(); + else if (focusIntent === "prev" || focusIntent === "next") { + if (focusIntent === "prev") candidateNodes.reverse(); + const currentIndex = candidateNodes.indexOf(event.currentTarget); + candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); + } + setTimeout(() => focusFirst(candidateNodes)); + } + }), + children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children + } + ) + } + ); + } +); +RovingFocusGroupItem.displayName = ITEM_NAME; +var MAP_KEY_TO_FOCUS_INTENT = { + ArrowLeft: "prev", + ArrowUp: "prev", + ArrowRight: "next", + ArrowDown: "next", + PageUp: "first", + Home: "first", + PageDown: "last", + End: "last" +}; +function getDirectionAwareKey(key, dir) { + if (dir !== "rtl") return key; + return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; +} +function getFocusIntent(event, orientation, dir) { + const key = getDirectionAwareKey(event.key, dir); + if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; + if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; + return MAP_KEY_TO_FOCUS_INTENT[key]; +} +function focusFirst(candidates, preventScroll = false) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus({ preventScroll }); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +var Root = RovingFocusGroup; +var Item = RovingFocusGroupItem; +export { + Item, + Root, + RovingFocusGroup, + RovingFocusGroupItem, + createRovingFocusGroupScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..735344a8a1febf844d423a28af83a366c41c6794 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/roving-focus-group.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'RovingFocusGroup';\n\ntype ItemData = { id: string; focusable: boolean; active: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n HTMLSpanElement,\n ItemData\n>(GROUP_NAME);\n\ntype ScopedProps

= P & { __scopeRovingFocusGroup?: Scope };\nconst [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope],\n);\n\ntype Orientation = React.AriaAttributes['aria-orientation'];\ntype Direction = 'ltr' | 'rtl';\n\ninterface RovingFocusGroupOptions {\n /**\n * The orientation of the group.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n */\n orientation?: Orientation;\n /**\n * The direction of navigation between items.\n */\n dir?: Direction;\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: boolean;\n}\n\ntype RovingContextValue = RovingFocusGroupOptions & {\n currentTabStopId: string | null;\n onItemFocus(tabStopId: string): void;\n onItemShiftTab(): void;\n onFocusableItemAdd(): void;\n onFocusableItemRemove(): void;\n};\n\nconst [RovingFocusProvider, useRovingFocusContext] =\n createRovingFocusGroupContext(GROUP_NAME);\n\ntype RovingFocusGroupElement = RovingFocusGroupImplElement;\ninterface RovingFocusGroupProps extends RovingFocusGroupImplProps {}\n\nconst RovingFocusGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n return (\n \n \n \n \n \n );\n },\n);\n\nRovingFocusGroup.displayName = GROUP_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupImplElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface RovingFocusGroupImplProps\n extends Omit, RovingFocusGroupOptions {\n currentTabStopId?: string | null;\n defaultCurrentTabStopId?: string;\n onCurrentTabStopIdChange?: (tabStopId: string | null) => void;\n onEntryFocus?: (event: Event) => void;\n preventScrollOnEntryFocus?: boolean;\n}\n\nconst RovingFocusGroupImpl = React.forwardRef<\n RovingFocusGroupImplElement,\n RovingFocusGroupImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME,\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n\n return (\n setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId],\n )}\n onItemShiftTab={React.useCallback(() => setIsTabbingBackOut(true), [])}\n onFocusableItemAdd={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n [],\n )}\n onFocusableItemRemove={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n [],\n )}\n >\n {\n isClickFocusRef.current = true;\n })}\n onFocus={composeEventHandlers(props.onFocus, (event) => {\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !isClickFocusRef.current;\n\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean,\n ) as typeof items;\n const candidateNodes = candidateItems.map((item) => item.ref.current!);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n\n isClickFocusRef.current = false;\n })}\n onBlur={composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RovingFocusGroupItem';\n\ntype RovingFocusItemElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface RovingFocusItemProps extends Omit {\n tabStopId?: string;\n focusable?: boolean;\n active?: boolean;\n children?:\n | React.ReactNode\n | ((props: { hasTabStop: boolean; isCurrentTabStop: boolean }) => React.ReactNode);\n}\n\nconst RovingFocusGroupItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n\n return (\n \n {\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n if (!focusable) event.preventDefault();\n // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n else context.onItemFocus(id);\n })}\n onFocus={composeEventHandlers(props.onFocus, () => context.onItemFocus(id))}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === 'Tab' && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n\n if (event.target !== event.currentTarget) return;\n\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n\n if (focusIntent !== undefined) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (focusIntent === 'last') candidateNodes.reverse();\n else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop\n ? wrapArray(candidateNodes, currentIndex + 1)\n : candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n }\n })}\n >\n {typeof children === 'function'\n ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null })\n : children}\n \n \n );\n },\n);\n\nRovingFocusGroupItem.displayName = ITEM_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// prettier-ignore\nconst MAP_KEY_TO_FOCUS_INTENT: Record = {\n ArrowLeft: 'prev', ArrowUp: 'prev',\n ArrowRight: 'next', ArrowDown: 'next',\n PageUp: 'first', Home: 'first',\n PageDown: 'last', End: 'last',\n};\n\nfunction getDirectionAwareKey(key: string, dir?: Direction) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nfunction getFocusIntent(event: React.KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nfunction focusFirst(candidates: HTMLElement[], preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = RovingFocusGroup;\nconst Item = RovingFocusGroupItem;\n\nexport {\n createRovingFocusGroupScope,\n //\n RovingFocusGroup,\n RovingFocusGroupIt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/node_modules/@radix-ui/react-roving-focus/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1d882207e009cb36c2399e5bee9f42cdab56cb7e --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-roving-focus/package.json @@ -0,0 +1,76 @@ +{ + "name": "@radix-ui/react-roving-focus", + "version": "1.1.13", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/react-collection": "1.1.10", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-id": "1.1.2", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-use-controllable-state": "1.2.3", + "@radix-ui/react-use-callback-ref": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/builder": "0.0.0", + "@repo/typescript-config": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/roving-focus" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/README.md new file mode 100644 index 0000000000000000000000000000000000000000..44cee383609ad358f2239e381f15c5beb548e880 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/README.md @@ -0,0 +1,3 @@ +# `react-scroll-area` + +View docs [here](https://radix-ui.com/primitives/docs/components/scroll-area). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..28bfd02cca32f09901c4def4af75a99ae8f07e74 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.d.mts @@ -0,0 +1,123 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type Direction = 'ltr' | 'rtl'; +type Sizes = { + content: number; + viewport: number; + scrollbar: { + size: number; + paddingStart: number; + paddingEnd: number; + }; +}; +declare const createScrollAreaScope: _radix_ui_react_context.CreateScope; +type ScrollAreaContextValue = { + type: 'auto' | 'always' | 'scroll' | 'hover'; + dir: Direction; + scrollHideDelay: number; + scrollArea: ScrollAreaElement | null; + viewport: ScrollAreaViewportElement | null; + onViewportChange(viewport: ScrollAreaViewportElement | null): void; + content: HTMLDivElement | null; + onContentChange(content: HTMLDivElement): void; + scrollbarX: ScrollAreaScrollbarElement | null; + onScrollbarXChange(scrollbar: ScrollAreaScrollbarElement | null): void; + scrollbarXEnabled: boolean; + onScrollbarXEnabledChange(rendered: boolean): void; + scrollbarY: ScrollAreaScrollbarElement | null; + onScrollbarYChange(scrollbar: ScrollAreaScrollbarElement | null): void; + scrollbarYEnabled: boolean; + onScrollbarYEnabledChange(rendered: boolean): void; + onCornerWidthChange(width: number): void; + onCornerHeightChange(height: number): void; +}; +type ScrollAreaElement = React.ComponentRef; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface ScrollAreaProps extends PrimitiveDivProps { + type?: ScrollAreaContextValue['type']; + dir?: ScrollAreaContextValue['dir']; + scrollHideDelay?: number; +} +declare const ScrollArea: React.ForwardRefExoticComponent>; +type ScrollAreaViewportElement = React.ComponentRef; +interface ScrollAreaViewportProps extends PrimitiveDivProps { + nonce?: string; +} +declare const ScrollAreaViewport: React.ForwardRefExoticComponent>; +type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement; +interface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps { + forceMount?: true; +} +declare const ScrollAreaScrollbar: React.ForwardRefExoticComponent>; +type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement; +interface ScrollAreaScrollbarVisibleProps extends Omit { + orientation?: 'horizontal' | 'vertical'; +} +type ScrollAreaScrollbarAxisPrivateProps = { + hasThumb: boolean; + sizes: Sizes; + onSizesChange(sizes: Sizes): void; + onThumbChange(thumb: ScrollAreaThumbElement | null): void; + onThumbPointerDown(pointerPos: number): void; + onThumbPointerUp(): void; + onThumbPositionChange(): void; + onWheelScroll(scrollPos: number): void; + onDragScroll(pointerPos: number): void; +}; +type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement; +interface ScrollAreaScrollbarAxisProps extends Omit, ScrollAreaScrollbarAxisPrivateProps { +} +type ScrollbarContext = { + hasThumb: boolean; + scrollbar: ScrollAreaScrollbarElement | null; + onThumbChange(thumb: ScrollAreaThumbElement | null): void; + onThumbPointerUp(): void; + onThumbPointerDown(pointerPos: { + x: number; + y: number; + }): void; + onThumbPositionChange(): void; +}; +type ScrollAreaScrollbarImplElement = React.ComponentRef; +type ScrollAreaScrollbarImplPrivateProps = { + sizes: Sizes; + hasThumb: boolean; + onThumbChange: ScrollbarContext['onThumbChange']; + onThumbPointerUp: ScrollbarContext['onThumbPointerUp']; + onThumbPointerDown: ScrollbarContext['onThumbPointerDown']; + onThumbPositionChange: ScrollbarContext['onThumbPositionChange']; + onWheelScroll(event: WheelEvent, maxScrollPos: number): void; + onDragScroll(pointerPos: { + x: number; + y: number; + }): void; + onResize(): void; +}; +interface ScrollAreaScrollbarImplProps extends Omit, ScrollAreaScrollbarImplPrivateProps { +} +type ScrollAreaThumbElement = ScrollAreaThumbImplElement; +interface ScrollAreaThumbProps extends ScrollAreaThumbImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const ScrollAreaThumb: React.ForwardRefExoticComponent>; +type ScrollAreaThumbImplElement = React.ComponentRef; +interface ScrollAreaThumbImplProps extends PrimitiveDivProps { +} +interface ScrollAreaCornerProps extends ScrollAreaCornerImplProps { +} +declare const ScrollAreaCorner: React.ForwardRefExoticComponent>; +interface ScrollAreaCornerImplProps extends PrimitiveDivProps { +} +declare const Root: React.ForwardRefExoticComponent>; +declare const Viewport: React.ForwardRefExoticComponent>; +declare const Scrollbar: React.ForwardRefExoticComponent>; +declare const Thumb: React.ForwardRefExoticComponent>; +declare const Corner: React.ForwardRefExoticComponent>; + +export { Corner, Root, ScrollArea, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Scrollbar, Thumb, Viewport, createScrollAreaScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..28bfd02cca32f09901c4def4af75a99ae8f07e74 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.d.ts @@ -0,0 +1,123 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type Direction = 'ltr' | 'rtl'; +type Sizes = { + content: number; + viewport: number; + scrollbar: { + size: number; + paddingStart: number; + paddingEnd: number; + }; +}; +declare const createScrollAreaScope: _radix_ui_react_context.CreateScope; +type ScrollAreaContextValue = { + type: 'auto' | 'always' | 'scroll' | 'hover'; + dir: Direction; + scrollHideDelay: number; + scrollArea: ScrollAreaElement | null; + viewport: ScrollAreaViewportElement | null; + onViewportChange(viewport: ScrollAreaViewportElement | null): void; + content: HTMLDivElement | null; + onContentChange(content: HTMLDivElement): void; + scrollbarX: ScrollAreaScrollbarElement | null; + onScrollbarXChange(scrollbar: ScrollAreaScrollbarElement | null): void; + scrollbarXEnabled: boolean; + onScrollbarXEnabledChange(rendered: boolean): void; + scrollbarY: ScrollAreaScrollbarElement | null; + onScrollbarYChange(scrollbar: ScrollAreaScrollbarElement | null): void; + scrollbarYEnabled: boolean; + onScrollbarYEnabledChange(rendered: boolean): void; + onCornerWidthChange(width: number): void; + onCornerHeightChange(height: number): void; +}; +type ScrollAreaElement = React.ComponentRef; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface ScrollAreaProps extends PrimitiveDivProps { + type?: ScrollAreaContextValue['type']; + dir?: ScrollAreaContextValue['dir']; + scrollHideDelay?: number; +} +declare const ScrollArea: React.ForwardRefExoticComponent>; +type ScrollAreaViewportElement = React.ComponentRef; +interface ScrollAreaViewportProps extends PrimitiveDivProps { + nonce?: string; +} +declare const ScrollAreaViewport: React.ForwardRefExoticComponent>; +type ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement; +interface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps { + forceMount?: true; +} +declare const ScrollAreaScrollbar: React.ForwardRefExoticComponent>; +type ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement; +interface ScrollAreaScrollbarVisibleProps extends Omit { + orientation?: 'horizontal' | 'vertical'; +} +type ScrollAreaScrollbarAxisPrivateProps = { + hasThumb: boolean; + sizes: Sizes; + onSizesChange(sizes: Sizes): void; + onThumbChange(thumb: ScrollAreaThumbElement | null): void; + onThumbPointerDown(pointerPos: number): void; + onThumbPointerUp(): void; + onThumbPositionChange(): void; + onWheelScroll(scrollPos: number): void; + onDragScroll(pointerPos: number): void; +}; +type ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement; +interface ScrollAreaScrollbarAxisProps extends Omit, ScrollAreaScrollbarAxisPrivateProps { +} +type ScrollbarContext = { + hasThumb: boolean; + scrollbar: ScrollAreaScrollbarElement | null; + onThumbChange(thumb: ScrollAreaThumbElement | null): void; + onThumbPointerUp(): void; + onThumbPointerDown(pointerPos: { + x: number; + y: number; + }): void; + onThumbPositionChange(): void; +}; +type ScrollAreaScrollbarImplElement = React.ComponentRef; +type ScrollAreaScrollbarImplPrivateProps = { + sizes: Sizes; + hasThumb: boolean; + onThumbChange: ScrollbarContext['onThumbChange']; + onThumbPointerUp: ScrollbarContext['onThumbPointerUp']; + onThumbPointerDown: ScrollbarContext['onThumbPointerDown']; + onThumbPositionChange: ScrollbarContext['onThumbPositionChange']; + onWheelScroll(event: WheelEvent, maxScrollPos: number): void; + onDragScroll(pointerPos: { + x: number; + y: number; + }): void; + onResize(): void; +}; +interface ScrollAreaScrollbarImplProps extends Omit, ScrollAreaScrollbarImplPrivateProps { +} +type ScrollAreaThumbElement = ScrollAreaThumbImplElement; +interface ScrollAreaThumbProps extends ScrollAreaThumbImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const ScrollAreaThumb: React.ForwardRefExoticComponent>; +type ScrollAreaThumbImplElement = React.ComponentRef; +interface ScrollAreaThumbImplProps extends PrimitiveDivProps { +} +interface ScrollAreaCornerProps extends ScrollAreaCornerImplProps { +} +declare const ScrollAreaCorner: React.ForwardRefExoticComponent>; +interface ScrollAreaCornerImplProps extends PrimitiveDivProps { +} +declare const Root: React.ForwardRefExoticComponent>; +declare const Viewport: React.ForwardRefExoticComponent>; +declare const Scrollbar: React.ForwardRefExoticComponent>; +declare const Thumb: React.ForwardRefExoticComponent>; +declare const Corner: React.ForwardRefExoticComponent>; + +export { Corner, Root, ScrollArea, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Scrollbar, Thumb, Viewport, createScrollAreaScope }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bfe8b1e3396feba950397a1d2fbeac32f26cf750 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.js @@ -0,0 +1,777 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Corner: () => Corner, + Root: () => Root, + ScrollArea: () => ScrollArea, + ScrollAreaCorner: () => ScrollAreaCorner, + ScrollAreaScrollbar: () => ScrollAreaScrollbar, + ScrollAreaThumb: () => ScrollAreaThumb, + ScrollAreaViewport: () => ScrollAreaViewport, + Scrollbar: () => Scrollbar, + Thumb: () => Thumb, + Viewport: () => Viewport, + createScrollAreaScope: () => createScrollAreaScope +}); +module.exports = __toCommonJS(index_exports); + +// src/scroll-area.tsx +var React2 = __toESM(require("react")); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_number = require("@radix-ui/number"); +var import_primitive = require("@radix-ui/primitive"); + +// src/use-state-machine.ts +var React = __toESM(require("react")); +function useStateMachine(initialState, machine) { + return React.useReducer((state, event) => { + const nextState = machine[state][event]; + return nextState ?? state; + }, initialState); +} + +// src/scroll-area.tsx +var import_jsx_runtime = require("react/jsx-runtime"); +var SCROLL_AREA_NAME = "ScrollArea"; +var [createScrollAreaContext, createScrollAreaScope] = (0, import_react_context.createContextScope)(SCROLL_AREA_NAME); +var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME); +var ScrollArea = React2.forwardRef( + (props, forwardedRef) => { + const { + __scopeScrollArea, + type = "hover", + dir, + scrollHideDelay = 600, + ...scrollAreaProps + } = props; + const [scrollArea, setScrollArea] = React2.useState(null); + const [viewport, setViewport] = React2.useState(null); + const [content, setContent] = React2.useState(null); + const [scrollbarX, setScrollbarX] = React2.useState(null); + const [scrollbarY, setScrollbarY] = React2.useState(null); + const [cornerWidth, setCornerWidth] = React2.useState(0); + const [cornerHeight, setCornerHeight] = React2.useState(0); + const [scrollbarXEnabled, setScrollbarXEnabled] = React2.useState(false); + const [scrollbarYEnabled, setScrollbarYEnabled] = React2.useState(false); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setScrollArea(node)); + const direction = (0, import_react_direction.useDirection)(dir); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaProvider, + { + scope: __scopeScrollArea, + type, + dir: direction, + scrollHideDelay, + scrollArea, + viewport, + onViewportChange: setViewport, + content, + onContentChange: setContent, + scrollbarX, + onScrollbarXChange: setScrollbarX, + scrollbarXEnabled, + onScrollbarXEnabledChange: setScrollbarXEnabled, + scrollbarY, + onScrollbarYChange: setScrollbarY, + scrollbarYEnabled, + onScrollbarYEnabledChange: setScrollbarYEnabled, + onCornerWidthChange: setCornerWidth, + onCornerHeightChange: setCornerHeight, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + dir: direction, + ...scrollAreaProps, + ref: composedRefs, + style: { + position: "relative", + // Pass corner sizes as CSS vars to reduce re-renders of context consumers + "--radix-scroll-area-corner-width": cornerWidth + "px", + "--radix-scroll-area-corner-height": cornerHeight + "px", + ...props.style + } + } + ) + } + ); + } +); +ScrollArea.displayName = SCROLL_AREA_NAME; +var VIEWPORT_NAME = "ScrollAreaViewport"; +var ScrollAreaViewport = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeScrollArea, children, nonce, ...viewportProps } = props; + const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea); + const ref = React2.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref, context.onViewportChange); + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaViewportStyle, { nonce }), + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-radix-scroll-area-viewport": "", + ...viewportProps, + ref: composedRefs, + style: { + /** + * We don't support `visible` because the intention is to have at least one scrollbar + * if this component is used and `visible` will behave like `auto` in that case + * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description + * + * We don't handle `auto` because the intention is for the native implementation + * to be hidden if using this component. We just want to ensure the node is scrollable + * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent + * the browser from having to work out whether to render native scrollbars or not, + * we tell it to with the intention of hiding them in CSS. + */ + overflowX: context.scrollbarXEnabled ? "scroll" : "hidden", + overflowY: context.scrollbarYEnabled ? "scroll" : "hidden", + ...props.style + }, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children }) + } + ) + ] }); + } +); +ScrollAreaViewport.displayName = VIEWPORT_NAME; +var ScrollAreaViewportStyle = React2.memo( + ({ nonce }) => { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "style", + { + dangerouslySetInnerHTML: { + __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` + }, + nonce + } + ); + }, + (prevProps, nextProps) => prevProps.nonce === nextProps.nonce +); +var SCROLLBAR_NAME = "ScrollAreaScrollbar"; +var ScrollAreaScrollbar = React2.forwardRef( + (props, forwardedRef) => { + const { forceMount, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context; + const isHorizontal = props.orientation === "horizontal"; + React2.useEffect(() => { + isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true); + return () => { + isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false); + }; + }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]); + return context.type === "hover" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef, "data-state": "visible" }) : null; + } +); +ScrollAreaScrollbar.displayName = SCROLLBAR_NAME; +var ScrollAreaScrollbarHover = React2.forwardRef((props, forwardedRef) => { + const { forceMount, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const [visible, setVisible] = React2.useState(false); + React2.useEffect(() => { + const scrollArea = context.scrollArea; + let hideTimer = 0; + if (scrollArea) { + const handlePointerEnter = () => { + window.clearTimeout(hideTimer); + setVisible(true); + }; + const handlePointerLeave = () => { + hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay); + }; + scrollArea.addEventListener("pointerenter", handlePointerEnter); + scrollArea.addEventListener("pointerleave", handlePointerLeave); + return () => { + window.clearTimeout(hideTimer); + scrollArea.removeEventListener("pointerenter", handlePointerEnter); + scrollArea.removeEventListener("pointerleave", handlePointerLeave); + }; + } + }, [context.scrollArea, context.scrollHideDelay]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || visible, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarAuto, + { + "data-state": visible ? "visible" : "hidden", + ...scrollbarProps, + ref: forwardedRef + } + ) }); +}); +var ScrollAreaScrollbarScroll = React2.forwardRef((props, forwardedRef) => { + const { forceMount, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const isHorizontal = props.orientation === "horizontal"; + const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100); + const [state, send] = useStateMachine("hidden", { + hidden: { + SCROLL: "scrolling" + }, + scrolling: { + SCROLL_END: "idle", + POINTER_ENTER: "interacting" + }, + interacting: { + SCROLL: "interacting", + POINTER_LEAVE: "idle" + }, + idle: { + HIDE: "hidden", + SCROLL: "scrolling", + POINTER_ENTER: "interacting" + } + }); + React2.useEffect(() => { + if (state === "idle") { + const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay); + return () => window.clearTimeout(hideTimer); + } + }, [state, context.scrollHideDelay, send]); + React2.useEffect(() => { + const viewport = context.viewport; + const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop"; + if (viewport) { + let prevScrollPos = viewport[scrollDirection]; + const handleScroll = () => { + const scrollPos = viewport[scrollDirection]; + const hasScrollInDirectionChanged = prevScrollPos !== scrollPos; + if (hasScrollInDirectionChanged) { + send("SCROLL"); + debounceScrollEnd(); + } + prevScrollPos = scrollPos; + }; + viewport.addEventListener("scroll", handleScroll); + return () => viewport.removeEventListener("scroll", handleScroll); + } + }, [context.viewport, isHorizontal, send, debounceScrollEnd]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarVisible, + { + "data-state": state === "hidden" ? "hidden" : "visible", + ...scrollbarProps, + ref: forwardedRef, + onPointerEnter: (0, import_primitive.composeEventHandlers)(props.onPointerEnter, () => send("POINTER_ENTER")), + onPointerLeave: (0, import_primitive.composeEventHandlers)(props.onPointerLeave, () => send("POINTER_LEAVE")) + } + ) }); +}); +var ScrollAreaScrollbarAuto = React2.forwardRef((props, forwardedRef) => { + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const { forceMount, ...scrollbarProps } = props; + const [visible, setVisible] = React2.useState(false); + const isHorizontal = props.orientation === "horizontal"; + const handleResize = useDebounceCallback(() => { + if (context.viewport) { + const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth; + const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight; + setVisible(isHorizontal ? isOverflowX : isOverflowY); + } + }, 10); + useResizeObserver(context.viewport, handleResize); + useResizeObserver(context.content, handleResize); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || visible, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarVisible, + { + "data-state": visible ? "visible" : "hidden", + ...scrollbarProps, + ref: forwardedRef + } + ) }); +}); +var ScrollAreaScrollbarVisible = React2.forwardRef((props, forwardedRef) => { + const { orientation = "vertical", ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const thumbRef = React2.useRef(null); + const pointerOffsetRef = React2.useRef(0); + const [sizes, setSizes] = React2.useState({ + content: 0, + viewport: 0, + scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 } + }); + const thumbRatio = getThumbRatio(sizes.viewport, sizes.content); + const commonProps = { + ...scrollbarProps, + sizes, + onSizesChange: setSizes, + hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1), + onThumbChange: (thumb) => thumbRef.current = thumb, + onThumbPointerUp: () => pointerOffsetRef.current = 0, + onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos + }; + function getScrollPosition(pointerPos, dir) { + return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir); + } + if (orientation === "horizontal") { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarX, + { + ...commonProps, + ref: forwardedRef, + onThumbPositionChange: () => { + if (context.viewport && thumbRef.current) { + const scrollPos = context.viewport.scrollLeft; + const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir); + thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`; + } + }, + onWheelScroll: (scrollPos) => { + if (context.viewport) context.viewport.scrollLeft = scrollPos; + }, + onDragScroll: (pointerPos) => { + if (context.viewport) { + context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir); + } + } + } + ); + } + if (orientation === "vertical") { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarY, + { + ...commonProps, + ref: forwardedRef, + onThumbPositionChange: () => { + if (context.viewport && thumbRef.current) { + const scrollPos = context.viewport.scrollTop; + const offset = getThumbOffsetFromScroll(scrollPos, sizes); + thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`; + } + }, + onWheelScroll: (scrollPos) => { + if (context.viewport) context.viewport.scrollTop = scrollPos; + }, + onDragScroll: (pointerPos) => { + if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos); + } + } + ); + } + return null; +}); +var ScrollAreaScrollbarX = React2.forwardRef((props, forwardedRef) => { + const { sizes, onSizesChange, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const [computedStyle, setComputedStyle] = React2.useState(); + const ref = React2.useRef(null); + const composeRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref, context.onScrollbarXChange); + React2.useEffect(() => { + if (ref.current) setComputedStyle(getComputedStyle(ref.current)); + }, [ref]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarImpl, + { + "data-orientation": "horizontal", + ...scrollbarProps, + ref: composeRefs, + sizes, + style: { + bottom: 0, + left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0, + right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0, + "--radix-scroll-area-thumb-width": getThumbSize(sizes) + "px", + ...props.style + }, + onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x), + onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x), + onWheelScroll: (event, maxScrollPos) => { + if (context.viewport) { + const scrollPos = context.viewport.scrollLeft + event.deltaX; + props.onWheelScroll(scrollPos); + if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) { + event.preventDefault(); + } + } + }, + onResize: () => { + if (ref.current && context.viewport && computedStyle) { + onSizesChange({ + content: context.viewport.scrollWidth, + viewport: context.viewport.offsetWidth, + scrollbar: { + size: ref.current.clientWidth, + paddingStart: toInt(computedStyle.paddingLeft), + paddingEnd: toInt(computedStyle.paddingRight) + } + }); + } + } + } + ); +}); +var ScrollAreaScrollbarY = React2.forwardRef((props, forwardedRef) => { + const { sizes, onSizesChange, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const [computedStyle, setComputedStyle] = React2.useState(); + const ref = React2.useRef(null); + const composeRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref, context.onScrollbarYChange); + React2.useEffect(() => { + if (ref.current) setComputedStyle(getComputedStyle(ref.current)); + }, [ref]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollAreaScrollbarImpl, + { + "data-orientation": "vertical", + ...scrollbarProps, + ref: composeRefs, + sizes, + style: { + top: 0, + right: context.dir === "ltr" ? 0 : void 0, + left: context.dir === "rtl" ? 0 : void 0, + bottom: "var(--radix-scroll-area-corner-height)", + "--radix-scroll-area-thumb-height": getThumbSize(sizes) + "px", + ...props.style + }, + onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y), + onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y), + onWheelScroll: (event, maxScrollPos) => { + if (context.viewport) { + const scrollPos = context.viewport.scrollTop + event.deltaY; + props.onWheelScroll(scrollPos); + if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) { + event.preventDefault(); + } + } + }, + onResize: () => { + if (ref.current && context.viewport && computedStyle) { + onSizesChange({ + content: context.viewport.scrollHeight, + viewport: context.viewport.offsetHeight, + scrollbar: { + size: ref.current.clientHeight, + paddingStart: toInt(computedStyle.paddingTop), + paddingEnd: toInt(computedStyle.paddingBottom) + } + }); + } + } + } + ); +}); +var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME); +var ScrollAreaScrollbarImpl = React2.forwardRef((props, forwardedRef) => { + const { + __scopeScrollArea, + sizes, + hasThumb, + onThumbChange, + onThumbPointerUp, + onThumbPointerDown, + onThumbPositionChange, + onDragScroll, + onWheelScroll, + onResize, + ...scrollbarProps + } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea); + const [scrollbar, setScrollbar] = React2.useState(null); + const composeRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setScrollbar(node)); + const rectRef = React2.useRef(null); + const prevWebkitUserSelectRef = React2.useRef(""); + const viewport = context.viewport; + const maxScrollPos = sizes.content - sizes.viewport; + const handleWheelScroll = (0, import_react_use_callback_ref.useCallbackRef)(onWheelScroll); + const handleThumbPositionChange = (0, import_react_use_callback_ref.useCallbackRef)(onThumbPositionChange); + const handleResize = useDebounceCallback(onResize, 10); + function handleDragScroll(event) { + if (rectRef.current) { + const x = event.clientX - rectRef.current.left; + const y = event.clientY - rectRef.current.top; + onDragScroll({ x, y }); + } + } + React2.useEffect(() => { + const handleWheel = (event) => { + const element = event.target; + const isScrollbarWheel = scrollbar?.contains(element); + if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos); + }; + document.addEventListener("wheel", handleWheel, { passive: false }); + return () => document.removeEventListener("wheel", handleWheel, { passive: false }); + }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]); + React2.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]); + useResizeObserver(scrollbar, handleResize); + useResizeObserver(context.content, handleResize); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + ScrollbarProvider, + { + scope: __scopeScrollArea, + scrollbar, + hasThumb, + onThumbChange: (0, import_react_use_callback_ref.useCallbackRef)(onThumbChange), + onThumbPointerUp: (0, import_react_use_callback_ref.useCallbackRef)(onThumbPointerUp), + onThumbPositionChange: handleThumbPositionChange, + onThumbPointerDown: (0, import_react_use_callback_ref.useCallbackRef)(onThumbPointerDown), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...scrollbarProps, + ref: composeRefs, + style: { position: "absolute", ...scrollbarProps.style }, + onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, (event) => { + const mainPointer = 0; + if (event.button === mainPointer) { + const element = event.target; + element.setPointerCapture(event.pointerId); + rectRef.current = scrollbar.getBoundingClientRect(); + prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect; + document.body.style.webkitUserSelect = "none"; + if (context.viewport) context.viewport.style.scrollBehavior = "auto"; + handleDragScroll(event); + } + }), + onPointerMove: (0, import_primitive.composeEventHandlers)(props.onPointerMove, handleDragScroll), + onPointerUp: (0, import_primitive.composeEventHandlers)(props.onPointerUp, (event) => { + const element = event.target; + if (element.hasPointerCapture(event.pointerId)) { + element.releasePointerCapture(event.pointerId); + } + document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current; + if (context.viewport) context.viewport.style.scrollBehavior = ""; + rectRef.current = null; + }) + } + ) + } + ); +}); +var THUMB_NAME = "ScrollAreaThumb"; +var ScrollAreaThumb = React2.forwardRef( + (props, forwardedRef) => { + const { forceMount, ...thumbProps } = props; + const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) }); + } +); +var ScrollAreaThumbImpl = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeScrollArea, style, ...thumbProps } = props; + const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea); + const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea); + const { onThumbPositionChange } = scrollbarContext; + const composedRef = (0, import_react_compose_refs.useComposedRefs)( + forwardedRef, + (node) => scrollbarContext.onThumbChange(node) + ); + const removeUnlinkedScrollListenerRef = React2.useRef(void 0); + const debounceScrollEnd = useDebounceCallback(() => { + if (removeUnlinkedScrollListenerRef.current) { + removeUnlinkedScrollListenerRef.current(); + removeUnlinkedScrollListenerRef.current = void 0; + } + }, 100); + React2.useEffect(() => { + const viewport = scrollAreaContext.viewport; + if (viewport) { + const handleScroll = () => { + debounceScrollEnd(); + if (!removeUnlinkedScrollListenerRef.current) { + const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange); + removeUnlinkedScrollListenerRef.current = listener; + onThumbPositionChange(); + } + }; + onThumbPositionChange(); + viewport.addEventListener("scroll", handleScroll); + return () => viewport.removeEventListener("scroll", handleScroll); + } + }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-state": scrollbarContext.hasThumb ? "visible" : "hidden", + ...thumbProps, + ref: composedRef, + style: { + width: "var(--radix-scroll-area-thumb-width)", + height: "var(--radix-scroll-area-thumb-height)", + ...style + }, + onPointerDownCapture: (0, import_primitive.composeEventHandlers)(props.onPointerDownCapture, (event) => { + const thumb = event.target; + const thumbRect = thumb.getBoundingClientRect(); + const x = event.clientX - thumbRect.left; + const y = event.clientY - thumbRect.top; + scrollbarContext.onThumbPointerDown({ x, y }); + }), + onPointerUp: (0, import_primitive.composeEventHandlers)(props.onPointerUp, scrollbarContext.onThumbPointerUp) + } + ); + } +); +ScrollAreaThumb.displayName = THUMB_NAME; +var CORNER_NAME = "ScrollAreaCorner"; +var ScrollAreaCorner = React2.forwardRef( + (props, forwardedRef) => { + const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea); + const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY); + const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible; + return hasCorner ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null; + } +); +ScrollAreaCorner.displayName = CORNER_NAME; +var ScrollAreaCornerImpl = React2.forwardRef((props, forwardedRef) => { + const { __scopeScrollArea, ...cornerProps } = props; + const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea); + const [width, setWidth] = React2.useState(0); + const [height, setHeight] = React2.useState(0); + const hasSize = Boolean(width && height); + useResizeObserver(context.scrollbarX, () => { + const height2 = context.scrollbarX?.offsetHeight || 0; + context.onCornerHeightChange(height2); + setHeight(height2); + }); + useResizeObserver(context.scrollbarY, () => { + const width2 = context.scrollbarY?.offsetWidth || 0; + context.onCornerWidthChange(width2); + setWidth(width2); + }); + return hasSize ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...cornerProps, + ref: forwardedRef, + style: { + width, + height, + position: "absolute", + right: context.dir === "ltr" ? 0 : void 0, + left: context.dir === "rtl" ? 0 : void 0, + bottom: 0, + ...props.style + } + } + ) : null; +}); +function toInt(value) { + return value ? parseInt(value, 10) : 0; +} +function getThumbRatio(viewportSize, contentSize) { + const ratio = viewportSize / contentSize; + return isNaN(ratio) ? 0 : ratio; +} +function getThumbSize(sizes) { + const ratio = getThumbRatio(sizes.viewport, sizes.content); + const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd; + const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio; + return Math.max(thumbSize, 18); +} +function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") { + const thumbSizePx = getThumbSize(sizes); + const thumbCenter = thumbSizePx / 2; + const offset = pointerOffset || thumbCenter; + const thumbOffsetFromEnd = thumbSizePx - offset; + const minPointerPos = sizes.scrollbar.paddingStart + offset; + const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd; + const maxScrollPos = sizes.content - sizes.viewport; + const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]; + const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange); + return interpolate(pointerPos); +} +function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") { + const thumbSizePx = getThumbSize(sizes); + const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd; + const scrollbar = sizes.scrollbar.size - scrollbarPadding; + const maxScrollPos = sizes.content - sizes.viewport; + const maxThumbPos = scrollbar - thumbSizePx; + const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]; + const scrollWithoutMomentum = (0, import_number.clamp)(scrollPos, scrollClampRange); + const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]); + return interpolate(scrollWithoutMomentum); +} +function linearScale(input, output) { + return (value) => { + if (input[0] === input[1] || output[0] === output[1]) return output[0]; + const ratio = (output[1] - output[0]) / (input[1] - input[0]); + return output[0] + ratio * (value - input[0]); + }; +} +function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) { + return scrollPos > 0 && scrollPos < maxScrollPos; +} +var addUnlinkedScrollListener = (node, handler = () => { +}) => { + let prevPosition = { left: node.scrollLeft, top: node.scrollTop }; + let rAF = 0; + (function loop() { + const position = { left: node.scrollLeft, top: node.scrollTop }; + const isHorizontalScroll = prevPosition.left !== position.left; + const isVerticalScroll = prevPosition.top !== position.top; + if (isHorizontalScroll || isVerticalScroll) handler(); + prevPosition = position; + rAF = window.requestAnimationFrame(loop); + })(); + return () => window.cancelAnimationFrame(rAF); +}; +function useDebounceCallback(callback, delay) { + const handleCallback = (0, import_react_use_callback_ref.useCallbackRef)(callback); + const debounceTimerRef = React2.useRef(0); + React2.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []); + return React2.useCallback(() => { + window.clearTimeout(debounceTimerRef.current); + debounceTimerRef.current = window.setTimeout(handleCallback, delay); + }, [handleCallback, delay]); +} +function useResizeObserver(element, onResize) { + const handleResize = (0, import_react_use_callback_ref.useCallbackRef)(onResize); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + let rAF = 0; + if (element) { + const resizeObserver = new ResizeObserver(() => { + cancelAnimationFrame(rAF); + rAF = window.requestAnimationFrame(handleResize); + }); + resizeObserver.observe(element); + return () => { + window.cancelAnimationFrame(rAF); + resizeObserver.unobserve(element); + }; + } + }, [element, handleResize]); +} +var Root = ScrollArea; +var Viewport = ScrollAreaViewport; +var Scrollbar = ScrollAreaScrollbar; +var Thumb = ScrollAreaThumb; +var Corner = ScrollAreaCorner; +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..74963847a9143013ea8f7abd7fbf642b85ec1fd6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/scroll-area.tsx", "../src/use-state-machine.ts"], + "sourcesContent": ["'use client';\nexport {\n createScrollAreaScope,\n //\n ScrollArea,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n //\n Root,\n Viewport,\n Scrollbar,\n Thumb,\n Corner,\n} from './scroll-area';\nexport type {\n ScrollAreaProps,\n ScrollAreaViewportProps,\n ScrollAreaScrollbarProps,\n ScrollAreaThumbProps,\n ScrollAreaCornerProps,\n} from './scroll-area';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Presence } from '@radix-ui/react-presence';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useStateMachine } from './use-state-machine';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Sizes = {\n content: number;\n viewport: number;\n scrollbar: {\n size: number;\n paddingStart: number;\n paddingEnd: number;\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollArea\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_AREA_NAME = 'ScrollArea';\n\ntype ScopedProps

= P & { __scopeScrollArea?: Scope };\nconst [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);\n\ntype ScrollAreaContextValue = {\n type: 'auto' | 'always' | 'scroll' | 'hover';\n dir: Direction;\n scrollHideDelay: number;\n scrollArea: ScrollAreaElement | null;\n viewport: ScrollAreaViewportElement | null;\n onViewportChange(viewport: ScrollAreaViewportElement | null): void;\n content: HTMLDivElement | null;\n onContentChange(content: HTMLDivElement): void;\n scrollbarX: ScrollAreaScrollbarElement | null;\n onScrollbarXChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarXEnabled: boolean;\n onScrollbarXEnabledChange(rendered: boolean): void;\n scrollbarY: ScrollAreaScrollbarElement | null;\n onScrollbarYChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarYEnabled: boolean;\n onScrollbarYEnabledChange(rendered: boolean): void;\n onCornerWidthChange(width: number): void;\n onCornerHeightChange(height: number): void;\n};\n\nconst [ScrollAreaProvider, useScrollAreaContext] =\n createScrollAreaContext(SCROLL_AREA_NAME);\n\ntype ScrollAreaElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface ScrollAreaProps extends PrimitiveDivProps {\n type?: ScrollAreaContextValue['type'];\n dir?: ScrollAreaContextValue['dir'];\n scrollHideDelay?: number;\n}\n\nconst ScrollArea = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeScrollArea,\n type = 'hover',\n dir,\n scrollHideDelay = 600,\n ...scrollAreaProps\n } = props;\n const [scrollArea, setScrollArea] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const [scrollbarX, setScrollbarX] = React.useState(null);\n const [scrollbarY, setScrollbarY] = React.useState(null);\n const [cornerWidth, setCornerWidth] = React.useState(0);\n const [cornerHeight, setCornerHeight] = React.useState(0);\n const [scrollbarXEnabled, setScrollbarXEnabled] = React.useState(false);\n const [scrollbarYEnabled, setScrollbarYEnabled] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));\n const direction = useDirection(dir);\n\n return (\n \n \n \n );\n },\n);\n\nScrollArea.displayName = SCROLL_AREA_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = 'ScrollAreaViewport';\n\ntype ScrollAreaViewportElement = React.ComponentRef;\ninterface ScrollAreaViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst ScrollAreaViewport = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeScrollArea, children, nonce, ...viewportProps } = props;\n const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n return (\n <>\n \n

\n {children}\n
\n \n \n );\n },\n);\n\nScrollAreaViewport.displayName = VIEWPORT_NAME;\n\nconst ScrollAreaViewportStyle = React.memo(\n ({ nonce }: { nonce?: string }) => {\n return (\n \n );\n },\n (prevProps, nextProps) => prevProps.nonce === nextProps.nonce,\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaScrollbar\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLLBAR_NAME = 'ScrollAreaScrollbar';\n\ntype ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbar = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;\n const isHorizontal = props.orientation === 'horizontal';\n\n React.useEffect(() => {\n isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);\n return () => {\n isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);\n };\n }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);\n\n return context.type === 'hover' ? (\n \n ) : context.type === 'scroll' ? (\n \n ) : context.type === 'auto' ? (\n \n ) : context.type === 'always' ? (\n \n ) : null;\n },\n);\n\nScrollAreaScrollbar.displayName = SCROLLBAR_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarHoverElement = ScrollAreaScrollbarAutoElement;\ninterface ScrollAreaScrollbarHoverProps extends ScrollAreaScrollbarAutoProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarHover = React.forwardRef<\n ScrollAreaScrollbarHoverElement,\n ScrollAreaScrollbarHoverProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [visible, setVisible] = React.useState(false);\n\n React.useEffect(() => {\n const scrollArea = context.scrollArea;\n let hideTimer = 0;\n if (scrollArea) {\n const handlePointerEnter = () => {\n window.clearTimeout(hideTimer);\n setVisible(true);\n };\n const handlePointerLeave = () => {\n hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);\n };\n scrollArea.addEventListener('pointerenter', handlePointerEnter);\n scrollArea.addEventListener('pointerleave', handlePointerLeave);\n return () => {\n window.clearTimeout(hideTimer);\n scrollArea.removeEventListener('pointerenter', handlePointerEnter);\n scrollArea.removeEventListener('pointerleave', handlePointerLeave);\n };\n }\n }, [context.scrollArea, context.scrollHideDelay]);\n\n return (\n \n \n \n );\n});\n\ntype ScrollAreaScrollbarScrollElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarScrollProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarScroll = React.forwardRef<\n ScrollAreaScrollbarScrollElement,\n ScrollAreaScrollbarScrollProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const isHorizontal = props.orientation === 'horizontal';\n const debounceScrollEnd = useDebounceCallback(() => send('SCROLL_END'), 100);\n const [state, send] = useStateMachine('hidden', {\n hidden: {\n SCROLL: 'scrolling',\n },\n scrolling: {\n SCROLL_END: 'idle',\n POINTER_ENTER: 'interacting',\n },\n interacting: {\n SCROLL: 'interacting',\n POINTER_LEAVE: 'idle',\n },\n idle: {\n HIDE: 'hidden',\n SCROLL: 'scrolling',\n POINTER_ENTER: 'interacting',\n },\n });\n\n React.useEffect(() => {\n if (state === 'idle') {\n const hideTimer = window.setTimeout(() => send('HIDE'), context.scrollHideDelay);\n return () => window.clearTimeout(hideTimer);\n }\n }, [state, context.scrollHideDelay, send]);\n\n React.useEffect(() => {\n const viewport = context.viewport;\n const scrollDirection = isHorizontal ? 'scrollLeft' : 'scrollTop';\n\n if (viewport) {\n let prevScrollPos = viewport[scrollDirection];\n const handleScroll = () => {\n const scrollPos = viewport[scrollDirection];\n const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;\n if (hasScrollInDirectionChanged) {\n send('SCROLL');\n debounceScrollEnd();\n }\n prevScrollPos = scrollPos;\n };\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [context.viewport, isHorizontal, send, debounceScrollEnd]);\n\n return (\n \n send('POINTER_ENTER'))}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, () => send('POINTER_LEAVE'))}\n />\n \n );\n});\n\ntype ScrollAreaScrollbarAutoElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarAutoProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarAuto = React.forwardRef<\n ScrollAreaScrollbarAutoElement,\n ScrollAreaScrollbarAutoProps\n>((props: ScopedProps, forwardedRef) => {\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { forceMount, ...scrollbarProps } = props;\n const [visible, setVisible] = React.useState(false);\n const isHorizontal = props.orientation === 'horizontal';\n const handleResize = useDebounceCallback(() => {\n if (context.viewport) {\n const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;\n const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;\n setVisible(isHorizontal ? isOverflowX : isOverflowY);\n }\n }, 10);\n\n useResizeObserver(context.viewport, handleResize);\n useResizeObserver(context.content, handleResize);\n\n return (\n \n \n \n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;\ninterface ScrollAreaScrollbarVisibleProps extends Omit<\n ScrollAreaScrollbarAxisProps,\n keyof ScrollAreaScrollbarAxisPrivateProps\n> {\n orientation?: 'horizontal' | 'vertical';\n}\n\nconst ScrollAreaScrollbarVisible = React.forwardRef<\n ScrollAreaScrollbarVisibleElement,\n ScrollAreaScrollbarVisibleProps\n>((props: ScopedProps, forwardedRef) => {\n const { orientation = 'vertical', ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const thumbRef = React.useRef(null);\n const pointerOffsetRef = React.useRef(0);\n const [sizes, setSizes] = React.useState({\n content: 0,\n viewport: 0,\n scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 },\n });\n const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);\n\n type UncommonProps = 'onThumbPositionChange' | 'onDragScroll' | 'onWheelScroll';\n const commonProps: Omit = {\n ...scrollbarProps,\n sizes,\n onSizesChange: setSizes,\n hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),\n onThumbChange: (thumb) => (thumbRef.current = thumb),\n onThumbPointerUp: () => (pointerOffsetRef.current = 0),\n onThumbPointerDown: (pointerPos) => (pointerOffsetRef.current = pointerPos),\n };\n\n function getScrollPosition(pointerPos: number, dir?: Direction) {\n return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);\n }\n\n if (orientation === 'horizontal') {\n return (\n {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollLeft;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);\n thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;\n }\n }}\n onWheelScroll={(scrollPos) => {\n if (context.viewport) context.viewport.scrollLeft = scrollPos;\n }}\n onDragScroll={(pointerPos) => {\n if (context.viewport) {\n context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);\n }\n }}\n />\n );\n }\n\n if (orientation === 'vertical') {\n return (\n {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollTop;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes);\n thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }}\n onWheelScroll={(scrollPos) => {\n if (context.viewport) context.viewport.scrollTop = scrollPos;\n }}\n onDragScroll={(pointerPos) => {\n if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);\n }}\n />\n );\n }\n\n return null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarAxisPrivateProps = {\n hasThumb: boolean;\n sizes: Sizes;\n onSizesChange(sizes: Sizes): void;\n onThumbChange(thumb: ScrollAreaThumbElement | null): void;\n onThumbPointerDown(pointerPos: number): void;\n onThumbPointerUp(): void;\n onThumbPositionChange(): void;\n onWheelScroll(scrollPos: number): void;\n onDragScroll(pointerPos: number): void;\n};\n\ntype ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;\ninterface ScrollAreaScrollbarAxisProps\n extends\n Omit,\n ScrollAreaScrollbarAxisPrivateProps {}\n\nconst ScrollAreaScrollbarX = React.forwardRef<\n ScrollAreaScrollbarAxisElement,\n ScrollAreaScrollbarAxisProps\n>((props: ScopedProps, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = React.useState();\n const ref = React.useRef(null);\n const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);\n\n React.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n\n return (\n props.onThumbPointerDown(pointerPos.x)}\n onDragScroll={(pointerPos) => props.onDragScroll(pointerPos.x)}\n onWheelScroll={(event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollLeft + event.deltaX;\n props.onWheelScroll(scrollPos);\n // prevent window scroll when wheeling on scrollbar\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n }}\n onResize={() => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollWidth,\n viewport: context.viewport.offsetWidth,\n scrollbar: {\n size: ref.current.clientWidth,\n paddingStart: toInt(computedStyle.paddingLeft),\n paddingEnd: toInt(computedStyle.paddingRight),\n },\n });\n }\n }}\n />\n );\n});\n\nconst ScrollAreaScrollbarY = React.forwardRef<\n ScrollAreaScrollbarAxisElement,\n ScrollAreaScrollbarAxisProps\n>((props: ScopedProps, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = React.useState();\n const ref = React.useRef(null);\n const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);\n\n React.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n\n return (\n props.onThumbPointerDown(pointerPos.y)}\n onDragScroll={(pointerPos) => props.onDragScroll(pointerPos.y)}\n onWheelScroll={(event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollTop + event.deltaY;\n props.onWheelScroll(scrollPos);\n // prevent window scroll when wheeling on scrollbar\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n }}\n onResize={() => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollHeight,\n viewport: context.viewport.offsetHeight,\n scrollbar: {\n size: ref.current.clientHeight,\n paddingStart: toInt(computedStyle.paddingTop),\n paddingEnd: toInt(computedStyle.paddingBottom),\n },\n });\n }\n }}\n />\n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollbarContext = {\n hasThumb: boolean;\n scrollbar: ScrollAreaScrollbarElement | null;\n onThumbChange(thumb: ScrollAreaThumbElement | null): void;\n onThumbPointerUp(): void;\n onThumbPointerDown(pointerPos: { x: number; y: number }): void;\n onThumbPositionChange(): void;\n};\n\nconst [ScrollbarProvider, useScrollbarContext] =\n createScrollAreaContext(SCROLLBAR_NAME);\n\ntype ScrollAreaScrollbarImplElement = React.ComponentRef;\ntype ScrollAreaScrollbarImplPrivateProps = {\n sizes: Sizes;\n hasThumb: boolean;\n onThumbChange: ScrollbarContext['onThumbChange'];\n onThumbPointerUp: ScrollbarContext['onThumbPointerUp'];\n onThumbPointerDown: ScrollbarContext['onThumbPointerDown'];\n onThumbPositionChange: ScrollbarContext['onThumbPositionChange'];\n onWheelScroll(event: WheelEvent, maxScrollPos: number): void;\n onDragScroll(pointerPos: { x: number; y: number }): void;\n onResize(): void;\n};\ninterface ScrollAreaScrollbarImplProps\n extends\n Omit,\n ScrollAreaScrollbarImplPrivateProps {}\n\nconst ScrollAreaScrollbarImpl = React.forwardRef<\n ScrollAreaScrollbarImplElement,\n ScrollAreaScrollbarImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeScrollArea,\n sizes,\n hasThumb,\n onThumbChange,\n onThumbPointerUp,\n onThumbPointerDown,\n onThumbPositionChange,\n onDragScroll,\n onWheelScroll,\n onResize,\n ...scrollbarProps\n } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);\n const [scrollbar, setScrollbar] = React.useState(null);\n const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node));\n const rectRef = React.useRef(null);\n const prevWebkitUserSelectRef = React.useRef('');\n const viewport = context.viewport;\n const maxScrollPos = sizes.content - sizes.viewport;\n const handleWheelScroll = useCallbackRef(onWheelScroll);\n const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);\n const handleResize = useDebounceCallback(onResize, 10);\n\n function handleDragScroll(event: React.PointerEvent) {\n if (rectRef.current) {\n const x = event.clientX - rectRef.current.left;\n const y = event.clientY - rectRef.current.top;\n onDragScroll({ x, y });\n }\n }\n\n /**\n * We bind wheel event imperatively so we can switch off passive\n * mode for document wheel event to allow it to be prevented\n */\n React.useEffect(() => {\n const handleWheel = (event: WheelEvent) => {\n const element = event.target as HTMLElement;\n const isScrollbarWheel = scrollbar?.contains(element);\n if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);\n };\n document.addEventListener('wheel', handleWheel, { passive: false });\n return () => document.removeEventListener('wheel', handleWheel, { passive: false } as any);\n }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);\n\n /**\n * Update thumb position on sizes change\n */\n React.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);\n\n useResizeObserver(scrollbar, handleResize);\n useResizeObserver(context.content, handleResize);\n\n return (\n \n {\n const mainPointer = 0;\n if (event.button === mainPointer) {\n const element = event.target as HTMLElement;\n element.setPointerCapture(event.pointerId);\n rectRef.current = scrollbar!.getBoundingClientRect();\n // pointer capture doesn't prevent text selection in Safari\n // so we remove text selection manually when scrolling\n prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;\n document.body.style.webkitUserSelect = 'none';\n if (context.viewport) context.viewport.style.scrollBehavior = 'auto';\n handleDragScroll(event);\n }\n })}\n onPointerMove={composeEventHandlers(props.onPointerMove, handleDragScroll)}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n const element = event.target as HTMLElement;\n if (element.hasPointerCapture(event.pointerId)) {\n element.releasePointerCapture(event.pointerId);\n }\n document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;\n if (context.viewport) context.viewport.style.scrollBehavior = '';\n rectRef.current = null;\n })}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'ScrollAreaThumb';\n\ntype ScrollAreaThumbElement = ScrollAreaThumbImplElement;\ninterface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst ScrollAreaThumb = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { forceMount, ...thumbProps } = props;\n const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);\n return (\n \n \n \n );\n },\n);\n\ntype ScrollAreaThumbImplElement = React.ComponentRef;\ninterface ScrollAreaThumbImplProps extends PrimitiveDivProps {}\n\nconst ScrollAreaThumbImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeScrollArea, style, ...thumbProps } = props;\n const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);\n const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);\n const { onThumbPositionChange } = scrollbarContext;\n const composedRef = useComposedRefs(forwardedRef, (node) =>\n scrollbarContext.onThumbChange(node),\n );\n const removeUnlinkedScrollListenerRef = React.useRef<() => void>(undefined);\n const debounceScrollEnd = useDebounceCallback(() => {\n if (removeUnlinkedScrollListenerRef.current) {\n removeUnlinkedScrollListenerRef.current();\n removeUnlinkedScrollListenerRef.current = undefined;\n }\n }, 100);\n\n React.useEffect(() => {\n const viewport = scrollAreaContext.viewport;\n if (viewport) {\n /**\n * We only bind to native scroll event so we know when scroll starts and ends.\n * When scroll starts we start a requestAnimationFrame loop that checks for\n * changes to scroll position. That rAF loop triggers our thumb position change\n * when relevant to avoid scroll-linked effects. We cancel the loop when scroll ends.\n * https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\n */\n const handleScroll = () => {\n debounceScrollEnd();\n if (!removeUnlinkedScrollListenerRef.current) {\n const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);\n removeUnlinkedScrollListenerRef.current = listener;\n onThumbPositionChange();\n }\n };\n onThumbPositionChange();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);\n\n return (\n {\n const thumb = event.target as HTMLElement;\n const thumbRect = thumb.getBoundingClientRect();\n const x = event.clientX - thumbRect.left;\n const y = event.clientY - thumbRect.top;\n scrollbarContext.onThumbPointerDown({ x, y });\n })}\n onPointerUp={composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)}\n />\n );\n },\n);\n\nScrollAreaThumb.displayName = THUMB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaCorner\n * -----------------------------------------------------------------------------------------------*/\n\nconst CORNER_NAME = 'ScrollAreaCorner';\n\ntype ScrollAreaCornerElement = ScrollAreaCornerImplElement;\ninterface ScrollAreaCornerProps extends ScrollAreaCornerImplProps {}\n\nconst ScrollAreaCorner = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);\n const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);\n const hasCorner = context.type !== 'scroll' && hasBothScrollbarsVisible;\n return hasCorner ? : null;\n },\n);\n\nScrollAreaCorner.displayName = CORNER_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaCornerImplElement = React.ComponentRef;\ninterface ScrollAreaCornerImplProps extends PrimitiveDivProps {}\n\nconst ScrollAreaCornerImpl = React.forwardRef<\n ScrollAreaCornerImplElement,\n ScrollAreaCornerImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeScrollArea, ...cornerProps } = props;\n const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);\n const [width, setWidth] = React.useState(0);\n const [height, setHeight] = React.useState(0);\n const hasSize = Boolean(width && height);\n\n useResizeObserver(context.scrollbarX, () => {\n const height = context.scrollbarX?.offsetHeight || 0;\n context.onCornerHeightChange(height);\n setHeight(height);\n });\n\n useResizeObserver(context.scrollbarY, () => {\n const width = context.scrollbarY?.offsetWidth || 0;\n context.onCornerWidthChange(width);\n setWidth(width);\n });\n\n return hasSize ? (\n \n ) : null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction toInt(value?: string) {\n return value ? parseInt(value, 10) : 0;\n}\n\nfunction getThumbRatio(viewportSize: number, contentSize: number) {\n const ratio = viewportSize / contentSize;\n return isNaN(ratio) ? 0 : ratio;\n}\n\nfunction getThumbSize(sizes: Sizes) {\n const ratio = getThumbRatio(sizes.viewport, sizes.content);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;\n // minimum of 18 matches macOS minimum\n return Math.max(thumbSize, 18);\n}\n\nfunction getScrollPositionFromPointer(\n pointerPos: number,\n pointerOffset: number,\n sizes: Sizes,\n dir: Direction = 'ltr',\n) {\n const thumbSizePx = getThumbSize(sizes);\n const thumbCenter = thumbSizePx / 2;\n const offset = pointerOffset || thumbCenter;\n const thumbOffsetFromEnd = thumbSizePx - offset;\n const minPointerPos = sizes.scrollbar.paddingStart + offset;\n const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;\n const maxScrollPos = sizes.content - sizes.viewport;\n const scrollRange = dir === 'ltr' ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange as [number, number]);\n return interpolate(pointerPos);\n}\n\nfunction getThumbOffsetFromScroll(scrollPos: number, sizes: Sizes, dir: Direction = 'ltr') {\n const thumbSizePx = getThumbSize(sizes);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const scrollbar = sizes.scrollbar.size - scrollbarPadding;\n const maxScrollPos = sizes.content - sizes.viewport;\n const maxThumbPos = scrollbar - thumbSizePx;\n const scrollClampRange = dir === 'ltr' ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange as [number, number]);\n const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);\n return interpolate(scrollWithoutMomentum);\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nfunction linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\n\nfunction isScrollingWithinScrollbarBounds(scrollPos: number, maxScrollPos: number) {\n return scrollPos > 0 && scrollPos < maxScrollPos;\n}\n\n// Custom scroll handler to avoid scroll-linked effects\n// https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\nconst addUnlinkedScrollListener = (node: HTMLElement, handler = () => {}) => {\n let prevPosition = { left: node.scrollLeft, top: node.scrollTop };\n let rAF = 0;\n (function loop() {\n const position = { left: node.scrollLeft, top: node.scrollTop };\n const isHorizontalScroll = prevPosition.left !== position.left;\n const isVerticalScroll = prevPosition.top !== position.top;\n if (isHorizontalScroll || isVerticalScroll) handler();\n prevPosition = position;\n rAF = window.requestAnimationFrame(loop);\n })();\n return () => window.cancelAnimationFrame(rAF);\n};\n\nfunction useDebounceCallback(callback: () => void, delay: number) {\n const handleCallback = useCallbackRef(callback);\n const debounceTimerRef = React.useRef(0);\n React.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);\n return React.useCallback(() => {\n window.clearTimeout(debounceTimerRef.current);\n debounceTimerRef.current = window.setTimeout(handleCallback, delay);\n }, [handleCallback, delay]);\n}\n\nfunction useResizeObserver(element: HTMLElement | null, onResize: () => void) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = ScrollArea;\nconst Viewport = ScrollAreaViewport;\nconst Scrollbar = ScrollAreaScrollbar;\nconst Thumb = ScrollAreaThumb;\nconst Corner = ScrollAreaCorner;\n\nexport {\n createScrollAreaScope,\n //\n ScrollArea,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n //\n Root,\n Viewport,\n Scrollbar,\n Thumb,\n Corner,\n};\nexport type {\n ScrollAreaProps,\n ScrollAreaViewportProps,\n ScrollAreaScrollbarProps,\n ScrollAreaThumbProps,\n ScrollAreaCornerProps,\n};\n", "import * as React from 'react';\n\ntype Machine = { [k: string]: { [k: string]: S } };\ntype MachineState = keyof T;\ntype MachineEvent = keyof UnionToIntersection;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine(\n initialState: MachineState,\n machine: M & Machine>,\n) {\n return React.useReducer((state: MachineState, event: MachineEvent): MachineState => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;A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;AAAA,IACF;AAAA,EACF,GAAG,CAAC,SAAS,YAAY,CAAC;AAC5B;AAIA,IAAM,OAAO;AACb,IAAM,WAAW;AACjB,IAAM,YAAY;AAClB,IAAM,QAAQ;AACd,IAAM,SAAS;", + "names": ["React", "height", "width"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.mjs b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f2d078db2d5a36e7a1109babc50f09e4446c76c6 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.mjs @@ -0,0 +1,745 @@ +"use client"; + +// src/scroll-area.tsx +import * as React2 from "react"; +import { Primitive } from "@radix-ui/react-primitive"; +import { Presence } from "@radix-ui/react-presence"; +import { createContextScope } from "@radix-ui/react-context"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { useDirection } from "@radix-ui/react-direction"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; +import { clamp } from "@radix-ui/number"; +import { composeEventHandlers } from "@radix-ui/primitive"; + +// src/use-state-machine.ts +import * as React from "react"; +function useStateMachine(initialState, machine) { + return React.useReducer((state, event) => { + const nextState = machine[state][event]; + return nextState ?? state; + }, initialState); +} + +// src/scroll-area.tsx +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var SCROLL_AREA_NAME = "ScrollArea"; +var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME); +var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME); +var ScrollArea = React2.forwardRef( + (props, forwardedRef) => { + const { + __scopeScrollArea, + type = "hover", + dir, + scrollHideDelay = 600, + ...scrollAreaProps + } = props; + const [scrollArea, setScrollArea] = React2.useState(null); + const [viewport, setViewport] = React2.useState(null); + const [content, setContent] = React2.useState(null); + const [scrollbarX, setScrollbarX] = React2.useState(null); + const [scrollbarY, setScrollbarY] = React2.useState(null); + const [cornerWidth, setCornerWidth] = React2.useState(0); + const [cornerHeight, setCornerHeight] = React2.useState(0); + const [scrollbarXEnabled, setScrollbarXEnabled] = React2.useState(false); + const [scrollbarYEnabled, setScrollbarYEnabled] = React2.useState(false); + const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node)); + const direction = useDirection(dir); + return /* @__PURE__ */ jsx( + ScrollAreaProvider, + { + scope: __scopeScrollArea, + type, + dir: direction, + scrollHideDelay, + scrollArea, + viewport, + onViewportChange: setViewport, + content, + onContentChange: setContent, + scrollbarX, + onScrollbarXChange: setScrollbarX, + scrollbarXEnabled, + onScrollbarXEnabledChange: setScrollbarXEnabled, + scrollbarY, + onScrollbarYChange: setScrollbarY, + scrollbarYEnabled, + onScrollbarYEnabledChange: setScrollbarYEnabled, + onCornerWidthChange: setCornerWidth, + onCornerHeightChange: setCornerHeight, + children: /* @__PURE__ */ jsx( + Primitive.div, + { + dir: direction, + ...scrollAreaProps, + ref: composedRefs, + style: { + position: "relative", + // Pass corner sizes as CSS vars to reduce re-renders of context consumers + "--radix-scroll-area-corner-width": cornerWidth + "px", + "--radix-scroll-area-corner-height": cornerHeight + "px", + ...props.style + } + } + ) + } + ); + } +); +ScrollArea.displayName = SCROLL_AREA_NAME; +var VIEWPORT_NAME = "ScrollAreaViewport"; +var ScrollAreaViewport = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeScrollArea, children, nonce, ...viewportProps } = props; + const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea); + const ref = React2.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange); + return /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx(ScrollAreaViewportStyle, { nonce }), + /* @__PURE__ */ jsx( + Primitive.div, + { + "data-radix-scroll-area-viewport": "", + ...viewportProps, + ref: composedRefs, + style: { + /** + * We don't support `visible` because the intention is to have at least one scrollbar + * if this component is used and `visible` will behave like `auto` in that case + * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description + * + * We don't handle `auto` because the intention is for the native implementation + * to be hidden if using this component. We just want to ensure the node is scrollable + * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent + * the browser from having to work out whether to render native scrollbars or not, + * we tell it to with the intention of hiding them in CSS. + */ + overflowX: context.scrollbarXEnabled ? "scroll" : "hidden", + overflowY: context.scrollbarYEnabled ? "scroll" : "hidden", + ...props.style + }, + children: /* @__PURE__ */ jsx("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children }) + } + ) + ] }); + } +); +ScrollAreaViewport.displayName = VIEWPORT_NAME; +var ScrollAreaViewportStyle = React2.memo( + ({ nonce }) => { + return /* @__PURE__ */ jsx( + "style", + { + dangerouslySetInnerHTML: { + __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` + }, + nonce + } + ); + }, + (prevProps, nextProps) => prevProps.nonce === nextProps.nonce +); +var SCROLLBAR_NAME = "ScrollAreaScrollbar"; +var ScrollAreaScrollbar = React2.forwardRef( + (props, forwardedRef) => { + const { forceMount, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context; + const isHorizontal = props.orientation === "horizontal"; + React2.useEffect(() => { + isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true); + return () => { + isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false); + }; + }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]); + return context.type === "hover" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef, "data-state": "visible" }) : null; + } +); +ScrollAreaScrollbar.displayName = SCROLLBAR_NAME; +var ScrollAreaScrollbarHover = React2.forwardRef((props, forwardedRef) => { + const { forceMount, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const [visible, setVisible] = React2.useState(false); + React2.useEffect(() => { + const scrollArea = context.scrollArea; + let hideTimer = 0; + if (scrollArea) { + const handlePointerEnter = () => { + window.clearTimeout(hideTimer); + setVisible(true); + }; + const handlePointerLeave = () => { + hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay); + }; + scrollArea.addEventListener("pointerenter", handlePointerEnter); + scrollArea.addEventListener("pointerleave", handlePointerLeave); + return () => { + window.clearTimeout(hideTimer); + scrollArea.removeEventListener("pointerenter", handlePointerEnter); + scrollArea.removeEventListener("pointerleave", handlePointerLeave); + }; + } + }, [context.scrollArea, context.scrollHideDelay]); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsx( + ScrollAreaScrollbarAuto, + { + "data-state": visible ? "visible" : "hidden", + ...scrollbarProps, + ref: forwardedRef + } + ) }); +}); +var ScrollAreaScrollbarScroll = React2.forwardRef((props, forwardedRef) => { + const { forceMount, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const isHorizontal = props.orientation === "horizontal"; + const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100); + const [state, send] = useStateMachine("hidden", { + hidden: { + SCROLL: "scrolling" + }, + scrolling: { + SCROLL_END: "idle", + POINTER_ENTER: "interacting" + }, + interacting: { + SCROLL: "interacting", + POINTER_LEAVE: "idle" + }, + idle: { + HIDE: "hidden", + SCROLL: "scrolling", + POINTER_ENTER: "interacting" + } + }); + React2.useEffect(() => { + if (state === "idle") { + const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay); + return () => window.clearTimeout(hideTimer); + } + }, [state, context.scrollHideDelay, send]); + React2.useEffect(() => { + const viewport = context.viewport; + const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop"; + if (viewport) { + let prevScrollPos = viewport[scrollDirection]; + const handleScroll = () => { + const scrollPos = viewport[scrollDirection]; + const hasScrollInDirectionChanged = prevScrollPos !== scrollPos; + if (hasScrollInDirectionChanged) { + send("SCROLL"); + debounceScrollEnd(); + } + prevScrollPos = scrollPos; + }; + viewport.addEventListener("scroll", handleScroll); + return () => viewport.removeEventListener("scroll", handleScroll); + } + }, [context.viewport, isHorizontal, send, debounceScrollEnd]); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsx( + ScrollAreaScrollbarVisible, + { + "data-state": state === "hidden" ? "hidden" : "visible", + ...scrollbarProps, + ref: forwardedRef, + onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")), + onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE")) + } + ) }); +}); +var ScrollAreaScrollbarAuto = React2.forwardRef((props, forwardedRef) => { + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const { forceMount, ...scrollbarProps } = props; + const [visible, setVisible] = React2.useState(false); + const isHorizontal = props.orientation === "horizontal"; + const handleResize = useDebounceCallback(() => { + if (context.viewport) { + const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth; + const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight; + setVisible(isHorizontal ? isOverflowX : isOverflowY); + } + }, 10); + useResizeObserver(context.viewport, handleResize); + useResizeObserver(context.content, handleResize); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsx( + ScrollAreaScrollbarVisible, + { + "data-state": visible ? "visible" : "hidden", + ...scrollbarProps, + ref: forwardedRef + } + ) }); +}); +var ScrollAreaScrollbarVisible = React2.forwardRef((props, forwardedRef) => { + const { orientation = "vertical", ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const thumbRef = React2.useRef(null); + const pointerOffsetRef = React2.useRef(0); + const [sizes, setSizes] = React2.useState({ + content: 0, + viewport: 0, + scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 } + }); + const thumbRatio = getThumbRatio(sizes.viewport, sizes.content); + const commonProps = { + ...scrollbarProps, + sizes, + onSizesChange: setSizes, + hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1), + onThumbChange: (thumb) => thumbRef.current = thumb, + onThumbPointerUp: () => pointerOffsetRef.current = 0, + onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos + }; + function getScrollPosition(pointerPos, dir) { + return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir); + } + if (orientation === "horizontal") { + return /* @__PURE__ */ jsx( + ScrollAreaScrollbarX, + { + ...commonProps, + ref: forwardedRef, + onThumbPositionChange: () => { + if (context.viewport && thumbRef.current) { + const scrollPos = context.viewport.scrollLeft; + const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir); + thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`; + } + }, + onWheelScroll: (scrollPos) => { + if (context.viewport) context.viewport.scrollLeft = scrollPos; + }, + onDragScroll: (pointerPos) => { + if (context.viewport) { + context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir); + } + } + } + ); + } + if (orientation === "vertical") { + return /* @__PURE__ */ jsx( + ScrollAreaScrollbarY, + { + ...commonProps, + ref: forwardedRef, + onThumbPositionChange: () => { + if (context.viewport && thumbRef.current) { + const scrollPos = context.viewport.scrollTop; + const offset = getThumbOffsetFromScroll(scrollPos, sizes); + thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`; + } + }, + onWheelScroll: (scrollPos) => { + if (context.viewport) context.viewport.scrollTop = scrollPos; + }, + onDragScroll: (pointerPos) => { + if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos); + } + } + ); + } + return null; +}); +var ScrollAreaScrollbarX = React2.forwardRef((props, forwardedRef) => { + const { sizes, onSizesChange, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const [computedStyle, setComputedStyle] = React2.useState(); + const ref = React2.useRef(null); + const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange); + React2.useEffect(() => { + if (ref.current) setComputedStyle(getComputedStyle(ref.current)); + }, [ref]); + return /* @__PURE__ */ jsx( + ScrollAreaScrollbarImpl, + { + "data-orientation": "horizontal", + ...scrollbarProps, + ref: composeRefs, + sizes, + style: { + bottom: 0, + left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0, + right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0, + "--radix-scroll-area-thumb-width": getThumbSize(sizes) + "px", + ...props.style + }, + onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x), + onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x), + onWheelScroll: (event, maxScrollPos) => { + if (context.viewport) { + const scrollPos = context.viewport.scrollLeft + event.deltaX; + props.onWheelScroll(scrollPos); + if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) { + event.preventDefault(); + } + } + }, + onResize: () => { + if (ref.current && context.viewport && computedStyle) { + onSizesChange({ + content: context.viewport.scrollWidth, + viewport: context.viewport.offsetWidth, + scrollbar: { + size: ref.current.clientWidth, + paddingStart: toInt(computedStyle.paddingLeft), + paddingEnd: toInt(computedStyle.paddingRight) + } + }); + } + } + } + ); +}); +var ScrollAreaScrollbarY = React2.forwardRef((props, forwardedRef) => { + const { sizes, onSizesChange, ...scrollbarProps } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); + const [computedStyle, setComputedStyle] = React2.useState(); + const ref = React2.useRef(null); + const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange); + React2.useEffect(() => { + if (ref.current) setComputedStyle(getComputedStyle(ref.current)); + }, [ref]); + return /* @__PURE__ */ jsx( + ScrollAreaScrollbarImpl, + { + "data-orientation": "vertical", + ...scrollbarProps, + ref: composeRefs, + sizes, + style: { + top: 0, + right: context.dir === "ltr" ? 0 : void 0, + left: context.dir === "rtl" ? 0 : void 0, + bottom: "var(--radix-scroll-area-corner-height)", + "--radix-scroll-area-thumb-height": getThumbSize(sizes) + "px", + ...props.style + }, + onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y), + onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y), + onWheelScroll: (event, maxScrollPos) => { + if (context.viewport) { + const scrollPos = context.viewport.scrollTop + event.deltaY; + props.onWheelScroll(scrollPos); + if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) { + event.preventDefault(); + } + } + }, + onResize: () => { + if (ref.current && context.viewport && computedStyle) { + onSizesChange({ + content: context.viewport.scrollHeight, + viewport: context.viewport.offsetHeight, + scrollbar: { + size: ref.current.clientHeight, + paddingStart: toInt(computedStyle.paddingTop), + paddingEnd: toInt(computedStyle.paddingBottom) + } + }); + } + } + } + ); +}); +var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME); +var ScrollAreaScrollbarImpl = React2.forwardRef((props, forwardedRef) => { + const { + __scopeScrollArea, + sizes, + hasThumb, + onThumbChange, + onThumbPointerUp, + onThumbPointerDown, + onThumbPositionChange, + onDragScroll, + onWheelScroll, + onResize, + ...scrollbarProps + } = props; + const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea); + const [scrollbar, setScrollbar] = React2.useState(null); + const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node)); + const rectRef = React2.useRef(null); + const prevWebkitUserSelectRef = React2.useRef(""); + const viewport = context.viewport; + const maxScrollPos = sizes.content - sizes.viewport; + const handleWheelScroll = useCallbackRef(onWheelScroll); + const handleThumbPositionChange = useCallbackRef(onThumbPositionChange); + const handleResize = useDebounceCallback(onResize, 10); + function handleDragScroll(event) { + if (rectRef.current) { + const x = event.clientX - rectRef.current.left; + const y = event.clientY - rectRef.current.top; + onDragScroll({ x, y }); + } + } + React2.useEffect(() => { + const handleWheel = (event) => { + const element = event.target; + const isScrollbarWheel = scrollbar?.contains(element); + if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos); + }; + document.addEventListener("wheel", handleWheel, { passive: false }); + return () => document.removeEventListener("wheel", handleWheel, { passive: false }); + }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]); + React2.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]); + useResizeObserver(scrollbar, handleResize); + useResizeObserver(context.content, handleResize); + return /* @__PURE__ */ jsx( + ScrollbarProvider, + { + scope: __scopeScrollArea, + scrollbar, + hasThumb, + onThumbChange: useCallbackRef(onThumbChange), + onThumbPointerUp: useCallbackRef(onThumbPointerUp), + onThumbPositionChange: handleThumbPositionChange, + onThumbPointerDown: useCallbackRef(onThumbPointerDown), + children: /* @__PURE__ */ jsx( + Primitive.div, + { + ...scrollbarProps, + ref: composeRefs, + style: { position: "absolute", ...scrollbarProps.style }, + onPointerDown: composeEventHandlers(props.onPointerDown, (event) => { + const mainPointer = 0; + if (event.button === mainPointer) { + const element = event.target; + element.setPointerCapture(event.pointerId); + rectRef.current = scrollbar.getBoundingClientRect(); + prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect; + document.body.style.webkitUserSelect = "none"; + if (context.viewport) context.viewport.style.scrollBehavior = "auto"; + handleDragScroll(event); + } + }), + onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll), + onPointerUp: composeEventHandlers(props.onPointerUp, (event) => { + const element = event.target; + if (element.hasPointerCapture(event.pointerId)) { + element.releasePointerCapture(event.pointerId); + } + document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current; + if (context.viewport) context.viewport.style.scrollBehavior = ""; + rectRef.current = null; + }) + } + ) + } + ); +}); +var THUMB_NAME = "ScrollAreaThumb"; +var ScrollAreaThumb = React2.forwardRef( + (props, forwardedRef) => { + const { forceMount, ...thumbProps } = props; + const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) }); + } +); +var ScrollAreaThumbImpl = React2.forwardRef( + (props, forwardedRef) => { + const { __scopeScrollArea, style, ...thumbProps } = props; + const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea); + const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea); + const { onThumbPositionChange } = scrollbarContext; + const composedRef = useComposedRefs( + forwardedRef, + (node) => scrollbarContext.onThumbChange(node) + ); + const removeUnlinkedScrollListenerRef = React2.useRef(void 0); + const debounceScrollEnd = useDebounceCallback(() => { + if (removeUnlinkedScrollListenerRef.current) { + removeUnlinkedScrollListenerRef.current(); + removeUnlinkedScrollListenerRef.current = void 0; + } + }, 100); + React2.useEffect(() => { + const viewport = scrollAreaContext.viewport; + if (viewport) { + const handleScroll = () => { + debounceScrollEnd(); + if (!removeUnlinkedScrollListenerRef.current) { + const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange); + removeUnlinkedScrollListenerRef.current = listener; + onThumbPositionChange(); + } + }; + onThumbPositionChange(); + viewport.addEventListener("scroll", handleScroll); + return () => viewport.removeEventListener("scroll", handleScroll); + } + }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]); + return /* @__PURE__ */ jsx( + Primitive.div, + { + "data-state": scrollbarContext.hasThumb ? "visible" : "hidden", + ...thumbProps, + ref: composedRef, + style: { + width: "var(--radix-scroll-area-thumb-width)", + height: "var(--radix-scroll-area-thumb-height)", + ...style + }, + onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => { + const thumb = event.target; + const thumbRect = thumb.getBoundingClientRect(); + const x = event.clientX - thumbRect.left; + const y = event.clientY - thumbRect.top; + scrollbarContext.onThumbPointerDown({ x, y }); + }), + onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp) + } + ); + } +); +ScrollAreaThumb.displayName = THUMB_NAME; +var CORNER_NAME = "ScrollAreaCorner"; +var ScrollAreaCorner = React2.forwardRef( + (props, forwardedRef) => { + const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea); + const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY); + const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible; + return hasCorner ? /* @__PURE__ */ jsx(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null; + } +); +ScrollAreaCorner.displayName = CORNER_NAME; +var ScrollAreaCornerImpl = React2.forwardRef((props, forwardedRef) => { + const { __scopeScrollArea, ...cornerProps } = props; + const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea); + const [width, setWidth] = React2.useState(0); + const [height, setHeight] = React2.useState(0); + const hasSize = Boolean(width && height); + useResizeObserver(context.scrollbarX, () => { + const height2 = context.scrollbarX?.offsetHeight || 0; + context.onCornerHeightChange(height2); + setHeight(height2); + }); + useResizeObserver(context.scrollbarY, () => { + const width2 = context.scrollbarY?.offsetWidth || 0; + context.onCornerWidthChange(width2); + setWidth(width2); + }); + return hasSize ? /* @__PURE__ */ jsx( + Primitive.div, + { + ...cornerProps, + ref: forwardedRef, + style: { + width, + height, + position: "absolute", + right: context.dir === "ltr" ? 0 : void 0, + left: context.dir === "rtl" ? 0 : void 0, + bottom: 0, + ...props.style + } + } + ) : null; +}); +function toInt(value) { + return value ? parseInt(value, 10) : 0; +} +function getThumbRatio(viewportSize, contentSize) { + const ratio = viewportSize / contentSize; + return isNaN(ratio) ? 0 : ratio; +} +function getThumbSize(sizes) { + const ratio = getThumbRatio(sizes.viewport, sizes.content); + const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd; + const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio; + return Math.max(thumbSize, 18); +} +function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") { + const thumbSizePx = getThumbSize(sizes); + const thumbCenter = thumbSizePx / 2; + const offset = pointerOffset || thumbCenter; + const thumbOffsetFromEnd = thumbSizePx - offset; + const minPointerPos = sizes.scrollbar.paddingStart + offset; + const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd; + const maxScrollPos = sizes.content - sizes.viewport; + const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]; + const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange); + return interpolate(pointerPos); +} +function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") { + const thumbSizePx = getThumbSize(sizes); + const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd; + const scrollbar = sizes.scrollbar.size - scrollbarPadding; + const maxScrollPos = sizes.content - sizes.viewport; + const maxThumbPos = scrollbar - thumbSizePx; + const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]; + const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange); + const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]); + return interpolate(scrollWithoutMomentum); +} +function linearScale(input, output) { + return (value) => { + if (input[0] === input[1] || output[0] === output[1]) return output[0]; + const ratio = (output[1] - output[0]) / (input[1] - input[0]); + return output[0] + ratio * (value - input[0]); + }; +} +function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) { + return scrollPos > 0 && scrollPos < maxScrollPos; +} +var addUnlinkedScrollListener = (node, handler = () => { +}) => { + let prevPosition = { left: node.scrollLeft, top: node.scrollTop }; + let rAF = 0; + (function loop() { + const position = { left: node.scrollLeft, top: node.scrollTop }; + const isHorizontalScroll = prevPosition.left !== position.left; + const isVerticalScroll = prevPosition.top !== position.top; + if (isHorizontalScroll || isVerticalScroll) handler(); + prevPosition = position; + rAF = window.requestAnimationFrame(loop); + })(); + return () => window.cancelAnimationFrame(rAF); +}; +function useDebounceCallback(callback, delay) { + const handleCallback = useCallbackRef(callback); + const debounceTimerRef = React2.useRef(0); + React2.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []); + return React2.useCallback(() => { + window.clearTimeout(debounceTimerRef.current); + debounceTimerRef.current = window.setTimeout(handleCallback, delay); + }, [handleCallback, delay]); +} +function useResizeObserver(element, onResize) { + const handleResize = useCallbackRef(onResize); + useLayoutEffect(() => { + let rAF = 0; + if (element) { + const resizeObserver = new ResizeObserver(() => { + cancelAnimationFrame(rAF); + rAF = window.requestAnimationFrame(handleResize); + }); + resizeObserver.observe(element); + return () => { + window.cancelAnimationFrame(rAF); + resizeObserver.unobserve(element); + }; + } + }, [element, handleResize]); +} +var Root = ScrollArea; +var Viewport = ScrollAreaViewport; +var Scrollbar = ScrollAreaScrollbar; +var Thumb = ScrollAreaThumb; +var Corner = ScrollAreaCorner; +export { + Corner, + Root, + ScrollArea, + ScrollAreaCorner, + ScrollAreaScrollbar, + ScrollAreaThumb, + ScrollAreaViewport, + Scrollbar, + Thumb, + Viewport, + createScrollAreaScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.mjs.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..cfe7b75b6fb79b808745ba9e9b0dcc7ebedc5681 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/scroll-area.tsx", "../src/use-state-machine.ts"], + "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Presence } from '@radix-ui/react-presence';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useStateMachine } from './use-state-machine';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Sizes = {\n content: number;\n viewport: number;\n scrollbar: {\n size: number;\n paddingStart: number;\n paddingEnd: number;\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollArea\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_AREA_NAME = 'ScrollArea';\n\ntype ScopedProps

= P & { __scopeScrollArea?: Scope };\nconst [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);\n\ntype ScrollAreaContextValue = {\n type: 'auto' | 'always' | 'scroll' | 'hover';\n dir: Direction;\n scrollHideDelay: number;\n scrollArea: ScrollAreaElement | null;\n viewport: ScrollAreaViewportElement | null;\n onViewportChange(viewport: ScrollAreaViewportElement | null): void;\n content: HTMLDivElement | null;\n onContentChange(content: HTMLDivElement): void;\n scrollbarX: ScrollAreaScrollbarElement | null;\n onScrollbarXChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarXEnabled: boolean;\n onScrollbarXEnabledChange(rendered: boolean): void;\n scrollbarY: ScrollAreaScrollbarElement | null;\n onScrollbarYChange(scrollbar: ScrollAreaScrollbarElement | null): void;\n scrollbarYEnabled: boolean;\n onScrollbarYEnabledChange(rendered: boolean): void;\n onCornerWidthChange(width: number): void;\n onCornerHeightChange(height: number): void;\n};\n\nconst [ScrollAreaProvider, useScrollAreaContext] =\n createScrollAreaContext(SCROLL_AREA_NAME);\n\ntype ScrollAreaElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface ScrollAreaProps extends PrimitiveDivProps {\n type?: ScrollAreaContextValue['type'];\n dir?: ScrollAreaContextValue['dir'];\n scrollHideDelay?: number;\n}\n\nconst ScrollArea = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeScrollArea,\n type = 'hover',\n dir,\n scrollHideDelay = 600,\n ...scrollAreaProps\n } = props;\n const [scrollArea, setScrollArea] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const [scrollbarX, setScrollbarX] = React.useState(null);\n const [scrollbarY, setScrollbarY] = React.useState(null);\n const [cornerWidth, setCornerWidth] = React.useState(0);\n const [cornerHeight, setCornerHeight] = React.useState(0);\n const [scrollbarXEnabled, setScrollbarXEnabled] = React.useState(false);\n const [scrollbarYEnabled, setScrollbarYEnabled] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));\n const direction = useDirection(dir);\n\n return (\n \n \n \n );\n },\n);\n\nScrollArea.displayName = SCROLL_AREA_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = 'ScrollAreaViewport';\n\ntype ScrollAreaViewportElement = React.ComponentRef;\ninterface ScrollAreaViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst ScrollAreaViewport = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeScrollArea, children, nonce, ...viewportProps } = props;\n const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n return (\n <>\n \n

\n {children}\n
\n \n \n );\n },\n);\n\nScrollAreaViewport.displayName = VIEWPORT_NAME;\n\nconst ScrollAreaViewportStyle = React.memo(\n ({ nonce }: { nonce?: string }) => {\n return (\n \n );\n },\n (prevProps, nextProps) => prevProps.nonce === nextProps.nonce,\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaScrollbar\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLLBAR_NAME = 'ScrollAreaScrollbar';\n\ntype ScrollAreaScrollbarElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbar = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;\n const isHorizontal = props.orientation === 'horizontal';\n\n React.useEffect(() => {\n isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);\n return () => {\n isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);\n };\n }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);\n\n return context.type === 'hover' ? (\n \n ) : context.type === 'scroll' ? (\n \n ) : context.type === 'auto' ? (\n \n ) : context.type === 'always' ? (\n \n ) : null;\n },\n);\n\nScrollAreaScrollbar.displayName = SCROLLBAR_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarHoverElement = ScrollAreaScrollbarAutoElement;\ninterface ScrollAreaScrollbarHoverProps extends ScrollAreaScrollbarAutoProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarHover = React.forwardRef<\n ScrollAreaScrollbarHoverElement,\n ScrollAreaScrollbarHoverProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [visible, setVisible] = React.useState(false);\n\n React.useEffect(() => {\n const scrollArea = context.scrollArea;\n let hideTimer = 0;\n if (scrollArea) {\n const handlePointerEnter = () => {\n window.clearTimeout(hideTimer);\n setVisible(true);\n };\n const handlePointerLeave = () => {\n hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);\n };\n scrollArea.addEventListener('pointerenter', handlePointerEnter);\n scrollArea.addEventListener('pointerleave', handlePointerLeave);\n return () => {\n window.clearTimeout(hideTimer);\n scrollArea.removeEventListener('pointerenter', handlePointerEnter);\n scrollArea.removeEventListener('pointerleave', handlePointerLeave);\n };\n }\n }, [context.scrollArea, context.scrollHideDelay]);\n\n return (\n \n \n \n );\n});\n\ntype ScrollAreaScrollbarScrollElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarScrollProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarScroll = React.forwardRef<\n ScrollAreaScrollbarScrollElement,\n ScrollAreaScrollbarScrollProps\n>((props: ScopedProps, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const isHorizontal = props.orientation === 'horizontal';\n const debounceScrollEnd = useDebounceCallback(() => send('SCROLL_END'), 100);\n const [state, send] = useStateMachine('hidden', {\n hidden: {\n SCROLL: 'scrolling',\n },\n scrolling: {\n SCROLL_END: 'idle',\n POINTER_ENTER: 'interacting',\n },\n interacting: {\n SCROLL: 'interacting',\n POINTER_LEAVE: 'idle',\n },\n idle: {\n HIDE: 'hidden',\n SCROLL: 'scrolling',\n POINTER_ENTER: 'interacting',\n },\n });\n\n React.useEffect(() => {\n if (state === 'idle') {\n const hideTimer = window.setTimeout(() => send('HIDE'), context.scrollHideDelay);\n return () => window.clearTimeout(hideTimer);\n }\n }, [state, context.scrollHideDelay, send]);\n\n React.useEffect(() => {\n const viewport = context.viewport;\n const scrollDirection = isHorizontal ? 'scrollLeft' : 'scrollTop';\n\n if (viewport) {\n let prevScrollPos = viewport[scrollDirection];\n const handleScroll = () => {\n const scrollPos = viewport[scrollDirection];\n const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;\n if (hasScrollInDirectionChanged) {\n send('SCROLL');\n debounceScrollEnd();\n }\n prevScrollPos = scrollPos;\n };\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [context.viewport, isHorizontal, send, debounceScrollEnd]);\n\n return (\n \n send('POINTER_ENTER'))}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, () => send('POINTER_LEAVE'))}\n />\n \n );\n});\n\ntype ScrollAreaScrollbarAutoElement = ScrollAreaScrollbarVisibleElement;\ninterface ScrollAreaScrollbarAutoProps extends ScrollAreaScrollbarVisibleProps {\n forceMount?: true;\n}\n\nconst ScrollAreaScrollbarAuto = React.forwardRef<\n ScrollAreaScrollbarAutoElement,\n ScrollAreaScrollbarAutoProps\n>((props: ScopedProps, forwardedRef) => {\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { forceMount, ...scrollbarProps } = props;\n const [visible, setVisible] = React.useState(false);\n const isHorizontal = props.orientation === 'horizontal';\n const handleResize = useDebounceCallback(() => {\n if (context.viewport) {\n const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;\n const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;\n setVisible(isHorizontal ? isOverflowX : isOverflowY);\n }\n }, 10);\n\n useResizeObserver(context.viewport, handleResize);\n useResizeObserver(context.content, handleResize);\n\n return (\n \n \n \n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarVisibleElement = ScrollAreaScrollbarAxisElement;\ninterface ScrollAreaScrollbarVisibleProps extends Omit<\n ScrollAreaScrollbarAxisProps,\n keyof ScrollAreaScrollbarAxisPrivateProps\n> {\n orientation?: 'horizontal' | 'vertical';\n}\n\nconst ScrollAreaScrollbarVisible = React.forwardRef<\n ScrollAreaScrollbarVisibleElement,\n ScrollAreaScrollbarVisibleProps\n>((props: ScopedProps, forwardedRef) => {\n const { orientation = 'vertical', ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const thumbRef = React.useRef(null);\n const pointerOffsetRef = React.useRef(0);\n const [sizes, setSizes] = React.useState({\n content: 0,\n viewport: 0,\n scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 },\n });\n const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);\n\n type UncommonProps = 'onThumbPositionChange' | 'onDragScroll' | 'onWheelScroll';\n const commonProps: Omit = {\n ...scrollbarProps,\n sizes,\n onSizesChange: setSizes,\n hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),\n onThumbChange: (thumb) => (thumbRef.current = thumb),\n onThumbPointerUp: () => (pointerOffsetRef.current = 0),\n onThumbPointerDown: (pointerPos) => (pointerOffsetRef.current = pointerPos),\n };\n\n function getScrollPosition(pointerPos: number, dir?: Direction) {\n return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);\n }\n\n if (orientation === 'horizontal') {\n return (\n {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollLeft;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);\n thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;\n }\n }}\n onWheelScroll={(scrollPos) => {\n if (context.viewport) context.viewport.scrollLeft = scrollPos;\n }}\n onDragScroll={(pointerPos) => {\n if (context.viewport) {\n context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);\n }\n }}\n />\n );\n }\n\n if (orientation === 'vertical') {\n return (\n {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollTop;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes);\n thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }}\n onWheelScroll={(scrollPos) => {\n if (context.viewport) context.viewport.scrollTop = scrollPos;\n }}\n onDragScroll={(pointerPos) => {\n if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);\n }}\n />\n );\n }\n\n return null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaScrollbarAxisPrivateProps = {\n hasThumb: boolean;\n sizes: Sizes;\n onSizesChange(sizes: Sizes): void;\n onThumbChange(thumb: ScrollAreaThumbElement | null): void;\n onThumbPointerDown(pointerPos: number): void;\n onThumbPointerUp(): void;\n onThumbPositionChange(): void;\n onWheelScroll(scrollPos: number): void;\n onDragScroll(pointerPos: number): void;\n};\n\ntype ScrollAreaScrollbarAxisElement = ScrollAreaScrollbarImplElement;\ninterface ScrollAreaScrollbarAxisProps\n extends\n Omit,\n ScrollAreaScrollbarAxisPrivateProps {}\n\nconst ScrollAreaScrollbarX = React.forwardRef<\n ScrollAreaScrollbarAxisElement,\n ScrollAreaScrollbarAxisProps\n>((props: ScopedProps, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = React.useState();\n const ref = React.useRef(null);\n const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);\n\n React.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n\n return (\n props.onThumbPointerDown(pointerPos.x)}\n onDragScroll={(pointerPos) => props.onDragScroll(pointerPos.x)}\n onWheelScroll={(event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollLeft + event.deltaX;\n props.onWheelScroll(scrollPos);\n // prevent window scroll when wheeling on scrollbar\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n }}\n onResize={() => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollWidth,\n viewport: context.viewport.offsetWidth,\n scrollbar: {\n size: ref.current.clientWidth,\n paddingStart: toInt(computedStyle.paddingLeft),\n paddingEnd: toInt(computedStyle.paddingRight),\n },\n });\n }\n }}\n />\n );\n});\n\nconst ScrollAreaScrollbarY = React.forwardRef<\n ScrollAreaScrollbarAxisElement,\n ScrollAreaScrollbarAxisProps\n>((props: ScopedProps, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = React.useState();\n const ref = React.useRef(null);\n const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);\n\n React.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n\n return (\n props.onThumbPointerDown(pointerPos.y)}\n onDragScroll={(pointerPos) => props.onDragScroll(pointerPos.y)}\n onWheelScroll={(event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollTop + event.deltaY;\n props.onWheelScroll(scrollPos);\n // prevent window scroll when wheeling on scrollbar\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n }}\n onResize={() => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollHeight,\n viewport: context.viewport.offsetHeight,\n scrollbar: {\n size: ref.current.clientHeight,\n paddingStart: toInt(computedStyle.paddingTop),\n paddingEnd: toInt(computedStyle.paddingBottom),\n },\n });\n }\n }}\n />\n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollbarContext = {\n hasThumb: boolean;\n scrollbar: ScrollAreaScrollbarElement | null;\n onThumbChange(thumb: ScrollAreaThumbElement | null): void;\n onThumbPointerUp(): void;\n onThumbPointerDown(pointerPos: { x: number; y: number }): void;\n onThumbPositionChange(): void;\n};\n\nconst [ScrollbarProvider, useScrollbarContext] =\n createScrollAreaContext(SCROLLBAR_NAME);\n\ntype ScrollAreaScrollbarImplElement = React.ComponentRef;\ntype ScrollAreaScrollbarImplPrivateProps = {\n sizes: Sizes;\n hasThumb: boolean;\n onThumbChange: ScrollbarContext['onThumbChange'];\n onThumbPointerUp: ScrollbarContext['onThumbPointerUp'];\n onThumbPointerDown: ScrollbarContext['onThumbPointerDown'];\n onThumbPositionChange: ScrollbarContext['onThumbPositionChange'];\n onWheelScroll(event: WheelEvent, maxScrollPos: number): void;\n onDragScroll(pointerPos: { x: number; y: number }): void;\n onResize(): void;\n};\ninterface ScrollAreaScrollbarImplProps\n extends\n Omit,\n ScrollAreaScrollbarImplPrivateProps {}\n\nconst ScrollAreaScrollbarImpl = React.forwardRef<\n ScrollAreaScrollbarImplElement,\n ScrollAreaScrollbarImplProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeScrollArea,\n sizes,\n hasThumb,\n onThumbChange,\n onThumbPointerUp,\n onThumbPointerDown,\n onThumbPositionChange,\n onDragScroll,\n onWheelScroll,\n onResize,\n ...scrollbarProps\n } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);\n const [scrollbar, setScrollbar] = React.useState(null);\n const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node));\n const rectRef = React.useRef(null);\n const prevWebkitUserSelectRef = React.useRef('');\n const viewport = context.viewport;\n const maxScrollPos = sizes.content - sizes.viewport;\n const handleWheelScroll = useCallbackRef(onWheelScroll);\n const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);\n const handleResize = useDebounceCallback(onResize, 10);\n\n function handleDragScroll(event: React.PointerEvent) {\n if (rectRef.current) {\n const x = event.clientX - rectRef.current.left;\n const y = event.clientY - rectRef.current.top;\n onDragScroll({ x, y });\n }\n }\n\n /**\n * We bind wheel event imperatively so we can switch off passive\n * mode for document wheel event to allow it to be prevented\n */\n React.useEffect(() => {\n const handleWheel = (event: WheelEvent) => {\n const element = event.target as HTMLElement;\n const isScrollbarWheel = scrollbar?.contains(element);\n if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);\n };\n document.addEventListener('wheel', handleWheel, { passive: false });\n return () => document.removeEventListener('wheel', handleWheel, { passive: false } as any);\n }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);\n\n /**\n * Update thumb position on sizes change\n */\n React.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);\n\n useResizeObserver(scrollbar, handleResize);\n useResizeObserver(context.content, handleResize);\n\n return (\n \n {\n const mainPointer = 0;\n if (event.button === mainPointer) {\n const element = event.target as HTMLElement;\n element.setPointerCapture(event.pointerId);\n rectRef.current = scrollbar!.getBoundingClientRect();\n // pointer capture doesn't prevent text selection in Safari\n // so we remove text selection manually when scrolling\n prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;\n document.body.style.webkitUserSelect = 'none';\n if (context.viewport) context.viewport.style.scrollBehavior = 'auto';\n handleDragScroll(event);\n }\n })}\n onPointerMove={composeEventHandlers(props.onPointerMove, handleDragScroll)}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n const element = event.target as HTMLElement;\n if (element.hasPointerCapture(event.pointerId)) {\n element.releasePointerCapture(event.pointerId);\n }\n document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;\n if (context.viewport) context.viewport.style.scrollBehavior = '';\n rectRef.current = null;\n })}\n />\n \n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'ScrollAreaThumb';\n\ntype ScrollAreaThumbElement = ScrollAreaThumbImplElement;\ninterface ScrollAreaThumbProps extends ScrollAreaThumbImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst ScrollAreaThumb = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { forceMount, ...thumbProps } = props;\n const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);\n return (\n \n \n \n );\n },\n);\n\ntype ScrollAreaThumbImplElement = React.ComponentRef;\ninterface ScrollAreaThumbImplProps extends PrimitiveDivProps {}\n\nconst ScrollAreaThumbImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeScrollArea, style, ...thumbProps } = props;\n const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);\n const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);\n const { onThumbPositionChange } = scrollbarContext;\n const composedRef = useComposedRefs(forwardedRef, (node) =>\n scrollbarContext.onThumbChange(node),\n );\n const removeUnlinkedScrollListenerRef = React.useRef<() => void>(undefined);\n const debounceScrollEnd = useDebounceCallback(() => {\n if (removeUnlinkedScrollListenerRef.current) {\n removeUnlinkedScrollListenerRef.current();\n removeUnlinkedScrollListenerRef.current = undefined;\n }\n }, 100);\n\n React.useEffect(() => {\n const viewport = scrollAreaContext.viewport;\n if (viewport) {\n /**\n * We only bind to native scroll event so we know when scroll starts and ends.\n * When scroll starts we start a requestAnimationFrame loop that checks for\n * changes to scroll position. That rAF loop triggers our thumb position change\n * when relevant to avoid scroll-linked effects. We cancel the loop when scroll ends.\n * https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\n */\n const handleScroll = () => {\n debounceScrollEnd();\n if (!removeUnlinkedScrollListenerRef.current) {\n const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);\n removeUnlinkedScrollListenerRef.current = listener;\n onThumbPositionChange();\n }\n };\n onThumbPositionChange();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);\n\n return (\n {\n const thumb = event.target as HTMLElement;\n const thumbRect = thumb.getBoundingClientRect();\n const x = event.clientX - thumbRect.left;\n const y = event.clientY - thumbRect.top;\n scrollbarContext.onThumbPointerDown({ x, y });\n })}\n onPointerUp={composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)}\n />\n );\n },\n);\n\nScrollAreaThumb.displayName = THUMB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaCorner\n * -----------------------------------------------------------------------------------------------*/\n\nconst CORNER_NAME = 'ScrollAreaCorner';\n\ntype ScrollAreaCornerElement = ScrollAreaCornerImplElement;\ninterface ScrollAreaCornerProps extends ScrollAreaCornerImplProps {}\n\nconst ScrollAreaCorner = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);\n const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);\n const hasCorner = context.type !== 'scroll' && hasBothScrollbarsVisible;\n return hasCorner ? : null;\n },\n);\n\nScrollAreaCorner.displayName = CORNER_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ScrollAreaCornerImplElement = React.ComponentRef;\ninterface ScrollAreaCornerImplProps extends PrimitiveDivProps {}\n\nconst ScrollAreaCornerImpl = React.forwardRef<\n ScrollAreaCornerImplElement,\n ScrollAreaCornerImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeScrollArea, ...cornerProps } = props;\n const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);\n const [width, setWidth] = React.useState(0);\n const [height, setHeight] = React.useState(0);\n const hasSize = Boolean(width && height);\n\n useResizeObserver(context.scrollbarX, () => {\n const height = context.scrollbarX?.offsetHeight || 0;\n context.onCornerHeightChange(height);\n setHeight(height);\n });\n\n useResizeObserver(context.scrollbarY, () => {\n const width = context.scrollbarY?.offsetWidth || 0;\n context.onCornerWidthChange(width);\n setWidth(width);\n });\n\n return hasSize ? (\n \n ) : null;\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction toInt(value?: string) {\n return value ? parseInt(value, 10) : 0;\n}\n\nfunction getThumbRatio(viewportSize: number, contentSize: number) {\n const ratio = viewportSize / contentSize;\n return isNaN(ratio) ? 0 : ratio;\n}\n\nfunction getThumbSize(sizes: Sizes) {\n const ratio = getThumbRatio(sizes.viewport, sizes.content);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;\n // minimum of 18 matches macOS minimum\n return Math.max(thumbSize, 18);\n}\n\nfunction getScrollPositionFromPointer(\n pointerPos: number,\n pointerOffset: number,\n sizes: Sizes,\n dir: Direction = 'ltr',\n) {\n const thumbSizePx = getThumbSize(sizes);\n const thumbCenter = thumbSizePx / 2;\n const offset = pointerOffset || thumbCenter;\n const thumbOffsetFromEnd = thumbSizePx - offset;\n const minPointerPos = sizes.scrollbar.paddingStart + offset;\n const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;\n const maxScrollPos = sizes.content - sizes.viewport;\n const scrollRange = dir === 'ltr' ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange as [number, number]);\n return interpolate(pointerPos);\n}\n\nfunction getThumbOffsetFromScroll(scrollPos: number, sizes: Sizes, dir: Direction = 'ltr') {\n const thumbSizePx = getThumbSize(sizes);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const scrollbar = sizes.scrollbar.size - scrollbarPadding;\n const maxScrollPos = sizes.content - sizes.viewport;\n const maxThumbPos = scrollbar - thumbSizePx;\n const scrollClampRange = dir === 'ltr' ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange as [number, number]);\n const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);\n return interpolate(scrollWithoutMomentum);\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nfunction linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\n\nfunction isScrollingWithinScrollbarBounds(scrollPos: number, maxScrollPos: number) {\n return scrollPos > 0 && scrollPos < maxScrollPos;\n}\n\n// Custom scroll handler to avoid scroll-linked effects\n// https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\nconst addUnlinkedScrollListener = (node: HTMLElement, handler = () => {}) => {\n let prevPosition = { left: node.scrollLeft, top: node.scrollTop };\n let rAF = 0;\n (function loop() {\n const position = { left: node.scrollLeft, top: node.scrollTop };\n const isHorizontalScroll = prevPosition.left !== position.left;\n const isVerticalScroll = prevPosition.top !== position.top;\n if (isHorizontalScroll || isVerticalScroll) handler();\n prevPosition = position;\n rAF = window.requestAnimationFrame(loop);\n })();\n return () => window.cancelAnimationFrame(rAF);\n};\n\nfunction useDebounceCallback(callback: () => void, delay: number) {\n const handleCallback = useCallbackRef(callback);\n const debounceTimerRef = React.useRef(0);\n React.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);\n return React.useCallback(() => {\n window.clearTimeout(debounceTimerRef.current);\n debounceTimerRef.current = window.setTimeout(handleCallback, delay);\n }, [handleCallback, delay]);\n}\n\nfunction useResizeObserver(element: HTMLElement | null, onResize: () => void) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = ScrollArea;\nconst Viewport = ScrollAreaViewport;\nconst Scrollbar = ScrollAreaScrollbar;\nconst Thumb = ScrollAreaThumb;\nconst Corner = ScrollAreaCorner;\n\nexport {\n createScrollAreaScope,\n //\n ScrollArea,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n //\n Root,\n Viewport,\n Scrollbar,\n Thumb,\n Corner,\n};\nexport type {\n ScrollAreaProps,\n ScrollAreaViewportProps,\n ScrollAreaScrollbarProps,\n ScrollAreaThumbProps,\n ScrollAreaCornerProps,\n};\n", "import * as React from 'react';\n\ntype Machine = { [k: string]: { [k: string]: S } };\ntype MachineState = keyof T;\ntype MachineEvent = keyof UnionToIntersection;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine(\n initialState: MachineState,\n machine: M & Machine>,\n) {\n return React.useReducer((state: MachineState, event: MachineEvent): MachineState => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"], + "mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,4BAA4B;;;ACTrC,YAAY,WAAW;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;AD0FQ,SAqCF,UArCE,KAqCF,YArCE;AAhFR,IAAM,mBAAmB;AAGzB,IAAM,CAAC,yBAAyB,qBAAqB,IAAI,mBAAmB,gBAAgB;AAuB5F,IAAM,CAAC,oBAAoB,oBAAoB,IAC7C,wBAAgD,gBAAgB;AAUlE,IAAM,aAAmB;AAAA,EACvB,CAAC,OAAqC,iBAAiB;AACrD,UAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,CAAC,YAAY,aAAa,IAAU,gBAAmC,IAAI;AACjF,UAAM,CAAC,UAAU,W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BAAgB,KAAK;AAAA,EACpE,GAAG,CAAC,gBAAgB,KAAK,CAAC;AAC5B;AAEA,SAAS,kBAAkB,SAA6B,UAAsB;AAC5E,QAAM,eAAe,eAAe,QAAQ;AAC5C,kBAAgB,MAAM;AACpB,QAAI,MAAM;AACV,QAAI,SAAS;AAQX,YAAM,iBAAiB,IAAI,eAAe,MAAM;AAC9C,6BAAqB,GAAG;AACxB,cAAM,OAAO,sBAAsB,YAAY;AAAA,MACjD,CAAC;AACD,qBAAe,QAAQ,OAAO;AAC9B,aAAO,MAAM;AACX,eAAO,qBAAqB,GAAG;AAC/B,uBAAe,UAAU,OAAO;AAAA,MAClC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,SAAS,YAAY,CAAC;AAC5B;AAIA,IAAM,OAAO;AACb,IAAM,WAAW;AACjB,IAAM,YAAY;AAClB,IAAM,QAAQ;AACd,IAAM,SAAS;", + "names": ["React", "height", "width"] +} diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/package.json b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/package.json new file mode 100644 index 0000000000000000000000000000000000000000..147d82e52c7961358c742f1574d71c48eff5f6f5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-scroll-area/package.json @@ -0,0 +1,76 @@ +{ + "name": "@radix-ui/react-scroll-area", + "version": "1.2.12", + "license": "MIT", + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "dependencies": { + "@radix-ui/number": "1.1.2", + "@radix-ui/primitive": "1.1.4", + "@radix-ui/react-compose-refs": "1.1.3", + "@radix-ui/react-direction": "1.1.2", + "@radix-ui/react-context": "1.1.4", + "@radix-ui/react-primitive": "2.1.6", + "@radix-ui/react-presence": "1.1.6", + "@radix-ui/react-use-callback-ref": "1.1.2", + "@radix-ui/react-use-layout-effect": "1.1.2" + }, + "devDependencies": { + "@types/react": "^19.2.2", + "@types/react-dom": "^19.2.2", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "typescript": "^5.9.3", + "@repo/typescript-config": "0.0.0", + "@repo/builder": "0.0.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git", + "directory": "packages/react/scroll-area" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "scripts": { + "lint": "oxlint --max-warnings 0 src", + "clean": "rm -rf dist", + "reset": "rm -rf dist node_modules", + "typecheck": "tsc --noEmit", + "build": "radix-build" + }, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + } +} \ No newline at end of file diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/LICENSE b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a18858fb7b014098cba85703e66609be66a26ef5 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 WorkOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/README.md b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2eed12ca63174f987e3b13f8b2fa04eabe8fa17d --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/README.md @@ -0,0 +1,3 @@ +# `react-select` + +View docs [here](https://radix-ui.com/primitives/docs/components/select). diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.d.mts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..26a8c023243afdfa203c5e317cbaf3f7baea1ee7 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.d.mts @@ -0,0 +1,149 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +type Direction = 'ltr' | 'rtl'; +type ScopedProps

= P & { + __scopeSelect?: Scope; +}; +declare const createSelectScope: _radix_ui_react_context.CreateScope; +interface SelectSharedProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + dir?: Direction; + name?: string; + autoComplete?: string; + disabled?: boolean; + required?: boolean; + form?: string; +} +type SelectProps = SelectSharedProps & { + value?: string; + defaultValue?: string; + onValueChange?(value: string): void; +}; +interface SelectProviderProps extends SelectSharedProps { + value?: string; + defaultValue?: string; + onValueChange?(value: string): void; +} +declare function SelectProvider(props: ScopedProps): react_jsx_runtime.JSX.Element; +declare namespace SelectProvider { + var displayName: string; +} +declare const Select: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface SelectTriggerProps extends PrimitiveButtonProps { +} +declare const SelectTrigger: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface SelectValueProps extends Omit { + placeholder?: React.ReactNode; +} +declare const SelectValue: React.ForwardRefExoticComponent>; +interface SelectIconProps extends PrimitiveSpanProps { +} +declare const SelectIcon: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface SelectPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when controlling + * animation with React animation libraries. + */ + forceMount?: true; +} +declare const SelectPortal: React.FC; +interface SelectContentProps extends SelectContentImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const SelectContent: React.ForwardRefExoticComponent>; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type FocusScopeProps = React.ComponentPropsWithoutRef; +type SelectPopperPrivateProps = { + onPlaced?: PopperContentProps['onPlaced']; +}; +interface SelectContentImplProps extends Omit, Omit { + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; + /** + * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. + * Can be prevented. + */ + onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; + position?: 'item-aligned' | 'popper'; +} +interface SelectItemAlignedPositionProps extends PrimitiveDivProps, SelectPopperPrivateProps { +} +type PopperContentProps = React.ComponentPropsWithoutRef; +interface SelectPopperPositionProps extends PopperContentProps, SelectPopperPrivateProps { +} +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface SelectViewportProps extends PrimitiveDivProps { + nonce?: string; +} +declare const SelectViewport: React.ForwardRefExoticComponent>; +interface SelectGroupProps extends PrimitiveDivProps { +} +declare const SelectGroup: React.ForwardRefExoticComponent>; +interface SelectLabelProps extends PrimitiveDivProps { +} +declare const SelectLabel: React.ForwardRefExoticComponent>; +interface SelectItemProps extends PrimitiveDivProps { + value: string; + disabled?: boolean; + textValue?: string; +} +declare const SelectItem: React.ForwardRefExoticComponent>; +interface SelectItemTextProps extends PrimitiveSpanProps { +} +declare const SelectItemText: React.ForwardRefExoticComponent>; +interface SelectItemIndicatorProps extends PrimitiveSpanProps { +} +declare const SelectItemIndicator: React.ForwardRefExoticComponent>; +interface SelectScrollUpButtonProps extends Omit { +} +declare const SelectScrollUpButton: React.ForwardRefExoticComponent>; +interface SelectScrollDownButtonProps extends Omit { +} +declare const SelectScrollDownButton: React.ForwardRefExoticComponent>; +interface SelectScrollButtonImplProps extends PrimitiveDivProps { + onAutoScroll(): void; +} +interface SelectSeparatorProps extends PrimitiveDivProps { +} +declare const SelectSeparator: React.ForwardRefExoticComponent>; +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface SelectArrowProps extends PopperArrowProps { +} +declare const SelectArrow: React.ForwardRefExoticComponent>; +type PrimitiveSelectProps = React.ComponentPropsWithoutRef; +interface SelectBubbleInputProps extends Omit { +} +declare const SelectBubbleInput: React.ForwardRefExoticComponent>; + +export { SelectArrow as Arrow, SelectContent as Content, SelectGroup as Group, SelectIcon as Icon, SelectItem as Item, SelectItemIndicator as ItemIndicator, SelectItemText as ItemText, SelectLabel as Label, SelectPortal as Portal, Select as Root, SelectScrollDownButton as ScrollDownButton, SelectScrollUpButton as ScrollUpButton, Select, SelectArrow, type SelectArrowProps, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectIcon, type SelectIconProps, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectLabel, type SelectLabelProps, SelectPortal, type SelectPortalProps, type SelectProps, SelectScrollDownButton, type SelectScrollDownButtonProps, SelectScrollUpButton, type SelectScrollUpButtonProps, SelectSeparator, type SelectSeparatorProps, type SelectSharedProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, SelectViewport, type SelectViewportProps, SelectSeparator as Separator, SelectTrigger as Trigger, SelectValue as Value, SelectViewport as Viewport, createSelectScope, SelectBubbleInput as unstable_BubbleInput, SelectProvider as unstable_Provider, SelectBubbleInput as unstable_SelectBubbleInput, type SelectBubbleInputProps as unstable_SelectBubbleInputProps, SelectProvider as unstable_SelectProvider, type SelectProviderProps as unstable_SelectProviderProps }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26a8c023243afdfa203c5e317cbaf3f7baea1ee7 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.d.ts @@ -0,0 +1,149 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import { Scope } from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import * as PopperPrimitive from '@radix-ui/react-popper'; +import { Portal } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +type Direction = 'ltr' | 'rtl'; +type ScopedProps

= P & { + __scopeSelect?: Scope; +}; +declare const createSelectScope: _radix_ui_react_context.CreateScope; +interface SelectSharedProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + dir?: Direction; + name?: string; + autoComplete?: string; + disabled?: boolean; + required?: boolean; + form?: string; +} +type SelectProps = SelectSharedProps & { + value?: string; + defaultValue?: string; + onValueChange?(value: string): void; +}; +interface SelectProviderProps extends SelectSharedProps { + value?: string; + defaultValue?: string; + onValueChange?(value: string): void; +} +declare function SelectProvider(props: ScopedProps): react_jsx_runtime.JSX.Element; +declare namespace SelectProvider { + var displayName: string; +} +declare const Select: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface SelectTriggerProps extends PrimitiveButtonProps { +} +declare const SelectTrigger: React.ForwardRefExoticComponent>; +type PrimitiveSpanProps = React.ComponentPropsWithoutRef; +interface SelectValueProps extends Omit { + placeholder?: React.ReactNode; +} +declare const SelectValue: React.ForwardRefExoticComponent>; +interface SelectIconProps extends PrimitiveSpanProps { +} +declare const SelectIcon: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface SelectPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when controlling + * animation with React animation libraries. + */ + forceMount?: true; +} +declare const SelectPortal: React.FC; +interface SelectContentProps extends SelectContentImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const SelectContent: React.ForwardRefExoticComponent>; +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type FocusScopeProps = React.ComponentPropsWithoutRef; +type SelectPopperPrivateProps = { + onPlaced?: PopperContentProps['onPlaced']; +}; +interface SelectContentImplProps extends Omit, Omit { + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; + /** + * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. + * Can be prevented. + */ + onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; + position?: 'item-aligned' | 'popper'; +} +interface SelectItemAlignedPositionProps extends PrimitiveDivProps, SelectPopperPrivateProps { +} +type PopperContentProps = React.ComponentPropsWithoutRef; +interface SelectPopperPositionProps extends PopperContentProps, SelectPopperPrivateProps { +} +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface SelectViewportProps extends PrimitiveDivProps { + nonce?: string; +} +declare const SelectViewport: React.ForwardRefExoticComponent>; +interface SelectGroupProps extends PrimitiveDivProps { +} +declare const SelectGroup: React.ForwardRefExoticComponent>; +interface SelectLabelProps extends PrimitiveDivProps { +} +declare const SelectLabel: React.ForwardRefExoticComponent>; +interface SelectItemProps extends PrimitiveDivProps { + value: string; + disabled?: boolean; + textValue?: string; +} +declare const SelectItem: React.ForwardRefExoticComponent>; +interface SelectItemTextProps extends PrimitiveSpanProps { +} +declare const SelectItemText: React.ForwardRefExoticComponent>; +interface SelectItemIndicatorProps extends PrimitiveSpanProps { +} +declare const SelectItemIndicator: React.ForwardRefExoticComponent>; +interface SelectScrollUpButtonProps extends Omit { +} +declare const SelectScrollUpButton: React.ForwardRefExoticComponent>; +interface SelectScrollDownButtonProps extends Omit { +} +declare const SelectScrollDownButton: React.ForwardRefExoticComponent>; +interface SelectScrollButtonImplProps extends PrimitiveDivProps { + onAutoScroll(): void; +} +interface SelectSeparatorProps extends PrimitiveDivProps { +} +declare const SelectSeparator: React.ForwardRefExoticComponent>; +type PopperArrowProps = React.ComponentPropsWithoutRef; +interface SelectArrowProps extends PopperArrowProps { +} +declare const SelectArrow: React.ForwardRefExoticComponent>; +type PrimitiveSelectProps = React.ComponentPropsWithoutRef; +interface SelectBubbleInputProps extends Omit { +} +declare const SelectBubbleInput: React.ForwardRefExoticComponent>; + +export { SelectArrow as Arrow, SelectContent as Content, SelectGroup as Group, SelectIcon as Icon, SelectItem as Item, SelectItemIndicator as ItemIndicator, SelectItemText as ItemText, SelectLabel as Label, SelectPortal as Portal, Select as Root, SelectScrollDownButton as ScrollDownButton, SelectScrollUpButton as ScrollUpButton, Select, SelectArrow, type SelectArrowProps, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectIcon, type SelectIconProps, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectLabel, type SelectLabelProps, SelectPortal, type SelectPortalProps, type SelectProps, SelectScrollDownButton, type SelectScrollDownButtonProps, SelectScrollUpButton, type SelectScrollUpButtonProps, SelectSeparator, type SelectSeparatorProps, type SelectSharedProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, SelectViewport, type SelectViewportProps, SelectSeparator as Separator, SelectTrigger as Trigger, SelectValue as Value, SelectViewport as Viewport, createSelectScope, SelectBubbleInput as unstable_BubbleInput, SelectProvider as unstable_Provider, SelectBubbleInput as unstable_SelectBubbleInput, type SelectBubbleInputProps as unstable_SelectBubbleInputProps, SelectProvider as unstable_SelectProvider, type SelectProviderProps as unstable_SelectProviderProps }; diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.js b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..87642cf64377b511ad146810527b7b8a71565ca0 --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.js @@ -0,0 +1,1251 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + Arrow: () => SelectArrow, + Content: () => SelectContent, + Group: () => SelectGroup, + Icon: () => SelectIcon, + Item: () => SelectItem, + ItemIndicator: () => SelectItemIndicator, + ItemText: () => SelectItemText, + Label: () => SelectLabel, + Portal: () => SelectPortal, + Root: () => Select, + ScrollDownButton: () => SelectScrollDownButton, + ScrollUpButton: () => SelectScrollUpButton, + Select: () => Select, + SelectArrow: () => SelectArrow, + SelectContent: () => SelectContent, + SelectGroup: () => SelectGroup, + SelectIcon: () => SelectIcon, + SelectItem: () => SelectItem, + SelectItemIndicator: () => SelectItemIndicator, + SelectItemText: () => SelectItemText, + SelectLabel: () => SelectLabel, + SelectPortal: () => SelectPortal, + SelectScrollDownButton: () => SelectScrollDownButton, + SelectScrollUpButton: () => SelectScrollUpButton, + SelectSeparator: () => SelectSeparator, + SelectTrigger: () => SelectTrigger, + SelectValue: () => SelectValue, + SelectViewport: () => SelectViewport, + Separator: () => SelectSeparator, + Trigger: () => SelectTrigger, + Value: () => SelectValue, + Viewport: () => SelectViewport, + createSelectScope: () => createSelectScope, + unstable_BubbleInput: () => SelectBubbleInput, + unstable_Provider: () => SelectProvider, + unstable_SelectBubbleInput: () => SelectBubbleInput, + unstable_SelectProvider: () => SelectProvider +}); +module.exports = __toCommonJS(index_exports); + +// src/select.tsx +var React = __toESM(require("react")); +var ReactDOM = __toESM(require("react-dom")); +var import_number = require("@radix-ui/number"); +var import_primitive = require("@radix-ui/primitive"); +var import_react_collection = require("@radix-ui/react-collection"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_direction = require("@radix-ui/react-direction"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_react_focus_guards = require("@radix-ui/react-focus-guards"); +var import_react_focus_scope = require("@radix-ui/react-focus-scope"); +var import_react_id = require("@radix-ui/react-id"); +var PopperPrimitive = __toESM(require("@radix-ui/react-popper")); +var import_react_popper = require("@radix-ui/react-popper"); +var import_react_portal = require("@radix-ui/react-portal"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_slot = require("@radix-ui/react-slot"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_react_use_previous = require("@radix-ui/react-use-previous"); +var import_react_visually_hidden = require("@radix-ui/react-visually-hidden"); +var import_aria_hidden = require("aria-hidden"); +var import_react_remove_scroll = require("react-remove-scroll"); +var import_jsx_runtime = require("react/jsx-runtime"); +var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"]; +var SELECTION_KEYS = [" ", "Enter"]; +var SELECT_NAME = "Select"; +var [Collection, useCollection, createCollectionScope] = (0, import_react_collection.createCollection)(SELECT_NAME); +var [createSelectContext, createSelectScope] = (0, import_react_context.createContextScope)(SELECT_NAME, [ + createCollectionScope, + import_react_popper.createPopperScope +]); +var usePopperScope = (0, import_react_popper.createPopperScope)(); +var [SelectProviderImpl, useSelectContext] = createSelectContext(SELECT_NAME); +var [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME); +var PROVIDER_NAME = "SelectProvider"; +function SelectProvider(props) { + const { + __scopeSelect, + children, + open: openProp, + defaultOpen, + onOpenChange, + value: valueProp, + defaultValue, + onValueChange, + dir, + name, + autoComplete, + disabled, + required, + form, + // @ts-expect-error internal render prop used by `Select` to compose its default parts + internal_do_not_use_render + } = props; + const popperScope = usePopperScope(__scopeSelect); + const [trigger, setTrigger] = React.useState(null); + const [valueNode, setValueNode] = React.useState(null); + const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false); + const direction = (0, import_react_direction.useDirection)(dir); + const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen ?? false, + onChange: onOpenChange, + caller: SELECT_NAME + }); + const [value, setValue] = (0, import_react_use_controllable_state.useControllableState)({ + prop: valueProp, + defaultProp: defaultValue, + onChange: onValueChange, + caller: SELECT_NAME + }); + const triggerPointerDownPosRef = React.useRef(null); + const isFormControl = trigger ? !!form || !!trigger.closest("form") : true; + const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set()); + const contentId = (0, import_react_id.useId)(); + const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";"); + const handleNativeOptionAdd = React.useCallback((option) => { + setNativeOptionsSet((prev) => new Set(prev).add(option)); + }, []); + const handleNativeOptionRemove = React.useCallback((option) => { + setNativeOptionsSet((prev) => { + const optionsSet = new Set(prev); + optionsSet.delete(option); + return optionsSet; + }); + }, []); + const context = { + required, + trigger, + onTriggerChange: setTrigger, + valueNode, + onValueNodeChange: setValueNode, + valueNodeHasChildren, + onValueNodeHasChildrenChange: setValueNodeHasChildren, + contentId, + value, + onValueChange: setValue, + open, + onOpenChange: setOpen, + dir: direction, + triggerPointerDownPosRef, + disabled, + name, + autoComplete, + form, + nativeOptions: nativeOptionsSet, + nativeSelectKey, + isFormControl + }; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectProviderImpl, { scope: __scopeSelect, ...context, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectNativeOptionsProvider, + { + scope: __scopeSelect, + onNativeOptionAdd: handleNativeOptionAdd, + onNativeOptionRemove: handleNativeOptionRemove, + children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children + } + ) }) }) }); +} +SelectProvider.displayName = PROVIDER_NAME; +var Select = (props) => { + const { __scopeSelect, children, ...providerProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectProvider, + { + __scopeSelect, + ...providerProps, + internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + children, + isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectBubbleInput, + { + __scopeSelect + } + ) : null + ] }) + } + ); +}; +Select.displayName = SELECT_NAME; +var TRIGGER_NAME = "SelectTrigger"; +var SelectTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, disabled = false, ...triggerProps } = props; + const popperScope = usePopperScope(__scopeSelect); + const context = useSelectContext(TRIGGER_NAME, __scopeSelect); + const isDisabled = context.disabled || disabled; + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.onTriggerChange); + const getItems = useCollection(__scopeSelect); + const pointerTypeRef = React.useRef("touch"); + const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => { + const enabledItems = getItems().filter((item) => !item.disabled); + const currentItem = enabledItems.find((item) => item.value === context.value); + const nextItem = findNextItem(enabledItems, search, currentItem); + if (nextItem !== void 0) { + context.onValueChange(nextItem.value); + } + }); + const handleOpen = (pointerEvent) => { + if (!isDisabled) { + context.onOpenChange(true); + resetTypeahead(); + } + if (pointerEvent) { + context.triggerPointerDownPosRef.current = { + x: Math.round(pointerEvent.pageX), + y: Math.round(pointerEvent.pageY) + }; + } + }; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + role: "combobox", + "aria-controls": context.open ? context.contentId : void 0, + "aria-expanded": context.open, + "aria-required": context.required, + "aria-autocomplete": "none", + dir: context.dir, + "data-state": context.open ? "open" : "closed", + disabled: isDisabled, + "data-disabled": isDisabled ? "" : void 0, + "data-placeholder": shouldShowPlaceholder(context.value) ? "" : void 0, + ...triggerProps, + ref: composedRefs, + onClick: (0, import_primitive.composeEventHandlers)(triggerProps.onClick, (event) => { + event.currentTarget.focus(); + if (pointerTypeRef.current !== "mouse") { + handleOpen(event); + } + }), + onPointerDown: (0, import_primitive.composeEventHandlers)(triggerProps.onPointerDown, (event) => { + pointerTypeRef.current = event.pointerType; + const target = event.target; + if (target.hasPointerCapture(event.pointerId)) { + target.releasePointerCapture(event.pointerId); + } + if (event.button === 0 && event.ctrlKey === false && event.pointerType === "mouse") { + handleOpen(event); + event.preventDefault(); + } + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(triggerProps.onKeyDown, (event) => { + const isTypingAhead = searchRef.current !== ""; + const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; + if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key); + if (isTypingAhead && event.key === " ") return; + if (OPEN_KEYS.includes(event.key)) { + handleOpen(); + event.preventDefault(); + } + }) + } + ) }); + } +); +SelectTrigger.displayName = TRIGGER_NAME; +var VALUE_NAME = "SelectValue"; +var SelectValue = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props; + const context = useSelectContext(VALUE_NAME, __scopeSelect); + const { onValueNodeHasChildrenChange } = context; + const hasChildren = children !== void 0; + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.onValueNodeChange); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + onValueNodeHasChildrenChange(hasChildren); + }, [onValueNodeHasChildrenChange, hasChildren]); + const showPlaceholder = shouldShowPlaceholder(context.value); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.span, + { + ...valueProps, + asChild: showPlaceholder ? false : valueProps.asChild, + ref: composedRefs, + style: { pointerEvents: "none" }, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Fragment, { children: showPlaceholder ? placeholder : children }, showPlaceholder ? "placeholder" : "value") + } + ); + } +); +SelectValue.displayName = VALUE_NAME; +var ICON_NAME = "SelectIcon"; +var SelectIcon = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, children, ...iconProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" }); + } +); +SelectIcon.displayName = ICON_NAME; +var PORTAL_NAME = "SelectPortal"; +var [PortalProvider, usePortalContext] = createSelectContext(PORTAL_NAME, { + forceMount: void 0 +}); +var SelectPortal = (props) => { + const { __scopeSelect, forceMount, ...portalProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: props.__scopeSelect, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, ...portalProps }) }); +}; +SelectPortal.displayName = PORTAL_NAME; +var CONTENT_NAME = "SelectContent"; +var SelectContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeSelect); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useSelectContext(CONTENT_NAME, props.__scopeSelect); + const [fragment, setFragment] = React.useState(); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + setFragment(new DocumentFragment()); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: ({ present }) => present ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentImpl, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentFragment, { ...contentProps, fragment }) }); + } +); +SelectContent.displayName = CONTENT_NAME; +var SelectContentFragment = React.forwardRef((props, forwardedRef) => { + const { __scopeSelect, children, fragment } = props; + if (!fragment) return null; + return ReactDOM.createPortal( + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, { scope: __scopeSelect, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: forwardedRef, children }) }) }), + fragment + ); +}); +SelectContentFragment.displayName = "SelectContentFragment"; +var CONTENT_MARGIN = 10; +var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME); +var CONTENT_IMPL_NAME = "SelectContentImpl"; +var Slot = (0, import_react_slot.createSlot)("SelectContent.RemoveScroll"); +var SelectContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect } = props; + const { + position = "item-aligned", + onCloseAutoFocus, + onEscapeKeyDown, + onPointerDownOutside, + // + // PopperContent props + side, + sideOffset, + align, + alignOffset, + arrowPadding, + collisionBoundary, + collisionPadding, + sticky, + hideWhenDetached, + avoidCollisions, + // + ...contentProps + } = props; + const context = useSelectContext(CONTENT_NAME, __scopeSelect); + const [content, setContent] = React.useState(null); + const [viewport, setViewport] = React.useState(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setContent(node)); + const [selectedItem, setSelectedItem] = React.useState(null); + const [selectedItemText, setSelectedItemText] = React.useState( + null + ); + const getItems = useCollection(__scopeSelect); + const [isPositioned, setIsPositioned] = React.useState(false); + const firstValidItemFoundRef = React.useRef(false); + React.useEffect(() => { + if (content) return (0, import_aria_hidden.hideOthers)(content); + }, [content]); + (0, import_react_focus_guards.useFocusGuards)(); + const focusFirst = React.useCallback( + (candidates) => { + const [firstItem, ...restItems] = getItems().map((item) => item.ref.current); + const [lastItem] = restItems.slice(-1); + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate?.scrollIntoView({ block: "nearest" }); + if (candidate === firstItem && viewport) viewport.scrollTop = 0; + if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight; + candidate?.focus(); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } + }, + [getItems, viewport] + ); + const focusSelectedItem = React.useCallback( + () => focusFirst([selectedItem, content]), + [focusFirst, selectedItem, content] + ); + React.useEffect(() => { + if (isPositioned) { + focusSelectedItem(); + } + }, [isPositioned, focusSelectedItem]); + const { onOpenChange, triggerPointerDownPosRef } = context; + React.useEffect(() => { + if (content) { + let pointerMoveDelta = { x: 0, y: 0 }; + const handlePointerMove = (event) => { + pointerMoveDelta = { + x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)), + y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0)) + }; + }; + const handlePointerUp = (event) => { + if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) { + event.preventDefault(); + } else { + if (!event.composedPath().includes(content)) { + onOpenChange(false); + } + } + document.removeEventListener("pointermove", handlePointerMove); + triggerPointerDownPosRef.current = null; + }; + if (triggerPointerDownPosRef.current !== null) { + document.addEventListener("pointermove", handlePointerMove); + document.addEventListener("pointerup", handlePointerUp, { capture: true, once: true }); + } + return () => { + document.removeEventListener("pointermove", handlePointerMove); + document.removeEventListener("pointerup", handlePointerUp, { capture: true }); + }; + } + }, [content, onOpenChange, triggerPointerDownPosRef]); + React.useEffect(() => { + const close = () => onOpenChange(false); + window.addEventListener("blur", close); + window.addEventListener("resize", close); + return () => { + window.removeEventListener("blur", close); + window.removeEventListener("resize", close); + }; + }, [onOpenChange]); + const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => { + const enabledItems = getItems().filter((item) => !item.disabled); + const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement); + const nextItem = findNextItem(enabledItems, search, currentItem); + if (nextItem) { + setTimeout(() => nextItem.ref.current?.focus()); + } + }); + const itemRefCallback = React.useCallback( + (node, value, disabled) => { + const isFirstValidItem = !firstValidItemFoundRef.current && !disabled; + const isSelectedItem = context.value !== void 0 && context.value === value; + if (isSelectedItem || isFirstValidItem) { + setSelectedItem(node); + if (isFirstValidItem) firstValidItemFoundRef.current = true; + } + }, + [context.value] + ); + const handleItemLeave = React.useCallback(() => content?.focus(), [content]); + const itemTextRefCallback = React.useCallback( + (node, value, disabled) => { + const isFirstValidItem = !firstValidItemFoundRef.current && !disabled; + const isSelectedItem = context.value !== void 0 && context.value === value; + if (isSelectedItem || isFirstValidItem) { + setSelectedItemText(node); + } + }, + [context.value] + ); + const SelectPosition = position === "popper" ? SelectPopperPosition : SelectItemAlignedPosition; + const popperContentProps = SelectPosition === SelectPopperPosition ? { + side, + sideOffset, + align, + alignOffset, + arrowPadding, + collisionBoundary, + collisionPadding, + sticky, + hideWhenDetached, + avoidCollisions + } : {}; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectContentProvider, + { + scope: __scopeSelect, + content, + viewport, + onViewportChange: setViewport, + itemRefCallback, + selectedItem, + onItemLeave: handleItemLeave, + itemTextRefCallback, + focusSelectedItem, + selectedItemText, + position, + isPositioned, + searchRef, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_focus_scope.FocusScope, + { + asChild: true, + trapped: context.open, + onMountAutoFocus: (event) => { + event.preventDefault(); + }, + onUnmountAutoFocus: (0, import_primitive.composeEventHandlers)(onCloseAutoFocus, (event) => { + context.trigger?.focus({ preventScroll: true }); + event.preventDefault(); + }), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + asChild: true, + disableOutsidePointerEvents: true, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside: (event) => event.preventDefault(), + onDismiss: () => context.onOpenChange(false), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectPosition, + { + role: "listbox", + id: context.contentId, + "data-state": context.open ? "open" : "closed", + dir: context.dir, + onContextMenu: (event) => event.preventDefault(), + ...contentProps, + ...popperContentProps, + onPlaced: () => setIsPositioned(true), + ref: composedRefs, + style: { + // flex layout so we can place the scroll buttons properly + display: "flex", + flexDirection: "column", + // reset the outline by default as the content MAY get focused + outline: "none", + ...contentProps.style + }, + onKeyDown: (0, import_primitive.composeEventHandlers)(contentProps.onKeyDown, (event) => { + const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; + if (event.key === "Tab") event.preventDefault(); + if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key); + if (["ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) { + const items = getItems().filter((item) => !item.disabled); + let candidateNodes = items.map((item) => item.ref.current); + if (["ArrowUp", "End"].includes(event.key)) { + candidateNodes = candidateNodes.slice().reverse(); + } + if (["ArrowUp", "ArrowDown"].includes(event.key)) { + const currentElement = event.target; + const currentIndex = candidateNodes.indexOf(currentElement); + candidateNodes = candidateNodes.slice(currentIndex + 1); + } + setTimeout(() => focusFirst(candidateNodes)); + event.preventDefault(); + } + }) + } + ) + } + ) + } + ) }) + } + ); + } +); +SelectContentImpl.displayName = CONTENT_IMPL_NAME; +var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition"; +var SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => { + const { __scopeSelect, onPlaced, ...popperProps } = props; + const context = useSelectContext(CONTENT_NAME, __scopeSelect); + const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect); + const [contentWrapper, setContentWrapper] = React.useState(null); + const [content, setContent] = React.useState(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setContent(node)); + const getItems = useCollection(__scopeSelect); + const shouldExpandOnScrollRef = React.useRef(false); + const shouldRepositionRef = React.useRef(true); + const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext; + const position = React.useCallback(() => { + if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) { + const triggerRect = context.trigger.getBoundingClientRect(); + const contentRect = content.getBoundingClientRect(); + const valueNodeRect = context.valueNode.getBoundingClientRect(); + const itemTextRect = selectedItemText.getBoundingClientRect(); + if (context.dir !== "rtl") { + const itemTextOffset = itemTextRect.left - contentRect.left; + const left = valueNodeRect.left - itemTextOffset; + const leftDelta = triggerRect.left - left; + const minContentWidth = triggerRect.width + leftDelta; + const contentWidth = Math.max(minContentWidth, contentRect.width); + const rightEdge = window.innerWidth - CONTENT_MARGIN; + const clampedLeft = (0, import_number.clamp)(left, [ + CONTENT_MARGIN, + // Prevents the content from going off the starting edge of the + // viewport. It may still go off the ending edge, but this can be + // controlled by the user since they may want to manage overflow in a + // specific way. + // https://github.com/radix-ui/primitives/issues/2049 + Math.max(CONTENT_MARGIN, rightEdge - contentWidth) + ]); + contentWrapper.style.minWidth = minContentWidth + "px"; + contentWrapper.style.left = clampedLeft + "px"; + } else { + const itemTextOffset = contentRect.right - itemTextRect.right; + const right = window.innerWidth - valueNodeRect.right - itemTextOffset; + const rightDelta = window.innerWidth - triggerRect.right - right; + const minContentWidth = triggerRect.width + rightDelta; + const contentWidth = Math.max(minContentWidth, contentRect.width); + const leftEdge = window.innerWidth - CONTENT_MARGIN; + const clampedRight = (0, import_number.clamp)(right, [ + CONTENT_MARGIN, + Math.max(CONTENT_MARGIN, leftEdge - contentWidth) + ]); + contentWrapper.style.minWidth = minContentWidth + "px"; + contentWrapper.style.right = clampedRight + "px"; + } + const items = getItems(); + const availableHeight = window.innerHeight - CONTENT_MARGIN * 2; + const itemsHeight = viewport.scrollHeight; + const contentStyles = window.getComputedStyle(content); + const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10); + const contentPaddingTop = parseInt(contentStyles.paddingTop, 10); + const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10); + const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10); + const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; + const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight); + const viewportStyles = window.getComputedStyle(viewport); + const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10); + const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10); + const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN; + const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle; + const selectedItemHalfHeight = selectedItem.offsetHeight / 2; + const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight; + const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle; + const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle; + const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle; + if (willAlignWithoutTopOverflow) { + const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current; + contentWrapper.style.bottom = "0px"; + const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight; + const clampedTriggerMiddleToBottomEdge = Math.max( + triggerMiddleToBottomEdge, + selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth + ); + const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge; + contentWrapper.style.height = height + "px"; + } else { + const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current; + contentWrapper.style.top = "0px"; + const clampedTopEdgeToTriggerMiddle = Math.max( + topEdgeToTriggerMiddle, + contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight + ); + const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom; + contentWrapper.style.height = height + "px"; + viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop; + } + contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`; + contentWrapper.style.minHeight = minContentHeight + "px"; + contentWrapper.style.maxHeight = availableHeight + "px"; + onPlaced?.(); + requestAnimationFrame(() => shouldExpandOnScrollRef.current = true); + } + }, [ + getItems, + context.trigger, + context.valueNode, + contentWrapper, + content, + viewport, + selectedItem, + selectedItemText, + context.dir, + onPlaced + ]); + (0, import_react_use_layout_effect.useLayoutEffect)(() => position(), [position]); + const [contentZIndex, setContentZIndex] = React.useState(); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (content) setContentZIndex(window.getComputedStyle(content).zIndex); + }, [content]); + const handleScrollButtonChange = React.useCallback( + (node) => { + if (node && shouldRepositionRef.current === true) { + position(); + focusSelectedItem?.(); + shouldRepositionRef.current = false; + } + }, + [position, focusSelectedItem] + ); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectViewportProvider, + { + scope: __scopeSelect, + contentWrapper, + shouldExpandOnScrollRef, + onScrollButtonChange: handleScrollButtonChange, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "div", + { + ref: setContentWrapper, + style: { + display: "flex", + flexDirection: "column", + position: "fixed", + zIndex: contentZIndex + }, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...popperProps, + ref: composedRefs, + style: { + // When we get the height of the content, it includes borders. If we were to set + // the height without having `boxSizing: 'border-box'` it would be too big. + boxSizing: "border-box", + // We need to ensure the content doesn't get taller than the wrapper + maxHeight: "100%", + ...popperProps.style + } + } + ) + } + ) + } + ); +}); +SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME; +var POPPER_POSITION_NAME = "SelectPopperPosition"; +var SelectPopperPosition = React.forwardRef((props, forwardedRef) => { + const { + __scopeSelect, + align = "start", + collisionPadding = CONTENT_MARGIN, + ...popperProps + } = props; + const popperScope = usePopperScope(__scopeSelect); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + PopperPrimitive.Content, + { + ...popperScope, + ...popperProps, + ref: forwardedRef, + align, + collisionPadding, + style: { + // Ensure border-box for floating-ui calculations + boxSizing: "border-box", + ...popperProps.style, + // re-namespace exposed content custom properties + ...{ + "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)", + "--radix-select-content-available-width": "var(--radix-popper-available-width)", + "--radix-select-content-available-height": "var(--radix-popper-available-height)", + "--radix-select-trigger-width": "var(--radix-popper-anchor-width)", + "--radix-select-trigger-height": "var(--radix-popper-anchor-height)" + } + } + } + ); +}); +SelectPopperPosition.displayName = POPPER_POSITION_NAME; +var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {}); +var VIEWPORT_NAME = "SelectViewport"; +var SelectViewport = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, nonce, ...viewportProps } = props; + const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect); + const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentContext.onViewportChange); + const prevScrollTopRef = React.useRef(0); + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + "style", + { + dangerouslySetInnerHTML: { + __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}` + }, + nonce + } + ), + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-radix-select-viewport": "", + role: "presentation", + ...viewportProps, + ref: composedRefs, + style: { + // we use position: 'relative' here on the `viewport` so that when we call + // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport + // (independent of the scrollUpButton). + position: "relative", + flex: 1, + // Viewport should only be scrollable in the vertical direction. + // This won't work in vertical writing modes, so we'll need to + // revisit this if/when that is supported + // https://developer.chrome.com/blog/vertical-form-controls + overflow: "hidden auto", + ...viewportProps.style + }, + onScroll: (0, import_primitive.composeEventHandlers)(viewportProps.onScroll, (event) => { + const viewport = event.currentTarget; + const { contentWrapper, shouldExpandOnScrollRef } = viewportContext; + if (shouldExpandOnScrollRef?.current && contentWrapper) { + const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop); + if (scrolledBy > 0) { + const availableHeight = window.innerHeight - CONTENT_MARGIN * 2; + const cssMinHeight = parseFloat(contentWrapper.style.minHeight); + const cssHeight = parseFloat(contentWrapper.style.height); + const prevHeight = Math.max(cssMinHeight, cssHeight); + if (prevHeight < availableHeight) { + const nextHeight = prevHeight + scrolledBy; + const clampedNextHeight = Math.min(availableHeight, nextHeight); + const heightDiff = nextHeight - clampedNextHeight; + contentWrapper.style.height = clampedNextHeight + "px"; + if (contentWrapper.style.bottom === "0px") { + viewport.scrollTop = heightDiff > 0 ? heightDiff : 0; + contentWrapper.style.justifyContent = "flex-end"; + } + } + } + } + prevScrollTopRef.current = viewport.scrollTop; + }) + } + ) }) + ] }); + } +); +SelectViewport.displayName = VIEWPORT_NAME; +var GROUP_NAME = "SelectGroup"; +var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME); +var SelectGroup = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, ...groupProps } = props; + const groupId = (0, import_react_id.useId)(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) }); + } +); +SelectGroup.displayName = GROUP_NAME; +var LABEL_NAME = "SelectLabel"; +var SelectLabel = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, ...labelProps } = props; + const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef }); + } +); +SelectLabel.displayName = LABEL_NAME; +var ITEM_NAME = "SelectItem"; +var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME); +var SelectItem = React.forwardRef( + (props, forwardedRef) => { + const { + __scopeSelect, + value, + disabled = false, + textValue: textValueProp, + ...itemProps + } = props; + const context = useSelectContext(ITEM_NAME, __scopeSelect); + const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect); + const isSelected = context.value === value; + const [textValue, setTextValue] = React.useState(textValueProp ?? ""); + const [isFocused, setIsFocused] = React.useState(false); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)( + forwardedRef, + (node) => contentContext.itemRefCallback?.(node, value, disabled) + ); + const textId = (0, import_react_id.useId)(); + const pointerTypeRef = React.useRef("touch"); + const handleSelect = () => { + if (!disabled) { + context.onValueChange(value); + context.onOpenChange(false); + } + }; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectItemContextProvider, + { + scope: __scopeSelect, + value, + disabled, + textId, + isSelected, + onItemTextChange: React.useCallback((node) => { + setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim()); + }, []), + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + Collection.ItemSlot, + { + scope: __scopeSelect, + value, + disabled, + textValue, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + role: "option", + "aria-labelledby": textId, + "data-highlighted": isFocused ? "" : void 0, + "aria-selected": isSelected && isFocused, + "data-state": isSelected ? "checked" : "unchecked", + "aria-disabled": disabled || void 0, + "data-disabled": disabled ? "" : void 0, + tabIndex: disabled ? void 0 : -1, + ...itemProps, + ref: composedRefs, + onFocus: (0, import_primitive.composeEventHandlers)(itemProps.onFocus, () => setIsFocused(true)), + onBlur: (0, import_primitive.composeEventHandlers)(itemProps.onBlur, () => setIsFocused(false)), + onClick: (0, import_primitive.composeEventHandlers)(itemProps.onClick, () => { + if (pointerTypeRef.current !== "mouse") handleSelect(); + }), + onPointerUp: (0, import_primitive.composeEventHandlers)(itemProps.onPointerUp, () => { + if (pointerTypeRef.current === "mouse") handleSelect(); + }), + onPointerDown: (0, import_primitive.composeEventHandlers)(itemProps.onPointerDown, (event) => { + pointerTypeRef.current = event.pointerType; + }), + onPointerMove: (0, import_primitive.composeEventHandlers)(itemProps.onPointerMove, (event) => { + pointerTypeRef.current = event.pointerType; + if (disabled) { + contentContext.onItemLeave?.(); + } else if (pointerTypeRef.current === "mouse") { + event.currentTarget.focus({ preventScroll: true }); + } + }), + onPointerLeave: (0, import_primitive.composeEventHandlers)(itemProps.onPointerLeave, (event) => { + if (event.currentTarget === document.activeElement) { + contentContext.onItemLeave?.(); + } + }), + onKeyDown: (0, import_primitive.composeEventHandlers)(itemProps.onKeyDown, (event) => { + const isTypingAhead = contentContext.searchRef?.current !== ""; + if (isTypingAhead && event.key === " ") return; + if (SELECTION_KEYS.includes(event.key)) handleSelect(); + if (event.key === " ") event.preventDefault(); + }) + } + ) + } + ) + } + ); + } +); +SelectItem.displayName = ITEM_NAME; +var ITEM_TEXT_NAME = "SelectItemText"; +var SelectItemText = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, className, style, ...itemTextProps } = props; + const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect); + const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect); + const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect); + const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect); + const [itemTextNode, setItemTextNode] = React.useState(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)( + forwardedRef, + (node) => setItemTextNode(node), + itemContext.onItemTextChange, + (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled) + ); + const textContent = itemTextNode?.textContent; + const nativeOption = React.useMemo( + () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), + [itemContext.disabled, itemContext.value, textContent] + ); + const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext; + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + onNativeOptionAdd(nativeOption); + return () => onNativeOptionRemove(nativeOption); + }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }), + itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren && !shouldShowPlaceholder(context.value) ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null + ] }); + } +); +SelectItemText.displayName = ITEM_TEXT_NAME; +var ITEM_INDICATOR_NAME = "SelectItemIndicator"; +var SelectItemIndicator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, ...itemIndicatorProps } = props; + const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect); + return itemContext.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null; + } +); +SelectItemIndicator.displayName = ITEM_INDICATOR_NAME; +var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton"; +var SelectScrollUpButton = React.forwardRef((props, forwardedRef) => { + const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect); + const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect); + const [canScrollUp, setCanScrollUp] = React.useState(false); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, viewportContext.onScrollButtonChange); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (contentContext.viewport && contentContext.isPositioned) { + let handleScroll2 = function() { + const canScrollUp2 = viewport.scrollTop > 0; + setCanScrollUp(canScrollUp2); + }; + var handleScroll = handleScroll2; + const viewport = contentContext.viewport; + handleScroll2(); + viewport.addEventListener("scroll", handleScroll2); + return () => viewport.removeEventListener("scroll", handleScroll2); + } + }, [contentContext.viewport, contentContext.isPositioned]); + return canScrollUp ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectScrollButtonImpl, + { + ...props, + ref: composedRefs, + onAutoScroll: () => { + const { viewport, selectedItem } = contentContext; + if (viewport && selectedItem) { + viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight; + } + } + } + ) : null; +}); +SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME; +var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton"; +var SelectScrollDownButton = React.forwardRef((props, forwardedRef) => { + const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect); + const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect); + const [canScrollDown, setCanScrollDown] = React.useState(false); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, viewportContext.onScrollButtonChange); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (contentContext.viewport && contentContext.isPositioned) { + let handleScroll2 = function() { + const maxScroll = viewport.scrollHeight - viewport.clientHeight; + const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll; + setCanScrollDown(canScrollDown2); + }; + var handleScroll = handleScroll2; + const viewport = contentContext.viewport; + handleScroll2(); + viewport.addEventListener("scroll", handleScroll2); + return () => viewport.removeEventListener("scroll", handleScroll2); + } + }, [contentContext.viewport, contentContext.isPositioned]); + return canScrollDown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + SelectScrollButtonImpl, + { + ...props, + ref: composedRefs, + onAutoScroll: () => { + const { viewport, selectedItem } = contentContext; + if (viewport && selectedItem) { + viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight; + } + } + } + ) : null; +}); +SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME; +var SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => { + const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props; + const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect); + const autoScrollTimerRef = React.useRef(null); + const getItems = useCollection(__scopeSelect); + const clearAutoScrollTimer = React.useCallback(() => { + if (autoScrollTimerRef.current !== null) { + window.clearInterval(autoScrollTimerRef.current); + autoScrollTimerRef.current = null; + } + }, []); + React.useEffect(() => { + return () => clearAutoScrollTimer(); + }, [clearAutoScrollTimer]); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + const activeItem = getItems().find((item) => item.ref.current === document.activeElement); + activeItem?.ref.current?.scrollIntoView({ block: "nearest" }); + }, [getItems]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "aria-hidden": true, + ...scrollIndicatorProps, + ref: forwardedRef, + style: { flexShrink: 0, ...scrollIndicatorProps.style }, + onPointerDown: (0, import_primitive.composeEventHandlers)(scrollIndicatorProps.onPointerDown, () => { + if (autoScrollTimerRef.current === null) { + autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50); + } + }), + onPointerMove: (0, import_primitive.composeEventHandlers)(scrollIndicatorProps.onPointerMove, () => { + contentContext.onItemLeave?.(); + if (autoScrollTimerRef.current === null) { + autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50); + } + }), + onPointerLeave: (0, import_primitive.composeEventHandlers)(scrollIndicatorProps.onPointerLeave, () => { + clearAutoScrollTimer(); + }) + } + ); +}); +var SEPARATOR_NAME = "SelectSeparator"; +var SelectSeparator = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, ...separatorProps } = props; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef }); + } +); +SelectSeparator.displayName = SEPARATOR_NAME; +var ARROW_NAME = "SelectArrow"; +var SelectArrow = React.forwardRef( + (props, forwardedRef) => { + const { __scopeSelect, ...arrowProps } = props; + const popperScope = usePopperScope(__scopeSelect); + const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect); + return contentContext.position === "popper" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null; + } +); +SelectArrow.displayName = ARROW_NAME; +var BUBBLE_INPUT_NAME = "SelectBubbleInput"; +var SelectBubbleInput = React.forwardRef( + ({ __scopeSelect, ...props }, forwardedRef) => { + const context = useSelectContext(BUBBLE_INPUT_NAME, __scopeSelect); + const { value, onValueChange, required, disabled, name, autoComplete, form } = context; + const { nativeOptions, nativeSelectKey } = context; + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + const selectValue = value ?? ""; + const prevValue = (0, import_react_use_previous.usePrevious)(selectValue); + const hasEmptyValueOption = Array.from(nativeOptions).some( + (option) => (option.props.value ?? "") === "" + ); + React.useEffect(() => { + const select = ref.current; + if (!select) return; + const selectProto = window.HTMLSelectElement.prototype; + const descriptor = Object.getOwnPropertyDescriptor( + selectProto, + "value" + ); + const setValue = descriptor.set; + if (prevValue !== selectValue && setValue) { + const event = new Event("change", { bubbles: true }); + setValue.call(select, selectValue); + select.dispatchEvent(event); + } + }, [prevValue, selectValue]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)( + import_react_primitive.Primitive.select, + { + "aria-hidden": true, + required, + tabIndex: -1, + name, + autoComplete, + disabled, + form, + onChange: (event) => onValueChange(event.target.value), + ...props, + style: { ...import_react_visually_hidden.VISUALLY_HIDDEN_STYLES, ...props.style }, + ref: composedRefs, + defaultValue: selectValue, + children: [ + shouldShowPlaceholder(value) && !hasEmptyValueOption ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, + Array.from(nativeOptions) + ] + }, + nativeSelectKey + ); + } +); +SelectBubbleInput.displayName = BUBBLE_INPUT_NAME; +function isFunction(value) { + return typeof value === "function"; +} +function shouldShowPlaceholder(value) { + return value === "" || value === void 0; +} +function useTypeaheadSearch(onSearchChange) { + const handleSearchChange = (0, import_react_use_callback_ref.useCallbackRef)(onSearchChange); + const searchRef = React.useRef(""); + const timerRef = React.useRef(0); + const handleTypeaheadSearch = React.useCallback( + (key) => { + const search = searchRef.current + key; + handleSearchChange(search); + (function updateSearch(value) { + searchRef.current = value; + window.clearTimeout(timerRef.current); + if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3); + })(search); + }, + [handleSearchChange] + ); + const resetTypeahead = React.useCallback(() => { + searchRef.current = ""; + window.clearTimeout(timerRef.current); + }, []); + React.useEffect(() => { + return () => window.clearTimeout(timerRef.current); + }, []); + return [searchRef, handleTypeaheadSearch, resetTypeahead]; +} +function findNextItem(items, search, currentItem) { + const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); + const normalizedSearch = isRepeated ? search[0] : search; + const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1; + let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0)); + const excludeCurrentItem = normalizedSearch.length === 1; + if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem); + const nextItem = wrappedItems.find( + (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase()) + ); + return nextItem !== currentItem ? nextItem : void 0; +} +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +//# sourceMappingURL=index.js.map diff --git a/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.js.map b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2649d23bebdb5591eae9e14f1d3c13746797d85a --- /dev/null +++ b/loan-advisor-chatgpt-app/node_modules/@radix-ui/react-select/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/select.tsx"], + "sourcesContent": ["'use client';\nexport {\n createSelectScope,\n //\n Select,\n SelectProvider as unstable_SelectProvider,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPortal,\n SelectContent,\n SelectViewport,\n SelectGroup,\n SelectLabel,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n SelectSeparator,\n SelectArrow,\n SelectBubbleInput as unstable_SelectBubbleInput,\n //\n Root,\n Provider as unstable_Provider,\n Trigger,\n Value,\n Icon,\n Portal,\n Content,\n Viewport,\n Group,\n Label,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpButton,\n ScrollDownButton,\n Separator,\n Arrow,\n BubbleInput as unstable_BubbleInput,\n} from './select';\nexport type {\n SelectProps,\n SelectProviderProps as unstable_SelectProviderProps,\n SelectSharedProps,\n SelectTriggerProps,\n SelectValueProps,\n SelectIconProps,\n SelectPortalProps,\n SelectContentProps,\n SelectViewportProps,\n SelectGroupProps,\n SelectLabelProps,\n SelectItemProps,\n SelectItemTextProps,\n SelectItemIndicatorProps,\n SelectScrollUpButtonProps,\n SelectScrollDownButtonProps,\n SelectSeparatorProps,\n SelectArrowProps,\n SelectBubbleInputProps as unstable_SelectBubbleInputProps,\n} from './select';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { VISUALLY_HIDDEN_STYLES } from '@radix-ui/react-visually-hidden';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];\nconst SELECTION_KEYS = [' ', 'Enter'];\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = 'Select';\n\ntype ItemData = { value: string; disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n SelectItemElement,\n ItemData\n>(SELECT_NAME);\n\ntype ScopedProps

= P & { __scopeSelect?: Scope };\nconst [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype SelectContextValue = {\n trigger: SelectTriggerElement | null;\n onTriggerChange(node: SelectTriggerElement | null): void;\n valueNode: SelectValueElement | null;\n onValueNodeChange(node: SelectValueElement): void;\n valueNodeHasChildren: boolean;\n onValueNodeHasChildrenChange(hasChildren: boolean): void;\n contentId: string;\n value: string | undefined;\n onValueChange(value: string): void;\n open: boolean;\n required?: boolean;\n onOpenChange(open: boolean): void;\n dir: SelectProps['dir'];\n triggerPointerDownPosRef: React.MutableRefObject<{ x: number; y: number } | null>;\n disabled?: boolean;\n name?: string;\n autoComplete?: string;\n form?: string;\n nativeOptions: Set;\n nativeSelectKey: string;\n isFormControl: boolean;\n};\n\nconst [SelectProviderImpl, useSelectContext] = createSelectContext(SELECT_NAME);\n\ntype NativeOption = React.ReactElement>;\n\ntype SelectNativeOptionsContextValue = {\n onNativeOptionAdd(option: NativeOption): void;\n onNativeOptionRemove(option: NativeOption): void;\n};\nconst [SelectNativeOptionsProvider, useSelectNativeOptionsContext] =\n createSelectContext(SELECT_NAME);\n\ninterface ControlledClearableSelectProps {\n value: string | undefined;\n defaultValue?: never;\n onValueChange: (value: string | undefined) => void;\n}\n\ninterface ControlledUnclearableSelectProps {\n value: string;\n defaultValue?: never;\n onValueChange: (value: string) => void;\n}\n\ninterface UncontrolledSelectProps {\n value?: never;\n defaultValue?: string;\n onValueChange?: {\n (value: string): void;\n (value: string | undefined): void;\n };\n}\n\ntype SelectControlProps =\n | ControlledClearableSelectProps\n | ControlledUnclearableSelectProps\n | UncontrolledSelectProps;\n\nexport interface SelectSharedProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n name?: string;\n autoComplete?: string;\n disabled?: boolean;\n required?: boolean;\n form?: string;\n}\n\n// TODO: Should improve typing somewhat, but this would be a breaking change.\n// Consider using in the next major version (along with some testing to be sure\n// it works as expected and doesn't cause problems)\ntype _FutureSelectProps = SelectSharedProps & SelectControlProps;\n\ntype SelectProps = SelectSharedProps & {\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SelectProvider\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROVIDER_NAME = 'SelectProvider';\n\ninterface SelectProviderProps extends SelectSharedProps {\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n}\n\nfunction SelectProvider(props: ScopedProps) {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form,\n // @ts-expect-error internal render prop used by `Select` to compose its default parts\n internal_do_not_use_render,\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState(null);\n const [valueNode, setValueNode] = React.useState(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SELECT_NAME,\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange as any,\n caller: SELECT_NAME,\n });\n const triggerPointerDownPosRef = React.useRef<{ x: number; y: number } | null>(null);\n\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = trigger ? !!form || !!trigger.closest('form') : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(new Set());\n const contentId = useId();\n\n // The native `select` only associates the correct default value if the corresponding\n // `option` is rendered as a child **at the same time** as itself.\n // Because it might take a few renders for our items to gather the information to build\n // the native `option`(s), we generate a key on the `select` to make sure React re-builds it\n // each time the options change.\n const nativeSelectKey = Array.from(nativeOptionsSet)\n .map((option) => option.props.value)\n .join(';');\n\n const handleNativeOptionAdd = React.useCallback((option: NativeOption) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, []);\n\n const handleNativeOptionRemove = React.useCallback((option: NativeOption) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, []);\n\n const context: SelectContextValue = {\n required,\n trigger,\n onTriggerChange: setTrigger,\n valueNode,\n onValueNodeChange: setValueNode,\n valueNodeHasChildren,\n onValueNodeHasChildrenChange: setValueNodeHasChildren,\n contentId,\n value,\n onValueChange: setValue,\n open,\n onOpenChange: setOpen,\n dir: direction,\n triggerPointerDownPosRef,\n disabled,\n name,\n autoComplete,\n form,\n nativeOptions: nativeOptionsSet,\n nativeSelectKey,\n isFormControl,\n };\n\n return (\n \n \n \n \n {isFunction(internal_do_not_use_render)\n ? internal_do_not_use_render(context)\n : children}\n \n \n \n \n );\n}\n\nSelectProvider.displayName = PROVIDER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nconst Select: React.FC = (props: ScopedProps) => {\n const { __scopeSelect, children, ...providerProps } = props;\n return (\n (\n <>\n {children}\n {isFormControl ? (\n \n ) : null}\n \n )}\n />\n );\n};\n\nSelect.displayName = SELECT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'SelectTrigger';\n\ntype SelectTriggerElement = React.ComponentRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface SelectTriggerProps extends PrimitiveButtonProps {}\n\nconst SelectTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef('touch');\n\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== undefined) {\n context.onValueChange(nextItem.value);\n }\n });\n\n const handleOpen = (pointerEvent?: React.MouseEvent | React.PointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n // reset typeahead when we open\n resetTypeahead();\n }\n\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY),\n };\n }\n };\n\n return (\n \n {\n // Whilst browsers generally have no issue focusing the trigger when clicking\n // on a label, Safari seems to struggle with the fact that there's no `onClick`.\n // We force `focus` in this case. Note: this doesn't create any other side-effect\n // because we are preventing default in `onPointerDown` so effectively\n // this only runs for a label \"click\"\n event.currentTarget.focus();\n\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') {\n handleOpen(event);\n }\n })}\n onPointerDown={composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n\n // prevent implicit pointer capture\n // https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click); also not for touch\n // devices because that would open the menu on scroll. (pen devices behave as touch on iOS).\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === 'mouse') {\n handleOpen(event);\n // prevent trigger from stealing focus from the active item after opening.\n event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== '';\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === ' ') return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })}\n />\n \n );\n },\n);\n\nSelectTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectValue\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALUE_NAME = 'SelectValue';\n\ntype SelectValueElement = React.ComponentRef;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef;\ninterface SelectValueProps extends Omit {\n placeholder?: React.ReactNode;\n}\n\nconst SelectValue = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, children, placeholder = '', ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== undefined;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n\n const showPlaceholder = shouldShowPlaceholder(context.value);\n\n return (\n \n \n {showPlaceholder ? placeholder : children}\n \n \n );\n },\n);\n\nSelectValue.displayName = VALUE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectIcon\n * -----------------------------------------------------------------------------------------------*/\n\nconst ICON_NAME = 'SelectIcon';\n\ntype SelectIconElement = React.ComponentRef;\ninterface SelectIconProps extends PrimitiveSpanProps {}\n\nconst SelectIcon = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return (\n \n {children || '\u25BC'}\n \n );\n },\n);\n\nSelectIcon.displayName = ICON_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'SelectPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createSelectContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface SelectPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst SelectPortal: React.FC = (props: ScopedProps) => {\n const { __scopeSelect, forceMount, ...portalProps } = props;\n return (\n \n \n \n );\n};\n\nSelectPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'SelectContent';\n\ntype SelectContentElement = SelectContentImplElement;\ninterface SelectContentProps extends SelectContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst SelectContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeSelect);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState();\n\n // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n\n // The `Select` items collect their data (e.g. to build the native `option`s\n // and to display the selected value) by mounting their children. We keep\n // them mounted in a detached fragment whenever the content isn't present so\n // that this data stays up to date even while the select is closed (or\n // animating out).\n return (\n \n {({ present }) =>\n present ? (\n \n ) : (\n \n )\n }\n \n );\n },\n);\n\nSelectContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContentFragment\n * -----------------------------------------------------------------------------------------------*/\n\ntype SelectContentFragmentElement = React.ComponentRef;\ninterface SelectContentFragmentProps extends SelectContentImplProps {\n fragment?: DocumentFragment;\n}\n\nconst SelectContentFragment = React.forwardRef<\n SelectContentFragmentElement,\n SelectContentFragmentProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, children, fragment } = props;\n if (!fragment) return null;\n\n return ReactDOM.createPortal(\n \n \n

{children}
\n \n ,\n fragment,\n );\n});\n\nSelectContentFragment.displayName = 'SelectContentFragment';\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContentImpl\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_MARGIN = 10;\n\ntype SelectContentContextValue = {\n content?: SelectContentElement | null;\n viewport?: SelectViewportElement | null;\n onViewportChange?: (node: SelectViewportElement | null) => void;\n itemRefCallback?: (node: SelectItemElement | null, value: string, disabled: boolean) => void;\n selectedItem?: SelectItemElement | null;\n onItemLeave?: () => void;\n itemTextRefCallback?: (\n node: SelectItemTextElement | null,\n value: string,\n disabled: boolean,\n ) => void;\n focusSelectedItem?: () => void;\n selectedItemText?: SelectItemTextElement | null;\n position?: SelectContentProps['position'];\n isPositioned?: boolean;\n searchRef?: React.RefObject;\n};\n\nconst [SelectContentProvider, useSelectContentContext] =\n createSelectContext(CONTENT_NAME);\n\nconst CONTENT_IMPL_NAME = 'SelectContentImpl';\n\ntype SelectContentImplElement = SelectPopperPositionElement | SelectItemAlignedPositionElement;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\n\ntype SelectPopperPrivateProps = { onPlaced?: PopperContentProps['onPlaced'] };\n\ninterface SelectContentImplProps\n extends\n Omit,\n Omit {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n\n position?: 'item-aligned' | 'popper';\n}\n\nconst Slot = createSlot('SelectContent.RemoveScroll');\n\nconst SelectContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect } = props;\n const {\n position = 'item-aligned',\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState(null);\n const [selectedItemText, setSelectedItemText] = React.useState(\n null,\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n\n // Make sure the whole tree has focus guards as our `Select` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const focusFirst = React.useCallback(\n (candidates: Array) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: 'nearest' });\n // viewport might have padding so scroll to its edges when focusing first/last items.\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport],\n );\n\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content],\n );\n\n // Since this is not dependent on layout, we want to ensure this runs at the same time as\n // other effects across components. Hence why we don't call `focusSelectedItem` inside `position`.\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n\n // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`\n // and close on `pointerup` outside.\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n\n const handlePointerMove = (event: PointerEvent) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0)),\n };\n };\n const handlePointerUp = (event: PointerEvent) => {\n // If the pointer hasn't moved by a certain threshold then we prevent selecting item on `pointerup`.\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n // otherwise, if the event was outside the content, close.\n // `event.target` is retargeted to the shadow host for this\n // document-level listener, so use `composedPath()` which pierces\n // open shadow roots to reliably detect events inside the content.\n if (!event.composedPath().includes(content)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener('pointermove', handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener('pointermove', handlePointerMove);\n document.addEventListener('pointerup', handlePointerUp, { capture: true, once: true });\n }\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n document.removeEventListener('pointerup', handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener('blur', close);\n window.addEventListener('resize', close);\n return () => {\n window.removeEventListener('blur', close);\n window.removeEventListener('resize', close);\n };\n }, [onOpenChange]);\n\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => nextItem.ref.current?.focus());\n }\n });\n\n const itemRefCallback = React.useCallback(\n (node: SelectItemElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value],\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node: SelectItemTextElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value],\n );\n\n const SelectPosition = position === 'popper' ? SelectPopperPosition : SelectItemAlignedPosition;\n\n // Silently ignore props that are not supported by `SelectItemAlignedPosition`\n const popperContentProps =\n SelectPosition === SelectPopperPosition\n ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n }\n : {};\n\n return (\n \n \n {\n // we prevent open autofocus because we manually focus the selected item\n event.preventDefault();\n }}\n onUnmountAutoFocus={composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n })}\n >\n event.preventDefault()}\n onDismiss={() => context.onOpenChange(false)}\n >\n event.preventDefault()}\n {...contentProps}\n {...popperContentProps}\n onPlaced={() => setIsPositioned(true)}\n ref={composedRefs}\n style={{\n // flex layout so we can place the scroll buttons properly\n display: 'flex',\n flexDirection: 'column',\n // reset the outline by default as the content MAY get focused\n outline: 'none',\n ...contentProps.style,\n }}\n onKeyDown={composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n\n // select should not be navigated using tab key so we prevent it\n if (event.key === 'Tab') event.preventDefault();\n\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n\n if (['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (['ArrowUp', 'End'].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if (['ArrowUp', 'ArrowDown'].includes(event.key)) {\n const currentElement = event.target as SelectItemElement;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n event.preventDefault();\n }\n })}\n />\n \n \n \n \n );\n },\n);\n\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemAlignedPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_ALIGNED_POSITION_NAME = 'SelectItemAlignedPosition';\n\ntype SelectItemAlignedPositionElement = React.ComponentRef;\ninterface SelectItemAlignedPositionProps extends PrimitiveDivProps, SelectPopperPrivateProps {}\n\nconst SelectItemAlignedPosition = React.forwardRef<\n SelectItemAlignedPositionElement,\n SelectItemAlignedPositionProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (\n context.trigger &&\n context.valueNode &&\n contentWrapper &&\n content &&\n viewport &&\n selectedItem &&\n selectedItemText\n ) {\n const triggerRect = context.trigger.getBoundingClientRect();\n\n // -----------------------------------------------------------------------------------------\n // Horizontal positioning\n // -----------------------------------------------------------------------------------------\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n\n if (context.dir !== 'rtl') {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth),\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + 'px';\n contentWrapper.style.left = clampedLeft + 'px';\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth),\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + 'px';\n contentWrapper.style.right = clampedRight + 'px';\n }\n\n // -----------------------------------------------------------------------------------------\n // Vertical positioning\n // -----------------------------------------------------------------------------------------\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n\n if (willAlignWithoutTopOverflow) {\n const isLastItem =\n items.length > 0 && selectedItem === items[items.length - 1]!.ref.current;\n contentWrapper.style.bottom = 0 + 'px';\n const viewportOffsetBottom =\n content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight +\n // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) +\n viewportOffsetBottom +\n contentBorderBottomWidth,\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + 'px';\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0]!.ref.current;\n contentWrapper.style.top = 0 + 'px';\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth +\n viewport.offsetTop +\n // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) +\n selectedItemHalfHeight,\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + 'px';\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + 'px';\n contentWrapper.style.maxHeight = availableHeight + 'px';\n // -----------------------------------------------------------------------------------------\n\n onPlaced?.();\n\n // we don't want the initial scroll position adjustment to trigger \"expand on scroll\"\n // so we explicitly turn it on only after they've registered.\n requestAnimationFrame(() => (shouldExpandOnScrollRef.current = true));\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced,\n ]);\n\n useLayoutEffect(() => position(), [position]);\n\n // copy z-index from content to wrapper\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n // When the viewport becomes scrollable at the top, the scroll up button will mount.\n // Because it is part of the normal flow, it will push down the viewport, thus throwing our\n // trigger => selectedItem alignment off by the amount the viewport was pushed down.\n // We wait for this to happen and then re-run the positining logic one more time to account for it.\n const handleScrollButtonChange = React.useCallback(\n (node: SelectScrollButtonImplElement | null) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem],\n );\n\n return (\n \n \n \n \n \n );\n});\n\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPopperPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_POSITION_NAME = 'SelectPopperPosition';\n\ntype SelectPopperPositionElement = React.ComponentRef;\ntype PopperContentProps = React.ComponentPropsWithoutRef;\ninterface SelectPopperPositionProps extends PopperContentProps, SelectPopperPrivateProps {}\n\nconst SelectPopperPosition = React.forwardRef<\n SelectPopperPositionElement,\n SelectPopperPositionProps\n>((props: ScopedProps, forwardedRef) => {\n const {\n __scopeSelect,\n align = 'start',\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n\n return (\n \n );\n});\n\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectViewport\n * -----------------------------------------------------------------------------------------------*/\n\ntype SelectViewportContextValue = {\n contentWrapper?: HTMLDivElement | null;\n shouldExpandOnScrollRef?: React.RefObject;\n onScrollButtonChange?: (node: SelectScrollButtonImplElement | null) => void;\n};\n\nconst [SelectViewportProvider, useSelectViewportContext] =\n createSelectContext(CONTENT_NAME, {});\n\nconst VIEWPORT_NAME = 'SelectViewport';\n\ntype SelectViewportElement = React.ComponentRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface SelectViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst SelectViewport = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n \n \n {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n\n contentWrapper.style.height = clampedNextHeight + 'px';\n if (contentWrapper.style.bottom === '0px') {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n // ensure the content stays pinned to the bottom\n contentWrapper.style.justifyContent = 'flex-end';\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })}\n />\n \n \n );\n },\n);\n\nSelectViewport.displayName = VIEWPORT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'SelectGroup';\n\ntype SelectGroupContextValue = { id: string };\n\nconst [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext(GROUP_NAME);\n\ntype SelectGroupElement = React.ComponentRef;\ninterface SelectGroupProps extends PrimitiveDivProps {}\n\nconst SelectGroup = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return (\n \n \n \n );\n },\n);\n\nSelectGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'SelectLabel';\n\ntype SelectLabelElement = React.ComponentRef;\ninterface SelectLabelProps extends PrimitiveDivProps {}\n\nconst SelectLabel = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return ;\n },\n);\n\nSelectLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'SelectItem';\n\ntype SelectItemContextValue = {\n value: string;\n disabled: boolean;\n textId: string;\n isSelected: boolean;\n onItemTextChange(node: SelectItemTextElement | null): void;\n};\n\nconst [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext(ITEM_NAME);\n\ntype SelectItemElement = React.ComponentRef;\ninterface SelectItemProps extends PrimitiveDivProps {\n value: string;\n disabled?: boolean;\n textValue?: string;\n}\n\nconst SelectItem = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? '');\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) =>\n contentContext.itemRefCallback?.(node, value, disabled),\n );\n const textId = useId();\n const pointerTypeRef = React.useRef('touch');\n\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n\n return (\n {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim());\n }, [])}\n >\n \n setIsFocused(true))}\n onBlur={composeEventHandlers(itemProps.onBlur, () => setIsFocused(false))}\n onClick={composeEventHandlers(itemProps.onClick, () => {\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') handleSelect();\n })}\n onPointerUp={composeEventHandlers(itemProps.onPointerUp, () => {\n // Using a mouse you should be able to do pointer down, move through\n // the list, and release the pointer over the item to select it.\n if (pointerTypeRef.current === 'mouse') handleSelect();\n })}\n onPointerDown={composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n })}\n onPointerMove={composeEventHandlers(itemProps.onPointerMove, (event) => {\n // Remember pointer type when sliding over to this item from another one\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === 'mouse') {\n // even though safari doesn't support this option, it's acceptable\n // as it only means it might scroll a few pixels when using the pointer.\n event.currentTarget.focus({ preventScroll: true });\n }\n })}\n onPointerLeave={composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n })}\n onKeyDown={composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== '';\n if (isTypingAhead && event.key === ' ') return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n // prevent page scroll if using the space key to select an item\n if (event.key === ' ') event.preventDefault();\n })}\n />\n \n \n );\n },\n);\n\nSelectItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemText\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_TEXT_NAME = 'SelectItemText';\n\ntype SelectItemTextElement = React.ComponentRef;\ninterface SelectItemTextProps extends PrimitiveSpanProps {}\n\nconst SelectItemText = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled),\n );\n\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => (\n \n ),\n [itemContext.disabled, itemContext.value, textContent],\n );\n\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n\n return (\n <>\n \n\n {/* Portal the select item text into the trigger value node.\n When the value is empty we show the placeholder instead, so a\n selected \"clear\" item (empty value) must not portal its text. */}\n {itemContext.isSelected &&\n context.valueNode &&\n !context.valueNodeHasChildren &&\n !shouldShowPlaceholder(context.value)\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode)\n : null}\n \n );\n },\n);\n\nSelectItemText.displayName = ITEM_TEXT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'SelectItemIndicator';\n\ntype SelectItemIndicatorElement = React.ComponentRef;\ninterface SelectItemIndicatorProps extends PrimitiveSpanProps {}\n\nconst SelectItemIndicator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? (\n \n ) : null;\n },\n);\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';\n\ntype SelectScrollUpButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollUpButtonProps extends Omit {}\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>((props: ScopedProps, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const canScrollUp = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp);\n }\n handleScroll();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollUp ? (\n {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';\n\ntype SelectScrollDownButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollDownButtonProps extends Omit {}\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>((props: ScopedProps, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n // we use Math.ceil here because if the UI is zoomed-in\n // `scrollTop` is not always reported as an integer\n const canScrollDown = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown);\n }\n handleScroll();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollDown ? (\n {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\n\ntype SelectScrollButtonImplElement = React.ComponentRef;\ninterface SelectScrollButtonImplProps extends PrimitiveDivProps {\n onAutoScroll(): void;\n}\n\nconst SelectScrollButtonImpl = React.forwardRef<\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps\n>((props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext('SelectScrollButton', __scopeSelect);\n const autoScrollTimerRef = React.useRef(null);\n const getItems = useCollection(__scopeSelect);\n\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n\n // When the viewport becomes scrollable on either side, the relevant scroll button will mount.\n // Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)\n // the viewport, potentially causing the active item to now be partially out of view.\n // We re-run the `scrollIntoView` logic to make sure it stays within the viewport.\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: 'nearest' });\n }, [getItems]);\n\n return (\n {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n })}\n onPointerMove={composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n })}\n onPointerLeave={composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })}\n />\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * SelectSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'SelectSeparator';\n\ntype SelectSeparatorElement = React.ComponentRef;\ninterface SelectSeparatorProps extends PrimitiveDivProps {}\n\nconst SelectSeparator = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return ;\n },\n);\n\nSelectSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'SelectArrow';\n\ntype SelectArrowElement = React.ComponentRef;\ntype PopperArrowProps = React.ComponentPropsWithoutRef;\ninterface SelectArrowProps extends PopperArrowProps {}\n\nconst SelectArrow = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return contentContext.position === 'popper' ? (\n \n ) : null;\n },\n);\n\nSelectArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'SelectBubbleInput';\n\ntype SelectBubbleInputElement = React.ComponentRef;\ntype PrimitiveSelectProps = React.ComponentPropsWithoutRef;\ninterface SelectBubbleInputProps extends Omit {}\n\nconst SelectBubbleInput = React.forwardRef(\n ({ __scopeSelect, ...props }: ScopedProps, forwardedRef) => {\n const context = useSelectContext(BUBBLE_INPUT_NAME, __scopeSelect);\n const { value, onValueChange, required, disabled, name, autoComplete, form } = context;\n const { nativeOptions, nativeSelectKey } = context;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const selectValue = value ?? '';\n const prevValue = usePrevious(selectValue);\n\n // A consumer may render a `Select.Item` with an empty value to act as a\n // \"clear\" option. In that case it already provides a native `