@mahatisystems/mahati-ui-components 5.3.0 → 5.3.2
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/index.css +12 -5
- package/dist/index.css.map +1 -1
- package/dist/index.js +61 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +119 -93
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -505,6 +505,17 @@ var ButtonBase = React2.forwardRef(function(_0, _1) {
|
|
|
505
505
|
"style"
|
|
506
506
|
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
507
507
|
var color = getColorByName(name);
|
|
508
|
+
var getHoverStyles = function getHoverStyles() {
|
|
509
|
+
if (iconButtonHoverBgClass) return {};
|
|
510
|
+
if (iconButtonHoverIntensity) {
|
|
511
|
+
var opacity = iconButtonHoverIntensity / 100;
|
|
512
|
+
return {
|
|
513
|
+
"--hover-bg": "rgba(0,0,0,".concat(opacity, ")"),
|
|
514
|
+
"--active-bg": "rgba(0,0,0,".concat(Math.min(opacity + 0.2, 1), ")")
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return {};
|
|
518
|
+
};
|
|
508
519
|
if (iconButton) {
|
|
509
520
|
var height = parseHeightWidth(iconButtonHeightClass);
|
|
510
521
|
var width = parseHeightWidth(iconButtonWidthClass);
|
|
@@ -516,8 +527,11 @@ var ButtonBase = React2.forwardRef(function(_0, _1) {
|
|
|
516
527
|
minHeight: height,
|
|
517
528
|
minWidth: width,
|
|
518
529
|
color: color.startsWith("linear") ? "white" : color
|
|
530
|
+
}, iconButtonHoverIntensity && {
|
|
531
|
+
"--hover-bg": "rgba(0,0,0,".concat(iconButtonHoverIntensity / 100, ")"),
|
|
532
|
+
"--active-bg": "rgba(0,0,0,".concat(Math.min(iconButtonHoverIntensity / 100 + 0.2, 1), ")")
|
|
519
533
|
}, style),
|
|
520
|
-
className: "\n
|
|
534
|
+
className: "\n inline-flex items-center justify-center\n transition-all duration-200\n ".concat(iconButtonRadiusClass || "rounded-md", "\n ").concat(iconButtonBgPaddingClass || "p-[2px]", "\n ").concat(iconButtonBgClass || "bg-white/10", "\n\n ").concat(iconButtonHoverBgClass ? iconButtonHoverBgClass : iconButtonHoverIntensity ? "hover:bg-[var(--hover-bg)] active:bg-[var(--active-bg)]" : "hover:opacity-85 active:opacity-70", "\n\n ").concat(className || "", "\n")
|
|
521
535
|
}, props), {
|
|
522
536
|
children: children
|
|
523
537
|
}));
|
|
@@ -532,7 +546,10 @@ var ButtonBase = React2.forwardRef(function(_0, _1) {
|
|
|
532
546
|
}, style) : style,
|
|
533
547
|
className: "\n inline-flex items-center justify-center\n whitespace-nowrap\n font-medium\n text-[14px]\n transition-all duration-200\n cursor-pointer\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-400\n disabled:pointer-events-none disabled:opacity-50\n ".concat(!name ? variantClasses[variant] : "", "\n ").concat(sizeClasses[size], "\n ").concat(className || "", "\n ")
|
|
534
548
|
}, props), {
|
|
535
|
-
children:
|
|
549
|
+
children: /* @__PURE__ */ jsx2("span", {
|
|
550
|
+
className: "".concat(iconButtonBgPaddingClass || "p-[2px]", " flex items-center justify-center"),
|
|
551
|
+
children: children
|
|
552
|
+
})
|
|
536
553
|
}));
|
|
537
554
|
});
|
|
538
555
|
ButtonBase.displayName = "Button";
|
|
@@ -815,7 +832,7 @@ var FormContainer = function FormContainer(param) {
|
|
|
815
832
|
FormContainer.displayName = "FormContainer";
|
|
816
833
|
// src/components/Input.tsx
|
|
817
834
|
import React5 from "react";
|
|
818
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
835
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
819
836
|
var Input = React5.forwardRef(function(_0, _1) {
|
|
820
837
|
var _ref = [
|
|
821
838
|
_0,
|
|
@@ -832,14 +849,12 @@ var Input = React5.forwardRef(function(_0, _1) {
|
|
|
832
849
|
if (props.disabled) return;
|
|
833
850
|
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
834
851
|
};
|
|
835
|
-
return /* @__PURE__ */ jsxs4(
|
|
836
|
-
"data-testid": testId,
|
|
837
|
-
className: "flex flex-col w-full mb-4",
|
|
852
|
+
return /* @__PURE__ */ jsxs4(Fragment2, {
|
|
838
853
|
children: [
|
|
839
854
|
/* @__PURE__ */ jsx6("input", _object_spread({
|
|
840
855
|
ref: ref,
|
|
841
|
-
onChange: handleChange,
|
|
842
856
|
"data-testid": testId ? "".concat(testId, "-input") : void 0,
|
|
857
|
+
onChange: handleChange,
|
|
843
858
|
className: "\n w-full max-w-full min-w-0\n h-[44px]\n px-3\n text-base\n rounded-md\n border\n outline-none\n box-border\n transition-all duration-200\n\n ".concat(hasError ? "border-red-500 focus:border-red-600 focus:ring-2 focus:ring-red-100" : "border-[#D9D9D9] focus:border-blue-500 focus:ring-2 focus:ring-blue-100 hover:border-gray-400 focus:border-blue-500", "\n\n disabled:bg-gray-100\n disabled:text-gray-400\n disabled:border-gray-200\n disabled:cursor-not-allowed\n\n file:py-2 file:px-3 file:cursor-pointer\n\n placeholder:text-gray-400\n\n ").concat(className, "\n ")
|
|
844
859
|
}, props)),
|
|
845
860
|
hasError && errorMessage && /* @__PURE__ */ jsx6("span", {
|
|
@@ -859,7 +874,7 @@ import { createPortal } from "react-dom";
|
|
|
859
874
|
import { useState as useState3, useEffect as useEffect2, useRef } from "react";
|
|
860
875
|
import { HiOutlineClock, HiChevronDown, HiChevronLeft, HiChevronRight } from "react-icons/hi";
|
|
861
876
|
import { HiCalendarDays } from "react-icons/hi2";
|
|
862
|
-
import { Fragment as
|
|
877
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
863
878
|
var convertToDateString = function convertToDateString(date) {
|
|
864
879
|
if (!date) return "";
|
|
865
880
|
var year = date.year;
|
|
@@ -1960,7 +1975,7 @@ var Calendar = function Calendar(param) {
|
|
|
1960
1975
|
marginBottom: scale * 24,
|
|
1961
1976
|
width: "100%"
|
|
1962
1977
|
},
|
|
1963
|
-
children: enableRangeSelection ? /* @__PURE__ */ jsxs5(
|
|
1978
|
+
children: enableRangeSelection ? /* @__PURE__ */ jsxs5(Fragment3, {
|
|
1964
1979
|
children: [
|
|
1965
1980
|
/* @__PURE__ */ jsxs5("button", {
|
|
1966
1981
|
type: "button",
|
|
@@ -2030,7 +2045,7 @@ var Calendar = function Calendar(param) {
|
|
|
2030
2045
|
]
|
|
2031
2046
|
})
|
|
2032
2047
|
]
|
|
2033
|
-
}) : /* @__PURE__ */ jsxs5(
|
|
2048
|
+
}) : /* @__PURE__ */ jsxs5(Fragment3, {
|
|
2034
2049
|
children: [
|
|
2035
2050
|
/* @__PURE__ */ jsxs5("button", {
|
|
2036
2051
|
type: "button",
|
|
@@ -2162,7 +2177,7 @@ var Calendar = function Calendar(param) {
|
|
|
2162
2177
|
]
|
|
2163
2178
|
})
|
|
2164
2179
|
}),
|
|
2165
|
-
!showTimeSelector ? /* @__PURE__ */ jsxs5(
|
|
2180
|
+
!showTimeSelector ? /* @__PURE__ */ jsxs5(Fragment3, {
|
|
2166
2181
|
children: [
|
|
2167
2182
|
/* @__PURE__ */ jsx7("div", {
|
|
2168
2183
|
className: "grid grid-cols-7",
|
|
@@ -2235,7 +2250,7 @@ var Calendar = function Calendar(param) {
|
|
|
2235
2250
|
};
|
|
2236
2251
|
Calendar.displayName = "Calendar";
|
|
2237
2252
|
// src/components/Filter.tsx
|
|
2238
|
-
import { Fragment as
|
|
2253
|
+
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2239
2254
|
var DEFAULT_ACTIVITY_OPTIONS = [
|
|
2240
2255
|
{
|
|
2241
2256
|
label: "Select Activity",
|
|
@@ -2534,7 +2549,7 @@ var MahatiActivity = function MahatiActivity(param) {
|
|
|
2534
2549
|
return document.removeEventListener("mousedown", handler);
|
|
2535
2550
|
};
|
|
2536
2551
|
}, []);
|
|
2537
|
-
return /* @__PURE__ */ jsxs6(
|
|
2552
|
+
return /* @__PURE__ */ jsxs6(Fragment4, {
|
|
2538
2553
|
children: [
|
|
2539
2554
|
/* @__PURE__ */ jsxs6("div", {
|
|
2540
2555
|
"data-testid": testId ? "".concat(testId, "-trigger") : void 0,
|
|
@@ -2622,7 +2637,7 @@ var MahatiStatus = function MahatiStatus(param) {
|
|
|
2622
2637
|
return document.removeEventListener("mousedown", handler);
|
|
2623
2638
|
};
|
|
2624
2639
|
}, []);
|
|
2625
|
-
return /* @__PURE__ */ jsxs6(
|
|
2640
|
+
return /* @__PURE__ */ jsxs6(Fragment4, {
|
|
2626
2641
|
children: [
|
|
2627
2642
|
/* @__PURE__ */ jsxs6("div", {
|
|
2628
2643
|
"data-testid": testId ? "".concat(testId, "-trigger") : void 0,
|
|
@@ -2686,7 +2701,7 @@ MahatiStatus.displayName = "MahatiStatus";
|
|
|
2686
2701
|
MahatiSearch.displayName = "MahatiSearch";
|
|
2687
2702
|
// src/components/TabbedInterface.tsx
|
|
2688
2703
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
2689
|
-
import { Fragment as
|
|
2704
|
+
import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2690
2705
|
var getFontFamily = function getFontFamily(font) {
|
|
2691
2706
|
if (!font) return "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";
|
|
2692
2707
|
var lower = font.toLowerCase().trim();
|
|
@@ -2762,7 +2777,7 @@ var TabbedInterface = function TabbedInterface(param) {
|
|
|
2762
2777
|
if (!draggableTabs) return;
|
|
2763
2778
|
setDraggingIndex(null);
|
|
2764
2779
|
};
|
|
2765
|
-
var headerButtons = /* @__PURE__ */ jsx9(
|
|
2780
|
+
var headerButtons = /* @__PURE__ */ jsx9(Fragment5, {
|
|
2766
2781
|
children: tabs.map(function(tab, index) {
|
|
2767
2782
|
var active = index === activeIndex;
|
|
2768
2783
|
var isDragging = draggableTabs && draggingIndex === index;
|
|
@@ -2951,7 +2966,7 @@ Dropdown.displayName = "Dropdown";
|
|
|
2951
2966
|
// src/components/TableWithTab.tsx
|
|
2952
2967
|
import React10, { useEffect as useEffect6, useState as useState7 } from "react";
|
|
2953
2968
|
import { XMarkIcon } from "@heroicons/react/24/outline";
|
|
2954
|
-
import { Fragment as
|
|
2969
|
+
import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2955
2970
|
var getFontFamily2 = function getFontFamily2(font) {
|
|
2956
2971
|
if (!font) return "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";
|
|
2957
2972
|
var lower = font.toLowerCase().trim();
|
|
@@ -2972,7 +2987,7 @@ function renderCellValue(value) {
|
|
|
2972
2987
|
if (Array.isArray(value)) {
|
|
2973
2988
|
if (value.some(function(v) {
|
|
2974
2989
|
return React10.isValidElement(v);
|
|
2975
|
-
})) return /* @__PURE__ */ jsx11(
|
|
2990
|
+
})) return /* @__PURE__ */ jsx11(Fragment6, {
|
|
2976
2991
|
children: value
|
|
2977
2992
|
});
|
|
2978
2993
|
return value.join(", ");
|
|
@@ -3221,7 +3236,7 @@ TableWithTab.displayName = "TableWithTab";
|
|
|
3221
3236
|
// src/components/Table.tsx
|
|
3222
3237
|
import React11, { useState as useState8 } from "react";
|
|
3223
3238
|
import { ArrowDownOnSquareIcon, XMarkIcon as XMarkIcon2 } from "@heroicons/react/24/outline";
|
|
3224
|
-
import { Fragment as
|
|
3239
|
+
import { Fragment as Fragment7, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3225
3240
|
var Table = function Table(param) {
|
|
3226
3241
|
var headers = param.headers, data = param.data, page = param.page, setPage = param.setPage, limit = param.limit, setLimit = param.setLimit, totalCount = param.totalCount, highlightRowColor = param.highlightRowColor, actions = param.actions, paginationRequired = param.paginationRequired, _param_paginationPosition = param.paginationPosition, paginationPosition = _param_paginationPosition === void 0 ? "bottom-center" : _param_paginationPosition, onDownloadPDF = param.onDownloadPDF, onDownloadExcel = param.onDownloadExcel, _param_searchable = param.searchable, searchable = _param_searchable === void 0 ? false : _param_searchable, _param_searchTerm = param.searchTerm, searchTerm = _param_searchTerm === void 0 ? "" : _param_searchTerm, onResetSearch = param.onResetSearch, onSearch = param.onSearch, _param_searchModeOptions = param.searchModeOptions, searchModeOptions = _param_searchModeOptions === void 0 ? [
|
|
3227
3242
|
"includes",
|
|
@@ -3293,7 +3308,7 @@ var Table = function Table(param) {
|
|
|
3293
3308
|
if (Array.isArray(value)) {
|
|
3294
3309
|
if (value.some(function(item) {
|
|
3295
3310
|
return React11.isValidElement(item);
|
|
3296
|
-
})) return /* @__PURE__ */ jsx12(
|
|
3311
|
+
})) return /* @__PURE__ */ jsx12(Fragment7, {
|
|
3297
3312
|
children: value
|
|
3298
3313
|
});
|
|
3299
3314
|
return value.join(", ");
|
|
@@ -3313,7 +3328,7 @@ var Table = function Table(param) {
|
|
|
3313
3328
|
}
|
|
3314
3329
|
return String(value);
|
|
3315
3330
|
};
|
|
3316
|
-
return /* @__PURE__ */ jsxs10(
|
|
3331
|
+
return /* @__PURE__ */ jsxs10(Fragment7, {
|
|
3317
3332
|
children: [
|
|
3318
3333
|
(searchable || onDownloadExcel || onDownloadPDF) && /* @__PURE__ */ jsxs10("div", {
|
|
3319
3334
|
className: "mb-3 flex flex-wrap justify-between gap-3",
|
|
@@ -3484,7 +3499,7 @@ var Table = function Table(param) {
|
|
|
3484
3499
|
});
|
|
3485
3500
|
};
|
|
3486
3501
|
// src/components/MahatiChartAnalyticsWidget.tsx
|
|
3487
|
-
import { useMemo as useMemo3, useState as useState12 } from "react";
|
|
3502
|
+
import { useMemo as useMemo3, useState as useState12, useEffect as useEffect9 } from "react";
|
|
3488
3503
|
// src/components/ChartDropdown.tsx
|
|
3489
3504
|
import { useEffect as useEffect7, useMemo, useRef as useRef4, useState as useState9 } from "react";
|
|
3490
3505
|
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
@@ -5637,7 +5652,7 @@ var CalendarHeatmapChart = function CalendarHeatmapChart(param) {
|
|
|
5637
5652
|
};
|
|
5638
5653
|
CalendarHeatmapChart.displayName = "CalendarHeatmapChart";
|
|
5639
5654
|
// src/components/LollipopChart.tsx
|
|
5640
|
-
import { Fragment as
|
|
5655
|
+
import { Fragment as Fragment8, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5641
5656
|
var DEFAULT_COLORS = [
|
|
5642
5657
|
"rgba(37,99,235,1)",
|
|
5643
5658
|
"rgba(16,185,129,1)",
|
|
@@ -5718,7 +5733,7 @@ var LollipopChart = function LollipopChart(param) {
|
|
|
5718
5733
|
className: "flex-1 flex flex-col gap-4 py-4 min-h-[300px] relative overflow-visible",
|
|
5719
5734
|
children: /* @__PURE__ */ jsx20("div", {
|
|
5720
5735
|
className: "w-full overflow-x-visible lg:overflow-x-auto",
|
|
5721
|
-
children: orientation === "horizontal" ? /* @__PURE__ */ jsxs17(
|
|
5736
|
+
children: orientation === "horizontal" ? /* @__PURE__ */ jsxs17(Fragment8, {
|
|
5722
5737
|
children: [
|
|
5723
5738
|
/* @__PURE__ */ jsxs17("div", {
|
|
5724
5739
|
className: "flex flex-col gap-4 relative pl-[140px] w-full min-w-[800px] lg:min-w-0",
|
|
@@ -6101,7 +6116,7 @@ var ColumnChart = function ColumnChart(param) {
|
|
|
6101
6116
|
ColumnChart.displayName = "ColumnChart";
|
|
6102
6117
|
// src/components/KPIChart.tsx
|
|
6103
6118
|
import React16, { useMemo as useMemo2, useState as useState10, useRef as useRef5, useEffect as useEffect8 } from "react";
|
|
6104
|
-
import { Fragment as
|
|
6119
|
+
import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6105
6120
|
var createLinearPath = function createLinearPath(points) {
|
|
6106
6121
|
if (points.length === 0) return "";
|
|
6107
6122
|
if (points.length === 1) return "M ".concat(points[0].x, ",").concat(points[0].y);
|
|
@@ -6542,7 +6557,7 @@ var KPIChart = function KPIChart(param) {
|
|
|
6542
6557
|
transition: "d 0.4s ease-in-out, stroke 0.3s ease-in-out"
|
|
6543
6558
|
}
|
|
6544
6559
|
}),
|
|
6545
|
-
hoveredIndex !== null && points[hoveredIndex] && !isNaN(points[hoveredIndex].x) && /* @__PURE__ */ jsxs19(
|
|
6560
|
+
hoveredIndex !== null && points[hoveredIndex] && !isNaN(points[hoveredIndex].x) && /* @__PURE__ */ jsxs19(Fragment9, {
|
|
6546
6561
|
children: [
|
|
6547
6562
|
/* @__PURE__ */ jsx22("line", {
|
|
6548
6563
|
x1: points[hoveredIndex].x,
|
|
@@ -7153,7 +7168,7 @@ var StackBarChart = function StackBarChart(param) {
|
|
|
7153
7168
|
};
|
|
7154
7169
|
StackBarChart.displayName = "StackBarChart";
|
|
7155
7170
|
// src/components/MahatiChartAnalyticsWidget.tsx
|
|
7156
|
-
import { Fragment as
|
|
7171
|
+
import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7157
7172
|
var assetSrc3 = function assetSrc3(m) {
|
|
7158
7173
|
if (typeof m === "string") return m;
|
|
7159
7174
|
var anyM = m;
|
|
@@ -7261,6 +7276,12 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7261
7276
|
var _useState12 = _sliced_to_array(useState12(initialChartType), 2), chartType = _useState12[0], setChartType = _useState12[1];
|
|
7262
7277
|
var _useState121 = _sliced_to_array(useState12("Project 1"), 2), selectedGanttProject = _useState121[0], setSelectedGanttProject = _useState121[1];
|
|
7263
7278
|
var _useState122 = _sliced_to_array(useState12("Project 1"), 2), selectedCalendarHeatmapProject = _useState122[0], setSelectedCalendarHeatmapProject = _useState122[1];
|
|
7279
|
+
var _useState123 = _sliced_to_array(useState12(selectedFilters), 2), localFilters = _useState123[0], setLocalFilters = _useState123[1];
|
|
7280
|
+
useEffect9(function() {
|
|
7281
|
+
setLocalFilters(selectedFilters);
|
|
7282
|
+
}, [
|
|
7283
|
+
selectedFilters
|
|
7284
|
+
]);
|
|
7264
7285
|
var currentFilters = useMemo3(function() {
|
|
7265
7286
|
if (chartFilters && chartFilters[chartType]) return chartFilters[chartType] || [];
|
|
7266
7287
|
return filters;
|
|
@@ -7299,8 +7320,8 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7299
7320
|
var currentGanttData = useMemo3(function() {
|
|
7300
7321
|
if (chartType === "gantt" && ganttData) {
|
|
7301
7322
|
var _ganttData_year;
|
|
7302
|
-
var year =
|
|
7303
|
-
var type =
|
|
7323
|
+
var year = localFilters["SelectYear"] || "2026";
|
|
7324
|
+
var type = localFilters["SelectType"] || "Development";
|
|
7304
7325
|
var baseData = (_ganttData_year = ganttData[year]) === null || _ganttData_year === void 0 ? void 0 : _ganttData_year[type];
|
|
7305
7326
|
if (!baseData) return void 0;
|
|
7306
7327
|
if (selectedGanttProject === "Project 2") {
|
|
@@ -7332,8 +7353,8 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7332
7353
|
]);
|
|
7333
7354
|
var currentHorizontalBarTopPerformer = useMemo3(function() {
|
|
7334
7355
|
if (chartType !== "horizontalbar" || !horizontalBarData) return void 0;
|
|
7335
|
-
var selectedYear =
|
|
7336
|
-
var selectedMonth =
|
|
7356
|
+
var selectedYear = localFilters["SelectYear"] || "2026";
|
|
7357
|
+
var selectedMonth = localFilters["SelectMonth"] || "January";
|
|
7337
7358
|
var yearData = horizontalBarData[selectedYear];
|
|
7338
7359
|
var monthData = yearData === null || yearData === void 0 ? void 0 : yearData[selectedMonth];
|
|
7339
7360
|
if (!monthData) return void 0;
|
|
@@ -7407,8 +7428,8 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7407
7428
|
}
|
|
7408
7429
|
};
|
|
7409
7430
|
if (chartType !== "calendarheatmap" || !calendarheatmapData) return empty;
|
|
7410
|
-
var year =
|
|
7411
|
-
var type =
|
|
7431
|
+
var year = localFilters["SelectYear"] || "2026";
|
|
7432
|
+
var type = localFilters["SelectType"] || "Development";
|
|
7412
7433
|
var project = selectedCalendarHeatmapProject;
|
|
7413
7434
|
if (!((_calendarheatmapData_project = calendarheatmapData[project]) === null || _calendarheatmapData_project === void 0 ? void 0 : (_calendarheatmapData_project_year = _calendarheatmapData_project[year]) === null || _calendarheatmapData_project_year === void 0 ? void 0 : _calendarheatmapData_project_year[type])) return empty;
|
|
7414
7435
|
var yearData = calendarheatmapData[project][year][type];
|
|
@@ -7521,9 +7542,9 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7521
7542
|
};
|
|
7522
7543
|
var currentBulletData = useMemo3(function() {
|
|
7523
7544
|
if (!bulletData) return null;
|
|
7524
|
-
var year =
|
|
7525
|
-
var month =
|
|
7526
|
-
var type =
|
|
7545
|
+
var year = localFilters.SelectYear || "2026";
|
|
7546
|
+
var month = localFilters.SelectMonth || "January";
|
|
7547
|
+
var type = localFilters.SelectType || "Sales";
|
|
7527
7548
|
var yearData = bulletData[year];
|
|
7528
7549
|
if (yearData) {
|
|
7529
7550
|
var typeData = yearData[type];
|
|
@@ -7808,9 +7829,10 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7808
7829
|
},
|
|
7809
7830
|
children: /* @__PURE__ */ jsx25(ChartDropdown, {
|
|
7810
7831
|
options: options,
|
|
7811
|
-
value:
|
|
7832
|
+
value: localFilters[filter.id],
|
|
7812
7833
|
onSelect: function onSelect(val) {
|
|
7813
|
-
|
|
7834
|
+
var updated = _object_spread_props(_object_spread({}, localFilters), _define_property({}, filter.id, String(val)));
|
|
7835
|
+
setLocalFilters(updated);
|
|
7814
7836
|
},
|
|
7815
7837
|
variant: "mahatiFilter",
|
|
7816
7838
|
label: filter.label
|
|
@@ -7820,7 +7842,8 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
7820
7842
|
/* @__PURE__ */ jsx25("button", {
|
|
7821
7843
|
type: "button",
|
|
7822
7844
|
onClick: function onClick() {
|
|
7823
|
-
|
|
7845
|
+
onApplyFilters === null || onApplyFilters === void 0 ? void 0 : onApplyFilters(localFilters);
|
|
7846
|
+
onFiltersChange(localFilters);
|
|
7824
7847
|
},
|
|
7825
7848
|
className: "w-[77px] h-[30px] rounded border border-[rgba(23,97,163,1)] bg-gradient-to-r from-[rgba(23,97,163,1)] to-[rgba(77,175,131,1)] text-white text-sm font-medium cursor-pointer transition-opacity hover:opacity-90",
|
|
7826
7849
|
children: "Apply"
|
|
@@ -8103,8 +8126,8 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
8103
8126
|
children: [
|
|
8104
8127
|
function() {
|
|
8105
8128
|
var _gaugeData_gauges, _gaugeData_sy_sm2, _gaugeData_sy;
|
|
8106
|
-
var sy =
|
|
8107
|
-
var sm2 =
|
|
8129
|
+
var sy = localFilters["SelectYear"] || "2026";
|
|
8130
|
+
var sm2 = localFilters["SelectMonth"] || "January";
|
|
8108
8131
|
var currentGauge = ((_gaugeData_gauges = gaugeData.gauges) === null || _gaugeData_gauges === void 0 ? void 0 : _gaugeData_gauges.length) > 0 ? gaugeData.gauges[0] : null;
|
|
8109
8132
|
if (((_gaugeData_sy = gaugeData[sy]) === null || _gaugeData_sy === void 0 ? void 0 : (_gaugeData_sy_sm2 = _gaugeData_sy[sm2]) === null || _gaugeData_sy_sm2 === void 0 ? void 0 : _gaugeData_sy_sm2.length) > 0) currentGauge = gaugeData[sy][sm2][0];
|
|
8110
8133
|
if (!currentGauge) return null;
|
|
@@ -8254,9 +8277,9 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
8254
8277
|
children: [
|
|
8255
8278
|
function() {
|
|
8256
8279
|
var _riskGaugeData_gauges, _riskGaugeData_sy_sm2_st, _riskGaugeData_sy_sm2, _riskGaugeData_sy;
|
|
8257
|
-
var sy =
|
|
8258
|
-
var sm2 =
|
|
8259
|
-
var st =
|
|
8280
|
+
var sy = localFilters["SelectYear"] || "2026";
|
|
8281
|
+
var sm2 = localFilters["SelectMonth"] || "January";
|
|
8282
|
+
var st = localFilters["SelectType"] || "Credit Score";
|
|
8260
8283
|
var currentRiskGauge = ((_riskGaugeData_gauges = riskGaugeData.gauges) === null || _riskGaugeData_gauges === void 0 ? void 0 : _riskGaugeData_gauges.length) > 0 ? riskGaugeData.gauges[0] : null;
|
|
8261
8284
|
if (((_riskGaugeData_sy = riskGaugeData[sy]) === null || _riskGaugeData_sy === void 0 ? void 0 : (_riskGaugeData_sy_sm2 = _riskGaugeData_sy[sm2]) === null || _riskGaugeData_sy_sm2 === void 0 ? void 0 : (_riskGaugeData_sy_sm2_st = _riskGaugeData_sy_sm2[st]) === null || _riskGaugeData_sy_sm2_st === void 0 ? void 0 : _riskGaugeData_sy_sm2_st.length) > 0) currentRiskGauge = riskGaugeData[sy][sm2][st][0];
|
|
8262
8285
|
if (!currentRiskGauge) return null;
|
|
@@ -8895,7 +8918,7 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
8895
8918
|
}).findIndex(function(i) {
|
|
8896
8919
|
return i.name === topPerformer.name;
|
|
8897
8920
|
}) + 1;
|
|
8898
|
-
return /* @__PURE__ */ jsxs22(
|
|
8921
|
+
return /* @__PURE__ */ jsxs22(Fragment10, {
|
|
8899
8922
|
children: [
|
|
8900
8923
|
/* @__PURE__ */ jsx25("div", {
|
|
8901
8924
|
className: "text-base font-semibold text-[rgba(23,97,163,1)] font-[Poppins,sans-serif] mb-5",
|
|
@@ -8975,9 +8998,9 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
8975
8998
|
function() {
|
|
8976
8999
|
var _columnChartData_sy_sm2, _columnChartData_sy, _columnChartData_prevYear_prevMonth, _columnChartData_prevYear;
|
|
8977
9000
|
if (!columnChartData) return null;
|
|
8978
|
-
var sy =
|
|
8979
|
-
var sm2 =
|
|
8980
|
-
var st =
|
|
9001
|
+
var sy = localFilters["SelectYear"] || "2026";
|
|
9002
|
+
var sm2 = localFilters["SelectMonth"] || "January";
|
|
9003
|
+
var st = localFilters["SelectType"] || "Category A";
|
|
8981
9004
|
var typeData = (columnChartData === null || columnChartData === void 0 ? void 0 : (_columnChartData_sy = columnChartData[sy]) === null || _columnChartData_sy === void 0 ? void 0 : (_columnChartData_sy_sm2 = _columnChartData_sy[sm2]) === null || _columnChartData_sy_sm2 === void 0 ? void 0 : _columnChartData_sy_sm2[st]) || [];
|
|
8982
9005
|
var currentTotal = typeData.reduce(function(sum, item) {
|
|
8983
9006
|
return sum + item.value;
|
|
@@ -9136,8 +9159,8 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
9136
9159
|
function() {
|
|
9137
9160
|
var _groupBarData_sy, _groupBarData_prevYear;
|
|
9138
9161
|
if (!groupBarData) return null;
|
|
9139
|
-
var sy =
|
|
9140
|
-
var sm2 =
|
|
9162
|
+
var sy = localFilters["SelectYear"] || "2026";
|
|
9163
|
+
var sm2 = localFilters["SelectMonth"] || "January";
|
|
9141
9164
|
var groups = (groupBarData === null || groupBarData === void 0 ? void 0 : (_groupBarData_sy = groupBarData[sy]) === null || _groupBarData_sy === void 0 ? void 0 : _groupBarData_sy[sm2]) || [];
|
|
9142
9165
|
if (!groups.length) return null;
|
|
9143
9166
|
var legends = groupBarData.legends || [];
|
|
@@ -9632,9 +9655,9 @@ var MahatiChartAnalyticsWidget = function MahatiChartAnalyticsWidget(param) {
|
|
|
9632
9655
|
function() {
|
|
9633
9656
|
var _currentFilters_, _currentFilters_1, _currentFilters_2, _currentFilters_3, _currentFilters_4, _currentFilters_5, _yearData_month;
|
|
9634
9657
|
var f0 = (_currentFilters_ = currentFilters[0]) === null || _currentFilters_ === void 0 ? void 0 : _currentFilters_.id, f1 = (_currentFilters_1 = currentFilters[1]) === null || _currentFilters_1 === void 0 ? void 0 : _currentFilters_1.id, f2 = (_currentFilters_2 = currentFilters[2]) === null || _currentFilters_2 === void 0 ? void 0 : _currentFilters_2.id;
|
|
9635
|
-
var year =
|
|
9636
|
-
var month =
|
|
9637
|
-
var category =
|
|
9658
|
+
var year = localFilters[f0] || ((_currentFilters_3 = currentFilters[0]) === null || _currentFilters_3 === void 0 ? void 0 : _currentFilters_3.options[0]) || "2026";
|
|
9659
|
+
var month = localFilters[f1] || ((_currentFilters_4 = currentFilters[1]) === null || _currentFilters_4 === void 0 ? void 0 : _currentFilters_4.options[0]) || "January";
|
|
9660
|
+
var category = localFilters[f2] || ((_currentFilters_5 = currentFilters[2]) === null || _currentFilters_5 === void 0 ? void 0 : _currentFilters_5.options[0]) || "Category A";
|
|
9638
9661
|
var yearData = (lollipopData === null || lollipopData === void 0 ? void 0 : lollipopData[year]) || {};
|
|
9639
9662
|
var catData = (yearData === null || yearData === void 0 ? void 0 : (_yearData_month = yearData[month]) === null || _yearData_month === void 0 ? void 0 : _yearData_month[category]) || [];
|
|
9640
9663
|
var bestItem = catData.length ? catData.reduce(function(max, i) {
|
|
@@ -10040,7 +10063,7 @@ var TopPerformerCard = function TopPerformerCard(param) {
|
|
|
10040
10063
|
};
|
|
10041
10064
|
// src/components/Tooltip.tsx
|
|
10042
10065
|
import React19, { useState as useState13 } from "react";
|
|
10043
|
-
import { Fragment as
|
|
10066
|
+
import { Fragment as Fragment11, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
10044
10067
|
var Tooltip2 = function Tooltip2(param) {
|
|
10045
10068
|
var text = param.text, _param_position = param.position, position = _param_position === void 0 ? "top" : _param_position, children = param.children, _param_variant = param.variant, variant = _param_variant === void 0 ? "default" : _param_variant, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, textColor = param.textColor, backgroundColor = param.backgroundColor, image = param.image, testId = param.testId, animation = param.animation;
|
|
10046
10069
|
var _useState13 = _sliced_to_array(useState13(false), 2), visible = _useState13[0], setVisible = _useState13[1];
|
|
@@ -10169,7 +10192,7 @@ var Tooltip2 = function Tooltip2(param) {
|
|
|
10169
10192
|
isActive: showAnimation
|
|
10170
10193
|
}, animation.props));
|
|
10171
10194
|
};
|
|
10172
|
-
if (!hasContent) return /* @__PURE__ */ jsx26(
|
|
10195
|
+
if (!hasContent) return /* @__PURE__ */ jsx26(Fragment11, {
|
|
10173
10196
|
children: children
|
|
10174
10197
|
});
|
|
10175
10198
|
var variantStyle = variant === "default" ? "bg-gradient-to-r from-[#1761A3] to-[#4DAF83] text-white text-[11px]" : "bg-white/95 text-gray-700 border border-gray-200 text-[13px]";
|
|
@@ -10231,7 +10254,7 @@ var Tooltip2 = function Tooltip2(param) {
|
|
|
10231
10254
|
};
|
|
10232
10255
|
Tooltip2.displayName = "Tooltip";
|
|
10233
10256
|
// src/components/ToastMessage.tsx
|
|
10234
|
-
import React20, { useEffect as
|
|
10257
|
+
import React20, { useEffect as useEffect10 } from "react";
|
|
10235
10258
|
import ReactDOM from "react-dom";
|
|
10236
10259
|
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10237
10260
|
var getStripGradient = function getStripGradient(type) {
|
|
@@ -10356,7 +10379,7 @@ var ToastMessage = React20.forwardRef(function(_0, _1) {
|
|
|
10356
10379
|
var backgroundClass = background === "transparent" ? "bg-white" : "";
|
|
10357
10380
|
var displayTitle = customTitle !== null && customTitle !== void 0 ? customTitle : type.charAt(0).toUpperCase() + type.slice(1);
|
|
10358
10381
|
var hasActions = action && action.length > 0;
|
|
10359
|
-
|
|
10382
|
+
useEffect10(function() {
|
|
10360
10383
|
if (!onClose) return;
|
|
10361
10384
|
if (duration <= 0) return;
|
|
10362
10385
|
var timer = setTimeout(onClose, duration);
|
|
@@ -10454,7 +10477,7 @@ var ToastMessage = React20.forwardRef(function(_0, _1) {
|
|
|
10454
10477
|
});
|
|
10455
10478
|
ToastMessage.displayName = "ToastMessage";
|
|
10456
10479
|
// src/components/ConfettiExplosion.tsx
|
|
10457
|
-
import { useState as useState14, useEffect as
|
|
10480
|
+
import { useState as useState14, useEffect as useEffect11, useRef as useRef6, useMemo as useMemo4 } from "react";
|
|
10458
10481
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
10459
10482
|
var ConfettiExplosion = function ConfettiExplosion(param) {
|
|
10460
10483
|
var testId = param.testId, isActive = param.isActive, _param_particleCount = param.particleCount, particleCount = _param_particleCount === void 0 ? 150 : _param_particleCount, _param_duration = param.duration, duration = _param_duration === void 0 ? 4e3 : _param_duration, _param_colors = param.colors, colors = _param_colors === void 0 ? [
|
|
@@ -10479,7 +10502,7 @@ var ConfettiExplosion = function ConfettiExplosion(param) {
|
|
|
10479
10502
|
}, [
|
|
10480
10503
|
JSON.stringify(colors)
|
|
10481
10504
|
]);
|
|
10482
|
-
|
|
10505
|
+
useEffect11(function() {
|
|
10483
10506
|
if (isActive) {
|
|
10484
10507
|
var newParticles = Array.from({
|
|
10485
10508
|
length: particleCount
|
|
@@ -10592,7 +10615,7 @@ var ConfettiExplosion = function ConfettiExplosion(param) {
|
|
|
10592
10615
|
};
|
|
10593
10616
|
ConfettiExplosion.displayName = "ConfettiExplosion";
|
|
10594
10617
|
// src/components/RealisticConfetti.tsx
|
|
10595
|
-
import { useState as useState15, useEffect as
|
|
10618
|
+
import { useState as useState15, useEffect as useEffect12, useRef as useRef7, useMemo as useMemo5 } from "react";
|
|
10596
10619
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
10597
10620
|
var RealisticConfetti = function RealisticConfetti(param) {
|
|
10598
10621
|
var testId = param.testId, isActive = param.isActive, _param_particleCount = param.particleCount, particleCount = _param_particleCount === void 0 ? 150 : _param_particleCount, _param_duration = param.duration, duration = _param_duration === void 0 ? 4e3 : _param_duration, _param_colors = param.colors, colors = _param_colors === void 0 ? [
|
|
@@ -10617,7 +10640,7 @@ var RealisticConfetti = function RealisticConfetti(param) {
|
|
|
10617
10640
|
}, [
|
|
10618
10641
|
JSON.stringify(colors)
|
|
10619
10642
|
]);
|
|
10620
|
-
|
|
10643
|
+
useEffect12(function() {
|
|
10621
10644
|
if (isActive) {
|
|
10622
10645
|
var newParticles = Array.from({
|
|
10623
10646
|
length: particleCount
|
|
@@ -10786,10 +10809,12 @@ var CircularSpinner = function CircularSpinner(param) {
|
|
|
10786
10809
|
left: offset,
|
|
10787
10810
|
opacity: opacity,
|
|
10788
10811
|
borderWidth: Math.max(2, ringSize / 12),
|
|
10812
|
+
borderColor: "rgba(0,0,0,0.1)",
|
|
10789
10813
|
borderTopColor: color,
|
|
10790
|
-
animation: "
|
|
10814
|
+
animation: "spin ".concat(speed + i * 0.3, "s linear infinite"),
|
|
10815
|
+
animationDelay: "".concat(i * 0.2, "s")
|
|
10791
10816
|
},
|
|
10792
|
-
className: "absolute border border-
|
|
10817
|
+
className: "absolute border border-solid rounded-full"
|
|
10793
10818
|
}, i);
|
|
10794
10819
|
}),
|
|
10795
10820
|
/* @__PURE__ */ jsx30(SrOnly, {
|
|
@@ -10936,16 +10961,16 @@ var CardWithLoading = function CardWithLoading(param) {
|
|
|
10936
10961
|
});
|
|
10937
10962
|
};
|
|
10938
10963
|
// src/components/NestedDropdown.tsx
|
|
10939
|
-
import { useEffect as
|
|
10964
|
+
import { useEffect as useEffect13, useRef as useRef8, useState as useState16 } from "react";
|
|
10940
10965
|
import { ChevronDown as ChevronDown4, X as X3, Loader2 } from "lucide-react";
|
|
10941
|
-
import { Fragment as
|
|
10966
|
+
import { Fragment as Fragment12, jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10942
10967
|
function SearchableDropdown(param) {
|
|
10943
10968
|
var label = param.label, options = param.options, value = param.value, onChange = param.onChange, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "search here" : _param_placeholder, testId = param.testId;
|
|
10944
10969
|
var _find;
|
|
10945
10970
|
var _useState16 = _sliced_to_array(useState16(false), 2), open = _useState16[0], setOpen = _useState16[1];
|
|
10946
10971
|
var _useState161 = _sliced_to_array(useState16(""), 2), search = _useState161[0], setSearch = _useState161[1];
|
|
10947
10972
|
var ref = useRef8(null);
|
|
10948
|
-
|
|
10973
|
+
useEffect13(function() {
|
|
10949
10974
|
var h = function h(e) {
|
|
10950
10975
|
return ref.current && !ref.current.contains(e.target) && setOpen(false);
|
|
10951
10976
|
};
|
|
@@ -11040,7 +11065,7 @@ function MultiSelectDropdown(param) {
|
|
|
11040
11065
|
return v !== val;
|
|
11041
11066
|
}));
|
|
11042
11067
|
};
|
|
11043
|
-
|
|
11068
|
+
useEffect13(function() {
|
|
11044
11069
|
var handler = function handler(e) {
|
|
11045
11070
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11046
11071
|
setOpen(false);
|
|
@@ -11166,7 +11191,7 @@ function CascadingDropdown(param) {
|
|
|
11166
11191
|
var _data_find, _level2_find;
|
|
11167
11192
|
var _useState16 = _sliced_to_array(useState16(false), 2), open = _useState16[0], setOpen = _useState16[1];
|
|
11168
11193
|
var ref = useRef8(null);
|
|
11169
|
-
|
|
11194
|
+
useEffect13(function() {
|
|
11170
11195
|
var handler = function handler(e) {
|
|
11171
11196
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11172
11197
|
setOpen(false);
|
|
@@ -11271,7 +11296,7 @@ function GroupedDropdown(param) {
|
|
|
11271
11296
|
var _param_label = param.label, label = _param_label === void 0 ? "Grouped Dropdown" : _param_label, groups = param.groups, values = param.values, onChange = param.onChange, testId = param.testId;
|
|
11272
11297
|
var _useState16 = _sliced_to_array(useState16(false), 2), open = _useState16[0], setOpen = _useState16[1];
|
|
11273
11298
|
var ref = useRef8(null);
|
|
11274
|
-
|
|
11299
|
+
useEffect13(function() {
|
|
11275
11300
|
var handler = function handler(e) {
|
|
11276
11301
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11277
11302
|
setOpen(false);
|
|
@@ -11398,7 +11423,7 @@ function AvatarDropdown(param) {
|
|
|
11398
11423
|
var _param_label = param.label, label = _param_label === void 0 ? "Select Avatar" : _param_label, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "Choose user" : _param_placeholder, options = param.options, value = param.value, testId = param.testId, onChange = param.onChange;
|
|
11399
11424
|
var _useState16 = _sliced_to_array(useState16(false), 2), open = _useState16[0], setOpen = _useState16[1];
|
|
11400
11425
|
var ref = useRef8(null);
|
|
11401
|
-
|
|
11426
|
+
useEffect13(function() {
|
|
11402
11427
|
var handler = function handler(e) {
|
|
11403
11428
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11404
11429
|
setOpen(false);
|
|
@@ -11431,7 +11456,7 @@ function AvatarDropdown(param) {
|
|
|
11431
11456
|
children: [
|
|
11432
11457
|
/* @__PURE__ */ jsx31("span", {
|
|
11433
11458
|
className: "flex items-center gap-[10px]",
|
|
11434
|
-
children: selected ? /* @__PURE__ */ jsxs26(
|
|
11459
|
+
children: selected ? /* @__PURE__ */ jsxs26(Fragment12, {
|
|
11435
11460
|
children: [
|
|
11436
11461
|
/* @__PURE__ */ jsx31("img", {
|
|
11437
11462
|
src: selected.image,
|
|
@@ -11488,7 +11513,7 @@ function AvatarMultiSelectDropdown(param) {
|
|
|
11488
11513
|
var _param_label = param.label, label = _param_label === void 0 ? "Avatar Multi Select" : _param_label, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "Select users" : _param_placeholder, options = param.options, values = param.values, testId = param.testId, onChange = param.onChange;
|
|
11489
11514
|
var _useState16 = _sliced_to_array(useState16(false), 2), open = _useState16[0], setOpen = _useState16[1];
|
|
11490
11515
|
var ref = useRef8(null);
|
|
11491
|
-
|
|
11516
|
+
useEffect13(function() {
|
|
11492
11517
|
var handler = function handler(e) {
|
|
11493
11518
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11494
11519
|
setOpen(false);
|
|
@@ -11615,7 +11640,7 @@ function AsyncDropdown(param) {
|
|
|
11615
11640
|
var _useState162 = _sliced_to_array(useState16([]), 2), options = _useState162[0], setOptions = _useState162[1];
|
|
11616
11641
|
var _useState163 = _sliced_to_array(useState16(false), 2), loading = _useState163[0], setLoading = _useState163[1];
|
|
11617
11642
|
var ref = useRef8(null);
|
|
11618
|
-
|
|
11643
|
+
useEffect13(function() {
|
|
11619
11644
|
var handler = function handler(e) {
|
|
11620
11645
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
11621
11646
|
setOpen(false);
|
|
@@ -11626,7 +11651,7 @@ function AsyncDropdown(param) {
|
|
|
11626
11651
|
return document.removeEventListener("mousedown", handler);
|
|
11627
11652
|
};
|
|
11628
11653
|
}, []);
|
|
11629
|
-
|
|
11654
|
+
useEffect13(function() {
|
|
11630
11655
|
if (!open) return;
|
|
11631
11656
|
setLoading(true);
|
|
11632
11657
|
loadOptions(search).then(setOptions).finally(function() {
|
|
@@ -11720,7 +11745,7 @@ function AsyncDropdown(param) {
|
|
|
11720
11745
|
});
|
|
11721
11746
|
}
|
|
11722
11747
|
// src/components/TextToAudio.tsx
|
|
11723
|
-
import { useEffect as
|
|
11748
|
+
import { useEffect as useEffect14, useRef as useRef9, useState as useState17 } from "react";
|
|
11724
11749
|
import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11725
11750
|
var ControlIcon = function ControlIcon(param) {
|
|
11726
11751
|
var src = param.src;
|
|
@@ -12021,23 +12046,23 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12021
12046
|
(_textAreaRef_current = textAreaRef.current) === null || _textAreaRef_current === void 0 ? void 0 : _textAreaRef_current.setSelectionRange(0, 0);
|
|
12022
12047
|
utteranceRef.current = null;
|
|
12023
12048
|
};
|
|
12024
|
-
|
|
12049
|
+
useEffect14(function() {
|
|
12025
12050
|
return function() {
|
|
12026
12051
|
window.speechSynthesis.cancel();
|
|
12027
12052
|
stopTimer();
|
|
12028
12053
|
};
|
|
12029
12054
|
}, []);
|
|
12030
|
-
|
|
12055
|
+
useEffect14(function() {
|
|
12031
12056
|
volumeRef.current = volume;
|
|
12032
12057
|
}, [
|
|
12033
12058
|
volume
|
|
12034
12059
|
]);
|
|
12035
|
-
|
|
12060
|
+
useEffect14(function() {
|
|
12036
12061
|
speedRef.current = speed;
|
|
12037
12062
|
}, [
|
|
12038
12063
|
speed
|
|
12039
12064
|
]);
|
|
12040
|
-
|
|
12065
|
+
useEffect14(function() {
|
|
12041
12066
|
if (!playing) return;
|
|
12042
12067
|
window.speechSynthesis.cancel();
|
|
12043
12068
|
stopTimer();
|
|
@@ -12045,7 +12070,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12045
12070
|
}, [
|
|
12046
12071
|
volume
|
|
12047
12072
|
]);
|
|
12048
|
-
|
|
12073
|
+
useEffect14(function() {
|
|
12049
12074
|
if (!text.trim()) {
|
|
12050
12075
|
setDuration(0);
|
|
12051
12076
|
setCurrentTime(0);
|
|
@@ -12059,7 +12084,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12059
12084
|
}, [
|
|
12060
12085
|
text
|
|
12061
12086
|
]);
|
|
12062
|
-
|
|
12087
|
+
useEffect14(function() {
|
|
12063
12088
|
if (!baseDurationRef.current) return;
|
|
12064
12089
|
var progress = duration === 0 ? 0 : currentTime / duration;
|
|
12065
12090
|
var newDuration = baseDurationRef.current / speed;
|
|
@@ -12074,7 +12099,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12074
12099
|
}, [
|
|
12075
12100
|
speed
|
|
12076
12101
|
]);
|
|
12077
|
-
|
|
12102
|
+
useEffect14(function() {
|
|
12078
12103
|
if (!autoPlayRef.current) return;
|
|
12079
12104
|
if (!text.trim()) return;
|
|
12080
12105
|
autoPlayRef.current = false;
|
|
@@ -12412,7 +12437,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12412
12437
|
});
|
|
12413
12438
|
};
|
|
12414
12439
|
// src/components/Notifications.tsx
|
|
12415
|
-
import { useEffect as
|
|
12440
|
+
import { useEffect as useEffect15, useRef as useRef10, useState as useState18 } from "react";
|
|
12416
12441
|
import { createPortal as createPortal2 } from "react-dom";
|
|
12417
12442
|
import { X as X4 } from "lucide-react";
|
|
12418
12443
|
import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
@@ -12421,7 +12446,7 @@ var MahatiLocationAccessModal = function MahatiLocationAccessModal(param) {
|
|
|
12421
12446
|
var ref = useRef10(null);
|
|
12422
12447
|
var _useState18 = _sliced_to_array(useState18("prompt"), 2), status = _useState18[0], setStatus = _useState18[1];
|
|
12423
12448
|
var _useState181 = _sliced_to_array(useState18(null), 2), location = _useState181[0], setLocation = _useState181[1];
|
|
12424
|
-
|
|
12449
|
+
useEffect15(function() {
|
|
12425
12450
|
if (!navigator.permissions) return;
|
|
12426
12451
|
navigator.permissions.query({
|
|
12427
12452
|
name: "geolocation"
|
|
@@ -12432,7 +12457,7 @@ var MahatiLocationAccessModal = function MahatiLocationAccessModal(param) {
|
|
|
12432
12457
|
};
|
|
12433
12458
|
});
|
|
12434
12459
|
}, []);
|
|
12435
|
-
|
|
12460
|
+
useEffect15(function() {
|
|
12436
12461
|
if (status === "granted" && location) {
|
|
12437
12462
|
onAllow === null || onAllow === void 0 ? void 0 : onAllow(location.coords);
|
|
12438
12463
|
onClose();
|
|
@@ -12451,7 +12476,7 @@ var MahatiLocationAccessModal = function MahatiLocationAccessModal(param) {
|
|
|
12451
12476
|
enableHighAccuracy: true
|
|
12452
12477
|
});
|
|
12453
12478
|
};
|
|
12454
|
-
|
|
12479
|
+
useEffect15(function() {
|
|
12455
12480
|
if (!isOpen) return;
|
|
12456
12481
|
var h = function h(e) {
|
|
12457
12482
|
var _ref_current;
|
|
@@ -12561,7 +12586,7 @@ var MahatiCameraAccessModal = function MahatiCameraAccessModal(param) {
|
|
|
12561
12586
|
});
|
|
12562
12587
|
})();
|
|
12563
12588
|
};
|
|
12564
|
-
|
|
12589
|
+
useEffect15(function() {
|
|
12565
12590
|
if (!isOpen) return;
|
|
12566
12591
|
var handler = function handler(e) {
|
|
12567
12592
|
var _cardRef_current;
|
|
@@ -12592,7 +12617,8 @@ var MahatiCameraAccessModal = function MahatiCameraAccessModal(param) {
|
|
|
12592
12617
|
onClick: onClose,
|
|
12593
12618
|
className: "absolute right-5 top-5 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-[0_2px_6px_rgba(0,0,0,0.15)]",
|
|
12594
12619
|
children: /* @__PURE__ */ jsx33(X4, {
|
|
12595
|
-
size: 16
|
|
12620
|
+
size: 16,
|
|
12621
|
+
color: "black"
|
|
12596
12622
|
})
|
|
12597
12623
|
}),
|
|
12598
12624
|
image && /* @__PURE__ */ jsx33("div", {
|
|
@@ -12677,7 +12703,7 @@ var MahatiMicrophoneAccessModal = function MahatiMicrophoneAccessModal(param) {
|
|
|
12677
12703
|
});
|
|
12678
12704
|
})();
|
|
12679
12705
|
};
|
|
12680
|
-
|
|
12706
|
+
useEffect15(function() {
|
|
12681
12707
|
if (!isOpen) return;
|
|
12682
12708
|
var handler = function handler(e) {
|
|
12683
12709
|
var _cardRef_current;
|
|
@@ -12808,7 +12834,7 @@ var MahatiPromotionModal = function MahatiPromotionModal(_0) {
|
|
|
12808
12834
|
]);
|
|
12809
12835
|
var ref = useRef10(null);
|
|
12810
12836
|
var _useState18 = _sliced_to_array(useState18(""), 2), email = _useState18[0], setEmail = _useState18[1];
|
|
12811
|
-
|
|
12837
|
+
useEffect15(function() {
|
|
12812
12838
|
if (!isOpen) return;
|
|
12813
12839
|
var handler = function handler(e) {
|
|
12814
12840
|
var _ref_current;
|
|
@@ -12828,7 +12854,7 @@ var MahatiPromotionModal = function MahatiPromotionModal(_0) {
|
|
|
12828
12854
|
var handleCta = function handleCta() {
|
|
12829
12855
|
onCtaClick === null || onCtaClick === void 0 ? void 0 : onCtaClick(email);
|
|
12830
12856
|
if (ctaLink) {
|
|
12831
|
-
openInNewTab ? window.open(ctaLink, "_blank") : window.location.
|
|
12857
|
+
openInNewTab ? window.open(ctaLink, "_blank") : window.location.assign(ctaLink);
|
|
12832
12858
|
}
|
|
12833
12859
|
onClose();
|
|
12834
12860
|
};
|
|
@@ -12851,7 +12877,7 @@ var MahatiPromotionModal = function MahatiPromotionModal(_0) {
|
|
|
12851
12877
|
var MahatiPromotionModalV2Modal = function MahatiPromotionModalV2Modal(param) {
|
|
12852
12878
|
var isOpen = param.isOpen, testId = param.testId, onClose = param.onClose, headerTitle = param.headerTitle, title = param.title, description = param.description, ctaText = param.ctaText, onCtaClick = param.onCtaClick, ctaLink = param.ctaLink, _param_openInNewTab = param.openInNewTab, openInNewTab = _param_openInNewTab === void 0 ? false : _param_openInNewTab, _param_showBadgeImage = param.showBadgeImage, showBadgeImage = _param_showBadgeImage === void 0 ? false : _param_showBadgeImage, badgeImageSrc = param.badgeImageSrc;
|
|
12853
12879
|
var ref = useRef10(null);
|
|
12854
|
-
|
|
12880
|
+
useEffect15(function() {
|
|
12855
12881
|
if (!isOpen) return;
|
|
12856
12882
|
var handler = function handler(e) {
|
|
12857
12883
|
var _ref_current;
|
|
@@ -12932,7 +12958,7 @@ var MahatiPromotionModalV2Modal = function MahatiPromotionModalV2Modal(param) {
|
|
|
12932
12958
|
var MahatiPromotionModalV3Modal = function MahatiPromotionModalV3Modal(param) {
|
|
12933
12959
|
var isOpen = param.isOpen, testId = param.testId, onClose = param.onClose, title = param.title, description = param.description, ctaText = param.ctaText, onCtaClick = param.onCtaClick, _param_secondaryText = param.secondaryText, secondaryText = _param_secondaryText === void 0 ? "Later" : _param_secondaryText, onSecondaryClick = param.onSecondaryClick, imageSrc = param.imageSrc, ctaLink = param.ctaLink, _param_openInNewTab = param.openInNewTab, openInNewTab = _param_openInNewTab === void 0 ? false : _param_openInNewTab;
|
|
12934
12960
|
var ref = useRef10(null);
|
|
12935
|
-
|
|
12961
|
+
useEffect15(function() {
|
|
12936
12962
|
if (!isOpen) return;
|
|
12937
12963
|
var handler = function handler(e) {
|
|
12938
12964
|
var _ref_current;
|