akeyless-client-commons 1.0.1
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/index.d.mts +17 -0
- package/dist/assets/index.d.ts +17 -0
- package/dist/assets/index.js +334 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/index.mjs +248 -0
- package/dist/assets/index.mjs.map +1 -0
- package/dist/components/index.css +1815 -0
- package/dist/components/index.css.map +1 -0
- package/dist/components/index.d.mts +511 -0
- package/dist/components/index.d.ts +511 -0
- package/dist/components/index.js +5663 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +5423 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/helpers/index.d.mts +207 -0
- package/dist/helpers/index.d.ts +207 -0
- package/dist/helpers/index.js +1858 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/index.mjs +1494 -0
- package/dist/helpers/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +35 -0
- package/dist/hooks/index.d.ts +35 -0
- package/dist/hooks/index.js +592 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +496 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/types/index.d.mts +265 -0
- package/dist/types/index.d.ts +265 -0
- package/dist/types/index.js +49 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["c:\\work\\akeyless\\commons\\client_commons\\dist\\components\\index.js"],"names":[],"mappings":"","sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/components/index.tsx\nvar components_exports = {};\n__export(components_exports, {\n Badge: () => Badge,\n BooleanUi: () => BooleanUi,\n Button: () => Button,\n Checkbox: () => Checkbox,\n CodeInput: () => CodeInput,\n ConfirmForm: () => ConfirmForm,\n DatePicker: () => DatePicker,\n DurationUI: () => DurationUI,\n ElementLabel: () => ElementLabel,\n ErrorBoundary: () => ErrorBoundary,\n ExportToExcel: () => ExportToExcel,\n Filter: () => Filter,\n GeoUi: () => GeoUi,\n Input: () => Input,\n InputContainer: () => InputContainer,\n InternationalPhonePicker: () => InternationalPhonePicker,\n Loader: () => Loader,\n MaxRowsLabel: () => MaxRowsLabel,\n ModularForm: () => ModularForm_default,\n MultiSelect: () => MultiSelect,\n NumberUI: () => NumberUI,\n PhoneUI: () => PhoneUI,\n ProgressComponent: () => ProgressComponent,\n Search: () => Search,\n SelectContainer: () => SelectContainer,\n Summary: () => Summary,\n Table: () => Table,\n TableBody: () => TableBody,\n TableButton: () => TableButton,\n TableCell: () => TableCell,\n TableContext: () => TableContext,\n TableHead: () => TableHead,\n TableProvider: () => TableProvider,\n TableRow: () => TableRow2,\n TextAreaContainer: () => TextAreaContainer,\n TimesUI: () => TimesUI,\n Version: () => Version,\n badgeVariants: () => badgeVariants,\n buttonVariants: () => buttonVariants,\n getFixedNumber: () => getFixedNumber,\n useDebounce: () => useDebounce\n});\nmodule.exports = __toCommonJS(components_exports);\n\n// src/components/utils/Checkboxes.tsx\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar Checkbox = ({ id, checked, setChecked, rotate = true, style }) => {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(\"div\", { className: \"checkbox-wrapper-51\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"input\", { type: \"checkbox\", id, className: \"hidden\", checked, onChange: () => setChecked(!checked) }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(\"label\", { htmlFor: id, className: \"relative block w-[42px] h-[24px] cursor-pointer transform-gpu\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\n \"div\",\n {\n className: `relative top-[1px] left-[1px] w-[40px] h-[22px] rounded-[12px] transition-colors duration-200 ease-in-out ${checked ? \"bg-[#52d66b]\" : \"bg-[#c8ccd4]\"}`\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\n \"span\",\n {\n className: `absolute ${rotate ? \"left-0\" : \"right-0\"} top-0 w-[24px] h-[24px] bg-white rounded-full shadow-md transition-transform duration-200 ease-in-out ${checked ? rotate ? \"translate-x-[18px]\" : \"-translate-x-[18px]\" : \"\"}`,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"svg\", { width: \"10px\", height: \"10px\", viewBox: \"0 0 10 10\", className: \"m-[7px] fill-none\", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\n \"path\",\n {\n d: \"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n className: \"transition-all duration-500 linear\",\n stroke: checked ? \"#52d66b\" : \"#c8ccd4\",\n style: {\n strokeDasharray: checked ? \"25\" : \"24\",\n strokeDashoffset: checked ? \"25\" : \"0\"\n }\n }\n ) })\n }\n )\n ] })\n ] });\n};\n\n// src/components/utils/ErrorBoundary.tsx\nvar import_react = __toESM(require(\"react\"));\nvar import_jsx_runtime2 = require(\"react/jsx-runtime\");\nvar ErrorBoundary = class extends import_react.default.Component {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: null,\n errorInfo: null\n };\n }\n static getDerivedStateFromError(error) {\n return {\n hasError: true,\n error\n };\n }\n componentDidCatch(error, errorInfo) {\n console.error(\"Error:\", error);\n console.log(\"Error Info:\", errorInfo);\n this.setState({ errorInfo });\n }\n render() {\n if (this.state.hasError) {\n return this.props.fallback || /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(\"div\", { className: \"full center\", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(\"h1\", { children: \"\\u05DE\\u05E9\\u05D4\\u05D5 \\u05D4\\u05E9\\u05EA\\u05D1\\u05E9....\" }) });\n }\n return this.props.children;\n }\n};\n\n// src/components/utils/loaders.tsx\nvar import_react_spinners = require(\"react-spinners\");\nvar import_jsx_runtime3 = require(\"react/jsx-runtime\");\nvar Loader = ({ color, size, style = {}, className = \"\" }) => {\n return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(\"div\", { className: `flex items-center justify-center ${className}`, style, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_spinners.ClipLoader, { loading: true, color: color || \"#699A2C\", size: size || 18 }) });\n};\n\n// src/lib/utils.ts\nvar import_clsx = require(\"clsx\");\nvar import_tailwind_merge = require(\"tailwind-merge\");\nfunction cn(...inputs) {\n return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));\n}\n\n// src/components/utils/global.tsx\nvar import_jsx_runtime4 = require(\"react/jsx-runtime\");\nvar Version = ({ version, className = \"\" }) => {\n return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(\"div\", { className: cn(\"absolute text-black z-30 bottom-[0px] text-xs right-0 px-1 \", className), children: [\n \"v\",\n version\n ] });\n};\n\n// src/components/table/components.tsx\nvar import_exceljs = __toESM(require(\"exceljs\"));\nvar import_file_saver = require(\"file-saver\");\nvar import_react5 = require(\"react\");\n\n// src/assets/svg.tsx\nvar import_jsx_runtime5 = require(\"react/jsx-runtime\");\nvar RedXSvg = ({ height, width, viewBox }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"32\", height: height || \"32\", viewBox: viewBox || \"0 0 32 32\", fill: \"none\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\n \"path\",\n {\n d: \"M21.0801 10.3C20.6101 9.80996 19.8301 9.79996 19.3401 10.27L15.6101 13.89L11.8801 10.27C11.3901 9.79996 10.6101 9.80996 10.1401 10.3C9.67008 10.79 9.68008 11.57 10.1701 12.04L13.8501 15.61L10.1701 19.18C9.68008 19.65 9.67008 20.43 10.1401 20.92C10.6101 21.41 11.3901 21.42 11.8801 20.95L15.6101 17.33L19.3401 20.95C19.5701 21.17 19.8801 21.3 20.2001 21.3C20.8801 21.29 21.4301 20.73 21.4201 20.04C21.4201 19.72 21.2901 19.41 21.0601 19.19L17.3801 15.62L21.0601 12.05C21.5501 11.58 21.5601 10.8 21.0901 10.31L21.0801 10.3Z\",\n fill: \"#FF4C2B\"\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\n \"path\",\n {\n d: \"M15.61 0C6.99 0 0 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z\",\n fill: \"#FF4C2B\"\n }\n )\n] });\nvar RedXSvg2 = ({ height, width, viewBox }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"18px\", height: height || \"18px\", viewBox: viewBox || \"0,0,256,256\", fillRule: \"nonzero\", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\n \"g\",\n {\n fill: \"#e90404\",\n fillRule: \"nonzero\",\n stroke: \"none\",\n strokeWidth: \"1\",\n children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\"g\", { transform: \"scale(10.66667,10.66667)\", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\"path\", { d: \"M4.99023,3.99023c-0.40692,0.00011 -0.77321,0.24676 -0.92633,0.62377c-0.15312,0.37701 -0.06255,0.80921 0.22907,1.09303l6.29297,6.29297l-6.29297,6.29297c-0.26124,0.25082 -0.36647,0.62327 -0.27511,0.97371c0.09136,0.35044 0.36503,0.62411 0.71547,0.71547c0.35044,0.09136 0.72289,-0.01388 0.97371,-0.27511l6.29297,-6.29297l6.29297,6.29297c0.25082,0.26124 0.62327,0.36648 0.97371,0.27512c0.35044,-0.09136 0.62411,-0.36503 0.71547,-0.71547c0.09136,-0.35044 -0.01388,-0.72289 -0.27512,-0.97371l-6.29297,-6.29297l6.29297,-6.29297c0.29576,-0.28749 0.38469,-0.72707 0.22393,-1.10691c-0.16075,-0.37985 -0.53821,-0.62204 -0.9505,-0.60988c-0.2598,0.00774 -0.50638,0.11632 -0.6875,0.30273l-6.29297,6.29297l-6.29297,-6.29297c-0.18827,-0.19353 -0.4468,-0.30272 -0.7168,-0.30273z\" }) })\n }\n) });\nvar GreenVSvg = ({ height, width, viewBox }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: width || \"32\", height: height || \"32\", viewBox: viewBox || \"0 0 32 32\", fill: \"none\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\n \"path\",\n {\n d: \"M15.61 0C6.99 0 0.01 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z\",\n fill: \"#3B8F08\"\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(\n \"path\",\n {\n d: \"M21.66 10.15L13.37 18.44L9.58003 14.54C9.10003 14.06 8.32003 14.07 7.84003 14.54C7.38003 15.01 7.36003 15.76 7.82003 16.24L12.48 21.03C12.96 21.52 13.74 21.52 14.23 21.05L23.41 11.87C23.88 11.38 23.87 10.6 23.38 10.13C22.9 9.67003 22.15 9.67003 21.68 10.13L21.66 10.15Z\",\n fill: \"#3B8F08\"\n }\n )\n] });\n\n// src/assets/table.tsx\nvar import_jsx_runtime6 = require(\"react/jsx-runtime\");\nvar sortSvg = (upside_down) => {\n return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\n \"svg\",\n {\n style: upside_down ? { transform: \"rotate(180deg)\" } : {},\n className: \"absolute top-[3px] left-1\",\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 1536.000000 1536.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\"g\", { transform: \"translate(0.000000,1536.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M6465 15350 c3 -5 -27 -25 -68 -44 -40 -19 -103 -57 -140 -86 -37 -28 -584 -569 -1215 -1203 -631 -633 -1699 -1705 -2374 -2382 -674 -676 -1237 -1243 -1249 -1260 -13 -16 -37 -46 -53 -65 -36 -41 -108 -185 -126 -250 -32 -119 -30 -352 3 -465 35 -120 102 -231 197 -325 132 -133 288 -208 479 -231 214 -26 418 31 596 166 39 29 703 685 1477 1458 774 772 1432 1421 1461 1441 105 73 239 71 347 -3 52 -36 70 -57 107 -131 17 -33 18 -252 24 -4710 6 -4979 3 -4715 49 -4855 118 -363 507 -605 876 -545 77 13 201 53 245 79 19 12 45 26 59 31 41 18 157 119 206 179 43 53 113 173 127 217 3 11 16 51 29 89 l22 70 6 4690 c5 4887 4 4736 43 4784 6 7 16 23 22 34 20 42 116 103 188 120 42 10 75 13 85 8 10 -5 34 -11 55 -15 20 -4 59 -21 85 -38 26 -17 686 -671 1467 -1453 781 -782 1443 -1439 1470 -1459 68 -49 178 -106 245 -128 30 -10 100 -24 155 -32 87 -12 114 -12 200 1 128 18 187 39 360 131 37 19 178 162 211 212 36 56 94 176 94 194 0 7 7 31 16 52 23 55 23 352 0 406 -9 21 -16 46 -16 56 0 30 -83 185 -130 242 -80 98 -4793 4810 -4865 4865 -66 50 -182 111 -250 132 -16 5 -29 15 -27 21 1 9 -62 12 -249 12 -157 0 -248 -4 -244 -10z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n );\n};\nvar emptyFilterSvg = (solid) => {\n return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: solid ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M382 8980 c-7 -11 -19 -20 -27 -20 -46 0 -166 -99 -196 -162 -46 -95 -51 -115 -47 -199 3 -70 9 -95 37 -149 42 -85 45 -90 118 -190 34 -47 72 -98 83 -115 12 -16 50 -70 85 -120 143 -200 188 -263 235 -330 27 -38 56 -79 64 -90 8 -11 46 -65 85 -120 38 -55 96 -136 128 -179 32 -44 60 -84 62 -90 2 -6 32 -48 65 -93 34 -45 99 -137 146 -203 47 -66 113 -159 148 -205 34 -46 62 -87 62 -90 0 -4 20 -33 45 -65 25 -32 45 -61 45 -64 0 -3 33 -50 73 -105 39 -54 106 -146 147 -205 41 -58 103 -144 138 -191 34 -46 62 -87 62 -90 0 -3 22 -36 50 -73 27 -37 61 -83 75 -102 14 -19 59 -82 100 -140 41 -58 95 -133 120 -167 25 -34 45 -66 45 -70 0 -4 13 -22 28 -40 15 -17 47 -61 72 -97 25 -37 74 -107 110 -156 36 -50 99 -138 140 -196 41 -58 108 -150 148 -205 39 -54 72 -102 72 -105 0 -3 20 -32 45 -64 25 -32 45 -62 45 -67 0 -5 14 -22 30 -38 17 -16 30 -33 30 -38 0 -5 19 -34 43 -65 90 -122 154 -259 178 -387 11 -56 14 -423 19 -1850 l5 -1780 29 -58 c36 -71 112 -148 168 -171 24 -10 51 -22 60 -27 24 -12 205 -11 213 1 3 6 15 10 25 10 11 0 34 6 52 14 18 8 52 21 76 30 64 24 118 44 165 62 23 8 55 22 70 30 16 8 36 14 46 14 9 0 26 7 37 15 10 8 27 15 37 15 11 0 31 6 45 14 15 8 47 22 72 31 25 9 60 23 78 31 18 8 39 14 47 14 7 0 26 6 42 14 15 8 48 22 73 31 25 10 57 23 72 31 14 8 35 14 45 14 11 0 28 7 39 15 10 8 26 15 35 15 14 0 62 19 197 76 18 8 40 14 48 14 9 0 28 6 42 14 28 15 36 18 235 92 23 9 56 22 72 29 17 7 50 21 75 31 84 34 127 77 181 182 9 18 20 56 24 85 4 28 10 714 14 1522 6 1402 7 1472 25 1520 41 109 110 235 188 344 46 62 88 121 93 130 6 9 30 45 55 80 72 101 159 222 250 351 47 67 113 159 148 205 34 46 62 87 62 90 0 4 27 42 60 85 33 43 60 81 60 84 0 3 22 36 50 73 27 37 60 83 72 101 13 18 30 41 38 52 8 10 35 49 60 85 25 37 73 104 108 150 34 46 62 87 62 90 0 3 33 50 73 103 40 53 81 111 91 127 11 17 45 65 78 107 32 43 58 80 58 83 0 4 20 33 45 65 25 32 45 63 45 70 0 6 7 13 15 16 8 4 15 10 15 16 0 5 26 44 58 86 32 42 70 95 85 117 64 95 144 206 208 292 38 51 69 95 69 99 0 3 13 23 29 43 26 33 92 126 193 271 21 30 48 68 60 85 85 112 108 144 108 150 0 3 27 42 60 85 33 43 60 81 60 85 0 3 28 44 63 90 34 47 82 114 107 151 25 36 50 71 56 77 5 7 32 44 58 82 27 39 62 86 77 106 16 20 29 42 29 48 0 6 4 11 8 11 5 0 25 32 45 71 36 68 37 75 37 175 0 118 -13 163 -69 234 -37 48 -127 112 -173 124 -16 3 -28 13 -28 21 0 13 -486 15 -4103 15 -4091 0 -4102 0 -4115 -20z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 300.000000 300.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\"g\", { transform: \"translate(0.000000,300.000000) scale(0.050000,-0.050000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M58 5702 c-100 -101 -84 -148 136 -416 107 -130 242 -294 301 -366 58 -71 173 -211 254 -310 81 -99 441 -535 799 -969 l652 -789 0 -1201 c0 -1396 2 -1411 182 -1411 60 0 1302 604 1360 662 36 36 38 79 38 935 0 494 5 925 12 959 8 41 370 495 1110 1393 1202 1459 1158 1394 1040 1513 l-59 58 -2883 0 -2883 0 -59 -58z m5349 -327 c-16 -26 -150 -190 -683 -835 -169 -203 -381 -460 -472 -570 -90 -110 -290 -352 -443 -537 -154 -186 -301 -369 -329 -408 l-50 -70 -6 -913 -5 -913 -410 -205 c-225 -112 -413 -204 -418 -204 -6 0 -12 503 -15 1117 l-6 1118 -50 70 c-27 39 -175 222 -329 408 -153 185 -353 427 -443 537 -91 110 -303 367 -472 570 -533 645 -667 809 -683 835 -12 20 474 25 2407 25 1933 0 2419 -5 2407 -25z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) });\n};\nvar slashFilterSvg = (solid) => {\n return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: solid ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"div\", { className: \"mt-[-4px] mr-[-2px] \", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z\" }),\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 186 0 14 -3600 3624 -3614 3624 -3 0 -6 -6 -6 -12z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"div\", { className: \"mt-[-4px] mr-[-2px] \", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"20\",\n viewBox: \"0 0 900.000000 900.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\"g\", { transform: \"translate(0.000000,900.000000) scale(0.100000,-0.100000)\", fill: \"#fff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z m5494 -1490 c6 -10 -1204 -2436 -1226 -2458 -13 -13 -168 139 -1247 1217 -677 677 -1231 1236 -1231 1241 0 12 3697 12 3704 0z\" }),\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 185 0 18 -692 715 -709 715 -6 0 -11 -38 -13 -97 l-3 -98 -745 0 -745 0 -3 858 -2 859 -694 694 c-382 382 -697 694 -700 694 -3 0 -6 -6 -6 -12z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n ) }) });\n};\nvar exportToExcelSvg = () => {\n return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\n \"svg\",\n {\n version: \"1.0\",\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"18\",\n height: \"18\",\n viewBox: \"0 0 150.000000 150.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(\"g\", { transform: \"translate(0.000000,150.000000) scale(0.100000,-0.100000)\", fill: \"#ffffff\", stroke: \"none\", children: [\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M205 1418 c-3 -7 -4 -317 -3 -688 l3 -675 435 -3 c239 -1 441 0 449 3 11 4 9 11 -9 30 l-23 25 -396 2 -396 3 0 625 0 625 280 0 280 0 5 -190 5 -190 190 -5 190 -5 5 -175 5 -175 25 0 25 0 3 200 2 199 -202 203 -203 203 -333 0 c-257 0 -334 -3 -337 -12z m828 -235 c70 -70 127 -131 127 -135 0 -5 -60 -7 -132 -6 l-133 3 -3 133 c-1 72 1 132 6 132 4 0 65 -57 135 -127z\" }),\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M518 915 c-6 -6 9 -37 42 -90 11 -16 23 -37 27 -45 4 -8 19 -36 35 -61 15 -25 28 -56 28 -68 0 -20 -29 -69 -121 -209 -16 -24 -29 -47 -29 -53 0 -5 31 -9 68 -9 l69 0 42 82 c60 116 66 118 107 35 56 -114 53 -112 127 -115 51 -2 67 0 67 11 0 7 -5 18 -11 24 -11 11 -26 36 -49 78 -6 11 -19 34 -30 50 -11 17 -24 40 -29 52 -5 11 -15 24 -20 28 -26 16 -18 33 97 212 25 39 39 70 34 75 -5 5 -36 8 -68 6 l-59 -3 -42 -84 c-24 -46 -45 -86 -48 -89 -6 -6 -44 40 -45 54 0 6 -13 35 -29 65 l-28 54 -65 3 c-35 2 -67 0 -70 -3z\" }),\n \" \",\n /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(\"path\", { d: \"M1135 548 c-3 -7 -6 -67 -7 -133 l-3 -120 -55 -3 c-30 -1 -61 -5 -68 -7 -8 -3 28 -53 95 -132 122 -146 129 -153 140 -153 4 0 22 17 38 37 26 32 53 63 175 206 13 15 30 27 38 27 9 0 12 3 8 7 -3 4 -39 9 -79 12 l-72 6 -5 130 -5 130 -98 3 c-72 2 -99 -1 -102 -10z m145 -183 l5 -130 28 -3 c15 -2 27 -8 27 -14 0 -18 -92 -128 -107 -128 -11 1 -97 107 -101 125 -2 8 7 15 25 17 l28 3 3 120 c1 66 4 126 7 133 3 9 18 12 42 10 l38 -3 5 -130z\" }),\n \" \"\n ] }),\n \" \"\n ]\n }\n );\n};\n\n// src/components/table/hooks.tsx\nvar import_react3 = require(\"react\");\nvar import_zustand = require(\"zustand\");\nvar import_lodash2 = require(\"lodash\");\n\n// src/components/table/Table.tsx\nvar import_react2 = __toESM(require(\"react\"));\nvar import_lodash = require(\"lodash\");\n\n// src/helpers/forms.ts\nvar import_xregexp = __toESM(require(\"xregexp\"));\nvar textRegex = (0, import_xregexp.default)(\"[^\\\\p{L}\\\\s-]\", \"gu\");\nvar numbersRegex = (0, import_xregexp.default)(\"[^0-9\\\\s-+]\", \"g\");\nvar numbersOnlyRegex = (0, import_xregexp.default)(\"[^0-9]\", \"g\");\nvar priceRegex = (0, import_xregexp.default)(\"[^0-9.]\", \"g\");\nvar emailRegex = (0, import_xregexp.default)(\"[^\\\\p{L}0-9.@\\\\s-]\", \"gu\");\nvar colorRegex = (0, import_xregexp.default)(\"[^#0-9A-Fa-f]\", \"g\");\nvar carsRegex = (0, import_xregexp.default)(\"[^\\\\p{L}0-9,_]\", \"gu\");\nvar textNumbersRegex = (0, import_xregexp.default)(\"[^\\\\p{L}0-9\\\\s+\\\\-]\", \"gu\");\nvar addressRegex = (0, import_xregexp.default)(\"[^\\\\p{L}0-9\\\\s.,\\\\-]\", \"gu\");\nvar chartsRegex = (0, import_xregexp.default)(\"[^\\\\p{L}0-9\\\\s.,_@!\\\\-]\", \"gu\");\nvar handleChange = (e) => {\n e.target.setCustomValidity(\"\");\n const validation = e.target.getAttribute(\"data-validation\");\n if (validation === \"text\") {\n e.target.value = import_xregexp.default.replace(e.target.value, textRegex, \"\");\n } else if (validation === \"numbers\") {\n e.target.value = import_xregexp.default.replace(e.target.value, numbersRegex, \"\");\n } else if (validation === \"numbersOnly\") {\n e.target.value = import_xregexp.default.replace(e.target.value, numbersOnlyRegex, \"\");\n } else if (validation === \"price\") {\n e.target.value = import_xregexp.default.replace(e.target.value, priceRegex, \"\");\n } else if (validation === \"textNumbers\") {\n e.target.value = import_xregexp.default.replace(e.target.value, textNumbersRegex, \"\");\n } else if (validation === \"email\") {\n e.target.value = import_xregexp.default.replace(e.target.value, emailRegex, \"\");\n } else if (validation === \"color\") {\n e.target.value = import_xregexp.default.replace(e.target.value, colorRegex, \"\");\n } else if (validation === \"address\") {\n e.target.value = import_xregexp.default.replace(e.target.value, addressRegex, \"\");\n } else if (validation === \"cars\") {\n e.target.value = import_xregexp.default.replace(e.target.value, carsRegex, \"\");\n } else if (validation === \"charts\") {\n e.target.value = import_xregexp.default.replace(e.target.value, chartsRegex, \"\");\n }\n};\nvar handlePaste = (e) => {\n const validation = e.currentTarget.getAttribute(\"data-validation\");\n let pasteData = e.clipboardData.getData(\"text\");\n if (validation === \"text\") {\n pasteData = import_xregexp.default.replace(pasteData, textRegex, \"\");\n } else if (validation === \"numbers\") {\n pasteData = import_xregexp.default.replace(pasteData, numbersRegex, \"\");\n } else if (validation === \"numbersOnly\") {\n pasteData = import_xregexp.default.replace(pasteData, numbersOnlyRegex, \"\");\n } else if (validation === \"price\") {\n pasteData = import_xregexp.default.replace(pasteData, priceRegex, \"\");\n } else if (validation === \"textNumbers\") {\n pasteData = import_xregexp.default.replace(pasteData, textNumbersRegex, \"\");\n } else if (validation === \"email\") {\n pasteData = import_xregexp.default.replace(pasteData, emailRegex, \"\");\n } else if (validation === \"color\") {\n pasteData = import_xregexp.default.replace(pasteData, colorRegex, \"\");\n } else if (validation === \"address\") {\n pasteData = import_xregexp.default.replace(pasteData, addressRegex, \"\");\n } else if (validation === \"cars\") {\n pasteData = import_xregexp.default.replace(pasteData, carsRegex, \"\");\n } else if (validation === \"charts\") {\n pasteData = import_xregexp.default.replace(pasteData, chartsRegex, \"\");\n }\n e.preventDefault();\n document.execCommand(\"insertText\", false, pasteData);\n};\nvar handleInvalid = (e, requireError) => {\n e.target.setCustomValidity(requireError || \"This filed is required !\");\n};\nvar useValidation = (validationType, requireError) => {\n return {\n onChange: handleChange,\n onPaste: handlePaste,\n onInvalid: (e) => handleInvalid(e, requireError),\n \"data-validation\": validationType\n };\n};\nvar getFormElementValue = (form, name) => {\n return form.elements.namedItem(name)?.value || \"\";\n};\n\n// src/components/table/Table.tsx\nvar import_jsx_runtime7 = require(\"react/jsx-runtime\");\nvar TableContext = (0, import_react2.createContext)(null);\nvar TableProvider = (props) => {\n const {\n // basic props\n data,\n headers,\n optionalElement,\n keysToRender = [],\n direction = \"ltr\",\n onRowClick = (data2) => {\n },\n // container styles props\n containerStyle,\n containerClassName = \"\",\n tableContainerClass = \"\",\n tableContainerStyle = {},\n tableStyle = {},\n // row style\n rowStyles = {},\n rowClassName,\n // cell style\n cellClassName,\n cellStyle = {},\n // header styles\n headerStyle = {},\n headerCellStyle,\n searchInputStyle = {},\n // search\n searchInputClassName = \"\",\n includeSearch,\n searchPlaceHolder,\n // sort\n sortKeys,\n sortLabel = \"Sort by\",\n // filter\n filterableColumns = [],\n filterLabel = \"Filter by\",\n // export to excel\n exportToExcelKeys,\n dataToAddToExcelTable,\n exportExcelTitle = \"Export to excel\",\n excelFileName,\n // summary\n sumColumns,\n summaryLabel = \"\",\n summaryContainerStyle = {},\n summaryLabelStyle = {},\n summaryRowStyle = {},\n // max rows\n maxRows = data.length\n } = props;\n const { sortColumn, sortOrder, handleSort, clearSort } = useSort();\n const { searchQuery, handleSearch, clearSearch, deferredSearchQuery } = useSearch();\n const { filters, filterPopupsDisplay, filterOptions, handleFilterChange, handleFilterClick, closeFilterWindow, clearFilter } = useFilter({\n data,\n filterableColumns\n });\n const allKeys = (0, import_react2.useMemo)(() => {\n return Array.from(\n data.reduce((keys, obj) => {\n Object.keys(obj).forEach((key) => keys.add(key));\n return keys;\n }, /* @__PURE__ */ new Set())\n );\n }, [data]);\n const dataToRender = (0, import_react2.useMemo)(() => {\n let filtered = data;\n if (includeSearch && deferredSearchQuery.length > 0) {\n const cleanString = (str) => str.replace(textNumbersRegex, \"\").toLowerCase().trim();\n const normalizedSearchQuery = cleanString(deferredSearchQuery);\n filtered = data.filter(\n (item) => allKeys.some((key) => {\n return cleanString(item[key]?.toString()).includes(normalizedSearchQuery);\n })\n );\n }\n if (filterableColumns.length > 0 && filterPopupsDisplay !== \"\") {\n console.log(\"filtering ...\");\n Object.keys(filters).forEach((key) => {\n if (filters[key].length > 0) {\n filtered = filtered.filter((item) => filters[key].includes(item[key]));\n }\n });\n }\n if (sortColumn !== null && sortOrder !== null && sortKeys?.length > 0) {\n console.log(\"sorting ...\");\n filtered = filtered.sort((a, b) => {\n const aValue = a[sortKeys[sortColumn]];\n const bValue = b[sortKeys[sortColumn]];\n if (aValue < bValue) return sortOrder === \"asc\" ? -1 : 1;\n if (aValue > bValue) return sortOrder === \"asc\" ? 1 : -1;\n return 0;\n });\n }\n const renderedData = filtered.length > maxRows ? filtered.slice(0, maxRows) : filtered;\n return { renderedData, filtered };\n }, [deferredSearchQuery, sortColumn, sortOrder, filters, data]);\n const providerValues = {\n ...props,\n // props with default values\n direction,\n keysToRender,\n filterableColumns,\n maxRows,\n // states and functions\n sortColumn,\n sortOrder,\n handleSort,\n searchQuery,\n deferredSearchQuery,\n handleSearch,\n dataToRender,\n filters,\n filterPopupsDisplay,\n filterOptions,\n handleFilterChange,\n handleFilterClick,\n closeFilterWindow\n };\n return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableContext.Provider, { value: providerValues, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(\"div\", { className: `flex flex-col gap-2 ${containerClassName}`, style: { ...containerStyle, direction }, children: props.children }) });\n};\nvar TableBase = (props) => {\n const {\n containerHeaderClassName,\n optionalElement,\n tableContainerClass,\n tableContainerStyle,\n tableStyle,\n includeSearch,\n exportToExcelKeys,\n sumColumns,\n direction,\n maxRowsLabel1,\n maxRowsLabel2,\n searchContainerClassName\n } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(TableProvider, { ...props, children: [\n /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(\"div\", { style: { direction }, className: cn(\"flex justify-start items-center gap-2\", containerHeaderClassName || \"\"), children: [\n /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(\"div\", { className: cn(\"flex justify-start items-center gap-2\", searchContainerClassName), children: [\n includeSearch && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Search, {}),\n exportToExcelKeys && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ExportToExcel, {})\n ] }),\n maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MaxRowsLabel, {}),\n optionalElement && optionalElement\n ] }),\n /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(\n \"div\",\n {\n style: { ...tableContainerStyle || {}, direction },\n className: cn(`animate-slide-in-up overflow-y-auto`, tableContainerClass || \"\"),\n children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(\"table\", { style: tableStyle, className: \"min-w-full text-sm font-light relative\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableHead, {}),\n /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableBody, {})\n ] })\n }\n ),\n sumColumns && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Summary, {})\n ] });\n};\nvar areEqual = (prevProps, nextProps) => (0, import_lodash.isEqual)(prevProps, nextProps);\nvar Table = import_react2.default.memo(TableBase, areEqual);\nTable.displayName = \"Table\";\n\n// src/components/table/hooks.tsx\nvar useTableContext = () => {\n const context = (0, import_react3.useContext)(TableContext);\n if (!context) {\n throw new Error(\"useTableContext must be used within a Table component\");\n }\n return context;\n};\nvar useFilter = ({ data, filterableColumns }) => {\n const initFilter = filterableColumns.reduce((acc, col) => ({ ...acc, [col.dataKey]: [] }), {});\n const [filters, setFilters] = (0, import_react3.useState)(initFilter);\n const [filterPopupsDisplay, setFilterPopupsDisplay] = (0, import_react3.useState)(\"\");\n const filterOptions = filterableColumns.reduce((acc, col) => {\n acc[col.dataKey] = Array.from(new Set(data.map((item) => item[col.dataKey])));\n return acc;\n }, {});\n const handleFilterChange = (dataKey, value) => {\n const newFilters = { ...filters };\n if (newFilters[dataKey].includes(value)) {\n newFilters[dataKey] = newFilters[dataKey].filter((item) => item !== value);\n } else {\n newFilters[dataKey].push(value);\n }\n setFilters(newFilters);\n };\n const clearFilter = () => {\n if (!(0, import_lodash2.isEqual)(filters, initFilter)) {\n setFilters(initFilter);\n }\n };\n const handleFilterClick = (dataKey) => {\n setFilterPopupsDisplay((prev) => {\n if (prev === dataKey) {\n setFilters(initFilter);\n return \"\";\n }\n return dataKey;\n });\n };\n const closeFilterWindow = () => {\n setFilterPopupsDisplay(\"\");\n };\n return {\n filters,\n filterPopupsDisplay,\n filterOptions,\n handleFilterChange,\n handleFilterClick,\n closeFilterWindow,\n clearFilter\n };\n};\nvar useSort = () => {\n const [sortColumn, setSortColumn] = (0, import_react3.useState)(null);\n const [sortOrder, setSortOrder] = (0, import_react3.useState)(null);\n const handleSort = (columnIndex) => {\n let newSortOrder = \"asc\";\n if (sortColumn === columnIndex && sortOrder === \"asc\") {\n newSortOrder = \"desc\";\n }\n setSortColumn(columnIndex);\n setSortOrder(newSortOrder);\n };\n const clearSort = () => {\n if (sortColumn) {\n setSortColumn(null);\n }\n if (sortOrder) {\n setSortOrder(null);\n }\n };\n return { sortColumn, sortOrder, handleSort, clearSort };\n};\nvar useSearch = () => {\n const [searchQuery, setSearchQuery] = (0, import_react3.useState)(\"\");\n const [isPending, startTransition] = (0, import_react3.useTransition)();\n const deferredSearchQuery = (0, import_react3.useDeferredValue)(searchQuery);\n const handleSearch = (e) => {\n const value = e.target.value;\n startTransition(() => {\n setSearchQuery(value);\n });\n };\n const clearSearch = () => {\n if (searchQuery) {\n startTransition(() => {\n setSearchQuery(\"\");\n });\n }\n };\n return { searchQuery, handleSearch, clearSearch, isPending, deferredSearchQuery };\n};\n\n// src/helpers/firebase.ts\nvar import_moment = __toESM(require(\"moment\"));\nvar import_app = require(\"firebase/app\");\nvar import_storage = require(\"firebase/storage\");\nvar import_auth = require(\"firebase/auth\");\nvar import_firestore = require(\"firebase/firestore\");\nvar import_meta = {};\nvar initApp = () => {\n const isNodeEnv = typeof process !== \"undefined\" && process.env;\n const firebaseConfig = {\n apiKey: isNodeEnv ? process.env.NEXT_PUBLIC_API_KEY : import_meta.env.VITE_API_KEY,\n authDomain: isNodeEnv ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import_meta.env.VITE_AUTH_DOMAIN,\n projectId: isNodeEnv ? process.env.NEXT_PUBLIC_PROJECT_ID : import_meta.env.VITE_PROJECT_ID,\n storageBucket: isNodeEnv ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import_meta.env.VITE_STORAGE_BUCKET,\n messagingSenderId: isNodeEnv ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import_meta.env.VITE_MESSAGING_SENDER_ID,\n appId: isNodeEnv ? process.env.NEXT_PUBLIC_APP_ID : import_meta.env.VITE_APP_ID\n };\n try {\n const app = (0, import_app.initializeApp)(firebaseConfig);\n const auth2 = (0, import_auth.getAuth)(app);\n const db2 = (0, import_firestore.getFirestore)(app);\n const storage2 = (0, import_storage.getStorage)(app);\n return { db: db2, auth: auth2, storage: storage2 };\n } catch (error) {\n console.error(\"Failed to initialize Firebase app:\", error);\n return { db: null, auth: null };\n }\n};\nvar { db, auth, storage } = initApp();\nvar collections = {\n clients: (0, import_firestore.collection)(db, \"nx-clients\"),\n sites: (0, import_firestore.collection)(db, \"nx-sites\"),\n cars: (0, import_firestore.collection)(db, \"units\"),\n users: (0, import_firestore.collection)(db, \"nx-users\"),\n lastLocations: (0, import_firestore.collection)(db, \"last_locations\"),\n ermEvents: (0, import_firestore.collection)(db, \"erm_events_general\"),\n erm2Events: (0, import_firestore.collection)(db, \"erm2_events_general\"),\n ruptelaEvents: (0, import_firestore.collection)(db, \"ruptela_events_general\"),\n polygons: (0, import_firestore.collection)(db, \"nx-polygons\"),\n polygonEvents: (0, import_firestore.collection)(db, \"polygon_events\"),\n polygonCars: (0, import_firestore.collection)(db, \"polygon_cars\"),\n canbus: (0, import_firestore.collection)(db, \"erm_canbus_parameters\"),\n states: (0, import_firestore.collection)(db, \"erm_states\"),\n app_pro_commands_queue: (0, import_firestore.collection)(db, \"app_pro_commands_queue\"),\n trips: (0, import_firestore.collection)(db, \"erm2_trip\"),\n tripsDetails: (0, import_firestore.collection)(db, \"erm2_trip_details\"),\n audit: (0, import_firestore.collection)(db, \"nx-audit\"),\n nx_settings: (0, import_firestore.collection)(db, \"nx-settings\"),\n settings: (0, import_firestore.collection)(db, \"settings\"),\n translations: (0, import_firestore.collection)(db, \"nx-translations\"),\n nx_cars: (0, import_firestore.collection)(db, \"nx-cars\"),\n boards: (0, import_firestore.collection)(db, \"boards\"),\n protection_types: (0, import_firestore.collection)(db, \"protectionTypes\"),\n board_types: (0, import_firestore.collection)(db, \"boardTypes\"),\n charge_capacities: (0, import_firestore.collection)(db, \"nx-charge-capacities\")\n};\nvar fire_base_TIME_TEMP = import_firestore.Timestamp.now;\n\n// src/helpers/global.ts\nvar import_akeyless_types_commons = require(\"akeyless-types-commons\");\nvar import_axios = __toESM(require(\"axios\"));\n\n// src/helpers/phoneNumber.ts\nvar import_libphonenumber_js = require(\"libphonenumber-js\");\n\n// src/helpers/global.ts\nvar renderOnce = () => {\n return true;\n};\nvar getLocationUrl = (lang, lat) => {\n return `https://www.google.com/maps?q=${lang},${lat}`;\n};\n\n// src/helpers/time_helpers.ts\nvar import_firestore2 = require(\"firebase/firestore\");\nvar import_moment_timezone = __toESM(require(\"moment-timezone\"));\nfunction timestamp_to_string(firebaseTimestamp, options) {\n let date;\n if (firebaseTimestamp instanceof import_firestore2.Timestamp) {\n date = firebaseTimestamp.toDate();\n } else if (firebaseTimestamp instanceof Date) {\n date = firebaseTimestamp;\n } else if (typeof firebaseTimestamp === \"string\") {\n date = import_moment_timezone.default.utc(firebaseTimestamp, options?.fromFormat || \"DD/MM/YYYY HH:mm:ss\").toDate();\n if (isNaN(date.getTime())) {\n throw new Error(\"Invalid date string format\");\n }\n } else {\n throw new Error(\"Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.\");\n }\n if (options?.tz) {\n const result = (0, import_moment_timezone.default)(date).tz(options?.tz).format(options?.format || \"DD/MM/YYYY HH:mm:ss\");\n return result;\n }\n return import_moment_timezone.default.utc(date).format(options?.format || \"DD/MM/YYYY HH:mm:ss\");\n}\n\n// src/components/ui/badge.tsx\nvar import_class_variance_authority = require(\"class-variance-authority\");\nvar import_jsx_runtime8 = require(\"react/jsx-runtime\");\nvar badgeVariants = (0, import_class_variance_authority.cva)(\n \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n outline: \"text-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(\"div\", { className: cn(badgeVariants({ variant }), className), ...props });\n}\n\n// src/components/ui/button.tsx\nvar React3 = __toESM(require(\"react\"));\nvar import_react_slot = require(\"@radix-ui/react-slot\");\nvar import_class_variance_authority2 = require(\"class-variance-authority\");\nvar import_jsx_runtime9 = require(\"react/jsx-runtime\");\nvar buttonVariants = (0, import_class_variance_authority2.cva)(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline: \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Button = React3.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? import_react_slot.Slot : \"button\";\n return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(\n Comp,\n {\n className: cn(buttonVariants({ variant, size, className })),\n ref,\n ...props\n }\n );\n }\n);\nButton.displayName = \"Button\";\n\n// src/components/ui/input.tsx\nvar React4 = __toESM(require(\"react\"));\nvar import_jsx_runtime10 = require(\"react/jsx-runtime\");\nvar Input = React4.forwardRef(\n ({ className, type, ...props }, ref) => {\n return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(\n \"input\",\n {\n type,\n className: cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n ),\n ref,\n ...props\n }\n );\n }\n);\nInput.displayName = \"Input\";\n\n// src/components/ui/progress.tsx\nvar React5 = __toESM(require(\"react\"));\nvar ProgressPrimitive = __toESM(require(\"@radix-ui/react-progress\"));\nvar import_jsx_runtime11 = require(\"react/jsx-runtime\");\nvar ProgressComponent = React5.forwardRef(\n ({ className, value, containerClassName, indicatorClassName, showValueClassName, showValue = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(\"div\", { className: cn(\"relative w-full\", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ProgressPrimitive.Root, { ref, className: cn(\"w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full\", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(\n ProgressPrimitive.Indicator,\n {\n className: cn(\"h-full w-full flex-1 bg-[green] transition-all rounded-full\", indicatorClassName),\n style: { transform: `translateX(-${100 - (value || 0)}%)` },\n children: showValue && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(\"div\", { className: cn(\"absolute right-1 top-[-2px] font-medium text-white\", showValueClassName), children: `${value || 0}%` })\n }\n ) }) })\n);\nProgressComponent.displayName = ProgressPrimitive.Root.displayName;\n\n// src/components/ui/multiselect.tsx\nvar import_cmdk2 = require(\"cmdk\");\nvar import_lucide_react3 = require(\"lucide-react\");\nvar React8 = __toESM(require(\"react\"));\nvar import_react4 = require(\"react\");\n\n// src/components/ui/command.tsx\nvar import_cmdk = require(\"cmdk\");\nvar import_lucide_react2 = require(\"lucide-react\");\nvar React7 = __toESM(require(\"react\"));\n\n// src/components/ui/dialog.tsx\nvar React6 = __toESM(require(\"react\"));\nvar DialogPrimitive = __toESM(require(\"@radix-ui/react-dialog\"));\nvar import_lucide_react = require(\"lucide-react\");\nvar import_jsx_runtime12 = require(\"react/jsx-runtime\");\nvar DialogPortal = DialogPrimitive.Portal;\nvar DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(\n DialogPrimitive.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props\n }\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nvar DialogContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(DialogPortal, { children: [\n /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DialogOverlay, {}),\n /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(\n DialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(DialogPrimitive.Close, { className: \"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react.X, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(\"span\", { className: \"sr-only\", children: \"Close\" })\n ] })\n ]\n }\n )\n] }));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nvar DialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className\n ),\n ...props\n }\n);\nDialogHeader.displayName = \"DialogHeader\";\nvar DialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nDialogFooter.displayName = \"DialogFooter\";\nvar DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(\n DialogPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className\n ),\n ...props\n }\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nvar DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(\n DialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n// src/components/ui/command.tsx\nvar import_jsx_runtime13 = require(\"react/jsx-runtime\");\nvar Command = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n import_cmdk.Command,\n {\n ref,\n className: cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground\",\n className\n ),\n ...props\n }\n));\nCommand.displayName = import_cmdk.Command.displayName;\nvar CommandInput = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(\"div\", { className: \"flex items-center border-b border-input px-5\", \"cmdk-input-wrapper\": \"\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.Search, { size: 20, strokeWidth: 2, className: \"me-3 text-muted-foreground/80\" }),\n /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n import_cmdk.Command.Input,\n {\n ref,\n className: cn(\n \"flex h-10 w-full rounded-lg bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props\n }\n )\n] }));\nCommandInput.displayName = import_cmdk.Command.Input.displayName;\nvar CommandList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n import_cmdk.Command.List,\n {\n ref,\n className: cn(\"max-h-80 overflow-y-auto overflow-x-hidden\", className),\n ...props\n }\n));\nCommandList.displayName = import_cmdk.Command.List.displayName;\nvar CommandEmpty = React7.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_cmdk.Command.Empty, { ref, className: \"py-6 text-center text-sm\", ...props }));\nCommandEmpty.displayName = import_cmdk.Command.Empty.displayName;\nvar CommandGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n import_cmdk.Command.Group,\n {\n ref,\n className: cn(\n \"overflow-hidden p-2 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n ),\n ...props\n }\n));\nCommandGroup.displayName = import_cmdk.Command.Group.displayName;\nvar CommandSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n import_cmdk.Command.Separator,\n {\n ref,\n className: cn(\"-mx-1 h-px bg-border\", className),\n ...props\n }\n));\nCommandSeparator.displayName = import_cmdk.Command.Separator.displayName;\nvar CommandItem = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n import_cmdk.Command.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n ),\n ...props\n }\n));\nCommandItem.displayName = import_cmdk.Command.Item.displayName;\nvar CommandShortcut = ({ className, ...props }) => {\n return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(\n \"kbd\",\n {\n className: cn(\n \"-me-1 ms-auto inline-flex h-5 max-h-full items-center rounded border border-border bg-background px-1 font-[inherit] text-[0.625rem] font-medium text-muted-foreground/70\",\n className\n ),\n ...props\n }\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n// src/components/ui/multiselect.tsx\nvar import_lodash3 = require(\"lodash\");\nvar import_jsx_runtime14 = require(\"react/jsx-runtime\");\nfunction useDebounce(value, delay) {\n const [debouncedValue, setDebouncedValue] = React8.useState(value);\n (0, import_react4.useEffect)(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay || 500);\n return () => {\n clearTimeout(timer);\n };\n }, [value, delay]);\n return debouncedValue;\n}\nfunction transToGroupOption(options, groupBy) {\n if (options.length === 0) {\n return {};\n }\n if (!groupBy) {\n return {\n \"\": options\n };\n }\n const groupOption = {};\n options.forEach((option) => {\n const key = option[groupBy] || \"\";\n if (!groupOption[key]) {\n groupOption[key] = [];\n }\n groupOption[key].push(option);\n });\n return groupOption;\n}\nfunction removePickedOption(groupOption, picked) {\n const cloneOption = JSON.parse(JSON.stringify(groupOption));\n for (const [key, value] of Object.entries(cloneOption)) {\n cloneOption[key] = value.filter((val) => !picked.find((p) => p.value === val.value));\n }\n return cloneOption;\n}\nfunction isOptionsExist(groupOption, targetOption) {\n for (const [, value] of Object.entries(groupOption)) {\n if (value.some((option) => targetOption.find((p) => p.value === option.value))) {\n return true;\n }\n }\n return false;\n}\nvar CommandEmpty2 = (0, import_react4.forwardRef)(({ className, ...props }, forwardedRef) => {\n const render = (0, import_cmdk2.useCommandState)((state) => state.filtered.count === 0);\n if (!render) return null;\n return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\"div\", { ref: forwardedRef, className: cn(\"px-2 py-4 text-center text-sm\", className), \"cmdk-empty\": \"\", role: \"presentation\", ...props });\n});\nCommandEmpty2.displayName = \"CommandEmpty\";\nvar MultipleSelector = React8.forwardRef(\n ({\n value,\n onChange,\n placeholder,\n defaultOptions: arrayDefaultOptions = [],\n options: arrayOptions,\n delay,\n onSearch,\n onSearchSync,\n loadingIndicator,\n emptyIndicator,\n maxSelected = Number.MAX_SAFE_INTEGER,\n onMaxSelected,\n hidePlaceholderWhenSelected,\n disabled,\n groupBy,\n className,\n badgeClassName,\n selectFirstItem = true,\n creatable = false,\n triggerSearchOnFocus = true,\n commandProps,\n inputProps,\n hideClearAllButton = false,\n dropdownClassName,\n dropdownOptionClassName,\n emptyIndicatorClassName,\n unremovableOptions = [],\n name\n }, ref) => {\n const inputRef = React8.useRef(null);\n const [open, setOpen] = React8.useState(false);\n const [onScrollbar, setOnScrollbar] = React8.useState(false);\n const [isLoading, setIsLoading] = React8.useState(false);\n const dropdownRef = React8.useRef(null);\n const [selected, setSelected] = React8.useState(value || []);\n const [options, setOptions] = React8.useState(transToGroupOption(arrayDefaultOptions, groupBy));\n const [inputValue, setInputValue] = React8.useState(\"\");\n const debouncedSearchTerm = useDebounce(inputValue, delay || 500);\n React8.useImperativeHandle(\n ref,\n () => ({\n selectedValue: [...selected],\n input: inputRef.current,\n focus: () => inputRef?.current?.focus(),\n reset: () => setSelected([])\n }),\n [selected]\n );\n const handleClickOutside = (event) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target) && inputRef.current && !inputRef.current.contains(event.target)) {\n setOpen(false);\n inputRef.current.blur();\n }\n };\n const handleUnselect = React8.useCallback(\n (option) => {\n if (unremovableOptions.find((v) => (0, import_lodash3.isEqual)(v.value, option.value))) {\n return;\n }\n const newOptions = selected.filter((s) => s.value !== option.value);\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n [onChange, selected]\n );\n const handleKeyDown = React8.useCallback(\n (e) => {\n const input = inputRef.current;\n if (input) {\n if (e.key === \"Delete\" || e.key === \"Backspace\") {\n if (input.value === \"\" && selected.length > 0) {\n const lastSelectOption = selected[selected.length - 1];\n if (!lastSelectOption.fixed) {\n handleUnselect(selected[selected.length - 1]);\n }\n }\n }\n if (e.key === \"Escape\") {\n input.blur();\n }\n }\n },\n [handleUnselect, selected]\n );\n (0, import_react4.useEffect)(() => {\n if (open) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"touchend\", handleClickOutside);\n } else {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"touchend\", handleClickOutside);\n }\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"touchend\", handleClickOutside);\n };\n }, [open]);\n (0, import_react4.useEffect)(() => {\n if (value) {\n setSelected(value);\n }\n }, [value]);\n (0, import_react4.useEffect)(() => {\n if (!arrayOptions || onSearch) {\n return;\n }\n const newOption = transToGroupOption(arrayOptions || [], groupBy);\n if (JSON.stringify(newOption) !== JSON.stringify(options)) {\n setOptions(newOption);\n }\n }, [arrayDefaultOptions, arrayOptions, groupBy, onSearch, options]);\n (0, import_react4.useEffect)(() => {\n const doSearchSync = () => {\n const res = onSearchSync?.(debouncedSearchTerm);\n setOptions(transToGroupOption(res || [], groupBy));\n };\n const exec = async () => {\n if (!onSearchSync || !open) return;\n if (triggerSearchOnFocus) {\n doSearchSync();\n }\n if (debouncedSearchTerm) {\n doSearchSync();\n }\n };\n void exec();\n }, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus]);\n (0, import_react4.useEffect)(() => {\n const doSearch = async () => {\n setIsLoading(true);\n const res = await onSearch?.(debouncedSearchTerm);\n setOptions(transToGroupOption(res || [], groupBy));\n setIsLoading(false);\n };\n const exec = async () => {\n if (!onSearch || !open) return;\n if (triggerSearchOnFocus) {\n await doSearch();\n }\n if (debouncedSearchTerm) {\n await doSearch();\n }\n };\n void exec();\n }, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus]);\n const CreatableItem = () => {\n if (!creatable) return void 0;\n if (isOptionsExist(options, [{ value: inputValue, label: inputValue }]) || selected.find((s) => s.value === inputValue)) {\n return void 0;\n }\n const Item = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n CommandItem,\n {\n value: inputValue,\n className: \"cursor-pointer\",\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onSelect: (value2) => {\n if (selected.length >= maxSelected) {\n onMaxSelected?.(selected.length);\n return;\n }\n setInputValue(\"\");\n const newOptions = [...selected, { value: value2, label: value2 }];\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n children: `Create \"${inputValue}\"`\n }\n );\n if (!onSearch && inputValue.length > 0) {\n return Item;\n }\n if (onSearch && debouncedSearchTerm.length > 0 && !isLoading) {\n return Item;\n }\n return void 0;\n };\n const EmptyItem = React8.useCallback(() => {\n if (!emptyIndicator) return void 0;\n if (onSearch && !creatable && Object.keys(options).length === 0) {\n return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CommandItem, { className: \"\", value: \"-\", disabled: true, children: emptyIndicator });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CommandEmpty2, { className: emptyIndicatorClassName, children: emptyIndicator });\n }, [creatable, emptyIndicator, onSearch, options]);\n const selectables = React8.useMemo(() => removePickedOption(options, selected), [options, selected]);\n const commandFilter = React8.useCallback(() => {\n if (commandProps?.filter) {\n return commandProps.filter;\n }\n if (creatable) {\n return (value2, search) => {\n return value2.toLowerCase().includes(search.toLowerCase()) ? 1 : -1;\n };\n }\n return void 0;\n }, [creatable, commandProps?.filter]);\n return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(\n Command,\n {\n ref: dropdownRef,\n ...commandProps,\n onKeyDown: (e) => {\n handleKeyDown(e);\n commandProps?.onKeyDown?.(e);\n },\n className: cn(\"h-auto overflow-visible bg-transparent\", commandProps?.className),\n shouldFilter: commandProps?.shouldFilter !== void 0 ? commandProps.shouldFilter : !onSearch,\n filter: commandFilter(),\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n \"div\",\n {\n className: cn(\n \"relative min-h-[38px] py-2 rounded-lg border border-input text-sm transition-shadow focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50\",\n {\n \"p-1\": selected.length !== 0,\n \"cursor-text\": !disabled && selected.length !== 0\n },\n !hideClearAllButton && \"pe-9\",\n className\n ),\n onClick: () => {\n if (disabled) return;\n inputRef?.current?.focus();\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(\"div\", { className: \"flex flex-wrap gap-1\", children: [\n selected.map((option) => {\n return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(\n \"div\",\n {\n className: cn(\n \"animate-fadeIn relative inline-flex px-0.5 h-7 cursor-default items-center rounded-md border border-solid bg-background pe-7 pl-2 ps-2 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50 data-[fixed]:pe-2\",\n badgeClassName\n ),\n \"data-fixed\": option.fixed,\n \"data-disabled\": disabled || void 0,\n children: [\n option.label,\n !unremovableOptions.find((v) => (0, import_lodash3.isEqual)(v.value, option.value)) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n \"button\",\n {\n className: \"absolute -inset-y-px -end-px flex size-7 items-center justify-center rounded-e-lg border border-transparent p-0 text-muted-foreground/80 outline-0 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70\",\n onKeyDown: (e) => {\n if (e.key === \"Enter\") {\n handleUnselect(option);\n }\n },\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onClick: () => handleUnselect(option),\n \"aria-label\": \"Remove\",\n children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.X, { size: 14, strokeWidth: 2, \"aria-hidden\": \"true\" })\n }\n )\n ]\n },\n option.value\n );\n }),\n /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n import_cmdk2.Command.Input,\n {\n ...inputProps,\n ref: inputRef,\n value: inputValue,\n disabled,\n onValueChange: (value2) => {\n setInputValue(value2);\n inputProps?.onValueChange?.(value2);\n },\n onBlur: (event) => {\n if (!onScrollbar) {\n setOpen(false);\n }\n inputProps?.onBlur?.(event);\n },\n onFocus: (event) => {\n setOpen(true);\n if (triggerSearchOnFocus) {\n onSearch?.(debouncedSearchTerm);\n }\n inputProps?.onFocus?.(event);\n },\n placeholder: hidePlaceholderWhenSelected && selected.length !== 0 ? \"\" : placeholder,\n className: cn(\n \"flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed\",\n {\n \"w-full\": hidePlaceholderWhenSelected,\n \"px-3 py-2\": selected.length === 0,\n \"ml-1\": selected.length !== 0\n },\n inputProps?.className\n )\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n setSelected(selected.filter((s) => s.fixed));\n onChange?.(selected.filter((s) => s.fixed));\n },\n className: cn(\n \"absolute end-0 top-0 flex size-9 items-center justify-center rounded-lg border border-transparent text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70\",\n (hideClearAllButton || disabled || selected.length < 1 || selected.filter((s) => s.fixed).length === selected.length) && \"hidden\"\n ),\n \"aria-label\": \"Clear all\",\n children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.X, { size: 16, strokeWidth: 2, \"aria-hidden\": \"true\" })\n }\n )\n ] })\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\"div\", { className: \"relative\", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n \"div\",\n {\n className: cn(\n \"absolute top-2 z-10 w-full overflow-hidden rounded-lg border border-input\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n !open && \"hidden\"\n ),\n \"data-state\": open ? \"open\" : \"closed\",\n children: open && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n CommandList,\n {\n className: \"bg-popover text-popover-foreground shadow-lg shadow-black/5 outline-none\",\n onMouseLeave: () => {\n setOnScrollbar(false);\n },\n onMouseEnter: () => {\n setOnScrollbar(true);\n },\n onMouseUp: () => {\n inputRef?.current?.focus();\n },\n children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: loadingIndicator }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [\n EmptyItem(),\n CreatableItem(),\n !selectFirstItem && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CommandItem, { value: \"-\", className: \"hidden\" }),\n Object.entries(selectables).map(([key, dropdowns]) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CommandGroup, { heading: key, className: cn(\"h-full overflow-auto\", dropdownClassName), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: dropdowns.map((option) => {\n return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\n CommandItem,\n {\n value: option.value,\n disabled: option.disable,\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onSelect: () => {\n setOptions(transToGroupOption(arrayDefaultOptions, groupBy));\n if (selected.length >= maxSelected) {\n onMaxSelected?.(selected.length);\n return;\n }\n setInputValue(\"\");\n const newOptions = [...selected, option];\n setSelected(newOptions);\n onChange?.(newOptions);\n },\n className: cn(\n \"cursor-pointer\",\n option.disable && \"cursor-not-allowed opacity-50\",\n dropdownOptionClassName\n ),\n children: option.label\n },\n option.value\n );\n }) }) }, key))\n ] })\n }\n )\n }\n ) }),\n /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(\"input\", { value: JSON.stringify(selected), type: \"hidden\", name })\n ]\n }\n );\n }\n);\nMultipleSelector.displayName = \"MultipleSelector\";\nvar multiselect_default = MultipleSelector;\n\n// src/components/table/components.tsx\nvar import_jsx_runtime15 = require(\"react/jsx-runtime\");\nvar getFixedNumber = (number = 0, fix = 4) => {\n const sum_value = number % 1 === 0 ? number : number.toFixed(fix).replace(/\\.?0+$/, \"\");\n return String(sum_value);\n};\nvar TableRow2 = ({ item, index }) => {\n const { rowStyles, rowClassName, keysToRender, onRowClick, zebraStriping } = useTableContext();\n const zebraClassName = zebraStriping ? index % 2 === 0 ? zebraStriping.evenRowClassName || \"\" : zebraStriping.oddRowClassName || \"bg-gray-300\" : \"\";\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"tr\",\n {\n className: cn(\"hover:bg-[#808080] hover:text-[#fff]\", zebraClassName, rowClassName || \"\"),\n onClick: () => onRowClick && onRowClick(item),\n style: rowStyles,\n children: keysToRender.map((key, index2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TableCell, { value: item[key] }, index2))\n }\n );\n};\nvar TableCell = ({ value }) => {\n const { cellStyle, cellClassName } = useTableContext();\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"td\",\n {\n title: [\"string\", \"number\", \"boolean\"].includes(typeof value) ? value : \"\",\n style: cellStyle,\n className: cn(\"chivo ellipsis border-black border-[1px] max-w-[90px] px-1 text-center\", cellClassName || \"\"),\n children: value\n }\n );\n};\nvar Filter = (0, import_react5.memo)(({ filterableColumn, index }) => {\n const { direction, headers, filters, filterOptions, filterPopupsDisplay, handleFilterChange, handleFilterClick, closeFilterWindow, filterLabel } = useTableContext();\n const displayRight = direction === \"rtl\" && index === headers.length - 1 || direction === \"ltr\" && index !== headers.length - 1;\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"div\", { className: \"absolute top-1 right-1 \", children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"button\",\n {\n title: filterLabel + \" \" + filterableColumn.header,\n className: \"text-[12px]\",\n onClick: () => handleFilterClick(filterableColumn.dataKey),\n children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: filters[filterableColumn.dataKey]?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: slashFilterSvg(true) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: emptyFilterSvg(true) }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: filters[filterableColumn.dataKey]?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: slashFilterSvg() }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: emptyFilterSvg() }) })\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { className: \"relative\", children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\n \"div\",\n {\n className: `absolute top-[-20px] z-20 ${displayRight ? \" left-[100%]\" : \"right-[100%]\"} w-44 h-52 text-black bg-white p-1 flex flex-col items-center gap-2 shadow`,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"div\", { className: \"flex justify-between items-center border-black border-b-[1px] w-[90%]\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { className: \"text-start\", children: filterLabel + \" \" + filterableColumn.header }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"button\", { onClick: closeFilterWindow, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RedXSvg2, {}) })\n ] }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { className: \"overflow-auto h-[80%] flex flex-col gap-1 w-full cursor-pointer \", children: filterOptions[filterableColumn.dataKey]?.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"div\", { className: \"flex items-center px-2 justify-start hover:bg-[#547f22] hover:text-white\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"input\",\n {\n type: \"checkbox\",\n className: \"cursor-pointer\",\n checked: filters[filterableColumn.dataKey]?.includes(option),\n onChange: () => handleFilterChange(filterableColumn.dataKey, option)\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"button\", { className: \"flex-1 text-start px-2\", onClick: () => handleFilterChange(filterableColumn.dataKey, option), children: filterableColumn.ui ? filterableColumn.ui(option) : option })\n ] }, i)) })\n ]\n }\n ) })\n ] });\n});\nvar TableHead = (0, import_react5.memo)(() => {\n const {\n headers,\n headerStyle,\n headerCellStyle,\n sortColumn,\n handleSort,\n sortKeys,\n sortOrder,\n filterableColumns = [],\n sortLabel,\n headerClassName,\n headerCellClassName\n } = useTableContext();\n const sortDisplay = (0, import_react5.useMemo)(() => Boolean(sortKeys?.length), [sortKeys]);\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"thead\", { className: cn(\"bg-[#282828] text-white sticky top-0\", headerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"tr\", { style: headerStyle, children: headers.map((header, index) => {\n const filterableColumn = filterableColumns.find((col) => col.header === header);\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\n \"th\",\n {\n title: sortDisplay ? `${sortLabel} ${header}` : header,\n style: headerCellStyle,\n className: cn(\"border-black border-[1px] max-w-[130px] px-2 text-center relative\", headerCellClassName),\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { className: `px-2 ${sortDisplay ? \"cursor-pointer\" : \"\"}`, onClick: () => sortDisplay && handleSort(index), children: header }),\n sortDisplay && sortColumn === index && (sortOrder === \"desc\" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: sortSvg() }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: sortSvg(true) })),\n filterableColumn && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Filter, { filterableColumn, index })\n ]\n },\n index\n );\n }) }) });\n}, renderOnce);\nvar TableBody = (0, import_react5.memo)(() => {\n const { dataToRender } = useTableContext();\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"tbody\", { className: \"divide-y divide-gray-600\", children: dataToRender.renderedData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TableRow2, { item, index }, index)) });\n}, renderOnce);\nvar MaxRowsLabel = (0, import_react5.memo)(() => {\n const { data, dataToRender, maxRowsLabel1, maxRowsLabel2, maxRows, maxRowsContainerClassName } = useTableContext();\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"div\", { className: cn(\"flex justify-start items-center text-lg gap-1\", maxRowsContainerClassName || \"\"), children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { children: maxRowsLabel1 }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { children: maxRows > dataToRender.renderedData.length ? dataToRender.renderedData.length : maxRows }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { children: maxRowsLabel2 }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { children: dataToRender.filtered.length })\n ] });\n}, renderOnce);\nvar ExportToExcel = (0, import_react5.memo)(() => {\n const {\n exportToExcelKeys,\n dataToAddToExcelTable,\n excelFileName,\n dataToRender,\n headers,\n sumColumns,\n exportExcelTitle,\n exportExcelContent,\n exportToExcelClassName\n } = useTableContext();\n const addPropertiesToExcel = (properties) => {\n let newData = [...dataToRender.renderedData];\n let newHeaders = [...headers];\n properties.forEach((val) => {\n newHeaders.unshift(val.header);\n newData = newData.map((v) => ({ ...v, [val.key]: val.value }));\n });\n return { data: newData, headers: newHeaders };\n };\n const onExportExcelClick = async () => {\n if (exportToExcelKeys) {\n const workbook = new import_exceljs.default.Workbook();\n const worksheet = workbook.addWorksheet(\"Sheet1\");\n const dataToExport = dataToAddToExcelTable ? addPropertiesToExcel(dataToAddToExcelTable) : { data: dataToRender.renderedData, headers };\n worksheet.addRow(dataToExport.headers);\n dataToExport.data.forEach((item) => {\n const row = exportToExcelKeys.map((key) => item[key]);\n worksheet.addRow(row);\n });\n if (sumColumns) {\n sumColumns.forEach((val) => {\n const sumRow = worksheet.addRow([]);\n sumRow.getCell(1).value = val.label;\n const value = dataToRender.renderedData.reduce((acc, v) => {\n return acc + Number(v[val.dataKey]) || 0;\n }, 0).toFixed(2);\n sumRow.getCell(2).value = value;\n });\n }\n const buffer = await workbook.xlsx.writeBuffer();\n const blob = new Blob([buffer], { type: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" });\n (0, import_file_saver.saveAs)(blob, `${excelFileName || \"table_data\"}.xlsx`);\n }\n };\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"button\",\n {\n onClick: onExportExcelClick,\n title: exportExcelTitle,\n className: cn(\"px-2 py-[2px] bg-[#547f22] text-white rounded-lg text-[16px]\", exportToExcelClassName),\n children: exportExcelContent || exportToExcelSvg()\n }\n );\n}, renderOnce);\nvar Search = (0, import_react5.memo)(() => {\n const { searchQuery, handleSearch, searchPlaceHolder, searchInputClassName, searchInputStyle } = useTableContext();\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"input\",\n {\n className: cn(\"w-40 border-black border-[1px] text-lg px-2 \", searchInputClassName),\n type: \"text\",\n placeholder: searchPlaceHolder,\n value: searchQuery,\n onChange: handleSearch,\n style: searchInputStyle\n }\n );\n}, renderOnce);\nvar Summary = (0, import_react5.memo)(() => {\n const { summaryContainerStyle, summaryLabelStyle, summaryLabel, summaryRowStyle, sumColumns, dataToRender, direction } = useTableContext();\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\n \"div\",\n {\n style: { ...summaryContainerStyle, direction },\n className: \"w-full h-8 flex justify-between items-center px-3 text-[18px] font-bold\",\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { style: summaryLabelStyle, children: summaryLabel }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { style: summaryRowStyle, className: \"flex gap-3\", children: sumColumns.map((val) => {\n const sum_res = dataToRender.renderedData.reduce((acc, v) => acc + Number(v[val.dataKey]) || 0, 0);\n const sum_value = getFixedNumber(sum_res);\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"div\", { className: \"flex gap-1 justify-start\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { children: val.label }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"span\", { children: \":\" }),\n /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { children: val.ui ? val.ui(sum_value) : sum_value })\n ] }, val.dataKey + val.label);\n }) })\n ]\n }\n );\n}, renderOnce);\nvar TimesUI = ({ timestamp, format, tz, direction, fromFormat, className = \"\" }) => {\n const time = timestamp_to_string(timestamp, { format, fromFormat, tz });\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { style: { direction: \"ltr\" }, className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className), title: time, children: time });\n};\nvar TableButton = ({ onClick, title, className, type, children }) => {\n const icon = {\n add: \"fa-regular fa-plus text-2xl\",\n edit: \"fa-light fa-pen-to-square text-xl\",\n delete: \"fa-light fa-trash text-xl\"\n };\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: type === \"custom\" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"button\", { className, title, onClick, children }) : type === \"add\" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { title, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"i\", { className: cn(\"fa-regular fa-plus text-2xl\", className) }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"button\", { title, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"i\", { className: cn(icon[type], className) }) }) });\n};\nvar DurationUI = ({ duration, hoursLabel = \"h\", minutesLabel = \"m\", secondsLabel = \"s\", className = \"\", direction }) => {\n const durationTime = duration.split(\":\");\n const hours = parseInt(durationTime[0], 10);\n const minutes = parseInt(durationTime[1], 10);\n const isWithSeconds = durationTime.length === 3;\n const seconds = isWithSeconds ? parseInt(durationTime[2], 10) : 0;\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\n \"div\",\n {\n title: duration,\n style: { direction: \"ltr\" },\n className: cn(`flex gap-1 ${direction === \"rtl\" ? \"justify-end\" : \"justify-start\"}`, className),\n children: [\n hours > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [\n /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"span\", { style: { display: \"inline-block\" }, children: [\n hours,\n \" \",\n hoursLabel\n ] }),\n minutes === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"span\", { style: { display: \"inline-block\" }, children: [\n \" \",\n \"0\",\n \" \",\n minutesLabel\n ] })\n ] }),\n minutes > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"span\", { style: { display: \"inline-block\" }, children: [\n \" \",\n minutes,\n \" \",\n minutesLabel\n ] }),\n seconds > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(\"span\", { style: { display: \"inline-block\" }, children: [\n \" \",\n seconds,\n \" \",\n secondsLabel\n ] })\n ]\n }\n );\n};\nvar PhoneUI = ({ phone, direction, className = \"\" }) => {\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"div\", { style: { direction: \"ltr\" }, className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className), title: phone, children: phone });\n};\nvar BooleanUi = ({ value, size, className }) => {\n const icon = value ? \"fa-light fa-check text-green-500\" : \"fa-light fa-xmark text-red-500\";\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"i\", { className: cn(`${icon} ${size === \"small\" ? \"text-lg\" : \"text-2xl\"}`, className) });\n};\nvar GeoUi = ({ value, className, linkUi }) => {\n const lang = value.lng || value.longitude;\n const lat = value.lat || value.latitude;\n const googleMapsLink = getLocationUrl(lang, lat);\n const langLatUi = linkUi || ` ${lang} ${lat}`;\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\"a\", { href: googleMapsLink, target: \"_blank\", className: cn(\"_ellipsis\", className), title: `${lang} ${lat}`, children: langLatUi });\n};\nvar NumberUI = ({ number, direction, className = \"\" }) => {\n return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(\n \"div\",\n {\n style: { direction: \"ltr\" },\n className: cn(`_ellipsis ${direction === \"rtl\" ? \"text-right\" : \"text-left\"}`, className),\n title: String(number),\n children: number\n }\n );\n};\n\n// src/components/forms/ModularForm/ModularForm.tsx\nvar import_react8 = require(\"react\");\n\n// src/components/forms/ModularForm/formElements.tsx\nvar import_react7 = require(\"react\");\n\n// src/components/forms/ModularForm/InternationalPhonePicker.tsx\nvar import_lucide_react4 = require(\"lucide-react\");\nvar import_react6 = require(\"react\");\nvar RPNInput = __toESM(require(\"react-phone-number-input\"));\nvar import_flags = __toESM(require(\"react-phone-number-input/flags\"));\nvar import_jsx_runtime16 = require(\"react/jsx-runtime\");\nfunction InternationalPhonePicker({\n setPhoneValue,\n phoneValue = \"\",\n placeholder = \"\",\n className = \"\",\n containerClassName = \"\",\n defaultCountry = \"IL\",\n flagContainerClassName = \"\",\n inputClassName = \"\",\n defaultValue,\n name,\n style,\n onEnter,\n labelContent,\n labelClassName,\n required,\n direction\n}) {\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\") {\n if (onEnter) {\n onEnter();\n }\n }\n };\n const [tempPhoneValue, setTempPhoneValue] = (0, import_react6.useState)(\"\");\n (0, import_react6.useEffect)(() => {\n if (defaultValue) {\n if (setPhoneValue) {\n setPhoneValue(defaultValue);\n } else {\n setTempPhoneValue(defaultValue);\n }\n }\n }, [defaultValue, setPhoneValue]);\n return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(\"div\", { style: { direction }, className: cn(\"space-y-2\", `${labelContent ? \"flex gap-1 items-center\" : \"\"}`, containerClassName), children: [\n labelContent && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ElementLabel, { labelContent, labelClassName, name, required }),\n /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(\n RPNInput.default,\n {\n style: { direction: \"ltr\" },\n className: cn(\"flex rounded-lg shadow-sm shadow-black/5\", className),\n international: true,\n countries: [\"US\", \"IL\", \"NG\"],\n defaultCountry,\n flagComponent: FlagComponent,\n countrySelectComponent: CountrySelect,\n countrySelectProps: { className: flagContainerClassName },\n inputComponent: PhoneInput,\n numberInputProps: { className: cn(\"min-h-10\", inputClassName), onKeyDown: handleKeyDown, defaultValue, style },\n placeholder,\n value: tempPhoneValue || phoneValue,\n onChange: (newValue) => {\n if (setPhoneValue) {\n return setPhoneValue(newValue ?? \"\");\n }\n setTempPhoneValue(newValue ?? \"\");\n }\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(\"input\", { type: \"hidden\", name, value: tempPhoneValue })\n ] });\n}\nvar PhoneInput = (0, import_react6.forwardRef)(({ className, onKeyDown, defaultValue, style, ...props }, ref) => {\n const inputRef = (0, import_react6.useRef)(null);\n (0, import_react6.useEffect)(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(\n Input,\n {\n className: cn(\"-ms-px rounded-s-none shadow-none focus-visible:z-10 h-full\", className),\n onKeyDown,\n defaultValue,\n style,\n ref: (el) => {\n inputRef.current = el;\n if (typeof ref === \"function\") {\n ref(el);\n } else if (ref) {\n ref.current = el;\n }\n },\n ...props\n }\n );\n});\nPhoneInput.displayName = \"PhoneInput\";\nvar CountrySelect = ({ disabled, value, onChange, options, className }) => {\n const handleSelect = (event) => {\n onChange(event.target.value);\n };\n const originalClassName = (0, import_react6.useMemo)(() => {\n return \"relative inline-flex items-center self-stretch rounded-s-lg border border-input bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50\";\n }, []);\n return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(\"div\", { className: cn(originalClassName, className), children: [\n /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(\"div\", { className: \"inline-flex items-center gap-1\", \"aria-hidden\": \"true\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FlagComponent, { country: value, countryName: value, \"aria-hidden\": \"true\" }),\n /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(\"span\", { className: \"text-muted-foreground/80\", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react4.ChevronDown, { size: 16, strokeWidth: 2, \"aria-hidden\": \"true\" }) })\n ] }),\n /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(\n \"select\",\n {\n disabled,\n value,\n onChange: handleSelect,\n className: \"absolute inset-0 text-sm opacity-0\",\n \"aria-label\": \"Select country\",\n children: options.filter((x) => x.value).map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(\"option\", { className: \"text-black\", value: option.value, children: [\n option.label,\n \" \",\n option.value && `+${RPNInput.getCountryCallingCode(option.value)}`\n ] }, option.value ?? `empty-${i}`))\n }\n )\n ] });\n};\nvar FlagComponent = ({ country, countryName }) => {\n const Flag = import_flags.default[country];\n return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(\"span\", { className: \"w-5 overflow-hidden rounded-sm\", children: Flag ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Flag, { title: countryName }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react4.Phone, { size: 16, \"aria-hidden\": \"true\" }) });\n};\n\n// src/components/forms/ModularForm/formElements.tsx\nvar import_jsx_runtime17 = require(\"react/jsx-runtime\");\nvar InputContainer = ({\n validationError,\n name = \"\",\n inputType = \"text\",\n labelContent = \"\",\n defaultValue = \"\",\n validationName = \"textNumbers\",\n containerClassName = \"\",\n labelClassName = \"\",\n elementClassName = \"\",\n required = false,\n placeholder,\n props,\n minLength,\n onKeyDown,\n onChange\n}) => {\n const handleChangeFunction = (0, import_react7.useCallback)(\n (e) => {\n handleChange(e);\n onChange?.(e);\n },\n [onChange]\n );\n const validationProps = (0, import_react7.useMemo)(() => {\n return { ...useValidation(validationName, validationError), onChange: handleChangeFunction };\n }, [handleChangeFunction]);\n return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(\"div\", { className: cn(`center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ElementLabel, { labelContent, labelClassName, name, required }),\n /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\n \"input\",\n {\n ...props,\n minLength,\n placeholder,\n className: cn(`w-[70%] bg-inherit border-b-[1px] border-black px-2`, elementClassName),\n defaultValue,\n ...validationProps,\n onChange: (e) => handleChangeFunction(e),\n required,\n name,\n onKeyDown,\n type: inputType\n }\n )\n ] });\n};\nvar SelectContainer = ({\n name = \"\",\n labelContent = \"\",\n containerClassName = \"\",\n labelClassName = \"\",\n defaultValue = \"\",\n elementClassName = \"\",\n optionClassName = \"\",\n required = false,\n options = [],\n optionsContainerClassName = \"\",\n onChange\n}) => {\n const [isOpen, setIsOpen] = (0, import_react7.useState)(false);\n const [selectedValue, setSelectedValue] = (0, import_react7.useState)(defaultValue || options[0]?.value || \"\");\n const handleOptionClick = (value) => {\n setSelectedValue(value);\n onChange?.(value);\n setIsOpen(false);\n };\n return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(\"div\", { className: cn(`center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ElementLabel, { labelContent, labelClassName, name, required }),\n /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(\"div\", { className: cn(`w-[70%] relative`, elementClassName), onClick: () => setIsOpen(!isOpen), children: [\n /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"div\", { className: `border-b-[1px] border-black max-h-6 cursor-pointer`, children: options?.find((opt) => opt.value === selectedValue)?.label || selectedValue }),\n isOpen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"i\", { className: \"fa-light fa-chevron-up absolute top-[1px] left-1 cursor-pointer\" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"i\", { className: \"fa-light fa-chevron-down absolute top-[1px] left-1 cursor-pointer\" }),\n isOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"div\", { className: cn(`absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10`, optionsContainerClassName), children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\n \"div\",\n {\n className: `p-2 cursor-pointer hover:bg-gray-200 ${optionClassName}`,\n onClick: () => handleOptionClick(option.value),\n children: option.label\n },\n option.value\n )) }),\n /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"input\", { value: selectedValue, type: \"hidden\", name, required })\n ] })\n ] });\n};\nfunction MultiSelect({\n onChange,\n selectedOptions,\n emptyOptionsElement,\n unremovableOptions,\n options = [],\n styles = {},\n name = \"multipleSelect\",\n placeholder = \"Select items\",\n labelContent,\n required,\n labelClassName,\n groupBy,\n onSearch,\n onSearchSync,\n triggerSearchOnFocus\n}) {\n return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(\"div\", { className: cn(`${labelContent ? \"flex gap-1 items-center\" : \"\"}`, styles.containerClassName), children: [\n labelContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ElementLabel, { labelContent, labelClassName, name, required }),\n /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\n multiselect_default,\n {\n commandProps: {\n label: placeholder\n },\n name,\n defaultOptions: options,\n unremovableOptions,\n value: selectedOptions,\n onChange,\n onSearch,\n onSearchSync,\n triggerSearchOnFocus,\n groupBy,\n placeholder,\n hideClearAllButton: true,\n hidePlaceholderWhenSelected: true,\n badgeClassName: styles.badgeClassName,\n className: styles.className,\n dropdownClassName: styles.dropdownClassName,\n dropdownOptionClassName: styles.dropdownOptionClassName,\n emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"p\", { className: \"text-center text-sm\", children: \"all options selected.\" }),\n emptyIndicatorClassName: styles.emptyIndicatorClassName\n }\n )\n ] });\n}\nvar TextAreaContainer = ({\n name = \"\",\n labelContent = \"\",\n defaultValue = \"\",\n containerClassName = \"\",\n labelClassName = \"\",\n elementClassName = \"\",\n required = false,\n placeholder,\n props,\n minLength,\n onKeyDown,\n onChange\n}) => {\n return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(\"div\", { className: cn(`flex flex-col gap-2 items-center`, containerClassName), children: [\n labelContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\n ElementLabel,\n {\n labelContent,\n labelClassName: `w-fit text-xl px-2 border-b-2 border-[#000] text-center ${labelClassName}`,\n name,\n required,\n withDots: false\n }\n ),\n /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\n \"textarea\",\n {\n ...props,\n onChange,\n minLength,\n placeholder,\n className: cn(`w-full bg-inherit border-[1px] border-black min-h-16 max-h-52 px-2`, elementClassName),\n defaultValue,\n required,\n name,\n onKeyDown\n }\n )\n ] });\n};\nvar ElementLabel = ({\n labelContent,\n labelClassName,\n name,\n required,\n withDots = true\n}) => {\n return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(\"label\", { className: cn(`text-start w-[30%] flex gap-0.5`, labelClassName), htmlFor: name, children: [\n /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"div\", { children: labelContent }),\n required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"div\", { className: \"text-red-500\", children: \"*\" }),\n withDots && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(\"div\", { children: \":\" })\n ] });\n};\n\n// src/components/forms/ModularForm/ModularForm.tsx\nvar import_jsx_runtime18 = require(\"react/jsx-runtime\");\nvar ModularForm = ({\n submitFunction = async (form) => {\n },\n elements = [],\n headerContent,\n buttonContent,\n formClassName = \"\",\n headerClassName = \"\",\n direction = \"rtl\",\n buttonClassName = \"\",\n submitRef\n}) => {\n const [errorMsg, setErrorMsg] = (0, import_react8.useState)(\"\");\n const [isLoading, setIsLoading] = (0, import_react8.useState)(false);\n const onSubmit = async (e) => {\n e.preventDefault();\n setErrorMsg(\"\");\n setIsLoading(true);\n try {\n const form = e.currentTarget;\n elements.forEach((element) => {\n if (element.minLength) {\n const elementValue = getFormElementValue(form, element.name);\n if (elementValue.length < element.minLength) {\n throw element.validationError || `${element.labelContent || element.name} must be at least ${element.minLength} characters`;\n }\n }\n });\n await submitFunction(e);\n } catch (err) {\n if (typeof err === \"string\") {\n setErrorMsg(err);\n }\n if (err.message) {\n setErrorMsg(err.message);\n }\n console.error(\"Error from submit ModularForm:\", err);\n }\n setIsLoading(false);\n };\n return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(\"form\", { onSubmit, style: { direction }, className: cn(`w-[350px] px-5 py-5 flex flex-col gap-5`, formClassName), children: [\n headerContent && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(\"div\", { className: cn(`border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]`, headerClassName), children: headerContent }),\n elements.map((element, index) => {\n switch (element.type) {\n case \"input\":\n return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InputContainer, { ...element }, index);\n case \"textarea\":\n return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TextAreaContainer, { ...element }, index);\n case \"select\":\n return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectContainer, { ...element }, index);\n case \"multiSelect\":\n return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MultiSelect, { ...element }, index);\n case \"internationalPhoneInput\":\n return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InternationalPhonePicker, { ...element }, index);\n case \"custom\":\n return typeof element.element?.type !== \"string\" && (0, import_react8.cloneElement)(element.element, { key: index });\n default:\n return null;\n }\n }),\n /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(\"div\", { className: \"flex justify-between w-full\", children: [\n /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(\"div\", { title: errorMsg, className: \"text-[#f22] text-[18px] max-w-[80%] ellipsis\", children: errorMsg }),\n /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(\n \"button\",\n {\n ref: submitRef,\n disabled: isLoading,\n className: cn(`bg-[#547f22] px-3 py-1 rounded-lg text-white min-w-20`, buttonClassName),\n type: \"submit\",\n children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Loader, { size: 25, color: \"#fff\" }) : buttonContent\n }\n )\n ] })\n ] });\n};\nvar ModularForm_default = ModularForm;\n\n// src/components/forms/index.tsx\nvar import_react9 = require(\"react\");\nvar import_moment2 = __toESM(require(\"moment\"));\nvar import_jsx_runtime19 = require(\"react/jsx-runtime\");\nvar ConfirmForm = ({\n onV,\n onX,\n headline = \"\",\n direction = \"rtl\",\n containerClassName = \"\",\n buttonsContainerClassName = \"\",\n headlineClassName = \"\"\n}) => {\n const onConfirm = async () => {\n try {\n await onV();\n } catch (error) {\n console.error(\"'onV' failed:\", error);\n }\n };\n const onDenied = async () => {\n try {\n await onX();\n } catch (error) {\n console.error(\"'onX' failed:\", error);\n }\n };\n return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(\"div\", { style: { direction, padding: \"30px\" }, className: cn(\"w-full h-full flex flex-col gap-3\", containerClassName), children: [\n /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(\"div\", { className: cn(\"text-lg font-bold\", headlineClassName), children: headline }),\n /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(\"div\", { className: cn(\"flex justify-center items-center gap-2 w-full\", buttonsContainerClassName), children: [\n /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(\"button\", { onClick: onDenied, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RedXSvg, {}) }),\n /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(\"button\", { onClick: onConfirm, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GreenVSvg, {}) })\n ] })\n ] });\n};\nvar DatePicker = ({\n submit = async (form) => {\n },\n formClassName = \"\",\n labelsClassName = \"\",\n inputsClassName = \"\",\n buttonClassName = \"\",\n buttonStyle = {},\n defaultFrom,\n defaultTo,\n direction = \"rtl\",\n fromText = \"From date\",\n toText = \"To date\",\n buttonText = \"Search\"\n}) => {\n const [isLoading, setIsLoading] = (0, import_react9.useState)(false);\n const onSubmit = async (e) => {\n e.preventDefault();\n setIsLoading(true);\n await submit(e);\n setIsLoading(false);\n };\n return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(\"form\", { style: { direction }, onSubmit, className: cn(`w-full h-10 flex justify-start gap-3 items-center `, formClassName), children: [\n /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(\"label\", { className: cn(`center text-[14px] relative gap-2`, labelsClassName), htmlFor: \"from\", children: [\n fromText,\n /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(\n \"input\",\n {\n className: `w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ${inputsClassName}`,\n type: \"date\",\n name: \"from\",\n defaultValue: defaultFrom || (0, import_moment2.default)(/* @__PURE__ */ new Date()).format(\"YYYY-MM-DD\")\n }\n )\n ] }),\n /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(\"label\", { className: cn(`center text-[14px] relative gap-2 `, labelsClassName), htmlFor: \"to\", children: [\n toText,\n /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(\n \"input\",\n {\n className: `w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ${inputsClassName}`,\n type: \"date\",\n name: \"to\",\n defaultValue: defaultTo || (0, import_moment2.default)(/* @__PURE__ */ new Date()).format(\"YYYY-MM-DD\")\n }\n )\n ] }),\n /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(\n \"button\",\n {\n disabled: isLoading,\n style: buttonStyle,\n className: cn(`bg-[#699a2c] text-[#fff] font-[500] w-[75px] h-[27px]`, buttonClassName),\n type: \"submit\",\n children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Loader, { className: \"pt-[2px]\", size: 20, color: \"#fff\" }) : buttonText\n }\n )\n ] });\n};\n\n// src/components/CodeInput.tsx\nvar import_input_otp = require(\"input-otp\");\nvar import_react10 = require(\"react\");\nvar import_jsx_runtime20 = require(\"react/jsx-runtime\");\nfunction CodeInput({ codeValue, setCodeValue, className = \"\", slotContainerClassName = \"\" }) {\n const firstInputRef = (0, import_react10.useRef)(null);\n (0, import_react10.useEffect)(() => {\n if (firstInputRef.current) {\n firstInputRef.current.focus();\n }\n }, []);\n return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(\"div\", { className: cn(\"space-y-2 flex justify-center items-center\", className), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(\n import_input_otp.OTPInput,\n {\n ref: firstInputRef,\n value: codeValue,\n onChange: (newVal) => setCodeValue(newVal),\n containerClassName: \"flex items-center gap-3 has-[:disabled]:opacity-50\",\n maxLength: 6,\n render: ({ slots }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(\"div\", { className: cn(\"flex gap-5\", slotContainerClassName), children: slots.map((slot, idx) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Slot2, { ...slot }, idx)) })\n }\n ) });\n}\nfunction Slot2(props) {\n return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(\n \"div\",\n {\n className: cn(\n \"flex size-9 items-center justify-center rounded-lg border border-input bg-background font-medium text-foreground shadow-sm shadow-black/5 transition-shadow\",\n { \"z-10 border border-ring ring-[3px] ring-ring/20\": props.isActive }\n ),\n children: props.char !== null && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(\"div\", { children: props.char })\n }\n );\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n Badge,\n BooleanUi,\n Button,\n Checkbox,\n CodeInput,\n ConfirmForm,\n DatePicker,\n DurationUI,\n ElementLabel,\n ErrorBoundary,\n ExportToExcel,\n Filter,\n GeoUi,\n Input,\n InputContainer,\n InternationalPhonePicker,\n Loader,\n MaxRowsLabel,\n ModularForm,\n MultiSelect,\n NumberUI,\n PhoneUI,\n ProgressComponent,\n Search,\n SelectContainer,\n Summary,\n Table,\n TableBody,\n TableButton,\n TableCell,\n TableContext,\n TableHead,\n TableProvider,\n TableRow,\n TextAreaContainer,\n TimesUI,\n Version,\n badgeVariants,\n buttonVariants,\n getFixedNumber,\n useDebounce\n});\n"]}
|