UNPKG

@kubb/react

Version:

React integration for Kubb, providing JSX runtime support and React component generation capabilities for code generation plugins.

1 lines 1.55 MB
{"version":3,"file":"index.cjs","names":["Component","onExit","result: React.ReactNode[]","node: TextNode","nodeNames: Array<ElementNames>","performWorkUntilDeadline","isMessageLoopRunning","localClearTimeout","taskTimeoutID","currentPriorityLevel","peek","taskQueue","currentTask","shouldYieldToHost","pop","timerQueue","requestHostTimeout","handleTimeout","schedulePerformWorkUntilDeadline","push","compare","advanceTimers","isHostCallbackScheduled","needsPaint","startTime","frameInterval","localSetTimeout","localPerformance","localDate","initialTime","taskIdCounter","isPerformingWork","isHostTimeoutScheduled","localSetImmediate","channel","port","pop","push","renderLanes","workInProgress","thenableState","Component","use","exports","React","pop","push","renderLanes","workInProgress","current","thenableState","componentName","Component","use","didReadFromEntangledAsyncAction","commitStartTime","exports","React","localPerformance","localDate","NoEventPriority","DefaultEventPriority","exports","factory","text","file: KubbFile.File","exports","#options","#container","#rootNode","#isUnmounted","#lastRendererResult","ConcurrentRoot","process","#exitPromise","types: string[]","names: string[]","item","key","name","acc: string[]","parsedItem","#params"],"sources":["../src/components/Root.tsx","../src/components/App.tsx","../src/components/Text.tsx","../src/components/Const.tsx","../src/components/File.tsx","../../../node_modules/.pnpm/indent-string@5.0.0/node_modules/indent-string/index.js","../src/components/Indent.tsx","../src/components/Function.tsx","../src/components/Type.tsx","../../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.1.1/node_modules/react-reconciler/cjs/react-reconciler-constants.production.js","../../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.1.1/node_modules/react-reconciler/cjs/react-reconciler-constants.development.js","../../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.1.1/node_modules/react-reconciler/constants.js","../src/dom.ts","../../../node_modules/.pnpm/scheduler@0.26.0/node_modules/scheduler/cjs/scheduler.production.js","../../../node_modules/.pnpm/scheduler@0.26.0/node_modules/scheduler/cjs/scheduler.development.js","../../../node_modules/.pnpm/scheduler@0.26.0/node_modules/scheduler/index.js","../../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.1.1/node_modules/react-reconciler/cjs/react-reconciler.production.js","../../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.1.1/node_modules/react-reconciler/cjs/react-reconciler.development.js","../../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.1.1/node_modules/react-reconciler/index.js","../src/kubbRenderer.ts","../src/utils/squashExportNodes.ts","../src/utils/squashImportNodes.ts","../src/utils/squashTextNodes.ts","../src/utils/squashSourceNodes.ts","../src/utils/getFiles.ts","../src/renderer.ts","../src/ReactTemplate.tsx","../src/createRoot.ts","../src/hooks/useApp.ts","../src/hooks/useFile.ts","../src/hooks/useLifecycle.tsx","../src/utils/getFunctionParams.ts","../src/index.ts"],"sourcesContent":["import { Component, createContext } from 'react'\n\nimport type { Logger } from '@kubb/core/logger'\nimport type { KubbNode } from '../types.ts'\n\ntype ErrorBoundaryProps<Meta extends Record<string, unknown> = Record<string, unknown>> = {\n onError: (error: Error) => void\n meta: Meta\n logger?: Logger\n children?: KubbNode\n}\n\nclass ErrorBoundary extends Component<{\n onError: ErrorBoundaryProps['onError']\n logger?: Logger\n children?: KubbNode\n}> {\n state = { hasError: false }\n\n static displayName = 'KubbErrorBoundary'\n static getDerivedStateFromError(_error: Error) {\n return { hasError: true }\n }\n\n componentDidCatch(error: Error) {\n if (error) {\n this.props.onError(error)\n }\n }\n\n render() {\n if (this.state.hasError) {\n return null\n }\n return this.props.children\n }\n}\n\nexport type RootContextProps<Meta extends Record<string, unknown> = Record<string, unknown>> = {\n /**\n * Exit (unmount) the whole Ink app.\n */\n readonly exit: (error?: Error) => void\n readonly meta: Meta\n}\n\nexport const RootContext = createContext<RootContextProps>({\n exit: () => {},\n meta: {},\n})\n\ntype RootProps<Meta extends Record<string, unknown> = Record<string, unknown>> = {\n /**\n * Exit (unmount) hook\n */\n readonly onExit: (error?: Error) => void\n /**\n * Error hook\n */\n readonly onError: (error: Error) => void\n readonly meta: Meta\n readonly logger?: Logger\n readonly children?: KubbNode\n}\n\nexport function Root<Meta extends Record<string, unknown> = Record<string, unknown>>({ onError, onExit, logger, meta, children }: RootProps<Meta>) {\n try {\n return (\n <ErrorBoundary\n logger={logger}\n onError={(error) => {\n onError(error)\n }}\n >\n <RootContext.Provider value={{ meta, exit: onExit }}>{children}</RootContext.Provider>\n </ErrorBoundary>\n )\n } catch (_e) {\n return null\n }\n}\n\nRoot.Context = RootContext\nRoot.displayName = 'KubbRoot'\n","import { createContext, useContext } from 'react'\n\nimport type { Plugin, PluginManager } from '@kubb/core'\nimport type { KubbFile } from '@kubb/core/fs'\nimport type { KubbNode } from '../types.ts'\nimport { RootContext } from './Root.tsx'\n\ntype AppContextProps = {\n /**\n * Exit (unmount)\n */\n readonly exit: (error?: Error) => void\n readonly mode: KubbFile.Mode\n readonly pluginManager: PluginManager\n readonly plugin: Plugin\n}\n\nconst AppContext = createContext<AppContextProps | undefined>(undefined)\n\ntype Props = {\n readonly mode: KubbFile.Mode\n readonly pluginManager: PluginManager\n readonly plugin: Plugin\n readonly children?: KubbNode\n}\n\nexport function App({ plugin, pluginManager, mode, children }: Props) {\n const { exit } = useContext(RootContext)\n\n return <AppContext.Provider value={{ exit, plugin, pluginManager, mode }}>{children}</AppContext.Provider>\n}\n\nApp.Context = AppContext\nApp.displayName = 'KubbApp'\n","import type { Key, KubbNode } from '../types.ts'\n\ntype Props = {\n key?: Key\n /**\n * Change the indent.\n * @default 0\n * @deprecated\n */\n indentSize?: number\n children?: KubbNode\n}\n\n/**\n * @deprecated\n */\nexport function Text({ children }: Props) {\n return <kubb-text>{children}</kubb-text>\n}\n\ntype SpaceProps = {}\n\nText.displayName = 'KubbText'\n\nexport function Space({}: SpaceProps) {\n return <kubb-text> </kubb-text>\n}\n\nSpace.displayName = 'KubbSpace'\n\nText.Space = Space\n","import { createJSDocBlockText } from '@kubb/core/transformers'\nimport type { JSDoc, Key, KubbNode } from '../types.ts'\n\nimport { Space } from './Text.tsx'\n\ntype Props = {\n key?: Key\n /**\n * Name of the const\n */\n name: string\n /**\n * Does this type need to be exported.\n */\n export?: boolean\n /**\n * Type to make the const being typed\n */\n type?: string\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Use of `const` assertions\n */\n asConst?: boolean\n children?: KubbNode\n}\n\nexport function Const({ name, export: canExport, type, JSDoc, asConst, children }: Props) {\n return (\n <>\n {JSDoc?.comments && (\n <>\n {createJSDocBlockText({ comments: JSDoc?.comments })}\n <br />\n </>\n )}\n {canExport && (\n <>\n export\n <Space />\n </>\n )}\n const {name}\n <Space />\n {type && (\n <>\n {':'}\n {type}\n <Space />\n </>\n )}\n = {children}\n {asConst && (\n <>\n <Space />\n as const\n </>\n )}\n </>\n )\n}\n\nConst.displayName = 'KubbConst'\n","import { createContext } from 'react'\n\nimport type { FileMetaBase } from '@kubb/core'\nimport type { KubbFile } from '@kubb/core/fs'\nimport type { Key, KubbNode } from '../types.ts'\n\nexport type FileContextProps<TMeta extends FileMetaBase = FileMetaBase> = {\n /**\n * Name to be used to dynamicly create the baseName(based on input.path).\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: KubbFile.BaseName\n /**\n * Path will be full qualified path to a specified file.\n */\n path: KubbFile.Path\n meta?: TMeta\n}\nconst FileContext = createContext<FileContextProps>({} as FileContextProps)\n\ntype BasePropsWithBaseName = {\n /**\n * Name to be used to dynamicly create the baseName(based on input.path).\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: KubbFile.BaseName\n /**\n * Path will be full qualified path to a specified file.\n */\n path: KubbFile.Path\n}\n\ntype BasePropsWithoutBaseName = {\n baseName?: never\n /**\n * Path will be full qualified path to a specified file.\n */\n path?: KubbFile.Path\n}\n\ntype BaseProps = BasePropsWithBaseName | BasePropsWithoutBaseName\n\ntype Props<TMeta extends FileMetaBase = FileMetaBase> = BaseProps & {\n key?: Key\n meta?: TMeta\n banner?: string\n footer?: string\n children?: KubbNode\n}\n\nexport function File<TMeta extends FileMetaBase = FileMetaBase>({ children, ...rest }: Props<TMeta>) {\n if (!rest.baseName || !rest.path) {\n return <>{children}</>\n }\n\n return (\n <kubb-file {...rest}>\n <FileContext.Provider value={{ baseName: rest.baseName, path: rest.path, meta: rest.meta }}>{children}</FileContext.Provider>\n </kubb-file>\n )\n}\n\nFile.displayName = 'KubbFile'\n\ntype FileSourceProps = Omit<KubbFile.Source, 'value'> & {\n key?: Key\n children?: KubbNode\n}\n\nfunction FileSource({ isTypeOnly, name, isExportable, isIndexable, children }: FileSourceProps) {\n return (\n <kubb-source name={name} isTypeOnly={isTypeOnly} isExportable={isExportable} isIndexable={isIndexable}>\n {children}\n </kubb-source>\n )\n}\n\nFileSource.displayName = 'KubbFileSource'\n\ntype FileExportProps = KubbFile.Export & { key?: Key }\n\nfunction FileExport({ name, path, isTypeOnly, asAlias }: FileExportProps) {\n return <kubb-export name={name} path={path} isTypeOnly={isTypeOnly || false} asAlias={asAlias} />\n}\n\nFileExport.displayName = 'KubbFileExport'\n\ntype FileImportProps = KubbFile.Import & { key?: Key }\n\nfunction FileImport({ name, root, path, isTypeOnly, isNameSpace }: FileImportProps) {\n return <kubb-import name={name} root={root} path={path} isNameSpace={isNameSpace} isTypeOnly={isTypeOnly || false} />\n}\n\nFileImport.displayName = 'KubbFileImport'\n\nFile.Export = FileExport\nFile.Import = FileImport\nFile.Source = FileSource\nFile.Context = FileContext\n","export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n","import dedent from 'dedent'\nimport indentString from 'indent-string'\nimport React from 'react'\n\ntype IndentProps = {\n size?: number\n children?: React.ReactNode\n}\n\n/**\n * Indents all children by `size` spaces.\n * Collapses consecutive <br /> tags to at most 2.\n */\nexport function Indent({ size = 2, children }: IndentProps) {\n if (!children) return null\n\n const filtered = React.Children.toArray(children).filter(Boolean)\n const result: React.ReactNode[] = []\n\n let prevWasBr = false\n let brCount = 0\n\n filtered.forEach((child) => {\n if (React.isValidElement(child) && child.type === 'br') {\n if (!prevWasBr || brCount < 2) {\n result.push(child)\n brCount++\n }\n prevWasBr = true\n } else {\n prevWasBr = false\n brCount = 0\n result.push(child)\n }\n })\n\n return (\n <>\n {result.map((child) => {\n if (typeof child === 'string') {\n const cleaned = dedent(child)\n return <>{indentString(cleaned, size)}</>\n }\n return (\n <>\n {' '.repeat(size)}\n {child}\n </>\n )\n })}\n </>\n )\n}\n","import { createJSDocBlockText } from '@kubb/core/transformers'\nimport type { JSDoc, Key, KubbNode } from '../types.ts'\nimport { Indent } from './Indent.tsx'\nimport { Space } from './Text.tsx'\n\ntype Props = {\n key?: Key\n /**\n * Name of the function.\n */\n name: string\n /**\n * Add default when export is being used\n */\n default?: boolean\n /**\n * Parameters/options/props that need to be used.\n */\n params?: string\n /**\n * Does this function need to be exported.\n */\n export?: boolean\n /**\n * Does the function has async/promise behaviour.\n * This will also add `Promise<returnType>` as the returnType.\n */\n async?: boolean\n /**\n * Generics that needs to be added for TypeScript.\n */\n generics?: string | string[]\n\n /**\n * ReturnType(see async for adding Promise type).\n */\n returnType?: string\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n children?: KubbNode\n}\n\nexport function Function({ name, default: isDefault, export: canExport, async, generics, params, returnType, JSDoc, children }: Props) {\n return (\n <>\n {JSDoc?.comments && (\n <>\n {createJSDocBlockText({ comments: JSDoc?.comments })}\n <br />\n </>\n )}\n {canExport && (\n <>\n export\n <Space />\n </>\n )}\n {isDefault && (\n <>\n default\n <Space />\n </>\n )}\n {async && (\n <>\n async\n <Space />\n </>\n )}\n function {name}\n {generics && (\n <>\n {'<'}\n {Array.isArray(generics) ? generics.join(', ').trim() : generics}\n {'>'}\n </>\n )}\n ({params}){returnType && !async && <>: {returnType}</>}\n {returnType && async && (\n <>\n : Promise{'<'}\n {returnType}\n {'>'}\n </>\n )}\n {' {'}\n <br />\n <Indent size={2}>{children}</Indent>\n <br />\n {'}'}\n </>\n )\n}\n\nFunction.displayName = 'KubbFunction'\n\ntype ArrowFunctionProps = Props & {\n /**\n * Create Arrow function in one line\n */\n singleLine?: boolean\n}\n\nfunction ArrowFunction({ name, default: isDefault, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps) {\n return (\n <>\n {JSDoc?.comments && (\n <>\n {createJSDocBlockText({ comments: JSDoc?.comments })}\n <br />\n </>\n )}\n {canExport && (\n <>\n export\n <Space />\n </>\n )}\n {isDefault && (\n <>\n default\n <Space />\n </>\n )}\n const {name} =<Space />\n {async && (\n <>\n async\n <Space />\n </>\n )}\n {generics && (\n <>\n {'<'}\n {Array.isArray(generics) ? generics.join(', ').trim() : generics}\n {'>'}\n </>\n )}\n ({params}){returnType && !async && <>: {returnType}</>}\n {returnType && async && (\n <>\n : Promise{'<'}\n {returnType}\n {'>'}\n </>\n )}\n {singleLine && (\n <>\n {' => '}\n {children}\n <br />\n </>\n )}\n {!singleLine && (\n <>\n {' => {'}\n <br />\n <Indent size={2}>{children}</Indent>\n <br />\n {'}'}\n <br />\n </>\n )}\n </>\n )\n}\n\nArrowFunction.displayName = 'KubbArrowFunction'\nFunction.Arrow = ArrowFunction\n","import { createJSDocBlockText } from '@kubb/core/transformers'\nimport type { JSDoc, Key, KubbNode } from '../types.ts'\nimport { Space } from './Text.tsx'\n\ntype Props = {\n key?: Key\n /**\n * Name of the type, this needs to start with a capital letter.\n */\n name: string\n /**\n * Does this type need to be exported.\n */\n export?: boolean\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n children?: KubbNode\n}\n\nexport function Type({ name, export: canExport, JSDoc, children }: Props) {\n if (name.charAt(0).toUpperCase() !== name.charAt(0)) {\n throw new Error('Name should start with a capital letter(see TypeScript types)')\n }\n\n return (\n <>\n {JSDoc?.comments && (\n <>\n {createJSDocBlockText({ comments: JSDoc?.comments })}\n <br />\n </>\n )}\n {canExport && (\n <>\n export\n <Space />\n </>\n )}\n type {name} = {children}\n </>\n )\n}\n\nType.displayName = 'KubbType'\n","/**\n * @license React\n * react-reconciler-constants.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nexports.ConcurrentRoot = 1;\nexports.ContinuousEventPriority = 8;\nexports.DefaultEventPriority = 32;\nexports.DiscreteEventPriority = 2;\nexports.IdleEventPriority = 268435456;\nexports.LegacyRoot = 0;\nexports.NoEventPriority = 0;\n","/**\n * @license React\n * react-reconciler-constants.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n ((exports.ConcurrentRoot = 1),\n (exports.ContinuousEventPriority = 8),\n (exports.DefaultEventPriority = 32),\n (exports.DiscreteEventPriority = 2),\n (exports.IdleEventPriority = 268435456),\n (exports.LegacyRoot = 0),\n (exports.NoEventPriority = 0));\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-reconciler-constants.production.js');\n} else {\n module.exports = require('./cjs/react-reconciler-constants.development.js');\n}\n","import type { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, TextNode } from './types.ts'\n\nexport const createNode = (nodeName: string): DOMElement => {\n const node: DOMElement = {\n nodeName: nodeName as DOMElement['nodeName'],\n attributes: {},\n childNodes: [],\n parentNode: undefined,\n }\n\n return node\n}\n\nexport const appendChildNode = (node: DOMElement, childNode: DOMElement): void => {\n if (childNode.parentNode) {\n removeChildNode(childNode.parentNode, childNode)\n }\n\n childNode.parentNode = node\n node.childNodes.push(childNode)\n}\n\nexport const insertBeforeNode = (node: DOMElement, newChildNode: DOMNode, beforeChildNode: DOMNode): void => {\n if (newChildNode.parentNode) {\n removeChildNode(newChildNode.parentNode, newChildNode)\n }\n\n newChildNode.parentNode = node\n\n const index = node.childNodes.indexOf(beforeChildNode)\n if (index >= 0) {\n node.childNodes.splice(index, 0, newChildNode)\n\n return\n }\n\n node.childNodes.push(newChildNode)\n}\n\nexport const removeChildNode = (node: DOMElement, removeNode: DOMNode): void => {\n removeNode.parentNode = undefined\n\n const index = node.childNodes.indexOf(removeNode)\n if (index >= 0) {\n node.childNodes.splice(index, 1)\n }\n}\n\nexport const setAttribute = (node: DOMElement, key: string, value: DOMNodeAttribute): void => {\n node.attributes[key] = value\n}\n\nexport const createTextNode = (text: string): TextNode => {\n const node: TextNode = {\n nodeName: '#text',\n nodeValue: text,\n parentNode: undefined,\n }\n\n setTextNodeValue(node, text)\n\n return node\n}\n\nexport const setTextNodeValue = (node: TextNode, text: string): void => {\n if (typeof text !== 'string') {\n text = String(text)\n }\n\n node.nodeValue = text\n}\n\nexport const nodeNames: Array<ElementNames> = ['kubb-export', 'kubb-file', 'kubb-source', 'kubb-import', 'kubb-text']\n","/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);\n else break a;\n }\n}\nfunction peek(heap) {\n return 0 === heap.length ? null : heap[0];\n}\nfunction pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);\n else break a;\n }\n }\n return first;\n}\nfunction compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n}\nexports.unstable_now = void 0;\nif (\"object\" === typeof performance && \"function\" === typeof performance.now) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n}\nvar taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n needsPaint = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout = \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate = \"undefined\" !== typeof setImmediate ? setImmediate : null;\nfunction advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n}\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n}\nvar isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\nfunction shouldYieldToHost() {\n return needsPaint\n ? !0\n : exports.unstable_now() - startTime < frameInterval\n ? !1\n : !0;\n}\nfunction performWorkUntilDeadline() {\n needsPaint = !1;\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime && shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n}\nvar schedulePerformWorkUntilDeadline;\nif (\"function\" === typeof localSetImmediate)\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\nelse if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\nexports.unstable_IdlePriority = 5;\nexports.unstable_ImmediatePriority = 1;\nexports.unstable_LowPriority = 4;\nexports.unstable_NormalPriority = 3;\nexports.unstable_Profiling = null;\nexports.unstable_UserBlockingPriority = 2;\nexports.unstable_cancelCallback = function (task) {\n task.callback = null;\n};\nexports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n};\nexports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n};\nexports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_requestPaint = function () {\n needsPaint = !0;\n};\nexports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline())));\n return priorityLevel;\n};\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n};\n","/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function performWorkUntilDeadline() {\n needsPaint = !1;\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime &&\n shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n }\n function push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node),\n (heap[index] = parent),\n (index = parentIndex);\n else break a;\n }\n }\n function peek(heap) {\n return 0 === heap.length ? null : heap[0];\n }\n function pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex);\n else break a;\n }\n }\n return first;\n }\n function compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n }\n function advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n }\n function handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n }\n }\n function shouldYieldToHost() {\n return needsPaint\n ? !0\n : exports.unstable_now() - startTime < frameInterval\n ? !1\n : !0;\n }\n function requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n exports.unstable_now = void 0;\n if (\n \"object\" === typeof performance &&\n \"function\" === typeof performance.now\n ) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n } else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n }\n var taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n needsPaint = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout =\n \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate =\n \"undefined\" !== typeof setImmediate ? setImmediate : null,\n isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\n if (\"function\" === typeof localSetImmediate)\n var schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\n else if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n } else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\n exports.unstable_IdlePriority = 5;\n exports.unstable_ImmediatePriority = 1;\n exports.unstable_LowPriority = 4;\n exports.unstable_NormalPriority = 3;\n exports.unstable_Profiling = null;\n exports.unstable_UserBlockingPriority = 2;\n exports.unstable_cancelCallback = function (task) {\n task.callback = null;\n };\n exports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n };\n exports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n };\n exports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n exports.unstable_requestPaint = function () {\n needsPaint = !0;\n };\n exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n exports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n ) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0),\n schedulePerformWorkUntilDeadline())));\n return priorityLevel;\n };\n exports.unstable_shouldYield = shouldYieldToHost;\n exports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-reconciler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nmodule.exports = function ($$$config) {\n function createFiber(tag, pendingProps, key, mode) {\n return new FiberNode(tag, pendingProps, key, mode);\n }\n function noop() {}\n function formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n }\n function getNearestMountedFiber(fiber) {\n var node = fiber,\n nearestMounted = fiber;\n if (fiber.alternate) for (; node.return; ) node = node.return;\n else {\n fiber = node;\n do\n (node = fiber),\n 0 !== (node.flags & 4098) && (nearestMounted = node.return),\n (fiber = node.return);\n while (fiber);\n }\n return 3 === node.tag ? nearestMounted : null;\n }\n function assertIsMounted(fiber) {\n if (getNearestMountedFiber(fiber) !== fiber)\n throw Error(formatProdErrorMessage(188));\n }\n function findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n if (!alternate) {\n alternate = getNearestMountedFiber(fiber);\n if (null === alternate) throw Error(formatProdErrorMessage(188));\n return alternate !== fiber ? null : fiber;\n }\n for (var a = fiber, b = alternate; ; ) {\n var parentA = a.return;\n if (null === parentA) break;\n var parentB = parentA.alternate;\n if (null === parentB) {\n b = parentA.return;\n if (null !== b) {\n a = b;\n continue;\n }\n break;\n }\n if (parentA.child === parentB.child) {\n for (parentB = parentA.child; parentB; ) {\n if (parentB === a) return assertIsMounted(parentA), fiber;\n if (parentB === b) return assertIsMounted(parentA), alternate;\n parentB = parentB.sibling;\n }\n throw Error(formatProdErrorMessage(188));\n }\n if (a.return !== b.return) (a = parentA), (b = parentB);\n else {\n for (var didFindChild = !1, child$0 = parentA.child; child$0; ) {\n if (child$0 === a) {\n didFindChild = !0;\n a = parentA;\n b = parentB;\n break;\n }\n if (child$0 === b) {\n didFindChild = !0;\n b = parentA;\n a = parentB;\n break;\n }\n child$0 = child$0.sibling;\n }\n if (!didFindChild) {\n for (child$0 = parentB.child; child$0; ) {\n if (child$0 === a) {\n didFindChild = !0;\n a = parentB;\n b = parentA;\n break;\n }\n if (child$0 === b) {\n didFindChild = !0;\n b = parentB;\n a = parentA;\n break;\n }\n child$0 = child$0.sibling;\n }\n if (!didFindChild) throw Error(formatProdErrorMessage(189));\n }\n }\n if (a.alternate !== b) throw Error(formatProdErrorMessage(190));\n }\n if (3 !== a.tag) throw Error(formatProdErrorMessage(188));\n return a.stateNode.current === a ? fiber : alternate;\n }\n function findCurrentHostFiberImpl(node) {\n var tag = node.tag;\n if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;\n for (node = node.child; null !== node; ) {\n tag = findCurrentHostFiberImpl(node);\n if (null !== tag) return tag;\n node = node.sibling;\n }\n return null;\n }\n function findCurrentHostFiberWithNoPortalsImpl(node) {\n var tag = node.tag;\n if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;\n for (node = node.child; null !== node; ) {\n if (\n 4 !== node.tag &&\n ((tag = findCurrentHostFiberWithNoPortalsImpl(node)), null !== tag)\n )\n return tag;\n node = node.sibling;\n }\n return null;\n }\n function getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable)\n return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n }\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return (type.displayName || \"Context\") + \".Provider\";\n