@ews-admin/global-design-system 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/doctor.png +0 -0
- package/dist/assets/favicon.ico +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/assets/logoAssets.d.ts +11 -0
- package/dist/assets/logoAssets.d.ts.map +1 -0
- package/dist/assets/logoWhite.png +0 -0
- package/dist/assets/patient.png +0 -0
- package/dist/components/DoctorForm/DoctorForm.d.ts +11 -0
- package/dist/components/DoctorForm/DoctorForm.d.ts.map +1 -0
- package/dist/components/DoctorForm/index.d.ts +3 -0
- package/dist/components/DoctorForm/index.d.ts.map +1 -0
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +3 -3
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.css +2 -2
- package/dist/index.esm.js +7 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/public/doctor.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/image/doctor.png +0 -0
- package/dist/public/image/logo.png +0 -0
- package/dist/public/image/logoWhite.png +0 -0
- package/dist/public/image/patient.png +0 -0
- package/dist/public/logo.png +0 -0
- package/dist/public/logoWhite.png +0 -0
- package/dist/public/patient.png +0 -0
- package/dist/types/doctor.d.ts +144 -0
- package/dist/types/doctor.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/components/Logo/Logo.tsx +7 -5
- package/src/components/Modal/Modal.tsx +10 -10
- package/src/components/Select/Select.tsx +5 -2
- package/src/styles/index.css +0 -11
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../src/utils/index.ts","../src/components/Button/Button.tsx","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-right.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle-alert.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/eye-off.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/eye.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/heart.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/stethoscope.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/triangle-alert.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/user.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js","../src/icons/Icon.tsx","../src/icons/DoctorIcon.tsx","../src/icons/PatientIcon.tsx","../src/icons/UserIcon.tsx","../src/components/Input/Input.tsx","../src/components/Select/Select.tsx","../src/hooks/useDebounce.ts","../../../../../node_modules/.pnpm/react-hook-form@7.62.0_react@18.2.0/node_modules/react-hook-form/dist/index.esm.mjs","../src/hooks/useSelectField.ts","../src/components/SearchAutocomplete/SearchAutocomplete.tsx","../src/components/MultiSearchAutocomplete/MultiSearchAutocomplete.tsx","../src/components/Modal/Modal.tsx","../src/components/Logo/Logo.tsx","../src/theme/themeConfig.ts","../src/theme/ThemeProvider.tsx","../src/components/ThemeToggle/ThemeToggle.tsx","../src/components/ThemeDebugger/ThemeDebugger.tsx","../src/molecules/SpecialtySearchAutocomplete/SpecialtySearchAutocomplete.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx, type ClassValue } from \"clsx\";\n\n/**\n * Default currency for price formatting\n */\nexport const CURRENCY = \"XOF\";\n\n/**\n * Utility function to merge class names\n * @param inputs - Class values to merge\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n\n/**\n * Utility function to format currency\n * @param amount - Amount to format\n * @param currency - Currency code (default: CURRENCY constant)\n * @returns Formatted currency string\n */\nexport function formatCurrency(amount: number, currency = CURRENCY): string {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency,\n }).format(amount);\n}\n\n/**\n * Utility function to format date\n * @param date - Date to format\n * @param options - Intl.DateTimeFormat options\n * @returns Formatted date string\n */\nexport function formatDate(\n date: Date | string | number,\n options?: Intl.DateTimeFormatOptions\n): string {\n const dateObj = new Date(date);\n return new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n ...options,\n }).format(dateObj);\n}\n\n/**\n * Utility function to debounce function calls\n * @param func - Function to debounce\n * @param wait - Wait time in milliseconds\n * @returns Debounced function\n */\nexport function debounce<T extends (...args: any[]) => any>(\n func: T,\n wait: number\n): (...args: Parameters<T>) => void {\n let timeout: ReturnType<typeof setTimeout>;\n return (...args: Parameters<T>) => {\n clearTimeout(timeout);\n timeout = setTimeout(() => func(...args), wait);\n };\n}\n\n/**\n * Utility function to generate unique ID\n * @param prefix - Optional prefix for the ID\n * @returns Unique ID string\n */\nexport function generateId(prefix = \"ews\"): string {\n return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;\n}\n","import React from \"react\";\nimport { cn } from \"../../utils\";\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Button variant\n */\n variant?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"error\" | \"ghost\";\n /**\n * Button size\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Whether the button is in a loading state\n */\n loading?: boolean;\n /**\n * Whether the button should take full width\n */\n fullWidth?: boolean;\n /**\n * Icon to display before the button text\n */\n leftIcon?: React.ReactNode;\n /**\n * Icon to display after the button text\n */\n rightIcon?: React.ReactNode;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"md\",\n loading = false,\n fullWidth = false,\n leftIcon,\n rightIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const baseStyles =\n \"inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none\";\n\n const variants = {\n primary:\n \"bg-ews-primary text-white hover:bg-ews-primary-hover focus:ring-ews-primary\",\n secondary:\n \"bg-ews-secondary text-white hover:bg-ews-secondary-hover focus:ring-ews-secondary\",\n success:\n \"bg-ews-success text-white hover:bg-ews-success-hover focus:ring-ews-success\",\n warning:\n \"bg-ews-warning text-white hover:bg-ews-warning-hover focus:ring-ews-warning\",\n error:\n \"bg-ews-error text-white hover:bg-ews-error-hover focus:ring-ews-error\",\n ghost:\n \"bg-transparent text-ews-gray-700 hover:bg-ews-gray-100 focus:ring-ews-gray-500\",\n };\n\n const sizes = {\n sm: \"px-3 py-1.5 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n };\n\n const iconSizes = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n };\n\n return (\n <button\n className={cn(\n baseStyles,\n variants[variant],\n sizes[size],\n fullWidth && \"w-full\",\n className\n )}\n ref={ref}\n disabled={disabled || loading}\n {...props}\n >\n {loading && (\n <svg\n className=\"animate-spin -ml-1 mr-2 h-4 w-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n )}\n {!loading && leftIcon && (\n <span className={cn(\"mr-2 flex items-center\", iconSizes[size])}>\n {leftIcon}\n </span>\n )}\n {children}\n {!loading && rightIcon && (\n <span className={cn(\"ml-2 flex items-center\", iconSizes[size])}>\n {rightIcon}\n </span>\n )}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n\nexport { Button };\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n};\n\nexport { hasA11yProp, mergeClasses, toCamelCase, toKebabCase, toPascalCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses, hasA11yProp } from './shared/src/utils.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses, toKebabCase, toPascalCase } from './shared/src/utils.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"chevron-down\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n];\nconst CircleAlert = createLucideIcon(\"circle-alert\", __iconNode);\n\nexport { __iconNode, CircleAlert as default };\n//# sourceMappingURL=circle-alert.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\",\n key: \"mvr1a0\"\n }\n ]\n];\nconst Heart = createLucideIcon(\"heart\", __iconNode);\n\nexport { __iconNode, Heart as default };\n//# sourceMappingURL=heart.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }]\n];\nconst Search = createLucideIcon(\"search\", __iconNode);\n\nexport { __iconNode, Search as default };\n//# sourceMappingURL=search.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M11 2v2\", key: \"1539x4\" }],\n [\"path\", { d: \"M5 2v2\", key: \"1yf1q8\" }],\n [\"path\", { d: \"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1\", key: \"rb5t3r\" }],\n [\"path\", { d: \"M8 15a6 6 0 0 0 12 0v-3\", key: \"x18d4x\" }],\n [\"circle\", { cx: \"20\", cy: \"10\", r: \"2\", key: \"ts1r5v\" }]\n];\nconst Stethoscope = createLucideIcon(\"stethoscope\", __iconNode);\n\nexport { __iconNode, Stethoscope as default };\n//# sourceMappingURL=stethoscope.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\", key: \"975kel\" }],\n [\"circle\", { cx: \"12\", cy: \"7\", r: \"4\", key: \"17ys0d\" }]\n];\nconst User = createLucideIcon(\"user\", __iconNode);\n\nexport { __iconNode, User as default };\n//# sourceMappingURL=user.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n","import { LucideProps } from \"lucide-react\";\nimport React from \"react\";\n\nexport interface IconProps extends Omit<LucideProps, \"size\"> {\n /**\n * Icon size\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | number;\n /**\n * The Lucide icon component to render\n */\n icon: React.ComponentType<LucideProps>;\n}\n\n// Simple icon props for individual icon components\nexport interface SimpleIconProps {\n /**\n * Icon size in pixels\n */\n size?: number;\n /**\n * Icon color (can be hex, rgb, or Tailwind class)\n */\n color?: string;\n /**\n * Additional CSS classes (supports Tailwind classes)\n */\n className?: string;\n /**\n * Other props passed to the underlying icon\n */\n [key: string]: any;\n}\n\nconst Icon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ size = \"md\", icon: IconComponent, className, ...props }, ref) => {\n const sizes = {\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n };\n\n const iconSize = typeof size === \"number\" ? size : sizes[size];\n\n return (\n <IconComponent\n ref={ref}\n size={iconSize}\n className={className}\n {...props}\n />\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n\nexport { Icon };\n","import { Stethoscope } from \"lucide-react\";\nimport React from \"react\";\nimport { SimpleIconProps } from \"./Icon\";\n\nexport const DoctorIcon: React.FC<SimpleIconProps> = ({\n size = 24,\n color = \"currentColor\",\n className = \"\",\n ...props\n}) => {\n return (\n <Stethoscope size={size} color={color} className={className} {...props} />\n );\n};\n","import { Heart } from \"lucide-react\";\nimport React from \"react\";\nimport { SimpleIconProps } from \"./Icon\";\n\nexport const PatientIcon: React.FC<SimpleIconProps> = ({\n size = 24,\n color = \"currentColor\",\n className = \"\",\n ...props\n}) => {\n return <Heart size={size} color={color} className={className} {...props} />;\n};\n","import { User } from \"lucide-react\";\nimport React from \"react\";\nimport { SimpleIconProps } from \"./Icon\";\n\nexport const UserIcon: React.FC<SimpleIconProps> = ({\n size = 24,\n color = \"currentColor\",\n className = \"\",\n ...props\n}) => {\n return <User size={size} color={color} className={className} {...props} />;\n};\n","import React, { useState } from \"react\";\nimport { Eye, EyeOff } from \"../../icons\";\nimport { cn } from \"../../utils\";\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n /**\n * Input variant\n */\n variant?: \"default\" | \"error\" | \"success\";\n /**\n * Input size\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Label for the input\n */\n label?: string;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Error message to display\n */\n error?: string;\n /**\n * Icon to display before the input\n */\n leftIcon?: React.ReactNode;\n /**\n * Icon to display after the input\n */\n rightIcon?: React.ReactNode;\n /**\n * Whether the input should take full width\n */\n fullWidth?: boolean;\n /**\n * Whether to show password toggle for password inputs\n */\n showPasswordToggle?: boolean;\n /**\n * Whether the input is required (shows red asterisk)\n */\n required?: boolean;\n}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n variant = \"default\",\n size = \"md\",\n label,\n helperText,\n error,\n leftIcon,\n rightIcon,\n fullWidth = false,\n showPasswordToggle = false,\n required = false,\n id,\n type = \"text\",\n ...props\n },\n ref\n ) => {\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n const hasError = Boolean(error);\n const actualVariant = hasError ? \"error\" : variant;\n\n // Password visibility state\n const [showPassword, setShowPassword] = useState(false);\n const isPasswordInput = type === \"password\";\n const shouldShowPasswordToggle = showPasswordToggle && isPasswordInput;\n const actualType = isPasswordInput && showPassword ? \"text\" : type;\n\n const baseStyles =\n \"block w-full rounded-md border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-0 hover:border-ews-primary\";\n\n const variants = {\n default:\n \"border-ews-gray-300 focus:border-ews-primary focus:ring-ews-primary\",\n error: \"border-ews-error focus:border-ews-error focus:ring-ews-error\",\n success:\n \"border-ews-success focus:border-ews-success focus:ring-ews-success\",\n };\n\n const sizes = {\n sm: \"px-3 py-1.5 text-sm\",\n md: \"px-3 py-2 text-base\",\n lg: \"px-4 py-3 text-lg\",\n };\n\n const iconSizes = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n };\n\n return (\n <div className={cn(\"space-y-1\", fullWidth ? \"w-full\" : \"w-auto\")}>\n {label && (\n <label\n htmlFor={inputId}\n className=\"block text-sm font-medium text-ews-gray-700\"\n >\n {label}\n {required && <span className=\"ml-1 text-ews-error\">*</span>}\n </label>\n )}\n <div className=\"relative\">\n {leftIcon && (\n <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\n <span className={cn(\"text-ews-gray-400\", iconSizes[size])}>\n {leftIcon}\n </span>\n </div>\n )}\n <input\n id={inputId}\n type={actualType}\n className={cn(\n baseStyles,\n variants[actualVariant],\n sizes[size],\n leftIcon && \"pl-10\",\n (rightIcon || shouldShowPasswordToggle) && \"pr-10\",\n className\n )}\n ref={ref}\n {...props}\n />\n {rightIcon && !shouldShowPasswordToggle && (\n <div className=\"flex absolute inset-y-0 right-0 items-center pr-3 pointer-events-none\">\n <span className={cn(\"text-ews-gray-400\", iconSizes[size])}>\n {rightIcon}\n </span>\n </div>\n )}\n {shouldShowPasswordToggle && (\n <button\n type=\"button\"\n className=\"flex absolute inset-y-0 right-0 items-center pr-3\"\n onClick={() => setShowPassword(!showPassword)}\n tabIndex={-1}\n >\n <span\n className={cn(\n \"transition-colors text-ews-gray-400 hover:text-ews-gray-600\",\n iconSizes[size]\n )}\n >\n {showPassword ? <EyeOff size={16} /> : <Eye size={16} />}\n </span>\n </button>\n )}\n </div>\n {(error || helperText) && (\n <p\n className={cn(\n \"text-sm\",\n error ? \"text-ews-error\" : \"text-ews-gray-500\"\n )}\n >\n {error || helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { ChevronDown, Search, X } from \"lucide-react\";\nimport React, { forwardRef, useEffect, useId, useRef, useState } from \"react\";\nimport { cn } from \"../../utils\";\n\nexport interface SelectOption<T = any> {\n value: T;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps<T = any> {\n /**\n * Array of options to display\n */\n options: SelectOption<T>[];\n /**\n * Current selected value\n */\n value?: T;\n /**\n * Callback when selection changes\n */\n onChange?: (value: T, option: SelectOption<T>) => void;\n /**\n * Placeholder text when no option is selected\n */\n placeholder?: string;\n /**\n * Label for the select\n */\n label?: string;\n /**\n * Helper text to display below the select\n */\n helperText?: string;\n /**\n * Error message to display\n */\n error?: string;\n /**\n * Whether the select is in an error state\n */\n isError?: boolean;\n /**\n * Size variant\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Whether the select is disabled\n */\n disabled?: boolean;\n /**\n * Whether the select is required\n */\n required?: boolean;\n /**\n * Whether the select is searchable\n */\n searchable?: boolean;\n /**\n * Whether the select allows multiple selections\n */\n multiple?: boolean;\n /**\n * Custom class name for the select element\n */\n selectClassName?: string;\n /**\n * Custom class name for the container\n */\n containerClassName?: string;\n /**\n * Custom class name for the dropdown\n */\n dropdownClassName?: string;\n /**\n * Maximum height of the dropdown\n */\n maxHeight?: number;\n /**\n * Whether to show clear button\n */\n clearable?: boolean;\n /**\n * Custom render function for options\n */\n renderOption?: (\n option: SelectOption<T>,\n isSelected: boolean\n ) => React.ReactNode;\n /**\n * Custom render function for selected value\n */\n renderValue?: (option: SelectOption<T> | null) => React.ReactNode;\n}\n\nconst Select = forwardRef<HTMLDivElement, SelectProps>(\n (\n {\n options = [],\n value,\n onChange,\n placeholder = \"Select an option...\",\n label,\n helperText,\n error,\n isError = false,\n size = \"md\",\n disabled = false,\n required = false,\n searchable = false,\n multiple: _multiple = false,\n selectClassName,\n containerClassName,\n dropdownClassName,\n maxHeight = 200,\n clearable = false,\n renderOption,\n renderValue,\n ...props\n },\n ref\n ) => {\n const generatedId = useId();\n const selectId = `select-${generatedId}`;\n const hasError = isError || !!error;\n\n const [isOpen, setIsOpen] = useState(false);\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [focusedIndex, setFocusedIndex] = useState(-1);\n const [dropdownPosition, setDropdownPosition] = useState<\"bottom\" | \"top\">(\n \"bottom\"\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n // Find selected option\n const selectedOption = options.find((option) => option.value === value);\n\n // Filter options based on search term\n const filteredOptions = searchable\n ? options.filter((option) =>\n option.label.toLowerCase().includes(searchTerm.toLowerCase())\n )\n : options;\n\n // Calculate dropdown position based on available space\n const calculateDropdownPosition = () => {\n if (!containerRef.current) return;\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n // More accurate height calculation\n const optionHeight = 40; // Approximate height per option\n const searchHeight = searchable ? 60 : 0;\n const padding = 16; // py-1 = 8px top + 8px bottom\n const dropdownHeight = Math.min(\n maxHeight,\n filteredOptions.length * optionHeight + searchHeight + padding\n );\n\n const spaceBelow = viewportHeight - containerRect.bottom;\n const spaceAbove = containerRect.top;\n\n // Add some buffer (20px) to prevent edge cases\n const buffer = 20;\n\n console.log(\"Position calculation:\", {\n spaceBelow,\n spaceAbove,\n dropdownHeight,\n viewportHeight,\n containerBottom: containerRect.bottom,\n shouldOpenTop:\n spaceBelow < dropdownHeight + buffer &&\n spaceAbove > dropdownHeight + buffer,\n });\n\n // If there's not enough space below but enough space above, position on top\n if (\n spaceBelow < dropdownHeight + buffer &&\n spaceAbove > dropdownHeight + buffer\n ) {\n setDropdownPosition(\"top\");\n } else {\n setDropdownPosition(\"bottom\");\n }\n };\n\n // Alternative calculation using actual dropdown element when available\n const calculateDropdownPositionWithElement = () => {\n if (!containerRef.current || !dropdownRef.current) return;\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const dropdownRect = dropdownRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n const spaceBelow = viewportHeight - containerRect.bottom;\n const spaceAbove = containerRect.top;\n const actualDropdownHeight = dropdownRect.height;\n\n console.log(\"Position calculation with element:\", {\n spaceBelow,\n spaceAbove,\n actualDropdownHeight,\n viewportHeight,\n containerBottom: containerRect.bottom,\n });\n\n // If there's not enough space below but enough space above, position on top\n if (\n spaceBelow < actualDropdownHeight &&\n spaceAbove > actualDropdownHeight\n ) {\n setDropdownPosition(\"top\");\n } else {\n setDropdownPosition(\"bottom\");\n }\n };\n\n // Handle click outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n // Calculate position when dropdown opens\n useEffect(() => {\n if (isOpen) {\n // First calculation based on estimated height\n calculateDropdownPosition();\n\n // Second calculation after dropdown is rendered with actual height\n requestAnimationFrame(() => {\n calculateDropdownPositionWithElement();\n });\n }\n }, [isOpen, filteredOptions.length, searchable, maxHeight]);\n\n // Recalculate position on window resize\n useEffect(() => {\n const handleResize = () => {\n if (isOpen) {\n calculateDropdownPosition();\n }\n };\n\n window.addEventListener(\"resize\", handleResize);\n window.addEventListener(\"scroll\", handleResize);\n\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n window.removeEventListener(\"scroll\", handleResize);\n };\n }, [isOpen]);\n\n // Handle keyboard navigation\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (disabled) return;\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n } else {\n setFocusedIndex((prev) =>\n prev < filteredOptions.length - 1 ? prev + 1 : 0\n );\n }\n break;\n case \"ArrowUp\":\n event.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n } else {\n setFocusedIndex((prev) =>\n prev > 0 ? prev - 1 : filteredOptions.length - 1\n );\n }\n break;\n case \"Enter\":\n event.preventDefault();\n if (\n isOpen &&\n focusedIndex >= 0 &&\n focusedIndex < filteredOptions.length\n ) {\n handleSelect(filteredOptions[focusedIndex]);\n } else if (!isOpen) {\n setIsOpen(true);\n }\n break;\n case \"Escape\":\n event.preventDefault();\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n break;\n case \"Tab\":\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n break;\n }\n };\n\n // Handle option selection\n const handleSelect = (option: SelectOption) => {\n if (option.disabled) return;\n\n onChange?.(option.value, option);\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n };\n\n // Handle clear\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation();\n onChange?.(undefined as any, {} as SelectOption);\n };\n\n // Handle toggle\n const handleToggle = () => {\n if (disabled) return;\n setIsOpen(!isOpen);\n if (!isOpen && searchable) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n };\n\n // Scroll focused option into view\n useEffect(() => {\n if (focusedIndex >= 0 && optionRefs.current[focusedIndex]) {\n optionRefs.current[focusedIndex]?.scrollIntoView({\n block: \"nearest\",\n });\n }\n }, [focusedIndex]);\n\n const sizeClasses = {\n sm: \"text-sm px-3 py-1.5\",\n md: \"text-sm px-3 py-2\",\n lg: \"text-base px-4 py-2.5\",\n };\n\n const iconSizeClasses = {\n sm: \"w-4 h-4\",\n md: \"w-4 h-4\",\n lg: \"w-5 h-5\",\n };\n\n return (\n <div className={cn(\"w-full\", containerClassName)} ref={containerRef}>\n {label && (\n <label\n htmlFor={selectId}\n className={cn(\n \"block text-sm font-medium mb-1\",\n hasError ? \"text-ews-error\" : \"text-ews-gray-700\",\n disabled && \"text-ews-gray-400\"\n )}\n >\n {label}\n {required && <span className=\"ml-1 text-ews-error\">*</span>}\n </label>\n )}\n\n <div className=\"relative\">\n {/* Custom select trigger */}\n <div\n ref={ref as React.RefObject<HTMLDivElement>}\n role=\"combobox\"\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-labelledby={label ? selectId : undefined}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n onClick={handleToggle}\n className={cn(\n // Base styles\n \"ews-select-trigger w-full bg-white border rounded-md shadow-sm transition-colors cursor-pointer\",\n \"focus:outline-none focus:ring-2 focus:ring-offset-0\",\n \"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-ews-gray-50\",\n\n // Size\n sizeClasses[size],\n\n // Border and focus states\n hasError\n ? \"border-ews-error focus:border-ews-error focus:ring-ews-error/20\"\n : \"border-ews-gray-300 focus:border-ews-primary focus:ring-ews-primary/20\",\n\n // Hover state\n !disabled && !hasError && \"hover:border-ews-gray-400\",\n\n // Text color\n \"text-ews-gray-900\",\n\n // Padding for icons\n \"pr-10\",\n\n selectClassName\n )}\n {...props}\n >\n <div className=\"flex justify-between items-center\">\n <div className=\"flex-1 min-w-0\">\n {selectedOption ? (\n renderValue ? (\n renderValue(selectedOption)\n ) : (\n <span className=\"truncate\">{selectedOption.label}</span>\n )\n ) : (\n <span className=\"text-ews-gray-500\">{placeholder}</span>\n )}\n </div>\n\n <div className=\"flex items-center ml-2 space-x-1\">\n {clearable && selectedOption && !disabled && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"p-1 rounded hover:bg-ews-gray-100\"\n >\n <X\n className={cn(iconSizeClasses[size], \"text-ews-gray-400\")}\n />\n </button>\n )}\n <ChevronDown\n className={cn(\n iconSizeClasses[size],\n hasError ? \"text-ews-error\" : \"text-ews-gray-400\",\n disabled && \"text-ews-gray-300\",\n isOpen && \"rotate-180 transition-transform\"\n )}\n />\n </div>\n </div>\n </div>\n\n {/* Custom dropdown */}\n {isOpen && (\n <div\n ref={dropdownRef}\n role=\"listbox\"\n className={cn(\n \"absolute z-50 w-full bg-white rounded-md border shadow-lg border-ews-gray-300\",\n \"focus:outline-none\",\n dropdownPosition === \"top\"\n ? \"bottom-full mb-1\"\n : \"top-full mt-1\",\n dropdownClassName\n )}\n style={{ maxHeight: `${maxHeight}px` }}\n >\n {/* Search input */}\n {searchable && (\n <div className=\"p-2 border-b border-ews-gray-200\">\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 w-4 h-4 transform -translate-y-1/2 text-ews-gray-400\" />\n <input\n ref={inputRef}\n type=\"text\"\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder=\"Search options...\"\n className=\"py-2 pr-3 pl-9 w-full text-sm rounded-md border border-ews-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-ews-primary/20 focus:border-ews-primary\"\n />\n </div>\n </div>\n )}\n\n {/* Options list */}\n <div\n className=\"overflow-auto py-1\"\n style={{ maxHeight: `${maxHeight - (searchable ? 60 : 0)}px` }}\n >\n {filteredOptions.length === 0 ? (\n <div className=\"px-3 py-2 text-sm text-ews-gray-500\">\n {searchTerm ? \"No options found\" : \"No options available\"}\n </div>\n ) : (\n filteredOptions.map((option, index) => {\n const isSelected = option.value === value;\n const isFocused = index === focusedIndex;\n\n return (\n <div\n key={`${String(option.value)}-${index}`}\n ref={(el) => (optionRefs.current[index] = el)}\n role=\"option\"\n aria-selected={isSelected}\n onClick={() => handleSelect(option)}\n className={cn(\n \"px-3 py-2 text-sm cursor-pointer transition-colors\",\n isSelected && \"bg-ews-primary text-white\",\n !isSelected && isFocused && \"bg-ews-gray-100\",\n !isSelected && !isFocused && \"hover:bg-ews-gray-50\",\n option.disabled && \"opacity-50 cursor-not-allowed\"\n )}\n >\n {renderOption ? (\n renderOption(option, isSelected)\n ) : (\n <span className=\"truncate\">{option.label}</span>\n )}\n </div>\n );\n })\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* Helper text or error message */}\n {(helperText || error) && (\n <div className=\"mt-1\">\n {error ? (\n <p className=\"text-sm text-ews-error\">{error}</p>\n ) : (\n <p className=\"text-sm text-ews-gray-500\">{helperText}</p>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nSelect.displayName = \"Select\";\n\nexport { Select };\n","import { useEffect, useState } from \"react\";\n\nconst DEFAULT_DELAY = 500;\n\n/**\n * A custom hook that debounces a value\n * @param value - The value to debounce\n * @param delay - The delay in milliseconds (optional, defaults to 300ms)\n * @returns The debounced value\n */\nexport function useDebounce<T>(value: T, delay?: number): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n const actualDelay = delay ?? DEFAULT_DELAY;\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, actualDelay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, actualDelay]);\n\n return debouncedValue;\n}\n\n/**\n * A custom hook that provides a debounced callback function\n * @param callback - The function to debounce\n * @param delay - The delay in milliseconds (optional, defaults to 300ms)\n * @returns A debounced version of the callback\n */\nexport function useDebouncedCallback<T extends (...args: unknown[]) => unknown>(\n callback: T,\n delay?: number\n): T {\n const [debounceTimer, setDebounceTimer] = useState<ReturnType<\n typeof setTimeout\n > | null>(null);\n\n const debouncedCallback = ((...args: Parameters<T>) => {\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n\n const actualDelay = delay ?? DEFAULT_DELAY;\n const newTimer = setTimeout(() => {\n callback(...args);\n }, actualDelay);\n\n setDebounceTimer(newTimer);\n }) as T;\n\n useEffect(() => {\n return () => {\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n };\n }, [debounceTimer]);\n\n return debouncedCallback;\n}\n","import React from 'react';\n\nvar isCheckBoxInput = (element) => element.type === 'checkbox';\n\nvar isDateObject = (value) => value instanceof Date;\n\nvar isNullOrUndefined = (value) => value == null;\n\nconst isObjectType = (value) => typeof value === 'object';\nvar isObject = (value) => !isNullOrUndefined(value) &&\n !Array.isArray(value) &&\n isObjectType(value) &&\n !isDateObject(value);\n\nvar getEventValue = (event) => isObject(event) && event.target\n ? isCheckBoxInput(event.target)\n ? event.target.checked\n : event.target.value\n : event;\n\nvar getNodeParentName = (name) => name.substring(0, name.search(/\\.\\d+(\\.|$)/)) || name;\n\nvar isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));\n\nvar isPlainObject = (tempObject) => {\n const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;\n return (isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf'));\n};\n\nvar isWeb = typeof window !== 'undefined' &&\n typeof window.HTMLElement !== 'undefined' &&\n typeof document !== 'undefined';\n\nfunction cloneObject(data) {\n let copy;\n const isArray = Array.isArray(data);\n const isFileListInstance = typeof FileList !== 'undefined' ? data instanceof FileList : false;\n if (data instanceof Date) {\n copy = new Date(data);\n }\n else if (!(isWeb && (data instanceof Blob || isFileListInstance)) &&\n (isArray || isObject(data))) {\n copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));\n if (!isArray && !isPlainObject(data)) {\n copy = data;\n }\n else {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n copy[key] = cloneObject(data[key]);\n }\n }\n }\n }\n else {\n return data;\n }\n return copy;\n}\n\nvar isKey = (value) => /^\\w*$/.test(value);\n\nvar isUndefined = (val) => val === undefined;\n\nvar compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];\n\nvar stringToPath = (input) => compact(input.replace(/[\"|']|\\]/g, '').split(/\\.|\\[/));\n\nvar get = (object, path, defaultValue) => {\n if (!path || !isObject(object)) {\n return defaultValue;\n }\n const result = (isKey(path) ? [path] : stringToPath(path)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);\n return isUndefined(result) || result === object\n ? isUndefined(object[path])\n ? defaultValue\n : object[path]\n : result;\n};\n\nvar isBoolean = (value) => typeof value === 'boolean';\n\nvar set = (object, path, value) => {\n let index = -1;\n const tempPath = isKey(path) ? [path] : stringToPath(path);\n const length = tempPath.length;\n const lastIndex = length - 1;\n while (++index < length) {\n const key = tempPath[index];\n let newValue = value;\n if (index !== lastIndex) {\n const objValue = object[key];\n newValue =\n isObject(objValue) || Array.isArray(objValue)\n ? objValue\n : !isNaN(+tempPath[index + 1])\n ? []\n : {};\n }\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n object[key] = newValue;\n object = object[key];\n }\n};\n\nconst EVENTS = {\n BLUR: 'blur',\n FOCUS_OUT: 'focusout',\n CHANGE: 'change',\n};\nconst VALIDATION_MODE = {\n onBlur: 'onBlur',\n onChange: 'onChange',\n onSubmit: 'onSubmit',\n onTouched: 'onTouched',\n all: 'all',\n};\nconst INPUT_VALIDATION_RULES = {\n max: 'max',\n min: 'min',\n maxLength: 'maxLength',\n minLength: 'minLength',\n pattern: 'pattern',\n required: 'required',\n validate: 'validate',\n};\n\nconst HookFormContext = React.createContext(null);\nHookFormContext.displayName = 'HookFormContext';\n/**\n * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @returns return all useForm methods\n *\n * @example\n * ```tsx\n * function App() {\n * const methods = useForm();\n * const onSubmit = data => console.log(data);\n *\n * return (\n * <FormProvider {...methods} >\n * <form onSubmit={methods.handleSubmit(onSubmit)}>\n * <NestedInput />\n * <input type=\"submit\" />\n * </form>\n * </FormProvider>\n * );\n * }\n *\n * function NestedInput() {\n * const { register } = useFormContext(); // retrieve all hook methods\n * return <input {...register(\"test\")} />;\n * }\n * ```\n */\nconst useFormContext = () => React.useContext(HookFormContext);\n/**\n * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @param props - all useForm methods\n *\n * @example\n * ```tsx\n * function App() {\n * const methods = useForm();\n * const onSubmit = data => console.log(data);\n *\n * return (\n * <FormProvider {...methods} >\n * <form onSubmit={methods.handleSubmit(onSubmit)}>\n * <NestedInput />\n * <input type=\"submit\" />\n * </form>\n * </FormProvider>\n * );\n * }\n *\n * function NestedInput() {\n * const { register } = useFormContext(); // retrieve all hook methods\n * return <input {...register(\"test\")} />;\n * }\n * ```\n */\nconst FormProvider = (props) => {\n const { children, ...data } = props;\n return (React.createElement(HookFormContext.Provider, { value: data }, children));\n};\n\nvar getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {\n const result = {\n defaultValues: control._defaultValues,\n };\n for (const key in formState) {\n Object.defineProperty(result, key, {\n get: () => {\n const _key = key;\n if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {\n control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;\n }\n localProxyFormState && (localProxyFormState[_key] = true);\n return formState[_key];\n },\n });\n }\n return result;\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\n/**\n * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)\n *\n * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, control } = useForm({\n * defaultValues: {\n * firstName: \"firstName\"\n * }});\n * const { dirtyFields } = useFormState({\n * control\n * });\n * const onSubmit = (data) => console.log(data);\n *\n * return (\n * <form onSubmit={handleSubmit(onSubmit)}>\n * <input {...register(\"firstName\")} placeholder=\"First Name\" />\n * {dirtyFields.firstName && <p>Field is dirty.</p>}\n * <input type=\"submit\" />\n * </form>\n * );\n * }\n * ```\n */\nfunction useFormState(props) {\n const methods = useFormContext();\n const { control = methods.control, disabled, name, exact } = props || {};\n const [formState, updateFormState] = React.useState(control._formState);\n const _localProxyFormState = React.useRef({\n isDirty: false,\n isLoading: false,\n dirtyFields: false,\n touchedFields: false,\n validatingFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n });\n useIsomorphicLayoutEffect(() => control._subscribe({\n name,\n formState: _localProxyFormState.current,\n exact,\n callback: (formState) => {\n !disabled &&\n updateFormState({\n ...control._formState,\n ...formState,\n });\n },\n }), [name, disabled, exact]);\n React.useEffect(() => {\n _localProxyFormState.current.isValid && control._setValid(true);\n }, [control]);\n return React.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);\n}\n\nvar isString = (value) => typeof value === 'string';\n\nvar generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {\n if (isString(names)) {\n isGlobal && _names.watch.add(names);\n return get(formValues, names, defaultValue);\n }\n if (Array.isArray(names)) {\n return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName),\n get(formValues, fieldName)));\n }\n isGlobal && (_names.watchAll = true);\n return formValues;\n};\n\nvar isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);\n\nfunction deepEqual(object1, object2, _internal_visited = new WeakSet()) {\n if (isPrimitive(object1) || isPrimitive(object2)) {\n return object1 === object2;\n }\n if (isDateObject(object1) && isDateObject(object2)) {\n return object1.getTime() === object2.getTime();\n }\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n if (_internal_visited.has(object1) || _internal_visited.has(object2)) {\n return true;\n }\n _internal_visited.add(object1);\n _internal_visited.add(object2);\n for (const key of keys1) {\n const val1 = object1[key];\n if (!keys2.includes(key)) {\n return false;\n }\n if (key !== 'ref') {\n const val2 = object2[key];\n if ((isDateObject(val1) && isDateObject(val2)) ||\n (isObject(val1) && isObject(val2)) ||\n (Array.isArray(val1) && Array.isArray(val2))\n ? !deepEqual(val1, val2, _internal_visited)\n : val1 !== val2) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Custom hook to subscribe to field change and isolate re-rendering at the component level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @example\n * ```tsx\n * const { control } = useForm();\n * const values = useWatch({\n * name: \"fieldName\"\n * control,\n * })\n * ```\n */\nfunction useWatch(props) {\n const methods = useFormContext();\n const { control = methods.control, name, defaultValue, disabled, exact, compute, } = props || {};\n const _defaultValue = React.useRef(defaultValue);\n const _compute = React.useRef(compute);\n const _computeFormValues = React.useRef(undefined);\n _compute.current = compute;\n const defaultValueMemo = React.useMemo(() => control._getWatch(name, _defaultValue.current), [control, name]);\n const [value, updateValue] = React.useState(_compute.current ? _compute.current(defaultValueMemo) : defaultValueMemo);\n useIsomorphicLayoutEffect(() => control._subscribe({\n name,\n formState: {\n values: true,\n },\n exact,\n callback: (formState) => {\n if (!disabled) {\n const formValues = generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current);\n if (_compute.current) {\n const computedFormValues = _compute.current(formValues);\n if (!deepEqual(computedFormValues, _computeFormValues.current)) {\n updateValue(computedFormValues);\n _computeFormValues.current = computedFormValues;\n }\n }\n else {\n updateValue(formValues);\n }\n }\n },\n }), [control, disabled, name, exact]);\n React.useEffect(() => control._removeUnmounted());\n return value;\n}\n\n/**\n * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns field properties, field and form state. {@link UseControllerReturn}\n *\n * @example\n * ```tsx\n * function Input(props) {\n * const { field, fieldState, formState } = useController(props);\n * return (\n * <div>\n * <input {...field} placeholder={props.name} />\n * <p>{fieldState.isTouched && \"Touched\"}</p>\n * <p>{formState.isSubmitted ? \"submitted\" : \"\"}</p>\n * </div>\n * );\n * }\n * ```\n */\nfunction useController(props) {\n const methods = useFormContext();\n const { name, disabled, control = methods.control, shouldUnregister, defaultValue, } = props;\n const isArrayField = isNameInFieldArray(control._names.array, name);\n const defaultValueMemo = React.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);\n const value = useWatch({\n control,\n name,\n defaultValue: defaultValueMemo,\n exact: true,\n });\n const formState = useFormState({\n control,\n name,\n exact: true,\n });\n const _props = React.useRef(props);\n const _registerProps = React.useRef(control.register(name, {\n ...props.rules,\n value,\n ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),\n }));\n _props.current = props;\n const fieldState = React.useMemo(() => Object.defineProperties({}, {\n invalid: {\n enumerable: true,\n get: () => !!get(formState.errors, name),\n },\n isDirty: {\n enumerable: true,\n get: () => !!get(formState.dirtyFields, name),\n },\n isTouched: {\n enumerable: true,\n get: () => !!get(formState.touchedFields, name),\n },\n isValidating: {\n enumerable: true,\n get: () => !!get(formState.validatingFields, name),\n },\n error: {\n enumerable: true,\n get: () => get(formState.errors, name),\n },\n }), [formState, name]);\n const onChange = React.useCallback((event) => _registerProps.current.onChange({\n target: {\n value: getEventValue(event),\n name: name,\n },\n type: EVENTS.CHANGE,\n }), [name]);\n const onBlur = React.useCallback(() => _registerProps.current.onBlur({\n target: {\n value: get(control._formValues, name),\n name: name,\n },\n type: EVENTS.BLUR,\n }), [name, control._formValues]);\n const ref = React.useCallback((elm) => {\n const field = get(control._fields, name);\n if (field && elm) {\n field._f.ref = {\n focus: () => elm.focus && elm.focus(),\n select: () => elm.select && elm.select(),\n setCustomValidity: (message) => elm.setCustomValidity(message),\n reportValidity: () => elm.reportValidity(),\n };\n }\n }, [control._fields, name]);\n const field = React.useMemo(() => ({\n name,\n value,\n ...(isBoolean(disabled) || formState.disabled\n ? { disabled: formState.disabled || disabled }\n : {}),\n onChange,\n onBlur,\n ref,\n }), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);\n React.useEffect(() => {\n const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;\n control.register(name, {\n ..._props.current.rules,\n ...(isBoolean(_props.current.disabled)\n ? { disabled: _props.current.disabled }\n : {}),\n });\n const updateMounted = (name, value) => {\n const field = get(control._fields, name);\n if (field && field._f) {\n field._f.mount = value;\n }\n };\n updateMounted(name, true);\n if (_shouldUnregisterField) {\n const value = cloneObject(get(control._options.defaultValues, name));\n set(control._defaultValues, name, value);\n if (isUndefined(get(control._formValues, name))) {\n set(control._formValues, name, value);\n }\n }\n !isArrayField && control.register(name);\n return () => {\n (isArrayField\n ? _shouldUnregisterField && !control._state.action\n : _shouldUnregisterField)\n ? control.unregister(name)\n : updateMounted(name, false);\n };\n }, [name, control, isArrayField, shouldUnregister]);\n React.useEffect(() => {\n control._setDisabledField({\n disabled,\n name,\n });\n }, [disabled, name, control]);\n return React.useMemo(() => ({\n field,\n formState,\n fieldState,\n }), [field, formState, fieldState]);\n}\n\n/**\n * Component based on `useController` hook to work with controlled component.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns provide field handler functions, field and form state.\n *\n * @example\n * ```tsx\n * function App() {\n * const { control } = useForm<FormValues>({\n * defaultValues: {\n * test: \"\"\n * }\n * });\n *\n * return (\n * <form>\n * <Controller\n * control={control}\n * name=\"test\"\n * render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => (\n * <>\n * <input\n * onChange={onChange} // send value to hook form\n * onBlur={onBlur} // notify when input is touched\n * value={value} // return updated value\n * ref={ref} // set ref for focus management\n * />\n * <p>{formState.isSubmitted ? \"submitted\" : \"\"}</p>\n * <p>{fieldState.isTouched ? \"touched\" : \"\"}</p>\n * </>\n * )}\n * />\n * </form>\n * );\n * }\n * ```\n */\nconst Controller = (props) => props.render(useController(props));\n\nconst flatten = (obj) => {\n const output = {};\n for (const key of Object.keys(obj)) {\n if (isObjectType(obj[key]) && obj[key] !== null) {\n const nested = flatten(obj[key]);\n for (const nestedKey of Object.keys(nested)) {\n output[`${key}.${nestedKey}`] = nested[nestedKey];\n }\n }\n else {\n output[key] = obj[key];\n }\n }\n return output;\n};\n\nconst POST_REQUEST = 'post';\n/**\n * Form component to manage submission.\n *\n * @param props - to setup submission detail. {@link FormProps}\n *\n * @returns form component or headless render prop.\n *\n * @example\n * ```tsx\n * function App() {\n * const { control, formState: { errors } } = useForm();\n *\n * return (\n * <Form action=\"/api\" control={control}>\n * <input {...register(\"name\")} />\n * <p>{errors?.root?.server && 'Server error'}</p>\n * <button>Submit</button>\n * </Form>\n * );\n * }\n * ```\n */\nfunction Form(props) {\n const methods = useFormContext();\n const [mounted, setMounted] = React.useState(false);\n const { control = methods.control, onSubmit, children, action, method = POST_REQUEST, headers, encType, onError, render, onSuccess, validateStatus, ...rest } = props;\n const submit = async (event) => {\n let hasError = false;\n let type = '';\n await control.handleSubmit(async (data) => {\n const formData = new FormData();\n let formDataJson = '';\n try {\n formDataJson = JSON.stringify(data);\n }\n catch (_a) { }\n const flattenFormValues = flatten(control._formValues);\n for (const key in flattenFormValues) {\n formData.append(key, flattenFormValues[key]);\n }\n if (onSubmit) {\n await onSubmit({\n data,\n event,\n method,\n formData,\n formDataJson,\n });\n }\n if (action) {\n try {\n const shouldStringifySubmissionData = [\n headers && headers['Content-Type'],\n encType,\n ].some((value) => value && value.includes('json'));\n const response = await fetch(String(action), {\n method,\n headers: {\n ...headers,\n ...(encType && encType !== 'multipart/form-data'\n ? { 'Content-Type': encType }\n : {}),\n },\n body: shouldStringifySubmissionData ? formDataJson : formData,\n });\n if (response &&\n (validateStatus\n ? !validateStatus(response.status)\n : response.status < 200 || response.status >= 300)) {\n hasError = true;\n onError && onError({ response });\n type = String(response.status);\n }\n else {\n onSuccess && onSuccess({ response });\n }\n }\n catch (error) {\n hasError = true;\n onError && onError({ error });\n }\n }\n })(event);\n if (hasError && props.control) {\n props.control._subjects.state.next({\n isSubmitSuccessful: false,\n });\n props.control.setError('root.server', {\n type,\n });\n }\n };\n React.useEffect(() => {\n setMounted(true);\n }, []);\n return render ? (React.createElement(React.Fragment, null, render({\n submit,\n }))) : (React.createElement(\"form\", { noValidate: mounted, action: action, method: method, encType: encType, onSubmit: submit, ...rest }, children));\n}\n\nvar appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria\n ? {\n ...errors[name],\n types: {\n ...(errors[name] && errors[name].types ? errors[name].types : {}),\n [type]: message || true,\n },\n }\n : {};\n\nvar convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);\n\nvar createSubject = () => {\n let _observers = [];\n const next = (value) => {\n for (const observer of _observers) {\n observer.next && observer.next(value);\n }\n };\n const subscribe = (observer) => {\n _observers.push(observer);\n return {\n unsubscribe: () => {\n _observers = _observers.filter((o) => o !== observer);\n },\n };\n };\n const unsubscribe = () => {\n _observers = [];\n };\n return {\n get observers() {\n return _observers;\n },\n next,\n subscribe,\n unsubscribe,\n };\n};\n\nvar isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;\n\nvar isFileInput = (element) => element.type === 'file';\n\nvar isFunction = (value) => typeof value === 'function';\n\nvar isHTMLElement = (value) => {\n if (!isWeb) {\n return false;\n }\n const owner = value ? value.ownerDocument : 0;\n return (value instanceof\n (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));\n};\n\nvar isMultipleSelect = (element) => element.type === `select-multiple`;\n\nvar isRadioInput = (element) => element.type === 'radio';\n\nvar isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);\n\nvar live = (ref) => isHTMLElement(ref) && ref.isConnected;\n\nfunction baseGet(object, updatePath) {\n const length = updatePath.slice(0, -1).length;\n let index = 0;\n while (index < length) {\n object = isUndefined(object) ? index++ : object[updatePath[index++]];\n }\n return object;\n}\nfunction isEmptyArray(obj) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {\n return false;\n }\n }\n return true;\n}\nfunction unset(object, path) {\n const paths = Array.isArray(path)\n ? path\n : isKey(path)\n ? [path]\n : stringToPath(path);\n const childObject = paths.length === 1 ? object : baseGet(object, paths);\n const index = paths.length - 1;\n const key = paths[index];\n if (childObject) {\n delete childObject[key];\n }\n if (index !== 0 &&\n ((isObject(childObject) && isEmptyObject(childObject)) ||\n (Array.isArray(childObject) && isEmptyArray(childObject)))) {\n unset(object, paths.slice(0, -1));\n }\n return object;\n}\n\nvar objectHasFunction = (data) => {\n for (const key in data) {\n if (isFunction(data[key])) {\n return true;\n }\n }\n return false;\n};\n\nfunction markFieldsDirty(data, fields = {}) {\n const isParentNodeArray = Array.isArray(data);\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))) {\n fields[key] = Array.isArray(data[key]) ? [] : {};\n markFieldsDirty(data[key], fields[key]);\n }\n else if (!isNullOrUndefined(data[key])) {\n fields[key] = true;\n }\n }\n }\n return fields;\n}\nfunction getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues) {\n const isParentNodeArray = Array.isArray(data);\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))) {\n if (isUndefined(formValues) ||\n isPrimitive(dirtyFieldsFromValues[key])) {\n dirtyFieldsFromValues[key] = Array.isArray(data[key])\n ? markFieldsDirty(data[key], [])\n : { ...markFieldsDirty(data[key]) };\n }\n else {\n getDirtyFieldsFromDefaultValues(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);\n }\n }\n else {\n dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]);\n }\n }\n }\n return dirtyFieldsFromValues;\n}\nvar getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues));\n\nconst defaultResult = {\n value: false,\n isValid: false,\n};\nconst validResult = { value: true, isValid: true };\nvar getCheckboxValue = (options) => {\n if (Array.isArray(options)) {\n if (options.length > 1) {\n const values = options\n .filter((option) => option && option.checked && !option.disabled)\n .map((option) => option.value);\n return { value: values, isValid: !!values.length };\n }\n return options[0].checked && !options[0].disabled\n ? // @ts-expect-error expected to work in the browser\n options[0].attributes && !isUndefined(options[0].attributes.value)\n ? isUndefined(options[0].value) || options[0].value === ''\n ? validResult\n : { value: options[0].value, isValid: true }\n : validResult\n : defaultResult;\n }\n return defaultResult;\n};\n\nvar getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value)\n ? value\n : valueAsNumber\n ? value === ''\n ? NaN\n : value\n ? +value\n : value\n : valueAsDate && isString(value)\n ? new Date(value)\n : setValueAs\n ? setValueAs(value)\n : value;\n\nconst defaultReturn = {\n isValid: false,\n value: null,\n};\nvar getRadioValue = (options) => Array.isArray(options)\n ? options.reduce((previous, option) => option && option.checked && !option.disabled\n ? {\n isValid: true,\n value: option.value,\n }\n : previous, defaultReturn)\n : defaultReturn;\n\nfunction getFieldValue(_f) {\n const ref = _f.ref;\n if (isFileInput(ref)) {\n return ref.files;\n }\n if (isRadioInput(ref)) {\n return getRadioValue(_f.refs).value;\n }\n if (isMultipleSelect(ref)) {\n return [...ref.selectedOptions].map(({ value }) => value);\n }\n if (isCheckBoxInput(ref)) {\n return getCheckboxValue(_f.refs).value;\n }\n return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);\n}\n\nvar getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {\n const fields = {};\n for (const name of fieldsNames) {\n const field = get(_fields, name);\n field && set(fields, name, field._f);\n }\n return {\n criteriaMode,\n names: [...fieldsNames],\n fields,\n shouldUseNativeValidation,\n };\n};\n\nvar isRegex = (value) => value instanceof RegExp;\n\nvar getRuleValue = (rule) => isUndefined(rule)\n ? rule\n : isRegex(rule)\n ? rule.source\n : isObject(rule)\n ? isRegex(rule.value)\n ? rule.value.source\n : rule.value\n : rule;\n\nvar getValidationModes = (mode) => ({\n isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,\n isOnBlur: mode === VALIDATION_MODE.onBlur,\n isOnChange: mode === VALIDATION_MODE.onChange,\n isOnAll: mode === VALIDATION_MODE.all,\n isOnTouch: mode === VALIDATION_MODE.onTouched,\n});\n\nconst ASYNC_FUNCTION = 'AsyncFunction';\nvar hasPromiseValidation = (fieldReference) => !!fieldReference &&\n !!fieldReference.validate &&\n !!((isFunction(fieldReference.validate) &&\n fieldReference.validate.constructor.name === ASYNC_FUNCTION) ||\n (isObject(fieldReference.validate) &&\n Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION)));\n\nvar hasValidation = (options) => options.mount &&\n (options.required ||\n options.min ||\n options.max ||\n options.maxLength ||\n options.minLength ||\n options.pattern ||\n options.validate);\n\nvar isWatched = (name, _names, isBlurEvent) => !isBlurEvent &&\n (_names.watchAll ||\n _names.watch.has(name) ||\n [..._names.watch].some((watchName) => name.startsWith(watchName) &&\n /^\\.\\w+/.test(name.slice(watchName.length))));\n\nconst iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {\n for (const key of fieldsNames || Object.keys(fields)) {\n const field = get(fields, key);\n if (field) {\n const { _f, ...currentField } = field;\n if (_f) {\n if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {\n return true;\n }\n else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {\n return true;\n }\n else {\n if (iterateFieldsByAction(currentField, action)) {\n break;\n }\n }\n }\n else if (isObject(currentField)) {\n if (iterateFieldsByAction(currentField, action)) {\n break;\n }\n }\n }\n }\n return;\n};\n\nfunction schemaErrorLookup(errors, _fields, name) {\n const error = get(errors, name);\n if (error || isKey(name)) {\n return {\n error,\n name,\n };\n }\n const names = name.split('.');\n while (names.length) {\n const fieldName = names.join('.');\n const field = get(_fields, fieldName);\n const foundError = get(errors, fieldName);\n if (field && !Array.isArray(field) && name !== fieldName) {\n return { name };\n }\n if (foundError && foundError.type) {\n return {\n name: fieldName,\n error: foundError,\n };\n }\n if (foundError && foundError.root && foundError.root.type) {\n return {\n name: `${fieldName}.root`,\n error: foundError.root,\n };\n }\n names.pop();\n }\n return {\n name,\n };\n}\n\nvar shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {\n updateFormState(formStateData);\n const { name, ...formState } = formStateData;\n return (isEmptyObject(formState) ||\n Object.keys(formState).length >= Object.keys(_proxyFormState).length ||\n Object.keys(formState).find((key) => _proxyFormState[key] ===\n (!isRoot || VALIDATION_MODE.all)));\n};\n\nvar shouldSubscribeByName = (name, signalName, exact) => !name ||\n !signalName ||\n name === signalName ||\n convertToArrayPayload(name).some((currentName) => currentName &&\n (exact\n ? currentName === signalName\n : currentName.startsWith(signalName) ||\n signalName.startsWith(currentName)));\n\nvar skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {\n if (mode.isOnAll) {\n return false;\n }\n else if (!isSubmitted && mode.isOnTouch) {\n return !(isTouched || isBlurEvent);\n }\n else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {\n return !isBlurEvent;\n }\n else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {\n return isBlurEvent;\n }\n return true;\n};\n\nvar unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);\n\nvar updateFieldArrayRootError = (errors, error, name) => {\n const fieldArrayErrors = convertToArrayPayload(get(errors, name));\n set(fieldArrayErrors, 'root', error[name]);\n set(errors, name, fieldArrayErrors);\n return errors;\n};\n\nvar isMessage = (value) => isString(value);\n\nfunction getValidateError(result, ref, type = 'validate') {\n if (isMessage(result) ||\n (Array.isArray(result) && result.every(isMessage)) ||\n (isBoolean(result) && !result)) {\n return {\n type,\n message: isMessage(result) ? result : '',\n ref,\n };\n }\n}\n\nvar getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData)\n ? validationData\n : {\n value: validationData,\n message: '',\n };\n\nvar validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {\n const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount, } = field._f;\n const inputValue = get(formValues, name);\n if (!mount || disabledFieldNames.has(name)) {\n return {};\n }\n const inputRef = refs ? refs[0] : ref;\n const setCustomValidity = (message) => {\n if (shouldUseNativeValidation && inputRef.reportValidity) {\n inputRef.setCustomValidity(isBoolean(message) ? '' : message || '');\n inputRef.reportValidity();\n }\n };\n const error = {};\n const isRadio = isRadioInput(ref);\n const isCheckBox = isCheckBoxInput(ref);\n const isRadioOrCheckbox = isRadio || isCheckBox;\n const isEmpty = ((valueAsNumber || isFileInput(ref)) &&\n isUndefined(ref.value) &&\n isUndefined(inputValue)) ||\n (isHTMLElement(ref) && ref.value === '') ||\n inputValue === '' ||\n (Array.isArray(inputValue) && !inputValue.length);\n const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);\n const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {\n const message = exceedMax ? maxLengthMessage : minLengthMessage;\n error[name] = {\n type: exceedMax ? maxType : minType,\n message,\n ref,\n ...appendErrorsCurry(exceedMax ? maxType : minType, message),\n };\n };\n if (isFieldArray\n ? !Array.isArray(inputValue) || !inputValue.length\n : required &&\n ((!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue))) ||\n (isBoolean(inputValue) && !inputValue) ||\n (isCheckBox && !getCheckboxValue(refs).isValid) ||\n (isRadio && !getRadioValue(refs).isValid))) {\n const { value, message } = isMessage(required)\n ? { value: !!required, message: required }\n : getValueAndMessage(required);\n if (value) {\n error[name] = {\n type: INPUT_VALIDATION_RULES.required,\n message,\n ref: inputRef,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(message);\n return error;\n }\n }\n }\n if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {\n let exceedMax;\n let exceedMin;\n const maxOutput = getValueAndMessage(max);\n const minOutput = getValueAndMessage(min);\n if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {\n const valueNumber = ref.valueAsNumber ||\n (inputValue ? +inputValue : inputValue);\n if (!isNullOrUndefined(maxOutput.value)) {\n exceedMax = valueNumber > maxOutput.value;\n }\n if (!isNullOrUndefined(minOutput.value)) {\n exceedMin = valueNumber < minOutput.value;\n }\n }\n else {\n const valueDate = ref.valueAsDate || new Date(inputValue);\n const convertTimeToDate = (time) => new Date(new Date().toDateString() + ' ' + time);\n const isTime = ref.type == 'time';\n const isWeek = ref.type == 'week';\n if (isString(maxOutput.value) && inputValue) {\n exceedMax = isTime\n ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value)\n : isWeek\n ? inputValue > maxOutput.value\n : valueDate > new Date(maxOutput.value);\n }\n if (isString(minOutput.value) && inputValue) {\n exceedMin = isTime\n ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value)\n : isWeek\n ? inputValue < minOutput.value\n : valueDate < new Date(minOutput.value);\n }\n }\n if (exceedMax || exceedMin) {\n getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name].message);\n return error;\n }\n }\n }\n if ((maxLength || minLength) &&\n !isEmpty &&\n (isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))) {\n const maxLengthOutput = getValueAndMessage(maxLength);\n const minLengthOutput = getValueAndMessage(minLength);\n const exceedMax = !isNullOrUndefined(maxLengthOutput.value) &&\n inputValue.length > +maxLengthOutput.value;\n const exceedMin = !isNullOrUndefined(minLengthOutput.value) &&\n inputValue.length < +minLengthOutput.value;\n if (exceedMax || exceedMin) {\n getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name].message);\n return error;\n }\n }\n }\n if (pattern && !isEmpty && isString(inputValue)) {\n const { value: patternValue, message } = getValueAndMessage(pattern);\n if (isRegex(patternValue) && !inputValue.match(patternValue)) {\n error[name] = {\n type: INPUT_VALIDATION_RULES.pattern,\n message,\n ref,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(message);\n return error;\n }\n }\n }\n if (validate) {\n if (isFunction(validate)) {\n const result = await validate(inputValue, formValues);\n const validateError = getValidateError(result, inputRef);\n if (validateError) {\n error[name] = {\n ...validateError,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(validateError.message);\n return error;\n }\n }\n }\n else if (isObject(validate)) {\n let validationResult = {};\n for (const key in validate) {\n if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {\n break;\n }\n const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);\n if (validateError) {\n validationResult = {\n ...validateError,\n ...appendErrorsCurry(key, validateError.message),\n };\n setCustomValidity(validateError.message);\n if (validateAllFieldCriteria) {\n error[name] = validationResult;\n }\n }\n }\n if (!isEmptyObject(validationResult)) {\n error[name] = {\n ref: inputRef,\n ...validationResult,\n };\n if (!validateAllFieldCriteria) {\n return error;\n }\n }\n }\n }\n setCustomValidity(true);\n return error;\n};\n\nconst defaultOptions = {\n mode: VALIDATION_MODE.onSubmit,\n reValidateMode: VALIDATION_MODE.onChange,\n shouldFocusError: true,\n};\nfunction createFormControl(props = {}) {\n let _options = {\n ...defaultOptions,\n ...props,\n };\n let _formState = {\n submitCount: 0,\n isDirty: false,\n isReady: false,\n isLoading: isFunction(_options.defaultValues),\n isValidating: false,\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n touchedFields: {},\n dirtyFields: {},\n validatingFields: {},\n errors: _options.errors || {},\n disabled: _options.disabled || false,\n };\n let _fields = {};\n let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)\n ? cloneObject(_options.defaultValues || _options.values) || {}\n : {};\n let _formValues = _options.shouldUnregister\n ? {}\n : cloneObject(_defaultValues);\n let _state = {\n action: false,\n mount: false,\n watch: false,\n };\n let _names = {\n mount: new Set(),\n disabled: new Set(),\n unMount: new Set(),\n array: new Set(),\n watch: new Set(),\n };\n let delayErrorCallback;\n let timer = 0;\n const _proxyFormState = {\n isDirty: false,\n dirtyFields: false,\n validatingFields: false,\n touchedFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n };\n let _proxySubscribeFormState = {\n ..._proxyFormState,\n };\n const _subjects = {\n array: createSubject(),\n state: createSubject(),\n };\n const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;\n const debounce = (callback) => (wait) => {\n clearTimeout(timer);\n timer = setTimeout(callback, wait);\n };\n const _setValid = async (shouldUpdateValid) => {\n if (!_options.disabled &&\n (_proxyFormState.isValid ||\n _proxySubscribeFormState.isValid ||\n shouldUpdateValid)) {\n const isValid = _options.resolver\n ? isEmptyObject((await _runSchema()).errors)\n : await executeBuiltInValidation(_fields, true);\n if (isValid !== _formState.isValid) {\n _subjects.state.next({\n isValid,\n });\n }\n }\n };\n const _updateIsValidating = (names, isValidating) => {\n if (!_options.disabled &&\n (_proxyFormState.isValidating ||\n _proxyFormState.validatingFields ||\n _proxySubscribeFormState.isValidating ||\n _proxySubscribeFormState.validatingFields)) {\n (names || Array.from(_names.mount)).forEach((name) => {\n if (name) {\n isValidating\n ? set(_formState.validatingFields, name, isValidating)\n : unset(_formState.validatingFields, name);\n }\n });\n _subjects.state.next({\n validatingFields: _formState.validatingFields,\n isValidating: !isEmptyObject(_formState.validatingFields),\n });\n }\n };\n const _setFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {\n if (args && method && !_options.disabled) {\n _state.action = true;\n if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {\n const fieldValues = method(get(_fields, name), args.argA, args.argB);\n shouldSetValues && set(_fields, name, fieldValues);\n }\n if (shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.errors, name))) {\n const errors = method(get(_formState.errors, name), args.argA, args.argB);\n shouldSetValues && set(_formState.errors, name, errors);\n unsetEmptyArray(_formState.errors, name);\n }\n if ((_proxyFormState.touchedFields ||\n _proxySubscribeFormState.touchedFields) &&\n shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.touchedFields, name))) {\n const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);\n shouldSetValues && set(_formState.touchedFields, name, touchedFields);\n }\n if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {\n _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);\n }\n _subjects.state.next({\n name,\n isDirty: _getDirty(name, values),\n dirtyFields: _formState.dirtyFields,\n errors: _formState.errors,\n isValid: _formState.isValid,\n });\n }\n else {\n set(_formValues, name, values);\n }\n };\n const updateErrors = (name, error) => {\n set(_formState.errors, name, error);\n _subjects.state.next({\n errors: _formState.errors,\n });\n };\n const _setErrors = (errors) => {\n _formState.errors = errors;\n _subjects.state.next({\n errors: _formState.errors,\n isValid: false,\n });\n };\n const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {\n const field = get(_fields, name);\n if (field) {\n const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);\n isUndefined(defaultValue) ||\n (ref && ref.defaultChecked) ||\n shouldSkipSetValueAs\n ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f))\n : setFieldValue(name, defaultValue);\n _state.mount && _setValid();\n }\n };\n const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {\n let shouldUpdateField = false;\n let isPreviousDirty = false;\n const output = {\n name,\n };\n if (!_options.disabled) {\n if (!isBlurEvent || shouldDirty) {\n if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {\n isPreviousDirty = _formState.isDirty;\n _formState.isDirty = output.isDirty = _getDirty();\n shouldUpdateField = isPreviousDirty !== output.isDirty;\n }\n const isCurrentFieldPristine = deepEqual(get(_defaultValues, name), fieldValue);\n isPreviousDirty = !!get(_formState.dirtyFields, name);\n isCurrentFieldPristine\n ? unset(_formState.dirtyFields, name)\n : set(_formState.dirtyFields, name, true);\n output.dirtyFields = _formState.dirtyFields;\n shouldUpdateField =\n shouldUpdateField ||\n ((_proxyFormState.dirtyFields ||\n _proxySubscribeFormState.dirtyFields) &&\n isPreviousDirty !== !isCurrentFieldPristine);\n }\n if (isBlurEvent) {\n const isPreviousFieldTouched = get(_formState.touchedFields, name);\n if (!isPreviousFieldTouched) {\n set(_formState.touchedFields, name, isBlurEvent);\n output.touchedFields = _formState.touchedFields;\n shouldUpdateField =\n shouldUpdateField ||\n ((_proxyFormState.touchedFields ||\n _proxySubscribeFormState.touchedFields) &&\n isPreviousFieldTouched !== isBlurEvent);\n }\n }\n shouldUpdateField && shouldRender && _subjects.state.next(output);\n }\n return shouldUpdateField ? output : {};\n };\n const shouldRenderByError = (name, isValid, error, fieldState) => {\n const previousFieldError = get(_formState.errors, name);\n const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) &&\n isBoolean(isValid) &&\n _formState.isValid !== isValid;\n if (_options.delayError && error) {\n delayErrorCallback = debounce(() => updateErrors(name, error));\n delayErrorCallback(_options.delayError);\n }\n else {\n clearTimeout(timer);\n delayErrorCallback = null;\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) ||\n !isEmptyObject(fieldState) ||\n shouldUpdateValid) {\n const updatedFormState = {\n ...fieldState,\n ...(shouldUpdateValid && isBoolean(isValid) ? { isValid } : {}),\n errors: _formState.errors,\n name,\n };\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n _subjects.state.next(updatedFormState);\n }\n };\n const _runSchema = async (name) => {\n _updateIsValidating(name, true);\n const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));\n _updateIsValidating(name);\n return result;\n };\n const executeSchemaAndUpdateState = async (names) => {\n const { errors } = await _runSchema(names);\n if (names) {\n for (const name of names) {\n const error = get(errors, name);\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n }\n else {\n _formState.errors = errors;\n }\n return errors;\n };\n const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {\n valid: true,\n }) => {\n for (const name in fields) {\n const field = fields[name];\n if (field) {\n const { _f, ...fieldValue } = field;\n if (_f) {\n const isFieldArrayRoot = _names.array.has(_f.name);\n const isPromiseFunction = field._f && hasPromiseValidation(field._f);\n if (isPromiseFunction && _proxyFormState.validatingFields) {\n _updateIsValidating([name], true);\n }\n const fieldError = await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);\n if (isPromiseFunction && _proxyFormState.validatingFields) {\n _updateIsValidating([name]);\n }\n if (fieldError[_f.name]) {\n context.valid = false;\n if (shouldOnlyCheckValid) {\n break;\n }\n }\n !shouldOnlyCheckValid &&\n (get(fieldError, _f.name)\n ? isFieldArrayRoot\n ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name)\n : set(_formState.errors, _f.name, fieldError[_f.name])\n : unset(_formState.errors, _f.name));\n }\n !isEmptyObject(fieldValue) &&\n (await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context));\n }\n }\n return context.valid;\n };\n const _removeUnmounted = () => {\n for (const name of _names.unMount) {\n const field = get(_fields, name);\n field &&\n (field._f.refs\n ? field._f.refs.every((ref) => !live(ref))\n : !live(field._f.ref)) &&\n unregister(name);\n }\n _names.unMount = new Set();\n };\n const _getDirty = (name, data) => !_options.disabled &&\n (name && data && set(_formValues, name, data),\n !deepEqual(getValues(), _defaultValues));\n const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {\n ...(_state.mount\n ? _formValues\n : isUndefined(defaultValue)\n ? _defaultValues\n : isString(names)\n ? { [names]: defaultValue }\n : defaultValue),\n }, isGlobal, defaultValue);\n const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, _options.shouldUnregister ? get(_defaultValues, name, []) : []));\n const setFieldValue = (name, value, options = {}) => {\n const field = get(_fields, name);\n let fieldValue = value;\n if (field) {\n const fieldReference = field._f;\n if (fieldReference) {\n !fieldReference.disabled &&\n set(_formValues, name, getFieldValueAs(value, fieldReference));\n fieldValue =\n isHTMLElement(fieldReference.ref) && isNullOrUndefined(value)\n ? ''\n : value;\n if (isMultipleSelect(fieldReference.ref)) {\n [...fieldReference.ref.options].forEach((optionRef) => (optionRef.selected = fieldValue.includes(optionRef.value)));\n }\n else if (fieldReference.refs) {\n if (isCheckBoxInput(fieldReference.ref)) {\n fieldReference.refs.forEach((checkboxRef) => {\n if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {\n if (Array.isArray(fieldValue)) {\n checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);\n }\n else {\n checkboxRef.checked =\n fieldValue === checkboxRef.value || !!fieldValue;\n }\n }\n });\n }\n else {\n fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));\n }\n }\n else if (isFileInput(fieldReference.ref)) {\n fieldReference.ref.value = '';\n }\n else {\n fieldReference.ref.value = fieldValue;\n if (!fieldReference.ref.type) {\n _subjects.state.next({\n name,\n values: cloneObject(_formValues),\n });\n }\n }\n }\n }\n (options.shouldDirty || options.shouldTouch) &&\n updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);\n options.shouldValidate && trigger(name);\n };\n const setValues = (name, value, options) => {\n for (const fieldKey in value) {\n if (!value.hasOwnProperty(fieldKey)) {\n return;\n }\n const fieldValue = value[fieldKey];\n const fieldName = name + '.' + fieldKey;\n const field = get(_fields, fieldName);\n (_names.array.has(name) ||\n isObject(fieldValue) ||\n (field && !field._f)) &&\n !isDateObject(fieldValue)\n ? setValues(fieldName, fieldValue, options)\n : setFieldValue(fieldName, fieldValue, options);\n }\n };\n const setValue = (name, value, options = {}) => {\n const field = get(_fields, name);\n const isFieldArray = _names.array.has(name);\n const cloneValue = cloneObject(value);\n set(_formValues, name, cloneValue);\n if (isFieldArray) {\n _subjects.array.next({\n name,\n values: cloneObject(_formValues),\n });\n if ((_proxyFormState.isDirty ||\n _proxyFormState.dirtyFields ||\n _proxySubscribeFormState.isDirty ||\n _proxySubscribeFormState.dirtyFields) &&\n options.shouldDirty) {\n _subjects.state.next({\n name,\n dirtyFields: getDirtyFields(_defaultValues, _formValues),\n isDirty: _getDirty(name, cloneValue),\n });\n }\n }\n else {\n field && !field._f && !isNullOrUndefined(cloneValue)\n ? setValues(name, cloneValue, options)\n : setFieldValue(name, cloneValue, options);\n }\n isWatched(name, _names) && _subjects.state.next({ ..._formState, name });\n _subjects.state.next({\n name: _state.mount ? name : undefined,\n values: cloneObject(_formValues),\n });\n };\n const onChange = async (event) => {\n _state.mount = true;\n const target = event.target;\n let name = target.name;\n let isFieldValueUpdated = true;\n const field = get(_fields, name);\n const _updateIsFieldValueUpdated = (fieldValue) => {\n isFieldValueUpdated =\n Number.isNaN(fieldValue) ||\n (isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||\n deepEqual(fieldValue, get(_formValues, name, fieldValue));\n };\n const validationModeBeforeSubmit = getValidationModes(_options.mode);\n const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);\n if (field) {\n let error;\n let isValid;\n const fieldValue = target.type\n ? getFieldValue(field._f)\n : getEventValue(event);\n const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;\n const shouldSkipValidation = (!hasValidation(field._f) &&\n !_options.resolver &&\n !get(_formState.errors, name) &&\n !field._f.deps) ||\n skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);\n const watched = isWatched(name, _names, isBlurEvent);\n set(_formValues, name, fieldValue);\n if (isBlurEvent) {\n if (!target || !target.readOnly) {\n field._f.onBlur && field._f.onBlur(event);\n delayErrorCallback && delayErrorCallback(0);\n }\n }\n else if (field._f.onChange) {\n field._f.onChange(event);\n }\n const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent);\n const shouldRender = !isEmptyObject(fieldState) || watched;\n !isBlurEvent &&\n _subjects.state.next({\n name,\n type: event.type,\n values: cloneObject(_formValues),\n });\n if (shouldSkipValidation) {\n if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {\n if (_options.mode === 'onBlur') {\n if (isBlurEvent) {\n _setValid();\n }\n }\n else if (!isBlurEvent) {\n _setValid();\n }\n }\n return (shouldRender &&\n _subjects.state.next({ name, ...(watched ? {} : fieldState) }));\n }\n !isBlurEvent && watched && _subjects.state.next({ ..._formState });\n if (_options.resolver) {\n const { errors } = await _runSchema([name]);\n _updateIsFieldValueUpdated(fieldValue);\n if (isFieldValueUpdated) {\n const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);\n const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);\n error = errorLookupResult.error;\n name = errorLookupResult.name;\n isValid = isEmptyObject(errors);\n }\n }\n else {\n _updateIsValidating([name], true);\n error = (await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];\n _updateIsValidating([name]);\n _updateIsFieldValueUpdated(fieldValue);\n if (isFieldValueUpdated) {\n if (error) {\n isValid = false;\n }\n else if (_proxyFormState.isValid ||\n _proxySubscribeFormState.isValid) {\n isValid = await executeBuiltInValidation(_fields, true);\n }\n }\n }\n if (isFieldValueUpdated) {\n field._f.deps &&\n trigger(field._f.deps);\n shouldRenderByError(name, isValid, error, fieldState);\n }\n }\n };\n const _focusInput = (ref, key) => {\n if (get(_formState.errors, key) && ref.focus) {\n ref.focus();\n return 1;\n }\n return;\n };\n const trigger = async (name, options = {}) => {\n let isValid;\n let validationResult;\n const fieldNames = convertToArrayPayload(name);\n if (_options.resolver) {\n const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);\n isValid = isEmptyObject(errors);\n validationResult = name\n ? !fieldNames.some((name) => get(errors, name))\n : isValid;\n }\n else if (name) {\n validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {\n const field = get(_fields, fieldName);\n return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);\n }))).every(Boolean);\n !(!validationResult && !_formState.isValid) && _setValid();\n }\n else {\n validationResult = isValid = await executeBuiltInValidation(_fields);\n }\n _subjects.state.next({\n ...(!isString(name) ||\n ((_proxyFormState.isValid || _proxySubscribeFormState.isValid) &&\n isValid !== _formState.isValid)\n ? {}\n : { name }),\n ...(_options.resolver || !name ? { isValid } : {}),\n errors: _formState.errors,\n });\n options.shouldFocus &&\n !validationResult &&\n iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);\n return validationResult;\n };\n const getValues = (fieldNames) => {\n const values = {\n ...(_state.mount ? _formValues : _defaultValues),\n };\n return isUndefined(fieldNames)\n ? values\n : isString(fieldNames)\n ? get(values, fieldNames)\n : fieldNames.map((name) => get(values, name));\n };\n const getFieldState = (name, formState) => ({\n invalid: !!get((formState || _formState).errors, name),\n isDirty: !!get((formState || _formState).dirtyFields, name),\n error: get((formState || _formState).errors, name),\n isValidating: !!get(_formState.validatingFields, name),\n isTouched: !!get((formState || _formState).touchedFields, name),\n });\n const clearErrors = (name) => {\n name &&\n convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName));\n _subjects.state.next({\n errors: name ? _formState.errors : {},\n });\n };\n const setError = (name, error, options) => {\n const ref = (get(_fields, name, { _f: {} })._f || {}).ref;\n const currentError = get(_formState.errors, name) || {};\n // Don't override existing error messages elsewhere in the object tree.\n const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;\n set(_formState.errors, name, {\n ...restOfErrorTree,\n ...error,\n ref,\n });\n _subjects.state.next({\n name,\n errors: _formState.errors,\n isValid: false,\n });\n options && options.shouldFocus && ref && ref.focus && ref.focus();\n };\n const watch = (name, defaultValue) => isFunction(name)\n ? _subjects.state.subscribe({\n next: (payload) => 'values' in payload &&\n name(_getWatch(undefined, defaultValue), payload),\n })\n : _getWatch(name, defaultValue, true);\n const _subscribe = (props) => _subjects.state.subscribe({\n next: (formState) => {\n if (shouldSubscribeByName(props.name, formState.name, props.exact) &&\n shouldRenderFormState(formState, props.formState || _proxyFormState, _setFormState, props.reRenderRoot)) {\n props.callback({\n values: { ..._formValues },\n ..._formState,\n ...formState,\n defaultValues: _defaultValues,\n });\n }\n },\n }).unsubscribe;\n const subscribe = (props) => {\n _state.mount = true;\n _proxySubscribeFormState = {\n ..._proxySubscribeFormState,\n ...props.formState,\n };\n return _subscribe({\n ...props,\n formState: _proxySubscribeFormState,\n });\n };\n const unregister = (name, options = {}) => {\n for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {\n _names.mount.delete(fieldName);\n _names.array.delete(fieldName);\n if (!options.keepValue) {\n unset(_fields, fieldName);\n unset(_formValues, fieldName);\n }\n !options.keepError && unset(_formState.errors, fieldName);\n !options.keepDirty && unset(_formState.dirtyFields, fieldName);\n !options.keepTouched && unset(_formState.touchedFields, fieldName);\n !options.keepIsValidating &&\n unset(_formState.validatingFields, fieldName);\n !_options.shouldUnregister &&\n !options.keepDefaultValue &&\n unset(_defaultValues, fieldName);\n }\n _subjects.state.next({\n values: cloneObject(_formValues),\n });\n _subjects.state.next({\n ..._formState,\n ...(!options.keepDirty ? {} : { isDirty: _getDirty() }),\n });\n !options.keepIsValid && _setValid();\n };\n const _setDisabledField = ({ disabled, name, }) => {\n if ((isBoolean(disabled) && _state.mount) ||\n !!disabled ||\n _names.disabled.has(name)) {\n disabled ? _names.disabled.add(name) : _names.disabled.delete(name);\n }\n };\n const register = (name, options = {}) => {\n let field = get(_fields, name);\n const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);\n set(_fields, name, {\n ...(field || {}),\n _f: {\n ...(field && field._f ? field._f : { ref: { name } }),\n name,\n mount: true,\n ...options,\n },\n });\n _names.mount.add(name);\n if (field) {\n _setDisabledField({\n disabled: isBoolean(options.disabled)\n ? options.disabled\n : _options.disabled,\n name,\n });\n }\n else {\n updateValidAndValue(name, true, options.value);\n }\n return {\n ...(disabledIsDefined\n ? { disabled: options.disabled || _options.disabled }\n : {}),\n ...(_options.progressive\n ? {\n required: !!options.required,\n min: getRuleValue(options.min),\n max: getRuleValue(options.max),\n minLength: getRuleValue(options.minLength),\n maxLength: getRuleValue(options.maxLength),\n pattern: getRuleValue(options.pattern),\n }\n : {}),\n name,\n onChange,\n onBlur: onChange,\n ref: (ref) => {\n if (ref) {\n register(name, options);\n field = get(_fields, name);\n const fieldRef = isUndefined(ref.value)\n ? ref.querySelectorAll\n ? ref.querySelectorAll('input,select,textarea')[0] || ref\n : ref\n : ref;\n const radioOrCheckbox = isRadioOrCheckbox(fieldRef);\n const refs = field._f.refs || [];\n if (radioOrCheckbox\n ? refs.find((option) => option === fieldRef)\n : fieldRef === field._f.ref) {\n return;\n }\n set(_fields, name, {\n _f: {\n ...field._f,\n ...(radioOrCheckbox\n ? {\n refs: [\n ...refs.filter(live),\n fieldRef,\n ...(Array.isArray(get(_defaultValues, name)) ? [{}] : []),\n ],\n ref: { type: fieldRef.type, name },\n }\n : { ref: fieldRef }),\n },\n });\n updateValidAndValue(name, false, undefined, fieldRef);\n }\n else {\n field = get(_fields, name, {});\n if (field._f) {\n field._f.mount = false;\n }\n (_options.shouldUnregister || options.shouldUnregister) &&\n !(isNameInFieldArray(_names.array, name) && _state.action) &&\n _names.unMount.add(name);\n }\n },\n };\n };\n const _focusError = () => _options.shouldFocusError &&\n iterateFieldsByAction(_fields, _focusInput, _names.mount);\n const _disableForm = (disabled) => {\n if (isBoolean(disabled)) {\n _subjects.state.next({ disabled });\n iterateFieldsByAction(_fields, (ref, name) => {\n const currentField = get(_fields, name);\n if (currentField) {\n ref.disabled = currentField._f.disabled || disabled;\n if (Array.isArray(currentField._f.refs)) {\n currentField._f.refs.forEach((inputRef) => {\n inputRef.disabled = currentField._f.disabled || disabled;\n });\n }\n }\n }, 0, false);\n }\n };\n const handleSubmit = (onValid, onInvalid) => async (e) => {\n let onValidError = undefined;\n if (e) {\n e.preventDefault && e.preventDefault();\n e.persist &&\n e.persist();\n }\n let fieldValues = cloneObject(_formValues);\n _subjects.state.next({\n isSubmitting: true,\n });\n if (_options.resolver) {\n const { errors, values } = await _runSchema();\n _formState.errors = errors;\n fieldValues = cloneObject(values);\n }\n else {\n await executeBuiltInValidation(_fields);\n }\n if (_names.disabled.size) {\n for (const name of _names.disabled) {\n unset(fieldValues, name);\n }\n }\n unset(_formState.errors, 'root');\n if (isEmptyObject(_formState.errors)) {\n _subjects.state.next({\n errors: {},\n });\n try {\n await onValid(fieldValues, e);\n }\n catch (error) {\n onValidError = error;\n }\n }\n else {\n if (onInvalid) {\n await onInvalid({ ..._formState.errors }, e);\n }\n _focusError();\n setTimeout(_focusError);\n }\n _subjects.state.next({\n isSubmitted: true,\n isSubmitting: false,\n isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,\n submitCount: _formState.submitCount + 1,\n errors: _formState.errors,\n });\n if (onValidError) {\n throw onValidError;\n }\n };\n const resetField = (name, options = {}) => {\n if (get(_fields, name)) {\n if (isUndefined(options.defaultValue)) {\n setValue(name, cloneObject(get(_defaultValues, name)));\n }\n else {\n setValue(name, options.defaultValue);\n set(_defaultValues, name, cloneObject(options.defaultValue));\n }\n if (!options.keepTouched) {\n unset(_formState.touchedFields, name);\n }\n if (!options.keepDirty) {\n unset(_formState.dirtyFields, name);\n _formState.isDirty = options.defaultValue\n ? _getDirty(name, cloneObject(get(_defaultValues, name)))\n : _getDirty();\n }\n if (!options.keepError) {\n unset(_formState.errors, name);\n _proxyFormState.isValid && _setValid();\n }\n _subjects.state.next({ ..._formState });\n }\n };\n const _reset = (formValues, keepStateOptions = {}) => {\n const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;\n const cloneUpdatedValues = cloneObject(updatedValues);\n const isEmptyResetValues = isEmptyObject(formValues);\n const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;\n if (!keepStateOptions.keepDefaultValues) {\n _defaultValues = updatedValues;\n }\n if (!keepStateOptions.keepValues) {\n if (keepStateOptions.keepDirtyValues) {\n const fieldsToCheck = new Set([\n ..._names.mount,\n ...Object.keys(getDirtyFields(_defaultValues, _formValues)),\n ]);\n for (const fieldName of Array.from(fieldsToCheck)) {\n get(_formState.dirtyFields, fieldName)\n ? set(values, fieldName, get(_formValues, fieldName))\n : setValue(fieldName, get(values, fieldName));\n }\n }\n else {\n if (isWeb && isUndefined(formValues)) {\n for (const name of _names.mount) {\n const field = get(_fields, name);\n if (field && field._f) {\n const fieldReference = Array.isArray(field._f.refs)\n ? field._f.refs[0]\n : field._f.ref;\n if (isHTMLElement(fieldReference)) {\n const form = fieldReference.closest('form');\n if (form) {\n form.reset();\n break;\n }\n }\n }\n }\n }\n if (keepStateOptions.keepFieldsRef) {\n for (const fieldName of _names.mount) {\n setValue(fieldName, get(values, fieldName));\n }\n }\n else {\n _fields = {};\n }\n }\n _formValues = _options.shouldUnregister\n ? keepStateOptions.keepDefaultValues\n ? cloneObject(_defaultValues)\n : {}\n : cloneObject(values);\n _subjects.array.next({\n values: { ...values },\n });\n _subjects.state.next({\n values: { ...values },\n });\n }\n _names = {\n mount: keepStateOptions.keepDirtyValues ? _names.mount : new Set(),\n unMount: new Set(),\n array: new Set(),\n disabled: new Set(),\n watch: new Set(),\n watchAll: false,\n focus: '',\n };\n _state.mount =\n !_proxyFormState.isValid ||\n !!keepStateOptions.keepIsValid ||\n !!keepStateOptions.keepDirtyValues;\n _state.watch = !!_options.shouldUnregister;\n _subjects.state.next({\n submitCount: keepStateOptions.keepSubmitCount\n ? _formState.submitCount\n : 0,\n isDirty: isEmptyResetValues\n ? false\n : keepStateOptions.keepDirty\n ? _formState.isDirty\n : !!(keepStateOptions.keepDefaultValues &&\n !deepEqual(formValues, _defaultValues)),\n isSubmitted: keepStateOptions.keepIsSubmitted\n ? _formState.isSubmitted\n : false,\n dirtyFields: isEmptyResetValues\n ? {}\n : keepStateOptions.keepDirtyValues\n ? keepStateOptions.keepDefaultValues && _formValues\n ? getDirtyFields(_defaultValues, _formValues)\n : _formState.dirtyFields\n : keepStateOptions.keepDefaultValues && formValues\n ? getDirtyFields(_defaultValues, formValues)\n : keepStateOptions.keepDirty\n ? _formState.dirtyFields\n : {},\n touchedFields: keepStateOptions.keepTouched\n ? _formState.touchedFields\n : {},\n errors: keepStateOptions.keepErrors ? _formState.errors : {},\n isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful\n ? _formState.isSubmitSuccessful\n : false,\n isSubmitting: false,\n defaultValues: _defaultValues,\n });\n };\n const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)\n ? formValues(_formValues)\n : formValues, keepStateOptions);\n const setFocus = (name, options = {}) => {\n const field = get(_fields, name);\n const fieldReference = field && field._f;\n if (fieldReference) {\n const fieldRef = fieldReference.refs\n ? fieldReference.refs[0]\n : fieldReference.ref;\n if (fieldRef.focus) {\n fieldRef.focus();\n options.shouldSelect &&\n isFunction(fieldRef.select) &&\n fieldRef.select();\n }\n }\n };\n const _setFormState = (updatedFormState) => {\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n };\n const _resetDefaultValues = () => isFunction(_options.defaultValues) &&\n _options.defaultValues().then((values) => {\n reset(values, _options.resetOptions);\n _subjects.state.next({\n isLoading: false,\n });\n });\n const methods = {\n control: {\n register,\n unregister,\n getFieldState,\n handleSubmit,\n setError,\n _subscribe,\n _runSchema,\n _focusError,\n _getWatch,\n _getDirty,\n _setValid,\n _setFieldArray,\n _setDisabledField,\n _setErrors,\n _getFieldArray,\n _reset,\n _resetDefaultValues,\n _removeUnmounted,\n _disableForm,\n _subjects,\n _proxyFormState,\n get _fields() {\n return _fields;\n },\n get _formValues() {\n return _formValues;\n },\n get _state() {\n return _state;\n },\n set _state(value) {\n _state = value;\n },\n get _defaultValues() {\n return _defaultValues;\n },\n get _names() {\n return _names;\n },\n set _names(value) {\n _names = value;\n },\n get _formState() {\n return _formState;\n },\n get _options() {\n return _options;\n },\n set _options(value) {\n _options = {\n ..._options,\n ...value,\n };\n },\n },\n subscribe,\n trigger,\n register,\n handleSubmit,\n watch,\n setValue,\n getValues,\n reset,\n resetField,\n clearErrors,\n unregister,\n setError,\n setFocus,\n getFieldState,\n };\n return {\n ...methods,\n formControl: methods,\n };\n}\n\nvar generateId = () => {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n const d = typeof performance === 'undefined' ? Date.now() : performance.now() * 1000;\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16 + d) % 16 | 0;\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nvar getFocusFieldName = (name, index, options = {}) => options.shouldFocus || isUndefined(options.shouldFocus)\n ? options.focusName ||\n `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.`\n : '';\n\nvar appendAt = (data, value) => [\n ...data,\n ...convertToArrayPayload(value),\n];\n\nvar fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => undefined) : undefined;\n\nfunction insert(data, index, value) {\n return [\n ...data.slice(0, index),\n ...convertToArrayPayload(value),\n ...data.slice(index),\n ];\n}\n\nvar moveArrayAt = (data, from, to) => {\n if (!Array.isArray(data)) {\n return [];\n }\n if (isUndefined(data[to])) {\n data[to] = undefined;\n }\n data.splice(to, 0, data.splice(from, 1)[0]);\n return data;\n};\n\nvar prependAt = (data, value) => [\n ...convertToArrayPayload(value),\n ...convertToArrayPayload(data),\n];\n\nfunction removeAtIndexes(data, indexes) {\n let i = 0;\n const temp = [...data];\n for (const index of indexes) {\n temp.splice(index - i, 1);\n i++;\n }\n return compact(temp).length ? temp : [];\n}\nvar removeArrayAt = (data, index) => isUndefined(index)\n ? []\n : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b));\n\nvar swapArrayAt = (data, indexA, indexB) => {\n [data[indexA], data[indexB]] = [data[indexB], data[indexA]];\n};\n\nvar updateAt = (fieldValues, index, value) => {\n fieldValues[index] = value;\n return fieldValues;\n};\n\n/**\n * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)\n *\n * @param props - useFieldArray props\n *\n * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, control, handleSubmit, reset, trigger, setError } = useForm({\n * defaultValues: {\n * test: []\n * }\n * });\n * const { fields, append } = useFieldArray({\n * control,\n * name: \"test\"\n * });\n *\n * return (\n * <form onSubmit={handleSubmit(data => console.log(data))}>\n * {fields.map((item, index) => (\n * <input key={item.id} {...register(`test.${index}.firstName`)} />\n * ))}\n * <button type=\"button\" onClick={() => append({ firstName: \"bill\" })}>\n * append\n * </button>\n * <input type=\"submit\" />\n * </form>\n * );\n * }\n * ```\n */\nfunction useFieldArray(props) {\n const methods = useFormContext();\n const { control = methods.control, name, keyName = 'id', shouldUnregister, rules, } = props;\n const [fields, setFields] = React.useState(control._getFieldArray(name));\n const ids = React.useRef(control._getFieldArray(name).map(generateId));\n const _fieldIds = React.useRef(fields);\n const _actioned = React.useRef(false);\n _fieldIds.current = fields;\n control._names.array.add(name);\n React.useMemo(() => rules &&\n control.register(name, rules), [control, rules, name]);\n useIsomorphicLayoutEffect(() => control._subjects.array.subscribe({\n next: ({ values, name: fieldArrayName, }) => {\n if (fieldArrayName === name || !fieldArrayName) {\n const fieldValues = get(values, name);\n if (Array.isArray(fieldValues)) {\n setFields(fieldValues);\n ids.current = fieldValues.map(generateId);\n }\n }\n },\n }).unsubscribe, [control, name]);\n const updateValues = React.useCallback((updatedFieldArrayValues) => {\n _actioned.current = true;\n control._setFieldArray(name, updatedFieldArrayValues);\n }, [control, name]);\n const append = (value, options) => {\n const appendValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = appendAt(control._getFieldArray(name), appendValue);\n control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options);\n ids.current = appendAt(ids.current, appendValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, appendAt, {\n argA: fillEmptyArray(value),\n });\n };\n const prepend = (value, options) => {\n const prependValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = prependAt(control._getFieldArray(name), prependValue);\n control._names.focus = getFocusFieldName(name, 0, options);\n ids.current = prependAt(ids.current, prependValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, prependAt, {\n argA: fillEmptyArray(value),\n });\n };\n const remove = (index) => {\n const updatedFieldArrayValues = removeArrayAt(control._getFieldArray(name), index);\n ids.current = removeArrayAt(ids.current, index);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n !Array.isArray(get(control._fields, name)) &&\n set(control._fields, name, undefined);\n control._setFieldArray(name, updatedFieldArrayValues, removeArrayAt, {\n argA: index,\n });\n };\n const insert$1 = (index, value, options) => {\n const insertValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue);\n control._names.focus = getFocusFieldName(name, index, options);\n ids.current = insert(ids.current, index, insertValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, insert, {\n argA: index,\n argB: fillEmptyArray(value),\n });\n };\n const swap = (indexA, indexB) => {\n const updatedFieldArrayValues = control._getFieldArray(name);\n swapArrayAt(updatedFieldArrayValues, indexA, indexB);\n swapArrayAt(ids.current, indexA, indexB);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, swapArrayAt, {\n argA: indexA,\n argB: indexB,\n }, false);\n };\n const move = (from, to) => {\n const updatedFieldArrayValues = control._getFieldArray(name);\n moveArrayAt(updatedFieldArrayValues, from, to);\n moveArrayAt(ids.current, from, to);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, moveArrayAt, {\n argA: from,\n argB: to,\n }, false);\n };\n const update = (index, value) => {\n const updateValue = cloneObject(value);\n const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue);\n ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]);\n updateValues(updatedFieldArrayValues);\n setFields([...updatedFieldArrayValues]);\n control._setFieldArray(name, updatedFieldArrayValues, updateAt, {\n argA: index,\n argB: updateValue,\n }, true, false);\n };\n const replace = (value) => {\n const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));\n ids.current = updatedFieldArrayValues.map(generateId);\n updateValues([...updatedFieldArrayValues]);\n setFields([...updatedFieldArrayValues]);\n control._setFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);\n };\n React.useEffect(() => {\n control._state.action = false;\n isWatched(name, control._names) &&\n control._subjects.state.next({\n ...control._formState,\n });\n if (_actioned.current &&\n (!getValidationModes(control._options.mode).isOnSubmit ||\n control._formState.isSubmitted) &&\n !getValidationModes(control._options.reValidateMode).isOnSubmit) {\n if (control._options.resolver) {\n control._runSchema([name]).then((result) => {\n const error = get(result.errors, name);\n const existingError = get(control._formState.errors, name);\n if (existingError\n ? (!error && existingError.type) ||\n (error &&\n (existingError.type !== error.type ||\n existingError.message !== error.message))\n : error && error.type) {\n error\n ? set(control._formState.errors, name, error)\n : unset(control._formState.errors, name);\n control._subjects.state.next({\n errors: control._formState.errors,\n });\n }\n });\n }\n else {\n const field = get(control._fields, name);\n if (field &&\n field._f &&\n !(getValidationModes(control._options.reValidateMode).isOnSubmit &&\n getValidationModes(control._options.mode).isOnSubmit)) {\n validateField(field, control._names.disabled, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !isEmptyObject(error) &&\n control._subjects.state.next({\n errors: updateFieldArrayRootError(control._formState.errors, error, name),\n }));\n }\n }\n }\n control._subjects.state.next({\n name,\n values: cloneObject(control._formValues),\n });\n control._names.focus &&\n iterateFieldsByAction(control._fields, (ref, key) => {\n if (control._names.focus &&\n key.startsWith(control._names.focus) &&\n ref.focus) {\n ref.focus();\n return 1;\n }\n return;\n });\n control._names.focus = '';\n control._setValid();\n _actioned.current = false;\n }, [fields, name, control]);\n React.useEffect(() => {\n !get(control._formValues, name) && control._setFieldArray(name);\n return () => {\n const updateMounted = (name, value) => {\n const field = get(control._fields, name);\n if (field && field._f) {\n field._f.mount = value;\n }\n };\n control._options.shouldUnregister || shouldUnregister\n ? control.unregister(name)\n : updateMounted(name, false);\n };\n }, [name, control, keyName, shouldUnregister]);\n return {\n swap: React.useCallback(swap, [updateValues, name, control]),\n move: React.useCallback(move, [updateValues, name, control]),\n prepend: React.useCallback(prepend, [updateValues, name, control]),\n append: React.useCallback(append, [updateValues, name, control]),\n remove: React.useCallback(remove, [updateValues, name, control]),\n insert: React.useCallback(insert$1, [updateValues, name, control]),\n update: React.useCallback(update, [updateValues, name, control]),\n replace: React.useCallback(replace, [updateValues, name, control]),\n fields: React.useMemo(() => fields.map((field, index) => ({\n ...field,\n [keyName]: ids.current[index] || generateId(),\n })), [fields, keyName]),\n };\n}\n\n/**\n * Custom hook to manage the entire form.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)\n *\n * @param props - form configuration and validation parameters.\n *\n * @returns methods - individual functions to manage the form state. {@link UseFormReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, watch, formState: { errors } } = useForm();\n * const onSubmit = data => console.log(data);\n *\n * console.log(watch(\"example\"));\n *\n * return (\n * <form onSubmit={handleSubmit(onSubmit)}>\n * <input defaultValue=\"test\" {...register(\"example\")} />\n * <input {...register(\"exampleRequired\", { required: true })} />\n * {errors.exampleRequired && <span>This field is required</span>}\n * <button>Submit</button>\n * </form>\n * );\n * }\n * ```\n */\nfunction useForm(props = {}) {\n const _formControl = React.useRef(undefined);\n const _values = React.useRef(undefined);\n const [formState, updateFormState] = React.useState({\n isDirty: false,\n isValidating: false,\n isLoading: isFunction(props.defaultValues),\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n submitCount: 0,\n dirtyFields: {},\n touchedFields: {},\n validatingFields: {},\n errors: props.errors || {},\n disabled: props.disabled || false,\n isReady: false,\n defaultValues: isFunction(props.defaultValues)\n ? undefined\n : props.defaultValues,\n });\n if (!_formControl.current) {\n if (props.formControl) {\n _formControl.current = {\n ...props.formControl,\n formState,\n };\n if (props.defaultValues && !isFunction(props.defaultValues)) {\n props.formControl.reset(props.defaultValues, props.resetOptions);\n }\n }\n else {\n const { formControl, ...rest } = createFormControl(props);\n _formControl.current = {\n ...rest,\n formState,\n };\n }\n }\n const control = _formControl.current.control;\n control._options = props;\n useIsomorphicLayoutEffect(() => {\n const sub = control._subscribe({\n formState: control._proxyFormState,\n callback: () => updateFormState({ ...control._formState }),\n reRenderRoot: true,\n });\n updateFormState((data) => ({\n ...data,\n isReady: true,\n }));\n control._formState.isReady = true;\n return sub;\n }, [control]);\n React.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);\n React.useEffect(() => {\n if (props.mode) {\n control._options.mode = props.mode;\n }\n if (props.reValidateMode) {\n control._options.reValidateMode = props.reValidateMode;\n }\n }, [control, props.mode, props.reValidateMode]);\n React.useEffect(() => {\n if (props.errors) {\n control._setErrors(props.errors);\n control._focusError();\n }\n }, [control, props.errors]);\n React.useEffect(() => {\n props.shouldUnregister &&\n control._subjects.state.next({\n values: control._getWatch(),\n });\n }, [control, props.shouldUnregister]);\n React.useEffect(() => {\n if (control._proxyFormState.isDirty) {\n const isDirty = control._getDirty();\n if (isDirty !== formState.isDirty) {\n control._subjects.state.next({\n isDirty,\n });\n }\n }\n }, [control, formState.isDirty]);\n React.useEffect(() => {\n if (props.values && !deepEqual(props.values, _values.current)) {\n control._reset(props.values, {\n keepFieldsRef: true,\n ...control._options.resetOptions,\n });\n _values.current = props.values;\n updateFormState((state) => ({ ...state }));\n }\n else {\n control._resetDefaultValues();\n }\n }, [control, props.values]);\n React.useEffect(() => {\n if (!control._state.mount) {\n control._setValid();\n control._state.mount = true;\n }\n if (control._state.watch) {\n control._state.watch = false;\n control._subjects.state.next({ ...control._formState });\n }\n control._removeUnmounted();\n });\n _formControl.current.formState = getProxyFormState(formState, control);\n return _formControl.current;\n}\n\nexport { Controller, Form, FormProvider, appendErrors, createFormControl, get, set, useController, useFieldArray, useForm, useFormContext, useFormState, useWatch };\n//# sourceMappingURL=index.esm.mjs.map\n","import {\n Control,\n FieldPath,\n FieldValues,\n useController,\n} from \"react-hook-form\";\nimport { SelectOption, SelectProps } from \"../components/Select\";\n\nexport interface UseSelectFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> {\n name: TName;\n control: Control<TFieldValues>;\n options: SelectOption[];\n rules?: any;\n defaultValue?: any;\n}\n\nexport function useSelectField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n control,\n options: _options,\n rules,\n defaultValue,\n}: UseSelectFieldProps<TFieldValues, TName>) {\n const {\n field,\n fieldState: { error, invalid },\n } = useController({\n name,\n control,\n rules,\n defaultValue,\n });\n\n const selectProps: Omit<SelectProps, \"options\"> = {\n value: field.value,\n onChange: (value) => field.onChange(value),\n isError: invalid,\n error: error?.message,\n };\n\n return {\n selectProps,\n field,\n error,\n invalid,\n };\n}\n","import { LucideIcon, Search, X } from \"lucide-react\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useDebounce } from \"../../hooks\";\nimport { Input } from \"../Input/Input\";\n\n// Generic interface for searchable entities\nexport interface SearchableEntity {\n id: string;\n [key: string]: any;\n}\n\ninterface SearchAutocompleteProps<T extends SearchableEntity> {\n onSelect: (id: string) => void;\n selectedId: string;\n searchFunction: (keyword: string) => Promise<T[]>;\n getEntityById?: (id: string) => Promise<T | undefined>;\n getDisplayValue: (entity: T) => string;\n getSecondaryText?: (entity: T) => string | null;\n placeholder: string;\n icon?: LucideIcon;\n disabled?: boolean;\n minSearchLength?: number;\n debounceTime?: number;\n error?: string;\n}\n\nexport function SearchAutocomplete<T extends SearchableEntity>({\n onSelect,\n selectedId,\n searchFunction,\n getEntityById,\n getDisplayValue,\n getSecondaryText,\n placeholder,\n icon = Search,\n disabled = false,\n minSearchLength = 2,\n debounceTime = 300,\n error,\n}: SearchAutocompleteProps<T>) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [entities, setEntities] = useState<T[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [showDropdown, setShowDropdown] = useState(false);\n const [selectedEntity, setSelectedEntity] = useState<T | null>(null);\n const [initialLoadDone, setInitialLoadDone] = useState(false);\n const [searchError, setSearchError] = useState<string | null>(null);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const debouncedSearchTerm = useDebounce(searchTerm, debounceTime);\n\n // Track if this is an initial load or a user-initiated search\n const isUserSearch = useRef(false);\n\n // Only fetch the selected entity by ID once on initial load\n useEffect(() => {\n const fetchSelectedEntity = async () => {\n // Only fetch if we have a selectedId, getEntityById function, and haven't loaded yet\n if (!selectedId || !getEntityById || initialLoadDone) return;\n\n setIsLoading(true);\n try {\n const entity = await getEntityById(selectedId);\n if (entity) {\n setSelectedEntity(entity);\n setSearchTerm(getDisplayValue(entity));\n }\n } catch (error) {\n console.error(\"Error fetching selected entity:\", error);\n } finally {\n setIsLoading(false);\n setInitialLoadDone(true);\n }\n };\n\n fetchSelectedEntity();\n }, [selectedId, getEntityById, getDisplayValue, initialLoadDone]);\n\n // Handle search term changes - only for user-initiated searches\n useEffect(() => {\n // Skip if this is just setting the initial value\n if (!isUserSearch.current) return;\n\n // Clear entities if search term is too short\n if (searchTerm.trim().length < minSearchLength) {\n setEntities([]);\n setSearchError(null);\n }\n }, [searchTerm, minSearchLength]);\n\n // Fetch entities when debounced search term changes - only for user searches\n useEffect(() => {\n const fetchEntities = async () => {\n if (\n !debouncedSearchTerm ||\n debouncedSearchTerm.length < minSearchLength\n ) {\n return;\n }\n\n setIsLoading(true);\n setSearchError(null);\n try {\n const results = await searchFunction(debouncedSearchTerm);\n setEntities(results);\n } catch (error) {\n console.error(\"Error fetching search results:\", error);\n setSearchError(\n error instanceof Error ? error.message : \"Search failed\"\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n // Only fetch if this is a user-initiated search\n if (isUserSearch.current) {\n fetchEntities();\n }\n }, [debouncedSearchTerm, searchFunction, minSearchLength]);\n\n // Handle click outside to close dropdown\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setShowDropdown(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, []);\n\n const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n\n // Mark this as a user-initiated search\n isUserSearch.current = true;\n\n setSearchTerm(value);\n\n if (selectedEntity) {\n setSelectedEntity(null);\n onSelect(\"\");\n }\n\n setShowDropdown(value.trim().length >= minSearchLength);\n };\n\n const handleEntitySelect = (entity: T) => {\n // This is a user selection, not an API fetch\n isUserSearch.current = false;\n\n console.log(`Selected entity with ID: ${entity.id}`);\n\n setSelectedEntity(entity);\n setSearchTerm(getDisplayValue(entity));\n onSelect(entity.id);\n setShowDropdown(false);\n };\n\n const handleClearSelection = () => {\n // This is a user action, but not a search\n isUserSearch.current = false;\n\n setSelectedEntity(null);\n setSearchTerm(\"\");\n onSelect(\"\");\n };\n\n return (\n <div className=\"relative\" ref={dropdownRef}>\n <div className=\"relative\">\n <Input\n type=\"text\"\n placeholder={`${placeholder} (min. ${minSearchLength} characters)`}\n value={selectedEntity ? \"\" : searchTerm}\n onChange={handleSearchChange}\n onFocus={() =>\n searchTerm.length >= minSearchLength &&\n isUserSearch.current &&\n setShowDropdown(true)\n }\n disabled={disabled}\n autoComplete=\"off\"\n name=\"search-autocomplete\"\n leftIcon={React.createElement(icon, { size: 16 })}\n />\n\n {selectedEntity && (\n <button\n type=\"button\"\n className=\"flex absolute inset-y-0 right-0 items-center pr-3\"\n onClick={handleClearSelection}\n disabled={disabled}\n >\n <X className=\"w-5 h-5 text-gray-400 hover:text-gray-500\" />\n </button>\n )}\n </div>\n\n {/* Selected Entity Display */}\n {selectedEntity && (\n <div className=\"p-4 mt-3 rounded-lg border bg-neutral-50 border-neutral-200\">\n <div className=\"flex justify-between items-center\">\n <div className=\"flex items-center\">\n {(selectedEntity as { photoUrl?: string }).photoUrl ? (\n <img\n src={(selectedEntity as { photoUrl?: string }).photoUrl!}\n alt={getDisplayValue(selectedEntity)}\n className=\"object-cover mr-3 w-10 h-10 rounded-full\"\n />\n ) : (\n React.createElement(icon, {\n className: \"w-10 h-10 text-neutral-400 mr-3\",\n })\n )}\n <div>\n <div className=\"font-medium text-neutral-900\">\n {getDisplayValue(selectedEntity)}\n </div>\n {getSecondaryText && getSecondaryText(selectedEntity) && (\n <div className=\"text-sm text-neutral-500\">\n {getSecondaryText(selectedEntity)}\n </div>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={handleClearSelection}\n className=\"transition-colors text-neutral-400 hover:text-neutral-600\"\n disabled={disabled}\n >\n <X className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n )}\n\n {showDropdown && entities?.length > 0 && (\n <div className=\"overflow-auto absolute z-10 mt-1 w-full max-h-60 bg-white rounded-md shadow-lg\">\n <ul className=\"py-1\">\n {entities.map((entity) => (\n <li\n key={entity.id}\n className=\"px-4 py-2 cursor-pointer hover:bg-gray-100\"\n onClick={() => handleEntitySelect(entity)}\n >\n <div className=\"flex items-center\">\n {React.createElement(icon, {\n className: \"w-4 h-4 text-gray-400\",\n })}\n <div className=\"ml-2\">\n <div className=\"font-medium\">{getDisplayValue(entity)}</div>\n {getSecondaryText && getSecondaryText(entity) && (\n <div className=\"text-xs text-gray-500\">\n {getSecondaryText(entity)}\n </div>\n )}\n </div>\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {showDropdown && searchError && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md border border-red-200 shadow-lg\">\n <div className=\"flex justify-center items-center\">\n <X className=\"mr-2 w-4 h-4\" />\n Error: {searchError}\n </div>\n </div>\n )}\n\n {showDropdown && error && !searchError && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md border border-red-200 shadow-lg\">\n <div className=\"flex justify-center items-center\">\n <X className=\"mr-2 w-4 h-4\" />\n {error}\n </div>\n </div>\n )}\n\n {showDropdown &&\n debouncedSearchTerm &&\n entities?.length === 0 &&\n !isLoading &&\n !searchError &&\n !error && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg\">\n {debouncedSearchTerm.length < minSearchLength\n ? `Type at least ${minSearchLength} characters to search`\n : \"No results found. Try a different search term.\"}\n </div>\n )}\n\n {isLoading && showDropdown && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg\">\n <div className=\"flex justify-center items-center\">\n <div className=\"mr-2 w-4 h-4 rounded-full border-b-2 animate-spin border-ews-primary\"></div>\n Loading...\n </div>\n </div>\n )}\n </div>\n );\n}\n","import { Check, Search, X } from \"lucide-react\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useDebounce } from \"../../hooks\";\nimport { cn } from \"../../utils\";\nimport { Input } from \"../Input/Input\";\nimport { SearchableEntity } from \"../SearchAutocomplete/SearchAutocomplete\";\n\ninterface MultiSearchAutocompleteProps<T extends SearchableEntity> {\n items: T[];\n selectedItems: T[];\n onSelectionChange: (items: T[]) => void;\n onSearch: (searchTerm: string) => Promise<void>;\n getEntityById?: (id: string) => Promise<T | undefined>;\n getPrimaryText: (entity: T) => string;\n getSecondaryText?: (entity: T) => string | null;\n placeholder: string;\n disabled?: boolean;\n loading?: boolean;\n multiple?: boolean;\n className?: string;\n renderSelectedItem?: (entity: T) => React.ReactNode;\n renderListItem?: (entity: T, isSelected: boolean) => React.ReactNode;\n keepOpenOnSelect?: boolean;\n error?: string;\n minSearchLength?: number;\n debounceTime?: number;\n}\n\nexport function MultiSearchAutocomplete<T extends SearchableEntity>({\n items,\n selectedItems,\n onSelectionChange,\n onSearch,\n getEntityById: _getEntityById,\n getPrimaryText,\n getSecondaryText,\n placeholder,\n disabled = false,\n loading = false,\n multiple = true,\n className,\n renderSelectedItem,\n renderListItem,\n keepOpenOnSelect = true,\n error,\n minSearchLength = 2,\n debounceTime = 300,\n}: MultiSearchAutocompleteProps<T>) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [isOpen, setIsOpen] = useState(false);\n const [filteredItems, setFilteredItems] = useState<T[]>(items);\n const [isSearching, setIsSearching] = useState(false);\n const [searchError, setSearchError] = useState<string | null>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const debouncedSearchTerm = useDebounce(searchTerm, debounceTime);\n\n // Handle search term changes\n useEffect(() => {\n // If search term is empty, show all items\n if (!searchTerm.trim()) {\n setFilteredItems(items);\n setSearchError(null);\n return;\n }\n\n // If search term is too short, don't search\n if (searchTerm.length < minSearchLength) {\n setFilteredItems([]);\n setSearchError(null);\n return;\n }\n }, [searchTerm, items, minSearchLength]);\n\n // Debounced search with API calls\n useEffect(() => {\n // If debounced search term is empty or too short, don't search\n if (\n !debouncedSearchTerm.trim() ||\n debouncedSearchTerm.length < minSearchLength\n ) {\n return;\n }\n\n const performSearch = async () => {\n try {\n setIsSearching(true);\n setSearchError(null);\n await onSearch(debouncedSearchTerm);\n } catch (err) {\n setSearchError(err instanceof Error ? err.message : \"Search failed\");\n } finally {\n setIsSearching(false);\n }\n };\n\n performSearch();\n }, [debouncedSearchTerm, onSearch, minSearchLength]);\n\n // Update filtered items when items prop changes\n useEffect(() => {\n setFilteredItems(items);\n }, [items]);\n\n const handleItemToggle = useCallback(\n (item: T) => {\n if (multiple) {\n const isSelected = selectedItems.some(\n (selected) => selected.id === item.id\n );\n\n if (isSelected) {\n onSelectionChange(\n selectedItems.filter((selected) => selected.id !== item.id)\n );\n } else {\n onSelectionChange([...selectedItems, item]);\n }\n // Keep dropdown open for multiple selection\n if (keepOpenOnSelect) {\n setIsOpen(true);\n }\n } else {\n onSelectionChange([item]);\n setIsOpen(false);\n }\n },\n [selectedItems, onSelectionChange, multiple, keepOpenOnSelect]\n );\n\n const handleRemoveItem = useCallback(\n (itemToRemove: T) => {\n onSelectionChange(\n selectedItems.filter((item) => item.id !== itemToRemove.id)\n );\n },\n [selectedItems, onSelectionChange]\n );\n\n const handleInputFocus = () => {\n if (!disabled) {\n setIsOpen(true);\n }\n };\n\n const handleInputBlur = () => {\n // Don't close immediately to allow for clicks on dropdown items\n // Only close if keepOpenOnSelect is false\n if (!keepOpenOnSelect) {\n setTimeout(() => setIsOpen(false), 150);\n }\n };\n\n // Close dropdown when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false);\n }\n };\n\n const handleEscapeKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setIsOpen(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscapeKey);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscapeKey);\n };\n }, [isOpen]);\n\n // Default render functions\n const defaultRenderSelectedItem = (entity: T) => (\n <span className=\"inline-flex items-center px-3 py-1 text-sm font-medium rounded-full bg-ews-primary/10 text-ews-primary border border-ews-primary/20\">\n {getPrimaryText(entity)}\n <button\n type=\"button\"\n onClick={() => handleRemoveItem(entity)}\n className=\"ml-2 text-ews-primary/60 hover:text-ews-primary\"\n disabled={disabled}\n title=\"Remove item\"\n >\n <X className=\"w-3 h-3\" />\n </button>\n </span>\n );\n\n const defaultRenderListItem = (entity: T, isSelected: boolean) => (\n <div className=\"flex items-center space-x-3\">\n <div\n className={cn(\n \"w-5 h-5 border-2 rounded flex items-center justify-center\",\n isSelected ? \"bg-ews-primary border-ews-primary\" : \"border-gray-300\"\n )}\n >\n {isSelected && <Check className=\"w-3 h-3 text-white\" />}\n </div>\n <div className=\"flex flex-col\">\n <span\n className={cn(\n \"font-medium\",\n isSelected ? \"text-ews-primary\" : \"text-gray-900\"\n )}\n >\n {getPrimaryText(entity)}\n </span>\n {getSecondaryText && (\n <span\n className={cn(\n \"text-sm\",\n isSelected ? \"text-ews-primary/70\" : \"text-gray-500\"\n )}\n >\n {getSecondaryText(entity)}\n </span>\n )}\n </div>\n </div>\n );\n\n return (\n <div className={cn(\"relative\", className)} ref={dropdownRef}>\n {/* Selected items display */}\n {selectedItems.length > 0 && (\n <div className=\"flex flex-wrap gap-2 mb-3\">\n {selectedItems.map((item) => (\n <div key={item.id}>\n {renderSelectedItem\n ? renderSelectedItem(item)\n : defaultRenderSelectedItem(item)}\n </div>\n ))}\n </div>\n )}\n\n {/* Search input */}\n <Input\n ref={inputRef}\n type=\"text\"\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n placeholder={placeholder}\n disabled={disabled}\n leftIcon={<Search className=\"w-4 h-4\" />}\n className=\"w-full\"\n />\n\n {/* Dropdown */}\n {isOpen && !disabled && (\n <div className=\"absolute z-10 mt-1 w-full max-h-60 bg-white rounded-lg border border-gray-200 shadow-lg overflow-auto\">\n {loading || isSearching ? (\n <div className=\"px-4 py-3 text-sm text-gray-500 flex items-center\">\n <div className=\"animate-spin rounded-full h-4 w-4 border-b-2 border-ews-primary mr-2\"></div>\n {isSearching ? \"Searching...\" : \"Loading...\"}\n </div>\n ) : searchError ? (\n <div className=\"px-4 py-3 text-sm text-red-600\">\n <div className=\"flex items-center\">\n <X className=\"w-4 h-4 mr-2\" />\n Error: {searchError}\n </div>\n </div>\n ) : error ? (\n <div className=\"px-4 py-3 text-sm text-red-600\">\n <div className=\"flex items-center\">\n <X className=\"w-4 h-4 mr-2\" />\n {error}\n </div>\n </div>\n ) : filteredItems.length === 0 ? (\n <div className=\"px-4 py-3 text-sm text-gray-500\">\n {searchTerm.length < minSearchLength\n ? `Type at least ${minSearchLength} characters to search`\n : \"No items found\"}\n </div>\n ) : (\n <div className=\"py-1\">\n {filteredItems.map((item) => {\n const isSelected = selectedItems.some(\n (selected) => selected.id === item.id\n );\n\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={() => handleItemToggle(item)}\n className={cn(\n \"w-full px-4 py-3 text-left flex items-center transition-colors\",\n isSelected\n ? \"bg-ews-primary/10 text-ews-primary border-l-4 border-ews-primary\"\n : \"hover:bg-ews-primary/5 text-gray-900\"\n )}\n >\n {renderListItem\n ? renderListItem(item, isSelected)\n : defaultRenderListItem(item, isSelected)}\n </button>\n );\n })}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import { AlertCircle, AlertTriangle, CheckCircle, X } from \"lucide-react\";\nimport React, { useEffect } from \"react\";\nimport { cn } from \"../../utils\";\nimport { Button } from \"../Button/Button\";\n\nexport interface ErrorField {\n name: string;\n message: string;\n path: string;\n}\n\nexport interface ErrorObject {\n code: string;\n message: string;\n fields: ErrorField[];\n}\n\nexport interface ModalProps {\n /**\n * Whether the modal is open\n */\n isOpen: boolean;\n /**\n * Function to call when modal should be closed\n */\n onClose: () => void;\n /**\n * Modal title\n */\n title: string;\n /**\n * Modal content/description\n */\n children: React.ReactNode;\n /**\n * Modal variant\n */\n variant?: \"error\" | \"warning\" | \"confirmation\" | \"info\";\n /**\n * Primary action button text\n */\n primaryAction?: string;\n /**\n * Secondary action button text\n */\n secondaryAction?: string;\n /**\n * Function to call when primary action is clicked\n */\n onPrimaryAction?: () => void;\n /**\n * Function to call when secondary action is clicked\n */\n onSecondaryAction?: () => void;\n /**\n * Whether the primary action button is loading\n */\n isLoading?: boolean;\n /**\n * Whether the modal can be closed by clicking outside or pressing escape\n */\n closeOnOverlayClick?: boolean;\n /**\n * Custom className for the modal\n */\n className?: string;\n /**\n * Custom className for the content\n */\n contentClassName?: string;\n /**\n * Error object for error modals\n */\n error?: ErrorObject;\n}\n\nconst Modal = ({\n isOpen,\n onClose,\n title,\n children,\n variant = \"info\",\n primaryAction,\n secondaryAction,\n onPrimaryAction,\n onSecondaryAction,\n isLoading = false,\n closeOnOverlayClick = true,\n className,\n contentClassName,\n error,\n}: ModalProps) => {\n // Handle escape key press\n useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isOpen) {\n onClose();\n }\n };\n\n if (isOpen) {\n document.addEventListener(\"keydown\", handleEscape);\n // Prevent body scroll when modal is open\n document.body.style.overflow = \"hidden\";\n }\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.body.style.overflow = \"unset\";\n };\n }, [isOpen, onClose]);\n\n if (!isOpen) return null;\n\n const getVariantStyles = () => {\n switch (variant) {\n case \"error\":\n return {\n icon: <AlertCircle className=\"w-6 h-6 text-ews-error\" />,\n iconBg: \"bg-ews-error/10\",\n titleColor: \"text-ews-error\",\n borderColor: \"border-ews-error/20\",\n };\n case \"warning\":\n return {\n icon: <AlertTriangle className=\"w-6 h-6 text-ews-warning\" />,\n iconBg: \"bg-ews-warning/10\",\n titleColor: \"text-ews-warning\",\n borderColor: \"border-ews-warning/20\",\n };\n case \"confirmation\":\n return {\n icon: <CheckCircle className=\"w-6 h-6 text-ews-success\" />,\n iconBg: \"bg-ews-success/10\",\n titleColor: \"text-ews-success\",\n borderColor: \"border-ews-success/20\",\n };\n default:\n return {\n icon: <AlertCircle className=\"w-6 h-6 text-ews-primary\" />,\n iconBg: \"bg-ews-primary/10\",\n titleColor: \"text-ews-primary\",\n borderColor: \"border-ews-primary/20\",\n };\n }\n };\n\n const variantStyles = getVariantStyles();\n\n const handleOverlayClick = (e: React.MouseEvent) => {\n if (e.target === e.currentTarget && closeOnOverlayClick) {\n onClose();\n }\n };\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n {/* Backdrop */}\n <div\n className=\"absolute inset-0 bg-black/50 backdrop-blur-sm\"\n onClick={handleOverlayClick}\n />\n\n {/* Modal */}\n <div\n className={cn(\n \"relative w-full max-w-md mx-4 bg-white rounded-lg shadow-xl transform transition-all\",\n \"animate-in fade-in-0 zoom-in-95 duration-200\",\n className\n )}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"modal-title\"\n >\n {/* Header */}\n <div\n className={cn(\n \"flex items-center justify-between p-6 border-b\",\n variantStyles.borderColor\n )}\n >\n <div className=\"flex items-center space-x-3\">\n <div className={cn(\"p-2 rounded-full\", variantStyles.iconBg)}>\n {variantStyles.icon}\n </div>\n <h2\n id=\"modal-title\"\n className={cn(\"text-lg font-semibold\", variantStyles.titleColor)}\n >\n {title}\n </h2>\n </div>\n <button\n onClick={onClose}\n className=\"p-1 text-gray-400 hover:text-gray-600 transition-colors\"\n aria-label=\"Close modal\"\n >\n <X className=\"w-5 h-5\" />\n </button>\n </div>\n\n {/* Content */}\n <div className={cn(\"p-6\", contentClassName)}>\n <div className=\"text-gray-700 leading-relaxed\">\n {error && variant === \"error\" ? (\n <div className=\"space-y-3\">\n <p>{error.message}</p>\n {error.fields && error.fields.length > 0 && (\n <div>\n <p className=\"font-semibold text-gray-900\">\n Erreurs de champ:\n </p>\n <ul className=\"mt-2 space-y-1\">\n {error.fields.map((field, index) => (\n <li key={index} className=\"text-ews-error\">\n • {field.path}: {field.message}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n ) : (\n children\n )}\n </div>\n </div>\n\n {/* Actions */}\n {(primaryAction || secondaryAction) && (\n <div className=\"flex items-center justify-end space-x-3 p-6 pt-0\">\n {secondaryAction && (\n <Button\n variant=\"ghost\"\n onClick={onSecondaryAction || onClose}\n disabled={isLoading}\n >\n {secondaryAction}\n </Button>\n )}\n {primaryAction && (\n <Button\n variant={variant === \"error\" ? \"error\" : \"primary\"}\n onClick={onPrimaryAction}\n loading={isLoading}\n >\n {primaryAction}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport { Modal };\n","import { cn } from \"../../utils\";\n\nexport interface LogoProps {\n /**\n * Logo size\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n /**\n * Whether to show the tagline\n */\n showTagline?: boolean;\n /**\n * Whether to show only the icon (favicon version)\n */\n iconOnly?: boolean;\n /**\n * Logo variant - normal, white, or favicon\n */\n variant?: \"normal\" | \"white\" | \"favicon\";\n /**\n * Custom className\n */\n className?: string;\n /**\n * Click handler\n */\n onClick?: () => void;\n}\n\nconst Logo = ({\n size = \"md\",\n showTagline: _showTagline = true,\n iconOnly = false,\n variant = \"normal\",\n className,\n onClick,\n}: LogoProps) => {\n const sizes = {\n sm: \"h-8\",\n md: \"h-12\",\n lg: \"h-16\",\n xl: \"h-24\",\n };\n\n const iconSizes = {\n sm: \"h-6 w-6\",\n md: \"h-8 w-8\",\n lg: \"h-12 w-12\",\n xl: \"h-16 w-16\",\n };\n\n // Get the appropriate logo image based on variant\n // For iconOnly, always use favicon.ico\n const logoSrc = iconOnly\n ? \"/favicon.ico\"\n : variant === \"white\"\n ? \"/image/logoWhite.png\"\n : variant === \"favicon\"\n ? \"/favicon.ico\"\n : \"/image/logo.png\";\n\n if (iconOnly) {\n return (\n <div\n className={cn(\n \"flex items-center justify-center\",\n iconSizes[size],\n className\n )}\n onClick={onClick}\n role={onClick ? \"button\" : undefined}\n tabIndex={onClick ? 0 : undefined}\n >\n <img\n src={logoSrc}\n alt=\"MEDECINE 360 Logo\"\n className=\"w-full h-full object-contain\"\n />\n </div>\n );\n }\n\n return (\n <div\n className={cn(\"flex items-center\", sizes[size], className)}\n onClick={onClick}\n role={onClick ? \"button\" : undefined}\n tabIndex={onClick ? 0 : undefined}\n >\n {/* Logo Image */}\n <img\n src={logoSrc}\n alt=\"MEDECINE 360 Logo\"\n className=\"h-full w-auto object-contain\"\n />\n </div>\n );\n};\n\nexport { Logo };\n","import { ThemeConfig } from \"../types/theme\";\n\nexport const PROMED_THEME: ThemeConfig = {\n name: \"PROMED\",\n colors: {\n primary: \"#21596C\",\n secondary: \"#3BA1A1\",\n primaryHover: \"#1a4756\",\n secondaryHover: \"#308181\",\n primaryLight: \"#c0d0d4\",\n success: \"#059669\",\n successHover: \"#047857\",\n warning: \"#d97706\",\n warningHover: \"#b45309\",\n error: \"#dc2626\",\n errorHover: \"#b91c1c\",\n },\n};\n\nexport const MED_THEME: ThemeConfig = {\n name: \"MED\",\n colors: {\n primary: \"#3BA1A1\", // Teal for patients (calming, trustworthy)\n secondary: \"#6B73FF\", // Soft purple-blue (suggested secondary for MED)\n primaryHover: \"#308181\",\n secondaryHover: \"#5a61e6\",\n primaryLight: \"#a8d5d5\",\n success: \"#059669\",\n successHover: \"#047857\",\n warning: \"#d97706\",\n warningHover: \"#b45309\",\n error: \"#dc2626\",\n errorHover: \"#b91c1c\",\n },\n};\n\nexport const THEMES = {\n PROMED: PROMED_THEME,\n MED: MED_THEME,\n} as const;\n","import React, {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useState,\n} from \"react\";\nimport { Theme, ThemeContextType } from \"../types/theme\";\nimport { THEMES } from \"./themeConfig\";\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n children: ReactNode;\n defaultTheme?: Theme;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n children,\n defaultTheme = \"PROMED\",\n}) => {\n const [theme, setTheme] = useState<Theme>(defaultTheme);\n const [themeConfig, setThemeConfig] = useState(THEMES[defaultTheme]);\n\n // Update theme config when theme changes\n useEffect(() => {\n setThemeConfig(THEMES[theme]);\n\n // Update data-theme attribute for CSS variable switching\n const root = document.documentElement;\n root.setAttribute(\"data-theme\", theme);\n\n // Also update CSS custom properties for backward compatibility\n const colors = THEMES[theme].colors;\n root.style.setProperty(\"--ews-primary\", colors.primary);\n root.style.setProperty(\"--ews-primary-hover\", colors.primaryHover);\n root.style.setProperty(\"--ews-primary-light\", colors.primaryLight);\n root.style.setProperty(\"--ews-secondary\", colors.secondary);\n root.style.setProperty(\"--ews-secondary-hover\", colors.secondaryHover);\n root.style.setProperty(\"--ews-success\", colors.success);\n root.style.setProperty(\"--ews-success-hover\", colors.successHover);\n root.style.setProperty(\"--ews-warning\", colors.warning);\n root.style.setProperty(\"--ews-warning-hover\", colors.warningHover);\n root.style.setProperty(\"--ews-error\", colors.error);\n root.style.setProperty(\"--ews-error-hover\", colors.errorHover);\n }, [theme]);\n\n const handleSetTheme = (newTheme: Theme) => {\n setTheme(newTheme);\n };\n\n const value: ThemeContextType = {\n theme,\n setTheme: handleSetTheme,\n themeConfig,\n };\n\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n return context;\n};\n","import React from \"react\";\nimport { useTheme } from \"../../theme/ThemeProvider\";\nimport { Theme } from \"../../types/theme\";\n\nexport interface ThemeToggleProps {\n className?: string;\n}\n\nexport const ThemeToggle: React.FC<ThemeToggleProps> = ({ className }) => {\n const { theme, setTheme } = useTheme();\n\n const handleThemeChange = (newTheme: Theme) => {\n setTheme(newTheme);\n };\n\n return (\n <div className={`flex items-center space-x-2 ${className || \"\"}`}>\n <span className=\"text-sm font-medium text-gray-700\">Theme:</span>\n <div className=\"flex bg-gray-100 rounded-lg p-1\">\n <button\n onClick={() => handleThemeChange(\"PROMED\")}\n className={`px-3 py-1 text-xs font-medium rounded-md transition-colors ${\n theme === \"PROMED\"\n ? \"bg-ews-primary text-white\"\n : \"text-gray-600 hover:text-gray-900\"\n }`}\n >\n PROMED\n </button>\n <button\n onClick={() => handleThemeChange(\"MED\")}\n className={`px-3 py-1 text-xs font-medium rounded-md transition-colors ${\n theme === \"MED\"\n ? \"bg-ews-primary text-white\"\n : \"text-gray-600 hover:text-gray-900\"\n }`}\n >\n MED\n </button>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport { useTheme } from \"../../theme/ThemeProvider\";\n\nexport interface ThemeDebuggerProps {\n className?: string;\n}\n\nexport const ThemeDebugger: React.FC<ThemeDebuggerProps> = ({\n className = \"\",\n}) => {\n const { theme, themeConfig, setTheme } = useTheme();\n\n const getComputedStyleValue = (property: string) => {\n if (typeof window !== \"undefined\") {\n return getComputedStyle(document.documentElement).getPropertyValue(\n property\n );\n }\n return \"N/A\";\n };\n\n return (\n <div className={`p-4 border rounded-lg bg-gray-50 ${className}`}>\n <h3 className=\"text-lg font-semibold mb-4\">Theme Debugger</h3>\n\n <div className=\"space-y-3\">\n <div>\n <strong>Current Theme:</strong> {theme}\n </div>\n\n <div>\n <strong>Theme Config:</strong>\n <pre className=\"text-xs bg-gray-100 p-2 rounded mt-1\">\n {JSON.stringify(themeConfig, null, 2)}\n </pre>\n </div>\n\n <div>\n <strong>CSS Variables:</strong>\n <div className=\"text-xs space-y-1 mt-1\">\n <div>--ews-primary: {getComputedStyleValue(\"--ews-primary\")}</div>\n <div>\n --ews-secondary: {getComputedStyleValue(\"--ews-secondary\")}\n </div>\n <div>\n --ews-primary-hover:{\" \"}\n {getComputedStyleValue(\"--ews-primary-hover\")}\n </div>\n <div>\n --ews-secondary-hover:{\" \"}\n {getComputedStyleValue(\"--ews-secondary-hover\")}\n </div>\n </div>\n </div>\n\n <div>\n <strong>Data Theme Attribute:</strong>{\" \"}\n {document.documentElement.getAttribute(\"data-theme\")}\n </div>\n\n <div className=\"flex space-x-2\">\n <button\n onClick={() => setTheme(\"PROMED\")}\n className={`px-3 py-1 text-xs rounded ${\n theme === \"PROMED\"\n ? \"bg-ews-primary text-white\"\n : \"bg-gray-200 text-gray-700\"\n }`}\n >\n PROMED\n </button>\n <button\n onClick={() => setTheme(\"MED\")}\n className={`px-3 py-1 text-xs rounded ${\n theme === \"MED\"\n ? \"bg-ews-primary text-white\"\n : \"bg-gray-200 text-gray-700\"\n }`}\n >\n MED\n </button>\n </div>\n\n <div className=\"grid grid-cols-2 gap-2 mt-4\">\n <div className=\"bg-ews-primary text-white p-2 rounded text-center\">\n Primary\n </div>\n <div className=\"bg-ews-secondary text-white p-2 rounded text-center\">\n Secondary\n </div>\n <div className=\"bg-ews-success text-white p-2 rounded text-center\">\n Success\n </div>\n <div className=\"bg-ews-warning text-white p-2 rounded text-center\">\n Warning\n </div>\n </div>\n </div>\n </div>\n );\n};\n","import { Stethoscope } from \"lucide-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { MultiSearchAutocomplete } from \"../../components/MultiSearchAutocomplete\";\nimport { cn } from \"../../utils\";\n\nexport interface Specialty {\n id: string;\n code: string;\n label: string;\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface SpecialtySearchAutocompleteProps {\n selectedSpecialties: Specialty[];\n onSpecialtiesChange: (specialties: Specialty[]) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n maxSelections?: number;\n showSelectedCount?: boolean;\n}\n\nexport const SpecialtySearchAutocomplete: React.FC<\n SpecialtySearchAutocompleteProps\n> = ({\n selectedSpecialties = [],\n onSpecialtiesChange,\n placeholder = \"Search and select medical specialties...\",\n className = \"\",\n disabled = false,\n maxSelections,\n showSelectedCount = true,\n}) => {\n const [specialties, setSpecialties] = useState<Specialty[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n // Mock API call - replace with actual API\n const fetchSpecialties = useCallback(async (searchTerm: string) => {\n setIsLoading(true);\n try {\n // Simulate API delay\n await new Promise((resolve) => setTimeout(resolve, 300));\n\n // Mock data - replace with actual API call\n const mockSpecialties: Specialty[] = [\n { id: \"1\", code: \"CARD\", label: \"Cardiology\" },\n { id: \"2\", code: \"DERM\", label: \"Dermatology\" },\n { id: \"3\", code: \"ENDO\", label: \"Endocrinology\" },\n { id: \"4\", code: \"GAST\", label: \"Gastroenterology\" },\n { id: \"5\", code: \"HEMA\", label: \"Hematology\" },\n { id: \"6\", code: \"NEUR\", label: \"Neurology\" },\n { id: \"7\", code: \"ONCO\", label: \"Oncology\" },\n { id: \"8\", code: \"ORTH\", label: \"Orthopedics\" },\n { id: \"9\", code: \"PED\", label: \"Pediatrics\" },\n { id: \"10\", code: \"PSYC\", label: \"Psychiatry\" },\n { id: \"11\", code: \"RAD\", label: \"Radiology\" },\n { id: \"12\", code: \"SURG\", label: \"Surgery\" },\n { id: \"13\", code: \"UROL\", label: \"Urology\" },\n { id: \"14\", code: \"GYN\", label: \"Gynecology\" },\n { id: \"15\", code: \"OPHT\", label: \"Ophthalmology\" },\n ];\n\n // Filter based on search term\n const filtered = mockSpecialties.filter(\n (specialty) =>\n specialty.label.toLowerCase().includes(searchTerm.toLowerCase()) ||\n specialty.code.toLowerCase().includes(searchTerm.toLowerCase())\n );\n\n setSpecialties(filtered);\n } catch (error) {\n console.error(\"Error fetching specialties:\", error);\n setSpecialties([]);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n // Initial load\n useEffect(() => {\n fetchSpecialties(\"\");\n }, [fetchSpecialties]);\n\n const handleSelectionChange = useCallback(\n (items: Specialty[]) => {\n // Check max selections limit\n if (maxSelections && items.length > maxSelections) {\n return; // Don't update if exceeding max selections\n }\n onSpecialtiesChange(items);\n },\n [onSpecialtiesChange, maxSelections]\n );\n\n const getEntityById = useCallback(\n async (id: string): Promise<Specialty | undefined> => {\n return specialties.find((specialty) => specialty.id === id);\n },\n [specialties]\n );\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {/* Header with title and icon */}\n <div className=\"flex items-center space-x-2\">\n <div className=\"flex justify-center items-center w-8 h-8 rounded-lg bg-secondary-100\">\n <Stethoscope className=\"w-4 h-4 text-secondary-600\" />\n </div>\n <h3 className=\"text-lg font-semibold text-gray-900\">\n Medical Specialties\n </h3>\n </div>\n\n {/* Label */}\n <div>\n <label className=\"block text-sm font-medium text-gray-700 mb-2\">\n Select Specialties\n </label>\n </div>\n\n {/* MultiSearchAutocomplete component */}\n <MultiSearchAutocomplete<Specialty>\n items={specialties}\n selectedItems={selectedSpecialties}\n onSelectionChange={handleSelectionChange}\n onSearch={fetchSpecialties}\n getEntityById={getEntityById}\n getPrimaryText={(specialty) => specialty.label}\n getSecondaryText={(specialty) => specialty.code}\n placeholder={placeholder}\n disabled={disabled}\n loading={isLoading}\n multiple={true}\n keepOpenOnSelect={true}\n className=\"w-full\"\n renderSelectedItem={(specialty) => (\n <span className=\"inline-flex items-center px-3 py-1 text-sm font-medium rounded-full bg-ews-primary/10 text-ews-primary border border-ews-primary/20\">\n {specialty.label}\n </span>\n )}\n renderListItem={(specialty, isSelected) => (\n <div className=\"flex items-center space-x-3\">\n <div\n className={cn(\n \"w-5 h-5 border-2 rounded flex items-center justify-center\",\n isSelected\n ? \"bg-ews-primary border-ews-primary\"\n : \"border-gray-300\"\n )}\n >\n {isSelected && (\n <svg\n className=\"w-3 h-3 text-white\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )}\n </div>\n <div className=\"flex flex-col\">\n <span\n className={cn(\n \"font-medium\",\n isSelected ? \"text-ews-primary\" : \"text-gray-900\"\n )}\n >\n {specialty.label}\n </span>\n <span\n className={cn(\n \"text-sm\",\n isSelected ? \"text-ews-primary/70\" : \"text-gray-500\"\n )}\n >\n {specialty.code}\n </span>\n </div>\n </div>\n )}\n />\n\n {/* Selected count display */}\n {showSelectedCount && selectedSpecialties.length > 0 && (\n <div className=\"flex items-center justify-between text-sm text-gray-600\">\n <span>\n {selectedSpecialties.length} specialty\n {selectedSpecialties.length !== 1 ? \"ies\" : \"\"} selected\n </span>\n {maxSelections && (\n <span className=\"text-gray-400\">\n {selectedSpecialties.length}/{maxSelections}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n"],"names":["_jsxs","_jsx","Icon","__iconNode","AlertCircle","AlertTriangle","CheckCircle"],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
{"version":3,"file":"index.esm.js","sources":["../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../src/utils/index.ts","../src/components/Button/Button.tsx","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-right.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle-alert.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/eye-off.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/eye.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/heart.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/stethoscope.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/triangle-alert.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/user.js","../node_modules/.pnpm/lucide-react@0.544.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js","../src/icons/Icon.tsx","../src/icons/DoctorIcon.tsx","../src/icons/PatientIcon.tsx","../src/icons/UserIcon.tsx","../src/components/Input/Input.tsx","../src/components/Select/Select.tsx","../src/hooks/useDebounce.ts","../../../../../node_modules/.pnpm/react-hook-form@7.62.0_react@18.2.0/node_modules/react-hook-form/dist/index.esm.mjs","../src/hooks/useSelectField.ts","../src/components/SearchAutocomplete/SearchAutocomplete.tsx","../src/components/MultiSearchAutocomplete/MultiSearchAutocomplete.tsx","../src/components/Modal/Modal.tsx","../src/components/Logo/Logo.tsx","../src/theme/themeConfig.ts","../src/theme/ThemeProvider.tsx","../src/components/ThemeToggle/ThemeToggle.tsx","../src/components/ThemeDebugger/ThemeDebugger.tsx","../src/molecules/SpecialtySearchAutocomplete/SpecialtySearchAutocomplete.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { clsx, type ClassValue } from \"clsx\";\n\n/**\n * Default currency for price formatting\n */\nexport const CURRENCY = \"XOF\";\n\n/**\n * Utility function to merge class names\n * @param inputs - Class values to merge\n * @returns Merged class string\n */\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n\n/**\n * Utility function to format currency\n * @param amount - Amount to format\n * @param currency - Currency code (default: CURRENCY constant)\n * @returns Formatted currency string\n */\nexport function formatCurrency(amount: number, currency = CURRENCY): string {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency,\n }).format(amount);\n}\n\n/**\n * Utility function to format date\n * @param date - Date to format\n * @param options - Intl.DateTimeFormat options\n * @returns Formatted date string\n */\nexport function formatDate(\n date: Date | string | number,\n options?: Intl.DateTimeFormatOptions\n): string {\n const dateObj = new Date(date);\n return new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n ...options,\n }).format(dateObj);\n}\n\n/**\n * Utility function to debounce function calls\n * @param func - Function to debounce\n * @param wait - Wait time in milliseconds\n * @returns Debounced function\n */\nexport function debounce<T extends (...args: any[]) => any>(\n func: T,\n wait: number\n): (...args: Parameters<T>) => void {\n let timeout: ReturnType<typeof setTimeout>;\n return (...args: Parameters<T>) => {\n clearTimeout(timeout);\n timeout = setTimeout(() => func(...args), wait);\n };\n}\n\n/**\n * Utility function to generate unique ID\n * @param prefix - Optional prefix for the ID\n * @returns Unique ID string\n */\nexport function generateId(prefix = \"ews\"): string {\n return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;\n}\n","import React from \"react\";\nimport { cn } from \"../../utils\";\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Button variant\n */\n variant?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"error\" | \"ghost\";\n /**\n * Button size\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Whether the button is in a loading state\n */\n loading?: boolean;\n /**\n * Whether the button should take full width\n */\n fullWidth?: boolean;\n /**\n * Icon to display before the button text\n */\n leftIcon?: React.ReactNode;\n /**\n * Icon to display after the button text\n */\n rightIcon?: React.ReactNode;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"md\",\n loading = false,\n fullWidth = false,\n leftIcon,\n rightIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const baseStyles =\n \"inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none\";\n\n const variants = {\n primary:\n \"bg-ews-primary text-white hover:bg-ews-primary-hover focus:ring-ews-primary\",\n secondary:\n \"bg-ews-secondary text-white hover:bg-ews-secondary-hover focus:ring-ews-secondary\",\n success:\n \"bg-ews-success text-white hover:bg-ews-success-hover focus:ring-ews-success\",\n warning:\n \"bg-ews-warning text-white hover:bg-ews-warning-hover focus:ring-ews-warning\",\n error:\n \"bg-ews-error text-white hover:bg-ews-error-hover focus:ring-ews-error\",\n ghost:\n \"bg-transparent text-ews-gray-700 hover:bg-ews-gray-100 focus:ring-ews-gray-500\",\n };\n\n const sizes = {\n sm: \"px-3 py-1.5 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n };\n\n const iconSizes = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n };\n\n return (\n <button\n className={cn(\n baseStyles,\n variants[variant],\n sizes[size],\n fullWidth && \"w-full\",\n className\n )}\n ref={ref}\n disabled={disabled || loading}\n {...props}\n >\n {loading && (\n <svg\n className=\"animate-spin -ml-1 mr-2 h-4 w-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n )}\n {!loading && leftIcon && (\n <span className={cn(\"mr-2 flex items-center\", iconSizes[size])}>\n {leftIcon}\n </span>\n )}\n {children}\n {!loading && rightIcon && (\n <span className={cn(\"ml-2 flex items-center\", iconSizes[size])}>\n {rightIcon}\n </span>\n )}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n\nexport { Button };\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n};\n\nexport { hasA11yProp, mergeClasses, toCamelCase, toKebabCase, toPascalCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses, hasA11yProp } from './shared/src/utils.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses, toKebabCase, toPascalCase } from './shared/src/utils.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"chevron-down\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n];\nconst CircleAlert = createLucideIcon(\"circle-alert\", __iconNode);\n\nexport { __iconNode, CircleAlert as default };\n//# sourceMappingURL=circle-alert.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\",\n key: \"mvr1a0\"\n }\n ]\n];\nconst Heart = createLucideIcon(\"heart\", __iconNode);\n\nexport { __iconNode, Heart as default };\n//# sourceMappingURL=heart.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m21 21-4.34-4.34\", key: \"14j7rj\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }]\n];\nconst Search = createLucideIcon(\"search\", __iconNode);\n\nexport { __iconNode, Search as default };\n//# sourceMappingURL=search.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M11 2v2\", key: \"1539x4\" }],\n [\"path\", { d: \"M5 2v2\", key: \"1yf1q8\" }],\n [\"path\", { d: \"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1\", key: \"rb5t3r\" }],\n [\"path\", { d: \"M8 15a6 6 0 0 0 12 0v-3\", key: \"x18d4x\" }],\n [\"circle\", { cx: \"20\", cy: \"10\", r: \"2\", key: \"ts1r5v\" }]\n];\nconst Stethoscope = createLucideIcon(\"stethoscope\", __iconNode);\n\nexport { __iconNode, Stethoscope as default };\n//# sourceMappingURL=stethoscope.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\", key: \"975kel\" }],\n [\"circle\", { cx: \"12\", cy: \"7\", r: \"4\", key: \"17ys0d\" }]\n];\nconst User = createLucideIcon(\"user\", __iconNode);\n\nexport { __iconNode, User as default };\n//# sourceMappingURL=user.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n","import { LucideProps } from \"lucide-react\";\nimport React from \"react\";\n\nexport interface IconProps extends Omit<LucideProps, \"size\"> {\n /**\n * Icon size\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | number;\n /**\n * The Lucide icon component to render\n */\n icon: React.ComponentType<LucideProps>;\n}\n\n// Simple icon props for individual icon components\nexport interface SimpleIconProps {\n /**\n * Icon size in pixels\n */\n size?: number;\n /**\n * Icon color (can be hex, rgb, or Tailwind class)\n */\n color?: string;\n /**\n * Additional CSS classes (supports Tailwind classes)\n */\n className?: string;\n /**\n * Other props passed to the underlying icon\n */\n [key: string]: any;\n}\n\nconst Icon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ size = \"md\", icon: IconComponent, className, ...props }, ref) => {\n const sizes = {\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n };\n\n const iconSize = typeof size === \"number\" ? size : sizes[size];\n\n return (\n <IconComponent\n ref={ref}\n size={iconSize}\n className={className}\n {...props}\n />\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n\nexport { Icon };\n","import { Stethoscope } from \"lucide-react\";\nimport React from \"react\";\nimport { SimpleIconProps } from \"./Icon\";\n\nexport const DoctorIcon: React.FC<SimpleIconProps> = ({\n size = 24,\n color = \"currentColor\",\n className = \"\",\n ...props\n}) => {\n return (\n <Stethoscope size={size} color={color} className={className} {...props} />\n );\n};\n","import { Heart } from \"lucide-react\";\nimport React from \"react\";\nimport { SimpleIconProps } from \"./Icon\";\n\nexport const PatientIcon: React.FC<SimpleIconProps> = ({\n size = 24,\n color = \"currentColor\",\n className = \"\",\n ...props\n}) => {\n return <Heart size={size} color={color} className={className} {...props} />;\n};\n","import { User } from \"lucide-react\";\nimport React from \"react\";\nimport { SimpleIconProps } from \"./Icon\";\n\nexport const UserIcon: React.FC<SimpleIconProps> = ({\n size = 24,\n color = \"currentColor\",\n className = \"\",\n ...props\n}) => {\n return <User size={size} color={color} className={className} {...props} />;\n};\n","import React, { useState } from \"react\";\nimport { Eye, EyeOff } from \"../../icons\";\nimport { cn } from \"../../utils\";\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n /**\n * Input variant\n */\n variant?: \"default\" | \"error\" | \"success\";\n /**\n * Input size\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Label for the input\n */\n label?: string;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Error message to display\n */\n error?: string;\n /**\n * Icon to display before the input\n */\n leftIcon?: React.ReactNode;\n /**\n * Icon to display after the input\n */\n rightIcon?: React.ReactNode;\n /**\n * Whether the input should take full width\n */\n fullWidth?: boolean;\n /**\n * Whether to show password toggle for password inputs\n */\n showPasswordToggle?: boolean;\n /**\n * Whether the input is required (shows red asterisk)\n */\n required?: boolean;\n}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n variant = \"default\",\n size = \"md\",\n label,\n helperText,\n error,\n leftIcon,\n rightIcon,\n fullWidth = false,\n showPasswordToggle = false,\n required = false,\n id,\n type = \"text\",\n ...props\n },\n ref\n ) => {\n const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;\n const hasError = Boolean(error);\n const actualVariant = hasError ? \"error\" : variant;\n\n // Password visibility state\n const [showPassword, setShowPassword] = useState(false);\n const isPasswordInput = type === \"password\";\n const shouldShowPasswordToggle = showPasswordToggle && isPasswordInput;\n const actualType = isPasswordInput && showPassword ? \"text\" : type;\n\n const baseStyles =\n \"block w-full rounded-md border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-0 hover:border-ews-primary\";\n\n const variants = {\n default:\n \"border-ews-gray-300 focus:border-ews-primary focus:ring-ews-primary\",\n error: \"border-ews-error focus:border-ews-error focus:ring-ews-error\",\n success:\n \"border-ews-success focus:border-ews-success focus:ring-ews-success\",\n };\n\n const sizes = {\n sm: \"px-3 py-1.5 text-sm\",\n md: \"px-3 py-2 text-base\",\n lg: \"px-4 py-3 text-lg\",\n };\n\n const iconSizes = {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n };\n\n return (\n <div className={cn(\"space-y-1\", fullWidth ? \"w-full\" : \"w-auto\")}>\n {label && (\n <label\n htmlFor={inputId}\n className=\"block text-sm font-medium text-ews-gray-700\"\n >\n {label}\n {required && <span className=\"ml-1 text-ews-error\">*</span>}\n </label>\n )}\n <div className=\"relative\">\n {leftIcon && (\n <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\n <span className={cn(\"text-ews-gray-400\", iconSizes[size])}>\n {leftIcon}\n </span>\n </div>\n )}\n <input\n id={inputId}\n type={actualType}\n className={cn(\n baseStyles,\n variants[actualVariant],\n sizes[size],\n leftIcon && \"pl-10\",\n (rightIcon || shouldShowPasswordToggle) && \"pr-10\",\n className\n )}\n ref={ref}\n {...props}\n />\n {rightIcon && !shouldShowPasswordToggle && (\n <div className=\"flex absolute inset-y-0 right-0 items-center pr-3 pointer-events-none\">\n <span className={cn(\"text-ews-gray-400\", iconSizes[size])}>\n {rightIcon}\n </span>\n </div>\n )}\n {shouldShowPasswordToggle && (\n <button\n type=\"button\"\n className=\"flex absolute inset-y-0 right-0 items-center pr-3\"\n onClick={() => setShowPassword(!showPassword)}\n tabIndex={-1}\n >\n <span\n className={cn(\n \"transition-colors text-ews-gray-400 hover:text-ews-gray-600\",\n iconSizes[size]\n )}\n >\n {showPassword ? <EyeOff size={16} /> : <Eye size={16} />}\n </span>\n </button>\n )}\n </div>\n {(error || helperText) && (\n <p\n className={cn(\n \"text-sm\",\n error ? \"text-ews-error\" : \"text-ews-gray-500\"\n )}\n >\n {error || helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { ChevronDown, Search, X } from \"lucide-react\";\nimport React, { forwardRef, useEffect, useId, useRef, useState } from \"react\";\nimport { cn } from \"../../utils\";\nimport { Input } from \"../Input\";\n\nexport interface SelectOption<T = any> {\n value: T;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps<T = any> {\n /**\n * Array of options to display\n */\n options: SelectOption<T>[];\n /**\n * Current selected value\n */\n value?: T;\n /**\n * Callback when selection changes\n */\n onChange?: (value: T, option: SelectOption<T>) => void;\n /**\n * Placeholder text when no option is selected\n */\n placeholder?: string;\n /**\n * Label for the select\n */\n label?: string;\n /**\n * Helper text to display below the select\n */\n helperText?: string;\n /**\n * Error message to display\n */\n error?: string;\n /**\n * Whether the select is in an error state\n */\n isError?: boolean;\n /**\n * Size variant\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Whether the select is disabled\n */\n disabled?: boolean;\n /**\n * Whether the select is required\n */\n required?: boolean;\n /**\n * Whether the select is searchable\n */\n searchable?: boolean;\n /**\n * Whether the select allows multiple selections\n */\n multiple?: boolean;\n /**\n * Custom class name for the select element\n */\n selectClassName?: string;\n /**\n * Custom class name for the container\n */\n containerClassName?: string;\n /**\n * Custom class name for the dropdown\n */\n dropdownClassName?: string;\n /**\n * Maximum height of the dropdown\n */\n maxHeight?: number;\n /**\n * Whether to show clear button\n */\n clearable?: boolean;\n /**\n * Custom render function for options\n */\n renderOption?: (\n option: SelectOption<T>,\n isSelected: boolean\n ) => React.ReactNode;\n /**\n * Custom render function for selected value\n */\n renderValue?: (option: SelectOption<T> | null) => React.ReactNode;\n}\n\nconst Select = forwardRef<HTMLDivElement, SelectProps>(\n (\n {\n options = [],\n value,\n onChange,\n placeholder = \"Select an option...\",\n label,\n helperText,\n error,\n isError = false,\n size = \"md\",\n disabled = false,\n required = false,\n searchable = false,\n multiple: _multiple = false,\n selectClassName,\n containerClassName,\n dropdownClassName,\n maxHeight = 200,\n clearable = false,\n renderOption,\n renderValue,\n ...props\n },\n ref\n ) => {\n const generatedId = useId();\n const selectId = `select-${generatedId}`;\n const hasError = isError || !!error;\n\n const [isOpen, setIsOpen] = useState(false);\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [focusedIndex, setFocusedIndex] = useState(-1);\n const [dropdownPosition, setDropdownPosition] = useState<\"bottom\" | \"top\">(\n \"bottom\"\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n // Find selected option\n const selectedOption = options.find((option) => option.value === value);\n\n // Filter options based on search term\n const filteredOptions = searchable\n ? options.filter((option) =>\n option.label.toLowerCase().includes(searchTerm.toLowerCase())\n )\n : options;\n\n // Calculate dropdown position based on available space\n const calculateDropdownPosition = () => {\n if (!containerRef.current) return;\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n // More accurate height calculation\n const optionHeight = 40; // Approximate height per option\n const searchHeight = searchable ? 60 : 0;\n const padding = 16; // py-1 = 8px top + 8px bottom\n const dropdownHeight = Math.min(\n maxHeight,\n filteredOptions.length * optionHeight + searchHeight + padding\n );\n\n const spaceBelow = viewportHeight - containerRect.bottom;\n const spaceAbove = containerRect.top;\n\n // Add some buffer (20px) to prevent edge cases\n const buffer = 20;\n\n console.log(\"Position calculation:\", {\n spaceBelow,\n spaceAbove,\n dropdownHeight,\n viewportHeight,\n containerBottom: containerRect.bottom,\n shouldOpenTop:\n spaceBelow < dropdownHeight + buffer &&\n spaceAbove > dropdownHeight + buffer,\n });\n\n // If there's not enough space below but enough space above, position on top\n if (\n spaceBelow < dropdownHeight + buffer &&\n spaceAbove > dropdownHeight + buffer\n ) {\n setDropdownPosition(\"top\");\n } else {\n setDropdownPosition(\"bottom\");\n }\n };\n\n // Alternative calculation using actual dropdown element when available\n const calculateDropdownPositionWithElement = () => {\n if (!containerRef.current || !dropdownRef.current) return;\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const dropdownRect = dropdownRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n const spaceBelow = viewportHeight - containerRect.bottom;\n const spaceAbove = containerRect.top;\n const actualDropdownHeight = dropdownRect.height;\n\n console.log(\"Position calculation with element:\", {\n spaceBelow,\n spaceAbove,\n actualDropdownHeight,\n viewportHeight,\n containerBottom: containerRect.bottom,\n });\n\n // If there's not enough space below but enough space above, position on top\n if (\n spaceBelow < actualDropdownHeight &&\n spaceAbove > actualDropdownHeight\n ) {\n setDropdownPosition(\"top\");\n } else {\n setDropdownPosition(\"bottom\");\n }\n };\n\n // Handle click outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n // Calculate position when dropdown opens\n useEffect(() => {\n if (isOpen) {\n // First calculation based on estimated height\n calculateDropdownPosition();\n\n // Second calculation after dropdown is rendered with actual height\n requestAnimationFrame(() => {\n calculateDropdownPositionWithElement();\n });\n }\n }, [isOpen, filteredOptions.length, searchable, maxHeight]);\n\n // Recalculate position on window resize\n useEffect(() => {\n const handleResize = () => {\n if (isOpen) {\n calculateDropdownPosition();\n }\n };\n\n window.addEventListener(\"resize\", handleResize);\n window.addEventListener(\"scroll\", handleResize);\n\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n window.removeEventListener(\"scroll\", handleResize);\n };\n }, [isOpen]);\n\n // Handle keyboard navigation\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (disabled) return;\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n } else {\n setFocusedIndex((prev) =>\n prev < filteredOptions.length - 1 ? prev + 1 : 0\n );\n }\n break;\n case \"ArrowUp\":\n event.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n } else {\n setFocusedIndex((prev) =>\n prev > 0 ? prev - 1 : filteredOptions.length - 1\n );\n }\n break;\n case \"Enter\":\n event.preventDefault();\n if (\n isOpen &&\n focusedIndex >= 0 &&\n focusedIndex < filteredOptions.length\n ) {\n handleSelect(filteredOptions[focusedIndex]);\n } else if (!isOpen) {\n setIsOpen(true);\n }\n break;\n case \"Escape\":\n event.preventDefault();\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n break;\n case \"Tab\":\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n break;\n }\n };\n\n // Handle option selection\n const handleSelect = (option: SelectOption) => {\n if (option.disabled) return;\n\n onChange?.(option.value, option);\n setIsOpen(false);\n setSearchTerm(\"\");\n setFocusedIndex(-1);\n };\n\n // Handle clear\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation();\n onChange?.(undefined as any, {} as SelectOption);\n };\n\n // Handle toggle\n const handleToggle = () => {\n if (disabled) return;\n setIsOpen(!isOpen);\n if (!isOpen && searchable) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n };\n\n // Scroll focused option into view\n useEffect(() => {\n if (focusedIndex >= 0 && optionRefs.current[focusedIndex]) {\n optionRefs.current[focusedIndex]?.scrollIntoView({\n block: \"nearest\",\n });\n }\n }, [focusedIndex]);\n\n const sizeClasses = {\n sm: \"text-sm px-3 py-1.5\",\n md: \"text-sm px-3 py-2\",\n lg: \"text-base px-4 py-2.5\",\n };\n\n const iconSizeClasses = {\n sm: \"w-4 h-4\",\n md: \"w-4 h-4\",\n lg: \"w-5 h-5\",\n };\n\n return (\n <div className={cn(\"w-full\", containerClassName)} ref={containerRef}>\n {label && (\n <label\n htmlFor={selectId}\n className={cn(\n \"block text-sm font-medium mb-1\",\n hasError ? \"text-ews-error\" : \"text-ews-gray-700\",\n disabled && \"text-ews-gray-400\"\n )}\n >\n {label}\n {required && <span className=\"ml-1 text-ews-error\">*</span>}\n </label>\n )}\n\n <div className=\"relative\">\n {/* Custom select trigger */}\n <div\n ref={ref as React.RefObject<HTMLDivElement>}\n role=\"combobox\"\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-labelledby={label ? selectId : undefined}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n onClick={handleToggle}\n className={cn(\n // Base styles\n \"ews-select-trigger w-full bg-white border rounded-md shadow-sm transition-colors cursor-pointer\",\n \"focus:outline-none focus:ring-2 focus:ring-offset-0\",\n \"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-ews-gray-50\",\n\n // Size\n sizeClasses[size],\n\n // Border and focus states\n hasError\n ? \"border-ews-error focus:border-ews-error focus:ring-ews-error/20\"\n : \"border-ews-gray-300 focus:border-ews-primary focus:ring-ews-primary/20\",\n\n // Hover state\n !disabled && !hasError && \"hover:border-ews-gray-400\",\n\n // Text color\n \"text-ews-gray-900\",\n\n // Padding for icons\n \"pr-10\",\n\n selectClassName\n )}\n {...props}\n >\n <div className=\"flex justify-between items-center\">\n <div className=\"flex-1 min-w-0\">\n {selectedOption ? (\n renderValue ? (\n renderValue(selectedOption)\n ) : (\n <span className=\"truncate\">{selectedOption.label}</span>\n )\n ) : (\n <span className=\"text-ews-gray-500\">{placeholder}</span>\n )}\n </div>\n\n <div className=\"flex items-center ml-2 space-x-1\">\n {clearable && selectedOption && !disabled && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"p-1 rounded hover:bg-ews-gray-100\"\n >\n <X\n className={cn(iconSizeClasses[size], \"text-ews-gray-400\")}\n />\n </button>\n )}\n <ChevronDown\n className={cn(\n iconSizeClasses[size],\n hasError ? \"text-ews-error\" : \"text-ews-gray-400\",\n disabled && \"text-ews-gray-300\",\n isOpen && \"rotate-180 transition-transform\"\n )}\n />\n </div>\n </div>\n </div>\n\n {/* Custom dropdown */}\n {isOpen && (\n <div\n ref={dropdownRef}\n role=\"listbox\"\n className={cn(\n \"absolute z-50 w-full bg-white rounded-md border shadow-lg border-ews-gray-300\",\n \"focus:outline-none\",\n dropdownPosition === \"top\"\n ? \"bottom-full mb-1\"\n : \"top-full mt-1\",\n dropdownClassName\n )}\n style={{ maxHeight: `${maxHeight}px` }}\n >\n {/* Search input */}\n {searchable && (\n <div className=\"p-2 border-b border-ews-gray-200\">\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 w-4 h-4 transform -translate-y-1/2 text-ews-gray-400\" />\n <Input\n ref={inputRef}\n type=\"text\"\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder=\"Search options...\"\n leftIcon={\n <Search className=\"w-4 h-4 text-ews-gray-400\" />\n }\n />\n </div>\n </div>\n )}\n\n {/* Options list */}\n <div\n className=\"overflow-auto py-1\"\n style={{ maxHeight: `${maxHeight - (searchable ? 60 : 0)}px` }}\n >\n {filteredOptions.length === 0 ? (\n <div className=\"px-3 py-2 text-sm text-ews-gray-500\">\n {searchTerm ? \"No options found\" : \"No options available\"}\n </div>\n ) : (\n filteredOptions.map((option, index) => {\n const isSelected = option.value === value;\n const isFocused = index === focusedIndex;\n\n return (\n <div\n key={`${String(option.value)}-${index}`}\n ref={(el) => (optionRefs.current[index] = el)}\n role=\"option\"\n aria-selected={isSelected}\n onClick={() => handleSelect(option)}\n className={cn(\n \"px-3 py-2 text-sm cursor-pointer transition-colors\",\n isSelected && \"bg-ews-primary text-white\",\n !isSelected && isFocused && \"bg-ews-gray-100\",\n !isSelected && !isFocused && \"hover:bg-ews-gray-50\",\n option.disabled && \"opacity-50 cursor-not-allowed\"\n )}\n >\n {renderOption ? (\n renderOption(option, isSelected)\n ) : (\n <span className=\"truncate\">{option.label}</span>\n )}\n </div>\n );\n })\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* Helper text or error message */}\n {(helperText || error) && (\n <div className=\"mt-1\">\n {error ? (\n <p className=\"text-sm text-ews-error\">{error}</p>\n ) : (\n <p className=\"text-sm text-ews-gray-500\">{helperText}</p>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nSelect.displayName = \"Select\";\n\nexport { Select };\n","import { useEffect, useState } from \"react\";\n\nconst DEFAULT_DELAY = 500;\n\n/**\n * A custom hook that debounces a value\n * @param value - The value to debounce\n * @param delay - The delay in milliseconds (optional, defaults to 300ms)\n * @returns The debounced value\n */\nexport function useDebounce<T>(value: T, delay?: number): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n const actualDelay = delay ?? DEFAULT_DELAY;\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, actualDelay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, actualDelay]);\n\n return debouncedValue;\n}\n\n/**\n * A custom hook that provides a debounced callback function\n * @param callback - The function to debounce\n * @param delay - The delay in milliseconds (optional, defaults to 300ms)\n * @returns A debounced version of the callback\n */\nexport function useDebouncedCallback<T extends (...args: unknown[]) => unknown>(\n callback: T,\n delay?: number\n): T {\n const [debounceTimer, setDebounceTimer] = useState<ReturnType<\n typeof setTimeout\n > | null>(null);\n\n const debouncedCallback = ((...args: Parameters<T>) => {\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n\n const actualDelay = delay ?? DEFAULT_DELAY;\n const newTimer = setTimeout(() => {\n callback(...args);\n }, actualDelay);\n\n setDebounceTimer(newTimer);\n }) as T;\n\n useEffect(() => {\n return () => {\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n };\n }, [debounceTimer]);\n\n return debouncedCallback;\n}\n","import React from 'react';\n\nvar isCheckBoxInput = (element) => element.type === 'checkbox';\n\nvar isDateObject = (value) => value instanceof Date;\n\nvar isNullOrUndefined = (value) => value == null;\n\nconst isObjectType = (value) => typeof value === 'object';\nvar isObject = (value) => !isNullOrUndefined(value) &&\n !Array.isArray(value) &&\n isObjectType(value) &&\n !isDateObject(value);\n\nvar getEventValue = (event) => isObject(event) && event.target\n ? isCheckBoxInput(event.target)\n ? event.target.checked\n : event.target.value\n : event;\n\nvar getNodeParentName = (name) => name.substring(0, name.search(/\\.\\d+(\\.|$)/)) || name;\n\nvar isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));\n\nvar isPlainObject = (tempObject) => {\n const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;\n return (isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf'));\n};\n\nvar isWeb = typeof window !== 'undefined' &&\n typeof window.HTMLElement !== 'undefined' &&\n typeof document !== 'undefined';\n\nfunction cloneObject(data) {\n let copy;\n const isArray = Array.isArray(data);\n const isFileListInstance = typeof FileList !== 'undefined' ? data instanceof FileList : false;\n if (data instanceof Date) {\n copy = new Date(data);\n }\n else if (!(isWeb && (data instanceof Blob || isFileListInstance)) &&\n (isArray || isObject(data))) {\n copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));\n if (!isArray && !isPlainObject(data)) {\n copy = data;\n }\n else {\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n copy[key] = cloneObject(data[key]);\n }\n }\n }\n }\n else {\n return data;\n }\n return copy;\n}\n\nvar isKey = (value) => /^\\w*$/.test(value);\n\nvar isUndefined = (val) => val === undefined;\n\nvar compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];\n\nvar stringToPath = (input) => compact(input.replace(/[\"|']|\\]/g, '').split(/\\.|\\[/));\n\nvar get = (object, path, defaultValue) => {\n if (!path || !isObject(object)) {\n return defaultValue;\n }\n const result = (isKey(path) ? [path] : stringToPath(path)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);\n return isUndefined(result) || result === object\n ? isUndefined(object[path])\n ? defaultValue\n : object[path]\n : result;\n};\n\nvar isBoolean = (value) => typeof value === 'boolean';\n\nvar set = (object, path, value) => {\n let index = -1;\n const tempPath = isKey(path) ? [path] : stringToPath(path);\n const length = tempPath.length;\n const lastIndex = length - 1;\n while (++index < length) {\n const key = tempPath[index];\n let newValue = value;\n if (index !== lastIndex) {\n const objValue = object[key];\n newValue =\n isObject(objValue) || Array.isArray(objValue)\n ? objValue\n : !isNaN(+tempPath[index + 1])\n ? []\n : {};\n }\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n object[key] = newValue;\n object = object[key];\n }\n};\n\nconst EVENTS = {\n BLUR: 'blur',\n FOCUS_OUT: 'focusout',\n CHANGE: 'change',\n};\nconst VALIDATION_MODE = {\n onBlur: 'onBlur',\n onChange: 'onChange',\n onSubmit: 'onSubmit',\n onTouched: 'onTouched',\n all: 'all',\n};\nconst INPUT_VALIDATION_RULES = {\n max: 'max',\n min: 'min',\n maxLength: 'maxLength',\n minLength: 'minLength',\n pattern: 'pattern',\n required: 'required',\n validate: 'validate',\n};\n\nconst HookFormContext = React.createContext(null);\nHookFormContext.displayName = 'HookFormContext';\n/**\n * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @returns return all useForm methods\n *\n * @example\n * ```tsx\n * function App() {\n * const methods = useForm();\n * const onSubmit = data => console.log(data);\n *\n * return (\n * <FormProvider {...methods} >\n * <form onSubmit={methods.handleSubmit(onSubmit)}>\n * <NestedInput />\n * <input type=\"submit\" />\n * </form>\n * </FormProvider>\n * );\n * }\n *\n * function NestedInput() {\n * const { register } = useFormContext(); // retrieve all hook methods\n * return <input {...register(\"test\")} />;\n * }\n * ```\n */\nconst useFormContext = () => React.useContext(HookFormContext);\n/**\n * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)\n *\n * @param props - all useForm methods\n *\n * @example\n * ```tsx\n * function App() {\n * const methods = useForm();\n * const onSubmit = data => console.log(data);\n *\n * return (\n * <FormProvider {...methods} >\n * <form onSubmit={methods.handleSubmit(onSubmit)}>\n * <NestedInput />\n * <input type=\"submit\" />\n * </form>\n * </FormProvider>\n * );\n * }\n *\n * function NestedInput() {\n * const { register } = useFormContext(); // retrieve all hook methods\n * return <input {...register(\"test\")} />;\n * }\n * ```\n */\nconst FormProvider = (props) => {\n const { children, ...data } = props;\n return (React.createElement(HookFormContext.Provider, { value: data }, children));\n};\n\nvar getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {\n const result = {\n defaultValues: control._defaultValues,\n };\n for (const key in formState) {\n Object.defineProperty(result, key, {\n get: () => {\n const _key = key;\n if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {\n control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;\n }\n localProxyFormState && (localProxyFormState[_key] = true);\n return formState[_key];\n },\n });\n }\n return result;\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\n/**\n * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)\n *\n * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, control } = useForm({\n * defaultValues: {\n * firstName: \"firstName\"\n * }});\n * const { dirtyFields } = useFormState({\n * control\n * });\n * const onSubmit = (data) => console.log(data);\n *\n * return (\n * <form onSubmit={handleSubmit(onSubmit)}>\n * <input {...register(\"firstName\")} placeholder=\"First Name\" />\n * {dirtyFields.firstName && <p>Field is dirty.</p>}\n * <input type=\"submit\" />\n * </form>\n * );\n * }\n * ```\n */\nfunction useFormState(props) {\n const methods = useFormContext();\n const { control = methods.control, disabled, name, exact } = props || {};\n const [formState, updateFormState] = React.useState(control._formState);\n const _localProxyFormState = React.useRef({\n isDirty: false,\n isLoading: false,\n dirtyFields: false,\n touchedFields: false,\n validatingFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n });\n useIsomorphicLayoutEffect(() => control._subscribe({\n name,\n formState: _localProxyFormState.current,\n exact,\n callback: (formState) => {\n !disabled &&\n updateFormState({\n ...control._formState,\n ...formState,\n });\n },\n }), [name, disabled, exact]);\n React.useEffect(() => {\n _localProxyFormState.current.isValid && control._setValid(true);\n }, [control]);\n return React.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);\n}\n\nvar isString = (value) => typeof value === 'string';\n\nvar generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {\n if (isString(names)) {\n isGlobal && _names.watch.add(names);\n return get(formValues, names, defaultValue);\n }\n if (Array.isArray(names)) {\n return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName),\n get(formValues, fieldName)));\n }\n isGlobal && (_names.watchAll = true);\n return formValues;\n};\n\nvar isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);\n\nfunction deepEqual(object1, object2, _internal_visited = new WeakSet()) {\n if (isPrimitive(object1) || isPrimitive(object2)) {\n return object1 === object2;\n }\n if (isDateObject(object1) && isDateObject(object2)) {\n return object1.getTime() === object2.getTime();\n }\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n if (_internal_visited.has(object1) || _internal_visited.has(object2)) {\n return true;\n }\n _internal_visited.add(object1);\n _internal_visited.add(object2);\n for (const key of keys1) {\n const val1 = object1[key];\n if (!keys2.includes(key)) {\n return false;\n }\n if (key !== 'ref') {\n const val2 = object2[key];\n if ((isDateObject(val1) && isDateObject(val2)) ||\n (isObject(val1) && isObject(val2)) ||\n (Array.isArray(val1) && Array.isArray(val2))\n ? !deepEqual(val1, val2, _internal_visited)\n : val1 !== val2) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Custom hook to subscribe to field change and isolate re-rendering at the component level.\n *\n * @remarks\n *\n * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)\n *\n * @example\n * ```tsx\n * const { control } = useForm();\n * const values = useWatch({\n * name: \"fieldName\"\n * control,\n * })\n * ```\n */\nfunction useWatch(props) {\n const methods = useFormContext();\n const { control = methods.control, name, defaultValue, disabled, exact, compute, } = props || {};\n const _defaultValue = React.useRef(defaultValue);\n const _compute = React.useRef(compute);\n const _computeFormValues = React.useRef(undefined);\n _compute.current = compute;\n const defaultValueMemo = React.useMemo(() => control._getWatch(name, _defaultValue.current), [control, name]);\n const [value, updateValue] = React.useState(_compute.current ? _compute.current(defaultValueMemo) : defaultValueMemo);\n useIsomorphicLayoutEffect(() => control._subscribe({\n name,\n formState: {\n values: true,\n },\n exact,\n callback: (formState) => {\n if (!disabled) {\n const formValues = generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current);\n if (_compute.current) {\n const computedFormValues = _compute.current(formValues);\n if (!deepEqual(computedFormValues, _computeFormValues.current)) {\n updateValue(computedFormValues);\n _computeFormValues.current = computedFormValues;\n }\n }\n else {\n updateValue(formValues);\n }\n }\n },\n }), [control, disabled, name, exact]);\n React.useEffect(() => control._removeUnmounted());\n return value;\n}\n\n/**\n * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns field properties, field and form state. {@link UseControllerReturn}\n *\n * @example\n * ```tsx\n * function Input(props) {\n * const { field, fieldState, formState } = useController(props);\n * return (\n * <div>\n * <input {...field} placeholder={props.name} />\n * <p>{fieldState.isTouched && \"Touched\"}</p>\n * <p>{formState.isSubmitted ? \"submitted\" : \"\"}</p>\n * </div>\n * );\n * }\n * ```\n */\nfunction useController(props) {\n const methods = useFormContext();\n const { name, disabled, control = methods.control, shouldUnregister, defaultValue, } = props;\n const isArrayField = isNameInFieldArray(control._names.array, name);\n const defaultValueMemo = React.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);\n const value = useWatch({\n control,\n name,\n defaultValue: defaultValueMemo,\n exact: true,\n });\n const formState = useFormState({\n control,\n name,\n exact: true,\n });\n const _props = React.useRef(props);\n const _registerProps = React.useRef(control.register(name, {\n ...props.rules,\n value,\n ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),\n }));\n _props.current = props;\n const fieldState = React.useMemo(() => Object.defineProperties({}, {\n invalid: {\n enumerable: true,\n get: () => !!get(formState.errors, name),\n },\n isDirty: {\n enumerable: true,\n get: () => !!get(formState.dirtyFields, name),\n },\n isTouched: {\n enumerable: true,\n get: () => !!get(formState.touchedFields, name),\n },\n isValidating: {\n enumerable: true,\n get: () => !!get(formState.validatingFields, name),\n },\n error: {\n enumerable: true,\n get: () => get(formState.errors, name),\n },\n }), [formState, name]);\n const onChange = React.useCallback((event) => _registerProps.current.onChange({\n target: {\n value: getEventValue(event),\n name: name,\n },\n type: EVENTS.CHANGE,\n }), [name]);\n const onBlur = React.useCallback(() => _registerProps.current.onBlur({\n target: {\n value: get(control._formValues, name),\n name: name,\n },\n type: EVENTS.BLUR,\n }), [name, control._formValues]);\n const ref = React.useCallback((elm) => {\n const field = get(control._fields, name);\n if (field && elm) {\n field._f.ref = {\n focus: () => elm.focus && elm.focus(),\n select: () => elm.select && elm.select(),\n setCustomValidity: (message) => elm.setCustomValidity(message),\n reportValidity: () => elm.reportValidity(),\n };\n }\n }, [control._fields, name]);\n const field = React.useMemo(() => ({\n name,\n value,\n ...(isBoolean(disabled) || formState.disabled\n ? { disabled: formState.disabled || disabled }\n : {}),\n onChange,\n onBlur,\n ref,\n }), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);\n React.useEffect(() => {\n const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;\n control.register(name, {\n ..._props.current.rules,\n ...(isBoolean(_props.current.disabled)\n ? { disabled: _props.current.disabled }\n : {}),\n });\n const updateMounted = (name, value) => {\n const field = get(control._fields, name);\n if (field && field._f) {\n field._f.mount = value;\n }\n };\n updateMounted(name, true);\n if (_shouldUnregisterField) {\n const value = cloneObject(get(control._options.defaultValues, name));\n set(control._defaultValues, name, value);\n if (isUndefined(get(control._formValues, name))) {\n set(control._formValues, name, value);\n }\n }\n !isArrayField && control.register(name);\n return () => {\n (isArrayField\n ? _shouldUnregisterField && !control._state.action\n : _shouldUnregisterField)\n ? control.unregister(name)\n : updateMounted(name, false);\n };\n }, [name, control, isArrayField, shouldUnregister]);\n React.useEffect(() => {\n control._setDisabledField({\n disabled,\n name,\n });\n }, [disabled, name, control]);\n return React.useMemo(() => ({\n field,\n formState,\n fieldState,\n }), [field, formState, fieldState]);\n}\n\n/**\n * Component based on `useController` hook to work with controlled component.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)\n *\n * @param props - the path name to the form field value, and validation rules.\n *\n * @returns provide field handler functions, field and form state.\n *\n * @example\n * ```tsx\n * function App() {\n * const { control } = useForm<FormValues>({\n * defaultValues: {\n * test: \"\"\n * }\n * });\n *\n * return (\n * <form>\n * <Controller\n * control={control}\n * name=\"test\"\n * render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => (\n * <>\n * <input\n * onChange={onChange} // send value to hook form\n * onBlur={onBlur} // notify when input is touched\n * value={value} // return updated value\n * ref={ref} // set ref for focus management\n * />\n * <p>{formState.isSubmitted ? \"submitted\" : \"\"}</p>\n * <p>{fieldState.isTouched ? \"touched\" : \"\"}</p>\n * </>\n * )}\n * />\n * </form>\n * );\n * }\n * ```\n */\nconst Controller = (props) => props.render(useController(props));\n\nconst flatten = (obj) => {\n const output = {};\n for (const key of Object.keys(obj)) {\n if (isObjectType(obj[key]) && obj[key] !== null) {\n const nested = flatten(obj[key]);\n for (const nestedKey of Object.keys(nested)) {\n output[`${key}.${nestedKey}`] = nested[nestedKey];\n }\n }\n else {\n output[key] = obj[key];\n }\n }\n return output;\n};\n\nconst POST_REQUEST = 'post';\n/**\n * Form component to manage submission.\n *\n * @param props - to setup submission detail. {@link FormProps}\n *\n * @returns form component or headless render prop.\n *\n * @example\n * ```tsx\n * function App() {\n * const { control, formState: { errors } } = useForm();\n *\n * return (\n * <Form action=\"/api\" control={control}>\n * <input {...register(\"name\")} />\n * <p>{errors?.root?.server && 'Server error'}</p>\n * <button>Submit</button>\n * </Form>\n * );\n * }\n * ```\n */\nfunction Form(props) {\n const methods = useFormContext();\n const [mounted, setMounted] = React.useState(false);\n const { control = methods.control, onSubmit, children, action, method = POST_REQUEST, headers, encType, onError, render, onSuccess, validateStatus, ...rest } = props;\n const submit = async (event) => {\n let hasError = false;\n let type = '';\n await control.handleSubmit(async (data) => {\n const formData = new FormData();\n let formDataJson = '';\n try {\n formDataJson = JSON.stringify(data);\n }\n catch (_a) { }\n const flattenFormValues = flatten(control._formValues);\n for (const key in flattenFormValues) {\n formData.append(key, flattenFormValues[key]);\n }\n if (onSubmit) {\n await onSubmit({\n data,\n event,\n method,\n formData,\n formDataJson,\n });\n }\n if (action) {\n try {\n const shouldStringifySubmissionData = [\n headers && headers['Content-Type'],\n encType,\n ].some((value) => value && value.includes('json'));\n const response = await fetch(String(action), {\n method,\n headers: {\n ...headers,\n ...(encType && encType !== 'multipart/form-data'\n ? { 'Content-Type': encType }\n : {}),\n },\n body: shouldStringifySubmissionData ? formDataJson : formData,\n });\n if (response &&\n (validateStatus\n ? !validateStatus(response.status)\n : response.status < 200 || response.status >= 300)) {\n hasError = true;\n onError && onError({ response });\n type = String(response.status);\n }\n else {\n onSuccess && onSuccess({ response });\n }\n }\n catch (error) {\n hasError = true;\n onError && onError({ error });\n }\n }\n })(event);\n if (hasError && props.control) {\n props.control._subjects.state.next({\n isSubmitSuccessful: false,\n });\n props.control.setError('root.server', {\n type,\n });\n }\n };\n React.useEffect(() => {\n setMounted(true);\n }, []);\n return render ? (React.createElement(React.Fragment, null, render({\n submit,\n }))) : (React.createElement(\"form\", { noValidate: mounted, action: action, method: method, encType: encType, onSubmit: submit, ...rest }, children));\n}\n\nvar appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria\n ? {\n ...errors[name],\n types: {\n ...(errors[name] && errors[name].types ? errors[name].types : {}),\n [type]: message || true,\n },\n }\n : {};\n\nvar convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);\n\nvar createSubject = () => {\n let _observers = [];\n const next = (value) => {\n for (const observer of _observers) {\n observer.next && observer.next(value);\n }\n };\n const subscribe = (observer) => {\n _observers.push(observer);\n return {\n unsubscribe: () => {\n _observers = _observers.filter((o) => o !== observer);\n },\n };\n };\n const unsubscribe = () => {\n _observers = [];\n };\n return {\n get observers() {\n return _observers;\n },\n next,\n subscribe,\n unsubscribe,\n };\n};\n\nvar isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;\n\nvar isFileInput = (element) => element.type === 'file';\n\nvar isFunction = (value) => typeof value === 'function';\n\nvar isHTMLElement = (value) => {\n if (!isWeb) {\n return false;\n }\n const owner = value ? value.ownerDocument : 0;\n return (value instanceof\n (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));\n};\n\nvar isMultipleSelect = (element) => element.type === `select-multiple`;\n\nvar isRadioInput = (element) => element.type === 'radio';\n\nvar isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);\n\nvar live = (ref) => isHTMLElement(ref) && ref.isConnected;\n\nfunction baseGet(object, updatePath) {\n const length = updatePath.slice(0, -1).length;\n let index = 0;\n while (index < length) {\n object = isUndefined(object) ? index++ : object[updatePath[index++]];\n }\n return object;\n}\nfunction isEmptyArray(obj) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {\n return false;\n }\n }\n return true;\n}\nfunction unset(object, path) {\n const paths = Array.isArray(path)\n ? path\n : isKey(path)\n ? [path]\n : stringToPath(path);\n const childObject = paths.length === 1 ? object : baseGet(object, paths);\n const index = paths.length - 1;\n const key = paths[index];\n if (childObject) {\n delete childObject[key];\n }\n if (index !== 0 &&\n ((isObject(childObject) && isEmptyObject(childObject)) ||\n (Array.isArray(childObject) && isEmptyArray(childObject)))) {\n unset(object, paths.slice(0, -1));\n }\n return object;\n}\n\nvar objectHasFunction = (data) => {\n for (const key in data) {\n if (isFunction(data[key])) {\n return true;\n }\n }\n return false;\n};\n\nfunction markFieldsDirty(data, fields = {}) {\n const isParentNodeArray = Array.isArray(data);\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))) {\n fields[key] = Array.isArray(data[key]) ? [] : {};\n markFieldsDirty(data[key], fields[key]);\n }\n else if (!isNullOrUndefined(data[key])) {\n fields[key] = true;\n }\n }\n }\n return fields;\n}\nfunction getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues) {\n const isParentNodeArray = Array.isArray(data);\n if (isObject(data) || isParentNodeArray) {\n for (const key in data) {\n if (Array.isArray(data[key]) ||\n (isObject(data[key]) && !objectHasFunction(data[key]))) {\n if (isUndefined(formValues) ||\n isPrimitive(dirtyFieldsFromValues[key])) {\n dirtyFieldsFromValues[key] = Array.isArray(data[key])\n ? markFieldsDirty(data[key], [])\n : { ...markFieldsDirty(data[key]) };\n }\n else {\n getDirtyFieldsFromDefaultValues(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);\n }\n }\n else {\n dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]);\n }\n }\n }\n return dirtyFieldsFromValues;\n}\nvar getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues));\n\nconst defaultResult = {\n value: false,\n isValid: false,\n};\nconst validResult = { value: true, isValid: true };\nvar getCheckboxValue = (options) => {\n if (Array.isArray(options)) {\n if (options.length > 1) {\n const values = options\n .filter((option) => option && option.checked && !option.disabled)\n .map((option) => option.value);\n return { value: values, isValid: !!values.length };\n }\n return options[0].checked && !options[0].disabled\n ? // @ts-expect-error expected to work in the browser\n options[0].attributes && !isUndefined(options[0].attributes.value)\n ? isUndefined(options[0].value) || options[0].value === ''\n ? validResult\n : { value: options[0].value, isValid: true }\n : validResult\n : defaultResult;\n }\n return defaultResult;\n};\n\nvar getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value)\n ? value\n : valueAsNumber\n ? value === ''\n ? NaN\n : value\n ? +value\n : value\n : valueAsDate && isString(value)\n ? new Date(value)\n : setValueAs\n ? setValueAs(value)\n : value;\n\nconst defaultReturn = {\n isValid: false,\n value: null,\n};\nvar getRadioValue = (options) => Array.isArray(options)\n ? options.reduce((previous, option) => option && option.checked && !option.disabled\n ? {\n isValid: true,\n value: option.value,\n }\n : previous, defaultReturn)\n : defaultReturn;\n\nfunction getFieldValue(_f) {\n const ref = _f.ref;\n if (isFileInput(ref)) {\n return ref.files;\n }\n if (isRadioInput(ref)) {\n return getRadioValue(_f.refs).value;\n }\n if (isMultipleSelect(ref)) {\n return [...ref.selectedOptions].map(({ value }) => value);\n }\n if (isCheckBoxInput(ref)) {\n return getCheckboxValue(_f.refs).value;\n }\n return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);\n}\n\nvar getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {\n const fields = {};\n for (const name of fieldsNames) {\n const field = get(_fields, name);\n field && set(fields, name, field._f);\n }\n return {\n criteriaMode,\n names: [...fieldsNames],\n fields,\n shouldUseNativeValidation,\n };\n};\n\nvar isRegex = (value) => value instanceof RegExp;\n\nvar getRuleValue = (rule) => isUndefined(rule)\n ? rule\n : isRegex(rule)\n ? rule.source\n : isObject(rule)\n ? isRegex(rule.value)\n ? rule.value.source\n : rule.value\n : rule;\n\nvar getValidationModes = (mode) => ({\n isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,\n isOnBlur: mode === VALIDATION_MODE.onBlur,\n isOnChange: mode === VALIDATION_MODE.onChange,\n isOnAll: mode === VALIDATION_MODE.all,\n isOnTouch: mode === VALIDATION_MODE.onTouched,\n});\n\nconst ASYNC_FUNCTION = 'AsyncFunction';\nvar hasPromiseValidation = (fieldReference) => !!fieldReference &&\n !!fieldReference.validate &&\n !!((isFunction(fieldReference.validate) &&\n fieldReference.validate.constructor.name === ASYNC_FUNCTION) ||\n (isObject(fieldReference.validate) &&\n Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION)));\n\nvar hasValidation = (options) => options.mount &&\n (options.required ||\n options.min ||\n options.max ||\n options.maxLength ||\n options.minLength ||\n options.pattern ||\n options.validate);\n\nvar isWatched = (name, _names, isBlurEvent) => !isBlurEvent &&\n (_names.watchAll ||\n _names.watch.has(name) ||\n [..._names.watch].some((watchName) => name.startsWith(watchName) &&\n /^\\.\\w+/.test(name.slice(watchName.length))));\n\nconst iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {\n for (const key of fieldsNames || Object.keys(fields)) {\n const field = get(fields, key);\n if (field) {\n const { _f, ...currentField } = field;\n if (_f) {\n if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {\n return true;\n }\n else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {\n return true;\n }\n else {\n if (iterateFieldsByAction(currentField, action)) {\n break;\n }\n }\n }\n else if (isObject(currentField)) {\n if (iterateFieldsByAction(currentField, action)) {\n break;\n }\n }\n }\n }\n return;\n};\n\nfunction schemaErrorLookup(errors, _fields, name) {\n const error = get(errors, name);\n if (error || isKey(name)) {\n return {\n error,\n name,\n };\n }\n const names = name.split('.');\n while (names.length) {\n const fieldName = names.join('.');\n const field = get(_fields, fieldName);\n const foundError = get(errors, fieldName);\n if (field && !Array.isArray(field) && name !== fieldName) {\n return { name };\n }\n if (foundError && foundError.type) {\n return {\n name: fieldName,\n error: foundError,\n };\n }\n if (foundError && foundError.root && foundError.root.type) {\n return {\n name: `${fieldName}.root`,\n error: foundError.root,\n };\n }\n names.pop();\n }\n return {\n name,\n };\n}\n\nvar shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {\n updateFormState(formStateData);\n const { name, ...formState } = formStateData;\n return (isEmptyObject(formState) ||\n Object.keys(formState).length >= Object.keys(_proxyFormState).length ||\n Object.keys(formState).find((key) => _proxyFormState[key] ===\n (!isRoot || VALIDATION_MODE.all)));\n};\n\nvar shouldSubscribeByName = (name, signalName, exact) => !name ||\n !signalName ||\n name === signalName ||\n convertToArrayPayload(name).some((currentName) => currentName &&\n (exact\n ? currentName === signalName\n : currentName.startsWith(signalName) ||\n signalName.startsWith(currentName)));\n\nvar skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {\n if (mode.isOnAll) {\n return false;\n }\n else if (!isSubmitted && mode.isOnTouch) {\n return !(isTouched || isBlurEvent);\n }\n else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {\n return !isBlurEvent;\n }\n else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {\n return isBlurEvent;\n }\n return true;\n};\n\nvar unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);\n\nvar updateFieldArrayRootError = (errors, error, name) => {\n const fieldArrayErrors = convertToArrayPayload(get(errors, name));\n set(fieldArrayErrors, 'root', error[name]);\n set(errors, name, fieldArrayErrors);\n return errors;\n};\n\nvar isMessage = (value) => isString(value);\n\nfunction getValidateError(result, ref, type = 'validate') {\n if (isMessage(result) ||\n (Array.isArray(result) && result.every(isMessage)) ||\n (isBoolean(result) && !result)) {\n return {\n type,\n message: isMessage(result) ? result : '',\n ref,\n };\n }\n}\n\nvar getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData)\n ? validationData\n : {\n value: validationData,\n message: '',\n };\n\nvar validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {\n const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount, } = field._f;\n const inputValue = get(formValues, name);\n if (!mount || disabledFieldNames.has(name)) {\n return {};\n }\n const inputRef = refs ? refs[0] : ref;\n const setCustomValidity = (message) => {\n if (shouldUseNativeValidation && inputRef.reportValidity) {\n inputRef.setCustomValidity(isBoolean(message) ? '' : message || '');\n inputRef.reportValidity();\n }\n };\n const error = {};\n const isRadio = isRadioInput(ref);\n const isCheckBox = isCheckBoxInput(ref);\n const isRadioOrCheckbox = isRadio || isCheckBox;\n const isEmpty = ((valueAsNumber || isFileInput(ref)) &&\n isUndefined(ref.value) &&\n isUndefined(inputValue)) ||\n (isHTMLElement(ref) && ref.value === '') ||\n inputValue === '' ||\n (Array.isArray(inputValue) && !inputValue.length);\n const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);\n const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {\n const message = exceedMax ? maxLengthMessage : minLengthMessage;\n error[name] = {\n type: exceedMax ? maxType : minType,\n message,\n ref,\n ...appendErrorsCurry(exceedMax ? maxType : minType, message),\n };\n };\n if (isFieldArray\n ? !Array.isArray(inputValue) || !inputValue.length\n : required &&\n ((!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue))) ||\n (isBoolean(inputValue) && !inputValue) ||\n (isCheckBox && !getCheckboxValue(refs).isValid) ||\n (isRadio && !getRadioValue(refs).isValid))) {\n const { value, message } = isMessage(required)\n ? { value: !!required, message: required }\n : getValueAndMessage(required);\n if (value) {\n error[name] = {\n type: INPUT_VALIDATION_RULES.required,\n message,\n ref: inputRef,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(message);\n return error;\n }\n }\n }\n if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {\n let exceedMax;\n let exceedMin;\n const maxOutput = getValueAndMessage(max);\n const minOutput = getValueAndMessage(min);\n if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {\n const valueNumber = ref.valueAsNumber ||\n (inputValue ? +inputValue : inputValue);\n if (!isNullOrUndefined(maxOutput.value)) {\n exceedMax = valueNumber > maxOutput.value;\n }\n if (!isNullOrUndefined(minOutput.value)) {\n exceedMin = valueNumber < minOutput.value;\n }\n }\n else {\n const valueDate = ref.valueAsDate || new Date(inputValue);\n const convertTimeToDate = (time) => new Date(new Date().toDateString() + ' ' + time);\n const isTime = ref.type == 'time';\n const isWeek = ref.type == 'week';\n if (isString(maxOutput.value) && inputValue) {\n exceedMax = isTime\n ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value)\n : isWeek\n ? inputValue > maxOutput.value\n : valueDate > new Date(maxOutput.value);\n }\n if (isString(minOutput.value) && inputValue) {\n exceedMin = isTime\n ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value)\n : isWeek\n ? inputValue < minOutput.value\n : valueDate < new Date(minOutput.value);\n }\n }\n if (exceedMax || exceedMin) {\n getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name].message);\n return error;\n }\n }\n }\n if ((maxLength || minLength) &&\n !isEmpty &&\n (isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))) {\n const maxLengthOutput = getValueAndMessage(maxLength);\n const minLengthOutput = getValueAndMessage(minLength);\n const exceedMax = !isNullOrUndefined(maxLengthOutput.value) &&\n inputValue.length > +maxLengthOutput.value;\n const exceedMin = !isNullOrUndefined(minLengthOutput.value) &&\n inputValue.length < +minLengthOutput.value;\n if (exceedMax || exceedMin) {\n getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);\n if (!validateAllFieldCriteria) {\n setCustomValidity(error[name].message);\n return error;\n }\n }\n }\n if (pattern && !isEmpty && isString(inputValue)) {\n const { value: patternValue, message } = getValueAndMessage(pattern);\n if (isRegex(patternValue) && !inputValue.match(patternValue)) {\n error[name] = {\n type: INPUT_VALIDATION_RULES.pattern,\n message,\n ref,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(message);\n return error;\n }\n }\n }\n if (validate) {\n if (isFunction(validate)) {\n const result = await validate(inputValue, formValues);\n const validateError = getValidateError(result, inputRef);\n if (validateError) {\n error[name] = {\n ...validateError,\n ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message),\n };\n if (!validateAllFieldCriteria) {\n setCustomValidity(validateError.message);\n return error;\n }\n }\n }\n else if (isObject(validate)) {\n let validationResult = {};\n for (const key in validate) {\n if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {\n break;\n }\n const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);\n if (validateError) {\n validationResult = {\n ...validateError,\n ...appendErrorsCurry(key, validateError.message),\n };\n setCustomValidity(validateError.message);\n if (validateAllFieldCriteria) {\n error[name] = validationResult;\n }\n }\n }\n if (!isEmptyObject(validationResult)) {\n error[name] = {\n ref: inputRef,\n ...validationResult,\n };\n if (!validateAllFieldCriteria) {\n return error;\n }\n }\n }\n }\n setCustomValidity(true);\n return error;\n};\n\nconst defaultOptions = {\n mode: VALIDATION_MODE.onSubmit,\n reValidateMode: VALIDATION_MODE.onChange,\n shouldFocusError: true,\n};\nfunction createFormControl(props = {}) {\n let _options = {\n ...defaultOptions,\n ...props,\n };\n let _formState = {\n submitCount: 0,\n isDirty: false,\n isReady: false,\n isLoading: isFunction(_options.defaultValues),\n isValidating: false,\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n touchedFields: {},\n dirtyFields: {},\n validatingFields: {},\n errors: _options.errors || {},\n disabled: _options.disabled || false,\n };\n let _fields = {};\n let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)\n ? cloneObject(_options.defaultValues || _options.values) || {}\n : {};\n let _formValues = _options.shouldUnregister\n ? {}\n : cloneObject(_defaultValues);\n let _state = {\n action: false,\n mount: false,\n watch: false,\n };\n let _names = {\n mount: new Set(),\n disabled: new Set(),\n unMount: new Set(),\n array: new Set(),\n watch: new Set(),\n };\n let delayErrorCallback;\n let timer = 0;\n const _proxyFormState = {\n isDirty: false,\n dirtyFields: false,\n validatingFields: false,\n touchedFields: false,\n isValidating: false,\n isValid: false,\n errors: false,\n };\n let _proxySubscribeFormState = {\n ..._proxyFormState,\n };\n const _subjects = {\n array: createSubject(),\n state: createSubject(),\n };\n const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;\n const debounce = (callback) => (wait) => {\n clearTimeout(timer);\n timer = setTimeout(callback, wait);\n };\n const _setValid = async (shouldUpdateValid) => {\n if (!_options.disabled &&\n (_proxyFormState.isValid ||\n _proxySubscribeFormState.isValid ||\n shouldUpdateValid)) {\n const isValid = _options.resolver\n ? isEmptyObject((await _runSchema()).errors)\n : await executeBuiltInValidation(_fields, true);\n if (isValid !== _formState.isValid) {\n _subjects.state.next({\n isValid,\n });\n }\n }\n };\n const _updateIsValidating = (names, isValidating) => {\n if (!_options.disabled &&\n (_proxyFormState.isValidating ||\n _proxyFormState.validatingFields ||\n _proxySubscribeFormState.isValidating ||\n _proxySubscribeFormState.validatingFields)) {\n (names || Array.from(_names.mount)).forEach((name) => {\n if (name) {\n isValidating\n ? set(_formState.validatingFields, name, isValidating)\n : unset(_formState.validatingFields, name);\n }\n });\n _subjects.state.next({\n validatingFields: _formState.validatingFields,\n isValidating: !isEmptyObject(_formState.validatingFields),\n });\n }\n };\n const _setFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {\n if (args && method && !_options.disabled) {\n _state.action = true;\n if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {\n const fieldValues = method(get(_fields, name), args.argA, args.argB);\n shouldSetValues && set(_fields, name, fieldValues);\n }\n if (shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.errors, name))) {\n const errors = method(get(_formState.errors, name), args.argA, args.argB);\n shouldSetValues && set(_formState.errors, name, errors);\n unsetEmptyArray(_formState.errors, name);\n }\n if ((_proxyFormState.touchedFields ||\n _proxySubscribeFormState.touchedFields) &&\n shouldUpdateFieldsAndState &&\n Array.isArray(get(_formState.touchedFields, name))) {\n const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);\n shouldSetValues && set(_formState.touchedFields, name, touchedFields);\n }\n if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {\n _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);\n }\n _subjects.state.next({\n name,\n isDirty: _getDirty(name, values),\n dirtyFields: _formState.dirtyFields,\n errors: _formState.errors,\n isValid: _formState.isValid,\n });\n }\n else {\n set(_formValues, name, values);\n }\n };\n const updateErrors = (name, error) => {\n set(_formState.errors, name, error);\n _subjects.state.next({\n errors: _formState.errors,\n });\n };\n const _setErrors = (errors) => {\n _formState.errors = errors;\n _subjects.state.next({\n errors: _formState.errors,\n isValid: false,\n });\n };\n const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {\n const field = get(_fields, name);\n if (field) {\n const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);\n isUndefined(defaultValue) ||\n (ref && ref.defaultChecked) ||\n shouldSkipSetValueAs\n ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f))\n : setFieldValue(name, defaultValue);\n _state.mount && _setValid();\n }\n };\n const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {\n let shouldUpdateField = false;\n let isPreviousDirty = false;\n const output = {\n name,\n };\n if (!_options.disabled) {\n if (!isBlurEvent || shouldDirty) {\n if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {\n isPreviousDirty = _formState.isDirty;\n _formState.isDirty = output.isDirty = _getDirty();\n shouldUpdateField = isPreviousDirty !== output.isDirty;\n }\n const isCurrentFieldPristine = deepEqual(get(_defaultValues, name), fieldValue);\n isPreviousDirty = !!get(_formState.dirtyFields, name);\n isCurrentFieldPristine\n ? unset(_formState.dirtyFields, name)\n : set(_formState.dirtyFields, name, true);\n output.dirtyFields = _formState.dirtyFields;\n shouldUpdateField =\n shouldUpdateField ||\n ((_proxyFormState.dirtyFields ||\n _proxySubscribeFormState.dirtyFields) &&\n isPreviousDirty !== !isCurrentFieldPristine);\n }\n if (isBlurEvent) {\n const isPreviousFieldTouched = get(_formState.touchedFields, name);\n if (!isPreviousFieldTouched) {\n set(_formState.touchedFields, name, isBlurEvent);\n output.touchedFields = _formState.touchedFields;\n shouldUpdateField =\n shouldUpdateField ||\n ((_proxyFormState.touchedFields ||\n _proxySubscribeFormState.touchedFields) &&\n isPreviousFieldTouched !== isBlurEvent);\n }\n }\n shouldUpdateField && shouldRender && _subjects.state.next(output);\n }\n return shouldUpdateField ? output : {};\n };\n const shouldRenderByError = (name, isValid, error, fieldState) => {\n const previousFieldError = get(_formState.errors, name);\n const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) &&\n isBoolean(isValid) &&\n _formState.isValid !== isValid;\n if (_options.delayError && error) {\n delayErrorCallback = debounce(() => updateErrors(name, error));\n delayErrorCallback(_options.delayError);\n }\n else {\n clearTimeout(timer);\n delayErrorCallback = null;\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) ||\n !isEmptyObject(fieldState) ||\n shouldUpdateValid) {\n const updatedFormState = {\n ...fieldState,\n ...(shouldUpdateValid && isBoolean(isValid) ? { isValid } : {}),\n errors: _formState.errors,\n name,\n };\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n _subjects.state.next(updatedFormState);\n }\n };\n const _runSchema = async (name) => {\n _updateIsValidating(name, true);\n const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));\n _updateIsValidating(name);\n return result;\n };\n const executeSchemaAndUpdateState = async (names) => {\n const { errors } = await _runSchema(names);\n if (names) {\n for (const name of names) {\n const error = get(errors, name);\n error\n ? set(_formState.errors, name, error)\n : unset(_formState.errors, name);\n }\n }\n else {\n _formState.errors = errors;\n }\n return errors;\n };\n const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {\n valid: true,\n }) => {\n for (const name in fields) {\n const field = fields[name];\n if (field) {\n const { _f, ...fieldValue } = field;\n if (_f) {\n const isFieldArrayRoot = _names.array.has(_f.name);\n const isPromiseFunction = field._f && hasPromiseValidation(field._f);\n if (isPromiseFunction && _proxyFormState.validatingFields) {\n _updateIsValidating([name], true);\n }\n const fieldError = await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);\n if (isPromiseFunction && _proxyFormState.validatingFields) {\n _updateIsValidating([name]);\n }\n if (fieldError[_f.name]) {\n context.valid = false;\n if (shouldOnlyCheckValid) {\n break;\n }\n }\n !shouldOnlyCheckValid &&\n (get(fieldError, _f.name)\n ? isFieldArrayRoot\n ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name)\n : set(_formState.errors, _f.name, fieldError[_f.name])\n : unset(_formState.errors, _f.name));\n }\n !isEmptyObject(fieldValue) &&\n (await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context));\n }\n }\n return context.valid;\n };\n const _removeUnmounted = () => {\n for (const name of _names.unMount) {\n const field = get(_fields, name);\n field &&\n (field._f.refs\n ? field._f.refs.every((ref) => !live(ref))\n : !live(field._f.ref)) &&\n unregister(name);\n }\n _names.unMount = new Set();\n };\n const _getDirty = (name, data) => !_options.disabled &&\n (name && data && set(_formValues, name, data),\n !deepEqual(getValues(), _defaultValues));\n const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {\n ...(_state.mount\n ? _formValues\n : isUndefined(defaultValue)\n ? _defaultValues\n : isString(names)\n ? { [names]: defaultValue }\n : defaultValue),\n }, isGlobal, defaultValue);\n const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, _options.shouldUnregister ? get(_defaultValues, name, []) : []));\n const setFieldValue = (name, value, options = {}) => {\n const field = get(_fields, name);\n let fieldValue = value;\n if (field) {\n const fieldReference = field._f;\n if (fieldReference) {\n !fieldReference.disabled &&\n set(_formValues, name, getFieldValueAs(value, fieldReference));\n fieldValue =\n isHTMLElement(fieldReference.ref) && isNullOrUndefined(value)\n ? ''\n : value;\n if (isMultipleSelect(fieldReference.ref)) {\n [...fieldReference.ref.options].forEach((optionRef) => (optionRef.selected = fieldValue.includes(optionRef.value)));\n }\n else if (fieldReference.refs) {\n if (isCheckBoxInput(fieldReference.ref)) {\n fieldReference.refs.forEach((checkboxRef) => {\n if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {\n if (Array.isArray(fieldValue)) {\n checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);\n }\n else {\n checkboxRef.checked =\n fieldValue === checkboxRef.value || !!fieldValue;\n }\n }\n });\n }\n else {\n fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));\n }\n }\n else if (isFileInput(fieldReference.ref)) {\n fieldReference.ref.value = '';\n }\n else {\n fieldReference.ref.value = fieldValue;\n if (!fieldReference.ref.type) {\n _subjects.state.next({\n name,\n values: cloneObject(_formValues),\n });\n }\n }\n }\n }\n (options.shouldDirty || options.shouldTouch) &&\n updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);\n options.shouldValidate && trigger(name);\n };\n const setValues = (name, value, options) => {\n for (const fieldKey in value) {\n if (!value.hasOwnProperty(fieldKey)) {\n return;\n }\n const fieldValue = value[fieldKey];\n const fieldName = name + '.' + fieldKey;\n const field = get(_fields, fieldName);\n (_names.array.has(name) ||\n isObject(fieldValue) ||\n (field && !field._f)) &&\n !isDateObject(fieldValue)\n ? setValues(fieldName, fieldValue, options)\n : setFieldValue(fieldName, fieldValue, options);\n }\n };\n const setValue = (name, value, options = {}) => {\n const field = get(_fields, name);\n const isFieldArray = _names.array.has(name);\n const cloneValue = cloneObject(value);\n set(_formValues, name, cloneValue);\n if (isFieldArray) {\n _subjects.array.next({\n name,\n values: cloneObject(_formValues),\n });\n if ((_proxyFormState.isDirty ||\n _proxyFormState.dirtyFields ||\n _proxySubscribeFormState.isDirty ||\n _proxySubscribeFormState.dirtyFields) &&\n options.shouldDirty) {\n _subjects.state.next({\n name,\n dirtyFields: getDirtyFields(_defaultValues, _formValues),\n isDirty: _getDirty(name, cloneValue),\n });\n }\n }\n else {\n field && !field._f && !isNullOrUndefined(cloneValue)\n ? setValues(name, cloneValue, options)\n : setFieldValue(name, cloneValue, options);\n }\n isWatched(name, _names) && _subjects.state.next({ ..._formState, name });\n _subjects.state.next({\n name: _state.mount ? name : undefined,\n values: cloneObject(_formValues),\n });\n };\n const onChange = async (event) => {\n _state.mount = true;\n const target = event.target;\n let name = target.name;\n let isFieldValueUpdated = true;\n const field = get(_fields, name);\n const _updateIsFieldValueUpdated = (fieldValue) => {\n isFieldValueUpdated =\n Number.isNaN(fieldValue) ||\n (isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||\n deepEqual(fieldValue, get(_formValues, name, fieldValue));\n };\n const validationModeBeforeSubmit = getValidationModes(_options.mode);\n const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);\n if (field) {\n let error;\n let isValid;\n const fieldValue = target.type\n ? getFieldValue(field._f)\n : getEventValue(event);\n const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;\n const shouldSkipValidation = (!hasValidation(field._f) &&\n !_options.resolver &&\n !get(_formState.errors, name) &&\n !field._f.deps) ||\n skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);\n const watched = isWatched(name, _names, isBlurEvent);\n set(_formValues, name, fieldValue);\n if (isBlurEvent) {\n if (!target || !target.readOnly) {\n field._f.onBlur && field._f.onBlur(event);\n delayErrorCallback && delayErrorCallback(0);\n }\n }\n else if (field._f.onChange) {\n field._f.onChange(event);\n }\n const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent);\n const shouldRender = !isEmptyObject(fieldState) || watched;\n !isBlurEvent &&\n _subjects.state.next({\n name,\n type: event.type,\n values: cloneObject(_formValues),\n });\n if (shouldSkipValidation) {\n if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {\n if (_options.mode === 'onBlur') {\n if (isBlurEvent) {\n _setValid();\n }\n }\n else if (!isBlurEvent) {\n _setValid();\n }\n }\n return (shouldRender &&\n _subjects.state.next({ name, ...(watched ? {} : fieldState) }));\n }\n !isBlurEvent && watched && _subjects.state.next({ ..._formState });\n if (_options.resolver) {\n const { errors } = await _runSchema([name]);\n _updateIsFieldValueUpdated(fieldValue);\n if (isFieldValueUpdated) {\n const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);\n const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);\n error = errorLookupResult.error;\n name = errorLookupResult.name;\n isValid = isEmptyObject(errors);\n }\n }\n else {\n _updateIsValidating([name], true);\n error = (await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];\n _updateIsValidating([name]);\n _updateIsFieldValueUpdated(fieldValue);\n if (isFieldValueUpdated) {\n if (error) {\n isValid = false;\n }\n else if (_proxyFormState.isValid ||\n _proxySubscribeFormState.isValid) {\n isValid = await executeBuiltInValidation(_fields, true);\n }\n }\n }\n if (isFieldValueUpdated) {\n field._f.deps &&\n trigger(field._f.deps);\n shouldRenderByError(name, isValid, error, fieldState);\n }\n }\n };\n const _focusInput = (ref, key) => {\n if (get(_formState.errors, key) && ref.focus) {\n ref.focus();\n return 1;\n }\n return;\n };\n const trigger = async (name, options = {}) => {\n let isValid;\n let validationResult;\n const fieldNames = convertToArrayPayload(name);\n if (_options.resolver) {\n const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);\n isValid = isEmptyObject(errors);\n validationResult = name\n ? !fieldNames.some((name) => get(errors, name))\n : isValid;\n }\n else if (name) {\n validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {\n const field = get(_fields, fieldName);\n return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);\n }))).every(Boolean);\n !(!validationResult && !_formState.isValid) && _setValid();\n }\n else {\n validationResult = isValid = await executeBuiltInValidation(_fields);\n }\n _subjects.state.next({\n ...(!isString(name) ||\n ((_proxyFormState.isValid || _proxySubscribeFormState.isValid) &&\n isValid !== _formState.isValid)\n ? {}\n : { name }),\n ...(_options.resolver || !name ? { isValid } : {}),\n errors: _formState.errors,\n });\n options.shouldFocus &&\n !validationResult &&\n iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);\n return validationResult;\n };\n const getValues = (fieldNames) => {\n const values = {\n ...(_state.mount ? _formValues : _defaultValues),\n };\n return isUndefined(fieldNames)\n ? values\n : isString(fieldNames)\n ? get(values, fieldNames)\n : fieldNames.map((name) => get(values, name));\n };\n const getFieldState = (name, formState) => ({\n invalid: !!get((formState || _formState).errors, name),\n isDirty: !!get((formState || _formState).dirtyFields, name),\n error: get((formState || _formState).errors, name),\n isValidating: !!get(_formState.validatingFields, name),\n isTouched: !!get((formState || _formState).touchedFields, name),\n });\n const clearErrors = (name) => {\n name &&\n convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName));\n _subjects.state.next({\n errors: name ? _formState.errors : {},\n });\n };\n const setError = (name, error, options) => {\n const ref = (get(_fields, name, { _f: {} })._f || {}).ref;\n const currentError = get(_formState.errors, name) || {};\n // Don't override existing error messages elsewhere in the object tree.\n const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;\n set(_formState.errors, name, {\n ...restOfErrorTree,\n ...error,\n ref,\n });\n _subjects.state.next({\n name,\n errors: _formState.errors,\n isValid: false,\n });\n options && options.shouldFocus && ref && ref.focus && ref.focus();\n };\n const watch = (name, defaultValue) => isFunction(name)\n ? _subjects.state.subscribe({\n next: (payload) => 'values' in payload &&\n name(_getWatch(undefined, defaultValue), payload),\n })\n : _getWatch(name, defaultValue, true);\n const _subscribe = (props) => _subjects.state.subscribe({\n next: (formState) => {\n if (shouldSubscribeByName(props.name, formState.name, props.exact) &&\n shouldRenderFormState(formState, props.formState || _proxyFormState, _setFormState, props.reRenderRoot)) {\n props.callback({\n values: { ..._formValues },\n ..._formState,\n ...formState,\n defaultValues: _defaultValues,\n });\n }\n },\n }).unsubscribe;\n const subscribe = (props) => {\n _state.mount = true;\n _proxySubscribeFormState = {\n ..._proxySubscribeFormState,\n ...props.formState,\n };\n return _subscribe({\n ...props,\n formState: _proxySubscribeFormState,\n });\n };\n const unregister = (name, options = {}) => {\n for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {\n _names.mount.delete(fieldName);\n _names.array.delete(fieldName);\n if (!options.keepValue) {\n unset(_fields, fieldName);\n unset(_formValues, fieldName);\n }\n !options.keepError && unset(_formState.errors, fieldName);\n !options.keepDirty && unset(_formState.dirtyFields, fieldName);\n !options.keepTouched && unset(_formState.touchedFields, fieldName);\n !options.keepIsValidating &&\n unset(_formState.validatingFields, fieldName);\n !_options.shouldUnregister &&\n !options.keepDefaultValue &&\n unset(_defaultValues, fieldName);\n }\n _subjects.state.next({\n values: cloneObject(_formValues),\n });\n _subjects.state.next({\n ..._formState,\n ...(!options.keepDirty ? {} : { isDirty: _getDirty() }),\n });\n !options.keepIsValid && _setValid();\n };\n const _setDisabledField = ({ disabled, name, }) => {\n if ((isBoolean(disabled) && _state.mount) ||\n !!disabled ||\n _names.disabled.has(name)) {\n disabled ? _names.disabled.add(name) : _names.disabled.delete(name);\n }\n };\n const register = (name, options = {}) => {\n let field = get(_fields, name);\n const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);\n set(_fields, name, {\n ...(field || {}),\n _f: {\n ...(field && field._f ? field._f : { ref: { name } }),\n name,\n mount: true,\n ...options,\n },\n });\n _names.mount.add(name);\n if (field) {\n _setDisabledField({\n disabled: isBoolean(options.disabled)\n ? options.disabled\n : _options.disabled,\n name,\n });\n }\n else {\n updateValidAndValue(name, true, options.value);\n }\n return {\n ...(disabledIsDefined\n ? { disabled: options.disabled || _options.disabled }\n : {}),\n ...(_options.progressive\n ? {\n required: !!options.required,\n min: getRuleValue(options.min),\n max: getRuleValue(options.max),\n minLength: getRuleValue(options.minLength),\n maxLength: getRuleValue(options.maxLength),\n pattern: getRuleValue(options.pattern),\n }\n : {}),\n name,\n onChange,\n onBlur: onChange,\n ref: (ref) => {\n if (ref) {\n register(name, options);\n field = get(_fields, name);\n const fieldRef = isUndefined(ref.value)\n ? ref.querySelectorAll\n ? ref.querySelectorAll('input,select,textarea')[0] || ref\n : ref\n : ref;\n const radioOrCheckbox = isRadioOrCheckbox(fieldRef);\n const refs = field._f.refs || [];\n if (radioOrCheckbox\n ? refs.find((option) => option === fieldRef)\n : fieldRef === field._f.ref) {\n return;\n }\n set(_fields, name, {\n _f: {\n ...field._f,\n ...(radioOrCheckbox\n ? {\n refs: [\n ...refs.filter(live),\n fieldRef,\n ...(Array.isArray(get(_defaultValues, name)) ? [{}] : []),\n ],\n ref: { type: fieldRef.type, name },\n }\n : { ref: fieldRef }),\n },\n });\n updateValidAndValue(name, false, undefined, fieldRef);\n }\n else {\n field = get(_fields, name, {});\n if (field._f) {\n field._f.mount = false;\n }\n (_options.shouldUnregister || options.shouldUnregister) &&\n !(isNameInFieldArray(_names.array, name) && _state.action) &&\n _names.unMount.add(name);\n }\n },\n };\n };\n const _focusError = () => _options.shouldFocusError &&\n iterateFieldsByAction(_fields, _focusInput, _names.mount);\n const _disableForm = (disabled) => {\n if (isBoolean(disabled)) {\n _subjects.state.next({ disabled });\n iterateFieldsByAction(_fields, (ref, name) => {\n const currentField = get(_fields, name);\n if (currentField) {\n ref.disabled = currentField._f.disabled || disabled;\n if (Array.isArray(currentField._f.refs)) {\n currentField._f.refs.forEach((inputRef) => {\n inputRef.disabled = currentField._f.disabled || disabled;\n });\n }\n }\n }, 0, false);\n }\n };\n const handleSubmit = (onValid, onInvalid) => async (e) => {\n let onValidError = undefined;\n if (e) {\n e.preventDefault && e.preventDefault();\n e.persist &&\n e.persist();\n }\n let fieldValues = cloneObject(_formValues);\n _subjects.state.next({\n isSubmitting: true,\n });\n if (_options.resolver) {\n const { errors, values } = await _runSchema();\n _formState.errors = errors;\n fieldValues = cloneObject(values);\n }\n else {\n await executeBuiltInValidation(_fields);\n }\n if (_names.disabled.size) {\n for (const name of _names.disabled) {\n unset(fieldValues, name);\n }\n }\n unset(_formState.errors, 'root');\n if (isEmptyObject(_formState.errors)) {\n _subjects.state.next({\n errors: {},\n });\n try {\n await onValid(fieldValues, e);\n }\n catch (error) {\n onValidError = error;\n }\n }\n else {\n if (onInvalid) {\n await onInvalid({ ..._formState.errors }, e);\n }\n _focusError();\n setTimeout(_focusError);\n }\n _subjects.state.next({\n isSubmitted: true,\n isSubmitting: false,\n isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,\n submitCount: _formState.submitCount + 1,\n errors: _formState.errors,\n });\n if (onValidError) {\n throw onValidError;\n }\n };\n const resetField = (name, options = {}) => {\n if (get(_fields, name)) {\n if (isUndefined(options.defaultValue)) {\n setValue(name, cloneObject(get(_defaultValues, name)));\n }\n else {\n setValue(name, options.defaultValue);\n set(_defaultValues, name, cloneObject(options.defaultValue));\n }\n if (!options.keepTouched) {\n unset(_formState.touchedFields, name);\n }\n if (!options.keepDirty) {\n unset(_formState.dirtyFields, name);\n _formState.isDirty = options.defaultValue\n ? _getDirty(name, cloneObject(get(_defaultValues, name)))\n : _getDirty();\n }\n if (!options.keepError) {\n unset(_formState.errors, name);\n _proxyFormState.isValid && _setValid();\n }\n _subjects.state.next({ ..._formState });\n }\n };\n const _reset = (formValues, keepStateOptions = {}) => {\n const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;\n const cloneUpdatedValues = cloneObject(updatedValues);\n const isEmptyResetValues = isEmptyObject(formValues);\n const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;\n if (!keepStateOptions.keepDefaultValues) {\n _defaultValues = updatedValues;\n }\n if (!keepStateOptions.keepValues) {\n if (keepStateOptions.keepDirtyValues) {\n const fieldsToCheck = new Set([\n ..._names.mount,\n ...Object.keys(getDirtyFields(_defaultValues, _formValues)),\n ]);\n for (const fieldName of Array.from(fieldsToCheck)) {\n get(_formState.dirtyFields, fieldName)\n ? set(values, fieldName, get(_formValues, fieldName))\n : setValue(fieldName, get(values, fieldName));\n }\n }\n else {\n if (isWeb && isUndefined(formValues)) {\n for (const name of _names.mount) {\n const field = get(_fields, name);\n if (field && field._f) {\n const fieldReference = Array.isArray(field._f.refs)\n ? field._f.refs[0]\n : field._f.ref;\n if (isHTMLElement(fieldReference)) {\n const form = fieldReference.closest('form');\n if (form) {\n form.reset();\n break;\n }\n }\n }\n }\n }\n if (keepStateOptions.keepFieldsRef) {\n for (const fieldName of _names.mount) {\n setValue(fieldName, get(values, fieldName));\n }\n }\n else {\n _fields = {};\n }\n }\n _formValues = _options.shouldUnregister\n ? keepStateOptions.keepDefaultValues\n ? cloneObject(_defaultValues)\n : {}\n : cloneObject(values);\n _subjects.array.next({\n values: { ...values },\n });\n _subjects.state.next({\n values: { ...values },\n });\n }\n _names = {\n mount: keepStateOptions.keepDirtyValues ? _names.mount : new Set(),\n unMount: new Set(),\n array: new Set(),\n disabled: new Set(),\n watch: new Set(),\n watchAll: false,\n focus: '',\n };\n _state.mount =\n !_proxyFormState.isValid ||\n !!keepStateOptions.keepIsValid ||\n !!keepStateOptions.keepDirtyValues;\n _state.watch = !!_options.shouldUnregister;\n _subjects.state.next({\n submitCount: keepStateOptions.keepSubmitCount\n ? _formState.submitCount\n : 0,\n isDirty: isEmptyResetValues\n ? false\n : keepStateOptions.keepDirty\n ? _formState.isDirty\n : !!(keepStateOptions.keepDefaultValues &&\n !deepEqual(formValues, _defaultValues)),\n isSubmitted: keepStateOptions.keepIsSubmitted\n ? _formState.isSubmitted\n : false,\n dirtyFields: isEmptyResetValues\n ? {}\n : keepStateOptions.keepDirtyValues\n ? keepStateOptions.keepDefaultValues && _formValues\n ? getDirtyFields(_defaultValues, _formValues)\n : _formState.dirtyFields\n : keepStateOptions.keepDefaultValues && formValues\n ? getDirtyFields(_defaultValues, formValues)\n : keepStateOptions.keepDirty\n ? _formState.dirtyFields\n : {},\n touchedFields: keepStateOptions.keepTouched\n ? _formState.touchedFields\n : {},\n errors: keepStateOptions.keepErrors ? _formState.errors : {},\n isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful\n ? _formState.isSubmitSuccessful\n : false,\n isSubmitting: false,\n defaultValues: _defaultValues,\n });\n };\n const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)\n ? formValues(_formValues)\n : formValues, keepStateOptions);\n const setFocus = (name, options = {}) => {\n const field = get(_fields, name);\n const fieldReference = field && field._f;\n if (fieldReference) {\n const fieldRef = fieldReference.refs\n ? fieldReference.refs[0]\n : fieldReference.ref;\n if (fieldRef.focus) {\n fieldRef.focus();\n options.shouldSelect &&\n isFunction(fieldRef.select) &&\n fieldRef.select();\n }\n }\n };\n const _setFormState = (updatedFormState) => {\n _formState = {\n ..._formState,\n ...updatedFormState,\n };\n };\n const _resetDefaultValues = () => isFunction(_options.defaultValues) &&\n _options.defaultValues().then((values) => {\n reset(values, _options.resetOptions);\n _subjects.state.next({\n isLoading: false,\n });\n });\n const methods = {\n control: {\n register,\n unregister,\n getFieldState,\n handleSubmit,\n setError,\n _subscribe,\n _runSchema,\n _focusError,\n _getWatch,\n _getDirty,\n _setValid,\n _setFieldArray,\n _setDisabledField,\n _setErrors,\n _getFieldArray,\n _reset,\n _resetDefaultValues,\n _removeUnmounted,\n _disableForm,\n _subjects,\n _proxyFormState,\n get _fields() {\n return _fields;\n },\n get _formValues() {\n return _formValues;\n },\n get _state() {\n return _state;\n },\n set _state(value) {\n _state = value;\n },\n get _defaultValues() {\n return _defaultValues;\n },\n get _names() {\n return _names;\n },\n set _names(value) {\n _names = value;\n },\n get _formState() {\n return _formState;\n },\n get _options() {\n return _options;\n },\n set _options(value) {\n _options = {\n ..._options,\n ...value,\n };\n },\n },\n subscribe,\n trigger,\n register,\n handleSubmit,\n watch,\n setValue,\n getValues,\n reset,\n resetField,\n clearErrors,\n unregister,\n setError,\n setFocus,\n getFieldState,\n };\n return {\n ...methods,\n formControl: methods,\n };\n}\n\nvar generateId = () => {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n const d = typeof performance === 'undefined' ? Date.now() : performance.now() * 1000;\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16 + d) % 16 | 0;\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nvar getFocusFieldName = (name, index, options = {}) => options.shouldFocus || isUndefined(options.shouldFocus)\n ? options.focusName ||\n `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.`\n : '';\n\nvar appendAt = (data, value) => [\n ...data,\n ...convertToArrayPayload(value),\n];\n\nvar fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => undefined) : undefined;\n\nfunction insert(data, index, value) {\n return [\n ...data.slice(0, index),\n ...convertToArrayPayload(value),\n ...data.slice(index),\n ];\n}\n\nvar moveArrayAt = (data, from, to) => {\n if (!Array.isArray(data)) {\n return [];\n }\n if (isUndefined(data[to])) {\n data[to] = undefined;\n }\n data.splice(to, 0, data.splice(from, 1)[0]);\n return data;\n};\n\nvar prependAt = (data, value) => [\n ...convertToArrayPayload(value),\n ...convertToArrayPayload(data),\n];\n\nfunction removeAtIndexes(data, indexes) {\n let i = 0;\n const temp = [...data];\n for (const index of indexes) {\n temp.splice(index - i, 1);\n i++;\n }\n return compact(temp).length ? temp : [];\n}\nvar removeArrayAt = (data, index) => isUndefined(index)\n ? []\n : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b));\n\nvar swapArrayAt = (data, indexA, indexB) => {\n [data[indexA], data[indexB]] = [data[indexB], data[indexA]];\n};\n\nvar updateAt = (fieldValues, index, value) => {\n fieldValues[index] = value;\n return fieldValues;\n};\n\n/**\n * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)\n *\n * @param props - useFieldArray props\n *\n * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, control, handleSubmit, reset, trigger, setError } = useForm({\n * defaultValues: {\n * test: []\n * }\n * });\n * const { fields, append } = useFieldArray({\n * control,\n * name: \"test\"\n * });\n *\n * return (\n * <form onSubmit={handleSubmit(data => console.log(data))}>\n * {fields.map((item, index) => (\n * <input key={item.id} {...register(`test.${index}.firstName`)} />\n * ))}\n * <button type=\"button\" onClick={() => append({ firstName: \"bill\" })}>\n * append\n * </button>\n * <input type=\"submit\" />\n * </form>\n * );\n * }\n * ```\n */\nfunction useFieldArray(props) {\n const methods = useFormContext();\n const { control = methods.control, name, keyName = 'id', shouldUnregister, rules, } = props;\n const [fields, setFields] = React.useState(control._getFieldArray(name));\n const ids = React.useRef(control._getFieldArray(name).map(generateId));\n const _fieldIds = React.useRef(fields);\n const _actioned = React.useRef(false);\n _fieldIds.current = fields;\n control._names.array.add(name);\n React.useMemo(() => rules &&\n control.register(name, rules), [control, rules, name]);\n useIsomorphicLayoutEffect(() => control._subjects.array.subscribe({\n next: ({ values, name: fieldArrayName, }) => {\n if (fieldArrayName === name || !fieldArrayName) {\n const fieldValues = get(values, name);\n if (Array.isArray(fieldValues)) {\n setFields(fieldValues);\n ids.current = fieldValues.map(generateId);\n }\n }\n },\n }).unsubscribe, [control, name]);\n const updateValues = React.useCallback((updatedFieldArrayValues) => {\n _actioned.current = true;\n control._setFieldArray(name, updatedFieldArrayValues);\n }, [control, name]);\n const append = (value, options) => {\n const appendValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = appendAt(control._getFieldArray(name), appendValue);\n control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options);\n ids.current = appendAt(ids.current, appendValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, appendAt, {\n argA: fillEmptyArray(value),\n });\n };\n const prepend = (value, options) => {\n const prependValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = prependAt(control._getFieldArray(name), prependValue);\n control._names.focus = getFocusFieldName(name, 0, options);\n ids.current = prependAt(ids.current, prependValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, prependAt, {\n argA: fillEmptyArray(value),\n });\n };\n const remove = (index) => {\n const updatedFieldArrayValues = removeArrayAt(control._getFieldArray(name), index);\n ids.current = removeArrayAt(ids.current, index);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n !Array.isArray(get(control._fields, name)) &&\n set(control._fields, name, undefined);\n control._setFieldArray(name, updatedFieldArrayValues, removeArrayAt, {\n argA: index,\n });\n };\n const insert$1 = (index, value, options) => {\n const insertValue = convertToArrayPayload(cloneObject(value));\n const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue);\n control._names.focus = getFocusFieldName(name, index, options);\n ids.current = insert(ids.current, index, insertValue.map(generateId));\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, insert, {\n argA: index,\n argB: fillEmptyArray(value),\n });\n };\n const swap = (indexA, indexB) => {\n const updatedFieldArrayValues = control._getFieldArray(name);\n swapArrayAt(updatedFieldArrayValues, indexA, indexB);\n swapArrayAt(ids.current, indexA, indexB);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, swapArrayAt, {\n argA: indexA,\n argB: indexB,\n }, false);\n };\n const move = (from, to) => {\n const updatedFieldArrayValues = control._getFieldArray(name);\n moveArrayAt(updatedFieldArrayValues, from, to);\n moveArrayAt(ids.current, from, to);\n updateValues(updatedFieldArrayValues);\n setFields(updatedFieldArrayValues);\n control._setFieldArray(name, updatedFieldArrayValues, moveArrayAt, {\n argA: from,\n argB: to,\n }, false);\n };\n const update = (index, value) => {\n const updateValue = cloneObject(value);\n const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue);\n ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]);\n updateValues(updatedFieldArrayValues);\n setFields([...updatedFieldArrayValues]);\n control._setFieldArray(name, updatedFieldArrayValues, updateAt, {\n argA: index,\n argB: updateValue,\n }, true, false);\n };\n const replace = (value) => {\n const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));\n ids.current = updatedFieldArrayValues.map(generateId);\n updateValues([...updatedFieldArrayValues]);\n setFields([...updatedFieldArrayValues]);\n control._setFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);\n };\n React.useEffect(() => {\n control._state.action = false;\n isWatched(name, control._names) &&\n control._subjects.state.next({\n ...control._formState,\n });\n if (_actioned.current &&\n (!getValidationModes(control._options.mode).isOnSubmit ||\n control._formState.isSubmitted) &&\n !getValidationModes(control._options.reValidateMode).isOnSubmit) {\n if (control._options.resolver) {\n control._runSchema([name]).then((result) => {\n const error = get(result.errors, name);\n const existingError = get(control._formState.errors, name);\n if (existingError\n ? (!error && existingError.type) ||\n (error &&\n (existingError.type !== error.type ||\n existingError.message !== error.message))\n : error && error.type) {\n error\n ? set(control._formState.errors, name, error)\n : unset(control._formState.errors, name);\n control._subjects.state.next({\n errors: control._formState.errors,\n });\n }\n });\n }\n else {\n const field = get(control._fields, name);\n if (field &&\n field._f &&\n !(getValidationModes(control._options.reValidateMode).isOnSubmit &&\n getValidationModes(control._options.mode).isOnSubmit)) {\n validateField(field, control._names.disabled, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !isEmptyObject(error) &&\n control._subjects.state.next({\n errors: updateFieldArrayRootError(control._formState.errors, error, name),\n }));\n }\n }\n }\n control._subjects.state.next({\n name,\n values: cloneObject(control._formValues),\n });\n control._names.focus &&\n iterateFieldsByAction(control._fields, (ref, key) => {\n if (control._names.focus &&\n key.startsWith(control._names.focus) &&\n ref.focus) {\n ref.focus();\n return 1;\n }\n return;\n });\n control._names.focus = '';\n control._setValid();\n _actioned.current = false;\n }, [fields, name, control]);\n React.useEffect(() => {\n !get(control._formValues, name) && control._setFieldArray(name);\n return () => {\n const updateMounted = (name, value) => {\n const field = get(control._fields, name);\n if (field && field._f) {\n field._f.mount = value;\n }\n };\n control._options.shouldUnregister || shouldUnregister\n ? control.unregister(name)\n : updateMounted(name, false);\n };\n }, [name, control, keyName, shouldUnregister]);\n return {\n swap: React.useCallback(swap, [updateValues, name, control]),\n move: React.useCallback(move, [updateValues, name, control]),\n prepend: React.useCallback(prepend, [updateValues, name, control]),\n append: React.useCallback(append, [updateValues, name, control]),\n remove: React.useCallback(remove, [updateValues, name, control]),\n insert: React.useCallback(insert$1, [updateValues, name, control]),\n update: React.useCallback(update, [updateValues, name, control]),\n replace: React.useCallback(replace, [updateValues, name, control]),\n fields: React.useMemo(() => fields.map((field, index) => ({\n ...field,\n [keyName]: ids.current[index] || generateId(),\n })), [fields, keyName]),\n };\n}\n\n/**\n * Custom hook to manage the entire form.\n *\n * @remarks\n * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)\n *\n * @param props - form configuration and validation parameters.\n *\n * @returns methods - individual functions to manage the form state. {@link UseFormReturn}\n *\n * @example\n * ```tsx\n * function App() {\n * const { register, handleSubmit, watch, formState: { errors } } = useForm();\n * const onSubmit = data => console.log(data);\n *\n * console.log(watch(\"example\"));\n *\n * return (\n * <form onSubmit={handleSubmit(onSubmit)}>\n * <input defaultValue=\"test\" {...register(\"example\")} />\n * <input {...register(\"exampleRequired\", { required: true })} />\n * {errors.exampleRequired && <span>This field is required</span>}\n * <button>Submit</button>\n * </form>\n * );\n * }\n * ```\n */\nfunction useForm(props = {}) {\n const _formControl = React.useRef(undefined);\n const _values = React.useRef(undefined);\n const [formState, updateFormState] = React.useState({\n isDirty: false,\n isValidating: false,\n isLoading: isFunction(props.defaultValues),\n isSubmitted: false,\n isSubmitting: false,\n isSubmitSuccessful: false,\n isValid: false,\n submitCount: 0,\n dirtyFields: {},\n touchedFields: {},\n validatingFields: {},\n errors: props.errors || {},\n disabled: props.disabled || false,\n isReady: false,\n defaultValues: isFunction(props.defaultValues)\n ? undefined\n : props.defaultValues,\n });\n if (!_formControl.current) {\n if (props.formControl) {\n _formControl.current = {\n ...props.formControl,\n formState,\n };\n if (props.defaultValues && !isFunction(props.defaultValues)) {\n props.formControl.reset(props.defaultValues, props.resetOptions);\n }\n }\n else {\n const { formControl, ...rest } = createFormControl(props);\n _formControl.current = {\n ...rest,\n formState,\n };\n }\n }\n const control = _formControl.current.control;\n control._options = props;\n useIsomorphicLayoutEffect(() => {\n const sub = control._subscribe({\n formState: control._proxyFormState,\n callback: () => updateFormState({ ...control._formState }),\n reRenderRoot: true,\n });\n updateFormState((data) => ({\n ...data,\n isReady: true,\n }));\n control._formState.isReady = true;\n return sub;\n }, [control]);\n React.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);\n React.useEffect(() => {\n if (props.mode) {\n control._options.mode = props.mode;\n }\n if (props.reValidateMode) {\n control._options.reValidateMode = props.reValidateMode;\n }\n }, [control, props.mode, props.reValidateMode]);\n React.useEffect(() => {\n if (props.errors) {\n control._setErrors(props.errors);\n control._focusError();\n }\n }, [control, props.errors]);\n React.useEffect(() => {\n props.shouldUnregister &&\n control._subjects.state.next({\n values: control._getWatch(),\n });\n }, [control, props.shouldUnregister]);\n React.useEffect(() => {\n if (control._proxyFormState.isDirty) {\n const isDirty = control._getDirty();\n if (isDirty !== formState.isDirty) {\n control._subjects.state.next({\n isDirty,\n });\n }\n }\n }, [control, formState.isDirty]);\n React.useEffect(() => {\n if (props.values && !deepEqual(props.values, _values.current)) {\n control._reset(props.values, {\n keepFieldsRef: true,\n ...control._options.resetOptions,\n });\n _values.current = props.values;\n updateFormState((state) => ({ ...state }));\n }\n else {\n control._resetDefaultValues();\n }\n }, [control, props.values]);\n React.useEffect(() => {\n if (!control._state.mount) {\n control._setValid();\n control._state.mount = true;\n }\n if (control._state.watch) {\n control._state.watch = false;\n control._subjects.state.next({ ...control._formState });\n }\n control._removeUnmounted();\n });\n _formControl.current.formState = getProxyFormState(formState, control);\n return _formControl.current;\n}\n\nexport { Controller, Form, FormProvider, appendErrors, createFormControl, get, set, useController, useFieldArray, useForm, useFormContext, useFormState, useWatch };\n//# sourceMappingURL=index.esm.mjs.map\n","import {\n Control,\n FieldPath,\n FieldValues,\n useController,\n} from \"react-hook-form\";\nimport { SelectOption, SelectProps } from \"../components/Select\";\n\nexport interface UseSelectFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> {\n name: TName;\n control: Control<TFieldValues>;\n options: SelectOption[];\n rules?: any;\n defaultValue?: any;\n}\n\nexport function useSelectField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n control,\n options: _options,\n rules,\n defaultValue,\n}: UseSelectFieldProps<TFieldValues, TName>) {\n const {\n field,\n fieldState: { error, invalid },\n } = useController({\n name,\n control,\n rules,\n defaultValue,\n });\n\n const selectProps: Omit<SelectProps, \"options\"> = {\n value: field.value,\n onChange: (value) => field.onChange(value),\n isError: invalid,\n error: error?.message,\n };\n\n return {\n selectProps,\n field,\n error,\n invalid,\n };\n}\n","import { LucideIcon, Search, X } from \"lucide-react\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useDebounce } from \"../../hooks\";\nimport { Input } from \"../Input/Input\";\n\n// Generic interface for searchable entities\nexport interface SearchableEntity {\n id: string;\n [key: string]: any;\n}\n\ninterface SearchAutocompleteProps<T extends SearchableEntity> {\n onSelect: (id: string) => void;\n selectedId: string;\n searchFunction: (keyword: string) => Promise<T[]>;\n getEntityById?: (id: string) => Promise<T | undefined>;\n getDisplayValue: (entity: T) => string;\n getSecondaryText?: (entity: T) => string | null;\n placeholder: string;\n icon?: LucideIcon;\n disabled?: boolean;\n minSearchLength?: number;\n debounceTime?: number;\n error?: string;\n}\n\nexport function SearchAutocomplete<T extends SearchableEntity>({\n onSelect,\n selectedId,\n searchFunction,\n getEntityById,\n getDisplayValue,\n getSecondaryText,\n placeholder,\n icon = Search,\n disabled = false,\n minSearchLength = 2,\n debounceTime = 300,\n error,\n}: SearchAutocompleteProps<T>) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [entities, setEntities] = useState<T[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [showDropdown, setShowDropdown] = useState(false);\n const [selectedEntity, setSelectedEntity] = useState<T | null>(null);\n const [initialLoadDone, setInitialLoadDone] = useState(false);\n const [searchError, setSearchError] = useState<string | null>(null);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const debouncedSearchTerm = useDebounce(searchTerm, debounceTime);\n\n // Track if this is an initial load or a user-initiated search\n const isUserSearch = useRef(false);\n\n // Only fetch the selected entity by ID once on initial load\n useEffect(() => {\n const fetchSelectedEntity = async () => {\n // Only fetch if we have a selectedId, getEntityById function, and haven't loaded yet\n if (!selectedId || !getEntityById || initialLoadDone) return;\n\n setIsLoading(true);\n try {\n const entity = await getEntityById(selectedId);\n if (entity) {\n setSelectedEntity(entity);\n setSearchTerm(getDisplayValue(entity));\n }\n } catch (error) {\n console.error(\"Error fetching selected entity:\", error);\n } finally {\n setIsLoading(false);\n setInitialLoadDone(true);\n }\n };\n\n fetchSelectedEntity();\n }, [selectedId, getEntityById, getDisplayValue, initialLoadDone]);\n\n // Handle search term changes - only for user-initiated searches\n useEffect(() => {\n // Skip if this is just setting the initial value\n if (!isUserSearch.current) return;\n\n // Clear entities if search term is too short\n if (searchTerm.trim().length < minSearchLength) {\n setEntities([]);\n setSearchError(null);\n }\n }, [searchTerm, minSearchLength]);\n\n // Fetch entities when debounced search term changes - only for user searches\n useEffect(() => {\n const fetchEntities = async () => {\n if (\n !debouncedSearchTerm ||\n debouncedSearchTerm.length < minSearchLength\n ) {\n return;\n }\n\n setIsLoading(true);\n setSearchError(null);\n try {\n const results = await searchFunction(debouncedSearchTerm);\n setEntities(results);\n } catch (error) {\n console.error(\"Error fetching search results:\", error);\n setSearchError(\n error instanceof Error ? error.message : \"Search failed\"\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n // Only fetch if this is a user-initiated search\n if (isUserSearch.current) {\n fetchEntities();\n }\n }, [debouncedSearchTerm, searchFunction, minSearchLength]);\n\n // Handle click outside to close dropdown\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setShowDropdown(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, []);\n\n const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n\n // Mark this as a user-initiated search\n isUserSearch.current = true;\n\n setSearchTerm(value);\n\n if (selectedEntity) {\n setSelectedEntity(null);\n onSelect(\"\");\n }\n\n setShowDropdown(value.trim().length >= minSearchLength);\n };\n\n const handleEntitySelect = (entity: T) => {\n // This is a user selection, not an API fetch\n isUserSearch.current = false;\n\n console.log(`Selected entity with ID: ${entity.id}`);\n\n setSelectedEntity(entity);\n setSearchTerm(getDisplayValue(entity));\n onSelect(entity.id);\n setShowDropdown(false);\n };\n\n const handleClearSelection = () => {\n // This is a user action, but not a search\n isUserSearch.current = false;\n\n setSelectedEntity(null);\n setSearchTerm(\"\");\n onSelect(\"\");\n };\n\n return (\n <div className=\"relative\" ref={dropdownRef}>\n <div className=\"relative\">\n <Input\n type=\"text\"\n placeholder={`${placeholder} (min. ${minSearchLength} characters)`}\n value={selectedEntity ? \"\" : searchTerm}\n onChange={handleSearchChange}\n onFocus={() =>\n searchTerm.length >= minSearchLength &&\n isUserSearch.current &&\n setShowDropdown(true)\n }\n disabled={disabled}\n autoComplete=\"off\"\n name=\"search-autocomplete\"\n leftIcon={React.createElement(icon, { size: 16 })}\n />\n\n {selectedEntity && (\n <button\n type=\"button\"\n className=\"flex absolute inset-y-0 right-0 items-center pr-3\"\n onClick={handleClearSelection}\n disabled={disabled}\n >\n <X className=\"w-5 h-5 text-gray-400 hover:text-gray-500\" />\n </button>\n )}\n </div>\n\n {/* Selected Entity Display */}\n {selectedEntity && (\n <div className=\"p-4 mt-3 rounded-lg border bg-neutral-50 border-neutral-200\">\n <div className=\"flex justify-between items-center\">\n <div className=\"flex items-center\">\n {(selectedEntity as { photoUrl?: string }).photoUrl ? (\n <img\n src={(selectedEntity as { photoUrl?: string }).photoUrl!}\n alt={getDisplayValue(selectedEntity)}\n className=\"object-cover mr-3 w-10 h-10 rounded-full\"\n />\n ) : (\n React.createElement(icon, {\n className: \"w-10 h-10 text-neutral-400 mr-3\",\n })\n )}\n <div>\n <div className=\"font-medium text-neutral-900\">\n {getDisplayValue(selectedEntity)}\n </div>\n {getSecondaryText && getSecondaryText(selectedEntity) && (\n <div className=\"text-sm text-neutral-500\">\n {getSecondaryText(selectedEntity)}\n </div>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={handleClearSelection}\n className=\"transition-colors text-neutral-400 hover:text-neutral-600\"\n disabled={disabled}\n >\n <X className=\"w-4 h-4\" />\n </button>\n </div>\n </div>\n )}\n\n {showDropdown && entities?.length > 0 && (\n <div className=\"overflow-auto absolute z-10 mt-1 w-full max-h-60 bg-white rounded-md shadow-lg\">\n <ul className=\"py-1\">\n {entities.map((entity) => (\n <li\n key={entity.id}\n className=\"px-4 py-2 cursor-pointer hover:bg-gray-100\"\n onClick={() => handleEntitySelect(entity)}\n >\n <div className=\"flex items-center\">\n {React.createElement(icon, {\n className: \"w-4 h-4 text-gray-400\",\n })}\n <div className=\"ml-2\">\n <div className=\"font-medium\">{getDisplayValue(entity)}</div>\n {getSecondaryText && getSecondaryText(entity) && (\n <div className=\"text-xs text-gray-500\">\n {getSecondaryText(entity)}\n </div>\n )}\n </div>\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {showDropdown && searchError && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md border border-red-200 shadow-lg\">\n <div className=\"flex justify-center items-center\">\n <X className=\"mr-2 w-4 h-4\" />\n Error: {searchError}\n </div>\n </div>\n )}\n\n {showDropdown && error && !searchError && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-red-600 bg-white rounded-md border border-red-200 shadow-lg\">\n <div className=\"flex justify-center items-center\">\n <X className=\"mr-2 w-4 h-4\" />\n {error}\n </div>\n </div>\n )}\n\n {showDropdown &&\n debouncedSearchTerm &&\n entities?.length === 0 &&\n !isLoading &&\n !searchError &&\n !error && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg\">\n {debouncedSearchTerm.length < minSearchLength\n ? `Type at least ${minSearchLength} characters to search`\n : \"No results found. Try a different search term.\"}\n </div>\n )}\n\n {isLoading && showDropdown && (\n <div className=\"absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg\">\n <div className=\"flex justify-center items-center\">\n <div className=\"mr-2 w-4 h-4 rounded-full border-b-2 animate-spin border-ews-primary\"></div>\n Loading...\n </div>\n </div>\n )}\n </div>\n );\n}\n","import { Check, Search, X } from \"lucide-react\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useDebounce } from \"../../hooks\";\nimport { cn } from \"../../utils\";\nimport { Input } from \"../Input/Input\";\nimport { SearchableEntity } from \"../SearchAutocomplete/SearchAutocomplete\";\n\ninterface MultiSearchAutocompleteProps<T extends SearchableEntity> {\n items: T[];\n selectedItems: T[];\n onSelectionChange: (items: T[]) => void;\n onSearch: (searchTerm: string) => Promise<void>;\n getEntityById?: (id: string) => Promise<T | undefined>;\n getPrimaryText: (entity: T) => string;\n getSecondaryText?: (entity: T) => string | null;\n placeholder: string;\n disabled?: boolean;\n loading?: boolean;\n multiple?: boolean;\n className?: string;\n renderSelectedItem?: (entity: T) => React.ReactNode;\n renderListItem?: (entity: T, isSelected: boolean) => React.ReactNode;\n keepOpenOnSelect?: boolean;\n error?: string;\n minSearchLength?: number;\n debounceTime?: number;\n}\n\nexport function MultiSearchAutocomplete<T extends SearchableEntity>({\n items,\n selectedItems,\n onSelectionChange,\n onSearch,\n getEntityById: _getEntityById,\n getPrimaryText,\n getSecondaryText,\n placeholder,\n disabled = false,\n loading = false,\n multiple = true,\n className,\n renderSelectedItem,\n renderListItem,\n keepOpenOnSelect = true,\n error,\n minSearchLength = 2,\n debounceTime = 300,\n}: MultiSearchAutocompleteProps<T>) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [isOpen, setIsOpen] = useState(false);\n const [filteredItems, setFilteredItems] = useState<T[]>(items);\n const [isSearching, setIsSearching] = useState(false);\n const [searchError, setSearchError] = useState<string | null>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const debouncedSearchTerm = useDebounce(searchTerm, debounceTime);\n\n // Handle search term changes\n useEffect(() => {\n // If search term is empty, show all items\n if (!searchTerm.trim()) {\n setFilteredItems(items);\n setSearchError(null);\n return;\n }\n\n // If search term is too short, don't search\n if (searchTerm.length < minSearchLength) {\n setFilteredItems([]);\n setSearchError(null);\n return;\n }\n }, [searchTerm, items, minSearchLength]);\n\n // Debounced search with API calls\n useEffect(() => {\n // If debounced search term is empty or too short, don't search\n if (\n !debouncedSearchTerm.trim() ||\n debouncedSearchTerm.length < minSearchLength\n ) {\n return;\n }\n\n const performSearch = async () => {\n try {\n setIsSearching(true);\n setSearchError(null);\n await onSearch(debouncedSearchTerm);\n } catch (err) {\n setSearchError(err instanceof Error ? err.message : \"Search failed\");\n } finally {\n setIsSearching(false);\n }\n };\n\n performSearch();\n }, [debouncedSearchTerm, onSearch, minSearchLength]);\n\n // Update filtered items when items prop changes\n useEffect(() => {\n setFilteredItems(items);\n }, [items]);\n\n const handleItemToggle = useCallback(\n (item: T) => {\n if (multiple) {\n const isSelected = selectedItems.some(\n (selected) => selected.id === item.id\n );\n\n if (isSelected) {\n onSelectionChange(\n selectedItems.filter((selected) => selected.id !== item.id)\n );\n } else {\n onSelectionChange([...selectedItems, item]);\n }\n // Keep dropdown open for multiple selection\n if (keepOpenOnSelect) {\n setIsOpen(true);\n }\n } else {\n onSelectionChange([item]);\n setIsOpen(false);\n }\n },\n [selectedItems, onSelectionChange, multiple, keepOpenOnSelect]\n );\n\n const handleRemoveItem = useCallback(\n (itemToRemove: T) => {\n onSelectionChange(\n selectedItems.filter((item) => item.id !== itemToRemove.id)\n );\n },\n [selectedItems, onSelectionChange]\n );\n\n const handleInputFocus = () => {\n if (!disabled) {\n setIsOpen(true);\n }\n };\n\n const handleInputBlur = () => {\n // Don't close immediately to allow for clicks on dropdown items\n // Only close if keepOpenOnSelect is false\n if (!keepOpenOnSelect) {\n setTimeout(() => setIsOpen(false), 150);\n }\n };\n\n // Close dropdown when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false);\n }\n };\n\n const handleEscapeKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setIsOpen(false);\n }\n };\n\n if (isOpen) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscapeKey);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscapeKey);\n };\n }, [isOpen]);\n\n // Default render functions\n const defaultRenderSelectedItem = (entity: T) => (\n <span className=\"inline-flex items-center px-3 py-1 text-sm font-medium rounded-full bg-ews-primary/10 text-ews-primary border border-ews-primary/20\">\n {getPrimaryText(entity)}\n <button\n type=\"button\"\n onClick={() => handleRemoveItem(entity)}\n className=\"ml-2 text-ews-primary/60 hover:text-ews-primary\"\n disabled={disabled}\n title=\"Remove item\"\n >\n <X className=\"w-3 h-3\" />\n </button>\n </span>\n );\n\n const defaultRenderListItem = (entity: T, isSelected: boolean) => (\n <div className=\"flex items-center space-x-3\">\n <div\n className={cn(\n \"w-5 h-5 border-2 rounded flex items-center justify-center\",\n isSelected ? \"bg-ews-primary border-ews-primary\" : \"border-gray-300\"\n )}\n >\n {isSelected && <Check className=\"w-3 h-3 text-white\" />}\n </div>\n <div className=\"flex flex-col\">\n <span\n className={cn(\n \"font-medium\",\n isSelected ? \"text-ews-primary\" : \"text-gray-900\"\n )}\n >\n {getPrimaryText(entity)}\n </span>\n {getSecondaryText && (\n <span\n className={cn(\n \"text-sm\",\n isSelected ? \"text-ews-primary/70\" : \"text-gray-500\"\n )}\n >\n {getSecondaryText(entity)}\n </span>\n )}\n </div>\n </div>\n );\n\n return (\n <div className={cn(\"relative\", className)} ref={dropdownRef}>\n {/* Selected items display */}\n {selectedItems.length > 0 && (\n <div className=\"flex flex-wrap gap-2 mb-3\">\n {selectedItems.map((item) => (\n <div key={item.id}>\n {renderSelectedItem\n ? renderSelectedItem(item)\n : defaultRenderSelectedItem(item)}\n </div>\n ))}\n </div>\n )}\n\n {/* Search input */}\n <Input\n ref={inputRef}\n type=\"text\"\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n placeholder={placeholder}\n disabled={disabled}\n leftIcon={<Search className=\"w-4 h-4\" />}\n className=\"w-full\"\n />\n\n {/* Dropdown */}\n {isOpen && !disabled && (\n <div className=\"absolute z-10 mt-1 w-full max-h-60 bg-white rounded-lg border border-gray-200 shadow-lg overflow-auto\">\n {loading || isSearching ? (\n <div className=\"px-4 py-3 text-sm text-gray-500 flex items-center\">\n <div className=\"animate-spin rounded-full h-4 w-4 border-b-2 border-ews-primary mr-2\"></div>\n {isSearching ? \"Searching...\" : \"Loading...\"}\n </div>\n ) : searchError ? (\n <div className=\"px-4 py-3 text-sm text-red-600\">\n <div className=\"flex items-center\">\n <X className=\"w-4 h-4 mr-2\" />\n Error: {searchError}\n </div>\n </div>\n ) : error ? (\n <div className=\"px-4 py-3 text-sm text-red-600\">\n <div className=\"flex items-center\">\n <X className=\"w-4 h-4 mr-2\" />\n {error}\n </div>\n </div>\n ) : filteredItems.length === 0 ? (\n <div className=\"px-4 py-3 text-sm text-gray-500\">\n {searchTerm.length < minSearchLength\n ? `Type at least ${minSearchLength} characters to search`\n : \"No items found\"}\n </div>\n ) : (\n <div className=\"py-1\">\n {filteredItems.map((item) => {\n const isSelected = selectedItems.some(\n (selected) => selected.id === item.id\n );\n\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={() => handleItemToggle(item)}\n className={cn(\n \"w-full px-4 py-3 text-left flex items-center transition-colors\",\n isSelected\n ? \"bg-ews-primary/10 text-ews-primary border-l-4 border-ews-primary\"\n : \"hover:bg-ews-primary/5 text-gray-900\"\n )}\n >\n {renderListItem\n ? renderListItem(item, isSelected)\n : defaultRenderListItem(item, isSelected)}\n </button>\n );\n })}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import { AlertCircle, AlertTriangle, CheckCircle, X } from \"lucide-react\";\nimport React, { useEffect } from \"react\";\nimport { cn } from \"../../utils\";\nimport { Button } from \"../Button/Button\";\n\nexport interface ErrorField {\n name: string;\n message: string;\n path?: string;\n}\n\nexport interface ErrorObject {\n code: string;\n message: string;\n fields?: ErrorField[];\n}\n\nexport interface ModalProps {\n /**\n * Whether the modal is open\n */\n isOpen: boolean;\n /**\n * Function to call when modal should be closed\n */\n onClose: () => void;\n /**\n * Modal title\n */\n title: string;\n /**\n * Modal content/description\n */\n children?: React.ReactNode;\n /**\n * Modal variant\n */\n variant?: \"error\" | \"warning\" | \"confirmation\" | \"info\";\n /**\n * Primary action button text\n */\n primaryAction?: string;\n /**\n * Secondary action button text\n */\n secondaryAction?: string;\n /**\n * Function to call when primary action is clicked\n */\n onPrimaryAction?: () => void;\n /**\n * Function to call when secondary action is clicked\n */\n onSecondaryAction?: () => void;\n /**\n * Whether the primary action button is loading\n */\n isLoading?: boolean;\n /**\n * Whether the modal can be closed by clicking outside or pressing escape\n */\n closeOnOverlayClick?: boolean;\n /**\n * Custom className for the modal\n */\n className?: string;\n /**\n * Custom className for the content\n */\n contentClassName?: string;\n /**\n * Error object for error modals\n */\n error?: ErrorObject;\n}\n\nconst Modal = ({\n isOpen,\n onClose,\n title,\n children,\n variant = \"info\",\n primaryAction,\n secondaryAction,\n onPrimaryAction,\n onSecondaryAction,\n isLoading = false,\n closeOnOverlayClick = true,\n className,\n contentClassName,\n error,\n}: ModalProps) => {\n // Handle escape key press\n useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isOpen) {\n onClose();\n }\n };\n\n if (isOpen) {\n document.addEventListener(\"keydown\", handleEscape);\n // Prevent body scroll when modal is open\n document.body.style.overflow = \"hidden\";\n }\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.body.style.overflow = \"unset\";\n };\n }, [isOpen, onClose]);\n\n if (!isOpen) return null;\n\n const getVariantStyles = () => {\n switch (variant) {\n case \"error\":\n return {\n icon: <AlertCircle className=\"w-6 h-6 text-ews-error\" />,\n iconBg: \"bg-ews-error/10\",\n titleColor: \"text-ews-error\",\n borderColor: \"border-ews-error/20\",\n };\n case \"warning\":\n return {\n icon: <AlertTriangle className=\"w-6 h-6 text-ews-warning\" />,\n iconBg: \"bg-ews-warning/10\",\n titleColor: \"text-ews-warning\",\n borderColor: \"border-ews-warning/20\",\n };\n case \"confirmation\":\n return {\n icon: <CheckCircle className=\"w-6 h-6 text-ews-success\" />,\n iconBg: \"bg-ews-success/10\",\n titleColor: \"text-ews-success\",\n borderColor: \"border-ews-success/20\",\n };\n default:\n return {\n icon: <AlertCircle className=\"w-6 h-6 text-ews-primary\" />,\n iconBg: \"bg-ews-primary/10\",\n titleColor: \"text-ews-primary\",\n borderColor: \"border-ews-primary/20\",\n };\n }\n };\n\n const variantStyles = getVariantStyles();\n\n const handleOverlayClick = (e: React.MouseEvent) => {\n if (e.target === e.currentTarget && closeOnOverlayClick) {\n onClose();\n }\n };\n\n return (\n <div className=\"flex fixed inset-0 z-50 justify-center items-center\">\n {/* Backdrop */}\n <div\n className=\"absolute inset-0 backdrop-blur-sm bg-black/50\"\n onClick={handleOverlayClick}\n />\n\n {/* Modal */}\n <div\n className={cn(\n \"relative mx-4 w-full max-w-md bg-white rounded-lg shadow-xl transition-all transform\",\n \"duration-200 animate-in fade-in-0 zoom-in-95\",\n className\n )}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"modal-title\"\n >\n {/* Header */}\n <div\n className={cn(\n \"flex items-center justify-between p-6 border-b\",\n variantStyles.borderColor\n )}\n >\n <div className=\"flex items-center space-x-3\">\n <div className={cn(\"p-2 rounded-full\", variantStyles.iconBg)}>\n {variantStyles.icon}\n </div>\n <h2\n id=\"modal-title\"\n className={cn(\"text-lg font-semibold\", variantStyles.titleColor)}\n >\n {title}\n </h2>\n </div>\n <button\n onClick={onClose}\n className=\"p-1 text-gray-400 transition-colors hover:text-gray-600\"\n aria-label=\"Close modal\"\n >\n <X className=\"w-5 h-5\" />\n </button>\n </div>\n\n {/* Content */}\n <div className={cn(\"p-6\", contentClassName)}>\n <div className=\"leading-relaxed text-gray-700\">\n {error && variant === \"error\" ? (\n <div className=\"space-y-3\">\n <p>{error.message}</p>\n {error.fields && error.fields.length > 0 && (\n <div>\n <p className=\"font-semibold text-gray-900\">\n Erreurs de champ:\n </p>\n <ul className=\"mt-2 space-y-1\">\n {error.fields.map((field, index) => (\n <li key={index} className=\"text-ews-error\">\n • {field.path}: {field.message}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n ) : (\n children\n )}\n </div>\n </div>\n\n {/* Actions */}\n {(primaryAction || secondaryAction) && (\n <div className=\"flex justify-end items-center p-6 pt-0 space-x-3\">\n {secondaryAction && (\n <Button\n variant=\"ghost\"\n onClick={onSecondaryAction || onClose}\n disabled={isLoading}\n >\n {secondaryAction}\n </Button>\n )}\n {primaryAction && (\n <Button\n variant={variant === \"error\" ? \"error\" : \"primary\"}\n onClick={onPrimaryAction}\n loading={isLoading}\n >\n {primaryAction}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport { Modal };\n","import { cn } from \"../../utils\";\n\nexport interface LogoProps {\n /**\n * Logo size\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n /**\n * Whether to show the tagline\n */\n showTagline?: boolean;\n /**\n * Whether to show only the icon (favicon version)\n */\n iconOnly?: boolean;\n /**\n * Logo variant - normal, white, or favicon\n */\n variant?: \"normal\" | \"white\" | \"fullWhite\" | \"favicon\";\n /**\n * Custom className\n */\n className?: string;\n /**\n * Click handler\n */\n onClick?: () => void;\n}\n\nconst Logo = ({\n size = \"md\",\n showTagline: _showTagline = true,\n iconOnly = false,\n variant = \"normal\",\n className,\n onClick,\n}: LogoProps) => {\n const sizes = {\n sm: \"h-8\",\n md: \"h-12\",\n lg: \"h-16\",\n xl: \"h-24\",\n };\n\n const iconSizes = {\n sm: \"h-6 w-6\",\n md: \"h-8 w-8\",\n lg: \"h-12 w-12\",\n xl: \"h-16 w-16\",\n };\n\n // Get the appropriate logo image based on variant\n // For iconOnly, always use favicon.ico\n const logoSrc = iconOnly\n ? \"/favicon.ico\"\n : variant === \"white\"\n ? \"/image/logoWhite.png\"\n : variant === \"fullWhite\"\n ? \"/image/logoFullWhite.png\"\n : variant === \"favicon\"\n ? \"/favicon.ico\"\n : \"/image/logo.png\";\n\n if (iconOnly) {\n return (\n <div\n className={cn(\n \"flex items-center justify-center\",\n iconSizes[size],\n className\n )}\n onClick={onClick}\n role={onClick ? \"button\" : undefined}\n tabIndex={onClick ? 0 : undefined}\n >\n <img\n src={logoSrc}\n alt=\"MEDECINE 360 Logo\"\n className=\"w-full h-full object-contain\"\n />\n </div>\n );\n }\n\n return (\n <div\n className={cn(\"flex items-center\", sizes[size], className)}\n onClick={onClick}\n role={onClick ? \"button\" : undefined}\n tabIndex={onClick ? 0 : undefined}\n >\n {/* Logo Image */}\n <img\n src={logoSrc}\n alt=\"MEDECINE 360 Logo\"\n className=\"h-full w-auto object-contain\"\n />\n </div>\n );\n};\n\nexport { Logo };\n","import { ThemeConfig } from \"../types/theme\";\n\nexport const PROMED_THEME: ThemeConfig = {\n name: \"PROMED\",\n colors: {\n primary: \"#21596C\",\n secondary: \"#3BA1A1\",\n primaryHover: \"#1a4756\",\n secondaryHover: \"#308181\",\n primaryLight: \"#c0d0d4\",\n success: \"#059669\",\n successHover: \"#047857\",\n warning: \"#d97706\",\n warningHover: \"#b45309\",\n error: \"#dc2626\",\n errorHover: \"#b91c1c\",\n },\n};\n\nexport const MED_THEME: ThemeConfig = {\n name: \"MED\",\n colors: {\n primary: \"#3BA1A1\", // Teal for patients (calming, trustworthy)\n secondary: \"#6B73FF\", // Soft purple-blue (suggested secondary for MED)\n primaryHover: \"#308181\",\n secondaryHover: \"#5a61e6\",\n primaryLight: \"#a8d5d5\",\n success: \"#059669\",\n successHover: \"#047857\",\n warning: \"#d97706\",\n warningHover: \"#b45309\",\n error: \"#dc2626\",\n errorHover: \"#b91c1c\",\n },\n};\n\nexport const THEMES = {\n PROMED: PROMED_THEME,\n MED: MED_THEME,\n} as const;\n","import React, {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useState,\n} from \"react\";\nimport { Theme, ThemeContextType } from \"../types/theme\";\nimport { THEMES } from \"./themeConfig\";\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n children: ReactNode;\n defaultTheme?: Theme;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n children,\n defaultTheme = \"PROMED\",\n}) => {\n const [theme, setTheme] = useState<Theme>(defaultTheme);\n const [themeConfig, setThemeConfig] = useState(THEMES[defaultTheme]);\n\n // Update theme config when theme changes\n useEffect(() => {\n setThemeConfig(THEMES[theme]);\n\n // Update data-theme attribute for CSS variable switching\n const root = document.documentElement;\n root.setAttribute(\"data-theme\", theme);\n\n // Also update CSS custom properties for backward compatibility\n const colors = THEMES[theme].colors;\n root.style.setProperty(\"--ews-primary\", colors.primary);\n root.style.setProperty(\"--ews-primary-hover\", colors.primaryHover);\n root.style.setProperty(\"--ews-primary-light\", colors.primaryLight);\n root.style.setProperty(\"--ews-secondary\", colors.secondary);\n root.style.setProperty(\"--ews-secondary-hover\", colors.secondaryHover);\n root.style.setProperty(\"--ews-success\", colors.success);\n root.style.setProperty(\"--ews-success-hover\", colors.successHover);\n root.style.setProperty(\"--ews-warning\", colors.warning);\n root.style.setProperty(\"--ews-warning-hover\", colors.warningHover);\n root.style.setProperty(\"--ews-error\", colors.error);\n root.style.setProperty(\"--ews-error-hover\", colors.errorHover);\n }, [theme]);\n\n const handleSetTheme = (newTheme: Theme) => {\n setTheme(newTheme);\n };\n\n const value: ThemeContextType = {\n theme,\n setTheme: handleSetTheme,\n themeConfig,\n };\n\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n return context;\n};\n","import React from \"react\";\nimport { useTheme } from \"../../theme/ThemeProvider\";\nimport { Theme } from \"../../types/theme\";\n\nexport interface ThemeToggleProps {\n className?: string;\n}\n\nexport const ThemeToggle: React.FC<ThemeToggleProps> = ({ className }) => {\n const { theme, setTheme } = useTheme();\n\n const handleThemeChange = (newTheme: Theme) => {\n setTheme(newTheme);\n };\n\n return (\n <div className={`flex items-center space-x-2 ${className || \"\"}`}>\n <span className=\"text-sm font-medium text-gray-700\">Theme:</span>\n <div className=\"flex bg-gray-100 rounded-lg p-1\">\n <button\n onClick={() => handleThemeChange(\"PROMED\")}\n className={`px-3 py-1 text-xs font-medium rounded-md transition-colors ${\n theme === \"PROMED\"\n ? \"bg-ews-primary text-white\"\n : \"text-gray-600 hover:text-gray-900\"\n }`}\n >\n PROMED\n </button>\n <button\n onClick={() => handleThemeChange(\"MED\")}\n className={`px-3 py-1 text-xs font-medium rounded-md transition-colors ${\n theme === \"MED\"\n ? \"bg-ews-primary text-white\"\n : \"text-gray-600 hover:text-gray-900\"\n }`}\n >\n MED\n </button>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport { useTheme } from \"../../theme/ThemeProvider\";\n\nexport interface ThemeDebuggerProps {\n className?: string;\n}\n\nexport const ThemeDebugger: React.FC<ThemeDebuggerProps> = ({\n className = \"\",\n}) => {\n const { theme, themeConfig, setTheme } = useTheme();\n\n const getComputedStyleValue = (property: string) => {\n if (typeof window !== \"undefined\") {\n return getComputedStyle(document.documentElement).getPropertyValue(\n property\n );\n }\n return \"N/A\";\n };\n\n return (\n <div className={`p-4 border rounded-lg bg-gray-50 ${className}`}>\n <h3 className=\"text-lg font-semibold mb-4\">Theme Debugger</h3>\n\n <div className=\"space-y-3\">\n <div>\n <strong>Current Theme:</strong> {theme}\n </div>\n\n <div>\n <strong>Theme Config:</strong>\n <pre className=\"text-xs bg-gray-100 p-2 rounded mt-1\">\n {JSON.stringify(themeConfig, null, 2)}\n </pre>\n </div>\n\n <div>\n <strong>CSS Variables:</strong>\n <div className=\"text-xs space-y-1 mt-1\">\n <div>--ews-primary: {getComputedStyleValue(\"--ews-primary\")}</div>\n <div>\n --ews-secondary: {getComputedStyleValue(\"--ews-secondary\")}\n </div>\n <div>\n --ews-primary-hover:{\" \"}\n {getComputedStyleValue(\"--ews-primary-hover\")}\n </div>\n <div>\n --ews-secondary-hover:{\" \"}\n {getComputedStyleValue(\"--ews-secondary-hover\")}\n </div>\n </div>\n </div>\n\n <div>\n <strong>Data Theme Attribute:</strong>{\" \"}\n {document.documentElement.getAttribute(\"data-theme\")}\n </div>\n\n <div className=\"flex space-x-2\">\n <button\n onClick={() => setTheme(\"PROMED\")}\n className={`px-3 py-1 text-xs rounded ${\n theme === \"PROMED\"\n ? \"bg-ews-primary text-white\"\n : \"bg-gray-200 text-gray-700\"\n }`}\n >\n PROMED\n </button>\n <button\n onClick={() => setTheme(\"MED\")}\n className={`px-3 py-1 text-xs rounded ${\n theme === \"MED\"\n ? \"bg-ews-primary text-white\"\n : \"bg-gray-200 text-gray-700\"\n }`}\n >\n MED\n </button>\n </div>\n\n <div className=\"grid grid-cols-2 gap-2 mt-4\">\n <div className=\"bg-ews-primary text-white p-2 rounded text-center\">\n Primary\n </div>\n <div className=\"bg-ews-secondary text-white p-2 rounded text-center\">\n Secondary\n </div>\n <div className=\"bg-ews-success text-white p-2 rounded text-center\">\n Success\n </div>\n <div className=\"bg-ews-warning text-white p-2 rounded text-center\">\n Warning\n </div>\n </div>\n </div>\n </div>\n );\n};\n","import { Stethoscope } from \"lucide-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { MultiSearchAutocomplete } from \"../../components/MultiSearchAutocomplete\";\nimport { cn } from \"../../utils\";\n\nexport interface Specialty {\n id: string;\n code: string;\n label: string;\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface SpecialtySearchAutocompleteProps {\n selectedSpecialties: Specialty[];\n onSpecialtiesChange: (specialties: Specialty[]) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n maxSelections?: number;\n showSelectedCount?: boolean;\n}\n\nexport const SpecialtySearchAutocomplete: React.FC<\n SpecialtySearchAutocompleteProps\n> = ({\n selectedSpecialties = [],\n onSpecialtiesChange,\n placeholder = \"Search and select medical specialties...\",\n className = \"\",\n disabled = false,\n maxSelections,\n showSelectedCount = true,\n}) => {\n const [specialties, setSpecialties] = useState<Specialty[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n // Mock API call - replace with actual API\n const fetchSpecialties = useCallback(async (searchTerm: string) => {\n setIsLoading(true);\n try {\n // Simulate API delay\n await new Promise((resolve) => setTimeout(resolve, 300));\n\n // Mock data - replace with actual API call\n const mockSpecialties: Specialty[] = [\n { id: \"1\", code: \"CARD\", label: \"Cardiology\" },\n { id: \"2\", code: \"DERM\", label: \"Dermatology\" },\n { id: \"3\", code: \"ENDO\", label: \"Endocrinology\" },\n { id: \"4\", code: \"GAST\", label: \"Gastroenterology\" },\n { id: \"5\", code: \"HEMA\", label: \"Hematology\" },\n { id: \"6\", code: \"NEUR\", label: \"Neurology\" },\n { id: \"7\", code: \"ONCO\", label: \"Oncology\" },\n { id: \"8\", code: \"ORTH\", label: \"Orthopedics\" },\n { id: \"9\", code: \"PED\", label: \"Pediatrics\" },\n { id: \"10\", code: \"PSYC\", label: \"Psychiatry\" },\n { id: \"11\", code: \"RAD\", label: \"Radiology\" },\n { id: \"12\", code: \"SURG\", label: \"Surgery\" },\n { id: \"13\", code: \"UROL\", label: \"Urology\" },\n { id: \"14\", code: \"GYN\", label: \"Gynecology\" },\n { id: \"15\", code: \"OPHT\", label: \"Ophthalmology\" },\n ];\n\n // Filter based on search term\n const filtered = mockSpecialties.filter(\n (specialty) =>\n specialty.label.toLowerCase().includes(searchTerm.toLowerCase()) ||\n specialty.code.toLowerCase().includes(searchTerm.toLowerCase())\n );\n\n setSpecialties(filtered);\n } catch (error) {\n console.error(\"Error fetching specialties:\", error);\n setSpecialties([]);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n // Initial load\n useEffect(() => {\n fetchSpecialties(\"\");\n }, [fetchSpecialties]);\n\n const handleSelectionChange = useCallback(\n (items: Specialty[]) => {\n // Check max selections limit\n if (maxSelections && items.length > maxSelections) {\n return; // Don't update if exceeding max selections\n }\n onSpecialtiesChange(items);\n },\n [onSpecialtiesChange, maxSelections]\n );\n\n const getEntityById = useCallback(\n async (id: string): Promise<Specialty | undefined> => {\n return specialties.find((specialty) => specialty.id === id);\n },\n [specialties]\n );\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {/* Header with title and icon */}\n <div className=\"flex items-center space-x-2\">\n <div className=\"flex justify-center items-center w-8 h-8 rounded-lg bg-secondary-100\">\n <Stethoscope className=\"w-4 h-4 text-secondary-600\" />\n </div>\n <h3 className=\"text-lg font-semibold text-gray-900\">\n Medical Specialties\n </h3>\n </div>\n\n {/* Label */}\n <div>\n <label className=\"block text-sm font-medium text-gray-700 mb-2\">\n Select Specialties\n </label>\n </div>\n\n {/* MultiSearchAutocomplete component */}\n <MultiSearchAutocomplete<Specialty>\n items={specialties}\n selectedItems={selectedSpecialties}\n onSelectionChange={handleSelectionChange}\n onSearch={fetchSpecialties}\n getEntityById={getEntityById}\n getPrimaryText={(specialty) => specialty.label}\n getSecondaryText={(specialty) => specialty.code}\n placeholder={placeholder}\n disabled={disabled}\n loading={isLoading}\n multiple={true}\n keepOpenOnSelect={true}\n className=\"w-full\"\n renderSelectedItem={(specialty) => (\n <span className=\"inline-flex items-center px-3 py-1 text-sm font-medium rounded-full bg-ews-primary/10 text-ews-primary border border-ews-primary/20\">\n {specialty.label}\n </span>\n )}\n renderListItem={(specialty, isSelected) => (\n <div className=\"flex items-center space-x-3\">\n <div\n className={cn(\n \"w-5 h-5 border-2 rounded flex items-center justify-center\",\n isSelected\n ? \"bg-ews-primary border-ews-primary\"\n : \"border-gray-300\"\n )}\n >\n {isSelected && (\n <svg\n className=\"w-3 h-3 text-white\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n />\n </svg>\n )}\n </div>\n <div className=\"flex flex-col\">\n <span\n className={cn(\n \"font-medium\",\n isSelected ? \"text-ews-primary\" : \"text-gray-900\"\n )}\n >\n {specialty.label}\n </span>\n <span\n className={cn(\n \"text-sm\",\n isSelected ? \"text-ews-primary/70\" : \"text-gray-500\"\n )}\n >\n {specialty.code}\n </span>\n </div>\n </div>\n )}\n />\n\n {/* Selected count display */}\n {showSelectedCount && selectedSpecialties.length > 0 && (\n <div className=\"flex items-center justify-between text-sm text-gray-600\">\n <span>\n {selectedSpecialties.length} specialty\n {selectedSpecialties.length !== 1 ? \"ies\" : \"\"} selected\n </span>\n {maxSelections && (\n <span className=\"text-gray-400\">\n {selectedSpecialties.length}/{maxSelections}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n"],"names":["_jsxs","_js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