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,GACrC,GAAKA,MAAAA,IAAAA,EAAQwN,WAAW,KAAM,OAAO4b,EAAAA,EAAAA,MAErC,MAAM8e,EAAgBpB,EAAY9mC,GAElC,OAAI0wB,EAAAA,EAAAA,SAAwBwX,EAActsC,eAAuBwtB,EAAAA,EAAAA,OACpC,IAAzB8e,EAAcnwC,OAAqBqxB,EAAAA,EAAAA,MAEhCA,EAAAA,EAAAA,QAMT,IAAI+e,EACGvlC,eAAeovB,IACpB,QAAqC,IAA1B15B,OAAOK,eAAgC,CAChD,MAAMs5B,QAAiB,+BAGvB,OAFAkW,EAAyBlW,EAASwJ,QAClCnjC,OAAOK,eAAiBwvC,EACjBA,GAIJvlC,eAAewlC,IACpB,OAAQjnC,UAAUknC,aAAgBlnC,UAAUknC,MAAMC,YAAe,I","sources":["webpack://@finviz/website/./js/app/header/market-badge.tsx","webpack://@finviz/website/./js/app/header/time.tsx","webpack://@finviz/website/./js/app/header/utils.ts","webpack://@finviz/website/./js/app/queryString.ts","webpack://@finviz/website/./js/app/shared/cookie.ts","webpack://@finviz/website/./js/app/shared/hover-chart.ts","webpack://@finviz/website/./js/app/shared/isMobile.ts","webpack://@finviz/website/./js/app/shared/ticker-sanitizer.ts","webpack://@finviz/website/./js/app/shared/utils.ts","webpack://@finviz/website/./js/main/components/box.tsx","webpack://@finviz/website/./js/main/components/button-group/button-group.tsx","webpack://@finviz/website/./js/main/components/button.tsx","webpack://@finviz/website/./js/main/components/checkbox.tsx","webpack://@finviz/website/./js/main/components/color-picker/draggable.tsx","webpack://@finviz/website/./js/main/components/color-picker/pointer.tsx","webpack://@finviz/website/./js/main/components/color-picker/util.ts","webpack://@finviz/website/./js/main/components/color-picker/alpha.tsx","webpack://@finviz/website/./js/main/components/color-picker/color-palette.tsx","webpack://@finviz/website/./js/main/components/color-picker/hue-saturation.tsx","webpack://@finviz/website/./js/main/components/color-picker/lightness.tsx","webpack://@finviz/website/./js/main/components/color-picker/color-preview.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker-input.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker-button.tsx","webpack://@finviz/website/./js/main/components/constants.ts","webpack://@finviz/website/./js/main/components/copy-to-clipboard/copy-to-clipboard.tsx","webpack://@finviz/website/./js/main/components/date-picker/index.tsx","webpack://@finviz/website/./js/main/components/delayed.tsx","webpack://@finviz/website/./js/main/components/dialog/hooks.ts","webpack://@finviz/website/./js/main/components/dialog/dialog-box.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-overlay.tsx","webpack://@finviz/website/./js/main/components/dialog/utils.ts","webpack://@finviz/website/./js/main/components/dialog/dialog.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-body.tsx","webpack://@finviz/website/./js/main/components/dialog/confirmation-dialog.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-trigger.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-footer.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-header.tsx","webpack://@finviz/website/./js/main/components/dropdown/hooks.ts","webpack://@finviz/website/./js/main/components/dropdown/dropdown.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-bar.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-item.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-separator.tsx","webpack://@finviz/website/./js/main/components/dropdown/more-button.tsx","webpack://@finviz/website/./js/main/components/icon/icon.tsx","webpack://@finviz/website/./js/main/components/icon/index.tsx","webpack://@finviz/website/./js/main/components/icon/add.tsx","webpack://@finviz/website/./js/main/components/icon/calendar.tsx","webpack://@finviz/website/./js/main/components/icon/candle-bar-basic.tsx","webpack://@finviz/website/./js/main/components/icon/candle-bar-heikin-ashi.tsx","webpack://@finviz/website/./js/main/components/icon/candle-bar-hollow.tsx","webpack://@finviz/website/./js/main/components/icon/caret-down.tsx","webpack://@finviz/website/./js/main/components/icon/caret-right.tsx","webpack://@finviz/website/./js/main/components/icon/caretVertical.tsx","webpack://@finviz/website/./js/main/components/icon/chart-bar.tsx","webpack://@finviz/website/./js/main/components/icon/chart-bubble.tsx","webpack://@finviz/website/./js/main/components/icon/chart-treemap.tsx","webpack://@finviz/website/./js/main/components/icon/chevron-down.tsx","webpack://@finviz/website/./js/main/components/icon/chevron-right.tsx","webpack://@finviz/website/./js/main/components/icon/menu-close.tsx","webpack://@finviz/website/./js/main/components/icon/dark-mode.tsx","webpack://@finviz/website/./js/main/components/icon/done.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-action-delete.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-autosave-off.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-autosave-on.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-autosave-saving.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-drawing-mode.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-drawing-mode-active.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-hide.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-lock.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-preserve-drawings.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-preserve-drawings-active.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-show.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-unlock.tsx","webpack://@finviz/website/./js/main/components/icon/exit-fullscreen.tsx","webpack://@finviz/website/./js/main/components/icon/flash.tsx","webpack://@finviz/website/./js/main/components/icon/fullscreen.tsx","webpack://@finviz/website/./js/main/components/icon/gift.tsx","webpack://@finviz/website/./js/main/components/icon/hamburger.tsx","webpack://@finviz/website/./js/main/components/icon/help.tsx","webpack://@finviz/website/./js/main/components/icon/idea.tsx","webpack://@finviz/website/./js/main/components/icon/idea-load.tsx","webpack://@finviz/website/./js/main/components/icon/idea-save.tsx","webpack://@finviz/website/./js/main/components/icon/interval.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1h1v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1h2v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1h3v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1l2r.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1t2b.tsx","webpack://@finviz/website/./js/main/components/icon/layout-2h1v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-2h2v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-3h1v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-3h2v.tsx","webpack://@finviz/website/./js/main/components/icon/light-mode.tsx","webpack://@finviz/website/./js/main/components/icon/line-chart-type.tsx","webpack://@finviz/website/./js/main/components/icon/close.tsx","webpack://@finviz/website/./js/main/components/icon/more.tsx","webpack://@finviz/website/./js/main/components/icon/ohlc-chart-type.tsx","webpack://@finviz/website/./js/main/components/icon/profile.tsx","webpack://@finviz/website/./js/main/components/icon/publish.tsx","webpack://@finviz/website/./js/main/components/icon/refresh.tsx","webpack://@finviz/website/./js/main/components/icon/remove.tsx","webpack://@finviz/website/./js/main/components/icon/restore.tsx","webpack://@finviz/website/./js/main/components/icon/settings-wheel.tsx","webpack://@finviz/website/./js/main/components/icon/gesture.tsx","webpack://@finviz/website/./js/main/components/icon/search.tsx","webpack://@finviz/website/./js/main/components/icon/settings.tsx","webpack://@finviz/website/./js/main/components/icon/share.tsx","webpack://@finviz/website/./js/main/components/icon/sign-out.tsx","webpack://@finviz/website/./js/main/components/icon/switch-horizontal.tsx","webpack://@finviz/website/./js/main/components/icon/switch-vertical.tsx","webpack://@finviz/website/./js/main/components/icon/tab-key.tsx","webpack://@finviz/website/./js/main/components/icon/template.tsx","webpack://@finviz/website/./js/main/components/icon/tool-arrow.tsx","webpack://@finviz/website/./js/main/components/icon/tool-brush.tsx","webpack://@finviz/website/./js/main/components/icon/tool-callout.tsx","webpack://@finviz/website/./js/main/components/icon/tool-curve.tsx","webpack://@finviz/website/./js/main/components/icon/tool-elliott-wave.tsx","webpack://@finviz/website/./js/main/components/icon/tool-ellipse.tsx","webpack://@finviz/website/./js/main/components/icon/tool-expand.tsx","webpack://@finviz/website/./js/main/components/icon/tool-fibonacci.tsx","webpack://@finviz/website/./js/main/components/icon/tool-line.tsx","webpack://@finviz/website/./js/main/components/icon/tool-measure.tsx","webpack://@finviz/website/./js/main/components/icon/tool-midline-h.tsx","webpack://@finviz/website/./js/main/components/icon/tool-midline-v.tsx","webpack://@finviz/website/./js/main/components/icon/tool-mouse.tsx","webpack://@finviz/website/./js/main/components/icon/tool-pitchfork.tsx","webpack://@finviz/website/./js/main/components/icon/tool-polygon.tsx","webpack://@finviz/website/./js/main/components/icon/tool-position.tsx","webpack://@finviz/website/./js/main/components/icon/tool-rect.tsx","webpack://@finviz/website/./js/main/components/icon/tool-rect-rotated.tsx","webpack://@finviz/website/./js/main/components/icon/tool-text.tsx","webpack://@finviz/website/./js/main/components/icon/tool-triangle.tsx","webpack://@finviz/website/./js/main/components/icon/tool-xabcd.tsx","webpack://@finviz/website/./js/main/components/icon/warning.tsx","webpack://@finviz/website/./js/main/components/icon/palette.tsx","webpack://@finviz/website/./js/main/components/icon/arrow-forward.tsx","webpack://@finviz/website/./js/main/components/icon/trending-up.tsx","webpack://@finviz/website/./js/main/components/icon/trending-down.tsx","webpack://@finviz/website/./js/main/components/icon/trash-can.tsx","webpack://@finviz/website/./js/main/components/icon/star.tsx","webpack://@finviz/website/./js/main/components/icon/star-outlined.tsx","webpack://@finviz/website/./js/main/components/icon/svg.tsx","webpack://@finviz/website/./js/main/components/input.tsx","webpack://@finviz/website/./js/main/components/list/hooks.tsx","webpack://@finviz/website/./js/main/components/list/list-item.tsx","webpack://@finviz/website/./js/main/components/list/list.tsx","webpack://@finviz/website/./js/main/components/notification/hooks.ts","webpack://@finviz/website/./js/main/components/notification/notification-wrapper.tsx","webpack://@finviz/website/./js/main/components/notification/notification.tsx","webpack://@finviz/website/./js/main/components/notification/with-notification-context.tsx","webpack://@finviz/website/./js/main/components/popover/popover.tsx","webpack://@finviz/website/./js/main/hooks/use-window-size.tsx","webpack://@finviz/website/./js/main/components/popover/hooks.ts","webpack://@finviz/website/./js/main/components/popover/popover-trigger.tsx","webpack://@finviz/website/./js/main/components/combo-box/combo-box-item.tsx","webpack://@finviz/website/./js/main/components/combo-box/combo-box.tsx","webpack://@finviz/website/./js/main/components/search/constants.ts","webpack://@finviz/website/./js/main/components/centered.tsx","webpack://@finviz/website/./js/main/components/search/search-error.tsx","webpack://@finviz/website/./js/main/components/highlight.tsx","webpack://@finviz/website/./js/main/components/search/util.ts","webpack://@finviz/website/./js/main/components/search/search-item.tsx","webpack://@finviz/website/./js/main/components/search/search-list.tsx","webpack://@finviz/website/./js/main/components/search/search.tsx","webpack://@finviz/website/./js/main/components/combo-box/hooks.ts","webpack://@finviz/website/./js/main/components/select/hooks.ts","webpack://@finviz/website/./js/main/components/select/select-button.tsx","webpack://@finviz/website/./js/main/components/select/select.tsx","webpack://@finviz/website/./js/main/components/select/select-with-tooltip.tsx","webpack://@finviz/website/./js/main/components/select/native-select.tsx","webpack://@finviz/website/./js/main/components/select/select-list.tsx","webpack://@finviz/website/./js/main/components/spinner.tsx","webpack://@finviz/website/./js/main/components/tooltip/tooltip-box.tsx","webpack://@finviz/website/./js/main/components/tooltip/tooltip.tsx","webpack://@finviz/website/./js/main/components/tooltip/tooltip-trigger.tsx","webpack://@finviz/website/./js/main/components/tooltip/hooks.ts","webpack://@finviz/website/./js/main/components/tooltip/tooltip-arrow.tsx","webpack://@finviz/website/./js/main/components/tooltip/types.ts","webpack://@finviz/website/./js/main/components/typography.tsx","webpack://@finviz/website/./js/main/constants.ts","webpack://@finviz/website/./js/main/hooks/use-element-measure.ts","webpack://@finviz/website/./js/main/hooks/use-resize-observer.ts","webpack://@finviz/website/./js/main/components/context-menu.tsx","webpack://@finviz/website/./js/main/components/grid/grid.tsx","webpack://@finviz/website/./js/main/components/inner-state/inner-state.tsx","webpack://@finviz/website/./js/main/components/range.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/daterange-select.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/label-with-delayed-spinner.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/timeframe-select.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/timeframe-bar.tsx","webpack://@finviz/website/./js/main/components/toolbar/interfaces.ts","webpack://@finviz/website/./js/main/components/toolbar/hooks.ts","webpack://@finviz/website/./js/main/components/toolbar/toolbar.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-button.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-group.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-item.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-divider.tsx","webpack://@finviz/website/./js/main/components/tooltip-input.tsx","webpack://@finviz/website/./js/main/components/tour/step-content.tsx","webpack://@finviz/website/./js/main/components/tour/utils.ts","webpack://@finviz/website/./js/main/components/tour/hooks.tsx","webpack://@finviz/website/./js/main/components/index.ts","webpack://@finviz/website/./js/main/libs-init.ts","webpack://@finviz/website/./js/main/hooks/use-sync-local-storage.ts","webpack://@finviz/website/./js/main/services/api.ts","webpack://@finviz/website/./js/main/services/local-storage.ts","webpack://@finviz/website/./js/main/services/routing.ts","webpack://@finviz/website/./js/main/types.ts","webpack://@finviz/website/./js/main/util.ts"],"sourcesContent":["import classnames from 'classnames'\r\n\r\nimport { isAftermarket, isHoliday, isPremarket } from './utils'\r\n\r\nexport enum MarketBadgeType {\r\n None,\r\n Open,\r\n Closed,\r\n Premarket,\r\n Aftermarket,\r\n}\r\n\r\nexport function getMarketBadgeText(type: MarketBadgeType, _date?: Date) {\r\n switch (type) {\r\n case MarketBadgeType.Open:\r\n return {\r\n label: 'Markets Open',\r\n }\r\n case MarketBadgeType.Closed:\r\n // const holiday = getHoliday(date)\r\n\r\n return {\r\n label: 'Markets Closed',\r\n // description: holiday && (\r\n // <>\r\n // The markets observe U.S. holidays and are closed on\r\n //
\r\n // {holiday.label}\r\n // \r\n // ),\r\n }\r\n case MarketBadgeType.Premarket:\r\n return {\r\n label: 'Premarket',\r\n // description: (\r\n // <>\r\n // An additional time window when trading is possible.\r\n //
\r\n // We report it as the time between 8:00 AM and 9:30 AM\r\n // \r\n // ),\r\n }\r\n case MarketBadgeType.Aftermarket:\r\n return {\r\n label: 'Aftermarket',\r\n // description: (\r\n // <>\r\n // An additional time window when trading is still possible.\r\n //
\r\n // We report it as the time between 4:00 PM and 5:30 PM\r\n // \r\n // ),\r\n }\r\n }\r\n}\r\n\r\nexport function getMarketBadgeType(time: Date, hasUserPremium?: boolean) {\r\n if (isHoliday(time)) return MarketBadgeType.Closed\r\n if (isPremarket(time, hasUserPremium)) return MarketBadgeType.Premarket\r\n if (isAftermarket(time, hasUserPremium)) return MarketBadgeType.Aftermarket\r\n // if (isMarketOpen(time, hasUserPremium)) return MarketBadgeType.Open\r\n\r\n return MarketBadgeType.None\r\n}\r\n\r\nexport interface MarketBadgeProps {\r\n badge: MarketBadgeType\r\n className?: string\r\n}\r\n\r\nexport function MarketBadge({ badge, className }: MarketBadgeProps) {\r\n if (badge === MarketBadgeType.None) return null\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\n\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from '../../main/components/tooltip'\r\nimport { Heading } from '../../main/components/typography'\r\nimport { useResizeObserver } from '../../main/hooks/use-resize-observer'\r\nimport { MarketBadge, MarketBadgeProps, getMarketBadgeText, getMarketBadgeType } from './market-badge'\r\nimport { TimeFormatType, getDate, getFormattedDateString } from './utils'\r\n\r\nconst UPDATE_INTERVAL = 10000\r\n\r\nenum TimeBreakpointMode {\r\n container,\r\n window,\r\n}\r\n\r\nexport interface TimeBreakpoint {\r\n minWidth: number\r\n marketBadgeText: boolean\r\n timeFormat: TimeFormatType\r\n}\r\n\r\nconst BREAKPOINTS: TimeBreakpoint[] = [\r\n { minWidth: -Infinity, marketBadgeText: false, timeFormat: 'timeOnly' },\r\n { minWidth: 140, marketBadgeText: false, timeFormat: 'short' },\r\n { minWidth: 180, marketBadgeText: false, timeFormat: 'long' },\r\n { minWidth: 255, marketBadgeText: true, timeFormat: 'long' },\r\n]\r\n\r\nfunction getTimeState(fixedTime?: string | Date, hasUserPremium: boolean = FinvizSettings.hasUserPremium) {\r\n const time = getDate(fixedTime)\r\n const badge = getMarketBadgeType(time, hasUserPremium)\r\n\r\n return { time, badge }\r\n}\r\n\r\nfunction TooltipBadge(props: MarketBadgeProps & { time: Date }) {\r\n const state = useTooltipState({ placement: 'bottom' })\r\n const badge = getMarketBadgeText(props.badge, props.time)\r\n\r\n if (!badge) return null\r\n\r\n return (\r\n <>\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n {badge.label}\r\n \r\n {/* {badge.description && {badge.description}} */}\r\n \r\n \r\n )\r\n}\r\n\r\nfunction StaticBadge(props: MarketBadgeProps & { time: Date }) {\r\n const badge = getMarketBadgeText(props.badge, props.time)\r\n\r\n if (!badge) return null\r\n\r\n return (\r\n <>\r\n \r\n {`${badge.label} · `}\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Find matching breakpoint or return the last (largest) one\r\n */\r\nfunction findMatchingBreakpoint(compareWidth: number | undefined, breakpoints: TimeBreakpoint[]) {\r\n if (typeof compareWidth !== 'number') return breakpoints[breakpoints.length - 1]\r\n\r\n const matchingBreakpoints = breakpoints.filter((breakpoint) => compareWidth >= breakpoint.minWidth)\r\n\r\n return matchingBreakpoints.pop() ?? breakpoints[breakpoints.length - 1]\r\n}\r\n\r\nfunction getCurrentWidth(mode: TimeBreakpointMode, element: HTMLElement | null) {\r\n return mode === TimeBreakpointMode.window ? window.innerWidth : element?.clientWidth ?? 0\r\n}\r\n\r\ninterface TimeProps extends React.HTMLProps {\r\n /**\r\n * Set custom time to display\r\n */\r\n fixedTime?: string | Date\r\n\r\n /**\r\n * What to measure the breakpoints to\r\n * - `container` parent element\r\n * - `window` window\r\n *\r\n * @default \"container\"\r\n */\r\n breakpointMode?: keyof typeof TimeBreakpointMode\r\n\r\n /**\r\n * Defines what information is visible at which breakpoint. Local mode measures\r\n * the component wrapper div and global mode measures window width. The definitions\r\n * must be ascending in width\r\n */\r\n breakpoints?: TimeBreakpoint[]\r\n}\r\n\r\nexport function Time({\r\n className,\r\n fixedTime,\r\n breakpointMode = 'container',\r\n breakpoints = BREAKPOINTS,\r\n ...props\r\n}: TimeProps) {\r\n const ResizeObserver = useResizeObserver()\r\n const rootRef = React.useRef(null)\r\n const [state, setState] = React.useState(getTimeState(fixedTime))\r\n const [currentBreakpoint, setBreakpoint] = React.useState(null)\r\n\r\n React.useEffect(() => {\r\n const interval = setInterval(() => setState(getTimeState(fixedTime)), UPDATE_INTERVAL)\r\n return () => clearInterval(interval)\r\n }, [fixedTime])\r\n\r\n React.useEffect(() => {\r\n if (!ResizeObserver || !rootRef.current) return\r\n\r\n if (!currentBreakpoint) {\r\n const currentWidth = getCurrentWidth(TimeBreakpointMode[breakpointMode], rootRef.current)\r\n setBreakpoint(findMatchingBreakpoint(currentWidth, breakpoints))\r\n }\r\n\r\n const handleResize = throttle(() => {\r\n const currentWidth = getCurrentWidth(TimeBreakpointMode[breakpointMode], rootRef.current)\r\n const foundBreakpoint = findMatchingBreakpoint(currentWidth, breakpoints)\r\n\r\n if (foundBreakpoint !== currentBreakpoint) setBreakpoint(foundBreakpoint)\r\n }, 150)\r\n\r\n const observer = new ResizeObserver((entries) => {\r\n window.requestAnimationFrame(() => {\r\n if (Array.isArray(entries) && entries.length > 0) handleResize()\r\n })\r\n })\r\n\r\n observer.observe(rootRef.current)\r\n window.addEventListener('resize', handleResize)\r\n\r\n return () => {\r\n observer.disconnect()\r\n window.removeEventListener('resize', handleResize)\r\n }\r\n }, [ResizeObserver, currentBreakpoint, breakpoints, breakpointMode])\r\n\r\n return (\r\n
\r\n {currentBreakpoint && (\r\n
\r\n {currentBreakpoint.marketBadgeText ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {getFormattedDateString(state.time, currentBreakpoint.timeFormat)}\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","/**\r\n * Check if a given date is DST in the US\r\n * - begins on the second Sunday in March\r\n * - ends on the first Sunday in November\r\n *\r\n * Keep in sync with https://github.com/finvizhq/charts/blob/master/app/utils.ts\r\n */\r\nexport function getIsDstInNy(date: Date) {\r\n const dayNumber = date.getDate()\r\n const monthIndex = date.getMonth()\r\n const dayOfWeek = date.getDay()\r\n const previousSunday = dayNumber - dayOfWeek\r\n if (monthIndex < 2 || monthIndex > 10) {\r\n return false\r\n }\r\n if (monthIndex > 2 && monthIndex < 10) {\r\n return true\r\n }\r\n return monthIndex === 2 ? previousSunday >= 8 : previousSunday <= 0\r\n}\r\n\r\nexport function getDate(seed?: string | number | Date) {\r\n var date = seed != null ? new Date(seed) : new Date()\r\n const dateAsNY = new Date(\r\n date.getUTCFullYear(),\r\n date.getUTCMonth(),\r\n date.getUTCDate(),\r\n date.getUTCHours() - 5,\r\n date.getUTCMinutes(),\r\n date.getUTCSeconds()\r\n )\r\n const isDst = getIsDstInNy(dateAsNY)\r\n\r\n if (isDst) {\r\n dateAsNY.setUTCHours(dateAsNY.getUTCHours() + 1)\r\n }\r\n\r\n return dateAsNY\r\n}\r\n\r\nfunction getWeekDay(date: Date) {\r\n return date.toLocaleDateString('en-US', { weekday: 'short' })\r\n}\r\n\r\nfunction getMonth(date: Date) {\r\n return date.toLocaleDateString('en-US', { month: 'short' }).toUpperCase()\r\n}\r\n\r\nfunction getDay(date: Date) {\r\n return date.getDate().toString().padStart(2, '0')\r\n}\r\n\r\nfunction getTime(date: Date) {\r\n return date.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true })\r\n}\r\n\r\nenum TimeFormat {\r\n long,\r\n short,\r\n timeOnly,\r\n}\r\n\r\nexport type TimeFormatType = keyof typeof TimeFormat\r\n\r\nexport function getFormattedDateString(date: Date = getDate(), format: TimeFormatType = 'long') {\r\n switch (TimeFormat[format]) {\r\n case TimeFormat.long:\r\n return `${getWeekDay(date)} ${getMonth(date)} ${getDay(date)} ${date.getFullYear()} ${getTime(date)} ET`\r\n case TimeFormat.short:\r\n return `${getWeekDay(date)} ${getMonth(date)} ${getDay(date)} ${getTime(date)}`\r\n case TimeFormat.timeOnly:\r\n return getTime(date)\r\n }\r\n}\r\n\r\nexport function isPremarket(date: Date = getDate(), isPremium = FinvizSettings.hasUserPremium) {\r\n const dayOfWeek = date.getDay()\r\n const min = date.getMinutes()\r\n\r\n if (\r\n isPremium &&\r\n dayOfWeek !== 0 &&\r\n dayOfWeek !== 6 &&\r\n (date.getHours() === 8 || (date.getHours() === 9 && min < 30))\r\n ) {\r\n return true\r\n }\r\n return false\r\n}\r\n\r\nexport function isAftermarket(date: Date = getDate(), isPremium = FinvizSettings.hasUserPremium) {\r\n const dayOfWeek = date.getDay()\r\n const min = date.getMinutes()\r\n\r\n if (\r\n isPremium &&\r\n dayOfWeek !== 0 &&\r\n dayOfWeek !== 6 &&\r\n (date.getHours() === 16 || (date.getHours() === 17 && min < 30))\r\n ) {\r\n return true\r\n }\r\n return false\r\n}\r\n\r\n/**\r\n * https://www.nyse.com/markets/hours-calendars\r\n */\r\nconst HOLIDAY_DATES = [\r\n {\r\n label: \"New Year's Day\",\r\n test: (day: number, month: number) => month === 1 && day === 2,\r\n },\r\n {\r\n label: 'Martin Luther King, Jr. Day',\r\n test: (day: number, month: number) => month === 1 && day === 16,\r\n },\r\n {\r\n label: 'Presidents Day',\r\n test: (day: number, month: number) => month === 2 && day === 20,\r\n },\r\n {\r\n label: 'Good Friday',\r\n test: (day: number, month: number) => month === 4 && day === 7,\r\n },\r\n {\r\n label: 'Memorial Day',\r\n test: (day: number, month: number) => month === 5 && day === 29,\r\n },\r\n {\r\n label: 'Juneteenth Holiday',\r\n test: (day: number, month: number) => month === 6 && day === 19,\r\n },\r\n {\r\n label: 'Early Close',\r\n test: (day: number, month: number, hours: number) => month === 7 && day === 3 && hours >= 13,\r\n },\r\n {\r\n label: 'Independence Day',\r\n test: (day: number, month: number) => month === 7 && day === 4,\r\n },\r\n {\r\n label: 'Labor Day',\r\n test: (day: number, month: number) => month === 9 && day === 4,\r\n },\r\n {\r\n label: 'Thanksgiving Day',\r\n test: (day: number, month: number) => month === 11 && day === 23,\r\n },\r\n {\r\n label: 'Day after Thanksgiving (closed from 1 PM)',\r\n test: (day: number, month: number, hours: number) => month === 11 && day === 24 && hours >= 13,\r\n },\r\n {\r\n label: 'Christmas Day',\r\n test: (day: number, month: number) => month === 12 && day === 25,\r\n },\r\n]\r\n\r\nexport function getHoliday(date: Date = getDate()) {\r\n var day = date.getDate()\r\n var month = date.getMonth() + 1\r\n var hours = date.getHours()\r\n\r\n return HOLIDAY_DATES.find((holiday) => holiday.test(day, month, hours))\r\n}\r\n\r\nexport function isHoliday(date: Date = getDate()) {\r\n return !!getHoliday(date)\r\n}\r\n\r\nexport function isMarketOpen(date: Date = getDate(), isPremium = FinvizSettings.hasUserPremium) {\r\n if (isPremarket(date, isPremium) || isAftermarket(date, isPremium) || isHoliday(date)) {\r\n return false\r\n }\r\n\r\n const dayOfWeek = date.getDay()\r\n const hour = date.getHours()\r\n const minute = date.getMinutes()\r\n\r\n const isWeekend = dayOfWeek === 0 || dayOfWeek === 6\r\n // Day starts at 9:30\r\n const dayStarted = hour === 9 ? minute >= 30 : hour >= 10\r\n // Ends at 16:00\r\n const dayEnded = hour >= 16\r\n\r\n return !isWeekend && dayStarted && !dayEnded\r\n}\r\n","export type ObjectHash = Record\r\n\r\nexport const decodeQueryString = function = ObjectHash>(\r\n search = window.location.search\r\n): T {\r\n const vars = search.substring(1).split('&')\r\n const obj: ObjectHash = {}\r\n vars.forEach((pair) => {\r\n const delimiterPos = pair.indexOf('='),\r\n key = decodeURIComponent(pair.substring(0, delimiterPos)),\r\n value = decodeURIComponent(pair.substring(delimiterPos + 1))\r\n obj[key] = value\r\n })\r\n return obj as T\r\n}\r\n\r\nexport const encodeQueryString = function (values: ObjectHash, whitelistedValues: string[] = []) {\r\n return Object.keys(values).reduce((prev, key) => {\r\n const value = values[key]\r\n if (!['', null, undefined].includes(value) || whitelistedValues.includes(value)) {\r\n return prev + (prev.length > 0 ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value)\r\n }\r\n return prev\r\n }, '')\r\n}\r\n","export function getParsedCookies(cookieName: string) {\r\n const parseCookies = document.cookie\r\n .split(';')\r\n .map((cookieString) => cookieString.split('='))\r\n .reduce((acc, v) => {\r\n acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim())\r\n return acc\r\n }, {} as Record)\r\n\r\n return cookieName ? parseCookies[cookieName] : parseCookies\r\n}\r\n\r\nexport function getCookie(name: string) {\r\n var re = new RegExp('(?:(?:^|.*;\\\\s*)' + name + '\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$')\r\n return document.cookie.replace(re, '$1')\r\n}\r\n\r\nexport function setCookie(name: string, value: string, expires: Date) {\r\n var cookie = name + '=' + value + '; expires=' + expires.toUTCString()\r\n if (/\\bfinviz\\b/.test(document.location.hostname)) {\r\n cookie += '; domain=.finviz.com'\r\n }\r\n document.cookie = cookie\r\n}\r\n","import { HTMLAttributeReferrerPolicy } from 'react'\r\n\r\nexport function getHoverChartUrl(ticker: string, escaped: boolean = false): string {\r\n let imgUrl = `${FinvizSettings.nodeChartsDomain}/chart.ashx?cs=m&t=${ticker}&tf=${\r\n FinvizSettings.stocksHoverChartTimeframe || 'd'\r\n }&ct=candle_stick`\r\n if (FinvizSettings.hasUserPremium && FinvizSettings.stocksHoverChartPatterns) {\r\n imgUrl +=\r\n '&o[0][ot]=sma&o[0][op]=50&o[0][oc]=FF8F33C6&o[1][ot]=sma&o[1][op]=200&o[1][oc]=DCB3326D&o[2][ot]=patterns&o[2][op]=&o[2][oc]=000'\r\n }\r\n if (escaped) {\r\n // \"Escaping\" [ and ] because of how boxover.js works\r\n imgUrl = imgUrl.replace(/\\[/g, '[[').replace(/]/g, ']]')\r\n }\r\n return imgUrl\r\n}\r\n\r\nexport function getHoverChartDimensions() {\r\n switch (FinvizSettings.stocksHoverChartTimeframe) {\r\n case 'i3':\r\n case 'i15':\r\n return { width: 584, height: 180 }\r\n case 'i5':\r\n return { width: 376, height: 180 }\r\n case 'd':\r\n if (FinvizSettings.stocksHoverChartPatterns) return { width: 464, height: 230 }\r\n return { width: 324, height: 180 }\r\n default:\r\n return { width: 324, height: 180 }\r\n }\r\n}\r\n\r\nexport function getReferrerPolicy(): HTMLAttributeReferrerPolicy {\r\n return 'no-referrer-when-downgrade'\r\n}\r\n\r\nexport function getHoverChartImg(ticker: string, escaped: boolean = false) {\r\n const referrerPolicy = getReferrerPolicy()\r\n const { width, height } = getHoverChartDimensions()\r\n const url = getHoverChartUrl(ticker, escaped)\r\n const srcSet = getSrcSet(url)\r\n const srcsetString = srcSet?.length ? `srcset='${srcSet}'` : ''\r\n\r\n return {\r\n img: ``,\r\n width,\r\n height,\r\n }\r\n}\r\n\r\nexport function getSrcSet(url: string) {\r\n return FinvizSettings.hasUserRetinaHoverCharts ? `${url} 1x, ${url}&sf=2 2x` : undefined\r\n}\r\n","const matchesAndroid = navigator.userAgent.match(/Android/i)\r\nconst matchesWebOS = navigator.userAgent.match(/webOS/i)\r\nconst matchesIPhone = navigator.userAgent.match(/iPhone/i)\r\nconst matchesiPad = navigator.userAgent.match(/iPad/i)\r\nconst matchesIPod = navigator.userAgent.match(/iPod/i)\r\nconst matchesBlackBerry = navigator.userAgent.match(/BlackBerry/i)\r\nconst matchesWindowsPhone = navigator.userAgent.match(/Windows Phone/i)\r\nconst matchesIOSLike = navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints > 0\r\n\r\nconst isMobileDevice =\r\n matchesAndroid ||\r\n matchesWebOS ||\r\n matchesIPhone ||\r\n matchesiPad ||\r\n matchesIPod ||\r\n matchesBlackBerry ||\r\n matchesWindowsPhone ||\r\n matchesIOSLike\r\n\r\nexport function isMobile() {\r\n return !!isMobileDevice\r\n}\r\n\r\nexport function isIphone() {\r\n return !!(matchesIPhone && !matchesiPad)\r\n}\r\n\r\nexport function isIpad() {\r\n return (matchesIOSLike && !matchesIPhone && !matchesIPod) || matchesiPad\r\n}\r\n\r\nexport function isSafariDesktop() {\r\n return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) && navigator.maxTouchPoints === 0\r\n}\r\n","function getSanitizedSingleTicker(rawTicker: string) {\r\n return rawTicker\r\n .replace(/\\.+/gi, '-')\r\n .split('-')\r\n .map((x) => x.replace(/([^a-z0-9@-])+/gi, ''))\r\n .filter((x) => !!x)\r\n .join('-')\r\n .toUpperCase()\r\n}\r\n\r\nexport function getSanitizedTicker(rawTicker: string, isMulti = false) {\r\n if (isMulti) {\r\n return rawTicker\r\n .replace(/ /g, ',')\r\n .split(',')\r\n .map(getSanitizedSingleTicker)\r\n .filter((x) => !!x)\r\n .join(',')\r\n }\r\n\r\n return getSanitizedSingleTicker(rawTicker)\r\n}\r\n","import { getCookie, setCookie } from './cookie'\r\n\r\nexport const formatDateToStringUS = (date: Date) =>\r\n date.toLocaleDateString('en-US', {\r\n day: '2-digit',\r\n month: '2-digit',\r\n year: 'numeric',\r\n })\r\n\r\nconst DRAWING_QUOTE_PAGE_COOKIE_NAME = 'charts-draw'\r\nexport function getIsDrawingEnabledOnQuotePage() {\r\n return getCookie(DRAWING_QUOTE_PAGE_COOKIE_NAME) === 'on'\r\n}\r\n\r\nexport async function setIsDrawingEnabledOnQuotePage(isEnabled: boolean) {\r\n return fetch('/api/set_cookie.ashx?cookie=' + DRAWING_QUOTE_PAGE_COOKIE_NAME + '&value=' + (isEnabled ? 'on' : 'off'))\r\n .catch(() => {})\r\n .then((res) => {\r\n if (!res?.ok) {\r\n // fallback to JS otherwise draw toggle won't work if API don't work\r\n setIsDrawingEnabledOnQuotePageCookieViaJS(isEnabled)\r\n }\r\n\r\n document.location.reload()\r\n })\r\n}\r\n\r\nfunction setIsDrawingEnabledOnQuotePageCookieViaJS(isEnabled: boolean) {\r\n const expires = new Date()\r\n expires.setMonth(expires.getMonth() + 1)\r\n setCookie(DRAWING_QUOTE_PAGE_COOKIE_NAME, isEnabled ? 'on' : 'off', expires)\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nexport enum BoxRounding {\r\n none = '',\r\n regular = 'rounded-md', // 6px\r\n}\r\n\r\nexport enum BoxTheme {\r\n none = '',\r\n light = 'bg-white dark:bg-gray-800 border border-gray-100 dark:border-gray-600',\r\n dark = 'bg-gray-800 border border-gray-600',\r\n}\r\n\r\nexport interface BoxProps extends Omit, 'ref'> {\r\n rounding?: keyof typeof BoxRounding\r\n theme?: keyof typeof BoxTheme\r\n}\r\n\r\nexport const Box = React.forwardRef(function Box(\r\n { rounding = 'regular', theme = 'light', ...props }: BoxProps,\r\n ref: React.ForwardedRef\r\n) {\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n})\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonRounding, ButtonRoundingType } from '../button'\r\n\r\nexport enum GroupTheme {\r\n light,\r\n dark,\r\n}\r\n\r\nexport interface ButtonGroupProps {\r\n children: React.ReactNode\r\n\r\n /**\r\n * Border radius of entire group wrapper\r\n *\r\n * @default \"regular\"\r\n */\r\n rounding?: ButtonRoundingType\r\n\r\n className?: string\r\n\r\n /**\r\n * If a pipe divider between buttons should be rendered\r\n *\r\n * @default true\r\n */\r\n hasDivider?: boolean\r\n\r\n /**\r\n * If group wrapper has a border\r\n *\r\n * @default true\r\n */\r\n hasBorder?: boolean\r\n\r\n /**\r\n * Group color theme\r\n *\r\n * @default \"light\"\r\n */\r\n theme?: keyof typeof GroupTheme\r\n\r\n /**\r\n * Custom button component which extends Button\r\n *\r\n * @default undefined\r\n */\r\n childComponent?: string | React.JSXElementConstructor\r\n}\r\n\r\nfunction getGroupTheme(theme: GroupTheme) {\r\n switch (theme) {\r\n case GroupTheme.dark:\r\n return {\r\n wrapper: 'bg-gray-800 border-gray-600',\r\n divider: 'bg-gray-600',\r\n }\r\n default:\r\n return {\r\n wrapper: 'bg-white dark:bg-gray-800 border-gray-100 dark:border-gray-600',\r\n divider: 'bg-gray-100 dark:bg-gray-600',\r\n }\r\n }\r\n}\r\n\r\nexport function ButtonGroup({\r\n className,\r\n children,\r\n theme = 'light',\r\n hasDivider = true,\r\n hasBorder = true,\r\n rounding = 'regular',\r\n childComponent,\r\n}: ButtonGroupProps) {\r\n const buttonRounding = ButtonRounding[rounding]\r\n const groupTheme = React.useMemo(() => getGroupTheme(GroupTheme[theme]), [theme])\r\n return (\r\n \r\n {React.Children.map(children, (child, index) => {\r\n if (!React.isValidElement(child) || ![Button, childComponent].filter(Boolean).includes(child.type)) {\r\n return child\r\n }\r\n\r\n return (\r\n \r\n {hasDivider && index > 0 &&
}\r\n {React.cloneElement(child as React.ReactElement>, {\r\n rounding: child.props.rounding ?? 'none',\r\n theme: child.props.theme ?? (GroupTheme[theme] === GroupTheme.dark ? 'menuItemDark' : 'menuItem'),\r\n })}\r\n \r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from './icon'\r\nimport { PropsWithAs } from './types'\r\n\r\nexport const BUTTON_DEFAULT_ELEMENT = 'button'\r\n\r\nexport const BUTTON_BASE_CLASS = 'flex items-center font-medium whitespace-nowrap focus:outline-none'\r\nexport const BUTTON_SQUARE_BASE_CLASS = 'shrink-0 justify-center'\r\nexport const BUTTON_FOCUS_STYLES = 'focus-visible:ring-2 ring-gray-200 dark:ring-gray-500'\r\n\r\nexport enum ButtonSize {\r\n none = '', // Do not set fixed dimensions\r\n small = 'text-2xs h-6 px-2', // 24px height\r\n regular = 'text-2xs h-7 px-2', // 28px height\r\n medium = 'text-sm h-8 px-3', // 28px height\r\n large = 'text-sm h-9 px-4', // 28px height\r\n}\r\n\r\nexport type ButtonSizeType = keyof typeof ButtonSize\r\n\r\nexport enum ButtonSquareSize {\r\n none = '', // Do not set fixed dimensions\r\n small = 'h-6 w-6', // 24x24px\r\n regular = 'h-7 w-7', // 28x28px\r\n medium = 'h-8 w-8', // 32x32px\r\n large = 'h-9 w-9', // 36x36px\r\n}\r\n\r\nexport enum ButtonRounding {\r\n none = '',\r\n small = 'rounded', // 4px\r\n regular = 'rounded-md', // 6px\r\n full = 'rounded-full', // 9999px\r\n}\r\n\r\nexport type ButtonRoundingType = keyof typeof ButtonRounding\r\n\r\nexport enum ButtonTheme {\r\n transparent, // Only basic shape is rendered\r\n light,\r\n dark,\r\n blue,\r\n blueHover,\r\n red,\r\n headerItem,\r\n menuItem,\r\n menuItemDark,\r\n opacity,\r\n outline,\r\n chipTransparent,\r\n chip,\r\n}\r\n\r\nexport type ButtonThemeType = keyof typeof ButtonTheme\r\n\r\n/**\r\n * Get button theme\r\n */\r\nexport function getButtonTheme(theme: ButtonTheme, active = false) {\r\n switch (theme) {\r\n case ButtonTheme.light: {\r\n return {\r\n button: classnames(\r\n 'active:bg-gray-200 disabled:bg-gray-50 disabled:text-gray-400', // Light\r\n 'dark:active:bg-gray-500 dark:disabled:bg-gray-700 dark:disabled:text-gray-300', // Dark\r\n {\r\n 'bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600': !active,\r\n 'bg-gray-200 dark:bg-gray-500': active,\r\n }\r\n ),\r\n }\r\n }\r\n case ButtonTheme.dark: {\r\n return {\r\n button: classnames('text-gray-50 active:bg-gray-500 disabled:bg-gray-700 disabled:text-gray-300', {\r\n 'bg-gray-700 hover:bg-gray-600': !active,\r\n 'bg-gray-500': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.blue: {\r\n return {\r\n button: classnames(\r\n 'text-white hover:text-white active:bg-blue-600 disabled:bg-blue-200 dark:disabled:text-gray-300',\r\n {\r\n 'bg-blue-400 hover:bg-blue-500': !active,\r\n 'bg-blue-600': active,\r\n }\r\n ),\r\n }\r\n }\r\n case ButtonTheme.blueHover: {\r\n return {\r\n button: classnames(\r\n 'text-blue-600 active:bg-blue-600 disabled:bg-blue-200 disabled:text-gray-400 dark:disabled:text-gray-300',\r\n {\r\n 'hover:bg-blue-400 hover:text-white dark:text-blue-500 dark:hover:text-white': !active,\r\n 'bg-blue-400 text-white': active,\r\n }\r\n ),\r\n }\r\n }\r\n case ButtonTheme.red: {\r\n return {\r\n button: classnames('text-white active:bg-red-600 disabled:bg-red-200 disabled:text-gray-300', {\r\n 'bg-red-400 hover:bg-red-500': !active,\r\n 'bg-red-600': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.headerItem: {\r\n return {\r\n button: classnames(\r\n 'bg-gray-800 text-gray-300 hover:bg-gray-900 hover:text-white disabled:bg-gray-700' // Base\r\n ),\r\n icon: 'text-white',\r\n }\r\n }\r\n case ButtonTheme.menuItem: {\r\n return {\r\n button: classnames({\r\n 'hover:bg-gray-50 disabled:text-gray-400 dark:hover:bg-gray-700': !active,\r\n 'bg-gray-50 dark:bg-gray-700': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.menuItemDark: {\r\n return {\r\n button: classnames('text-white', {\r\n 'hover:bg-gray-700': !active,\r\n 'bg-gray-700': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.opacity:\r\n return {\r\n button: classnames('disabled:opacity-50 dark:text-gray-400', {\r\n 'opacity-70 hover:opacity-100': !active,\r\n }),\r\n }\r\n case ButtonTheme.outline:\r\n return {\r\n button: classnames(\r\n // Base styles\r\n 'border border-gray-100 active:border-blue-400 disabled:border-gray-100 disabled:bg-gray-50 disabled:text-gray-500',\r\n // Dark styles\r\n 'dark:border-gray-600 dark:bg-gray-800 dark:text-gray-50 dark:active:border-blue-400 dark:disabled:border-transparent dark:disabled:bg-gray-700 dark:disabled:text-gray-400',\r\n {\r\n 'border-blue-400 dark:border-blue-400': active,\r\n 'hover:border-gray-300 dark:hover:border-gray-400': !active,\r\n }\r\n ),\r\n }\r\n case ButtonTheme.chip:\r\n return {\r\n button: classnames('border', {\r\n 'border-transparent bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600': !active,\r\n 'border-blue-500 bg-blue-50 text-gray-900 dark:bg-gray-700 dark:text-white': active,\r\n }),\r\n }\r\n case ButtonTheme.chipTransparent:\r\n return {\r\n button: classnames(\r\n 'border', // Base styles\r\n {\r\n 'border-transparent text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200':\r\n !active,\r\n 'border-blue-400 bg-blue-50 text-gray-900 dark:bg-gray-700 dark:text-white': active,\r\n }\r\n ),\r\n }\r\n default:\r\n return {}\r\n }\r\n}\r\n\r\n/**\r\n * Export Button html props type so we don’t always have to omit\r\n */\r\nexport type ButtonHTMLProps = Omit, 'ref' | 'type' | 'size' | 'content'>\r\n\r\nexport interface ButtonProps {\r\n /**\r\n * Visual appearance of the button\r\n */\r\n theme?: ButtonThemeType\r\n\r\n /**\r\n * Sets if button is square or normal.\r\n *\r\n * @default 'regular'\r\n */\r\n appearance?: 'regular' | 'square'\r\n\r\n /**\r\n * Size of the button\r\n *\r\n * @default \"regular\"\r\n */\r\n size?: ButtonSizeType\r\n\r\n /**\r\n * Render button in an active state (darker background, etc.)\r\n */\r\n active?: boolean\r\n\r\n /**\r\n * Sets if the button has focus ring\r\n *\r\n * @default true\r\n */\r\n focusRing?: boolean\r\n\r\n /**\r\n * Sets rounded corners for the button\r\n *\r\n * @default regular\r\n */\r\n rounding?: ButtonRoundingType\r\n\r\n /**\r\n * Class for the content wrapper\r\n */\r\n contentClass?: string\r\n\r\n /**\r\n * Name of left icon\r\n */\r\n leftContent?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Name of right icon\r\n */\r\n rightContent?: JSX.Element | IconNameType\r\n}\r\n\r\nexport type ButtonComponentProps =\r\n PropsWithAs & ButtonProps\r\n\r\nfunction ButtonComponent(\r\n {\r\n as: asComponent,\r\n theme = 'light',\r\n size = 'regular',\r\n rounding = 'regular',\r\n focusRing = true,\r\n appearance = 'regular',\r\n active,\r\n contentClass,\r\n leftContent,\r\n rightContent,\r\n className,\r\n children,\r\n ...props\r\n }: ButtonComponentProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const isSquare = appearance === 'square'\r\n const buttonTheme = React.useMemo(() => getButtonTheme(ButtonTheme[theme], active), [theme, active])\r\n const buttonSize = isSquare ? ButtonSquareSize[size] : ButtonSize[size]\r\n const buttonRounding = ButtonRounding[rounding]\r\n\r\n return React.createElement(\r\n asComponent ?? BUTTON_DEFAULT_ELEMENT,\r\n {\r\n ...props,\r\n ref,\r\n className: classnames(\r\n BUTTON_BASE_CLASS,\r\n buttonTheme.button,\r\n buttonSize,\r\n buttonRounding,\r\n {\r\n [BUTTON_SQUARE_BASE_CLASS]: isSquare,\r\n [BUTTON_FOCUS_STYLES]: focusRing,\r\n },\r\n className\r\n ),\r\n },\r\n <>\r\n {isValidIconName(leftContent) ? (\r\n \r\n ) : (\r\n leftContent\r\n )}\r\n {children && !isSquare ? (\r\n \r\n {children}\r\n \r\n ) : (\r\n children\r\n )}\r\n {isValidIconName(rightContent) ? (\r\n \r\n ) : (\r\n rightContent\r\n )}\r\n \r\n )\r\n}\r\n\r\n/**\r\n * We need to forward ref to the function, but typescript looses the type of the\r\n * props param so we need to typecast to get suggestions to work\r\n */\r\nexport const Button = React.forwardRef(ButtonComponent) as <\r\n TagType extends React.ElementType = typeof BUTTON_DEFAULT_ELEMENT\r\n>(\r\n props: PropsWithAs & ButtonProps & { ref?: React.ForwardedRef }\r\n) => ReturnType\r\n","import classnames from 'classnames'\r\nimport { ForwardedRef, HTMLProps, PropsWithChildren, ReactNode, forwardRef } from 'react'\r\n\r\nimport { Icon } from './icon'\r\n\r\ninterface CheckboxProps extends Omit, 'label'> {\r\n /**\r\n * Text that gets displayed on the right side of the checkbox\r\n */\r\n label?: ReactNode\r\n\r\n checked: boolean\r\n}\r\n\r\nfunction CheckboxComponent(\r\n { className, label, children, ...props }: PropsWithChildren,\r\n ref: ForwardedRef\r\n) {\r\n const checked = props.checked ?? props.defaultChecked\r\n\r\n return (\r\n \r\n
\r\n \r\n {checked && }\r\n
\r\n {label ?? children}\r\n \r\n )\r\n}\r\n\r\nexport const Checkbox = forwardRef(CheckboxComponent)\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, PropsWithChildren, memo, useCallback, useLayoutEffect, useRef, useState } from 'react'\r\n\r\nexport interface Interaction {\r\n left: number\r\n top: number\r\n}\r\n\r\n/**\r\n * Clamp value between two bounds\r\n */\r\nfunction clamp(num: number, min = 0, max = 1) {\r\n return num > max ? max : num < min ? min : num\r\n}\r\n\r\n/**\r\n * Check if an event was triggered by touch\r\n */\r\nfunction isTouch(event: MouseEvent | TouchEvent): event is TouchEvent {\r\n return 'touches' in event\r\n}\r\n\r\n/**\r\n * Returns a relative position of the pointer inside the node's bounding box\r\n */\r\nfunction getRelativePosition(node: HTMLDivElement, event: MouseEvent | TouchEvent): Interaction {\r\n const rect = node.getBoundingClientRect()\r\n\r\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\r\n const pointer = isTouch(event) ? event.touches[0] : (event as MouseEvent)\r\n\r\n return {\r\n left: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),\r\n top: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height),\r\n }\r\n}\r\n\r\n/**\r\n * Browsers introduced an intervention, making touch events passive by default.\r\n * This workaround removes `preventDefault` call from the touch handlers.\r\n * @see https://github.com/facebook/react/issues/19651\r\n */\r\nfunction preventDefaultMove(event: MouseEvent | TouchEvent) {\r\n !isTouch(event) && event.preventDefault()\r\n}\r\n\r\ninterface Props {\r\n onMove: (interaction: Interaction) => void\r\n onKey: (offset: Interaction) => void\r\n}\r\n\r\nfunction DraggablePickerComponent({\r\n onMove,\r\n onKey,\r\n className,\r\n ...props\r\n}: PropsWithChildren & HTMLProps) {\r\n const container = useRef(null)\r\n const hasTouched = useRef(false)\r\n const [isDragging, setDragging] = useState(false)\r\n\r\n /**\r\n * Prevent mobile browsers from handling mouse events (conflicting with touch ones).\r\n * If we detected a touch interaction before, we prefer reacting to touch events only.\r\n */\r\n const isValid = useRef((event: MouseEvent | TouchEvent): boolean => {\r\n if (hasTouched.current && !isTouch(event)) return false\r\n if (!hasTouched.current) hasTouched.current = isTouch(event)\r\n return true\r\n })\r\n\r\n const handleMove = useCallback(\r\n (event: MouseEvent | TouchEvent) => {\r\n preventDefaultMove(event)\r\n\r\n // If user moves the pointer outside of the window or iframe bounds and release it there,\r\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\r\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\r\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\r\n // without pressing it down\r\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0\r\n\r\n if (isDown && container.current) {\r\n onMove(getRelativePosition(container.current, event))\r\n } else {\r\n setDragging(false)\r\n }\r\n },\r\n [onMove]\r\n )\r\n\r\n const handleMoveStart = useCallback(\r\n ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\r\n preventDefaultMove(nativeEvent)\r\n\r\n if (!isValid.current(nativeEvent)) return\r\n\r\n // The node/ref must actually exist when user start an interaction.\r\n // We won't suppress the ESLint warning though, as it should probably be something to be aware of.\r\n onMove(getRelativePosition(container.current!, nativeEvent))\r\n setDragging(true)\r\n },\r\n [onMove]\r\n )\r\n\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent) => {\r\n const keyCode = event.which || event.keyCode\r\n\r\n // Ignore all keys except arrow ones\r\n if (keyCode < 37 || keyCode > 40) return\r\n // Do not scroll page by arrow keys when document is focused on the element\r\n event.preventDefault()\r\n // Send relative offset to the parent component.\r\n // We use codes (37←, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\r\n // to reduce the size of the library\r\n onKey({\r\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\r\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\r\n })\r\n },\r\n [onKey]\r\n )\r\n\r\n const handleMoveEnd = useCallback(() => setDragging(false), [])\r\n\r\n const toggleDocumentEvents = useCallback(\r\n (state) => {\r\n // add or remove additional pointer event listeners\r\n const toggleEvent = state ? window.addEventListener : window.removeEventListener\r\n toggleEvent(hasTouched.current ? 'touchmove' : 'mousemove', handleMove)\r\n toggleEvent(hasTouched.current ? 'touchend' : 'mouseup', handleMoveEnd)\r\n },\r\n [handleMove, handleMoveEnd]\r\n )\r\n\r\n useLayoutEffect(() => {\r\n toggleDocumentEvents(isDragging)\r\n return () => {\r\n isDragging && toggleDocumentEvents(false)\r\n }\r\n }, [isDragging, toggleDocumentEvents])\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport const DraggablePicker = memo(DraggablePickerComponent)\r\n","interface PointerProps {\r\n className?: string\r\n top?: number\r\n left: number\r\n color: string\r\n}\r\n\r\nexport function Pointer({ color, left, top = 0.5 }: PointerProps) {\r\n return (\r\n \r\n
\r\n
\r\n )\r\n}\r\n","/**\r\n * Keep this file in sync with `app/utils/colors.ts` in charts repo\r\n * */\r\n\r\nexport interface RGBA {\r\n r: number\r\n g: number\r\n b: number\r\n a: number\r\n}\r\n\r\nexport interface HSVA {\r\n h: number\r\n s: number\r\n v: number\r\n a: number\r\n}\r\n\r\nexport interface HSLA {\r\n h: number\r\n s: number\r\n l: number\r\n a: number\r\n}\r\n\r\n/**\r\n * Convert Hex string to RGBA object.\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hexStringToRGBA(hexString: string): RGBA {\r\n const hexColor = removeHashSymbol(hexString)\r\n let r: string | number = 0\r\n let g: string | number = 0\r\n let b: string | number = 0\r\n let a: string | number = 255\r\n\r\n // 3 digits\r\n if (hexColor.length === 3 || hexColor.length === 4) {\r\n r = '0x' + hexColor[0] + hexColor[0]\r\n g = '0x' + hexColor[1] + hexColor[1]\r\n b = '0x' + hexColor[2] + hexColor[2]\r\n // Get channel if defined\r\n a = hexColor.length === 4 ? '0x' + hexColor[3] + hexColor[3] : a\r\n\r\n // 6 digits\r\n } else if (hexColor.length === 6 || hexColor.length === 8) {\r\n r = '0x' + hexColor[0] + hexColor[1]\r\n g = '0x' + hexColor[2] + hexColor[3]\r\n b = '0x' + hexColor[4] + hexColor[5]\r\n // Get channel if defined\r\n a = hexColor.length === 8 ? '0x' + hexColor[6] + hexColor[7] : a\r\n }\r\n\r\n return { r: Number(r), g: Number(g), b: Number(b), a: Math.min(Math.round((Number(a) / 255) * 100) / 100, 1) }\r\n}\r\n\r\n/**\r\n * Convert HEX string to HSVA color representation.\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n */\r\nexport function hexStringToHSVA(hexString: string) {\r\n return rgbaToHSVA(hexStringToRGBA(hexString))\r\n}\r\n\r\n/**\r\n * Convert HEX string to HSLA color representation.\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n */\r\nexport function hexStringToHSLA(hexString: string) {\r\n return rgbaToHSLA(hexStringToRGBA(hexString))\r\n}\r\n\r\n/**\r\n * Convert alpha value to hex value\r\n *\r\n * Input: [0,1]\r\n *\r\n * Output: alpha in HEX format\r\n */\r\nexport function alphaToHex(alpha: number) {\r\n return Math.max(Math.min(Math.round(alpha * 255), 255), 0)\r\n .toString(16)\r\n .padStart(2, '0')\r\n}\r\n\r\n/**\r\n * Convert RGBA color to HEX string.\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: color in hex6 or hex8 depending on whether or not alpha is enabled\r\n */\r\nexport function rgbaToHexString(color: RGBA, alpha = false) {\r\n const r = color.r.toString(16)\r\n const g = color.g.toString(16)\r\n const b = color.b.toString(16)\r\n const hexString = '#' + r.padStart(2, '0') + g.padStart(2, '0') + b.padStart(2, '0')\r\n\r\n if (!alpha || color.a === 1) {\r\n return hexString\r\n }\r\n\r\n return `${hexString}${alphaToHex(color.a)}`\r\n}\r\n\r\n/**\r\n * Convert HSVA object to HEX string\r\n *\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hsvaToHEXString(color: HSVA, alpha = false) {\r\n const rgbaColor = hsvaToRGBA(color)\r\n\r\n return rgbaToHexString(rgbaColor, alpha)\r\n}\r\n\r\n/**\r\n * Convert HSLA object to HEX string\r\n *\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hslaToHexString(color: HSLA, alpha = false) {\r\n const rgbaColor = hslaToRGBA(color)\r\n\r\n return rgbaToHexString(rgbaColor, alpha)\r\n}\r\n\r\n/**\r\n * Convert RGBA color to HSVA\r\n * @see https://stackoverflow.com/a/54070620/6662683\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n */\r\nexport function rgbaToHSVA(color: RGBA): HSVA {\r\n const r = color.r / 255\r\n const g = color.g / 255\r\n const b = color.b / 255\r\n\r\n const v = Math.max(r, g, b)\r\n const c = v - Math.min(r, g, b)\r\n const h = c && (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c)\r\n\r\n return {\r\n h: 60 * (h < 0 ? h + 6 : h),\r\n s: v ? c / v : 0,\r\n v: v,\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert RGBA to HSLA\r\n * @see https://stackoverflow.com/a/54071699/6662683\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n */\r\nexport function rgbaToHSLA(color: RGBA): HSLA {\r\n const r = color.r / 255\r\n const g = color.g / 255\r\n const b = color.b / 255\r\n\r\n const v = Math.max(r, g, b)\r\n const c = v - Math.min(r, g, b)\r\n const f = 1 - Math.abs(v + v - c - 1)\r\n const h = c && (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c)\r\n\r\n return {\r\n h: 60 * (h < 0 ? h + 6 : h),\r\n s: f ? c / f : 0,\r\n l: (v + v - c) / 2,\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSVA color to RGBA\r\n * @see https://stackoverflow.com/a/54024653/6662683\r\n *\r\n * Input: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hsvaToRGBA(color: HSVA): RGBA {\r\n const f = (n: number, k = (n + color.h / 60) % 6) => color.v - color.v * color.s * Math.max(Math.min(k, 4 - k, 1), 0)\r\n\r\n return {\r\n r: Math.round(f(5) * 255),\r\n g: Math.round(f(3) * 255),\r\n b: Math.round(f(1) * 255),\r\n a: Math.round(color.a * 100) / 100,\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSLA color to RGBA\r\n * @see https://stackoverflow.com/a/54014428/6662683\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hslaToRGBA(color: HSLA): RGBA {\r\n const a = color.s * Math.min(color.l, 1 - color.l)\r\n const f = (n: number, k = (n + color.h / 30) % 12) => color.l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)\r\n\r\n return {\r\n r: Math.round(f(0) * 255),\r\n g: Math.round(f(8) * 255),\r\n b: Math.round(f(4) * 255),\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert RGBA color to rgba() string\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: rgba(r, g, b, a)\r\n */\r\nexport function rgbaToRGBAString(color: RGBA) {\r\n return `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`\r\n}\r\n\r\n/**\r\n * Convert rgba() string to RGBA color\r\n *\r\n * Input: rgba(r, g, b, a)\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function rgbaStringToObject(color: string) {\r\n const colorParts = /^rgba?\\(([0-9]{1,3})[ ,]+([0-9]{1,3})[ ,]+([0-9]{1,3})[ ,]*([01].?[0-9]*)?\\)$/.exec(color)\r\n const [red, green, blue, alpha = '1'] = colorParts?.slice(1) || [0, 0, 0, 1].map(String)\r\n return {\r\n r: Number.parseInt(red),\r\n g: Number.parseInt(green),\r\n b: Number.parseInt(blue),\r\n a: Number.parseFloat(alpha),\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSLA color to hsla() string\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: hsla(h, s, l, a)\r\n */\r\nexport function hslaToHSLAString(color: HSLA) {\r\n return `hsla(${Math.round(color.h)}, ${Math.round(color.s * 10000) / 100}%, ${Math.round(color.l * 10000) / 100}%, ${\r\n color.a\r\n })`\r\n}\r\n\r\nexport function removeHashSymbol(strColor: string) {\r\n return strColor.replace(/#/g, '')\r\n}\r\n\r\n/**\r\n * Check if the param is a valid color by setting it as style\r\n */\r\nexport function isValidColor(strColor: string) {\r\n const isRgb = strColor.startsWith('rgba')\r\n const s = new Option().style\r\n\r\n s.color = isRgb ? strColor : `#${removeHashSymbol(strColor)}`\r\n\r\n return s.color !== ''\r\n}\r\n\r\n/**\r\n * Normalize color to be a hex value\r\n */\r\nexport function convertColorToHEX(strColor: string) {\r\n const isRgb = getIsRgb(strColor)\r\n\r\n if (isRgb) {\r\n return rgbaToHexString(rgbaStringToObject(strColor), true)\r\n }\r\n\r\n return strColor\r\n}\r\n\r\n/**\r\n * Returns true if color is rgb or rgba\r\n */\r\nexport function getIsRgb(strColor: string, isAlphaAllowed = true) {\r\n const rgbKeys = ['rgb']\r\n if (isAlphaAllowed) {\r\n rgbKeys.push('rgba')\r\n }\r\n return rgbKeys.some((startsWith) => strColor.startsWith(startsWith))\r\n}\r\n\r\n/**\r\n * Convert any color format to HSVA (internal color picker representation)\r\n */\r\nexport function getHSVAFromColor(strColor: string) {\r\n if (getIsRgb(strColor)) {\r\n return rgbaToHSVA(rgbaStringToObject(strColor))\r\n }\r\n\r\n return hexStringToHSVA(strColor)\r\n}\r\n\r\n/**\r\n * Stringify HSVA color representation into a output format\r\n */\r\nexport function stringifyHSVAColor(color: HSVA, output: 'rgba' | 'hex', canSelectAlpha?: boolean) {\r\n switch (output) {\r\n case 'rgba':\r\n return rgbaToRGBAString(hsvaToRGBA(color))\r\n default:\r\n return hsvaToHEXString(color, canSelectAlpha)\r\n }\r\n}\r\n\r\n/**\r\n * Get luma value from RGBA color using the Rec. 709 coefficients\r\n * @see https://en.wikipedia.org/wiki/Luma_%28video%29\r\n *\r\n * If luma is >= 165 the foreground color should be dark\r\n */\r\nexport function getLumaFromRGBA(color: RGBA) {\r\n return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b\r\n}\r\n\r\n/**\r\n * Checks if luma is >= 165 or alpha < 0.3\r\n */\r\nexport function getIsColorTooLightOrTransparent(color: RGBA) {\r\n return getLumaFromRGBA(color) >= 165 || color.a < 0.5\r\n}\r\n\r\n/**\r\n * Set specific alpha for a hex color\r\n */\r\nexport function getHEXWithSpecificAplha(color: string, alpha = 1) {\r\n const rgbaColor = hexStringToRGBA(color)\r\n return rgbaToHexString({ ...rgbaColor, a: alpha }, true)\r\n}\r\n\r\n/**\r\n * Get rgba from valid color string\r\n */\r\nexport function getRGBAValueFromValidColorString(value: string) {\r\n if (getIsRgb(value)) return rgbaToRGBAString(rgbaStringToObject(value))\r\n return rgbaToRGBAString(hexStringToRGBA(value))\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface LightnessProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nexport function Alpha({ color, onChange }: LightnessProps) {\r\n const changeLightness = useCallback((pos: Interaction) => onChange({ ...color, a: 1 - pos.left }), [onChange, color])\r\n\r\n const gradientPreview = useMemo(() => {\r\n const gradientFrom = hsvaToHEXString({ ...color, a: 1 })\r\n const gradientTo = hsvaToHEXString({ ...color, a: 0 }, true)\r\n\r\n return `linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`\r\n // Don’t recalculate when alpha changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [color.h, color.s, color.v])\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n","import { Icon } from '../icon'\r\nimport { HSVA, hexStringToHSVA } from './util'\r\n\r\nconst DEFAULT_COLORS = [\r\n { title: 'Rose', value: '#f43f5e' },\r\n { title: 'Pink', value: '#db2777' },\r\n { title: 'Fuchsia', value: '#c026d3' },\r\n { title: 'Purple', value: '#9333ea' },\r\n { title: 'Violet', value: '#7c3aed' },\r\n { title: 'Indigo', value: '#4f46e5' },\r\n { title: 'Blue', value: '#2563eb' },\r\n { title: 'Light Blue', value: '#0284c7' },\r\n { title: 'Cyan', value: '#0891b2' },\r\n { title: 'Teal', value: '#0d9488' },\r\n { title: 'Emerald', value: '#059669' },\r\n { title: 'Green', value: '#16a34a' },\r\n { title: 'Lime', value: '#65a30d' },\r\n { title: 'Yellow', value: '#eab308' },\r\n { title: 'Amber', value: '#d97706' },\r\n { title: 'Red', value: '#dc2626' },\r\n]\r\n\r\ninterface ColorItem {\r\n /**\r\n * Name of the color\r\n */\r\n title: string\r\n\r\n /**\r\n * Hex value\r\n */\r\n value: string\r\n}\r\n\r\ninterface ColorPaletteProps {\r\n /**\r\n * Current selected color in HEX format (supports HEX8 for alpha)\r\n */\r\n color: string\r\n\r\n /**\r\n * List of colors to display in the palette\r\n *\r\n * @default DEFAULT_COLORS\r\n */\r\n colors?: ColorItem[]\r\n\r\n /**\r\n * Callback when user picks a color\r\n */\r\n onChange: (color: string, originalColor: HSVA) => void\r\n}\r\n\r\nexport function ColorPalette({ color, colors = DEFAULT_COLORS, onChange }: ColorPaletteProps) {\r\n const lowerCaseColor = color.toLowerCase()\r\n\r\n return (\r\n
\r\n {colors.map((colorObj) => {\r\n const isSelected = lowerCaseColor.startsWith(colorObj.value)\r\n return (\r\n onChange(colorObj.value, hexStringToHSVA(colorObj.value))}\r\n >\r\n {isSelected && }\r\n
\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface HueSaturationProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nfunction getPositionFromHSLA(color: HSVA) {\r\n return {\r\n left: color.h / 360,\r\n top: 1 - color.s,\r\n }\r\n}\r\n\r\nexport function HueSaturation({ color, onChange }: HueSaturationProps) {\r\n const position = useMemo(() => getPositionFromHSLA(color), [color])\r\n\r\n const colorPreview = useMemo(() => hsvaToHEXString({ h: color.h, s: color.s, v: 1, a: 1 }), [color.h, color.s])\r\n\r\n const changeSaturation = useCallback(\r\n (pos: Interaction) =>\r\n onChange({\r\n h: Math.round(pos.left * 360),\r\n s: 1 - pos.top,\r\n v: 1,\r\n a: color.a,\r\n }),\r\n [color.a, onChange]\r\n )\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface LightnessProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nexport function Lightness({ color, onChange }: LightnessProps) {\r\n const changeLightness = useCallback((pos: Interaction) => onChange({ ...color, v: 1 - pos.left }), [onChange, color])\r\n\r\n const colorPreview = useMemo(\r\n () => hsvaToHEXString({ h: color.h, s: color.s, v: color.v, a: 1 }),\r\n [color.h, color.s, color.v]\r\n )\r\n\r\n const gradientPreview = useMemo(() => {\r\n const gradientFrom = hsvaToHEXString({ h: color.h, s: color.s, v: 1, a: 1 })\r\n const gradientTo = hsvaToHEXString({ h: color.h, s: color.s, v: 0, a: 1 })\r\n\r\n return `linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`\r\n }, [color.h, color.s])\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from '../icon'\r\nimport { getIsColorTooLightOrTransparent, hexStringToRGBA } from './util'\r\n\r\ninterface ColorPreviewProps {\r\n /**\r\n * Name of an icon or JSX.Element\r\n */\r\n icon?: JSX.Element | IconNameType\r\n\r\n /**\r\n * One or more colors to show in the preview\r\n */\r\n color: string | string[]\r\n\r\n /**\r\n * Wrapper classname\r\n */\r\n className?: string\r\n}\r\n\r\nexport function ColorPreview({ icon, color, className }: ColorPreviewProps) {\r\n const colors = Array.isArray(color) ? color : [color]\r\n const isTooLight = getIsColorTooLightOrTransparent(hexStringToRGBA(colors[0]))\r\n return (\r\n \r\n {icon && (\r\n
\r\n {isValidIconName(icon) ? (\r\n \r\n ) : (\r\n icon\r\n )}\r\n
\r\n )}\r\n {colors.map((color, index) => (\r\n //   has to be there because of a bug on safari which ignores h-full when empty element\r\n
\r\n  \r\n
\r\n ))}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React, { ForwardedRef, useCallback, useEffect, useState } from 'react'\r\n\r\nimport { Input, InputComponentProps } from '../input'\r\nimport { ColorPreview } from './color-preview'\r\nimport { ColorPickerProps } from './picker'\r\nimport * as colorUtil from './util'\r\n\r\ninterface PickerInputProps extends Omit {\r\n color: ColorPickerProps['color']\r\n onChange: ColorPickerProps['onChange']\r\n\r\n /*\r\n * Is color preview square visible\r\n *\r\n * @default true\r\n * */\r\n hasColorPreview?: boolean\r\n}\r\nexport const PickerInput = React.forwardRef(\r\n (\r\n { color, inputClass, hasColorPreview = true, onChange, ...props }: PickerInputProps,\r\n ref: ForwardedRef\r\n ) => {\r\n const [colorInput, setColorInput] = useState(colorUtil.removeHashSymbol(color))\r\n const isRgba = colorUtil.getIsRgb(colorInput)\r\n\r\n useEffect(() => {\r\n setColorInput(colorUtil.removeHashSymbol(color))\r\n }, [color])\r\n\r\n const handleColorInputChange = useCallback(\r\n (event) => {\r\n const value = colorUtil.removeHashSymbol(event.currentTarget.value)\r\n const isRgba = value.startsWith('rgba')\r\n const colorValue = isRgba ? value : `#${value}`\r\n\r\n setColorInput(value)\r\n if ((value.length >= 6 || (isRgba && value.length >= 16)) && colorUtil.isValidColor(colorValue)) {\r\n onChange(colorValue, colorUtil.hexStringToHSVA(colorValue))\r\n }\r\n },\r\n [onChange]\r\n )\r\n return (\r\n \r\n {hasColorPreview && }\r\n {!isRgba && #}\r\n
\r\n }\r\n onChange={handleColorInputChange}\r\n />\r\n )\r\n }\r\n)\r\n","import classnames from 'classnames'\r\nimport React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Button } from '../button'\r\nimport { Popover, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { Alpha } from './alpha'\r\nimport { ColorPalette } from './color-palette'\r\nimport { HueSaturation } from './hue-saturation'\r\nimport { Lightness } from './lightness'\r\nimport { PickerInput } from './picker-input'\r\nimport * as colorUtil from './util'\r\n\r\nexport interface ColorPickerProps {\r\n /**\r\n * The selected color in HEX format (supports HEX8 for alpha)\r\n */\r\n color: string\r\n\r\n /**\r\n * Whether or not the user is able to select custom color\r\n *\r\n * @default true\r\n */\r\n canSelectCustom?: boolean\r\n\r\n /**\r\n * Whether or not the user is able to change alpha channel. Only applicable\r\n * when `canSelectCustom` is true\r\n *\r\n * @default true\r\n */\r\n canSelectAlpha?: boolean\r\n\r\n /**\r\n * Sets the output format for the color picker\r\n *\r\n * @default 'hex'\r\n */\r\n outputFormat?: 'hex' | 'rgba'\r\n\r\n /**\r\n * Callback when user changes color. Use the second parameter to do color space\r\n * conversions otherwise the color could differ due to rounding\r\n */\r\n onChange: (color: string, originalColor: colorUtil.HSVA) => void\r\n\r\n /**\r\n * Callback when user clicks on a palette item. Used to close popover\r\n */\r\n onPaletteItemClick?: () => void\r\n}\r\n\r\nexport function ColorPicker({\r\n color,\r\n canSelectCustom = true,\r\n canSelectAlpha = true,\r\n outputFormat = 'hex',\r\n onChange,\r\n onPaletteItemClick,\r\n}: ColorPickerProps) {\r\n const cachedColor = useRef(color)\r\n const [hsvaColor, setColor] = useState(colorUtil.getHSVAFromColor(color))\r\n\r\n /**\r\n * Update state if the color from outside changed\r\n */\r\n useEffect(() => {\r\n const currentColor = colorUtil.removeHashSymbol(cachedColor.current)\r\n const newColor = colorUtil.removeHashSymbol(color)\r\n\r\n if (currentColor === newColor || !colorUtil.isValidColor(newColor)) return\r\n\r\n cachedColor.current = color\r\n setColor(colorUtil.getHSVAFromColor(color))\r\n }, [color])\r\n\r\n /**\r\n * Handle color change\r\n * 1. update cache so we can correctly check when outside color updates\r\n * 2. Update internal color representation\r\n * 3. call onChange with string color\r\n */\r\n const onChangeCallback = useCallback(\r\n (color: colorUtil.HSVA) => {\r\n const stringColor = colorUtil.stringifyHSVAColor(color, outputFormat, canSelectAlpha)\r\n cachedColor.current = stringColor\r\n onChange(stringColor, color)\r\n setColor(color)\r\n },\r\n [onChange, canSelectAlpha, outputFormat]\r\n )\r\n\r\n const onSetCustomCodeClick = useCallback(() => {\r\n const value = prompt('Enter a color code')?.trim()\r\n\r\n if (!value) return\r\n\r\n const isValid = colorUtil.isValidColor(value)\r\n\r\n if (!isValid) {\r\n return alert('The code is not a valid color')\r\n }\r\n\r\n onChangeCallback(colorUtil.getHSVAFromColor(value))\r\n }, [onChangeCallback])\r\n\r\n return (\r\n
\r\n {canSelectCustom && (\r\n <>\r\n {isMobile() && (\r\n \r\n )}\r\n \r\n \r\n\r\n {canSelectAlpha && }\r\n \r\n )}\r\n\r\n \r\n {\r\n onPaletteItemClick?.()\r\n onChangeCallback({ ...orignalColor, a: hsvaColor.a })\r\n }}\r\n />\r\n
\r\n \r\n )\r\n}\r\n\r\ninterface InputColorPickerProps extends ColorPickerProps {\r\n /**\r\n * Label for the input\r\n */\r\n label?: ReactNode\r\n inputDataTestId?: string\r\n}\r\n\r\nexport function InputColorPicker({ label, inputDataTestId, onChange, ...props }: InputColorPickerProps) {\r\n const popoverState = usePopoverState()\r\n const canSelectCustom = props.canSelectCustom !== false\r\n const isMobileDevice = isMobile()\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {\r\n if (canSelectCustom) return\r\n popoverState.hide()\r\n }}\r\n />\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Button, ButtonComponentProps, ButtonRounding, ButtonSizeType } from '../button'\r\nimport { ButtonGroup } from '../button-group'\r\nimport { IconNameType } from '../icon'\r\nimport { Popover, PopoverProps, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { ColorPreview } from './color-preview'\r\nimport { ColorPicker, ColorPickerProps } from './picker'\r\nimport { PickerInput } from './picker-input'\r\nimport * as colorUtil from './util'\r\n\r\ninterface MultiColorPickerProps extends ColorPickerProps {\r\n /**\r\n * Label for color text input\r\n *\r\n * @default undefined\r\n */\r\n colorInputLabel?: string\r\n}\r\n\r\nexport function MultiColorPicker({\r\n colorInputLabel,\r\n onChange,\r\n canSelectCustom = true,\r\n ...props\r\n}: MultiColorPickerProps) {\r\n const isMobileDevice = isMobile()\r\n\r\n return (\r\n <>\r\n {canSelectCustom && !isMobileDevice && (\r\n
\r\n \r\n
\r\n )}\r\n \r\n {}} />\r\n \r\n \r\n )\r\n}\r\n\r\ninterface ColorTabButtonProps extends ButtonComponentProps {\r\n /*\r\n * Preview color\r\n * */\r\n color: string\r\n}\r\n\r\nexport function ColorTabButton({ color, children, ...props }: ColorTabButtonProps) {\r\n return (\r\n }\r\n {...props}\r\n >\r\n {children}\r\n \r\n )\r\n}\r\n\r\ntype ButtonColorProperties = { color: string; label: string }\r\n\r\ninterface ButtonColorPickerProps\r\n extends Omit {\r\n /**\r\n * Temporary prop to enable/disable multi picker funcionality,\r\n * in the future we'll only use secondaryColor prop to decide if the picker is multi picker or not\r\n *\r\n * @default undefined\r\n */\r\n isMultiPicker?: boolean\r\n\r\n /**\r\n * Button classname\r\n */\r\n className?: string\r\n\r\n /**\r\n * Array of objects with color and value\r\n */\r\n colors: ColorType[]\r\n\r\n /**\r\n * Color onchange callback\r\n */\r\n onChange: (colors: ColorType[], originalColor: colorUtil.HSVA) => void\r\n\r\n /**\r\n * Button size\r\n *\r\n * @default undefined\r\n */\r\n size?: ButtonSizeType\r\n /**\r\n * Label for color text input\r\n *\r\n * @default undefined\r\n */\r\n colorInputLabel?: string\r\n\r\n /**\r\n * Name of an icon or JSX.Element\r\n */\r\n icon?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Hides color picker when clicked outside of popover,\r\n * works with changing focus from the trigger component to another one\r\n *\r\n * @default true\r\n */\r\n hideOnClickOutside: PopoverProps['hideOnClickOutside']\r\n\r\n /**\r\n * Popover overlay click callback, if nothing's provided it calls hide when clicked outside of popover on its overlay\r\n * If false is provided, overlay click calls hide func on popover state object\r\n *\r\n * @default undefined\r\n */\r\n onOverlayClick?: (() => void) | false\r\n\r\n /**\r\n * Identifier for e2e testing\r\n *\r\n * @default undefined\r\n */\r\n buttonPickerDataTestId?: string\r\n}\r\n\r\nexport function ButtonColorPicker({\r\n size,\r\n icon,\r\n colors,\r\n className,\r\n onChange,\r\n buttonPickerDataTestId,\r\n hideOnClickOutside = true,\r\n onOverlayClick,\r\n ...props\r\n}: ButtonColorPickerProps) {\r\n const popoverState = usePopoverState()\r\n const isMultiPicker = !!props.isMultiPicker && colors.length > 1\r\n const [activeColorIndex, setActiveColorIndex] = React.useState(0)\r\n const handleColorChange = React.useCallback(\r\n (color: string, originalColor: colorUtil.HSVA) => {\r\n onChange(\r\n colors.map((colorObject, index) => (index === activeColorIndex ? { ...colorObject, color } : colorObject)),\r\n originalColor\r\n )\r\n },\r\n [activeColorIndex, colors, onChange]\r\n )\r\n return (\r\n <>\r\n \r\n color)}\r\n className={classnames('h-full w-full', ButtonRounding.small)}\r\n />\r\n \r\n \r\n {isMultiPicker && (\r\n
\r\n \r\n {colors.map(({ color, label }, index) => (\r\n setActiveColorIndex(index)}\r\n >\r\n {label}\r\n \r\n ))}\r\n \r\n
\r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n","/**\r\n * Used for reakit as the duration of a open/close animation. The animation itself is done using css\r\n */\r\nexport const COMPONENT_ANIMATION_DURATION = 250\r\n","import copy from 'copy-to-clipboard'\r\nimport React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { InputProps, Textarea } from '../input'\r\n\r\ninterface Props extends Pick {\r\n className?: string\r\n text: string\r\n bottomLeftContent?: React.ReactNode\r\n}\r\n\r\nexport const CopyToClipboard: React.FC = ({ className, label, text, bottomLeftContent }) => {\r\n const [isCopied, setIsCopied] = React.useState(false)\r\n\r\n const handleCopyToClipboard = React.useCallback(() => {\r\n setIsCopied(true)\r\n copy(text)\r\n }, [text])\r\n\r\n React.useEffect(() => {\r\n let timeout: NodeJS.Timeout\r\n const resetTimer = () => {\r\n if (!timeout) return\r\n clearTimeout(timeout)\r\n }\r\n if (isCopied) {\r\n resetTimer()\r\n timeout = setTimeout(() => {\r\n setIsCopied(false)\r\n }, 2000)\r\n }\r\n\r\n return () => {\r\n resetTimer()\r\n }\r\n }, [isCopied])\r\n\r\n return (\r\n
\r\n e.currentTarget.select()}\r\n inputClass=\"h-12\"\r\n data-testid=\"copy-to-clipboard-textarea\"\r\n value={text}\r\n />\r\n
\r\n {bottomLeftContent &&
{bottomLeftContent}
}\r\n \r\n {isCopied ? 'Copied' : 'Copy'}\r\n \r\n
\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { CalendarProps } from 'react-calendar'\r\n\r\nimport { Box } from '../box'\r\nimport { ZIndexContext } from '../dialog'\r\nimport { Popover, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { Spinner } from '../spinner'\r\n\r\nconst DatePickerComponent = React.lazy(() => import('./picker'))\r\n\r\ntype RangePickerCallback = (value: [Date, Date], ev: React.ChangeEvent) => void\r\ntype PickerCallback = (value: Date, ev: React.ChangeEvent) => void\r\n\r\ninterface DatePickerProps extends Omit {\r\n /**\r\n * Trigger element for the picker\r\n */\r\n children: JSX.Element\r\n\r\n onChange: PickerCallback | RangePickerCallback\r\n}\r\n\r\nexport function DatePicker({ children, ...props }: DatePickerProps) {\r\n const popover = usePopoverState()\r\n\r\n return (\r\n <>\r\n \r\n {(triggerProps: React.HTMLProps) =>\r\n React.Children.map(children, (child) => {\r\n if (React.isValidElement(child))\r\n return React.cloneElement(child, { ...triggerProps, ...(child.props as any) })\r\n })\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n ) => {\r\n popover.hide()\r\n props.onChange?.(value, ev)\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nexport interface DelayedProps {\r\n /**\r\n * The delay in milliseconds before the component is rendered.\r\n *\r\n * @default 300\r\n */\r\n delay?: number\r\n\r\n /**\r\n * Delay in milliseconds before rendering timeout state.\r\n */\r\n timeout?: number\r\n\r\n /**\r\n * Throw on timeout (suspense)\r\n */\r\n throwOnTimeout?: boolean\r\n\r\n /**\r\n * Component visible during the delay.\r\n * If rendering text, wrap it in a `span` to prevent error — see PR#608\r\n */\r\n delayComponent?: React.ReactNode\r\n\r\n /**\r\n * Component visible when timeout is over.\r\n * If rendering text, wrap it in a `span` to prevent error — see PR#608\r\n */\r\n timeoutComponent?: React.ReactNode\r\n\r\n /**\r\n * Component visible when delay is over.\r\n * If rendering text, wrap it in a `span` to prevent error — see PR#608\r\n */\r\n children?: React.ReactNode\r\n}\r\n\r\nexport function Delayed({\r\n delay = 300,\r\n timeout = 0,\r\n throwOnTimeout = false,\r\n delayComponent,\r\n timeoutComponent,\r\n children,\r\n}: DelayedProps) {\r\n const [visible, setVisible] = React.useState(false)\r\n const [hasTimedOut, setHasTimedOut] = React.useState(false)\r\n\r\n React.useEffect(() => {\r\n const visibilityTimeout = window.setTimeout(() => setVisible(true), delay)\r\n\r\n let failedTimeout: number\r\n if (timeout > 0) {\r\n failedTimeout = window.setTimeout(() => {\r\n setHasTimedOut(true)\r\n if (throwOnTimeout) throw new Error()\r\n }, timeout)\r\n }\r\n\r\n return () => {\r\n clearTimeout(visibilityTimeout)\r\n clearTimeout(failedTimeout)\r\n }\r\n }, [delay, timeout, throwOnTimeout])\r\n\r\n if (!visible) return <>{delayComponent}\r\n\r\n if (hasTimedOut) {\r\n return <>{timeoutComponent}\r\n }\r\n\r\n return <>{children}\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Dialog'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport const ZIndexContext = React.createContext('z-50')\r\n\r\nexport function useZIndex() {\r\n return React.useContext(ZIndexContext)\r\n}\r\n\r\nexport type DialogStateReturn = ReturnType\r\n/**\r\n * Hook which provides state to dialogs\r\n */\r\nexport function useDialogState(settings?: Reakit.DialogInitialState) {\r\n return Reakit.useDialogState({ ...settings, animated: COMPONENT_ANIMATION_DURATION })\r\n}\r\n\r\nexport const DialogDragContext = React.createContext<{\r\n enabled?: boolean\r\n handleRef?: React.RefObject\r\n boxPosition: { x: number; y: number }\r\n}>({\r\n enabled: false,\r\n handleRef: undefined,\r\n boxPosition: { x: 0, y: 0 },\r\n})\r\n\r\n/**\r\n * Hook which allows an element on the page to become draggable\r\n */\r\nexport function useDrag(enabled?: boolean) {\r\n const dragging = React.useRef(false)\r\n const handleRef = React.useRef(null)\r\n const handleElement = handleRef.current\r\n\r\n /**\r\n * Set box position in both state for the component to re-render and as a ref\r\n * so that we don’t have to re-run the whole effect on every change\r\n */\r\n const [boxPosition, setBoxPosition] = React.useState({ x: 0, y: 0 })\r\n const boxPositionRef = React.useRef({ x: 0, y: 0 })\r\n const dragDiff = React.useRef({ x: 0, y: 0 })\r\n\r\n const { current: resetBoxPosition } = React.useRef(() => {\r\n boxPositionRef.current = { x: 0, y: 0 }\r\n setBoxPosition({ x: 0, y: 0 })\r\n })\r\n\r\n React.useEffect(() => {\r\n if (!enabled || !handleElement || isMobile()) return\r\n\r\n const onMouseDown = (ev: MouseEvent) => {\r\n dragging.current = true\r\n\r\n dragDiff.current = {\r\n x: ev.pageX - boxPositionRef.current.x - window.scrollX,\r\n y: ev.pageY - boxPositionRef.current.y - window.scrollY,\r\n }\r\n }\r\n\r\n const onMouseUp = () => {\r\n dragging.current = false\r\n }\r\n\r\n const onMouseMove = (ev: MouseEvent) => {\r\n if (!dragging.current) return\r\n\r\n const x = ev.pageX - dragDiff.current.x - window.scrollX\r\n const y = ev.pageY - dragDiff.current.y - window.scrollY\r\n\r\n boxPositionRef.current = { x, y }\r\n setBoxPosition({ x, y })\r\n }\r\n const onDoubleClick = () => {\r\n boxPositionRef.current = { x: 0, y: 0 }\r\n setBoxPosition({ x: 0, y: 0 })\r\n }\r\n\r\n handleElement.addEventListener('pointerdown', onMouseDown)\r\n handleElement.addEventListener('dblclick', onDoubleClick)\r\n window.addEventListener('pointerup', onMouseUp)\r\n document.body.addEventListener('pointermove', onMouseMove)\r\n\r\n return () => {\r\n handleElement.removeEventListener('pointerdown', onMouseDown)\r\n handleElement.removeEventListener('dblclick', onDoubleClick)\r\n window.removeEventListener('pointerup', onMouseUp)\r\n document.body.removeEventListener('pointermove', onMouseMove)\r\n }\r\n }, [enabled, handleElement])\r\n\r\n return {\r\n enabled,\r\n handleRef,\r\n boxPosition,\r\n resetBoxPosition,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Box, BoxProps } from '../box'\r\nimport { DialogDragContext } from './hooks'\r\n\r\n/**\r\n * Public props for the component\r\n */\r\nexport type DialogBoxProps = BoxProps\r\n\r\ninterface DialogBoxOwnProps extends DialogBoxProps {\r\n /**\r\n * This callback serves as a way to account for the time between dialog close\r\n * and animation finish. The box isn’t rendered when the dialog closes but we still\r\n * want to display content when the dialog is closing\r\n */\r\n onUnmount?: () => void\r\n}\r\n\r\n/**\r\n * Dialog content container\r\n */\r\nexport function DialogBox({ onUnmount, style, ...props }: React.PropsWithChildren) {\r\n const dialogDrag = React.useContext(DialogDragContext)\r\n\r\n // Set up an effect which only calls the unmount callback\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n React.useEffect(() => () => onUnmount?.(), [])\r\n\r\n const dialogBoxStyle = React.useMemo(() => {\r\n if (dialogDrag.enabled) {\r\n return { ...style, transform: `translate3d(${dialogDrag.boxPosition.x}px, ${dialogDrag.boxPosition.y}px, 0)` }\r\n }\r\n return style\r\n }, [style, dialogDrag])\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","/**\r\n * The backdrop of the dialog, closes the dialog on click\r\n */\r\nexport function DialogOverlay(props: { onClick: () => void }) {\r\n return
props.onClick()} />\r\n}\r\n","export function getExtendedDialogState(state: { visible: boolean; animating: boolean }) {\r\n return {\r\n isFullyOpened: state.visible && !state.animating,\r\n isFullyClosed: !state.visible && !state.animating,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Dialog'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { DialogBox, DialogBoxProps } from './dialog-box'\r\nimport { DialogOverlay } from './dialog-overlay'\r\nimport { DialogDragContext, DialogStateReturn, ZIndexContext, useDrag } from './hooks'\r\nimport { getExtendedDialogState } from './utils'\r\n\r\nexport enum DialogType {\r\n modal,\r\n drawer,\r\n}\r\n\r\nexport interface DialogProps extends DialogBoxProps, Pick {\r\n /**\r\n * The returned object from `useDialogState`\r\n */\r\n state: DialogStateReturn\r\n\r\n /**\r\n * Any additional props to the Reakit Dialog component\r\n */\r\n finalFocusRef?: React.RefObject\r\n\r\n /**\r\n * Callback which is called when the dialog closes and all animations complete\r\n */\r\n onHide?: () => void\r\n\r\n /**\r\n * Callback which is called when the dialog overlay is clicked\r\n * default behavior (closing the dialog) will be overridden so it has to be called manually\r\n */\r\n onOverlayClick?: () => void\r\n\r\n /**\r\n * Sets if the dialog can be dragged across the screen\r\n *\r\n * @default false\r\n */\r\n isDraggable?: boolean\r\n\r\n /**\r\n * Type of dialog\r\n *\r\n * @default modal\r\n */\r\n type?: keyof typeof DialogType\r\n}\r\n\r\nconst DIALOG_BACKDROP_WIDTH_CSS_VAR = '--dialog-backgrop-width'\r\n\r\n/**\r\n * The actual dialog component which renders overlay, box and handles all the\r\n * functionality like focus trapping, etc.\r\n */\r\nexport function Dialog({\r\n state,\r\n finalFocusRef,\r\n onHide,\r\n onOverlayClick,\r\n children,\r\n hide,\r\n hideOnEsc,\r\n isDraggable = false,\r\n type = 'modal',\r\n 'aria-label': ariaLabel,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const dialogDrag = useDrag(isDraggable)\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n\r\n React.useEffect(() => {\r\n const onResize = () => {\r\n // Save to css var because it can change and that could make modal dialog jump on open\r\n document.body.style.setProperty(DIALOG_BACKDROP_WIDTH_CSS_VAR, `${document.documentElement.clientWidth}px`)\r\n }\r\n\r\n window.addEventListener('resize', onResize)\r\n onResize()\r\n\r\n return () => {\r\n window.removeEventListener('resize', onResize)\r\n }\r\n }, [])\r\n\r\n const DialogWrapper = state.modal ? React.Fragment : Portal\r\n\r\n return (\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => {\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {\r\n onHide?.()\r\n dialogDrag.resetBoxPosition()\r\n }}\r\n >\r\n {children}\r\n \r\n \r\n \r\n
\r\n \r\n )\r\n }}\r\n \r\n \r\n )\r\n}\r\n","import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'\r\nimport classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\n\r\ninterface DialogBodyProps extends React.HTMLProps {\r\n /**\r\n * Whether or not the dialog body will have padding\r\n *\r\n * @default true\r\n */\r\n hasPadding?: boolean\r\n}\r\n\r\n/**\r\n * Content wrapper which handles scrolling on mobile\r\n */\r\nexport function DialogBody({ hasPadding = true, ...props }: React.PropsWithChildren) {\r\n const scrollDivRef = React.useRef(null)\r\n\r\n React.useEffect(() => {\r\n const scrollBox = scrollDivRef.current\r\n\r\n if (isMobile() && scrollBox) {\r\n disableBodyScroll(scrollBox)\r\n\r\n return () => enableBodyScroll(scrollBox)\r\n }\r\n }, [])\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { Dialog } from './dialog'\r\nimport { DialogBody } from './dialog-body'\r\nimport { DialogStateReturn } from './hooks'\r\n\r\ninterface ConfirmationDialogProps {\r\n state: DialogStateReturn\r\n title: React.ReactNode\r\n actions: React.ReactNode\r\n 'aria-label': string\r\n}\r\n\r\nexport function ConfirmationDialog(props: React.PropsWithChildren) {\r\n return (\r\n \r\n \r\n \r\n {props.title}\r\n \r\n {props.children}\r\n
{props.actions}
\r\n
\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Dialog'\r\n\r\nimport { DropdownContext } from '../dropdown'\r\nimport { DialogStateReturn } from './hooks'\r\n\r\ninterface DialogButtonProps extends Reakit.DialogDisclosureHTMLProps {\r\n state: DialogStateReturn\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const DialogTrigger = React.forwardRef(\r\n ({ state, ...props }: DialogButtonProps, ref: React.ForwardedRef) => {\r\n const dropdownContext = React.useContext(DropdownContext)\r\n\r\n return (\r\n ) => {\r\n // Close dropdown if we’re inside one\r\n dropdownContext?.root.hide()\r\n props.onClick?.(ev)\r\n }}\r\n >\r\n {props.children}\r\n \r\n )\r\n }\r\n)\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\n/**\r\n * Footer container which renders border and aligns items to right\r\n */\r\nexport function DialogFooter(props: React.PropsWithChildren>) {\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { Icon } from '../icon'\r\nimport { Heading } from '../typography'\r\nimport { DialogDragContext } from './hooks'\r\n\r\ninterface DialogHeaderProps {\r\n /**\r\n * Callback when user clicks on close button. The button will be hidden if not set\r\n */\r\n onCloseClick?: () => void\r\n\r\n /**\r\n * Additional class names for the component\r\n */\r\n className?: string\r\n}\r\n\r\n/**\r\n * Component which renders title and a close button\r\n */\r\nexport function DialogHeader({ onCloseClick, children, className }: React.PropsWithChildren) {\r\n const dialogDrag = React.useContext(DialogDragContext)\r\n\r\n return (\r\n \r\n {children && {children}}\r\n {onCloseClick && (\r\n \r\n \r\n \r\n )}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport const DropdownContext = React.createContext<{\r\n parent: Reakit.MenuStateReturn\r\n root: Reakit.MenuStateReturn\r\n} | null>(null)\r\n\r\nexport function useDropdownState(settings?: Reakit.MenuInitialState) {\r\n const context = React.useContext(DropdownContext)\r\n\r\n return Reakit.useMenuState({\r\n ...settings,\r\n loop: true,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n unstable_virtual: true,\r\n unstable_offset: context?.root ? [-5, 4] : [0, 5],\r\n modal: false,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { Box, BoxProps, BoxRounding } from '../box'\r\nimport { useZIndex } from '../dialog'\r\nimport { DropdownContext, useDropdownState } from './hooks'\r\n\r\ninterface DropdownBaseProps extends Omit {\r\n /**\r\n * Trigger button for the dropdown\r\n */\r\n label: JSX.Element\r\n\r\n /**\r\n * @private\r\n * Any additional props to the trigger button. Used by nested dropdown wrapper\r\n */\r\n triggerProps?: Reakit.MenuButtonHTMLProps\r\n\r\n /**\r\n * Rounding of all trigger button, dropdown wrapper and dropdown items\r\n */\r\n rounding?: keyof typeof BoxRounding\r\n}\r\n\r\ninterface RootDropdownProps {\r\n /**\r\n * The returned object from `useDropdownState`. For nested dropdowns use the `isNested` prop\r\n */\r\n state: Reakit.MenuStateReturn\r\n isNested?: never\r\n}\r\n\r\ninterface NestedDropdownProps {\r\n state?: never\r\n /**\r\n * When set to true the dropdown will compute its own state. Only usable with\r\n * nested dropdowns\r\n */\r\n isNested: true\r\n}\r\n\r\ntype DropdownProps = DropdownBaseProps & (RootDropdownProps | NestedDropdownProps)\r\n\r\nfunction DropdownComponent(\r\n {\r\n label,\r\n triggerProps,\r\n state,\r\n 'aria-label': ariaLabel,\r\n children,\r\n isNested,\r\n rounding,\r\n ...props\r\n }: React.PropsWithChildren,\r\n ref: React.ForwardedRef\r\n) {\r\n const zIndex = useZIndex()\r\n const context = React.useContext(DropdownContext)\r\n // Required due to the way conditional props work\r\n const dropdownState = state!\r\n if (!isNested && !dropdownState) {\r\n throw new Error('Dropdowns require either `state` or `isNested` prop defined!')\r\n }\r\n\r\n const ContainerElement = React.useRef(isNested ? React.Fragment : Portal).current\r\n\r\n return (\r\n <>\r\n \r\n {(buttonProps) =>\r\n React.cloneElement(label, {\r\n ...buttonProps,\r\n ...label.props,\r\n rounding,\r\n active: label.props.active ?? dropdownState.visible,\r\n })\r\n }\r\n \r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => (\r\n
\r\n \r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === Dropdown) {\r\n return {child}\r\n }\r\n\r\n return React.cloneElement(child, {\r\n ...child.props,\r\n rounding,\r\n })\r\n })}\r\n \r\n \r\n
\r\n )}\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport const Dropdown = React.forwardRef(DropdownComponent)\r\n\r\ninterface NestedDropdownWrapperProps {\r\n /**\r\n * State of parrent dropdown to be passed to MenuItem for correct navigation\r\n * handling\r\n */\r\n parentState: Reakit.MenuStateReturn\r\n\r\n /**\r\n * Nested dropdown element\r\n */\r\n children: JSX.Element\r\n}\r\n\r\n/**\r\n * The `useDropdownState` requires parent context to be defined in order to work\r\n * with nested Dropdowns. So we need to create a wrapper to be able to get to the\r\n * parent context\r\n */\r\nfunction NestedDropdownWrapper({ parentState, children }: NestedDropdownWrapperProps) {\r\n const state = useDropdownState()\r\n\r\n return (\r\n \r\n {(itemProps) => React.cloneElement(children, { ...children.props, triggerProps: itemProps, state })}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\n/**\r\n * When rendering multiple dropdowns, wrap them in `DropdownBar` so they can be\r\n * navigated between\r\n */\r\nexport function DropdownBar({ children, ...props }: Partial) {\r\n const state = Reakit.useMenuBarState()\r\n\r\n return (\r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n return (\r\n \r\n {(itemProps) => React.cloneElement(child, itemProps)}\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { Icon, isValidIconName } from '../icon'\r\nimport { PropsWithAs } from '../types'\r\nimport { DropdownContext } from './hooks'\r\n\r\nconst DEFAULT_ELEMENT = 'button'\r\n\r\ninterface DropdownItemProps extends ButtonProps {\r\n subtitle?: React.ReactNode\r\n\r\n /**\r\n * Whether clicking the item should also close the dropdown. Only applies to\r\n * items without a submenu\r\n *\r\n * @default true\r\n */\r\n closeOnClick?: boolean\r\n}\r\n\r\nfunction DropdownItemComponent(\r\n {\r\n as: asComponent,\r\n state,\r\n subtitle,\r\n closeOnClick = true,\r\n children,\r\n rounding,\r\n ...props\r\n }: PropsWithAs & DropdownItemProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const context = React.useContext(DropdownContext)\r\n\r\n return (\r\n \r\n {(itemProps) => {\r\n const active = itemProps['aria-selected'] && !context?.parent.animating\r\n const hasSubmenu = Boolean(itemProps['aria-haspopup'])\r\n\r\n const iconTheme = {\r\n 'text-gray-300': !active,\r\n 'text-gray-white dark:text-white': active,\r\n }\r\n\r\n return (\r\n \r\n ) : (\r\n props.leftContent\r\n )\r\n }\r\n rightContent={\r\n isValidIconName(props.rightContent) ? (\r\n \r\n ) : (\r\n props.rightContent\r\n )\r\n }\r\n onClick={(ev: React.MouseEvent) => {\r\n // Close if we clicked on an item which doesn’t have a submenu\r\n if (closeOnClick && !hasSubmenu) {\r\n context?.root.hide()\r\n }\r\n\r\n itemProps.onClick?.(ev)\r\n }}\r\n >\r\n {children}\r\n {subtitle &&
{subtitle}
}\r\n \r\n )\r\n }}\r\n
\r\n )\r\n}\r\n\r\n/**\r\n * We need to forward ref to the function, but typescript looses the type of the\r\n * props param so we need to typecast to get suggestions to work\r\n */\r\nexport const DropdownItem = React.forwardRef(DropdownItemComponent) as <\r\n TagType extends React.ElementType = typeof DEFAULT_ELEMENT\r\n>(\r\n props: PropsWithAs & DropdownItemProps & { ref?: React.ForwardedRef }\r\n) => ReturnType\r\n","import * as Reakit from 'reakit/Menu'\r\n\r\nimport { Paragraph } from '../typography'\r\n\r\nexport function DropdownSeparator(props: Partial) {\r\n return (\r\n \r\n
\r\n {props.children && (\r\n \r\n {props.children}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { ButtonGroup } from '../button-group'\r\nimport { Icon } from '../icon'\r\nimport { Dropdown } from './dropdown'\r\nimport { useDropdownState } from './hooks'\r\n\r\ninterface MoreButtonDropdownProps extends ButtonProps {\r\n /**\r\n * Children of the button\r\n */\r\n label?: React.ReactNode\r\n\r\n /**\r\n * Additional handler when user clicks on the button\r\n */\r\n onClick?: (event: React.MouseEvent) => void\r\n\r\n /**\r\n * Accessibility label for the dropdown component\r\n */\r\n 'aria-label': string\r\n}\r\n\r\nexport function MoreButtonDropdown({\r\n label,\r\n children,\r\n onClick,\r\n 'aria-label': ariaLabel,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const state = useDropdownState({ placement: 'bottom-end' })\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n {children}\r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { IconNameType, iconList } from '.'\r\nimport { SVGProps } from './svg'\r\n\r\nexport interface IconProps extends SVGProps {\r\n /**\r\n * Icon name\r\n */\r\n name?: IconNameType\r\n\r\n /**\r\n * Alternative way to pass icon to render if you want to render a custom component\r\n * or use `iconList` object lookup\r\n */\r\n as?: React.FC\r\n}\r\n\r\nexport function Icon({ name, as: asComponent, ...props }: IconProps) {\r\n const Component = name && iconList[name] ? iconList[name] : asComponent\r\n\r\n if (name && asComponent) {\r\n throw new Error('Specifying both \"name\" and \"as\" on Icon component is not supported')\r\n }\r\n\r\n if (!Component) {\r\n throw new Error('No icon to render!')\r\n }\r\n\r\n return \r\n}\r\n","import { IconAdd } from './add'\r\nimport { IconArrowForward } from './arrow-forward'\r\nimport { IconCalendar } from './calendar'\r\nimport { IconCandleBarBasic } from './candle-bar-basic'\r\nimport { IconCandleBarHeikinAshi } from './candle-bar-heikin-ashi'\r\nimport { IconCandleBarHollow } from './candle-bar-hollow'\r\nimport { IconCaretDown } from './caret-down'\r\nimport { IconCaretRight } from './caret-right'\r\nimport { IconCaretVertical } from './caretVertical'\r\nimport { IconChartBar } from './chart-bar'\r\nimport { IconChartBubble } from './chart-bubble'\r\nimport { IconChartTreemap } from './chart-treemap'\r\nimport { IconChevronDown } from './chevron-down'\r\nimport { IconChevronRight } from './chevron-right'\r\nimport { IconClose } from './close'\r\nimport { IconDarkMode } from './dark-mode'\r\nimport { IconDone } from './done'\r\nimport { IconDrawingActionDelete } from './drawing-action-delete'\r\nimport { IconDrawingSettingAutosaveOff } from './drawing-setting-autosave-off'\r\nimport { IconDrawingSettingAutosaveOn } from './drawing-setting-autosave-on'\r\nimport { IconDrawingSettingAutosaveSaving } from './drawing-setting-autosave-saving'\r\nimport { IconDrawingSettingDrawingMode } from './drawing-setting-drawing-mode'\r\nimport { IconDrawingSettingDrawingModeActive } from './drawing-setting-drawing-mode-active'\r\nimport { IconDrawingSettingHide } from './drawing-setting-hide'\r\nimport { IconDrawingSettingLock } from './drawing-setting-lock'\r\nimport { IconDrawingSettingPreserveDrawings } from './drawing-setting-preserve-drawings'\r\nimport { IconDrawingSettingPreserveDrawingsActive } from './drawing-setting-preserve-drawings-active'\r\nimport { IconDrawingSettingShow } from './drawing-setting-show'\r\nimport { IconDrawingSettingUnlock } from './drawing-setting-unlock'\r\nimport { IconExitFullscreen } from './exit-fullscreen'\r\nimport { IconFlash } from './flash'\r\nimport { IconFullscreen } from './fullscreen'\r\nimport { IconGesture } from './gesture'\r\nimport { IconGift } from './gift'\r\nimport { IconHamburger } from './hamburger'\r\nimport { IconHelp } from './help'\r\nimport { IconIdea } from './idea'\r\nimport { IconIdeaLoad } from './idea-load'\r\nimport { IconIdeaSave } from './idea-save'\r\nimport { IconInterval } from './interval'\r\nimport { IconLayout1h1v } from './layout-1h1v'\r\nimport { IconLayout1h2v } from './layout-1h2v'\r\nimport { IconLayout1h3v } from './layout-1h3v'\r\nimport { IconLayout1l2r } from './layout-1l2r'\r\nimport { IconLayout1t2b } from './layout-1t2b'\r\nimport { IconLayout2h1v } from './layout-2h1v'\r\nimport { IconLayout2h2v } from './layout-2h2v'\r\nimport { IconLayout3h1v } from './layout-3h1v'\r\nimport { IconLayout3h2v } from './layout-3h2v'\r\nimport { IconLightMode } from './light-mode'\r\nimport { IconLineChartType } from './line-chart-type'\r\nimport { IconMenuClose } from './menu-close'\r\nimport { IconMore } from './more'\r\nimport { IconOhlcChartType } from './ohlc-chart-type'\r\nimport { IconPalette } from './palette'\r\nimport { IconProfile } from './profile'\r\nimport { IconPublish } from './publish'\r\nimport { IconRefresh } from './refresh'\r\nimport { IconRemove } from './remove'\r\nimport { IconRestore } from './restore'\r\nimport { IconSearch } from './search'\r\nimport { IconSettings } from './settings'\r\nimport { IconSettingsWheel } from './settings-wheel'\r\nimport { IconShare } from './share'\r\nimport { IconSignOut } from './sign-out'\r\nimport { IconStar } from './star'\r\nimport { IconStarOutlined } from './star-outlined'\r\nimport { SVG, SVGProps } from './svg'\r\nimport { IconSwitchHorizontal } from './switch-horizontal'\r\nimport { IconSwitchVertical } from './switch-vertical'\r\nimport { IconTabKey } from './tab-key'\r\nimport { IconTemplate } from './template'\r\nimport { IconToolArrow } from './tool-arrow'\r\nimport { IconToolBrush } from './tool-brush'\r\nimport { IconToolCallout } from './tool-callout'\r\nimport { IconToolCurve } from './tool-curve'\r\nimport { IconToolElliottWave } from './tool-elliott-wave'\r\nimport { IconToolEllipse } from './tool-ellipse'\r\nimport { IconToolExpand } from './tool-expand'\r\nimport { IconToolFibonacci } from './tool-fibonacci'\r\nimport { IconToolLine } from './tool-line'\r\nimport { IconToolMeasure } from './tool-measure'\r\nimport { IconToolMidlineH } from './tool-midline-h'\r\nimport { IconToolMidlineV } from './tool-midline-v'\r\nimport { IconToolMouse } from './tool-mouse'\r\nimport { IconToolPitchFork } from './tool-pitchfork'\r\nimport { IconToolPolygon } from './tool-polygon'\r\nimport { IconToolPosition } from './tool-position'\r\nimport { IconToolRect } from './tool-rect'\r\nimport { IconToolRectRotated } from './tool-rect-rotated'\r\nimport { IconToolText } from './tool-text'\r\nimport { IconToolTriangle } from './tool-triangle'\r\nimport { IconToolXABCD } from './tool-xabcd'\r\nimport { IconTrashCan } from './trash-can'\r\nimport { IconTrendingDown } from './trending-down'\r\nimport { IconTrendingUp } from './trending-up'\r\nimport { IconWarning } from './warning'\r\n\r\n// Export the Icon component itself\r\nexport * from './icon'\r\n\r\nexport function isValidIconName(name?: unknown): name is IconNameType {\r\n if (!name || typeof name !== 'string') return false\r\n\r\n return !!iconList[name as IconNameType]\r\n}\r\n\r\nexport type IconNameType = keyof typeof iconList\r\n\r\n// Export list of icon components\r\nexport const iconList = {\r\n add: IconAdd,\r\n calendar: IconCalendar,\r\n candleBarBasic: IconCandleBarBasic,\r\n candleBarHeikinAshi: IconCandleBarHeikinAshi,\r\n candleBarHollow: IconCandleBarHollow,\r\n caretDown: IconCaretDown,\r\n caretRight: IconCaretRight,\r\n caretVertical: IconCaretVertical,\r\n chartBar: IconChartBar,\r\n chartBubble: IconChartBubble,\r\n chartTreemap: IconChartTreemap,\r\n chevronDown: IconChevronDown,\r\n chevronRight: IconChevronRight,\r\n close: IconMenuClose,\r\n darkMode: IconDarkMode,\r\n done: IconDone,\r\n drawingActionDelete: IconDrawingActionDelete,\r\n drawingSettingAutosaveOff: IconDrawingSettingAutosaveOff,\r\n drawingSettingAutosaveOn: IconDrawingSettingAutosaveOn,\r\n drawingSettingAutosaveSaving: IconDrawingSettingAutosaveSaving,\r\n drawingSettingDrawingMode: IconDrawingSettingDrawingMode,\r\n drawingSettingDrawingModeActive: IconDrawingSettingDrawingModeActive,\r\n drawingSettingHide: IconDrawingSettingHide,\r\n drawingSettingLock: IconDrawingSettingLock,\r\n drawingSettingPreserveDrawings: IconDrawingSettingPreserveDrawings,\r\n drawingSettingPreserveDrawingsActive: IconDrawingSettingPreserveDrawingsActive,\r\n drawingSettingShow: IconDrawingSettingShow,\r\n drawingSettingUnlock: IconDrawingSettingUnlock,\r\n empty: (props: SVGProps) => ,\r\n exitFullscreen: IconExitFullscreen,\r\n flash: IconFlash,\r\n fullscreen: IconFullscreen,\r\n gift: IconGift,\r\n hamburger: IconHamburger,\r\n help: IconHelp,\r\n idea: IconIdea,\r\n ideaLoad: IconIdeaLoad,\r\n ideaSave: IconIdeaSave,\r\n interval: IconInterval,\r\n layout1h1v: IconLayout1h1v,\r\n layout1h2v: IconLayout1h2v,\r\n layout1h3v: IconLayout1h3v,\r\n layout1l2r: IconLayout1l2r,\r\n layout1t2b: IconLayout1t2b,\r\n layout2h1v: IconLayout2h1v,\r\n layout2h2v: IconLayout2h2v,\r\n layout3h1v: IconLayout3h1v,\r\n layout3h2v: IconLayout3h2v,\r\n lightMode: IconLightMode,\r\n lineChartType: IconLineChartType,\r\n menuClose: IconClose,\r\n more: IconMore,\r\n ohlcChartType: IconOhlcChartType,\r\n profile: IconProfile,\r\n publish: IconPublish,\r\n refresh: IconRefresh,\r\n remove: IconRemove,\r\n restore: IconRestore,\r\n settingsWheel: IconSettingsWheel,\r\n gesture: IconGesture,\r\n search: IconSearch,\r\n settings: IconSettings,\r\n share: IconShare,\r\n signOut: IconSignOut,\r\n switchHorizontal: IconSwitchHorizontal,\r\n switchVertical: IconSwitchVertical,\r\n tabKey: IconTabKey,\r\n template: IconTemplate,\r\n toolArrow: IconToolArrow,\r\n toolBrush: IconToolBrush,\r\n toolCallout: IconToolCallout,\r\n toolCurve: IconToolCurve,\r\n toolElliottWave: IconToolElliottWave,\r\n toolEllipse: IconToolEllipse,\r\n toolExpand: IconToolExpand,\r\n toolFibonacci: IconToolFibonacci,\r\n toolLine: IconToolLine,\r\n toolMeasure: IconToolMeasure,\r\n toolMidLineH: IconToolMidlineH,\r\n toolMidLineV: IconToolMidlineV,\r\n toolMouse: IconToolMouse,\r\n toolPitchfork: IconToolPitchFork,\r\n toolPolygon: IconToolPolygon,\r\n toolPosition: IconToolPosition,\r\n toolRect: IconToolRect,\r\n toolRectRotated: IconToolRectRotated,\r\n toolText: IconToolText,\r\n toolTriangle: IconToolTriangle,\r\n toolXABCD: IconToolXABCD,\r\n warning: IconWarning,\r\n palette: IconPalette,\r\n arrowForward: IconArrowForward,\r\n trendingUp: IconTrendingUp,\r\n trendingDown: IconTrendingDown,\r\n trashCan: IconTrashCan,\r\n star: IconStar,\r\n starOutlined: IconStarOutlined,\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconAdd(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCalendar(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCandleBarBasic(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCandleBarHeikinAshi(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCandleBarHollow(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCaretDown(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCaretRight(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCaretVertical(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartBar(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartBubble(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartTreemap(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChevronDown(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChevronRight(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconMenuClose(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDarkMode(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDone(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingActionDelete(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingAutosaveOff(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingAutosaveOn(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingAutosaveSaving(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingDrawingMode(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingDrawingModeActive(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingHide(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingLock(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingPreserveDrawings(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingPreserveDrawingsActive(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingShow(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingUnlock(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconExitFullscreen(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconFlash(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconFullscreen(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconGift(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconHamburger(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconHelp(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconIdea(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconIdeaLoad(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconIdeaSave(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconInterval(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1h1v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1h2v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1h3v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1l2r(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1t2b(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout2h1v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout2h2v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout3h1v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout3h2v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLightMode(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLineChartType(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconClose(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconMore(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconOhlcChartType(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconProfile(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconPublish(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconRefresh(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconRemove(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconRestore(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSettingsWheel(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconGesture(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSearch(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSettings(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconShare(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSignOut(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSwitchHorizontal(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSwitchVertical(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTabKey(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTemplate(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolArrow(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolBrush(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolCallout(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolCurve(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolElliottWave(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolEllipse(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolExpand(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolFibonacci(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolLine(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMeasure(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMidlineH(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMidlineV(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMouse(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolPitchFork(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolPolygon(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolPosition(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolRect(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolRectRotated(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolText(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolTriangle(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolXABCD(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconWarning(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconPalette(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconArrowForward(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTrendingUp(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTrendingDown(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTrashCan(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconStar(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconStarOutlined(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nexport type SVGProps = React.SVGProps\r\n\r\nexport function SVG({ className, width = 16, height = width, ...props }: SVGProps) {\r\n return (\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport { ForwardedRef, HTMLProps, PropsWithChildren, ReactNode, forwardRef, useMemo } from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from './icon'\r\nimport { Label } from './typography'\r\n\r\nexport enum InputTheme {\r\n none,\r\n light,\r\n dark,\r\n}\r\n\r\nexport enum InputRounding {\r\n none = '',\r\n regular = 'rounded-md',\r\n}\r\n\r\n/**\r\n * Enum for input size. Only set size on larger viewports to avoid page zooming\r\n */\r\nexport enum InputSize {\r\n small = 'h-6 text-2xs', // 24px height\r\n regular = 'h-7 text-2xs', // 28px height\r\n medium = 'h-8 text-sm', // 32px height\r\n large = 'h-9 text-sm', // 36px height\r\n}\r\n\r\nfunction getInputTheme(theme: InputTheme, isError = false) {\r\n switch (theme) {\r\n case InputTheme.none:\r\n return {}\r\n case InputTheme.dark:\r\n return {\r\n input: classnames('border bg-gray-800 text-gray-50 disabled:bg-gray-700 disabled:text-gray-400', {\r\n 'border-gray-600 hover:border-gray-400 focus:border-blue-400 disabled:border-gray-700': !isError,\r\n 'border-red-400': isError,\r\n }),\r\n icon: classnames({\r\n 'text-gray-500 group-focus-within:text-blue-400': !isError,\r\n 'text-red-400': isError,\r\n }),\r\n }\r\n default:\r\n return {\r\n input: classnames(\r\n 'border', // Base styles\r\n 'bg-white disabled:bg-gray-50 disabled:text-gray-500', // Light\r\n 'dark:bg-gray-800 dark:disabled:bg-gray-700 dark:disabled:text-gray-400', // Dark\r\n {\r\n 'border-gray-100 hover:border-gray-300 focus:border-blue-400 disabled:hover:border-gray-100 dark:border-gray-600 dark:hover:border-gray-400 dark:focus:border-blue-400 dark:disabled:border-gray-700':\r\n !isError,\r\n 'border-red-400': isError,\r\n }\r\n ),\r\n icon: classnames({\r\n 'text-gray-300 group-focus-within:text-blue-400 dark:text-gray-500': !isError,\r\n 'text-red-400': isError,\r\n }),\r\n }\r\n }\r\n}\r\n\r\ntype OmitNativeProps = Omit, 'label' | 'size'>\r\n\r\nexport interface InputProps {\r\n /**\r\n * Label which is rendered above the input\r\n */\r\n label?: ReactNode\r\n\r\n /**\r\n * Theme for the input\r\n *\r\n * @default light\r\n */\r\n theme?: keyof typeof InputTheme\r\n\r\n /**\r\n * Input size. This setting is ignored on mobile to avoid zoom\r\n *\r\n * @default regular\r\n */\r\n size?: keyof typeof InputSize\r\n\r\n /**\r\n * Border radius of the input\r\n *\r\n * @default regular\r\n */\r\n rounding?: keyof typeof InputRounding\r\n\r\n /**\r\n * Element to display on left the side of the input or name of the icon\r\n */\r\n leftContent?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Element to display on right the side of the input or name of the icon\r\n */\r\n rightContent?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Additional class names for the input\r\n */\r\n inputClass?: string\r\n\r\n /**\r\n * Error label to display under the input\r\n */\r\n error?: ReactNode\r\n\r\n /**\r\n * Additional info to display under the input\r\n */\r\n caption?: ReactNode\r\n}\r\n\r\nexport type InputHTMLProps = OmitNativeProps\r\n\r\nexport type InputComponentProps = InputProps & InputHTMLProps\r\n\r\nfunction InputComponent(\r\n {\r\n label,\r\n size = 'regular',\r\n theme = 'light',\r\n rounding = 'regular',\r\n leftContent,\r\n rightContent,\r\n inputClass,\r\n error,\r\n caption,\r\n className,\r\n ...props\r\n }: InputComponentProps,\r\n ref: ForwardedRef\r\n) {\r\n const inputTheme = useMemo(() => getInputTheme(InputTheme[theme], !!error), [theme, error])\r\n const isLeftStringIcon = isValidIconName(leftContent)\r\n const isRightStringIcon = isValidIconName(rightContent)\r\n const inputSize = InputSize[size]\r\n\r\n const commonSideContentClassnames = useMemo(\r\n () => ({\r\n 'flex absolute top-0 justify-center items-center ml-px h-full': true,\r\n 'text-gray-500 dark:text-gray-600': theme === 'light',\r\n 'text-gray-600': theme === 'dark',\r\n }),\r\n [theme]\r\n )\r\n\r\n return (\r\n
\r\n
\r\n \r\n {caption && typeof caption !== 'boolean' && (\r\n {caption}\r\n )}\r\n {error && typeof error !== 'boolean' && {error}}\r\n
\r\n )\r\n}\r\n\r\ninterface InputCaptionProps extends Omit, 'size'> {\r\n size?: keyof typeof InputSize\r\n}\r\n\r\nfunction InputCaption({ size = 'regular', ...props }: PropsWithChildren) {\r\n return (\r\n \r\n )\r\n}\r\n\r\ntype TextareaProps = Omit & OmitNativeProps\r\n\r\nfunction TextareaComponent(\r\n { label, theme = 'light', rounding = 'regular', inputClass, error, caption, className, ...props }: TextareaProps,\r\n ref: ForwardedRef\r\n) {\r\n const textareaTheme = useMemo(() => getInputTheme(InputTheme[theme], !!error), [theme, error])\r\n\r\n return (\r\n
\r\n \r\n {caption && typeof caption !== 'boolean' && (\r\n {caption}\r\n )}\r\n {error && typeof error !== 'boolean' && {error}}\r\n
\r\n )\r\n}\r\n\r\nexport const Input = forwardRef(InputComponent)\r\nexport const Textarea = forwardRef(TextareaComponent)\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Composite'\r\n\r\nexport const ListContext = React.createContext(null)\r\n\r\nexport function useListState(options?: Reakit.CompositeInitialState) {\r\n return Reakit.useCompositeState({ ...options, loop: true, unstable_virtual: true })\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Composite'\r\n\r\nimport { BUTTON_DEFAULT_ELEMENT, Button, ButtonComponentProps, ButtonTheme } from '../button'\r\nimport { ListContext } from './hooks'\r\n\r\nexport interface ListItemProps {\r\n /**\r\n * Theme when the button is selected\r\n */\r\n activeTheme?: keyof typeof ButtonTheme\r\n\r\n /**\r\n * Close parent popover when the item is clicked\r\n */\r\n closeOnSelect?: boolean\r\n\r\n /**\r\n * OnChange callback when item is clicked or navigated to\r\n * @private\r\n */\r\n onSelectItem?: (item: string, closeOnSelect?: boolean) => void\r\n}\r\n\r\nexport function ListItem({\r\n as,\r\n activeTheme = 'blue',\r\n onSelectItem,\r\n onClick,\r\n onKeyPress,\r\n className,\r\n closeOnSelect = true,\r\n children,\r\n ...props\r\n}: React.PropsWithChildren & ButtonComponentProps) {\r\n const state = React.useContext(ListContext)\r\n\r\n return (\r\n {\r\n onClick?.(ev)\r\n onSelectItem?.(ev.currentTarget.id, closeOnSelect)\r\n }}\r\n onKeyPress={(ev) => {\r\n onKeyPress?.(ev)\r\n onSelectItem?.(ev.currentTarget.id, closeOnSelect)\r\n }}\r\n >\r\n {(itemProps: ButtonComponentProps) => {\r\n const active = Boolean(itemProps['aria-selected'])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Composite'\r\n\r\nimport { ListContext } from './hooks'\r\nimport { ListItem } from './list-item'\r\n\r\ninterface ListProps extends Omit {\r\n /**\r\n * The returned object from `useListState`\r\n */\r\n state: Reakit.CompositeStateReturn\r\n\r\n /**\r\n * The selected option\r\n */\r\n selectedIndex?: number\r\n\r\n /**\r\n * Callback when selected option index changes\r\n */\r\n onChange?: (selectedIndex: number, closeParent?: boolean) => void\r\n\r\n /**\r\n * Whether or not default styles should be included for the list\r\n * @default true\r\n */\r\n includeBaseStyles?: boolean\r\n}\r\n\r\nexport function List({ state, selectedIndex, includeBaseStyles = true, onChange, children, ...props }: ListProps) {\r\n const prevSelected = React.useRef(null)\r\n\r\n // Select option when `selectedIndex` changes\r\n React.useEffect(() => {\r\n if (\r\n selectedIndex !== undefined &&\r\n selectedIndex >= 0 &&\r\n prevSelected.current !== selectedIndex &&\r\n state.items.length > selectedIndex\r\n ) {\r\n state.move(state.items[selectedIndex].id)\r\n prevSelected.current = selectedIndex\r\n }\r\n }, [selectedIndex, state, state.items.length])\r\n\r\n const onSelectItem = React.useCallback(\r\n (id: string, closeParent: boolean) => {\r\n onChange?.(\r\n state.items.findIndex((item) => item.id === id),\r\n closeParent\r\n )\r\n },\r\n [onChange, state.items]\r\n )\r\n\r\n return (\r\n \r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === ListItem) {\r\n return React.cloneElement(child, { ...child.props, onSelectItem: onSelectItem })\r\n }\r\n\r\n return child\r\n })}\r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nexport type NotificationContextType = ReturnType\r\n\r\nexport enum NotificationPosition {\r\n TopLeft,\r\n TopRight,\r\n BottomLeft,\r\n BottomRight,\r\n}\r\n\r\nexport interface NotificationOptions {\r\n position: NotificationPosition\r\n inline?: boolean\r\n}\r\n\r\nexport const NotificationContext = React.createContext<{\r\n show: (element: JSX.Element, options?: NotificationOptions) => void\r\n hide: () => void\r\n}>({\r\n show: () => {},\r\n hide: () => {},\r\n})\r\n\r\nexport function useNotification() {\r\n return React.useContext(NotificationContext)\r\n}\r\n","import classnames from 'classnames'\r\nimport throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\nimport { Dialog, useDialogState } from 'reakit/Dialog'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\nimport { getExtendedDialogState } from '../dialog'\r\nimport { NotificationContext, NotificationOptions, NotificationPosition } from './hooks'\r\n\r\ninterface NotificationState {\r\n element: JSX.Element\r\n options: Partial\r\n}\r\n\r\nfunction getViewport(visualViewport: VisualViewport | null) {\r\n const width = visualViewport?.width ?? window.innerWidth\r\n const height = visualViewport?.height ?? window.innerHeight\r\n const scale = visualViewport?.scale ?? 1\r\n\r\n return {\r\n top: visualViewport?.offsetTop ?? 0,\r\n left: visualViewport?.offsetLeft ?? 0,\r\n scale: Math.round((1 / scale) * 100) / 100,\r\n width: Math.round(width * scale),\r\n height: Math.round(height * scale),\r\n }\r\n}\r\n\r\nexport function NotificationWrapper(props: React.PropsWithChildren) {\r\n const state = useDialogState({ modal: false, animated: COMPONENT_ANIMATION_DURATION })\r\n const [notification, setNotification] = React.useState(null)\r\n const { isFullyClosed, isFullyOpened } = getExtendedDialogState(state)\r\n const [viewport, setViewport] = React.useState(getViewport(window.visualViewport))\r\n\r\n React.useEffect(() => {\r\n if (!notification) return\r\n\r\n const handleResize = throttle((ev: Event) => {\r\n const viewport = ev.currentTarget as VisualViewport\r\n if (viewport) {\r\n setViewport(() => getViewport(viewport))\r\n }\r\n }, 50)\r\n\r\n window.visualViewport?.addEventListener('resize', handleResize)\r\n window.visualViewport?.addEventListener('scroll', handleResize)\r\n\r\n return () => {\r\n window.visualViewport?.removeEventListener('resize', handleResize)\r\n window.visualViewport?.removeEventListener('scroll', handleResize)\r\n }\r\n }, [notification])\r\n\r\n const context = React.useRef({\r\n show: (element: JSX.Element, options: Partial = {}) => {\r\n setViewport(() => getViewport(window.visualViewport))\r\n setNotification({ element, options })\r\n state.show()\r\n },\r\n hide: state.hide,\r\n })\r\n\r\n const positionClass = React.useMemo(() => {\r\n const { position = NotificationPosition.BottomLeft } = notification?.options ?? {}\r\n return {\r\n '[--inset-t:1rem] items-start pt-inset-top': [\r\n NotificationPosition.TopLeft,\r\n NotificationPosition.TopRight,\r\n ].includes(position),\r\n '[--inset-r:1rem] justify-end landscape-secondary:pr-inset-right': [\r\n NotificationPosition.TopRight,\r\n NotificationPosition.BottomRight,\r\n ].includes(position),\r\n '[--inset-b:1rem] items-end pb-inset-bottom': [\r\n NotificationPosition.BottomLeft,\r\n NotificationPosition.BottomRight,\r\n ].includes(position),\r\n '[--inset-l:1rem] justify-start landscape-primary:pl-inset-left': [\r\n NotificationPosition.TopLeft,\r\n NotificationPosition.BottomLeft,\r\n ].includes(position),\r\n }\r\n }, [notification?.options])\r\n\r\n const WrapperComponent = React.useMemo(\r\n () => (notification?.options.inline ? React.Fragment : Portal),\r\n [notification?.options.inline]\r\n )\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => {\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n \r\n \r\n {notification?.element}\r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { useNotification } from './hooks'\r\n\r\ninterface NotificationProps {\r\n className?: string\r\n actions?: JSX.Element\r\n timeoutInMs?: number\r\n}\r\n\r\nexport function Notification(props: React.PropsWithChildren) {\r\n const notification = useNotification()\r\n\r\n React.useEffect(() => {\r\n let timeoutId: NodeJS.Timeout\r\n if (props.timeoutInMs) {\r\n timeoutId = setTimeout(() => {\r\n notification.hide()\r\n }, props.timeoutInMs)\r\n }\r\n\r\n return () => {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId)\r\n }\r\n }\r\n }, [notification, props.timeoutInMs])\r\n\r\n return (\r\n \r\n
{props.children}
\r\n
{props.actions ?? }
\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { NotificationContextType, useNotification } from './hooks'\r\n\r\nexport function withNotificationContext(\r\n WrappedComponent: React.ComponentType\r\n) {\r\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name ?? 'Component'\r\n const WithNotificationContext = (props: Omit) => {\r\n const notification = useNotification()\r\n return \r\n }\r\n\r\n WithNotificationContext.displayName = `withNotificationContext(${displayName})`\r\n\r\n return WithNotificationContext\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { useWindowSize } from '../../hooks/use-window-size'\r\nimport { Box, BoxProps, BoxTheme } from '../box'\r\nimport { getExtendedDialogState, useZIndex } from '../dialog'\r\nimport { TooltipArrow } from '../tooltip/tooltip-arrow'\r\nimport { PopoverStateReturn } from './hooks'\r\n\r\nconst POPOVER_HEIGHT_LIMIT_STYLE = {\r\n maxHeight: 'calc(var(--popover-max-height) - env(safe-area-inset-bottom))',\r\n}\r\n\r\nexport interface PopoverProps extends BoxProps, Pick {\r\n /**\r\n * The returned object from `usePopoverState`\r\n */\r\n state: PopoverStateReturn\r\n\r\n /**\r\n * Focus the popover when it opens\r\n *\r\n * @default true\r\n */\r\n focusOnShow?: Reakit.PopoverProps['unstable_autoFocusOnShow']\r\n\r\n /**\r\n * Focus the anchor element when it closes\r\n *\r\n * @default true\r\n */\r\n focusOnHide?: Reakit.PopoverProps['unstable_autoFocusOnHide']\r\n\r\n /**\r\n * Focus the anchor element when it closes\r\n *\r\n * @default undefined\r\n */\r\n finalFocusRef?: Reakit.PopoverProps['unstable_finalFocusRef']\r\n\r\n /**\r\n * Hides when clicked outside of popover, works with changing focus from the trigger component to another one\r\n *\r\n * @default true\r\n */\r\n hideOnClickOutside?: Reakit.PopoverProps['hideOnClickOutside']\r\n\r\n /**\r\n * Overlay click callback or if false is provided, overlay click calls hide func on popover state object\r\n *\r\n * @default undefined\r\n */\r\n onOverlayClick?: (() => void) | false\r\n\r\n /**\r\n * Popover wrapper css style object\r\n *\r\n * @default undefined\r\n */\r\n popoverWrapperStyle?: React.CSSProperties\r\n\r\n /**\r\n * Show popover arrow\r\n *\r\n * @default false\r\n */\r\n hasArrow?: boolean\r\n\r\n /**\r\n * Enable or disable backdrop click events\r\n *\r\n * @default true\r\n */\r\n hasBackdrop?: boolean\r\n\r\n /**\r\n * Set the popover to height to be limited by the viewport instead of having full height\r\n *\r\n * @default false\r\n */\r\n hasViewportHeightLimit?: boolean\r\n\r\n /**\r\n * Set the popover max-width to be limited by the trigger button\r\n */\r\n hasButtonWidthLimit?: boolean\r\n}\r\n\r\nexport function Popover({\r\n state,\r\n children,\r\n focusOnShow = true,\r\n focusOnHide = true,\r\n finalFocusRef,\r\n 'aria-label': ariaLabel,\r\n hide,\r\n hideOnClickOutside = true,\r\n hasArrow = false,\r\n hasBackdrop = true,\r\n onOverlayClick,\r\n popoverWrapperStyle,\r\n theme = 'light',\r\n hasViewportHeightLimit = false,\r\n hasButtonWidthLimit = false,\r\n ...props\r\n}: PopoverProps) {\r\n const { innerHeight } = useWindowSize()\r\n const zIndex = useZIndex()\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n\r\n const buttonElement = state.unstable_referenceRef.current\r\n React.useEffect(() => {\r\n if (!buttonElement || !state.visible || !(hasViewportHeightLimit || hasButtonWidthLimit)) return\r\n\r\n const buttonRect = buttonElement.getBoundingClientRect()\r\n const popoverId = buttonElement.getAttribute('aria-controls')\r\n const popoverWrapper = popoverId ? document.getElementById(popoverId) : null\r\n\r\n // Limit popover max-width to be width of the trigger button\r\n if (hasButtonWidthLimit) {\r\n popoverWrapper?.style.setProperty('max-width', `${buttonRect.width}px`)\r\n }\r\n\r\n // Limit popover height to be always be in viewport if `hasViewportHeightLimit` set\r\n if (hasViewportHeightLimit) {\r\n const [, offsetY] = state.offsets\r\n const popoverMaxHeight = innerHeight - buttonRect.bottom - offsetY * 2\r\n popoverWrapper?.style.setProperty('--popover-max-height', `${popoverMaxHeight}px`)\r\n }\r\n }, [state.visible, state.offsets, buttonElement, hasViewportHeightLimit, hasButtonWidthLimit, innerHeight])\r\n\r\n return (\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => {\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n <>\r\n {\r\n // prevents from page scroll when clicked outside of popover\r\n event.preventDefault()\r\n }}\r\n />\r\n \r\n \r\n {hasArrow && (\r\n \r\n \r\n \r\n )}\r\n {children}\r\n \r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n )\r\n}\r\n","import throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\n\r\ninterface Props {\r\n throttleWaitInMs?: number\r\n}\r\n\r\nexport function useWindowSize({ throttleWaitInMs = 300 }: Props = {}) {\r\n const [size, setSize] = React.useState({\r\n innerWidth: window.innerWidth,\r\n innerHeight: window.innerHeight,\r\n })\r\n\r\n React.useEffect(() => {\r\n const handleResize = throttle(() => {\r\n setSize({\r\n innerWidth: window.innerWidth,\r\n innerHeight: window.innerHeight,\r\n })\r\n }, throttleWaitInMs)\r\n\r\n window.addEventListener('resize', handleResize)\r\n\r\n return () => {\r\n window.removeEventListener('resize', handleResize)\r\n }\r\n }, [throttleWaitInMs])\r\n\r\n return size\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport type PopoverStateReturn = ReturnType\r\n\r\nconst DEFAULT_OFFSET: [number, number] = [0, 5]\r\nconst HOVER_TIMEOUT = 150\r\n\r\nconst preventDefault = (ev: React.MouseEvent) => {\r\n ev.preventDefault()\r\n}\r\n\r\n/**\r\n * Hook which provides state to dialogs\r\n */\r\nexport function usePopoverState(settings?: Reakit.PopoverInitialState) {\r\n const offsets = (settings?.unstable_offset ?? DEFAULT_OFFSET) as [number, number]\r\n const popover = Reakit.usePopoverState({\r\n ...settings,\r\n placement: settings?.placement ?? 'bottom-start',\r\n unstable_offset: offsets,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n modal: false,\r\n })\r\n\r\n return { ...popover, offsets }\r\n}\r\n\r\nexport function useHoverPopover(settings?: Reakit.PopoverInitialState) {\r\n const popover = usePopoverState(settings)\r\n const showTimeout = React.useRef(null)\r\n const hideTimeout = React.useRef(null)\r\n\r\n const clearTimeouts = React.useRef(() => {\r\n if (showTimeout.current !== null) {\r\n window.clearTimeout(showTimeout.current)\r\n }\r\n if (hideTimeout.current !== null) {\r\n window.clearTimeout(hideTimeout.current)\r\n }\r\n })\r\n\r\n const showPopover = React.useRef(() => {\r\n clearTimeouts.current()\r\n showTimeout.current = window.setTimeout(() => {\r\n popover.show()\r\n }, HOVER_TIMEOUT)\r\n })\r\n\r\n const hidePopover = React.useRef(() => {\r\n clearTimeouts.current()\r\n hideTimeout.current = window.setTimeout(() => {\r\n popover.hide()\r\n }, HOVER_TIMEOUT)\r\n })\r\n\r\n // Unmount cleanup\r\n React.useEffect(() => () => clearTimeouts.current(), [])\r\n\r\n return {\r\n ...popover,\r\n show: showPopover.current,\r\n hide: hidePopover.current,\r\n onMouseOver: showPopover.current,\r\n onMouseOut: hidePopover.current,\r\n onMouseDown: preventDefault,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { useZIndex } from '../dialog'\r\n\r\ninterface PopoverButtonProps extends Reakit.PopoverDisclosureHTMLProps {\r\n state: Reakit.PopoverStateReturn\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const PopoverTrigger = React.forwardRef(\r\n ({ state, ...props }: PopoverButtonProps, ref: React.ForwardedRef) => {\r\n const zIndex = useZIndex()\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n }\r\n)\r\n","// Disable rule as the component is external\r\n\r\n/* eslint-disable react/jsx-pascal-case */\r\nimport classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Combobox'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { PropsWithAs } from '../types'\r\n\r\nconst DEFAULT_ELEMENT = 'button'\r\n\r\nexport interface ComboBoxItemProps extends ButtonProps {\r\n /**\r\n * The returned object from `useComboBoxState`\r\n */\r\n state?: Reakit.unstable_ComboboxStateReturn\r\n\r\n /**\r\n * Value for the combo box item\r\n */\r\n value: string\r\n}\r\n\r\nexport function ComboBoxItem({\r\n as: asComponent,\r\n state,\r\n children,\r\n ...props\r\n}: PropsWithAs & ComboBoxItemProps) {\r\n return (\r\n \r\n {(itemProps) => {\r\n const selected = state?.currentId === itemProps.id\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n","// Disable rule as the component is external\r\n\r\n/* eslint-disable react/jsx-pascal-case */\r\nimport classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Combobox'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { Box, BoxProps } from '../box'\r\nimport { useZIndex } from '../dialog'\r\nimport { Input, InputProps } from '../input'\r\nimport { ComboBoxItem } from './combo-box-item'\r\n\r\ninterface ComboBoxProps extends Omit {\r\n /**\r\n * The returned object from `useComboBoxState`\r\n */\r\n state: Reakit.unstable_ComboboxStateReturn\r\n\r\n /**\r\n * Additional props for the input\r\n */\r\n inputProps?: Partial & Partial\r\n\r\n /**\r\n * Additional props for the popover\r\n */\r\n popoverProps?: Partial\r\n\r\n /**\r\n * Callback when user presses enter\r\n */\r\n onChange: (value: string) => void\r\n}\r\n\r\nexport function ComboBox({\r\n state,\r\n children,\r\n inputProps,\r\n popoverProps,\r\n onChange,\r\n 'aria-label': ariaLabel,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const zIndex = useZIndex()\r\n\r\n return (\r\n <>\r\n {\r\n if (ev.key === 'Enter') {\r\n onChange(state.inputValue)\r\n }\r\n inputProps?.onKeyDown?.(ev)\r\n }}\r\n />\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => (\r\n
\r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === ComboBoxItem) {\r\n return React.cloneElement(child as React.ReactElement>, {\r\n state,\r\n onMouseUp: () => {\r\n onChange(child.props.value)\r\n },\r\n })\r\n }\r\n\r\n return child\r\n })}\r\n \r\n
\r\n )}\r\n
\r\n
\r\n \r\n )\r\n}\r\n","import { Instrument } from '../../types'\r\n\r\nexport const INSTRUMENT_CATEGORIES = [\r\n { name: 'All', instrument: undefined },\r\n { name: 'Stocks', instrument: Instrument.stock },\r\n { name: 'Futures', instrument: Instrument.futures },\r\n { name: 'Forex', instrument: Instrument.forex },\r\n { name: 'Crypto', instrument: Instrument.crypto },\r\n]\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, PropsWithChildren } from 'react'\r\n\r\nexport function Centered(props: PropsWithChildren>) {\r\n return
\r\n}\r\n","import { FallbackProps } from 'react-error-boundary'\r\n\r\nimport { link } from '../../services/routing'\r\nimport { Button } from '../button'\r\nimport { Centered } from '../centered'\r\nimport { Icon } from '../icon'\r\nimport { Heading, Paragraph } from '../typography'\r\n\r\nexport function SearchError(props: FallbackProps) {\r\n return (\r\n \r\n \r\n \r\n Error fetching the results\r\n \r\n \r\n There’s been an error fetching your results. Please try again or{' '}\r\n \r\n contact support\r\n \r\n .\r\n \r\n \r\n \r\n )\r\n}\r\n","import { useMemo } from 'react'\r\n\r\ninterface HighlightProps {\r\n /**\r\n * Search string that will be highlighted\r\n */\r\n highlight: string\r\n /**\r\n * Text to be highlighted\r\n */\r\n text: string\r\n}\r\n\r\nexport function Highlight({ highlight, text }: HighlightProps) {\r\n const index = text.toLowerCase().indexOf(highlight.toLowerCase())\r\n\r\n const processedText = useMemo(\r\n () => ({\r\n before: text.substring(0, index),\r\n highlight: text.substring(index, index + highlight.length),\r\n after: text.substring(index + highlight.length),\r\n }),\r\n [highlight.length, index, text]\r\n )\r\n\r\n if (index < 0 || highlight.length < 1) return {text}\r\n\r\n return (\r\n <>\r\n {processedText.before}\r\n {!!processedText.highlight.length && (\r\n \r\n {processedText.highlight}\r\n \r\n )}\r\n {processedText.after}\r\n \r\n )\r\n}\r\n","import { getSanitizedTicker } from '../../../app/shared/ticker-sanitizer'\r\nimport { link } from '../../services/routing'\r\nimport { Instrument } from '../../types'\r\nimport { getInstrumentForTicker } from '../../util'\r\n\r\nexport function getRedirectForTicker(tickerRaw: string) {\r\n const ticker = getSanitizedTicker(tickerRaw, true)\r\n const type = getInstrumentForTicker(ticker)\r\n\r\n switch (Instrument[type]) {\r\n case Instrument.stock:\r\n return link.toQuote(ticker)\r\n case Instrument.forex:\r\n return link.toForexChartDetail(ticker)\r\n case Instrument.futures:\r\n return link.toFuturesChartDetail(ticker)\r\n case Instrument.crypto:\r\n return link.toCryptoChartDetail(ticker)\r\n default:\r\n // Not used right now, all instruments are `stock` by default\r\n return link.toSearch(ticker)\r\n }\r\n}\r\n","import { SearchApiResult } from '../../services/api'\r\nimport { ComboBoxItem, ComboBoxItemProps } from '../combo-box'\r\nimport { Highlight } from '../highlight'\r\nimport { getRedirectForTicker } from './util'\r\n\r\ninterface SearchItemProps extends Pick {\r\n item: SearchApiResult\r\n}\r\n\r\nexport function SearchItem(props: SearchItemProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {props.item.exchange}\r\n \r\n )\r\n}\r\n","import { useQuery } from 'react-query'\r\nimport * as Reakit from 'reakit/Combobox'\r\n\r\nimport { searchApiRequest } from '../../services/api'\r\nimport { link } from '../../services/routing'\r\nimport { InstrumentType } from '../../types'\r\nimport { Button } from '../button'\r\nimport { Centered } from '../centered'\r\nimport { Icon } from '../icon'\r\nimport { Spinner } from '../spinner'\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { SearchItem } from './search-item'\r\n\r\ninterface SearchListProps {\r\n state: Reakit.unstable_ComboboxStateReturn\r\n instrument?: InstrumentType\r\n}\r\n\r\nexport function SearchList(props: SearchListProps) {\r\n const { data, isLoading } = useQuery(\r\n ['search', props.state.inputValue, props.instrument],\r\n () => searchApiRequest(props.state.inputValue, props.instrument),\r\n {\r\n enabled: props.state.inputValue.length > 0,\r\n keepPreviousData: true,\r\n staleTime: Infinity,\r\n }\r\n )\r\n\r\n if (isLoading) {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n if (!data?.length) {\r\n return (\r\n \r\n \r\n \r\n We couldn’t find any results\r\n \r\n \r\n Try refining your search and try again.\r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n
\r\n
\r\n {data.map((item) => (\r\n \r\n ))}\r\n
\r\n \r\n Show all results\r\n \r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { ErrorBoundary } from 'react-error-boundary'\r\nimport { useQueryErrorResetBoundary } from 'react-query'\r\n\r\nimport { ComboBox, useComboBoxState } from '../combo-box'\r\nimport { getExtendedDialogState } from '../dialog'\r\nimport { InputTheme } from '../input'\r\nimport { List, ListItem, useListState } from '../list'\r\nimport { INSTRUMENT_CATEGORIES } from './constants'\r\nimport { SearchError } from './search-error'\r\nimport { SearchList } from './search-list'\r\nimport { getRedirectForTicker } from './util'\r\n\r\ninterface SearchProps {\r\n autoFocus?: boolean\r\n defaultValue?: string\r\n theme?: keyof typeof InputTheme\r\n}\r\n\r\nexport function Search(props: SearchProps) {\r\n const { reset } = useQueryErrorResetBoundary()\r\n const state = useComboBoxState({ minValueLength: 1, inputValue: props.defaultValue, placement: 'bottom-end' })\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n const listState = useListState({ orientation: 'vertical' })\r\n const [category, setCategory] = React.useState(0)\r\n\r\n const changeCategory = React.useRef((ev: React.KeyboardEvent) => {\r\n switch (ev.key) {\r\n case 'ArrowRight':\r\n state.first()\r\n break\r\n case 'ArrowUp':\r\n setCategory((state) => (state - 1 + INSTRUMENT_CATEGORIES.length) % INSTRUMENT_CATEGORIES.length)\r\n break\r\n case 'ArrowDown':\r\n setCategory((state) => (state + 1) % INSTRUMENT_CATEGORIES.length)\r\n break\r\n }\r\n })\r\n\r\n /**\r\n * The search box can be child of a modal/dialog so we need to handle ESC\r\n * otherwise it would close both the combobox and the parent.\r\n */\r\n const onInputKeyDown = React.useCallback(\r\n (ev: React.KeyboardEvent) => {\r\n if (ev.key === 'Escape' && state.visible) {\r\n ev.stopPropagation()\r\n state.hide()\r\n }\r\n },\r\n // We only use `visible` and `hide` and don’t need the full state\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [state.visible, state.hide]\r\n )\r\n\r\n /**\r\n * Reset to category \"All\" when the combobox closes\r\n */\r\n React.useEffect(() => {\r\n if (isFullyClosed) {\r\n setCategory(0)\r\n }\r\n }, [isFullyClosed])\r\n\r\n return (\r\n {\r\n const redirectUri = getRedirectForTicker(value)\r\n window.location.href = redirectUri\r\n }}\r\n >\r\n
\r\n setCategory(index)}\r\n onKeyDown={changeCategory.current}\r\n >\r\n {INSTRUMENT_CATEGORIES.map((category) => (\r\n {category.name}\r\n ))}\r\n \r\n {(state.visible || state.animating) && (\r\n \r\n \r\n \r\n )}\r\n
\r\n \r\n )\r\n}\r\n","import * as Reakit from 'reakit/Combobox'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport function useComboBoxState(options?: Reakit.unstable_ComboboxInitialState) {\r\n return Reakit.unstable_useComboboxState({\r\n ...options,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n modal: false,\r\n inline: true,\r\n unstable_offset: [0, 5],\r\n })\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { PopoverStateReturn } from '../popover'\r\nimport { SelectItem } from './types'\r\n\r\nfunction getSelectedItemIndex(items: SelectItem[], value: unknown) {\r\n if (!value) return -1\r\n\r\n return items.findIndex((item) => item.value === value)\r\n}\r\n\r\n/**\r\n * Hook which handles select state and returns onChange handler\r\n */\r\nexport function useSelect>(\r\n state: PopoverStateReturn,\r\n defaultValue: ValueType | undefined,\r\n items: ItemType[],\r\n onChange: (item: ItemType) => void\r\n) {\r\n const [selectedIndex, setSelectedIndex] = React.useState(getSelectedItemIndex(items, defaultValue))\r\n const closePopover = React.useRef(() => state.hide())\r\n\r\n // Update select value on change from outside\r\n React.useEffect(() => {\r\n const newIndex = getSelectedItemIndex(items, defaultValue)\r\n setSelectedIndex(newIndex)\r\n }, [items, selectedIndex, defaultValue])\r\n\r\n const onItemChange = React.useCallback(\r\n (index: number, closeOnSelect = true) => {\r\n const selectedItem = items[index]\r\n setSelectedIndex(index)\r\n\r\n if (!selectedItem.href || !selectedItem.reloadDocument) {\r\n onChange(selectedItem)\r\n if (closeOnSelect) closePopover.current()\r\n return\r\n }\r\n\r\n if (typeof selectedItem.href === 'string') {\r\n window.location.href = selectedItem.href\r\n return\r\n }\r\n\r\n const newUrl = new URL(selectedItem.href.pathname, window.location.href)\r\n newUrl.search = selectedItem.href.search\r\n newUrl.hash = selectedItem.href.hash\r\n\r\n window.location.href = newUrl.toString()\r\n },\r\n [items, onChange, setSelectedIndex]\r\n )\r\n\r\n return { selectedIndex, onItemChange }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonHTMLProps, ButtonProps, ButtonTheme, ButtonThemeType } from '../button'\r\nimport { Icon } from '../icon'\r\nimport { PopoverStateReturn, PopoverTrigger } from '../popover'\r\n\r\nfunction getButtonProps(theme: ButtonTheme, active: boolean): ButtonProps & ButtonHTMLProps {\r\n switch (theme) {\r\n case ButtonTheme.light:\r\n return {\r\n theme: 'transparent',\r\n contentClass: 'font-normal truncate',\r\n className: classnames(\r\n 'border bg-white pr-1 disabled:border-gray-100 disabled:bg-gray-50 disabled:text-gray-500 dark:bg-gray-800',\r\n {\r\n 'border-gray-100 hover:border-gray-300 disabled:hover:border-gray-100 dark:border-gray-600 dark:hover:border-gray-400 dark:disabled:border-gray-700':\r\n !active,\r\n 'border-blue-400 dark:border-blue-400': active,\r\n }\r\n ),\r\n rightContent: (\r\n \r\n ),\r\n }\r\n case ButtonTheme.dark:\r\n return {\r\n theme: 'transparent',\r\n contentClass: 'font-normal truncate',\r\n className: classnames('border bg-gray-800 pr-1 text-gray-50 disabled:border-gray-700 disabled:text-gray-500', {\r\n 'border-gray-600 hover:border-gray-400': !active,\r\n 'border-blue-400': active,\r\n }),\r\n rightContent: (\r\n \r\n ),\r\n }\r\n default:\r\n return {}\r\n }\r\n}\r\n\r\ninterface SelectButtonProps extends ButtonProps, ButtonHTMLProps {\r\n /**\r\n * Theme for the button\r\n *\r\n * @default light\r\n */\r\n theme?: ButtonThemeType\r\n\r\n state: PopoverStateReturn\r\n}\r\n\r\nexport function SelectButton({ state, theme = 'light', ...props }: SelectButtonProps) {\r\n const themeProps = React.useMemo(() => getButtonProps(ButtonTheme[theme], state.visible), [theme, state.visible])\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport { useInRouterContext } from 'react-router-dom'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { ButtonHTMLProps, ButtonProps } from '../button'\r\nimport { ListItem } from '../list'\r\nimport { PopoverStateReturn, usePopoverState } from '../popover'\r\nimport { Label } from '../typography'\r\nimport { useSelect } from './hooks'\r\nimport { NativeSelect, NativeSelectInRouterContext } from './native-select'\r\nimport { SelectButton } from './select-button'\r\nimport { SelectList, SelectListProps } from './select-list'\r\nimport { SelectItem } from './types'\r\n\r\n/**\r\n * All non-select props get passed to the button element, these are the supported props\r\n */\r\ntype ButtonPassthroughProps = Omit &\r\n Omit\r\n\r\nexport interface SelectProps extends ButtonPassthroughProps {\r\n /**\r\n * Optional popover state settings\r\n */\r\n popoverStateSettings?: Reakit.PopoverInitialState\r\n\r\n /**\r\n * Name of the select, will be included in `onChange` event\r\n */\r\n name?: Name\r\n\r\n /**\r\n * Current selected value\r\n */\r\n value?: ValueType\r\n\r\n /**\r\n * List of items to display in the select\r\n */\r\n items: ItemType[]\r\n\r\n /**\r\n * Callback when selected item changes\r\n */\r\n onChange?: (item: ItemType, name: Name) => void\r\n\r\n /**\r\n * Label to display above the select\r\n */\r\n label?: React.ReactNode\r\n\r\n /**\r\n * Text for the button (usually the selected value). Falls back to placeholder if not set\r\n */\r\n buttonContent?: React.ReactNode\r\n\r\n /**\r\n * Placeholder when no value is selected\r\n */\r\n placeholder?: string\r\n\r\n /**\r\n * Additional props to the popover list\r\n */\r\n listProps?: Omit\r\n\r\n /**\r\n * Optional label className override\r\n */\r\n labelClassName?: string\r\n\r\n /**\r\n * Should use native select element on mobile devices\r\n *\r\n * @default true\r\n */\r\n isNativeMobileSelect?: boolean\r\n\r\n /**\r\n * Set the popover to height to be limited by the viewport instead of having full height\r\n *\r\n * @default false\r\n */\r\n hasPopoverViewportHeightLimit?: boolean\r\n\r\n /**\r\n * Set the popover max-width to be limited by the trigger button\r\n */\r\n hasPopoverButtonWidthLimit?: boolean\r\n}\r\n\r\nexport function Select, Name = never>({\r\n children,\r\n popoverStateSettings,\r\n ...props\r\n}: SelectProps) {\r\n const popoverState = usePopoverState(popoverStateSettings)\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport interface StatelessSelectProps extends SelectProps {\r\n /**\r\n * Popover state for handling list in popover\r\n */\r\n popoverState: PopoverStateReturn\r\n}\r\n\r\nexport function StatelessSelect, Name = never>({\r\n // Select\r\n name,\r\n label,\r\n value,\r\n items = [],\r\n onChange,\r\n labelClassName,\r\n 'aria-label': ariaLabel,\r\n // Button\r\n theme,\r\n buttonContent,\r\n placeholder = 'Select value',\r\n // Popover\r\n popoverState,\r\n listProps,\r\n isNativeMobileSelect = true,\r\n hasPopoverViewportHeightLimit = false,\r\n hasPopoverButtonWidthLimit = true,\r\n children,\r\n ...props\r\n}: StatelessSelectProps) {\r\n const { selectedIndex, onItemChange } = useSelect(popoverState, value, items, (item) => onChange?.(item, name!))\r\n const showMobileSelect = isNativeMobileSelect && isMobile()\r\n\r\n /** Items can have `href` and be router Links. We need a way to account for this in native select */\r\n const isInRouterContext = useInRouterContext()\r\n const NativeSelectComponent = isInRouterContext ? NativeSelectInRouterContext : NativeSelect\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport const SelectOption = ListItem\r\n","import * as React from 'react'\r\n\r\nimport { usePopoverState } from '../popover'\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from '../tooltip'\r\nimport { Paragraph } from '../typography'\r\nimport { SelectProps, StatelessSelect } from './select'\r\nimport { SelectItem } from './types'\r\n\r\nexport interface SelectWithTooltipProps extends SelectProps {\r\n /**\r\n * Labels which renders in tooltip on hover\r\n */\r\n tooltipLabel?: string\r\n}\r\n\r\nexport function SelectWithTooltip, Name = never>({\r\n children,\r\n tooltipLabel,\r\n popoverStateSettings,\r\n isNativeMobileSelect = false,\r\n ...props\r\n}: SelectWithTooltipProps) {\r\n const popoverState = usePopoverState(popoverStateSettings)\r\n const tooltip = useTooltipState({ placement: 'bottom', unstable_timeout: 300 })\r\n const isTooltipIgnored = React.useRef(false)\r\n\r\n /**\r\n * Ignore focus re-trigger (do not show tooltip) when page visibility/focus state changes\r\n * - some browsers re-trigger focus on `activeElement` when document becomes visible\r\n */\r\n React.useEffect(() => {\r\n const onChange = () => {\r\n if (\r\n document.visibilityState === 'visible' &&\r\n document.activeElement === popoverState.unstable_referenceRef.current\r\n ) {\r\n isTooltipIgnored.current = true\r\n tooltip.hide()\r\n }\r\n }\r\n\r\n document.addEventListener('visibilitychange', onChange)\r\n window.addEventListener('blur', onChange)\r\n return () => {\r\n document.removeEventListener('visibilitychange', onChange)\r\n window.removeEventListener('blur', onChange)\r\n }\r\n // Changing this to `tooltip` dependency will run this effect on every render\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [popoverState.unstable_referenceRef, tooltip.hide])\r\n\r\n // hide tooltip when select dropdown opens\r\n React.useEffect(() => {\r\n if (popoverState.visible) {\r\n isTooltipIgnored.current = true\r\n tooltip.hide()\r\n }\r\n }, [popoverState.visible, tooltip])\r\n\r\n const onSelectFocus = React.useRef(() => {\r\n if (!isTooltipIgnored.current) tooltip.show()\r\n })\r\n\r\n // Make sure the tooltip doesn’t reopen when the select is closed until focused again\r\n const onSelectBlur = React.useRef(() => {\r\n isTooltipIgnored.current = popoverState.visible\r\n if (!isTooltipIgnored.current) tooltip.hide()\r\n })\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { useNavigate } from 'react-router-dom'\r\n\r\nimport { SelectItem } from './types'\r\n\r\ninterface NativeSelectProps extends Omit, 'onChange'> {\r\n items: ItemType[]\r\n onChange: (itemIndex: number) => void\r\n}\r\n\r\nexport function NativeSelect>({\r\n items,\r\n onChange,\r\n placeholder = 'Select value',\r\n ...props\r\n}: NativeSelectProps) {\r\n const showPlaceholder = props.value === -1\r\n const handleNativeSelectChange = React.useCallback(\r\n (e: React.ChangeEvent) => {\r\n const itemIndex = e.target.selectedIndex + (showPlaceholder ? -1 : 0)\r\n const selectedItem = items[itemIndex]\r\n\r\n if (!selectedItem.href || !selectedItem.reloadDocument) {\r\n onChange(itemIndex)\r\n return\r\n }\r\n\r\n if (typeof selectedItem.href === 'string') {\r\n window.location.href = selectedItem.href\r\n return\r\n }\r\n\r\n const newUrl = new URL(selectedItem.href.pathname, window.location.href)\r\n newUrl.search = selectedItem.href.search\r\n newUrl.hash = selectedItem.href.hash\r\n\r\n window.location.href = newUrl.toString()\r\n },\r\n [items, onChange, showPlaceholder]\r\n )\r\n\r\n return (\r\n \r\n {showPlaceholder && }\r\n {items.map((item, i) => (\r\n \r\n ))}\r\n \r\n )\r\n}\r\n\r\nexport function NativeSelectInRouterContext>(props: NativeSelectProps) {\r\n const navigate = useNavigate()\r\n\r\n const onChangeWithNavigate = React.useCallback(\r\n (itemIndex: number) => {\r\n const selectedItem = props.items[itemIndex]\r\n props.onChange(itemIndex)\r\n\r\n if (selectedItem.href) navigate(selectedItem.href)\r\n },\r\n // We don’t need the whole props here, just onChange and items\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [navigate, props.onChange, props.items]\r\n )\r\n\r\n return \r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { List, useListState } from '../list'\r\nimport { Popover, PopoverProps } from '../popover'\r\n\r\nexport interface SelectListProps extends Omit {\r\n /**\r\n * The index of selected item\r\n */\r\n selectedIndex?: number\r\n\r\n /**\r\n * Handler called when selected item in list changes\r\n */\r\n onChange: (item: number) => void\r\n}\r\n\r\nexport function SelectList({\r\n selectedIndex,\r\n onChange,\r\n 'aria-label': ariaLabel,\r\n children,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const listState = useListState({ currentId: null })\r\n\r\n return (\r\n \r\n \r\n {children}\r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\n\r\ninterface SpinnerProps {\r\n /**\r\n * Spinner as progress bar\r\n * @default false\r\n */\r\n isProgressBar?: boolean\r\n\r\n /**\r\n * Progress number in percent\r\n * @default 0\r\n */\r\n progress?: number\r\n\r\n /**\r\n * Spinner box width\r\n *\r\n * @default 28\r\n */\r\n width?: number\r\n}\r\n\r\nexport function Spinner({ isProgressBar = false, progress = 0, width = 28 }: SpinnerProps) {\r\n const radius = (3 * width) / 7\r\n const strokeWidth = radius / 3\r\n const circleXY = radius + strokeWidth / 2\r\n const circumference = radius * 2 * Math.PI\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { TooltipColor } from './types'\r\n\r\nexport interface TooltipBoxProps extends Omit, 'ref'> {\r\n /**\r\n * Color of the tooltip. If se to `none`, the tooltip will have default color\r\n * based on light/dark theme\r\n *\r\n * @default 'none'\r\n */\r\n color?: keyof typeof TooltipColor\r\n}\r\n\r\nexport const TooltipBox = React.forwardRef(function TooltipBox(\r\n { color = 'none', ...props }: TooltipBoxProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const tooltipColor = TooltipColor[color]\r\n\r\n return (\r\n \r\n {props.children}\r\n
\r\n )\r\n})\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Tooltip'\r\n\r\nimport { TooltipArrow } from './tooltip-arrow'\r\nimport { TooltipBox, TooltipBoxProps } from './tooltip-box'\r\n\r\ninterface TooltipProps extends TooltipBoxProps {\r\n /**\r\n * The returned object from `useTooltipState`\r\n */\r\n state: Reakit.TooltipStateReturn\r\n}\r\n\r\nexport function Tooltip({ state, children, color = 'none', ...props }: React.PropsWithChildren) {\r\n return (\r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...tooltipProps }) => (\r\n
\r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Tooltip'\r\n\r\ninterface TooltipButtonProps extends Reakit.TooltipReferenceHTMLProps {\r\n state: Reakit.TooltipStateReturn\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const TooltipTrigger = React.forwardRef(\r\n ({ state, ...props }: TooltipButtonProps, ref: React.ForwardedRef) => (\r\n \r\n {props.children}\r\n \r\n )\r\n)\r\n","import * as Reakit from 'reakit/Tooltip'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\n/**\r\n * Hook which provides state to tooltips\r\n */\r\nexport function useTooltipState(settings?: Reakit.TooltipInitialState) {\r\n return Reakit.useTooltipState({\r\n ...settings,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\n\r\nimport { TooltipColor } from './types'\r\n\r\ntype PositionMain = 'auto' | 'top' | 'bottom' | 'left' | 'right'\r\ntype PositionSecondary = 'start' | 'end'\r\ntype Placement = PositionMain | `${PositionMain}-${PositionSecondary}`\r\n\r\nconst transformMap: Record = {\r\n auto: '',\r\n top: 'rotateZ(180deg)',\r\n right: 'rotateZ(-90deg)',\r\n bottom: 'rotateZ(360deg)',\r\n left: 'rotateZ(90deg)',\r\n}\r\n\r\ninterface TooltipArrowProps {\r\n color?: keyof typeof TooltipColor\r\n placement: Placement\r\n className?: string\r\n}\r\n\r\n/**\r\n * Custom arrow for the dropdown\r\n */\r\nexport function TooltipArrow({ placement, color = 'none', className }: TooltipArrowProps) {\r\n const positionMain = placement.split('-')[0] as PositionMain\r\n const arrowColor = TooltipColor[color]\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","export enum TooltipColor {\r\n none,\r\n green,\r\n red,\r\n orange,\r\n blue,\r\n dark,\r\n}\r\n","import classnames from 'classnames'\r\nimport React, { ComponentProps, ElementType, HTMLProps, PropsWithChildren, ReactNode } from 'react'\r\n\r\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6\r\n\r\ninterface HeadingProps extends HTMLProps {\r\n /**\r\n * Heading level\r\n */\r\n level: HeadingLevel\r\n}\r\n\r\nfunction getHeadingElement(level: HeadingLevel) {\r\n switch (level) {\r\n case 1:\r\n return 'h1'\r\n case 2:\r\n return 'h2'\r\n case 3:\r\n return 'h3'\r\n case 4:\r\n return 'h4'\r\n case 5:\r\n return 'h5'\r\n default:\r\n return 'h6'\r\n }\r\n}\r\n\r\nexport function Heading({ level, children, ...props }: PropsWithChildren) {\r\n return React.createElement(\r\n getHeadingElement(level),\r\n {\r\n ...props,\r\n className: classnames(props.className, 'font-bold', {\r\n 'text-3xl': level === 1,\r\n 'text-2xl': level === 2,\r\n 'text-xl': level === 3,\r\n 'text-sm': level === 5,\r\n 'text-2xs': level === 6,\r\n }),\r\n },\r\n children\r\n )\r\n}\r\n\r\ninterface ParagraphProps extends Omit>, 'size' | 'as'> {\r\n /**\r\n * Determines which element the text should render to\r\n *\r\n * @default p\r\n */\r\n as?: ElementType\r\n\r\n /**\r\n * Font size for the paragraph\r\n * - tiny - 10px\r\n * - small - 12px\r\n * - default - 14px\r\n * - medium - 16px\r\n * - large - 18px\r\n *\r\n * @default default\r\n */\r\n size?: 'tiny' | 'small' | 'default' | 'medium' | 'large'\r\n\r\n /**\r\n * Paragraph font weight\r\n */\r\n medium?: boolean\r\n}\r\n\r\nexport function Paragraph({\r\n as = 'p',\r\n size = 'default',\r\n medium,\r\n children,\r\n ...props\r\n}: PropsWithChildren>) {\r\n return React.createElement(\r\n as,\r\n {\r\n ...props,\r\n className: classnames(props.className, {\r\n 'font-medium': medium,\r\n 'text-lg': size === 'large',\r\n 'text-sm': size === 'default',\r\n 'text-2xs': size === 'small',\r\n 'text-3xs': size === 'tiny',\r\n }),\r\n },\r\n children\r\n )\r\n}\r\n\r\ninterface LabelProps extends Omit, 'title'> {\r\n title?: ReactNode\r\n}\r\n\r\nexport function Label({ title, children, ...props }: PropsWithChildren) {\r\n return (\r\n \r\n )\r\n}\r\n","export const CRYPTO_TICKERS = [\r\n 'BTCUSD',\r\n 'LTCUSD',\r\n 'ETHUSD',\r\n 'XRPUSD',\r\n 'BCHUSD',\r\n 'BTCEUR',\r\n 'LTCEUR',\r\n 'ETHEUR',\r\n 'XRPEUR',\r\n 'BCHEUR',\r\n 'LTCBTC',\r\n 'ETHBTC',\r\n 'XRPBTC',\r\n 'BCHBTC',\r\n]\r\n\r\n// Keep in sync with the copy in Charts repo - app/constants/common.ts\r\nexport enum TIMEFRAME {\r\n i1 = 'i1',\r\n i3 = 'i3',\r\n i5 = 'i5',\r\n i10 = 'i10',\r\n i15 = 'i15',\r\n i30 = 'i30',\r\n h = 'h',\r\n h2 = 'h2',\r\n h4 = 'h4',\r\n d = 'd',\r\n w = 'w',\r\n m = 'm',\r\n}\r\n","import debounce from 'lodash.debounce'\r\nimport * as React from 'react'\r\n\r\nimport { useResizeObserver } from './use-resize-observer'\r\n\r\nexport function useElementMeasure(elementOverride: HTMLElement | null = null) {\r\n const ResizeObserver = useResizeObserver()\r\n const [elementRef, setElementRef] = React.useState(elementOverride)\r\n const [elementWidth, setElementWidth] = React.useState(elementRef?.offsetWidth ?? 0)\r\n const [elementHeight, setElementHeight] = React.useState(elementRef?.offsetHeight ?? 0)\r\n\r\n React.useEffect(() => {\r\n if (!ResizeObserver) {\r\n return\r\n }\r\n\r\n const measureElement = () => {\r\n const newElementWidth = elementRef?.offsetWidth\r\n const newElementHeight = elementRef?.offsetHeight\r\n if (newElementWidth !== elementWidth) {\r\n setElementWidth(newElementWidth ?? 0)\r\n }\r\n if (newElementHeight !== elementHeight) {\r\n setElementHeight(newElementHeight ?? 0)\r\n }\r\n }\r\n const measureElementDebounced = debounce(measureElement, 200)\r\n\r\n const resizeObserver = new ResizeObserver((entries) => {\r\n /**\r\n * the reason for requestAnimationFrame is described here https://github.com/quasarframework/quasar/issues/2233\r\n * their approach was mostly to intercept and silence the error but I managed to avoid the error using requestAnimationFrame\r\n * */\r\n window.requestAnimationFrame(() => {\r\n if (Array.isArray(entries) && entries.length > 0) {\r\n measureElementDebounced()\r\n }\r\n })\r\n })\r\n\r\n if (elementRef) {\r\n resizeObserver.observe(elementRef)\r\n }\r\n\r\n measureElement()\r\n\r\n return () => {\r\n measureElementDebounced.cancel()\r\n resizeObserver?.disconnect()\r\n }\r\n }, [ResizeObserver, elementWidth, elementRef, elementHeight])\r\n\r\n return { setElementRef: elementOverride ? () => {} : setElementRef, elementWidth, elementHeight }\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { loadResizeObserverPolyfill } from '../util'\r\n\r\nexport function useResizeObserver() {\r\n const controller = React.useRef('AbortController' in window ? new AbortController() : undefined)\r\n const [ResizeObserver, setResizeObserver] = React.useState(\r\n () => window.ResizeObserver\r\n )\r\n\r\n React.useEffect(() => {\r\n if (typeof ResizeObserver === 'undefined') {\r\n loadResizeObserverPolyfill().then((polyfill) => {\r\n if (!controller.current?.signal.aborted) {\r\n setResizeObserver(() => polyfill)\r\n }\r\n })\r\n }\r\n }, [ResizeObserver])\r\n\r\n // Cleanup effect to abort the controller\r\n React.useEffect(() => () => controller.current?.abort(), [])\r\n\r\n return ResizeObserver\r\n}\r\n","import * as React from 'react'\r\nimport { usePopper } from 'react-popper'\r\n\r\nimport { Box } from './box'\r\nimport { Button } from './button'\r\n\r\nfunction getVirtualRef(top: number, left: number) {\r\n return {\r\n getBoundingClientRect(): DOMRect {\r\n const rect = {\r\n top: top - window.scrollY,\r\n x: top - window.scrollY,\r\n left: left - window.scrollX,\r\n y: left - window.scrollX,\r\n bottom: window.innerHeight - top,\r\n right: window.innerWidth - left,\r\n width: 0,\r\n height: 0,\r\n }\r\n\r\n return {\r\n ...rect,\r\n toJSON: () => rect,\r\n }\r\n },\r\n }\r\n}\r\n\r\ninterface ContextMenuOption {\r\n type?: never\r\n id: string\r\n label: React.ReactNode\r\n onClick: () => void\r\n}\r\n\r\ninterface ContextMenuDivider {\r\n type: 'divider'\r\n}\r\n\r\nexport type ContextMenuItem = ContextMenuOption | ContextMenuDivider\r\n\r\ninterface ContextMenuProps {\r\n /**\r\n * Top coordinate of the click\r\n */\r\n top: number\r\n\r\n /**\r\n * Left coordinate of the click\r\n */\r\n left: number\r\n\r\n /**\r\n * Items visible in the menu\r\n */\r\n items: Array\r\n\r\n /**\r\n * Callback to hide the menu\r\n */\r\n hide: () => void\r\n}\r\n\r\nexport function ContextMenu(props: ContextMenuProps) {\r\n const [popperElement, setPopperElement] = React.useState(null)\r\n const virtualRef = React.useMemo(() => getVirtualRef(props.top, props.left), [props.left, props.top])\r\n const { styles, attributes } = usePopper(virtualRef, popperElement, {\r\n placement: 'right-start',\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: [15, 15],\r\n },\r\n },\r\n ],\r\n })\r\n\r\n return (\r\n \r\n {props.items.map((item, index) => {\r\n if (item.type === 'divider') {\r\n return
\r\n }\r\n\r\n return (\r\n {\r\n item.onClick()\r\n props.hide()\r\n }}\r\n >\r\n {item.label}\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\ninterface GridLayoutProps extends React.HTMLProps {\r\n /**\r\n * Number of columns\r\n */\r\n columns?: number\r\n\r\n /**\r\n * Number of rows\r\n */\r\n rows?: number\r\n\r\n /**\r\n * Whether or not a border is rendered between and around items. eg. charts\r\n * on HP won’t have a border\r\n *\r\n * @default false\r\n */\r\n border?: boolean\r\n}\r\n\r\nexport const ChartGridCell = React.forwardRef(\r\n ({ children, gridArea, className, ...props }, ref) => (\r\n \r\n {children}\r\n
\r\n )\r\n)\r\n\r\ninterface ChartGridCellProps extends React.HTMLProps {\r\n /**\r\n * Css grid-area value\r\n */\r\n gridArea?: string\r\n}\r\n\r\nexport function GridLayout({ columns = 1, rows = 1, border = false, children, className, ...props }: GridLayoutProps) {\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\ninterface ChartGridProps extends GridLayoutProps {\r\n isResizable?: boolean\r\n}\r\n\r\nexport const ChartGrid: React.FC = (props) => \r\n","import * as React from 'react'\r\n\r\nimport { PropsWithAs, RequireByKey } from '../types'\r\n\r\nconst defaultValueAccessor: ValueAccessor = (data) => data\r\n\r\nconst DEFAULT_VALUE_KEY = 'value'\r\nconst DEFAULT_CHANGE_KEY = 'onChange'\r\n\r\ntype ValueAccessor<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps = typeof DEFAULT_VALUE_KEY,\r\n ChangeKey extends keyof React.ComponentProps = typeof DEFAULT_CHANGE_KEY\r\n> = (...args: Parameters[ChangeKey]>) => React.ComponentProps[ValueKey]\r\n\r\nexport type InnerStateProps<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps,\r\n ChangeKey extends keyof React.ComponentProps\r\n> = RequireByKey, 'as'> & {\r\n valueKey?: ValueKey\r\n changeKey?: ChangeKey\r\n valueAccessor?: ValueAccessor\r\n}\r\n\r\nexport function InnerState<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps = typeof DEFAULT_VALUE_KEY,\r\n ChangeKey extends keyof React.ComponentProps = typeof DEFAULT_CHANGE_KEY\r\n>({\r\n as: asComponent,\r\n valueKey = 'value' as ValueKey,\r\n changeKey = 'onChange' as ChangeKey,\r\n valueAccessor = defaultValueAccessor,\r\n ...props\r\n}: InnerStateProps) {\r\n const { [valueKey]: value, [changeKey]: onChange } = props\r\n const [state, setState] = React.useState[ValueKey]>(value)\r\n\r\n const handleChange = React.useCallback>(\r\n (...args) => {\r\n setState(valueAccessor(...args))\r\n onChange(...args)\r\n },\r\n [onChange, valueAccessor]\r\n )\r\n\r\n return React.createElement(asComponent, {\r\n ...props,\r\n [valueKey]: state,\r\n [changeKey]: handleChange,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, ReactNode, useEffect, useMemo, useRef, useState } from 'react'\r\n\r\nimport { Label } from './typography'\r\n\r\nexport enum RangeSize {\r\n small = 'sm:h-6', // 24px height\r\n regular = 'sm:h-7', // 28px height\r\n medium = 'sm:h-8', // 32px height\r\n large = 'sm:h-9', // 36px height\r\n}\r\n\r\ntype InputProps = HTMLProps\r\n\r\ninterface RangeSliderProps extends Omit {\r\n /**\r\n * Label which is rendered above the select\r\n */\r\n label?: ReactNode\r\n\r\n /**\r\n * Range size. All inputs have forced height on mobile to avoid zoom\r\n *\r\n * @default regular\r\n */\r\n size?: keyof typeof RangeSize\r\n\r\n /**\r\n * Element which will be rendered on the left side of the slider\r\n */\r\n leftContent?: ReactNode\r\n\r\n /**\r\n * Element which will be rendered on the right side of the slider\r\n */\r\n rightContent?: ReactNode\r\n\r\n /**\r\n * Class name for the wrapper element\r\n */\r\n className?: string\r\n\r\n /**\r\n * Class name for the input element\r\n */\r\n inputClassName?: string\r\n\r\n /**\r\n * Min value for the input\r\n *\r\n * @default 0\r\n */\r\n min?: number\r\n\r\n /**\r\n * Max value for the input\r\n *\r\n * @default 100\r\n */\r\n max?: number\r\n\r\n /**\r\n * Step value for the input\r\n *\r\n * @default 1\r\n */\r\n step?: number\r\n\r\n /**\r\n * Current value\r\n */\r\n value: number\r\n\r\n /**\r\n * Callback when value changes\r\n */\r\n onChange: InputProps['onChange']\r\n}\r\n\r\nexport function RangeSlider({\r\n label,\r\n size = 'regular',\r\n leftContent,\r\n rightContent,\r\n min = 0,\r\n max = 100,\r\n step = 1,\r\n className,\r\n inputClassName,\r\n ...props\r\n}: RangeSliderProps) {\r\n const [hasTrack, setHasTrack] = useState(false)\r\n const trackRef = useRef(null)\r\n const thumbRef = useRef(null)\r\n\r\n useEffect(() => {\r\n setHasTrack(Boolean(trackRef.current && thumbRef.current))\r\n }, [])\r\n\r\n const thumbLeft = useMemo(() => {\r\n const track = trackRef.current\r\n const thumb = thumbRef.current\r\n const valuePercent = (props.value - min) / (max - min)\r\n\r\n if (!hasTrack || !track || !thumb) return\r\n\r\n const trackBox = track.getBoundingClientRect()\r\n const thumbBox = thumb.getBoundingClientRect()\r\n\r\n return ((valuePercent * (trackBox.width - thumbBox.width)) / trackBox.width) * 100\r\n }, [min, max, props.value, hasTrack])\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { Link, Path } from 'react-router-dom'\r\n\r\nimport { BoxRounding } from '../box'\r\nimport { ButtonHTMLProps, ButtonProps, ButtonSizeType } from '../button'\r\nimport { DropdownSeparator } from '../dropdown'\r\nimport { Icon } from '../icon'\r\nimport { SelectOption, SelectWithTooltip } from '../select'\r\nimport { SelectItem } from '../select/types'\r\n\r\nexport interface DateRangeBaseOption extends SelectItem {\r\n timeframe: string\r\n href?: Path\r\n}\r\n\r\ninterface Props {\r\n chartIndex: number\r\n dateRangeGroups: Array<{ label: string; dateRanges: DateRange[] }>\r\n selectedDateRange: string | null\r\n onDateRangeSelect: (value: DateRange) => void\r\n rounding: keyof typeof BoxRounding\r\n size?: ButtonSizeType\r\n}\r\n\r\nconst DATERANGE_TOOLTIP = 'Range'\r\n\r\nexport function DateRangeSelect({\r\n size,\r\n chartIndex,\r\n dateRangeGroups,\r\n selectedDateRange,\r\n onDateRangeSelect,\r\n rounding,\r\n}: Props) {\r\n const flatDateRanges = React.useMemo(() => dateRangeGroups.flatMap(({ dateRanges }) => dateRanges), [dateRangeGroups])\r\n\r\n const buttonProps = React.useMemo(\r\n () => ({\r\n size,\r\n rounding,\r\n className: '',\r\n rightContent: undefined,\r\n appearance: 'square',\r\n theme: 'chip',\r\n }),\r\n [size, rounding]\r\n )\r\n\r\n const selectWithTooltipListProps = React.useMemo(() => ({ rounding }), [rounding])\r\n\r\n return (\r\n }\r\n tooltipLabel={DATERANGE_TOOLTIP}\r\n active={!!selectedDateRange}\r\n hasPopoverViewportHeightLimit\r\n isNativeMobileSelect={false}\r\n hasPopoverButtonWidthLimit={false}\r\n listProps={selectWithTooltipListProps}\r\n >\r\n {dateRangeGroups.flatMap(({ label, dateRanges }, index) => [\r\n {label},\r\n ...dateRanges.map(({ href, value, label }) => (\r\n \r\n {label}\r\n \r\n )),\r\n ])}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Delayed } from '../delayed'\r\nimport { Spinner } from '../spinner'\r\n\r\ninterface Props {\r\n label: React.ReactNode\r\n isLoading: boolean\r\n}\r\n\r\nexport function LabelWithDelayedSpinner({ label, isLoading }: Props) {\r\n return (\r\n <>\r\n {label}\r\n {isLoading && (\r\n
\r\n {label}}>\r\n \r\n \r\n
\r\n )}\r\n \r\n )\r\n}\r\n","import classNames from 'classnames'\r\nimport * as React from 'react'\r\nimport { Link, Path } from 'react-router-dom'\r\n\r\nimport { BoxRounding } from '../box'\r\nimport { Button, ButtonHTMLProps, ButtonProps, ButtonSizeType } from '../button'\r\nimport { DropdownSeparator } from '../dropdown'\r\nimport { Icon } from '../icon'\r\nimport { SelectItem, SelectOption, SelectWithTooltip } from '../select'\r\nimport { LabelWithDelayedSpinner } from './label-with-delayed-spinner'\r\n\r\nexport type TimeframeBaseOption = SelectItem & { labelShort: string; href?: Path }\r\n\r\ninterface Props {\r\n chartIndex: number\r\n isCompactView: boolean\r\n timeFrameGroups: Array<{ label: string; timeframes: TimeFrame[] }>\r\n selectedTimeframe: string\r\n onTimeframeSelect: (value: TimeFrame) => void\r\n favoriteTimeframes: string[]\r\n onFavoriteTimeframeToggle: (value: TimeFrame) => void\r\n rounding: keyof typeof BoxRounding\r\n size?: ButtonSizeType\r\n isLoading?: boolean\r\n}\r\n\r\nconst TIMEFRAME_TOOLTIP = 'Interval'\r\n\r\nexport function TimeframeSelect({\r\n size,\r\n chartIndex,\r\n timeFrameGroups,\r\n selectedTimeframe,\r\n favoriteTimeframes,\r\n isLoading = false,\r\n isCompactView,\r\n onTimeframeSelect,\r\n onFavoriteTimeframeToggle,\r\n rounding,\r\n}: Props) {\r\n const flatTimeframes = React.useMemo(() => timeFrameGroups.flatMap(({ timeframes }) => timeframes), [timeFrameGroups])\r\n\r\n const buttonProps = React.useMemo(\r\n () => ({\r\n size,\r\n rounding,\r\n rightContent: undefined,\r\n className: '',\r\n theme: 'chip',\r\n appearance: !isCompactView ? 'square' : undefined,\r\n }),\r\n [size, isCompactView, rounding]\r\n )\r\n\r\n const selectWithTooltipListProps = React.useMemo(() => ({ rounding }), [rounding])\r\n\r\n return (\r\n \r\n } isLoading={isLoading && isCompactView} />\r\n \r\n }\r\n buttonContent={isCompactView ? flatTimeframes.find(({ value }) => value === selectedTimeframe)?.labelShort : ''}\r\n data-testid={`chart-${chartIndex}-timeframes-select`}\r\n hasPopoverViewportHeightLimit\r\n isNativeMobileSelect={false}\r\n hasPopoverButtonWidthLimit={false}\r\n listProps={selectWithTooltipListProps}\r\n >\r\n {timeFrameGroups.flatMap(({ timeframes }, groupIndex) => [\r\n ,\r\n ...timeframes.map((item) => {\r\n const isIconButtonActive = favoriteTimeframes.includes(item.value)\r\n return (\r\n ) => {\r\n ev.stopPropagation()\r\n ev.preventDefault()\r\n onFavoriteTimeframeToggle(item)\r\n }}\r\n className={classNames('group -mr-2', {\r\n 'text-gray-300': !isIconButtonActive,\r\n 'text-yellow-200': isIconButtonActive,\r\n })}\r\n >\r\n \r\n \r\n \r\n }\r\n >\r\n {item.label}\r\n \r\n )\r\n }),\r\n ])}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport { Link } from 'react-router-dom'\r\n\r\nimport { useElementMeasure } from '../../hooks/use-element-measure'\r\nimport { BoxRounding } from '../box'\r\nimport { Button, ButtonSizeType } from '../button'\r\nimport { DateRangeBaseOption, DateRangeSelect } from './daterange-select'\r\nimport { LabelWithDelayedSpinner } from './label-with-delayed-spinner'\r\nimport { TimeframeBaseOption, TimeframeSelect } from './timeframe-select'\r\n\r\ninterface Props {\r\n chartIndex?: number\r\n compactViewMaxBreakpointPx?: number\r\n timeFrameGroups: Array<{ label: string; timeframes: TimeFrame[] }>\r\n dateRangeGroups: Array<{ label: string; dateRanges: DateRange[] }>\r\n selectedTimeframe: string\r\n selectedDateRange: string | null\r\n onTimeframeSelect: (value: TimeFrame) => void\r\n onDateRangeSelect: (value: DateRange) => void\r\n favoriteTimeframes: string[]\r\n onFavoriteTimeframeToggle: (value: TimeFrame) => void\r\n size?: ButtonSizeType\r\n loadingTimeframe?: string\r\n rounding?: keyof typeof BoxRounding\r\n isDateRangeAvailable?: boolean\r\n containerElement?: HTMLElement\r\n className?: string\r\n isFavoritesEnabled?: boolean\r\n isScrollIntoViewEnabled?: boolean\r\n}\r\n\r\nfunction getTimeframeChipElementId({ timeframe, chartIndex }: { timeframe: string; chartIndex: number }) {\r\n return `${chartIndex}-${timeframe}`\r\n}\r\n\r\nexport function TimeframeBar({\r\n chartIndex = 0,\r\n compactViewMaxBreakpointPx = 400,\r\n timeFrameGroups,\r\n dateRangeGroups,\r\n selectedTimeframe,\r\n selectedDateRange,\r\n favoriteTimeframes,\r\n loadingTimeframe,\r\n onTimeframeSelect,\r\n onDateRangeSelect,\r\n onFavoriteTimeframeToggle,\r\n size,\r\n rounding = 'regular',\r\n isDateRangeAvailable = true,\r\n containerElement,\r\n className,\r\n isFavoritesEnabled = true,\r\n isScrollIntoViewEnabled = true,\r\n}: Props) {\r\n const [scrollWrapperElement, setScrollWrapperElement] = React.useState(null)\r\n const [timeframeButtonsScrollLocation, setTimeframeButtonsScrollLocation] = React.useState({\r\n isOnLeftEdge: true,\r\n isOnRightEdge: true,\r\n })\r\n const { setElementRef, elementWidth } = useElementMeasure(containerElement)\r\n const flatTimeframes = React.useMemo(() => timeFrameGroups.flatMap(({ timeframes }) => timeframes), [timeFrameGroups])\r\n const isStockDetailTimeframeBar = rounding === 'none' && size === 'regular'\r\n\r\n const timeframesInExpandedPanel = React.useMemo(\r\n () => flatTimeframes.filter(({ value }) => value === selectedTimeframe || favoriteTimeframes.includes(value)),\r\n [flatTimeframes, selectedTimeframe, favoriteTimeframes]\r\n )\r\n\r\n const isCompactView = elementWidth < compactViewMaxBreakpointPx || timeframesInExpandedPanel.length <= 1\r\n const checkTimeframeWrapperScrollPosition = React.useCallback(() => {\r\n if (scrollWrapperElement) {\r\n const isOnLeftEdge = scrollWrapperElement.scrollLeft === 0\r\n const isOnRightEdge =\r\n scrollWrapperElement.offsetWidth + scrollWrapperElement.scrollLeft >= scrollWrapperElement.scrollWidth\r\n\r\n if (\r\n timeframeButtonsScrollLocation.isOnLeftEdge !== isOnLeftEdge ||\r\n timeframeButtonsScrollLocation.isOnRightEdge !== isOnRightEdge\r\n ) {\r\n setTimeframeButtonsScrollLocation({ isOnLeftEdge, isOnRightEdge })\r\n }\r\n }\r\n }, [timeframeButtonsScrollLocation, scrollWrapperElement])\r\n\r\n React.useEffect(() => {\r\n checkTimeframeWrapperScrollPosition()\r\n }, [checkTimeframeWrapperScrollPosition, scrollWrapperElement, elementWidth])\r\n\r\n React.useEffect(() => {\r\n if (!isCompactView && isScrollIntoViewEnabled) {\r\n const timeframeElement = document.getElementById(\r\n getTimeframeChipElementId({ chartIndex, timeframe: selectedTimeframe })\r\n )\r\n timeframeElement?.scrollIntoView({ inline: 'center', block: 'nearest' })\r\n }\r\n }, [isCompactView, chartIndex, selectedTimeframe, elementWidth, isScrollIntoViewEnabled])\r\n\r\n return (\r\n \r\n {isFavoritesEnabled && (\r\n
\r\n \r\n
\r\n )}\r\n {!isCompactView && (\r\n
\r\n \r\n {\r\n /*\r\n * Vertical scrolling doesn't scroll horizontally by default (it's possible when holding shift)\r\n * When using touchpad we may get values in both delatX and deltaY, so if someone's scrolling horizontally we don't want to do anything\r\n * but if they are scrolling vertically (deltaY > deltaX) we want to scroll horizontally the value they would nativally scroll in vertical direction\r\n * */\r\n const absDx = Math.abs(event.deltaX)\r\n const absDy = Math.abs(event.deltaY)\r\n if (absDy > absDx) {\r\n event.currentTarget.scrollLeft += event.deltaY\r\n }\r\n }}\r\n >\r\n
\r\n {timeframesInExpandedPanel.map((timeframe) => (\r\n onTimeframeSelect(timeframe)}\r\n rounding={rounding}\r\n >\r\n \r\n \r\n ))}\r\n
\r\n
\r\n \r\n
\r\n )}\r\n {isDateRangeAvailable && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","import { ButtonRoundingType, ButtonThemeType } from '../button'\r\nimport { IconNameType } from '../icon'\r\n\r\nexport enum ToolbarTheme {\r\n chipTransparent, // (default)\r\n alternative,\r\n}\r\n\r\nexport enum ToolbarDirection {\r\n vertical,\r\n horizontal,\r\n}\r\n\r\nexport type ToolbarDirectionType = keyof typeof ToolbarDirection\r\n\r\nexport interface IButtonThemeSettings {\r\n className?: string\r\n theme: ButtonThemeType\r\n rounding: ButtonRoundingType\r\n}\r\n\r\nexport interface IToolbarItem {\r\n id: string\r\n icon: IconNameType\r\n iconActive?: IconNameType\r\n iconAction?: IconNameType\r\n title: string\r\n titleActive?: string\r\n titleAction?: string\r\n}\r\n\r\nexport type ToolbarThemeType = keyof typeof ToolbarTheme\r\n","import * as React from 'react'\r\n\r\nimport { ToolbarDirection, ToolbarTheme } from './interfaces'\r\n\r\nexport interface IToolbarContext {\r\n direction: ToolbarDirection\r\n theme: ToolbarTheme\r\n isWrapped: boolean\r\n isStretched: boolean\r\n}\r\n\r\nexport const ToolbarContext = React.createContext({\r\n direction: ToolbarDirection.vertical,\r\n theme: ToolbarTheme.chipTransparent,\r\n isWrapped: false,\r\n isStretched: false,\r\n})\r\n\r\nexport function useToolbarContext() {\r\n return React.useContext(ToolbarContext)\r\n}\r\n","import classnames from 'classnames'\r\nimport throttle from 'lodash.throttle'\r\nimport React from 'react'\r\n\r\nimport { isSafariDesktop } from '../../../app/shared/isMobile'\r\nimport { IToolbarContext, ToolbarContext } from './hooks'\r\nimport { ToolbarDirection, ToolbarDirectionType, ToolbarTheme, ToolbarThemeType } from './interfaces'\r\n\r\nconst getToolbarSettings = ({ direction, isWrapped, theme }: IToolbarContext): React.HTMLProps => {\r\n switch (isWrapped) {\r\n case true:\r\n return {\r\n className: classnames('flex shrink-0 items-center dark:bg-gray-800', {\r\n 'flex-wrap justify-between': direction === ToolbarDirection.vertical,\r\n }),\r\n }\r\n\r\n default:\r\n return {\r\n className: classnames('flex shrink-0 items-center p-1.5 dark:bg-gray-800', {\r\n 'flex-col space-y-2 overflow-y-auto [--inset-l:0.5rem] landscape-primary:pl-inset-left':\r\n direction === ToolbarDirection.vertical,\r\n 'pb-inset-bottom [--inset-b:0.5rem]': theme !== ToolbarTheme.alternative,\r\n 'w-screen space-x-2 overflow-x-auto':\r\n direction === ToolbarDirection.horizontal && theme !== ToolbarTheme.alternative,\r\n 'overflow-x-hidden': theme === ToolbarTheme.alternative,\r\n }),\r\n }\r\n }\r\n}\r\n\r\nexport interface ToolbarProps {\r\n /**\r\n * Toolbar direction\r\n *\r\n * @default vertical\r\n */\r\n direction?: ToolbarDirectionType\r\n\r\n /**\r\n * Toolbar buttons theme\r\n *\r\n * @default light\r\n */\r\n theme?: ToolbarThemeType\r\n}\r\n\r\nexport function Toolbar({\r\n direction = 'vertical',\r\n theme = 'chipTransparent',\r\n children,\r\n}: React.PropsWithChildren) {\r\n const toolbarRef = React.useRef(null)\r\n const contextProviderValue = React.useMemo(\r\n () => ({\r\n direction: ToolbarDirection[direction],\r\n theme: ToolbarTheme[theme],\r\n isWrapped:\r\n ToolbarDirection[direction] === ToolbarDirection.vertical && ToolbarTheme[theme] === ToolbarTheme.alternative,\r\n isStretched:\r\n ToolbarDirection[direction] === ToolbarDirection.horizontal && ToolbarTheme[theme] === ToolbarTheme.alternative,\r\n }),\r\n [direction, theme]\r\n )\r\n const toolbarSettings = getToolbarSettings(contextProviderValue)\r\n\r\n React.useLayoutEffect(() => {\r\n // Workaround for Safari scrollbar bug https://github.com/finvizhq/charts/issues/1038\r\n // Safari injects scrollbar after layout render and doesn't trigger reflow\r\n if (ToolbarTheme[theme] !== ToolbarTheme.alternative && isSafariDesktop()) {\r\n const forceReflow = throttle(() => {\r\n if (toolbarRef.current !== null) {\r\n const originalWidth = toolbarRef.current.style.width\r\n toolbarRef.current.style.width = '0'\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n toolbarRef.current.offsetWidth\r\n toolbarRef.current.style.width = originalWidth\r\n }\r\n }, 200)\r\n\r\n forceReflow()\r\n window.addEventListener('resize', forceReflow)\r\n\r\n return () => {\r\n window.removeEventListener('resize', forceReflow)\r\n }\r\n }\r\n }, [theme])\r\n\r\n // reason for key is that popover is sealing initial state, description in\r\n // https://github.com/finvizhq/Finviz-Website/pull/402\r\n return (\r\n
\r\n {children}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonHTMLProps, ButtonProps } from '../button'\r\nimport { Delayed } from '../delayed'\r\nimport { Icon } from '../icon'\r\nimport { PropsWithAs } from '../types'\r\nimport { useToolbarContext } from './hooks'\r\nimport { IToolbarItem, ToolbarTheme } from './interfaces'\r\n\r\nfunction getButtonThemeSettings({\r\n theme,\r\n isActive,\r\n isStretched,\r\n isInAction,\r\n}: {\r\n theme: ToolbarTheme\r\n isStretched: boolean\r\n isActive?: boolean\r\n isInAction?: boolean\r\n}): Omit & ButtonProps {\r\n switch (theme) {\r\n case ToolbarTheme.alternative:\r\n return {\r\n className: classnames('active:bg-white disabled:bg-white disabled:text-gray-300 disabled:hover:text-gray-300', {\r\n 'border border-white text-gray-500 hover:border-gray-100 hover:text-gray-900': !isActive,\r\n 'border border-gray-900 text-gray-900': isActive,\r\n grow: isStretched,\r\n 'h-10 w-10': !isStretched,\r\n 'animate-pulse': isInAction,\r\n }),\r\n theme: 'transparent',\r\n rounding: 'none',\r\n }\r\n default:\r\n return {\r\n className: classnames(\r\n 'dark:disabled:bg-gray-800 dark:disabled:text-gray-600 disabled:text-gray-300 disabled:bg-white',\r\n { 'animate-pulse': isInAction }\r\n ),\r\n theme: 'chipTransparent',\r\n rounding: 'small',\r\n }\r\n }\r\n}\r\n\r\nexport interface ToolbarButtonProps extends Omit {\r\n item: IToolbarItem\r\n disabledTooltip?: string\r\n isInAction?: boolean\r\n}\r\n\r\nexport function ToolbarButton({\r\n item,\r\n disabledTooltip,\r\n isInAction: isInActionProp,\r\n ...props\r\n}: PropsWithAs & ToolbarButtonProps) {\r\n const { theme, isStretched } = useToolbarContext()\r\n const isInAction = isInActionProp && item.iconAction !== undefined\r\n const buttonSettings = getButtonThemeSettings({\r\n theme,\r\n isStretched,\r\n isActive: props.active,\r\n isInAction: isInAction,\r\n })\r\n\r\n const getMainIcon = () => (\r\n \r\n )\r\n\r\n return (\r\n \r\n {props.children ??\r\n (isInAction ? (\r\n \r\n \r\n \r\n ) : (\r\n getMainIcon()\r\n ))}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Icon } from '../icon'\r\nimport { PopoverTrigger, useHoverPopover } from '../popover'\r\nimport { SelectOption } from '../select'\r\nimport { useSelect } from '../select/hooks'\r\nimport { NativeSelect } from '../select/native-select'\r\nimport { SelectList } from '../select/select-list'\r\nimport { useToolbarContext } from './hooks'\r\nimport { IToolbarItem, ToolbarTheme } from './interfaces'\r\nimport { ToolbarButton } from './toolbar-button'\r\n\r\nexport interface ToolbarGroupProps {\r\n /**\r\n * Main button item\r\n */\r\n defaultItem: IToolbarItem\r\n\r\n /**\r\n * Current selected item id\r\n */\r\n isActive: boolean\r\n\r\n /**\r\n * Should indicate some action in progress\r\n */\r\n isInAction?: boolean\r\n\r\n /**\r\n * Array of items\r\n */\r\n groupItems: IToolbarItem[]\r\n\r\n /**\r\n * Expand group button label\r\n */\r\n groupTitle?: string\r\n\r\n /**\r\n * On item select callback\r\n */\r\n onChange: (id: string) => void\r\n\r\n /**\r\n * Is item disabled\r\n */\r\n disabled?: boolean\r\n\r\n /**\r\n * Tooltip message if item is disabled\r\n */\r\n disabledTooltip?: string\r\n}\r\n\r\nexport function ToolbarGroup({\r\n defaultItem,\r\n isActive,\r\n groupItems,\r\n groupTitle,\r\n onChange,\r\n disabled,\r\n disabledTooltip,\r\n}: ToolbarGroupProps) {\r\n const { theme, isStretched } = useToolbarContext()\r\n const [selectedItem, setSelectedItem] = React.useState(defaultItem)\r\n const groupId = groupTitle?.replace(/\\s/g, '-').toLocaleLowerCase()\r\n const useMobileNativeSelect = isMobile()\r\n const isAlternativeTheme = theme === ToolbarTheme.alternative\r\n const popoverState = useHoverPopover({\r\n placement: isAlternativeTheme && isStretched ? 'bottom' : 'right-start',\r\n })\r\n const select = useSelect(\r\n popoverState,\r\n selectedItem.id,\r\n groupItems?.map((i) => ({ value: i.id, label: i.title })) ?? [],\r\n (option) => {\r\n setSelectedItem(groupItems![groupItems!.findIndex((item) => item.id === option.value)])\r\n onChange(option.value)\r\n }\r\n )\r\n\r\n return (\r\n \r\n ) => {\r\n ev.preventDefault()\r\n ev.stopPropagation()\r\n onChange(selectedItem.id)\r\n }}\r\n >\r\n \r\n \r\n \r\n\r\n {useMobileNativeSelect ? (\r\n ({ value: item.id, label: item.title }))}\r\n onChange={select.onItemChange}\r\n onClick={() => onChange(selectedItem.id)}\r\n />\r\n ) : (\r\n \r\n {groupItems.map((item) => (\r\n }\r\n data-testid={`toolbar-group-${groupId}-${item.id}`}\r\n >\r\n {item.title}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","import { PartialBy } from '../../types'\r\nimport { ToolbarButton } from './toolbar-button'\r\nimport { ToolbarGroup, ToolbarGroupProps } from './toolbar-group'\r\n\r\nexport function ToolbarItem({\r\n defaultItem,\r\n isActive,\r\n isInAction,\r\n groupItems,\r\n groupTitle,\r\n onChange,\r\n disabled,\r\n disabledTooltip,\r\n}: PartialBy) {\r\n const isItemActive = isActive && !disabled\r\n\r\n if (!!groupItems?.length) {\r\n return (\r\n \r\n )\r\n }\r\n\r\n return (\r\n {\r\n onChange(defaultItem.id)\r\n }}\r\n />\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { useToolbarContext } from './hooks'\r\nimport { ToolbarDirection, ToolbarTheme } from './interfaces'\r\n\r\nexport function ToolbarDivider() {\r\n const { direction, theme } = useToolbarContext()\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Input, InputHTMLProps, InputProps } from './input'\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from './tooltip'\r\n\r\nexport interface TooltipInputProps {\r\n /**\r\n * Tooltip text content\r\n */\r\n tooltipContent?: React.ReactNode\r\n}\r\n\r\nfunction TooltipInputComponent(\r\n { tooltipContent, ...props }: TooltipInputProps & InputProps & InputHTMLProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const tooltip = useTooltipState({ placement: 'bottom' })\r\n\r\n return (\r\n <>\r\n ev.preventDefault()}\r\n onMouseLeave={(ev) => ev.preventDefault()}\r\n >\r\n \r\n \r\n \r\n {tooltipContent}\r\n \r\n \r\n )\r\n}\r\n\r\nexport const TooltipInput = React.forwardRef(TooltipInputComponent)\r\n","import { Box } from '../box'\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { TourStep } from './types'\r\n\r\nexport function StepContent({ step }: { step: TourStep }) {\r\n return (\r\n \r\n {step.title && (\r\n \r\n {step.title}\r\n \r\n )}\r\n {step.body && {step.body}}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as ReactDOM from 'react-dom/server'\r\nimport Shepherd from 'shepherd.js'\r\n\r\nimport {\r\n BUTTON_BASE_CLASS,\r\n BUTTON_FOCUS_STYLES,\r\n ButtonRounding,\r\n ButtonSize,\r\n ButtonTheme,\r\n getButtonTheme,\r\n} from '../button'\r\nimport { StepContent } from './step-content'\r\nimport { TourDefinition, TourStep } from './types'\r\n\r\ntype ExcludesFalse = (x: T | false) => x is T\r\n\r\n/**\r\n * Async load Shepherd module when we need it\r\n */\r\nlet shepherdLibrary: typeof Shepherd\r\nexport async function loadShepherdLibrary(setLoading: (state: boolean) => void) {\r\n if (shepherdLibrary) return shepherdLibrary\r\n\r\n try {\r\n setLoading(true)\r\n const shepherdPromise = await import('shepherd.js')\r\n shepherdLibrary = shepherdPromise.default\r\n setLoading(false)\r\n\r\n return shepherdLibrary\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Get buttons based on index in the step array\r\n */\r\nconst buttonClasses = classnames(BUTTON_BASE_CLASS, BUTTON_FOCUS_STYLES, ButtonSize.regular, ButtonRounding.regular)\r\nfunction getStepButtons(tour: Shepherd.Tour, step: TourStep, index: number, arr: TourStep[]) {\r\n return [\r\n {\r\n action: tour.complete,\r\n classes: classnames(buttonClasses, 'mr-auto', getButtonTheme(ButtonTheme.light).button),\r\n text: 'Exit',\r\n },\r\n index > 0 && {\r\n action: tour.back,\r\n classes: classnames(buttonClasses, getButtonTheme(ButtonTheme.light).button),\r\n text: step.backButton ?? 'Back',\r\n },\r\n {\r\n classes: classnames(buttonClasses, getButtonTheme(ButtonTheme.blue).button),\r\n action: tour.next,\r\n text: step.nextButton ?? (index === arr.length - 1 ? 'Finish' : 'Next'),\r\n },\r\n ].filter(Boolean as unknown as ExcludesFalse)\r\n}\r\n\r\n/**\r\n * Convert tour steps to Shepherd steps\r\n */\r\nexport function processSteps(tour: Shepherd.Tour, steps: TourStep[]): Shepherd.Step.StepOptions[] {\r\n return steps.map((step, index) => ({\r\n attachTo: { element: step.target, on: step.placement ?? 'auto' },\r\n classes: 'z-dialog',\r\n // Add offset\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: step.offset ?? [0, 10],\r\n },\r\n },\r\n ],\r\n },\r\n // Render the body\r\n text: ReactDOM.renderToString(React.createElement(StepContent, { step })),\r\n // Add buttons\r\n buttons: getStepButtons(tour, step, index, steps),\r\n }))\r\n}\r\n\r\nexport function getTourKey() {\r\n return `tour${window.location.pathname.replace(/[/.]/g, '-')}`\r\n}\r\n\r\nexport function getStepsForUser(tours: TourDefinition[]) {\r\n const lastFinishedTour = localStorage.getItem(getTourKey())\r\n const lastTourIndex = tours.findIndex((tour) => tour.id === lastFinishedTour)\r\n const allToursViewed = lastTourIndex === tours.length - 1 || tours.slice(lastTourIndex + 1).every((item) => item.skip)\r\n const toursToView = allToursViewed ? tours : tours.slice(lastTourIndex + 1)\r\n const userTour = toursToView.reduce(\r\n (acc, current) =>\r\n current.skip\r\n ? acc\r\n : {\r\n ...acc,\r\n id: current.id,\r\n steps: [...acc.steps, ...current.steps],\r\n },\r\n { id: 'tour', steps: [], initialTour: toursToView[0].id }\r\n )\r\n\r\n return { hasNewTours: !allToursViewed, tour: userTour }\r\n}\r\n\r\nexport function completeTour(key: string) {\r\n localStorage.setItem(getTourKey(), key)\r\n}\r\n","import * as React from 'react'\r\nimport Shepherd from 'shepherd.js'\r\n\r\nimport { TourDefinition } from './types'\r\nimport * as tourUtils from './utils'\r\n\r\nexport const DEFAULT_OPTIONS = {\r\n exitOnEsc: true,\r\n useModalOverlay: true,\r\n}\r\n\r\n/**\r\n * Hook which controls shepherd.js. The library is lazy-loaded when the tour starts\r\n *\r\n * Returns:\r\n * - `isLoading`: state of the library loading\r\n * - `currentTour`: tour object, only defined after library has loaded\r\n * - `startTour`: load the library and start tour. Returns `currentTour`\r\n * - `getStepsForUser`: returns a list of tour steps based on tours the user finished\r\n * - `completeTour`: persists the last finished tour to local storage\r\n */\r\nexport function useTour(options?: Shepherd.Tour.TourOptions) {\r\n const [isLoading, setIsLoading] = React.useState(false)\r\n const [currentTour, setTour] = React.useState(null)\r\n\r\n /**\r\n * We’re loading shepherd asynchronously and want to have loading state so we use\r\n * AbortController to check if the component is still mounted.\r\n */\r\n const controller = React.useRef('AbortController' in window ? new AbortController() : undefined)\r\n const loadingSetter = React.useRef((state: boolean) => {\r\n if (controller.current?.signal.aborted) return\r\n\r\n setIsLoading(state)\r\n })\r\n // Cleanup effect to abort the controller\r\n React.useEffect(() => () => controller.current?.abort(), [])\r\n\r\n const startTour = React.useCallback(\r\n async (definition: TourDefinition, setComplete = true) => {\r\n const shepherdLibrary = await tourUtils.loadShepherdLibrary(loadingSetter.current)\r\n\r\n if (shepherdLibrary && !controller.current?.signal.aborted) {\r\n const tour = currentTour ?? new shepherdLibrary.Tour({ ...DEFAULT_OPTIONS, ...options })\r\n\r\n if (!currentTour) setTour(tour)\r\n\r\n // Reset the tour steps in case they were updated\r\n Array.from(tour.steps).forEach((step) => tour.removeStep(step.id))\r\n\r\n const processedSteps = tourUtils.processSteps(tour, definition.steps)\r\n tour.addSteps(processedSteps)\r\n\r\n if (setComplete) {\r\n tourUtils.completeTour(definition.id)\r\n }\r\n\r\n tour.start()\r\n window.gtag?.('event', 'tour-start', { event_label: definition.initialTour ?? definition.id })\r\n\r\n return tour\r\n }\r\n },\r\n [currentTour, options]\r\n )\r\n\r\n return {\r\n isLoading,\r\n currentTour,\r\n startTour,\r\n getStepsForUser: tourUtils.getStepsForUser,\r\n completeTour: tourUtils.completeTour,\r\n }\r\n}\r\n","import * as time from '../../app/header/time'\r\nimport * as button from './button'\r\nimport * as buttonGroup from './button-group'\r\nimport * as checkbox from './checkbox'\r\nimport * as colorPicker from './color-picker'\r\nimport * as contextMenu from './context-menu'\r\nimport * as copyToClipboard from './copy-to-clipboard'\r\nimport * as datePicker from './date-picker'\r\nimport * as delayed from './delayed'\r\nimport * as dialog from './dialog'\r\nimport * as dropdown from './dropdown'\r\nimport * as grid from './grid'\r\nimport * as icon from './icon'\r\nimport * as innerState from './inner-state'\r\nimport * as input from './input'\r\nimport * as list from './list'\r\nimport * as notification from './notification'\r\nimport * as popover from './popover'\r\nimport * as range from './range'\r\nimport * as search from './search'\r\nimport * as select from './select'\r\nimport * as spinner from './spinner'\r\nimport * as timeframeBar from './timeframe-bar'\r\nimport * as toolbar from './toolbar'\r\nimport * as tooltip from './tooltip'\r\nimport * as tooltipInput from './tooltip-input'\r\nimport * as tour from './tour'\r\nimport * as typography from './typography'\r\n\r\nfunction exportAsGlobal(win: any, key: string) {\r\n if (!(key in win)) win[key] = {}\r\n\r\n win[key].components = {\r\n ...button,\r\n ...buttonGroup,\r\n ...checkbox,\r\n ...colorPicker,\r\n ...contextMenu,\r\n ...copyToClipboard,\r\n ...delayed,\r\n ...dialog,\r\n ...datePicker,\r\n ...dropdown,\r\n ...grid,\r\n ...icon,\r\n ...innerState,\r\n ...input,\r\n ...list,\r\n ...notification,\r\n ...popover,\r\n ...range,\r\n ...search,\r\n ...select,\r\n ...spinner,\r\n ...time,\r\n ...timeframeBar,\r\n ...toolbar,\r\n ...tooltip,\r\n ...tooltipInput,\r\n ...tour,\r\n ...typography,\r\n }\r\n}\r\n\r\nexportAsGlobal(window, 'FLibs')\r\n","/**\r\n * Expose loader doesn’t map these to window.FLibs until we import them somewhere.\r\n * Until we figure out a better way, this file needs to be included on the charts page\r\n */\r\n// eslint-disable-next-line react/no-typos\r\nimport 'classnames'\r\nimport { max, nice, scaleLinear, scaleSymlog } from 'd3'\r\nimport {\r\n add,\r\n addBusinessDays,\r\n differenceInCalendarDays,\r\n eachDayOfInterval,\r\n endOfDay,\r\n intervalToDuration,\r\n isSameMonth,\r\n isSameWeek,\r\n isWeekend,\r\n isWithinInterval,\r\n startOfDay,\r\n startOfYear,\r\n sub,\r\n subMonths,\r\n subYears,\r\n} from 'date-fns'\r\nimport 'hammerjs'\r\n// eslint-disable-next-line react/no-typos\r\nimport 'react'\r\nimport 'react-dom'\r\nimport * as ReactRouterDOM from 'react-router-dom'\r\n\r\nimport { getFormattedDateString } from '../app/header/utils'\r\nimport { decodeQueryString, encodeQueryString } from '../app/queryString'\r\nimport logo from '../app/shared/assets/logo.png'\r\nimport { getHoverChartImg } from '../app/shared/hover-chart'\r\nimport { getSanitizedTicker } from '../app/shared/ticker-sanitizer'\r\nimport { formatDateToStringUS, getIsDrawingEnabledOnQuotePage } from '../app/shared/utils'\r\nimport './components/index'\r\nimport { useSyncLocalStorage } from './hooks/use-sync-local-storage'\r\n\r\ndeclare const FLibs: any\r\n\r\nFLibs.ReactRouterDOM = ReactRouterDOM\r\nFLibs.getHoverChartImg = getHoverChartImg\r\nFLibs.getSanitizedTicker = getSanitizedTicker\r\nFLibs.decodeQueryString = decodeQueryString\r\nFLibs.encodeQueryString = encodeQueryString\r\nFLibs.getFormattedDateString = getFormattedDateString\r\nFLibs.formatDateToStringUS = formatDateToStringUS\r\nFLibs.useSyncLocalStorage = useSyncLocalStorage\r\nFLibs.getIsDrawingEnabledOnQuotePage = getIsDrawingEnabledOnQuotePage\r\nFLibs.d3 = { max, nice, scaleLinear, scaleSymlog }\r\nFLibs.DateFns = {\r\n add,\r\n addBusinessDays,\r\n differenceInCalendarDays,\r\n eachDayOfInterval,\r\n endOfDay,\r\n intervalToDuration,\r\n isSameMonth,\r\n isSameWeek,\r\n isWeekend,\r\n isWithinInterval,\r\n startOfDay,\r\n startOfYear,\r\n sub,\r\n subMonths,\r\n subYears,\r\n}\r\nFLibs.assets = {\r\n logo,\r\n}\r\n","import * as React from 'react'\r\n\r\nimport * as storage from '../services/local-storage'\r\n\r\n/**\r\n * Hook to synchronize localStorage.setItem across all components on the page on all open tabs\r\n */\r\nexport function useSyncLocalStorage(storageKey: string, defaultValue: ValueType) {\r\n const [state, setState] = React.useState(storage.getValue(storageKey, defaultValue))\r\n\r\n React.useEffect(() => {\r\n const subscription = storage.subscribeToChanges(storageKey, defaultValue, setState)\r\n\r\n return () => {\r\n subscription.unsubscribe()\r\n }\r\n }, [storageKey, defaultValue])\r\n\r\n const setValue = React.useCallback(\r\n (valueGetter: React.SetStateAction) => storage.setValue(storageKey, valueGetter, defaultValue),\r\n [defaultValue, storageKey]\r\n )\r\n\r\n return {\r\n state,\r\n setState: setValue,\r\n }\r\n}\r\n","import * as Sentry from '@sentry/browser'\r\n\r\nimport { InstrumentType } from '../types'\r\n\r\nexport enum ContentType {\r\n ApplicationJson = 'application/json',\r\n FormUrlEncoded = 'application/x-www-form-urlencoded',\r\n Html = 'text/html; charset=utf-8',\r\n}\r\n\r\nfunction parseResponseForContentType(response: string, contentType: ContentType) {\r\n switch (contentType) {\r\n case ContentType.ApplicationJson:\r\n case ContentType.FormUrlEncoded:\r\n return JSON.parse(response)\r\n default:\r\n return response\r\n }\r\n}\r\n\r\nexport class ThrowableError extends Error {\r\n status: number\r\n isServerError = false\r\n extra: Record = {}\r\n\r\n constructor(status: number, message = 'ThrowableError', extra: Record = {}) {\r\n super(`${status} ${message}`)\r\n this.status = status\r\n this.isServerError = status >= 500\r\n this.extra = extra\r\n }\r\n}\r\n\r\nexport interface CancelablePromise extends Promise {\r\n cancel?: () => void\r\n}\r\n\r\n/**\r\n * General api fetch utility which returns a cancelable promise\r\n */\r\nexport function apiRequest(\r\n url: string,\r\n { query, headers = {}, ...options }: RequestInit & { query?: Record } = {},\r\n throwOnAllErrors = false\r\n): CancelablePromise {\r\n const controller = 'AbortController' in window ? new AbortController() : undefined\r\n const requestUrl = query ? `${url}?${new URLSearchParams(query)}` : url\r\n const contentType: ContentType = (headers as any)['Content-Type'] ?? ContentType.ApplicationJson\r\n\r\n const requestOptions = {\r\n ...options,\r\n headers: {\r\n 'Content-Type': contentType,\r\n ...headers,\r\n },\r\n }\r\n const request = fetch(requestUrl, { ...requestOptions, signal: controller?.signal })\r\n\r\n const cancelableRequest: CancelablePromise = request\r\n .then(async (response) => {\r\n const textResponse = await response.text()\r\n const reponseContentType: ContentType = (response.headers.get('Content-Type') as any) ?? ContentType.Html\r\n if (!response.ok || response.status >= 500) {\r\n throw new ThrowableError(response.status, response.statusText, { rayId: response.headers.get('cf-ray') })\r\n }\r\n try {\r\n return parseResponseForContentType(textResponse, reponseContentType)\r\n } catch (error: any) {\r\n throw new ThrowableError(500, error.message, { rayId: response.headers.get('cf-ray') })\r\n }\r\n })\r\n .catch((error: ThrowableError) => {\r\n if (error.status >= 500) {\r\n Sentry.withScope((scope) => {\r\n scope.setContext('Cloudflare', error.extra)\r\n\r\n if (error.status === 500) {\r\n Sentry.captureException(error)\r\n } else {\r\n Sentry.captureMessage(`${error.status} ${error.message}`)\r\n }\r\n })\r\n }\r\n if (throwOnAllErrors) {\r\n throw error\r\n }\r\n })\r\n\r\n if (controller) {\r\n cancelableRequest.cancel = () => controller.abort()\r\n }\r\n\r\n return cancelableRequest\r\n}\r\n\r\nexport interface SearchApiResult {\r\n ticker: string\r\n company: string\r\n exchange: string\r\n}\r\n\r\nexport function searchApiRequest(input = '', instrument?: InstrumentType) {\r\n return apiRequest('/api/suggestions.ashx', { query: { input, instrument } })\r\n}\r\n","import { EventEmitter } from 'events'\r\nimport * as React from 'react'\r\n\r\nlet emitter: EventEmitter | undefined\r\n\r\n/**\r\n * Get the emitter which is used to sync components across the page, subscibe to\r\n * changes and attach event which handles changes across windows\r\n */\r\nexport function subscribeToChanges(\r\n key: string,\r\n defaultValue: ValueType,\r\n changeCallback?: (value: React.SetStateAction) => void\r\n) {\r\n if (!emitter) emitter = new EventEmitter()\r\n\r\n const onChange = (value: React.SetStateAction) => {\r\n const newValue = value ?? getValue(key, defaultValue)\r\n setValue(key, newValue, defaultValue, false)\r\n changeCallback?.(newValue)\r\n }\r\n\r\n const onStorageChange = (ev: StorageEvent) => {\r\n if (ev.key === key) {\r\n try {\r\n const value = ev.newValue ? JSON.parse(ev.newValue) : null\r\n onChange(value ?? defaultValue)\r\n } catch {\r\n onChange(defaultValue)\r\n }\r\n }\r\n }\r\n\r\n emitter.addListener(key, onChange)\r\n window.addEventListener('storage', onStorageChange)\r\n\r\n return {\r\n emitter,\r\n unsubscribe: () => {\r\n emitter?.removeListener(key, onChange)\r\n window.removeEventListener('storage', onStorageChange)\r\n },\r\n }\r\n}\r\n\r\n/**\r\n * Get value from local storage or fall back to `defaultValue`\r\n */\r\nexport function getValue(key: string, defaultValue: ValueType): ValueType {\r\n try {\r\n const value = localStorage.getItem(key)\r\n const parsedValue = value ? JSON.parse(value) : null\r\n return parsedValue ?? defaultValue\r\n } catch {\r\n return defaultValue\r\n }\r\n}\r\n\r\n/**\r\n * Set value to local storage. Optionally emits the change to all other components\r\n * which are subscribed with the same `key`\r\n */\r\nexport function setValue(\r\n key: string,\r\n valueGetter: React.SetStateAction,\r\n defaultValue: ValueType,\r\n emit = true\r\n) {\r\n try {\r\n const state = getValue(key, defaultValue)\r\n const valueToStore = valueGetter instanceof Function ? valueGetter(state) : valueGetter\r\n\r\n localStorage.setItem(key, JSON.stringify(valueToStore))\r\n if (emit) emitter?.emit(key, valueToStore)\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Helper function to migrate old value type to new one (eg. boolean to object)\r\n */\r\nexport function migrateValue(\r\n key: string,\r\n /**\r\n * The migrate function might get called multiple times on the page, so `oldValue` in the callback\r\n * can actually be the already migrated value. Make sure to add a condition to only migrate once.\r\n */\r\n transformValue: NewValue | ((oldValue: PrevValue | NewValue) => NewValue),\r\n defaultValue: NewValue\r\n) {\r\n try {\r\n const oldValue = getValue(key, undefined)\r\n if (typeof oldValue === 'undefined') return\r\n const migratedValue = transformValue instanceof Function ? transformValue(oldValue) : transformValue\r\n setValue(key, migratedValue, defaultValue, false) // don’t emit to other components\r\n } catch {}\r\n}\r\n","import * as pathToRegexp from 'path-to-regexp'\r\n\r\nimport { cleanTicker } from '../util'\r\n\r\n/**\r\n * Compile route path by applying parameters to it\r\n *\r\n * @example\r\n * // Outputs /route/1?query=foo\r\n * compilePath('/route/:id?query=:query', { id: 1, query: 'foo' })\r\n */\r\nfunction compilePath(\r\n path: string,\r\n params?: Record,\r\n options?: pathToRegexp.ParseOptions & pathToRegexp.TokensToFunctionOptions\r\n) {\r\n return pathToRegexp.compile(path, options)(params)\r\n}\r\n\r\nexport const path = {\r\n home: '/',\r\n news: '/news.ashx',\r\n screener: '/screener.ashx',\r\n charts: '/charts',\r\n groups: '/groups.ashx',\r\n portfolio: '/portfolio.ashx',\r\n insider: '/insidertrading.ashx',\r\n elite: '/elite.ashx',\r\n search: '/search.ashx\\\\?p=:ticker?',\r\n quote: '/quote.ashx\\\\?t=:ticker',\r\n contact: '/contact.ashx',\r\n\r\n alerts: '/alerts.ashx',\r\n help: '/help/screener.ashx',\r\n account: '/myaccount.ashx',\r\n login: '/login.ashx',\r\n logout: '/logout.ashx',\r\n\r\n // Maps\r\n maps: '/map.ashx',\r\n bubbles: '/bubbles.ashx',\r\n\r\n // Futures\r\n futures: '/futures.ashx',\r\n futuresPerf: '/futures_performance.ashx',\r\n futuresCharts: '/futures_charts.ashx',\r\n futuresChartDetail: '/futures_charts.ashx\\\\?t=:ticker',\r\n\r\n // Forex\r\n forex: '/forex.ashx',\r\n forexPerf: '/forex_performance.ashx',\r\n forexCharts: '/forex_charts.ashx',\r\n forexChartDetail: '/forex_charts.ashx\\\\?t=:ticker',\r\n\r\n // Crypto\r\n crypto: '/crypto.ashx',\r\n cryptoPerf: '/crypto_performance.ashx',\r\n cryptoCharts: '/crypto_charts.ashx',\r\n cryptoChartDetail: '/crypto_charts.ashx\\\\?t=:ticker',\r\n\r\n // Backtsest\r\n backtests: '/backtests.ashx',\r\n backtestCreate: '/backtest_create.ashx',\r\n backtestDetail: '/backtest_detail.ashx\\\\?id=:backtestId',\r\n backtestPresets: 'backtests.ashx\\\\?presets=1',\r\n}\r\n\r\nexport const link = {\r\n toHome: () => path.home,\r\n toNews: () => path.news,\r\n toScreener: () => path.screener,\r\n toCharts: () => path.charts,\r\n toGroups: () => path.groups,\r\n toPortfolio: () => path.portfolio,\r\n toInsider: () => path.insider,\r\n toElite: () => path.elite,\r\n toSearch: (ticker: string) => compilePath(path.search, { ticker }, { validate: false }),\r\n toQuote: (ticker: string) => compilePath(path.quote, { ticker }),\r\n toContact: () => path.contact,\r\n\r\n toAlerts: () => path.alerts,\r\n toHelp: () => path.help,\r\n toAccount: () => path.account,\r\n toLogin: () => path.login,\r\n toLogout: () => path.logout,\r\n\r\n toMaps: () => path.maps,\r\n toBubbles: () => path.bubbles,\r\n\r\n toFutures: () => path.futures,\r\n toFuturesPerf: () => path.futuresPerf,\r\n toFuturesCharts: () => path.futuresCharts,\r\n toFuturesChartDetail: (ticker: string) => compilePath(path.futuresChartDetail, { ticker: cleanTicker(ticker) }),\r\n\r\n toForex: () => path.forex,\r\n toForexPerf: () => path.forexPerf,\r\n toForexCharts: () => path.forexCharts,\r\n toForexChartDetail: (ticker: string) => compilePath(path.forexChartDetail, { ticker: cleanTicker(ticker) }),\r\n\r\n toCrypto: () => path.crypto,\r\n toCryptoPerf: () => path.cryptoPerf,\r\n toCryptoCharts: () => path.cryptoCharts,\r\n toCryptoChartDetail: (ticker: string) => compilePath(path.cryptoChartDetail, { ticker: cleanTicker(ticker) }),\r\n\r\n toBacktests: () => path.backtests,\r\n toBacktestCreate: () => path.backtestCreate,\r\n toBacktestDetail: (backtestId: string | number) => compilePath(path.backtestDetail, { backtestId }),\r\n toBacktestPresets: () => path.backtestPresets,\r\n}\r\n","export enum Instrument {\r\n stock = 'stock',\r\n forex = 'forex',\r\n crypto = 'crypto',\r\n futures = 'futures',\r\n}\r\n\r\nexport type InstrumentType = keyof typeof Instrument\r\n\r\nexport type RecordType = Record\r\n\r\nexport type PartialBy = Omit & Partial>\r\n","import isPlainObject from 'lodash.isplainobject'\r\nimport { ComponentType, LazyExoticComponent, lazy } from 'react'\r\n\r\nimport { CRYPTO_TICKERS } from './constants'\r\nimport { Instrument, InstrumentType } from './types'\r\nimport { RecordType } from './types'\r\n\r\n/**\r\n * Function which wraps React.lazy and checks whether a chunk is preloaded\r\n * from async-manifest. If yes, kick in the promise resolve early so we can\r\n * instantly render the component\r\n */\r\nexport function lazyLoadComponent({\r\n chunkName,\r\n load,\r\n}: {\r\n chunkName: string\r\n load: () => Promise<{ default: ComponentType }>\r\n}): LazyExoticComponent> {\r\n // Resolve earlier if prefetch element is present\r\n const hasPreloadElement = document.querySelector(`[data-chunk-id=${chunkName}]`)\r\n\r\n if (hasPreloadElement) {\r\n const componentLoader = load()\r\n\r\n return lazy(() => componentLoader)\r\n }\r\n\r\n return lazy(load)\r\n}\r\n\r\nconst isObject = (value: any): value is RecordType => isPlainObject(value)\r\n\r\n/**\r\n * Parse text as JSON\r\n */\r\nexport function parseAsJSON(value: unknown | Shape): Shape | undefined {\r\n if (isObject(value)) {\r\n return value as Shape\r\n }\r\n\r\n let parsedValue\r\n try {\r\n if (typeof value === 'string') {\r\n parsedValue = JSON.parse(value)\r\n }\r\n } catch (e) {\r\n return\r\n }\r\n return parsedValue\r\n}\r\n\r\n/**\r\n * remove @ symbol from a ticker\r\n */\r\nexport function cleanTicker(ticker: string) {\r\n return ticker.startsWith('@') ? ticker.substring(1) : ticker\r\n}\r\n\r\n/**\r\n * Get instrument for a ticker.\r\n *\r\n * - If ticker doesn’t start with `@` - stock\r\n * - Otherwise\r\n * - one of `CRYPTO_TICKERS` - crypto\r\n * - has length of 6 - forex\r\n * - none of above - future\r\n *\r\n * NOTE: counterpart in charts 'charts/app/utils/chart.js'\r\n */\r\n\r\nexport function getInstrumentForTicker(ticker: string): InstrumentType {\r\n if (!ticker?.startsWith('@')) return Instrument.stock\r\n\r\n const cleanedTicker = cleanTicker(ticker)\r\n\r\n if (CRYPTO_TICKERS.includes(cleanedTicker.toUpperCase())) return Instrument.crypto\r\n if (cleanedTicker.length === 6) return Instrument.forex\r\n\r\n return Instrument.futures\r\n}\r\n\r\n/**\r\n * Async load Resize observer polyfill when we need it\r\n */\r\nlet resizeObserverPolyfill: typeof window.ResizeObserver\r\nexport async function loadResizeObserverPolyfill() {\r\n if (typeof window.ResizeObserver === 'undefined') {\r\n const polyfill = await import('resize-observer-polyfill')\r\n resizeObserverPolyfill = polyfill.default\r\n window.ResizeObserver = resizeObserverPolyfill\r\n return resizeObserverPolyfill as typeof window.ResizeObserver\r\n }\r\n}\r\n\r\nexport async function getIsBrave() {\r\n return (navigator.brave && (await navigator.brave.isBrave())) || false\r\n}\r\n"],"names":["MarketBadgeType","getMarketBadgeText","type","_date","Open","label","Closed","Premarket","Aftermarket","getMarketBadgeType","time","hasUserPremium","isHoliday","isPremarket","isAftermarket","None","MarketBadge","badge","className","classnames","includes","TimeBreakpointMode","BREAKPOINTS","minWidth","Infinity","marketBadgeText","timeFormat","getTimeState","fixedTime","FinvizSettings","getDate","TooltipBadge","props","state","useTooltipState","placement","TooltipTrigger","Tooltip","Heading","level","StaticBadge","findMatchingBreakpoint","compareWidth","breakpoints","length","filter","breakpoint","pop","getCurrentWidth","mode","element","window","innerWidth","clientWidth","Time","breakpointMode","ResizeObserver","useResizeObserver","rootRef","React","setState","currentBreakpoint","setBreakpoint","interval","setInterval","clearInterval","current","currentWidth","handleResize","throttle","foundBreakpoint","observer","entries","requestAnimationFrame","Array","isArray","observe","addEventListener","disconnect","removeEventListener","ref","getFormattedDateString","TimeFormat","seed","date","Date","dateAsNY","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","isDst","dayNumber","monthIndex","getMonth","previousSunday","getDay","getIsDstInNy","setUTCHours","getWeekDay","toLocaleDateString","weekday","month","toUpperCase","toString","padStart","getTime","toLocaleString","hour","minute","hour12","format","long","getFullYear","short","timeOnly","isPremium","dayOfWeek","min","getMinutes","getHours","HOLIDAY_DATES","test","day","hours","getHoliday","find","holiday","decodeQueryString","search","location","vars","substring","split","obj","forEach","pair","delimiterPos","indexOf","key","decodeURIComponent","value","encodeQueryString","values","whitelistedValues","Object","keys","reduce","prev","undefined","encodeURIComponent","getParsedCookies","cookieName","parseCookies","document","cookie","map","cookieString","acc","v","trim","getCookie","name","re","RegExp","replace","setCookie","expires","toUTCString","hostname","getHoverChartUrl","ticker","escaped","imgUrl","nodeChartsDomain","stocksHoverChartTimeframe","stocksHoverChartPatterns","getHoverChartDimensions","width","height","getReferrerPolicy","getHoverChartImg","referrerPolicy","url","srcSet","getSrcSet","srcsetString","img","hasUserRetinaHoverCharts","matchesAndroid","navigator","userAgent","match","matchesWebOS","matchesIPhone","matchesiPad","matchesIPod","matchesBlackBerry","matchesWindowsPhone","matchesIOSLike","maxTouchPoints","isMobileDevice","isMobile","isIpad","isSafariDesktop","getSanitizedSingleTicker","rawTicker","x","join","getSanitizedTicker","isMulti","formatDateToStringUS","year","DRAWING_QUOTE_PAGE_COOKIE_NAME","getIsDrawingEnabledOnQuotePage","async","setIsDrawingEnabledOnQuotePage","isEnabled","fetch","catch","then","res","ok","setMonth","setIsDrawingEnabledOnQuotePageCookieViaJS","reload","BoxRounding","BoxTheme","Box","rounding","theme","children","GroupTheme","ButtonGroup","hasDivider","hasBorder","childComponent","buttonRounding","ButtonRounding","groupTheme","dark","wrapper","divider","getGroupTheme","role","border","child","index","Button","Boolean","BUTTON_DEFAULT_ELEMENT","BUTTON_BASE_CLASS","BUTTON_SQUARE_BASE_CLASS","BUTTON_FOCUS_STYLES","ButtonSize","ButtonSquareSize","ButtonTheme","getButtonTheme","active","light","button","blue","blueHover","red","headerItem","icon","menuItem","menuItemDark","opacity","outline","chip","chipTransparent","ButtonComponent","as","asComponent","size","focusRing","appearance","contentClass","leftContent","rightContent","isSquare","buttonTheme","buttonSize","isValidIconName","Icon","CheckboxComponent","checked","defaultChecked","disabled","Checkbox","forwardRef","clamp","num","max","isTouch","event","getRelativePosition","node","rect","getBoundingClientRect","pointer","touches","left","pageX","pageXOffset","top","pageY","pageYOffset","preventDefaultMove","preventDefault","DraggablePickerComponent","onMove","onKey","container","useRef","hasTouched","isDragging","setDragging","useState","isValid","handleMove","useCallback","buttons","handleMoveStart","nativeEvent","handleKeyDown","keyCode","which","handleMoveEnd","toggleDocumentEvents","toggleEvent","useLayoutEffect","onTouchStart","onMouseDown","onKeyDown","tabIndex","DraggablePicker","memo","Pointer","color","style","backgroundColor","hexStringToRGBA","hexString","hexColor","removeHashSymbol","r","g","b","a","Number","Math","round","hexStringToHSVA","rgbaToHSVA","hexStringToHSLA","rgbaToHSLA","alphaToHex","alpha","rgbaToHexString","hsvaToHEXString","rgbaColor","hsvaToRGBA","hslaToHexString","hslaToRGBA","c","h","s","f","abs","l","n","k","rgbaToRGBAString","rgbaStringToObject","colorParts","exec","green","slice","String","parseInt","parseFloat","hslaToHSLAString","strColor","isValidColor","isRgb","startsWith","Option","convertColorToHEX","getIsRgb","isAlphaAllowed","rgbKeys","push","some","getHSVAFromColor","stringifyHSVAColor","output","canSelectAlpha","getLumaFromRGBA","getIsColorTooLightOrTransparent","getHEXWithSpecificAplha","getRGBAValueFromValidColorString","Alpha","onChange","changeLightness","pos","gradientPreview","useMemo","gradientFrom","gradientTo","backgroundImage","DEFAULT_COLORS","title","ColorPalette","colors","lowerCaseColor","toLowerCase","colorObj","isSelected","onClick","HueSaturation","position","getPositionFromHSLA","colorPreview","changeSaturation","Lightness","ColorPreview","isTooLight","PickerInput","inputClass","hasColorPreview","colorInput","setColorInput","colorUtil","isRgba","useEffect","handleColorInputChange","currentTarget","colorValue","Input","ColorPicker","canSelectCustom","outputFormat","onPaletteItemClick","cachedColor","hsvaColor","setColor","currentColor","newColor","onChangeCallback","stringColor","onSetCustomCodeClick","prompt","alert","_hex","orignalColor","InputColorPicker","inputDataTestId","popoverState","usePopoverState","PopoverTrigger","Popover","focusOnShow","hide","MultiColorPicker","colorInputLabel","ColorTabButton","ButtonColorPicker","buttonPickerDataTestId","hideOnClickOutside","onOverlayClick","isMultiPicker","activeColorIndex","setActiveColorIndex","handleColorChange","originalColor","colorObject","visible","COMPONENT_ANIMATION_DURATION","CopyToClipboard","text","bottomLeftContent","isCopied","setIsCopied","handleCopyToClipboard","copy","timeout","resetTimer","clearTimeout","setTimeout","Textarea","readOnly","e","select","DatePickerComponent","DatePicker","popover","triggerProps","ZIndexContext","fallback","Spinner","locale","minDetail","ev","Delayed","delay","throwOnTimeout","delayComponent","timeoutComponent","setVisible","hasTimedOut","setHasTimedOut","visibilityTimeout","failedTimeout","Error","useZIndex","useDialogState","settings","Reakit","animated","DialogDragContext","enabled","handleRef","boxPosition","y","useDrag","dragging","handleElement","setBoxPosition","boxPositionRef","dragDiff","resetBoxPosition","scrollX","scrollY","onMouseUp","onMouseMove","onDoubleClick","body","DialogBox","onUnmount","dialogDrag","dialogBoxStyle","transform","DialogOverlay","getExtendedDialogState","isFullyOpened","animating","isFullyClosed","DialogType","DIALOG_BACKDROP_WIDTH_CSS_VAR","Dialog","finalFocusRef","onHide","hideOnEsc","isDraggable","ariaLabel","onResize","setProperty","documentElement","DialogWrapper","modal","Portal","unstable_finalFocusRef","onTransitionEnd","onAnimationEnd","innerProps","drawer","Provider","DialogBody","hasPadding","scrollDivRef","scrollBox","disableBodyScroll","enableBodyScroll","ConfirmationDialog","Paragraph","actions","DialogTrigger","dropdownContext","DropdownContext","root","DialogFooter","DialogHeader","onCloseClick","useDropdownState","context","loop","unstable_virtual","unstable_offset","DropdownComponent","isNested","zIndex","dropdownState","ContainerElement","buttonProps","parent","orientation","Dropdown","NestedDropdownWrapper","parentState","itemProps","DropdownBar","DropdownItemComponent","subtitle","closeOnClick","hasSubmenu","iconTheme","DropdownItem","DropdownSeparator","MoreButtonDropdown","Component","iconList","add","viewBox","d","calendar","candleBarBasic","candleBarHeikinAshi","candleBarHollow","caretDown","caretRight","caretVertical","chartBar","chartBubble","cx","cy","chartTreemap","chevronDown","chevronRight","close","darkMode","done","drawingActionDelete","fillRule","drawingSettingAutosaveOff","drawingSettingAutosaveOn","drawingSettingAutosaveSaving","drawingSettingDrawingMode","drawingSettingDrawingModeActive","drawingSettingHide","drawingSettingLock","drawingSettingPreserveDrawings","drawingSettingPreserveDrawingsActive","drawingSettingShow","drawingSettingUnlock","empty","exitFullscreen","flash","fullscreen","gift","hamburger","help","idea","ideaLoad","ideaSave","layout1h1v","layout1h2v","layout1h3v","layout1l2r","layout1t2b","layout2h1v","layout2h2v","layout3h1v","layout3h2v","lightMode","lineChartType","menuClose","more","ohlcChartType","profile","publish","refresh","remove","restore","settingsWheel","gesture","share","signOut","switchHorizontal","switchVertical","tabKey","template","toolArrow","toolBrush","toolCallout","toolCurve","toolElliottWave","toolEllipse","toolExpand","toolFibonacci","toolLine","fill","stroke","toolMeasure","toolMidLineH","toolMidLineV","toolMouse","toolPitchfork","toolPolygon","toolPosition","toolRect","toolRectRotated","toolText","toolTriangle","toolXABCD","warning","palette","clipRule","arrowForward","trendingUp","trendingDown","trashCan","star","starOutlined","SVG","xmlns","InputTheme","InputRounding","InputSize","getInputTheme","isError","none","input","InputComponent","error","caption","inputTheme","isLeftStringIcon","isRightStringIcon","inputSize","commonSideContentClassnames","Label","small","regular","medium","large","InputCaption","TextareaComponent","textareaTheme","ListContext","useListState","options","ListItem","activeTheme","onSelectItem","onKeyPress","closeOnSelect","id","List","selectedIndex","includeBaseStyles","prevSelected","items","move","closeParent","findIndex","item","NotificationPosition","NotificationContext","show","useNotification","getViewport","visualViewport","innerHeight","scale","offsetTop","offsetLeft","NotificationWrapper","notification","setNotification","viewport","setViewport","positionClass","BottomLeft","TopLeft","TopRight","BottomRight","WrapperComponent","inline","unstable_autoFocusOnShow","willChange","Notification","timeoutId","timeoutInMs","withNotificationContext","WrappedComponent","displayName","WithNotificationContext","notificationContext","POPOVER_HEIGHT_LIMIT_STYLE","maxHeight","focusOnHide","hasArrow","hasBackdrop","popoverWrapperStyle","hasViewportHeightLimit","hasButtonWidthLimit","throttleWaitInMs","setSize","useWindowSize","buttonElement","unstable_referenceRef","buttonRect","popoverId","getAttribute","popoverWrapper","getElementById","offsetY","offsets","popoverMaxHeight","bottom","unstable_autoFocusOnHide","DEFAULT_OFFSET","useHoverPopover","showTimeout","hideTimeout","clearTimeouts","showPopover","hidePopover","onMouseOver","onMouseOut","ComboBoxItem","selected","currentId","ComboBox","inputProps","popoverProps","inputValue","INSTRUMENT_CATEGORIES","instrument","Instrument","Centered","SearchError","href","link","resetErrorBoundary","Highlight","highlight","processedText","before","after","getRedirectForTicker","tickerRaw","getInstrumentForTicker","SearchItem","company","exchange","SearchList","data","isLoading","useQuery","searchApiRequest","keepPreviousData","staleTime","Search","reset","useQueryErrorResetBoundary","minValueLength","defaultValue","listState","category","setCategory","changeCategory","first","onInputKeyDown","stopPropagation","autoFocus","placeholder","autoComplete","autoCorrect","autoCapitalize","redirectUri","ErrorBoundary","FallbackComponent","onReset","getSelectedItemIndex","useSelect","setSelectedIndex","closePopover","newIndex","onItemChange","selectedItem","reloadDocument","newUrl","URL","pathname","hash","SelectButton","themeProps","getButtonProps","Select","popoverStateSettings","StatelessSelect","labelClassName","buttonContent","listProps","isNativeMobileSelect","hasPopoverViewportHeightLimit","hasPopoverButtonWidthLimit","showMobileSelect","NativeSelectComponent","useInRouterContext","NativeSelectInRouterContext","NativeSelect","relative","SelectOption","SelectWithTooltip","tooltipLabel","tooltip","unstable_timeout","isTooltipIgnored","visibilityState","activeElement","onSelectFocus","onSelectBlur","onFocus","onBlur","showPlaceholder","handleNativeSelectChange","itemIndex","target","hidden","i","navigate","useNavigate","onChangeWithNavigate","SelectList","isProgressBar","progress","radius","strokeWidth","circleXY","circumference","PI","strokeDasharray","strokeDashoffset","strokeLinecap","TooltipBox","tooltipColor","TooltipColor","tooltipProps","transformMap","auto","right","TooltipArrow","positionMain","arrowColor","getHeadingElement","CRYPTO_TICKERS","TIMEFRAME","useElementMeasure","elementOverride","elementRef","setElementRef","elementWidth","setElementWidth","offsetWidth","elementHeight","setElementHeight","offsetHeight","measureElement","newElementWidth","newElementHeight","measureElementDebounced","debounce","resizeObserver","cancel","controller","AbortController","setResizeObserver","loadResizeObserverPolyfill","polyfill","signal","aborted","abort","ContextMenu","popperElement","setPopperElement","virtualRef","getVirtualRef","toJSON","styles","attributes","usePopper","modifiers","offset","popper","ChartGridCell","gridArea","GridLayout","columns","rows","gridTemplateColumns","gridTemplateRows","ChartGrid","defaultValueAccessor","InnerState","valueKey","changeKey","valueAccessor","handleChange","RangeSize","RangeSlider","step","inputClassName","hasTrack","setHasTrack","trackRef","thumbRef","thumbLeft","track","thumb","valuePercent","trackBox","thumbBox","DATERANGE_TOOLTIP","DateRangeSelect","chartIndex","dateRangeGroups","selectedDateRange","onDateRangeSelect","flatDateRanges","flatMap","dateRanges","selectWithTooltipListProps","Link","to","LabelWithDelayedSpinner","invisible","TIMEFRAME_TOOLTIP","TimeframeSelect","timeFrameGroups","selectedTimeframe","favoriteTimeframes","isCompactView","onTimeframeSelect","onFavoriteTimeframeToggle","flatTimeframes","timeframes","labelShort","groupIndex","isIconButtonActive","classNames","getTimeframeChipElementId","timeframe","TimeframeBar","compactViewMaxBreakpointPx","loadingTimeframe","isDateRangeAvailable","containerElement","isFavoritesEnabled","isScrollIntoViewEnabled","scrollWrapperElement","setScrollWrapperElement","timeframeButtonsScrollLocation","setTimeframeButtonsScrollLocation","isOnLeftEdge","isOnRightEdge","isStockDetailTimeframeBar","timeframesInExpandedPanel","checkTimeframeWrapperScrollPosition","scrollLeft","scrollWidth","timeframeElement","scrollIntoView","block","onScroll","onWheel","absDx","deltaX","deltaY","ToolbarTheme","ToolbarDirection","ToolbarContext","direction","vertical","isWrapped","isStretched","useToolbarContext","Toolbar","toolbarRef","contextProviderValue","alternative","horizontal","toolbarSettings","getToolbarSettings","forceReflow","originalWidth","ToolbarButton","disabledTooltip","isInAction","isInActionProp","iconAction","buttonSettings","isActive","grow","getButtonThemeSettings","getMainIcon","iconActive","titleActive","ToolbarGroup","defaultItem","groupItems","groupTitle","setSelectedItem","groupId","toLocaleLowerCase","useMobileNativeSelect","isAlternativeTheme","option","ToolbarItem","isItemActive","ToolbarDivider","TooltipInputComponent","tooltipContent","onMouseEnter","onMouseLeave","TooltipInput","StepContent","shepherdLibrary","loadShepherdLibrary","setLoading","shepherdPromise","default","buttonClasses","getStepButtons","tour","arr","action","complete","classes","back","backButton","next","nextButton","processSteps","steps","attachTo","on","popperOptions","ReactDOM","getTourKey","getStepsForUser","tours","lastFinishedTour","localStorage","getItem","lastTourIndex","allToursViewed","every","skip","toursToView","hasNewTours","initialTour","completeTour","setItem","DEFAULT_OPTIONS","exitOnEsc","useModalOverlay","useTour","setIsLoading","currentTour","setTour","loadingSetter","startTour","definition","setComplete","tourUtils","Tour","from","removeStep","processedSteps","addSteps","start","gtag","event_label","win","components","buttonGroup","checkbox","colorPicker","contextMenu","copyToClipboard","delayed","dialog","datePicker","dropdown","grid","innerState","list","range","spinner","timeframeBar","toolbar","tooltipInput","typography","FLibs","ReactRouterDOM","useSyncLocalStorage","storageKey","storage","subscription","unsubscribe","valueGetter","d3","nice","scaleLinear","scaleSymlog","DateFns","addBusinessDays","differenceInCalendarDays","eachDayOfInterval","endOfDay","intervalToDuration","isSameMonth","isSameWeek","isWeekend","isWithinInterval","startOfDay","startOfYear","sub","subMonths","subYears","assets","logo","ContentType","parseResponseForContentType","response","contentType","ApplicationJson","FormUrlEncoded","JSON","parse","ThrowableError","constructor","status","message","extra","super","this","isServerError","apiRequest","query","headers","throwOnAllErrors","requestUrl","URLSearchParams","requestOptions","request","cancelableRequest","textResponse","reponseContentType","get","Html","statusText","rayId","Sentry","scope","setContext","emitter","subscribeToChanges","changeCallback","EventEmitter","newValue","getValue","setValue","onStorageChange","addListener","removeListener","parsedValue","emit","valueToStore","Function","stringify","migrateValue","transformValue","oldValue","compilePath","path","params","pathToRegexp","toHome","toNews","toScreener","toCharts","toGroups","toPortfolio","toInsider","toElite","toSearch","validate","toQuote","toContact","toAlerts","toHelp","toAccount","toLogin","toLogout","toMaps","toBubbles","toFutures","toFuturesPerf","toFuturesCharts","toFuturesChartDetail","cleanTicker","toForex","toForexPerf","toForexCharts","toForexChartDetail","toCrypto","toCryptoPerf","toCryptoCharts","toCryptoChartDetail","toBacktests","toBacktestCreate","toBacktestDetail","backtestId","toBacktestPresets","lazyLoadComponent","chunkName","load","querySelector","componentLoader","lazy","cleanedTicker","resizeObserverPolyfill","getIsBrave","brave","isBrave"],"sourceRoot":""}