unifyedx-storybook-new 0.1.36 → 0.1.38
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import require$$1, { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { forwardRef, createElement, useState, useMemo, useId as useId$1, createContext, useContext, useCallback, useRef, useLayoutEffect, useEffect, Fragment as Fragment$1, useImperativeHandle, memo, useReducer } from 'react';
|
|
3
|
+
import React__default, { forwardRef, createElement, useState, useMemo, useId as useId$1, createContext, useContext, useCallback, useRef, useLayoutEffect, useEffect, Fragment as Fragment$1, useImperativeHandle, memo, useReducer, useSyncExternalStore, isValidElement, cloneElement } from 'react';
|
|
4
4
|
import { Popover as Popover$1, PopoverButton, PopoverPanel, Transition, Dialog, TransitionChild, DialogPanel, DialogTitle, TabGroup, TabList, Tab, TabPanels, RadioGroup as RadioGroup$1, Listbox, ListboxButton, ListboxOptions, ListboxOption, SwitchGroup, Switch, Menu as Menu$1, MenuButton, Portal, MenuItems, MenuItem, DialogBackdrop } from '@headlessui/react';
|
|
5
5
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
6
6
|
import { useFloating, offset as offset$2, flip as flip$2, shift as shift$2, autoUpdate as autoUpdate$1, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
@@ -477,7 +477,7 @@ const __iconNode = [
|
|
|
477
477
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
478
478
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
479
479
|
];
|
|
480
|
-
const X = createLucideIcon("x", __iconNode);
|
|
480
|
+
const X$1 = createLucideIcon("x", __iconNode);
|
|
481
481
|
|
|
482
482
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
483
483
|
|
|
@@ -730,7 +730,7 @@ const Badge = ({
|
|
|
730
730
|
className: "badge-remove-button",
|
|
731
731
|
onClick: onRemove,
|
|
732
732
|
"aria-label": `Remove ${label}`,
|
|
733
|
-
children: /* @__PURE__ */ jsx(X, { className: "badge-remove-icon" })
|
|
733
|
+
children: /* @__PURE__ */ jsx(X$1, { className: "badge-remove-icon" })
|
|
734
734
|
}
|
|
735
735
|
)
|
|
736
736
|
] });
|
|
@@ -2167,7 +2167,9 @@ const offsetRe = /([+-]\d\d):?(\d\d)?/;
|
|
|
2167
2167
|
function calcOffset(cacheStr, values) {
|
|
2168
2168
|
const hours = +(values[0] || 0);
|
|
2169
2169
|
const minutes = +(values[1] || 0);
|
|
2170
|
-
|
|
2170
|
+
// Convert seconds to minutes by dividing by 60 to keep the function return in minutes.
|
|
2171
|
+
const seconds = +(values[2] || 0) / 60;
|
|
2172
|
+
return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
|
|
2171
2173
|
}
|
|
2172
2174
|
|
|
2173
2175
|
class TZDateMini extends Date {
|
|
@@ -2209,7 +2211,10 @@ class TZDateMini extends Date {
|
|
|
2209
2211
|
return new TZDateMini(+this, timeZone);
|
|
2210
2212
|
}
|
|
2211
2213
|
getTimezoneOffset() {
|
|
2212
|
-
|
|
2214
|
+
const offset = -tzOffset(this.timeZone, this);
|
|
2215
|
+
// Remove the seconds offset
|
|
2216
|
+
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
|
|
2217
|
+
return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
|
|
2213
2218
|
}
|
|
2214
2219
|
|
|
2215
2220
|
//#endregion
|
|
@@ -2269,7 +2274,7 @@ Object.getOwnPropertyNames(Date.prototype).forEach(method => {
|
|
|
2269
2274
|
*/
|
|
2270
2275
|
function syncToInternal(date) {
|
|
2271
2276
|
date.internal.setTime(+date);
|
|
2272
|
-
date.internal.
|
|
2277
|
+
date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, date) * 60));
|
|
2273
2278
|
}
|
|
2274
2279
|
|
|
2275
2280
|
/**
|
|
@@ -2295,8 +2300,10 @@ function syncFromInternal(date) {
|
|
|
2295
2300
|
*/
|
|
2296
2301
|
function adjustToSystemTZ(date) {
|
|
2297
2302
|
// Save the time zone offset before all the adjustments
|
|
2298
|
-
const
|
|
2299
|
-
|
|
2303
|
+
const baseOffset = tzOffset(date.timeZone, date);
|
|
2304
|
+
// Remove the seconds offset
|
|
2305
|
+
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
|
|
2306
|
+
const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
|
|
2300
2307
|
//#region System DST adjustment
|
|
2301
2308
|
|
|
2302
2309
|
// The biggest problem with using the system time zone is that when we create
|
|
@@ -2350,9 +2357,29 @@ function adjustToSystemTZ(date) {
|
|
|
2350
2357
|
|
|
2351
2358
|
//#endregion
|
|
2352
2359
|
|
|
2360
|
+
//#region Seconds System diff adjustment
|
|
2361
|
+
|
|
2362
|
+
const systemDate = new Date(+date);
|
|
2363
|
+
// Set the UTC seconds to 0 to isolate the timezone offset in seconds.
|
|
2364
|
+
systemDate.setUTCSeconds(0);
|
|
2365
|
+
// For negative systemOffset, invert the seconds.
|
|
2366
|
+
const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
|
|
2367
|
+
|
|
2368
|
+
// Calculate the seconds offset based on the timezone offset.
|
|
2369
|
+
const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
|
|
2370
|
+
if (secondsOffset || systemSecondsOffset) {
|
|
2371
|
+
date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
|
|
2372
|
+
Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
//#endregion
|
|
2376
|
+
|
|
2353
2377
|
//#region Post-adjustment DST fix
|
|
2354
2378
|
|
|
2355
|
-
const
|
|
2379
|
+
const postBaseOffset = tzOffset(date.timeZone, date);
|
|
2380
|
+
// Remove the seconds offset
|
|
2381
|
+
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
|
|
2382
|
+
const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
|
|
2356
2383
|
const postSystemOffset = -new Date(+date).getTimezoneOffset();
|
|
2357
2384
|
const postOffsetDiff = postSystemOffset - postOffset;
|
|
2358
2385
|
const offsetChanged = postOffset !== offset;
|
|
@@ -2363,7 +2390,10 @@ function adjustToSystemTZ(date) {
|
|
|
2363
2390
|
// Now we need to check if got offset change during the post-adjustment.
|
|
2364
2391
|
// If so, we also need both dates to reflect that.
|
|
2365
2392
|
|
|
2366
|
-
const
|
|
2393
|
+
const newBaseOffset = tzOffset(date.timeZone, date);
|
|
2394
|
+
// Remove the seconds offset
|
|
2395
|
+
// use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.
|
|
2396
|
+
const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
|
|
2367
2397
|
const offsetChange = postOffset - newOffset;
|
|
2368
2398
|
if (offsetChange) {
|
|
2369
2399
|
date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
|
|
@@ -2374,19 +2404,6 @@ function adjustToSystemTZ(date) {
|
|
|
2374
2404
|
//#endregion
|
|
2375
2405
|
}
|
|
2376
2406
|
|
|
2377
|
-
/**
|
|
2378
|
-
* UTC date class. It maps getters and setters to corresponding UTC methods,
|
|
2379
|
-
* forcing all calculations in the UTC time zone.
|
|
2380
|
-
*
|
|
2381
|
-
* Combined with date-fns, it allows using the class the same way as
|
|
2382
|
-
* the original date class.
|
|
2383
|
-
*
|
|
2384
|
-
* This complete version provides not only getters, setters,
|
|
2385
|
-
* and `getTimezoneOffset`, but also the formatter functions, mirroring
|
|
2386
|
-
* all original `Date` functionality. Use this version when you need to format
|
|
2387
|
-
* a string or in an environment you don't fully control (a library).
|
|
2388
|
-
* For a minimal version, see `UTCDateMini`.
|
|
2389
|
-
*/
|
|
2390
2407
|
class TZDate extends TZDateMini {
|
|
2391
2408
|
//#region static
|
|
2392
2409
|
|
|
@@ -2466,127 +2483,6 @@ class TZDate extends TZDateMini {
|
|
|
2466
2483
|
//#endregion
|
|
2467
2484
|
}
|
|
2468
2485
|
|
|
2469
|
-
/**
|
|
2470
|
-
* Enum representing the UI elements composing DayPicker. These elements are
|
|
2471
|
-
* mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.
|
|
2472
|
-
*
|
|
2473
|
-
* Some elements are extended by flags and modifiers.
|
|
2474
|
-
*/
|
|
2475
|
-
var UI;
|
|
2476
|
-
(function (UI) {
|
|
2477
|
-
/** The root component displaying the months and the navigation bar. */
|
|
2478
|
-
UI["Root"] = "root";
|
|
2479
|
-
/** The Chevron SVG element used by navigation buttons and dropdowns. */
|
|
2480
|
-
UI["Chevron"] = "chevron";
|
|
2481
|
-
/**
|
|
2482
|
-
* The grid cell with the day's date. Extended by {@link DayFlag} and
|
|
2483
|
-
* {@link SelectionState}.
|
|
2484
|
-
*/
|
|
2485
|
-
UI["Day"] = "day";
|
|
2486
|
-
/** The button containing the formatted day's date, inside the grid cell. */
|
|
2487
|
-
UI["DayButton"] = "day_button";
|
|
2488
|
-
/** The caption label of the month (when not showing the dropdown navigation). */
|
|
2489
|
-
UI["CaptionLabel"] = "caption_label";
|
|
2490
|
-
/** The container of the dropdown navigation (when enabled). */
|
|
2491
|
-
UI["Dropdowns"] = "dropdowns";
|
|
2492
|
-
/** The dropdown element to select for years and months. */
|
|
2493
|
-
UI["Dropdown"] = "dropdown";
|
|
2494
|
-
/** The container element of the dropdown. */
|
|
2495
|
-
UI["DropdownRoot"] = "dropdown_root";
|
|
2496
|
-
/** The root element of the footer. */
|
|
2497
|
-
UI["Footer"] = "footer";
|
|
2498
|
-
/** The month grid. */
|
|
2499
|
-
UI["MonthGrid"] = "month_grid";
|
|
2500
|
-
/** Contains the dropdown navigation or the caption label. */
|
|
2501
|
-
UI["MonthCaption"] = "month_caption";
|
|
2502
|
-
/** The dropdown with the months. */
|
|
2503
|
-
UI["MonthsDropdown"] = "months_dropdown";
|
|
2504
|
-
/** Wrapper of the month grid. */
|
|
2505
|
-
UI["Month"] = "month";
|
|
2506
|
-
/** The container of the displayed months. */
|
|
2507
|
-
UI["Months"] = "months";
|
|
2508
|
-
/** The navigation bar with the previous and next buttons. */
|
|
2509
|
-
UI["Nav"] = "nav";
|
|
2510
|
-
/**
|
|
2511
|
-
* The next month button in the navigation. *
|
|
2512
|
-
*
|
|
2513
|
-
* @since 9.1.0
|
|
2514
|
-
*/
|
|
2515
|
-
UI["NextMonthButton"] = "button_next";
|
|
2516
|
-
/**
|
|
2517
|
-
* The previous month button in the navigation.
|
|
2518
|
-
*
|
|
2519
|
-
* @since 9.1.0
|
|
2520
|
-
*/
|
|
2521
|
-
UI["PreviousMonthButton"] = "button_previous";
|
|
2522
|
-
/** The row containing the week. */
|
|
2523
|
-
UI["Week"] = "week";
|
|
2524
|
-
/** The group of row weeks in a month (`tbody`). */
|
|
2525
|
-
UI["Weeks"] = "weeks";
|
|
2526
|
-
/** The column header with the weekday. */
|
|
2527
|
-
UI["Weekday"] = "weekday";
|
|
2528
|
-
/** The row grouping the weekdays in the column headers. */
|
|
2529
|
-
UI["Weekdays"] = "weekdays";
|
|
2530
|
-
/** The cell containing the week number. */
|
|
2531
|
-
UI["WeekNumber"] = "week_number";
|
|
2532
|
-
/** The cell header of the week numbers column. */
|
|
2533
|
-
UI["WeekNumberHeader"] = "week_number_header";
|
|
2534
|
-
/** The dropdown with the years. */
|
|
2535
|
-
UI["YearsDropdown"] = "years_dropdown";
|
|
2536
|
-
})(UI || (UI = {}));
|
|
2537
|
-
/** Enum representing flags for the {@link UI.Day} element. */
|
|
2538
|
-
var DayFlag;
|
|
2539
|
-
(function (DayFlag) {
|
|
2540
|
-
/** The day is disabled. */
|
|
2541
|
-
DayFlag["disabled"] = "disabled";
|
|
2542
|
-
/** The day is hidden. */
|
|
2543
|
-
DayFlag["hidden"] = "hidden";
|
|
2544
|
-
/** The day is outside the current month. */
|
|
2545
|
-
DayFlag["outside"] = "outside";
|
|
2546
|
-
/** The day is focused. */
|
|
2547
|
-
DayFlag["focused"] = "focused";
|
|
2548
|
-
/** The day is today. */
|
|
2549
|
-
DayFlag["today"] = "today";
|
|
2550
|
-
})(DayFlag || (DayFlag = {}));
|
|
2551
|
-
/**
|
|
2552
|
-
* Enum representing selection states that can be applied to the {@link UI.Day}
|
|
2553
|
-
* element in selection mode.
|
|
2554
|
-
*/
|
|
2555
|
-
var SelectionState;
|
|
2556
|
-
(function (SelectionState) {
|
|
2557
|
-
/** The day is at the end of a selected range. */
|
|
2558
|
-
SelectionState["range_end"] = "range_end";
|
|
2559
|
-
/** The day is at the middle of a selected range. */
|
|
2560
|
-
SelectionState["range_middle"] = "range_middle";
|
|
2561
|
-
/** The day is at the start of a selected range. */
|
|
2562
|
-
SelectionState["range_start"] = "range_start";
|
|
2563
|
-
/** The day is selected. */
|
|
2564
|
-
SelectionState["selected"] = "selected";
|
|
2565
|
-
})(SelectionState || (SelectionState = {}));
|
|
2566
|
-
/**
|
|
2567
|
-
* Enum representing different animation states for transitioning between
|
|
2568
|
-
* months.
|
|
2569
|
-
*/
|
|
2570
|
-
var Animation;
|
|
2571
|
-
(function (Animation) {
|
|
2572
|
-
/** The entering weeks when they appear before the exiting month. */
|
|
2573
|
-
Animation["weeks_before_enter"] = "weeks_before_enter";
|
|
2574
|
-
/** The exiting weeks when they disappear before the entering month. */
|
|
2575
|
-
Animation["weeks_before_exit"] = "weeks_before_exit";
|
|
2576
|
-
/** The entering weeks when they appear after the exiting month. */
|
|
2577
|
-
Animation["weeks_after_enter"] = "weeks_after_enter";
|
|
2578
|
-
/** The exiting weeks when they disappear after the entering month. */
|
|
2579
|
-
Animation["weeks_after_exit"] = "weeks_after_exit";
|
|
2580
|
-
/** The entering caption when it appears after the exiting month. */
|
|
2581
|
-
Animation["caption_after_enter"] = "caption_after_enter";
|
|
2582
|
-
/** The exiting caption when it disappears after the entering month. */
|
|
2583
|
-
Animation["caption_after_exit"] = "caption_after_exit";
|
|
2584
|
-
/** The entering caption when it appears before the exiting month. */
|
|
2585
|
-
Animation["caption_before_enter"] = "caption_before_enter";
|
|
2586
|
-
/** The exiting caption when it disappears before the entering month. */
|
|
2587
|
-
Animation["caption_before_exit"] = "caption_before_exit";
|
|
2588
|
-
})(Animation || (Animation = {}));
|
|
2589
|
-
|
|
2590
2486
|
/**
|
|
2591
2487
|
* @module constants
|
|
2592
2488
|
* @summary Useful constants
|
|
@@ -6504,7 +6400,7 @@ class DateLib {
|
|
|
6504
6400
|
* @param formatStr The format string.
|
|
6505
6401
|
* @returns The formatted date string.
|
|
6506
6402
|
*/
|
|
6507
|
-
this.format = (date, formatStr,
|
|
6403
|
+
this.format = (date, formatStr, _options) => {
|
|
6508
6404
|
const formatted = this.overrides?.format
|
|
6509
6405
|
? this.overrides.format(date, formatStr, this.options)
|
|
6510
6406
|
: format$1(date, formatStr, this.options);
|
|
@@ -6530,7 +6426,7 @@ class DateLib {
|
|
|
6530
6426
|
* @param date The date to get the month for.
|
|
6531
6427
|
* @returns The month.
|
|
6532
6428
|
*/
|
|
6533
|
-
this.getMonth = (date,
|
|
6429
|
+
this.getMonth = (date, _options) => {
|
|
6534
6430
|
return this.overrides?.getMonth
|
|
6535
6431
|
? this.overrides.getMonth(date, this.options)
|
|
6536
6432
|
: getMonth$1(date, this.options);
|
|
@@ -6541,7 +6437,7 @@ class DateLib {
|
|
|
6541
6437
|
* @param date The date to get the year for.
|
|
6542
6438
|
* @returns The year.
|
|
6543
6439
|
*/
|
|
6544
|
-
this.getYear = (date,
|
|
6440
|
+
this.getYear = (date, _options) => {
|
|
6545
6441
|
return this.overrides?.getYear
|
|
6546
6442
|
? this.overrides.getYear(date, this.options)
|
|
6547
6443
|
: getYear$1(date, this.options);
|
|
@@ -6552,7 +6448,7 @@ class DateLib {
|
|
|
6552
6448
|
* @param date The date to get the week number for.
|
|
6553
6449
|
* @returns The week number.
|
|
6554
6450
|
*/
|
|
6555
|
-
this.getWeek = (date,
|
|
6451
|
+
this.getWeek = (date, _options) => {
|
|
6556
6452
|
return this.overrides?.getWeek
|
|
6557
6453
|
? this.overrides.getWeek(date, this.options)
|
|
6558
6454
|
: getWeek$1(date, this.options);
|
|
@@ -6676,7 +6572,7 @@ class DateLib {
|
|
|
6676
6572
|
* @param date The original date.
|
|
6677
6573
|
* @returns The start of the broadcast week.
|
|
6678
6574
|
*/
|
|
6679
|
-
this.startOfBroadcastWeek = (date,
|
|
6575
|
+
this.startOfBroadcastWeek = (date, _dateLib) => {
|
|
6680
6576
|
return this.overrides?.startOfBroadcastWeek
|
|
6681
6577
|
? this.overrides.startOfBroadcastWeek(date, this)
|
|
6682
6578
|
: startOfBroadcastWeek(date, this);
|
|
@@ -6720,7 +6616,7 @@ class DateLib {
|
|
|
6720
6616
|
* @param date The original date.
|
|
6721
6617
|
* @returns The start of the week.
|
|
6722
6618
|
*/
|
|
6723
|
-
this.startOfWeek = (date,
|
|
6619
|
+
this.startOfWeek = (date, _options) => {
|
|
6724
6620
|
return this.overrides?.startOfWeek
|
|
6725
6621
|
? this.overrides.startOfWeek(date, this.options)
|
|
6726
6622
|
: startOfWeek$1(date, this.options);
|
|
@@ -6750,7 +6646,7 @@ class DateLib {
|
|
|
6750
6646
|
const { numerals = "latn" } = this.options;
|
|
6751
6647
|
// Use Intl.NumberFormat to create a formatter with the specified numbering system
|
|
6752
6648
|
const formatter = new Intl.NumberFormat("en-US", {
|
|
6753
|
-
numberingSystem: numerals
|
|
6649
|
+
numberingSystem: numerals,
|
|
6754
6650
|
});
|
|
6755
6651
|
// Map Arabic digits (0-9) to the target numerals
|
|
6756
6652
|
const digitMap = {};
|
|
@@ -6840,281 +6736,6 @@ class CalendarWeek {
|
|
|
6840
6736
|
}
|
|
6841
6737
|
}
|
|
6842
6738
|
|
|
6843
|
-
/**
|
|
6844
|
-
* Checks if a given date is within a specified date range.
|
|
6845
|
-
*
|
|
6846
|
-
* @since 9.0.0
|
|
6847
|
-
* @param range - The date range to check against.
|
|
6848
|
-
* @param date - The date to check.
|
|
6849
|
-
* @param excludeEnds - If `true`, the range's start and end dates are excluded.
|
|
6850
|
-
* @param dateLib - The date utility library instance.
|
|
6851
|
-
* @returns `true` if the date is within the range, otherwise `false`.
|
|
6852
|
-
* @group Utilities
|
|
6853
|
-
*/
|
|
6854
|
-
function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {
|
|
6855
|
-
let { from, to } = range;
|
|
6856
|
-
const { differenceInCalendarDays, isSameDay } = dateLib;
|
|
6857
|
-
if (from && to) {
|
|
6858
|
-
const isRangeInverted = differenceInCalendarDays(to, from) < 0;
|
|
6859
|
-
if (isRangeInverted) {
|
|
6860
|
-
[from, to] = [to, from];
|
|
6861
|
-
}
|
|
6862
|
-
const isInRange = differenceInCalendarDays(date, from) >= (excludeEnds ? 1 : 0) &&
|
|
6863
|
-
differenceInCalendarDays(to, date) >= (excludeEnds ? 1 : 0);
|
|
6864
|
-
return isInRange;
|
|
6865
|
-
}
|
|
6866
|
-
if (!excludeEnds && to) {
|
|
6867
|
-
return isSameDay(to, date);
|
|
6868
|
-
}
|
|
6869
|
-
if (!excludeEnds && from) {
|
|
6870
|
-
return isSameDay(from, date);
|
|
6871
|
-
}
|
|
6872
|
-
return false;
|
|
6873
|
-
}
|
|
6874
|
-
|
|
6875
|
-
/**
|
|
6876
|
-
* Checks if the given value is of type {@link DateInterval}.
|
|
6877
|
-
*
|
|
6878
|
-
* @param matcher - The value to check.
|
|
6879
|
-
* @returns `true` if the value is a {@link DateInterval}, otherwise `false`.
|
|
6880
|
-
* @group Utilities
|
|
6881
|
-
*/
|
|
6882
|
-
function isDateInterval(matcher) {
|
|
6883
|
-
return Boolean(matcher &&
|
|
6884
|
-
typeof matcher === "object" &&
|
|
6885
|
-
"before" in matcher &&
|
|
6886
|
-
"after" in matcher);
|
|
6887
|
-
}
|
|
6888
|
-
/**
|
|
6889
|
-
* Checks if the given value is of type {@link DateRange}.
|
|
6890
|
-
*
|
|
6891
|
-
* @param value - The value to check.
|
|
6892
|
-
* @returns `true` if the value is a {@link DateRange}, otherwise `false`.
|
|
6893
|
-
* @group Utilities
|
|
6894
|
-
*/
|
|
6895
|
-
function isDateRange(value) {
|
|
6896
|
-
return Boolean(value && typeof value === "object" && "from" in value);
|
|
6897
|
-
}
|
|
6898
|
-
/**
|
|
6899
|
-
* Checks if the given value is of type {@link DateAfter}.
|
|
6900
|
-
*
|
|
6901
|
-
* @param value - The value to check.
|
|
6902
|
-
* @returns `true` if the value is a {@link DateAfter}, otherwise `false`.
|
|
6903
|
-
* @group Utilities
|
|
6904
|
-
*/
|
|
6905
|
-
function isDateAfterType(value) {
|
|
6906
|
-
return Boolean(value && typeof value === "object" && "after" in value);
|
|
6907
|
-
}
|
|
6908
|
-
/**
|
|
6909
|
-
* Checks if the given value is of type {@link DateBefore}.
|
|
6910
|
-
*
|
|
6911
|
-
* @param value - The value to check.
|
|
6912
|
-
* @returns `true` if the value is a {@link DateBefore}, otherwise `false`.
|
|
6913
|
-
* @group Utilities
|
|
6914
|
-
*/
|
|
6915
|
-
function isDateBeforeType(value) {
|
|
6916
|
-
return Boolean(value && typeof value === "object" && "before" in value);
|
|
6917
|
-
}
|
|
6918
|
-
/**
|
|
6919
|
-
* Checks if the given value is of type {@link DayOfWeek}.
|
|
6920
|
-
*
|
|
6921
|
-
* @param value - The value to check.
|
|
6922
|
-
* @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.
|
|
6923
|
-
* @group Utilities
|
|
6924
|
-
*/
|
|
6925
|
-
function isDayOfWeekType(value) {
|
|
6926
|
-
return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
|
|
6927
|
-
}
|
|
6928
|
-
/**
|
|
6929
|
-
* Checks if the given value is an array of valid dates.
|
|
6930
|
-
*
|
|
6931
|
-
* @private
|
|
6932
|
-
* @param value - The value to check.
|
|
6933
|
-
* @param dateLib - The date utility library instance.
|
|
6934
|
-
* @returns `true` if the value is an array of valid dates, otherwise `false`.
|
|
6935
|
-
*/
|
|
6936
|
-
function isDatesArray(value, dateLib) {
|
|
6937
|
-
return Array.isArray(value) && value.every(dateLib.isDate);
|
|
6938
|
-
}
|
|
6939
|
-
|
|
6940
|
-
/**
|
|
6941
|
-
* Checks if a given date matches at least one of the specified {@link Matcher}.
|
|
6942
|
-
*
|
|
6943
|
-
* @param date - The date to check.
|
|
6944
|
-
* @param matchers - The matchers to check against.
|
|
6945
|
-
* @param dateLib - The date utility library instance.
|
|
6946
|
-
* @returns `true` if the date matches any of the matchers, otherwise `false`.
|
|
6947
|
-
* @group Utilities
|
|
6948
|
-
*/
|
|
6949
|
-
function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
6950
|
-
const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
|
|
6951
|
-
const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;
|
|
6952
|
-
return matchersArr.some((matcher) => {
|
|
6953
|
-
if (typeof matcher === "boolean") {
|
|
6954
|
-
return matcher;
|
|
6955
|
-
}
|
|
6956
|
-
if (dateLib.isDate(matcher)) {
|
|
6957
|
-
return isSameDay(date, matcher);
|
|
6958
|
-
}
|
|
6959
|
-
if (isDatesArray(matcher, dateLib)) {
|
|
6960
|
-
return matcher.includes(date);
|
|
6961
|
-
}
|
|
6962
|
-
if (isDateRange(matcher)) {
|
|
6963
|
-
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
6964
|
-
}
|
|
6965
|
-
if (isDayOfWeekType(matcher)) {
|
|
6966
|
-
if (!Array.isArray(matcher.dayOfWeek)) {
|
|
6967
|
-
return matcher.dayOfWeek === date.getDay();
|
|
6968
|
-
}
|
|
6969
|
-
return matcher.dayOfWeek.includes(date.getDay());
|
|
6970
|
-
}
|
|
6971
|
-
if (isDateInterval(matcher)) {
|
|
6972
|
-
const diffBefore = differenceInCalendarDays(matcher.before, date);
|
|
6973
|
-
const diffAfter = differenceInCalendarDays(matcher.after, date);
|
|
6974
|
-
const isDayBefore = diffBefore > 0;
|
|
6975
|
-
const isDayAfter = diffAfter < 0;
|
|
6976
|
-
const isClosedInterval = isAfter(matcher.before, matcher.after);
|
|
6977
|
-
if (isClosedInterval) {
|
|
6978
|
-
return isDayAfter && isDayBefore;
|
|
6979
|
-
}
|
|
6980
|
-
else {
|
|
6981
|
-
return isDayBefore || isDayAfter;
|
|
6982
|
-
}
|
|
6983
|
-
}
|
|
6984
|
-
if (isDateAfterType(matcher)) {
|
|
6985
|
-
return differenceInCalendarDays(date, matcher.after) > 0;
|
|
6986
|
-
}
|
|
6987
|
-
if (isDateBeforeType(matcher)) {
|
|
6988
|
-
return differenceInCalendarDays(matcher.before, date) > 0;
|
|
6989
|
-
}
|
|
6990
|
-
if (typeof matcher === "function") {
|
|
6991
|
-
return matcher(date);
|
|
6992
|
-
}
|
|
6993
|
-
return false;
|
|
6994
|
-
});
|
|
6995
|
-
}
|
|
6996
|
-
|
|
6997
|
-
/**
|
|
6998
|
-
* Creates a function to retrieve the modifiers for a given day.
|
|
6999
|
-
*
|
|
7000
|
-
* This function calculates both internal and custom modifiers for each day
|
|
7001
|
-
* based on the provided calendar days and DayPicker props.
|
|
7002
|
-
*
|
|
7003
|
-
* @private
|
|
7004
|
-
* @param days The array of `CalendarDay` objects to process.
|
|
7005
|
-
* @param props The DayPicker props, including modifiers and configuration
|
|
7006
|
-
* options.
|
|
7007
|
-
* @param dateLib The date library to use for date manipulation.
|
|
7008
|
-
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
7009
|
-
*/
|
|
7010
|
-
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
7011
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today } = props;
|
|
7012
|
-
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter } = dateLib;
|
|
7013
|
-
const computedNavStart = navStart && startOfMonth(navStart);
|
|
7014
|
-
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
7015
|
-
const internalModifiersMap = {
|
|
7016
|
-
[DayFlag.focused]: [],
|
|
7017
|
-
[DayFlag.outside]: [],
|
|
7018
|
-
[DayFlag.disabled]: [],
|
|
7019
|
-
[DayFlag.hidden]: [],
|
|
7020
|
-
[DayFlag.today]: []
|
|
7021
|
-
};
|
|
7022
|
-
const customModifiersMap = {};
|
|
7023
|
-
for (const day of days) {
|
|
7024
|
-
const { date, displayMonth } = day;
|
|
7025
|
-
const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));
|
|
7026
|
-
const isBeforeNavStart = Boolean(computedNavStart && isBefore(date, computedNavStart));
|
|
7027
|
-
const isAfterNavEnd = Boolean(computedNavEnd && isAfter(date, computedNavEnd));
|
|
7028
|
-
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
|
|
7029
|
-
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||
|
|
7030
|
-
isBeforeNavStart ||
|
|
7031
|
-
isAfterNavEnd ||
|
|
7032
|
-
// Broadcast calendar will show outside days as default
|
|
7033
|
-
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
7034
|
-
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
7035
|
-
const isToday = isSameDay(date, today ?? dateLib.today());
|
|
7036
|
-
if (isOutside)
|
|
7037
|
-
internalModifiersMap.outside.push(day);
|
|
7038
|
-
if (isDisabled)
|
|
7039
|
-
internalModifiersMap.disabled.push(day);
|
|
7040
|
-
if (isHidden)
|
|
7041
|
-
internalModifiersMap.hidden.push(day);
|
|
7042
|
-
if (isToday)
|
|
7043
|
-
internalModifiersMap.today.push(day);
|
|
7044
|
-
// Add custom modifiers
|
|
7045
|
-
if (modifiers) {
|
|
7046
|
-
Object.keys(modifiers).forEach((name) => {
|
|
7047
|
-
const modifierValue = modifiers?.[name];
|
|
7048
|
-
const isMatch = modifierValue
|
|
7049
|
-
? dateMatchModifiers(date, modifierValue, dateLib)
|
|
7050
|
-
: false;
|
|
7051
|
-
if (!isMatch)
|
|
7052
|
-
return;
|
|
7053
|
-
if (customModifiersMap[name]) {
|
|
7054
|
-
customModifiersMap[name].push(day);
|
|
7055
|
-
}
|
|
7056
|
-
else {
|
|
7057
|
-
customModifiersMap[name] = [day];
|
|
7058
|
-
}
|
|
7059
|
-
});
|
|
7060
|
-
}
|
|
7061
|
-
}
|
|
7062
|
-
return (day) => {
|
|
7063
|
-
// Initialize all the modifiers to false
|
|
7064
|
-
const dayFlags = {
|
|
7065
|
-
[DayFlag.focused]: false,
|
|
7066
|
-
[DayFlag.disabled]: false,
|
|
7067
|
-
[DayFlag.hidden]: false,
|
|
7068
|
-
[DayFlag.outside]: false,
|
|
7069
|
-
[DayFlag.today]: false
|
|
7070
|
-
};
|
|
7071
|
-
const customModifiers = {};
|
|
7072
|
-
// Find the modifiers for the given day
|
|
7073
|
-
for (const name in internalModifiersMap) {
|
|
7074
|
-
const days = internalModifiersMap[name];
|
|
7075
|
-
dayFlags[name] = days.some((d) => d === day);
|
|
7076
|
-
}
|
|
7077
|
-
for (const name in customModifiersMap) {
|
|
7078
|
-
customModifiers[name] = customModifiersMap[name].some((d) => d === day);
|
|
7079
|
-
}
|
|
7080
|
-
return {
|
|
7081
|
-
...dayFlags,
|
|
7082
|
-
// custom modifiers should override all the previous ones
|
|
7083
|
-
...customModifiers
|
|
7084
|
-
};
|
|
7085
|
-
};
|
|
7086
|
-
}
|
|
7087
|
-
|
|
7088
|
-
/**
|
|
7089
|
-
* Returns the class names for a day based on its modifiers.
|
|
7090
|
-
*
|
|
7091
|
-
* This function combines the base class name for the day with any class names
|
|
7092
|
-
* associated with active modifiers.
|
|
7093
|
-
*
|
|
7094
|
-
* @param modifiers The modifiers applied to the day.
|
|
7095
|
-
* @param classNames The base class names for the calendar elements.
|
|
7096
|
-
* @param modifiersClassNames The class names associated with specific
|
|
7097
|
-
* modifiers.
|
|
7098
|
-
* @returns An array of class names for the day.
|
|
7099
|
-
*/
|
|
7100
|
-
function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
|
|
7101
|
-
const modifierClassNames = Object.entries(modifiers)
|
|
7102
|
-
.filter(([, active]) => active === true)
|
|
7103
|
-
.reduce((previousValue, [key]) => {
|
|
7104
|
-
if (modifiersClassNames[key]) {
|
|
7105
|
-
previousValue.push(modifiersClassNames[key]);
|
|
7106
|
-
}
|
|
7107
|
-
else if (classNames[DayFlag[key]]) {
|
|
7108
|
-
previousValue.push(classNames[DayFlag[key]]);
|
|
7109
|
-
}
|
|
7110
|
-
else if (classNames[SelectionState[key]]) {
|
|
7111
|
-
previousValue.push(classNames[SelectionState[key]]);
|
|
7112
|
-
}
|
|
7113
|
-
return previousValue;
|
|
7114
|
-
}, [classNames[UI.Day]]);
|
|
7115
|
-
return modifierClassNames;
|
|
7116
|
-
}
|
|
7117
|
-
|
|
7118
6739
|
/**
|
|
7119
6740
|
* Render the button elements in the calendar.
|
|
7120
6741
|
*
|
|
@@ -7143,7 +6764,9 @@ function CaptionLabel(props) {
|
|
|
7143
6764
|
*/
|
|
7144
6765
|
function Chevron(props) {
|
|
7145
6766
|
const { size = 24, orientation = "left", className } = props;
|
|
7146
|
-
return (
|
|
6767
|
+
return (
|
|
6768
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
6769
|
+
React__default.createElement("svg", { className: className, width: size, height: size, viewBox: "0 0 24 24" },
|
|
7147
6770
|
orientation === "up" && (React__default.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" })),
|
|
7148
6771
|
orientation === "down" && (React__default.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" })),
|
|
7149
6772
|
orientation === "left" && (React__default.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" })),
|
|
@@ -7181,6 +6804,127 @@ function DayButton(props) {
|
|
|
7181
6804
|
return React__default.createElement("button", { ref: ref, ...buttonProps });
|
|
7182
6805
|
}
|
|
7183
6806
|
|
|
6807
|
+
/**
|
|
6808
|
+
* Enum representing the UI elements composing DayPicker. These elements are
|
|
6809
|
+
* mapped to {@link CustomComponents}, {@link ClassNames}, and {@link Styles}.
|
|
6810
|
+
*
|
|
6811
|
+
* Some elements are extended by flags and modifiers.
|
|
6812
|
+
*/
|
|
6813
|
+
var UI;
|
|
6814
|
+
(function (UI) {
|
|
6815
|
+
/** The root component displaying the months and the navigation bar. */
|
|
6816
|
+
UI["Root"] = "root";
|
|
6817
|
+
/** The Chevron SVG element used by navigation buttons and dropdowns. */
|
|
6818
|
+
UI["Chevron"] = "chevron";
|
|
6819
|
+
/**
|
|
6820
|
+
* The grid cell with the day's date. Extended by {@link DayFlag} and
|
|
6821
|
+
* {@link SelectionState}.
|
|
6822
|
+
*/
|
|
6823
|
+
UI["Day"] = "day";
|
|
6824
|
+
/** The button containing the formatted day's date, inside the grid cell. */
|
|
6825
|
+
UI["DayButton"] = "day_button";
|
|
6826
|
+
/** The caption label of the month (when not showing the dropdown navigation). */
|
|
6827
|
+
UI["CaptionLabel"] = "caption_label";
|
|
6828
|
+
/** The container of the dropdown navigation (when enabled). */
|
|
6829
|
+
UI["Dropdowns"] = "dropdowns";
|
|
6830
|
+
/** The dropdown element to select for years and months. */
|
|
6831
|
+
UI["Dropdown"] = "dropdown";
|
|
6832
|
+
/** The container element of the dropdown. */
|
|
6833
|
+
UI["DropdownRoot"] = "dropdown_root";
|
|
6834
|
+
/** The root element of the footer. */
|
|
6835
|
+
UI["Footer"] = "footer";
|
|
6836
|
+
/** The month grid. */
|
|
6837
|
+
UI["MonthGrid"] = "month_grid";
|
|
6838
|
+
/** Contains the dropdown navigation or the caption label. */
|
|
6839
|
+
UI["MonthCaption"] = "month_caption";
|
|
6840
|
+
/** The dropdown with the months. */
|
|
6841
|
+
UI["MonthsDropdown"] = "months_dropdown";
|
|
6842
|
+
/** Wrapper of the month grid. */
|
|
6843
|
+
UI["Month"] = "month";
|
|
6844
|
+
/** The container of the displayed months. */
|
|
6845
|
+
UI["Months"] = "months";
|
|
6846
|
+
/** The navigation bar with the previous and next buttons. */
|
|
6847
|
+
UI["Nav"] = "nav";
|
|
6848
|
+
/**
|
|
6849
|
+
* The next month button in the navigation. *
|
|
6850
|
+
*
|
|
6851
|
+
* @since 9.1.0
|
|
6852
|
+
*/
|
|
6853
|
+
UI["NextMonthButton"] = "button_next";
|
|
6854
|
+
/**
|
|
6855
|
+
* The previous month button in the navigation.
|
|
6856
|
+
*
|
|
6857
|
+
* @since 9.1.0
|
|
6858
|
+
*/
|
|
6859
|
+
UI["PreviousMonthButton"] = "button_previous";
|
|
6860
|
+
/** The row containing the week. */
|
|
6861
|
+
UI["Week"] = "week";
|
|
6862
|
+
/** The group of row weeks in a month (`tbody`). */
|
|
6863
|
+
UI["Weeks"] = "weeks";
|
|
6864
|
+
/** The column header with the weekday. */
|
|
6865
|
+
UI["Weekday"] = "weekday";
|
|
6866
|
+
/** The row grouping the weekdays in the column headers. */
|
|
6867
|
+
UI["Weekdays"] = "weekdays";
|
|
6868
|
+
/** The cell containing the week number. */
|
|
6869
|
+
UI["WeekNumber"] = "week_number";
|
|
6870
|
+
/** The cell header of the week numbers column. */
|
|
6871
|
+
UI["WeekNumberHeader"] = "week_number_header";
|
|
6872
|
+
/** The dropdown with the years. */
|
|
6873
|
+
UI["YearsDropdown"] = "years_dropdown";
|
|
6874
|
+
})(UI || (UI = {}));
|
|
6875
|
+
/** Enum representing flags for the {@link UI.Day} element. */
|
|
6876
|
+
var DayFlag;
|
|
6877
|
+
(function (DayFlag) {
|
|
6878
|
+
/** The day is disabled. */
|
|
6879
|
+
DayFlag["disabled"] = "disabled";
|
|
6880
|
+
/** The day is hidden. */
|
|
6881
|
+
DayFlag["hidden"] = "hidden";
|
|
6882
|
+
/** The day is outside the current month. */
|
|
6883
|
+
DayFlag["outside"] = "outside";
|
|
6884
|
+
/** The day is focused. */
|
|
6885
|
+
DayFlag["focused"] = "focused";
|
|
6886
|
+
/** The day is today. */
|
|
6887
|
+
DayFlag["today"] = "today";
|
|
6888
|
+
})(DayFlag || (DayFlag = {}));
|
|
6889
|
+
/**
|
|
6890
|
+
* Enum representing selection states that can be applied to the {@link UI.Day}
|
|
6891
|
+
* element in selection mode.
|
|
6892
|
+
*/
|
|
6893
|
+
var SelectionState;
|
|
6894
|
+
(function (SelectionState) {
|
|
6895
|
+
/** The day is at the end of a selected range. */
|
|
6896
|
+
SelectionState["range_end"] = "range_end";
|
|
6897
|
+
/** The day is at the middle of a selected range. */
|
|
6898
|
+
SelectionState["range_middle"] = "range_middle";
|
|
6899
|
+
/** The day is at the start of a selected range. */
|
|
6900
|
+
SelectionState["range_start"] = "range_start";
|
|
6901
|
+
/** The day is selected. */
|
|
6902
|
+
SelectionState["selected"] = "selected";
|
|
6903
|
+
})(SelectionState || (SelectionState = {}));
|
|
6904
|
+
/**
|
|
6905
|
+
* Enum representing different animation states for transitioning between
|
|
6906
|
+
* months.
|
|
6907
|
+
*/
|
|
6908
|
+
var Animation;
|
|
6909
|
+
(function (Animation) {
|
|
6910
|
+
/** The entering weeks when they appear before the exiting month. */
|
|
6911
|
+
Animation["weeks_before_enter"] = "weeks_before_enter";
|
|
6912
|
+
/** The exiting weeks when they disappear before the entering month. */
|
|
6913
|
+
Animation["weeks_before_exit"] = "weeks_before_exit";
|
|
6914
|
+
/** The entering weeks when they appear after the exiting month. */
|
|
6915
|
+
Animation["weeks_after_enter"] = "weeks_after_enter";
|
|
6916
|
+
/** The exiting weeks when they disappear after the entering month. */
|
|
6917
|
+
Animation["weeks_after_exit"] = "weeks_after_exit";
|
|
6918
|
+
/** The entering caption when it appears after the exiting month. */
|
|
6919
|
+
Animation["caption_after_enter"] = "caption_after_enter";
|
|
6920
|
+
/** The exiting caption when it disappears after the entering month. */
|
|
6921
|
+
Animation["caption_after_exit"] = "caption_after_exit";
|
|
6922
|
+
/** The entering caption when it appears before the exiting month. */
|
|
6923
|
+
Animation["caption_before_enter"] = "caption_before_enter";
|
|
6924
|
+
/** The exiting caption when it disappears before the entering month. */
|
|
6925
|
+
Animation["caption_before_exit"] = "caption_before_exit";
|
|
6926
|
+
})(Animation || (Animation = {}));
|
|
6927
|
+
|
|
7184
6928
|
/**
|
|
7185
6929
|
* Render a dropdown component for navigation in the calendar.
|
|
7186
6930
|
*
|
|
@@ -7302,7 +7046,7 @@ function MonthsDropdown(props) {
|
|
|
7302
7046
|
*/
|
|
7303
7047
|
function Nav(props) {
|
|
7304
7048
|
const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;
|
|
7305
|
-
const { components, classNames, labels: { labelPrevious, labelNext } } = useDayPicker();
|
|
7049
|
+
const { components, classNames, labels: { labelPrevious, labelNext }, } = useDayPicker();
|
|
7306
7050
|
const handleNextClick = useCallback((e) => {
|
|
7307
7051
|
if (nextMonth) {
|
|
7308
7052
|
onNextClick?.(e);
|
|
@@ -7477,6 +7221,281 @@ const components = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty
|
|
|
7477
7221
|
YearsDropdown
|
|
7478
7222
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
7479
7223
|
|
|
7224
|
+
/**
|
|
7225
|
+
* Checks if a given date is within a specified date range.
|
|
7226
|
+
*
|
|
7227
|
+
* @since 9.0.0
|
|
7228
|
+
* @param range - The date range to check against.
|
|
7229
|
+
* @param date - The date to check.
|
|
7230
|
+
* @param excludeEnds - If `true`, the range's start and end dates are excluded.
|
|
7231
|
+
* @param dateLib - The date utility library instance.
|
|
7232
|
+
* @returns `true` if the date is within the range, otherwise `false`.
|
|
7233
|
+
* @group Utilities
|
|
7234
|
+
*/
|
|
7235
|
+
function rangeIncludesDate(range, date, excludeEnds = false, dateLib = defaultDateLib) {
|
|
7236
|
+
let { from, to } = range;
|
|
7237
|
+
const { differenceInCalendarDays, isSameDay } = dateLib;
|
|
7238
|
+
if (from && to) {
|
|
7239
|
+
const isRangeInverted = differenceInCalendarDays(to, from) < 0;
|
|
7240
|
+
if (isRangeInverted) {
|
|
7241
|
+
[from, to] = [to, from];
|
|
7242
|
+
}
|
|
7243
|
+
const isInRange = differenceInCalendarDays(date, from) >= (excludeEnds ? 1 : 0) &&
|
|
7244
|
+
differenceInCalendarDays(to, date) >= (excludeEnds ? 1 : 0);
|
|
7245
|
+
return isInRange;
|
|
7246
|
+
}
|
|
7247
|
+
if (!excludeEnds && to) {
|
|
7248
|
+
return isSameDay(to, date);
|
|
7249
|
+
}
|
|
7250
|
+
if (!excludeEnds && from) {
|
|
7251
|
+
return isSameDay(from, date);
|
|
7252
|
+
}
|
|
7253
|
+
return false;
|
|
7254
|
+
}
|
|
7255
|
+
|
|
7256
|
+
/**
|
|
7257
|
+
* Checks if the given value is of type {@link DateInterval}.
|
|
7258
|
+
*
|
|
7259
|
+
* @param matcher - The value to check.
|
|
7260
|
+
* @returns `true` if the value is a {@link DateInterval}, otherwise `false`.
|
|
7261
|
+
* @group Utilities
|
|
7262
|
+
*/
|
|
7263
|
+
function isDateInterval(matcher) {
|
|
7264
|
+
return Boolean(matcher &&
|
|
7265
|
+
typeof matcher === "object" &&
|
|
7266
|
+
"before" in matcher &&
|
|
7267
|
+
"after" in matcher);
|
|
7268
|
+
}
|
|
7269
|
+
/**
|
|
7270
|
+
* Checks if the given value is of type {@link DateRange}.
|
|
7271
|
+
*
|
|
7272
|
+
* @param value - The value to check.
|
|
7273
|
+
* @returns `true` if the value is a {@link DateRange}, otherwise `false`.
|
|
7274
|
+
* @group Utilities
|
|
7275
|
+
*/
|
|
7276
|
+
function isDateRange(value) {
|
|
7277
|
+
return Boolean(value && typeof value === "object" && "from" in value);
|
|
7278
|
+
}
|
|
7279
|
+
/**
|
|
7280
|
+
* Checks if the given value is of type {@link DateAfter}.
|
|
7281
|
+
*
|
|
7282
|
+
* @param value - The value to check.
|
|
7283
|
+
* @returns `true` if the value is a {@link DateAfter}, otherwise `false`.
|
|
7284
|
+
* @group Utilities
|
|
7285
|
+
*/
|
|
7286
|
+
function isDateAfterType(value) {
|
|
7287
|
+
return Boolean(value && typeof value === "object" && "after" in value);
|
|
7288
|
+
}
|
|
7289
|
+
/**
|
|
7290
|
+
* Checks if the given value is of type {@link DateBefore}.
|
|
7291
|
+
*
|
|
7292
|
+
* @param value - The value to check.
|
|
7293
|
+
* @returns `true` if the value is a {@link DateBefore}, otherwise `false`.
|
|
7294
|
+
* @group Utilities
|
|
7295
|
+
*/
|
|
7296
|
+
function isDateBeforeType(value) {
|
|
7297
|
+
return Boolean(value && typeof value === "object" && "before" in value);
|
|
7298
|
+
}
|
|
7299
|
+
/**
|
|
7300
|
+
* Checks if the given value is of type {@link DayOfWeek}.
|
|
7301
|
+
*
|
|
7302
|
+
* @param value - The value to check.
|
|
7303
|
+
* @returns `true` if the value is a {@link DayOfWeek}, otherwise `false`.
|
|
7304
|
+
* @group Utilities
|
|
7305
|
+
*/
|
|
7306
|
+
function isDayOfWeekType(value) {
|
|
7307
|
+
return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
|
|
7308
|
+
}
|
|
7309
|
+
/**
|
|
7310
|
+
* Checks if the given value is an array of valid dates.
|
|
7311
|
+
*
|
|
7312
|
+
* @private
|
|
7313
|
+
* @param value - The value to check.
|
|
7314
|
+
* @param dateLib - The date utility library instance.
|
|
7315
|
+
* @returns `true` if the value is an array of valid dates, otherwise `false`.
|
|
7316
|
+
*/
|
|
7317
|
+
function isDatesArray(value, dateLib) {
|
|
7318
|
+
return Array.isArray(value) && value.every(dateLib.isDate);
|
|
7319
|
+
}
|
|
7320
|
+
|
|
7321
|
+
/**
|
|
7322
|
+
* Checks if a given date matches at least one of the specified {@link Matcher}.
|
|
7323
|
+
*
|
|
7324
|
+
* @param date - The date to check.
|
|
7325
|
+
* @param matchers - The matchers to check against.
|
|
7326
|
+
* @param dateLib - The date utility library instance.
|
|
7327
|
+
* @returns `true` if the date matches any of the matchers, otherwise `false`.
|
|
7328
|
+
* @group Utilities
|
|
7329
|
+
*/
|
|
7330
|
+
function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
7331
|
+
const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
|
|
7332
|
+
const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;
|
|
7333
|
+
return matchersArr.some((matcher) => {
|
|
7334
|
+
if (typeof matcher === "boolean") {
|
|
7335
|
+
return matcher;
|
|
7336
|
+
}
|
|
7337
|
+
if (dateLib.isDate(matcher)) {
|
|
7338
|
+
return isSameDay(date, matcher);
|
|
7339
|
+
}
|
|
7340
|
+
if (isDatesArray(matcher, dateLib)) {
|
|
7341
|
+
return matcher.includes(date);
|
|
7342
|
+
}
|
|
7343
|
+
if (isDateRange(matcher)) {
|
|
7344
|
+
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
7345
|
+
}
|
|
7346
|
+
if (isDayOfWeekType(matcher)) {
|
|
7347
|
+
if (!Array.isArray(matcher.dayOfWeek)) {
|
|
7348
|
+
return matcher.dayOfWeek === date.getDay();
|
|
7349
|
+
}
|
|
7350
|
+
return matcher.dayOfWeek.includes(date.getDay());
|
|
7351
|
+
}
|
|
7352
|
+
if (isDateInterval(matcher)) {
|
|
7353
|
+
const diffBefore = differenceInCalendarDays(matcher.before, date);
|
|
7354
|
+
const diffAfter = differenceInCalendarDays(matcher.after, date);
|
|
7355
|
+
const isDayBefore = diffBefore > 0;
|
|
7356
|
+
const isDayAfter = diffAfter < 0;
|
|
7357
|
+
const isClosedInterval = isAfter(matcher.before, matcher.after);
|
|
7358
|
+
if (isClosedInterval) {
|
|
7359
|
+
return isDayAfter && isDayBefore;
|
|
7360
|
+
}
|
|
7361
|
+
else {
|
|
7362
|
+
return isDayBefore || isDayAfter;
|
|
7363
|
+
}
|
|
7364
|
+
}
|
|
7365
|
+
if (isDateAfterType(matcher)) {
|
|
7366
|
+
return differenceInCalendarDays(date, matcher.after) > 0;
|
|
7367
|
+
}
|
|
7368
|
+
if (isDateBeforeType(matcher)) {
|
|
7369
|
+
return differenceInCalendarDays(matcher.before, date) > 0;
|
|
7370
|
+
}
|
|
7371
|
+
if (typeof matcher === "function") {
|
|
7372
|
+
return matcher(date);
|
|
7373
|
+
}
|
|
7374
|
+
return false;
|
|
7375
|
+
});
|
|
7376
|
+
}
|
|
7377
|
+
|
|
7378
|
+
/**
|
|
7379
|
+
* Creates a function to retrieve the modifiers for a given day.
|
|
7380
|
+
*
|
|
7381
|
+
* This function calculates both internal and custom modifiers for each day
|
|
7382
|
+
* based on the provided calendar days and DayPicker props.
|
|
7383
|
+
*
|
|
7384
|
+
* @private
|
|
7385
|
+
* @param days The array of `CalendarDay` objects to process.
|
|
7386
|
+
* @param props The DayPicker props, including modifiers and configuration
|
|
7387
|
+
* options.
|
|
7388
|
+
* @param dateLib The date library to use for date manipulation.
|
|
7389
|
+
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
7390
|
+
*/
|
|
7391
|
+
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
7392
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
7393
|
+
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
7394
|
+
const computedNavStart = navStart && startOfMonth(navStart);
|
|
7395
|
+
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
7396
|
+
const internalModifiersMap = {
|
|
7397
|
+
[DayFlag.focused]: [],
|
|
7398
|
+
[DayFlag.outside]: [],
|
|
7399
|
+
[DayFlag.disabled]: [],
|
|
7400
|
+
[DayFlag.hidden]: [],
|
|
7401
|
+
[DayFlag.today]: [],
|
|
7402
|
+
};
|
|
7403
|
+
const customModifiersMap = {};
|
|
7404
|
+
for (const day of days) {
|
|
7405
|
+
const { date, displayMonth } = day;
|
|
7406
|
+
const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));
|
|
7407
|
+
const isBeforeNavStart = Boolean(computedNavStart && isBefore(date, computedNavStart));
|
|
7408
|
+
const isAfterNavEnd = Boolean(computedNavEnd && isAfter(date, computedNavEnd));
|
|
7409
|
+
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
|
|
7410
|
+
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||
|
|
7411
|
+
isBeforeNavStart ||
|
|
7412
|
+
isAfterNavEnd ||
|
|
7413
|
+
// Broadcast calendar will show outside days as default
|
|
7414
|
+
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
7415
|
+
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
7416
|
+
const isToday = isSameDay(date, today ?? dateLib.today());
|
|
7417
|
+
if (isOutside)
|
|
7418
|
+
internalModifiersMap.outside.push(day);
|
|
7419
|
+
if (isDisabled)
|
|
7420
|
+
internalModifiersMap.disabled.push(day);
|
|
7421
|
+
if (isHidden)
|
|
7422
|
+
internalModifiersMap.hidden.push(day);
|
|
7423
|
+
if (isToday)
|
|
7424
|
+
internalModifiersMap.today.push(day);
|
|
7425
|
+
// Add custom modifiers
|
|
7426
|
+
if (modifiers) {
|
|
7427
|
+
Object.keys(modifiers).forEach((name) => {
|
|
7428
|
+
const modifierValue = modifiers?.[name];
|
|
7429
|
+
const isMatch = modifierValue
|
|
7430
|
+
? dateMatchModifiers(date, modifierValue, dateLib)
|
|
7431
|
+
: false;
|
|
7432
|
+
if (!isMatch)
|
|
7433
|
+
return;
|
|
7434
|
+
if (customModifiersMap[name]) {
|
|
7435
|
+
customModifiersMap[name].push(day);
|
|
7436
|
+
}
|
|
7437
|
+
else {
|
|
7438
|
+
customModifiersMap[name] = [day];
|
|
7439
|
+
}
|
|
7440
|
+
});
|
|
7441
|
+
}
|
|
7442
|
+
}
|
|
7443
|
+
return (day) => {
|
|
7444
|
+
// Initialize all the modifiers to false
|
|
7445
|
+
const dayFlags = {
|
|
7446
|
+
[DayFlag.focused]: false,
|
|
7447
|
+
[DayFlag.disabled]: false,
|
|
7448
|
+
[DayFlag.hidden]: false,
|
|
7449
|
+
[DayFlag.outside]: false,
|
|
7450
|
+
[DayFlag.today]: false,
|
|
7451
|
+
};
|
|
7452
|
+
const customModifiers = {};
|
|
7453
|
+
// Find the modifiers for the given day
|
|
7454
|
+
for (const name in internalModifiersMap) {
|
|
7455
|
+
const days = internalModifiersMap[name];
|
|
7456
|
+
dayFlags[name] = days.some((d) => d === day);
|
|
7457
|
+
}
|
|
7458
|
+
for (const name in customModifiersMap) {
|
|
7459
|
+
customModifiers[name] = customModifiersMap[name].some((d) => d === day);
|
|
7460
|
+
}
|
|
7461
|
+
return {
|
|
7462
|
+
...dayFlags,
|
|
7463
|
+
// custom modifiers should override all the previous ones
|
|
7464
|
+
...customModifiers,
|
|
7465
|
+
};
|
|
7466
|
+
};
|
|
7467
|
+
}
|
|
7468
|
+
|
|
7469
|
+
/**
|
|
7470
|
+
* Returns the class names for a day based on its modifiers.
|
|
7471
|
+
*
|
|
7472
|
+
* This function combines the base class name for the day with any class names
|
|
7473
|
+
* associated with active modifiers.
|
|
7474
|
+
*
|
|
7475
|
+
* @param modifiers The modifiers applied to the day.
|
|
7476
|
+
* @param classNames The base class names for the calendar elements.
|
|
7477
|
+
* @param modifiersClassNames The class names associated with specific
|
|
7478
|
+
* modifiers.
|
|
7479
|
+
* @returns An array of class names for the day.
|
|
7480
|
+
*/
|
|
7481
|
+
function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {
|
|
7482
|
+
const modifierClassNames = Object.entries(modifiers)
|
|
7483
|
+
.filter(([, active]) => active === true)
|
|
7484
|
+
.reduce((previousValue, [key]) => {
|
|
7485
|
+
if (modifiersClassNames[key]) {
|
|
7486
|
+
previousValue.push(modifiersClassNames[key]);
|
|
7487
|
+
}
|
|
7488
|
+
else if (classNames[DayFlag[key]]) {
|
|
7489
|
+
previousValue.push(classNames[DayFlag[key]]);
|
|
7490
|
+
}
|
|
7491
|
+
else if (classNames[SelectionState[key]]) {
|
|
7492
|
+
previousValue.push(classNames[SelectionState[key]]);
|
|
7493
|
+
}
|
|
7494
|
+
return previousValue;
|
|
7495
|
+
}, [classNames[UI.Day]]);
|
|
7496
|
+
return modifierClassNames;
|
|
7497
|
+
}
|
|
7498
|
+
|
|
7480
7499
|
/**
|
|
7481
7500
|
* Merges custom components from the props with the default components.
|
|
7482
7501
|
*
|
|
@@ -7490,7 +7509,7 @@ const components = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty
|
|
|
7490
7509
|
function getComponents(customComponents) {
|
|
7491
7510
|
return {
|
|
7492
7511
|
...components,
|
|
7493
|
-
...customComponents
|
|
7512
|
+
...customComponents,
|
|
7494
7513
|
};
|
|
7495
7514
|
}
|
|
7496
7515
|
|
|
@@ -7510,7 +7529,7 @@ function getDataAttributes(props) {
|
|
|
7510
7529
|
"data-multiple-months": (props.numberOfMonths && props.numberOfMonths > 1) || undefined,
|
|
7511
7530
|
"data-week-numbers": props.showWeekNumber || undefined,
|
|
7512
7531
|
"data-broadcast-calendar": props.broadcastCalendar || undefined,
|
|
7513
|
-
"data-nav-layout": props.navLayout || undefined
|
|
7532
|
+
"data-nav-layout": props.navLayout || undefined,
|
|
7514
7533
|
};
|
|
7515
7534
|
Object.entries(props).forEach(([key, val]) => {
|
|
7516
7535
|
if (key.startsWith("data-")) {
|
|
@@ -7603,6 +7622,22 @@ function formatMonthDropdown(month, dateLib = defaultDateLib) {
|
|
|
7603
7622
|
return dateLib.format(month, "LLLL");
|
|
7604
7623
|
}
|
|
7605
7624
|
|
|
7625
|
+
/**
|
|
7626
|
+
* Formats the name of a weekday to be displayed in the weekdays header.
|
|
7627
|
+
*
|
|
7628
|
+
* @defaultValue `cccccc` (e.g., "Mo" for Monday).
|
|
7629
|
+
* @param weekday The date representing the weekday.
|
|
7630
|
+
* @param options Configuration options for the date library.
|
|
7631
|
+
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
7632
|
+
* instance is created.
|
|
7633
|
+
* @returns The formatted weekday name as a string.
|
|
7634
|
+
* @group Formatters
|
|
7635
|
+
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
7636
|
+
*/
|
|
7637
|
+
function formatWeekdayName(weekday, options, dateLib) {
|
|
7638
|
+
return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7606
7641
|
/**
|
|
7607
7642
|
* Formats the week number.
|
|
7608
7643
|
*
|
|
@@ -7633,22 +7668,6 @@ function formatWeekNumberHeader() {
|
|
|
7633
7668
|
return ``;
|
|
7634
7669
|
}
|
|
7635
7670
|
|
|
7636
|
-
/**
|
|
7637
|
-
* Formats the name of a weekday to be displayed in the weekdays header.
|
|
7638
|
-
*
|
|
7639
|
-
* @defaultValue `cccccc` (e.g., "Mo" for Monday).
|
|
7640
|
-
* @param weekday The date representing the weekday.
|
|
7641
|
-
* @param options Configuration options for the date library.
|
|
7642
|
-
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
7643
|
-
* instance is created.
|
|
7644
|
-
* @returns The formatted weekday name as a string.
|
|
7645
|
-
* @group Formatters
|
|
7646
|
-
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
7647
|
-
*/
|
|
7648
|
-
function formatWeekdayName(weekday, options, dateLib) {
|
|
7649
|
-
return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
|
|
7650
|
-
}
|
|
7651
|
-
|
|
7652
7671
|
/**
|
|
7653
7672
|
* Formats the year for the dropdown option label.
|
|
7654
7673
|
*
|
|
@@ -7699,7 +7718,7 @@ function getFormatters(customFormatters) {
|
|
|
7699
7718
|
}
|
|
7700
7719
|
return {
|
|
7701
7720
|
...defaultFormatters,
|
|
7702
|
-
...customFormatters
|
|
7721
|
+
...customFormatters,
|
|
7703
7722
|
};
|
|
7704
7723
|
}
|
|
7705
7724
|
|
|
@@ -7719,10 +7738,10 @@ function getFormatters(customFormatters) {
|
|
|
7719
7738
|
* if no months are available.
|
|
7720
7739
|
*/
|
|
7721
7740
|
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
7722
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth } = dateLib;
|
|
7741
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
7723
7742
|
const months = eachMonthOfInterval({
|
|
7724
7743
|
start: startOfYear(displayMonth),
|
|
7725
|
-
end: endOfYear(displayMonth)
|
|
7744
|
+
end: endOfYear(displayMonth),
|
|
7726
7745
|
});
|
|
7727
7746
|
const options = months.map((month) => {
|
|
7728
7747
|
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
@@ -7753,7 +7772,7 @@ function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
|
7753
7772
|
.forEach(([modifier]) => {
|
|
7754
7773
|
style = {
|
|
7755
7774
|
...style,
|
|
7756
|
-
...modifiersStyles?.[modifier]
|
|
7775
|
+
...modifiersStyles?.[modifier],
|
|
7757
7776
|
};
|
|
7758
7777
|
});
|
|
7759
7778
|
return style;
|
|
@@ -7792,10 +7811,11 @@ function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
|
7792
7811
|
* @param navEnd The end date for navigation.
|
|
7793
7812
|
* @param formatters The formatters to use for formatting the year labels.
|
|
7794
7813
|
* @param dateLib The date library to use for date manipulation.
|
|
7814
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
7795
7815
|
* @returns An array of dropdown options representing the years, or `undefined`
|
|
7796
7816
|
* if `navStart` or `navEnd` is not provided.
|
|
7797
7817
|
*/
|
|
7798
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib) {
|
|
7818
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
7799
7819
|
if (!navStart)
|
|
7800
7820
|
return undefined;
|
|
7801
7821
|
if (!navEnd)
|
|
@@ -7809,16 +7829,47 @@ function getYearOptions(navStart, navEnd, formatters, dateLib) {
|
|
|
7809
7829
|
years.push(year);
|
|
7810
7830
|
year = addYears(year, 1);
|
|
7811
7831
|
}
|
|
7832
|
+
if (reverse)
|
|
7833
|
+
years.reverse();
|
|
7812
7834
|
return years.map((year) => {
|
|
7813
7835
|
const label = formatters.formatYearDropdown(year, dateLib);
|
|
7814
7836
|
return {
|
|
7815
7837
|
value: getYear(year),
|
|
7816
7838
|
label,
|
|
7817
|
-
disabled: false
|
|
7839
|
+
disabled: false,
|
|
7818
7840
|
};
|
|
7819
7841
|
});
|
|
7820
7842
|
}
|
|
7821
7843
|
|
|
7844
|
+
/**
|
|
7845
|
+
* Generates the ARIA label for a day button.
|
|
7846
|
+
*
|
|
7847
|
+
* Use the `modifiers` argument to provide additional context for the label,
|
|
7848
|
+
* such as indicating if the day is "today" or "selected."
|
|
7849
|
+
*
|
|
7850
|
+
* @defaultValue The formatted date.
|
|
7851
|
+
* @param date - The date to format.
|
|
7852
|
+
* @param modifiers - The modifiers providing context for the day.
|
|
7853
|
+
* @param options - Optional configuration for the date formatting library.
|
|
7854
|
+
* @param dateLib - An optional instance of the date formatting library.
|
|
7855
|
+
* @returns The ARIA label for the day button.
|
|
7856
|
+
* @group Labels
|
|
7857
|
+
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7858
|
+
*/
|
|
7859
|
+
function labelDayButton(date, modifiers, options, dateLib) {
|
|
7860
|
+
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
|
|
7861
|
+
if (modifiers.today)
|
|
7862
|
+
label = `Today, ${label}`;
|
|
7863
|
+
if (modifiers.selected)
|
|
7864
|
+
label = `${label}, selected`;
|
|
7865
|
+
return label;
|
|
7866
|
+
}
|
|
7867
|
+
/**
|
|
7868
|
+
* @ignore
|
|
7869
|
+
* @deprecated Use `labelDayButton` instead.
|
|
7870
|
+
*/
|
|
7871
|
+
const labelDay = labelDayButton;
|
|
7872
|
+
|
|
7822
7873
|
/**
|
|
7823
7874
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
7824
7875
|
* the grid.
|
|
@@ -7860,33 +7911,17 @@ function labelGridcell(date, modifiers, options, dateLib) {
|
|
|
7860
7911
|
}
|
|
7861
7912
|
|
|
7862
7913
|
/**
|
|
7863
|
-
* Generates the ARIA label for
|
|
7864
|
-
*
|
|
7865
|
-
* Use the `modifiers` argument to provide additional context for the label,
|
|
7866
|
-
* such as indicating if the day is "today" or "selected."
|
|
7914
|
+
* Generates the ARIA label for the months dropdown.
|
|
7867
7915
|
*
|
|
7868
|
-
* @defaultValue
|
|
7869
|
-
* @param date - The date to format.
|
|
7870
|
-
* @param modifiers - The modifiers providing context for the day.
|
|
7916
|
+
* @defaultValue `"Choose the Month"`
|
|
7871
7917
|
* @param options - Optional configuration for the date formatting library.
|
|
7872
|
-
* @
|
|
7873
|
-
* @returns The ARIA label for the day button.
|
|
7918
|
+
* @returns The ARIA label for the months dropdown.
|
|
7874
7919
|
* @group Labels
|
|
7875
7920
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7876
7921
|
*/
|
|
7877
|
-
function
|
|
7878
|
-
|
|
7879
|
-
if (modifiers.today)
|
|
7880
|
-
label = `Today, ${label}`;
|
|
7881
|
-
if (modifiers.selected)
|
|
7882
|
-
label = `${label}, selected`;
|
|
7883
|
-
return label;
|
|
7922
|
+
function labelMonthDropdown(_options) {
|
|
7923
|
+
return "Choose the Month";
|
|
7884
7924
|
}
|
|
7885
|
-
/**
|
|
7886
|
-
* @ignore
|
|
7887
|
-
* @deprecated Use `labelDayButton` instead.
|
|
7888
|
-
*/
|
|
7889
|
-
const labelDay = labelDayButton;
|
|
7890
7925
|
|
|
7891
7926
|
/**
|
|
7892
7927
|
* Generates the ARIA label for the navigation toolbar.
|
|
@@ -7900,19 +7935,6 @@ function labelNav() {
|
|
|
7900
7935
|
return "";
|
|
7901
7936
|
}
|
|
7902
7937
|
|
|
7903
|
-
/**
|
|
7904
|
-
* Generates the ARIA label for the months dropdown.
|
|
7905
|
-
*
|
|
7906
|
-
* @defaultValue `"Choose the Month"`
|
|
7907
|
-
* @param options - Optional configuration for the date formatting library.
|
|
7908
|
-
* @returns The ARIA label for the months dropdown.
|
|
7909
|
-
* @group Labels
|
|
7910
|
-
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7911
|
-
*/
|
|
7912
|
-
function labelMonthDropdown(options) {
|
|
7913
|
-
return "Choose the Month";
|
|
7914
|
-
}
|
|
7915
|
-
|
|
7916
7938
|
/**
|
|
7917
7939
|
* Generates the ARIA label for the "next month" button.
|
|
7918
7940
|
*
|
|
@@ -7923,7 +7945,7 @@ function labelMonthDropdown(options) {
|
|
|
7923
7945
|
* @group Labels
|
|
7924
7946
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7925
7947
|
*/
|
|
7926
|
-
function labelNext(
|
|
7948
|
+
function labelNext(_month) {
|
|
7927
7949
|
return "Go to the Next Month";
|
|
7928
7950
|
}
|
|
7929
7951
|
|
|
@@ -7937,7 +7959,7 @@ function labelNext(month) {
|
|
|
7937
7959
|
* @group Labels
|
|
7938
7960
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7939
7961
|
*/
|
|
7940
|
-
function labelPrevious(
|
|
7962
|
+
function labelPrevious(_month) {
|
|
7941
7963
|
return "Go to the Previous Month";
|
|
7942
7964
|
}
|
|
7943
7965
|
|
|
@@ -7966,7 +7988,7 @@ function labelWeekday(date, options, dateLib) {
|
|
|
7966
7988
|
* @group Labels
|
|
7967
7989
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7968
7990
|
*/
|
|
7969
|
-
function labelWeekNumber(weekNumber,
|
|
7991
|
+
function labelWeekNumber(weekNumber, _options) {
|
|
7970
7992
|
return `Week ${weekNumber}`;
|
|
7971
7993
|
}
|
|
7972
7994
|
|
|
@@ -7979,7 +8001,7 @@ function labelWeekNumber(weekNumber, options) {
|
|
|
7979
8001
|
* @group Labels
|
|
7980
8002
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7981
8003
|
*/
|
|
7982
|
-
function labelWeekNumberHeader(
|
|
8004
|
+
function labelWeekNumberHeader(_options) {
|
|
7983
8005
|
return "Week Number";
|
|
7984
8006
|
}
|
|
7985
8007
|
|
|
@@ -7992,7 +8014,7 @@ function labelWeekNumberHeader(options) {
|
|
|
7992
8014
|
* @group Labels
|
|
7993
8015
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7994
8016
|
*/
|
|
7995
|
-
function labelYearDropdown(
|
|
8017
|
+
function labelYearDropdown(_options) {
|
|
7996
8018
|
return "Choose the Year";
|
|
7997
8019
|
}
|
|
7998
8020
|
|
|
@@ -8019,7 +8041,7 @@ const asHtmlElement = (element) => {
|
|
|
8019
8041
|
return null;
|
|
8020
8042
|
};
|
|
8021
8043
|
const queryMonthEls = (element) => [
|
|
8022
|
-
...(element.querySelectorAll("[data-animated-month]") ?? [])
|
|
8044
|
+
...(element.querySelectorAll("[data-animated-month]") ?? []),
|
|
8023
8045
|
];
|
|
8024
8046
|
const queryMonthEl = (element) => asHtmlElement(element.querySelector("[data-animated-month]"));
|
|
8025
8047
|
const queryCaptionEl = (element) => asHtmlElement(element.querySelector("[data-animated-caption]"));
|
|
@@ -8037,7 +8059,7 @@ const queryWeekdaysEl = (element) => asHtmlElement(element.querySelector("[data-
|
|
|
8037
8059
|
* @param options - Configuration options for the animation, including class
|
|
8038
8060
|
* names, months, focused day, and the date utility library.
|
|
8039
8061
|
*/
|
|
8040
|
-
function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib }) {
|
|
8062
|
+
function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib, }) {
|
|
8041
8063
|
const previousRootElSnapshotRef = useRef(null);
|
|
8042
8064
|
const previousMonthsRef = useRef(months);
|
|
8043
8065
|
const animatingRef = useRef(false);
|
|
@@ -8106,8 +8128,7 @@ function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib
|
|
|
8106
8128
|
? queryMonthEls(previousRootElSnapshot)
|
|
8107
8129
|
: [];
|
|
8108
8130
|
const currentMonthEls = queryMonthEls(rootElRef.current);
|
|
8109
|
-
if (currentMonthEls &&
|
|
8110
|
-
currentMonthEls.every((el) => el instanceof HTMLElement) &&
|
|
8131
|
+
if (currentMonthEls?.every((el) => el instanceof HTMLElement) &&
|
|
8111
8132
|
previousMonthEls &&
|
|
8112
8133
|
previousMonthEls.every((el) => el instanceof HTMLElement)) {
|
|
8113
8134
|
animatingRef.current = true;
|
|
@@ -8200,7 +8221,7 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
8200
8221
|
const firstMonth = displayMonths[0];
|
|
8201
8222
|
const lastMonth = displayMonths[displayMonths.length - 1];
|
|
8202
8223
|
const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
|
|
8203
|
-
const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;
|
|
8224
|
+
const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
|
|
8204
8225
|
const startWeekFirstDate = broadcastCalendar
|
|
8205
8226
|
? startOfBroadcastWeek(firstMonth, dateLib)
|
|
8206
8227
|
: ISOWeek
|
|
@@ -8246,10 +8267,10 @@ function getDays(calendarMonths) {
|
|
|
8246
8267
|
const initialDays = [];
|
|
8247
8268
|
return calendarMonths.reduce((days, month) => {
|
|
8248
8269
|
const weekDays = month.weeks.reduce((weekDays, week) => {
|
|
8249
|
-
return
|
|
8250
|
-
}, initialDays);
|
|
8251
|
-
return
|
|
8252
|
-
}, initialDays);
|
|
8270
|
+
return weekDays.concat(week.days.slice());
|
|
8271
|
+
}, initialDays.slice());
|
|
8272
|
+
return days.concat(weekDays.slice());
|
|
8273
|
+
}, initialDays.slice());
|
|
8253
8274
|
}
|
|
8254
8275
|
|
|
8255
8276
|
/**
|
|
@@ -8287,7 +8308,7 @@ function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib)
|
|
|
8287
8308
|
* @returns The initial month to display.
|
|
8288
8309
|
*/
|
|
8289
8310
|
function getInitialMonth(props, navStart, navEnd, dateLib) {
|
|
8290
|
-
const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1 } = props;
|
|
8311
|
+
const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1, } = props;
|
|
8291
8312
|
let initialMonth = month || defaultMonth || today;
|
|
8292
8313
|
const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;
|
|
8293
8314
|
if (navEnd &&
|
|
@@ -8316,7 +8337,7 @@ function getInitialMonth(props, navStart, navEnd, dateLib) {
|
|
|
8316
8337
|
* display.
|
|
8317
8338
|
*/
|
|
8318
8339
|
function getMonths(displayMonths, dates, props, dateLib) {
|
|
8319
|
-
const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;
|
|
8340
|
+
const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
|
|
8320
8341
|
const dayPickerMonths = displayMonths.reduce((months, month) => {
|
|
8321
8342
|
const firstDateOfFirstWeek = props.broadcastCalendar
|
|
8322
8343
|
? startOfBroadcastWeek(month, dateLib)
|
|
@@ -8374,7 +8395,7 @@ function getMonths(displayMonths, dates, props, dateLib) {
|
|
|
8374
8395
|
*/
|
|
8375
8396
|
function getNavMonths(props, dateLib) {
|
|
8376
8397
|
let { startMonth, endMonth } = props;
|
|
8377
|
-
const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today } = dateLib;
|
|
8398
|
+
const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;
|
|
8378
8399
|
// Handle deprecated code
|
|
8379
8400
|
const { fromYear, toYear, fromMonth, toMonth } = props;
|
|
8380
8401
|
if (!startMonth && fromMonth) {
|
|
@@ -8411,7 +8432,7 @@ function getNavMonths(props, dateLib) {
|
|
|
8411
8432
|
}
|
|
8412
8433
|
return [
|
|
8413
8434
|
startMonth ? startOfDay(startMonth) : startMonth,
|
|
8414
|
-
endMonth ? startOfDay(endMonth) : endMonth
|
|
8435
|
+
endMonth ? startOfDay(endMonth) : endMonth,
|
|
8415
8436
|
];
|
|
8416
8437
|
}
|
|
8417
8438
|
|
|
@@ -8495,8 +8516,8 @@ function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, date
|
|
|
8495
8516
|
function getWeeks(months) {
|
|
8496
8517
|
const initialWeeks = [];
|
|
8497
8518
|
return months.reduce((weeks, month) => {
|
|
8498
|
-
return
|
|
8499
|
-
}, initialWeeks);
|
|
8519
|
+
return weeks.concat(month.weeks.slice());
|
|
8520
|
+
}, initialWeeks.slice());
|
|
8500
8521
|
}
|
|
8501
8522
|
|
|
8502
8523
|
/**
|
|
@@ -8543,10 +8564,10 @@ function useCalendar(props, dateLib) {
|
|
|
8543
8564
|
const [firstMonth, setFirstMonth] = useControlledValue(initialMonth,
|
|
8544
8565
|
// initialMonth is always computed from props.month if provided
|
|
8545
8566
|
props.month ? initialMonth : undefined);
|
|
8567
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.
|
|
8546
8568
|
useEffect(() => {
|
|
8547
8569
|
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
8548
8570
|
setFirstMonth(newInitialMonth);
|
|
8549
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8550
8571
|
}, [props.timeZone]);
|
|
8551
8572
|
/** The months displayed in the calendar. */
|
|
8552
8573
|
const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);
|
|
@@ -8594,7 +8615,7 @@ function useCalendar(props, dateLib) {
|
|
|
8594
8615
|
previousMonth,
|
|
8595
8616
|
nextMonth,
|
|
8596
8617
|
goToMonth,
|
|
8597
|
-
goToDay
|
|
8618
|
+
goToDay,
|
|
8598
8619
|
};
|
|
8599
8620
|
return calendar;
|
|
8600
8621
|
}
|
|
@@ -8687,7 +8708,7 @@ function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {
|
|
|
8687
8708
|
*/
|
|
8688
8709
|
function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
|
|
8689
8710
|
const { ISOWeek, broadcastCalendar } = props;
|
|
8690
|
-
const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;
|
|
8711
|
+
const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;
|
|
8691
8712
|
const moveFns = {
|
|
8692
8713
|
day: addDays,
|
|
8693
8714
|
week: addWeeks,
|
|
@@ -8702,7 +8723,7 @@ function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dat
|
|
|
8702
8723
|
? endOfBroadcastWeek(date)
|
|
8703
8724
|
: ISOWeek
|
|
8704
8725
|
? endOfISOWeek(date)
|
|
8705
|
-
: endOfWeek(date)
|
|
8726
|
+
: endOfWeek(date),
|
|
8706
8727
|
};
|
|
8707
8728
|
let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
|
|
8708
8729
|
if (moveDir === "before" && navStart) {
|
|
@@ -8737,7 +8758,8 @@ function getNextFocus(moveBy, moveDir, refDay, calendarStartMonth, calendarEndMo
|
|
|
8737
8758
|
return undefined;
|
|
8738
8759
|
}
|
|
8739
8760
|
const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, calendarStartMonth, calendarEndMonth, props, dateLib);
|
|
8740
|
-
const isDisabled = Boolean(props.disabled &&
|
|
8761
|
+
const isDisabled = Boolean(props.disabled &&
|
|
8762
|
+
dateMatchModifiers(focusableDate, props.disabled, dateLib));
|
|
8741
8763
|
const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));
|
|
8742
8764
|
const targetMonth = focusableDate;
|
|
8743
8765
|
const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);
|
|
@@ -8788,7 +8810,7 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
8788
8810
|
setFocused,
|
|
8789
8811
|
focused: focusedDay,
|
|
8790
8812
|
blur,
|
|
8791
|
-
moveFocus
|
|
8813
|
+
moveFocus,
|
|
8792
8814
|
};
|
|
8793
8815
|
return useFocus;
|
|
8794
8816
|
}
|
|
@@ -8803,7 +8825,7 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
8803
8825
|
* and a function to check if a date is selected.
|
|
8804
8826
|
*/
|
|
8805
8827
|
function useMulti(props, dateLib) {
|
|
8806
|
-
const { selected: initiallySelected, required, onSelect } = props;
|
|
8828
|
+
const { selected: initiallySelected, required, onSelect, } = props;
|
|
8807
8829
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
8808
8830
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
8809
8831
|
const { isSameDay } = dateLib;
|
|
@@ -8843,7 +8865,7 @@ function useMulti(props, dateLib) {
|
|
|
8843
8865
|
return {
|
|
8844
8866
|
selected,
|
|
8845
8867
|
select,
|
|
8846
|
-
isSelected
|
|
8868
|
+
isSelected,
|
|
8847
8869
|
};
|
|
8848
8870
|
}
|
|
8849
8871
|
|
|
@@ -8872,7 +8894,10 @@ function addToRange(date, initialRange, min = 0, max = 0, required = false, date
|
|
|
8872
8894
|
// adding date to an incomplete range
|
|
8873
8895
|
if (isSameDay(from, date)) {
|
|
8874
8896
|
// adding a date equal to the start of the range
|
|
8875
|
-
if (
|
|
8897
|
+
if (min === 0) {
|
|
8898
|
+
range = { from, to: date };
|
|
8899
|
+
}
|
|
8900
|
+
else if (required) {
|
|
8876
8901
|
range = { from, to: undefined };
|
|
8877
8902
|
}
|
|
8878
8903
|
else {
|
|
@@ -9017,7 +9042,7 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
9017
9042
|
if (isClosedInterval) {
|
|
9018
9043
|
return rangeOverlaps(range, {
|
|
9019
9044
|
from: dateLib.addDays(matcher.after, 1),
|
|
9020
|
-
to: dateLib.addDays(matcher.before, -1)
|
|
9045
|
+
to: dateLib.addDays(matcher.before, -1),
|
|
9021
9046
|
}, dateLib);
|
|
9022
9047
|
}
|
|
9023
9048
|
return (dateMatchModifiers(range.from, matcher, dateLib) ||
|
|
@@ -9056,7 +9081,7 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
9056
9081
|
* range, and a function to check if a date is within the range.
|
|
9057
9082
|
*/
|
|
9058
9083
|
function useRange(props, dateLib) {
|
|
9059
|
-
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect } = props;
|
|
9084
|
+
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
9060
9085
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
9061
9086
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
9062
9087
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
@@ -9081,7 +9106,7 @@ function useRange(props, dateLib) {
|
|
|
9081
9106
|
return {
|
|
9082
9107
|
selected,
|
|
9083
9108
|
select,
|
|
9084
|
-
isSelected
|
|
9109
|
+
isSelected,
|
|
9085
9110
|
};
|
|
9086
9111
|
}
|
|
9087
9112
|
|
|
@@ -9095,7 +9120,7 @@ function useRange(props, dateLib) {
|
|
|
9095
9120
|
* and a function to check if a date is selected.
|
|
9096
9121
|
*/
|
|
9097
9122
|
function useSingle(props, dateLib) {
|
|
9098
|
-
const { selected: initiallySelected, required, onSelect } = props;
|
|
9123
|
+
const { selected: initiallySelected, required, onSelect, } = props;
|
|
9099
9124
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
9100
9125
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
9101
9126
|
const { isSameDay } = dateLib;
|
|
@@ -9122,7 +9147,7 @@ function useSingle(props, dateLib) {
|
|
|
9122
9147
|
return {
|
|
9123
9148
|
selected,
|
|
9124
9149
|
select,
|
|
9125
|
-
isSelected
|
|
9150
|
+
isSelected,
|
|
9126
9151
|
};
|
|
9127
9152
|
}
|
|
9128
9153
|
|
|
@@ -9164,7 +9189,7 @@ function DayPicker(initialProps) {
|
|
|
9164
9189
|
let props = initialProps;
|
|
9165
9190
|
if (props.timeZone) {
|
|
9166
9191
|
props = {
|
|
9167
|
-
...initialProps
|
|
9192
|
+
...initialProps,
|
|
9168
9193
|
};
|
|
9169
9194
|
if (props.today) {
|
|
9170
9195
|
props.today = new TZDate(props.today, props.timeZone);
|
|
@@ -9194,7 +9219,7 @@ function DayPicker(initialProps) {
|
|
|
9194
9219
|
: undefined,
|
|
9195
9220
|
to: props.selected.to
|
|
9196
9221
|
? new TZDate(props.selected.to, props.timeZone)
|
|
9197
|
-
: undefined
|
|
9222
|
+
: undefined,
|
|
9198
9223
|
};
|
|
9199
9224
|
}
|
|
9200
9225
|
}
|
|
@@ -9207,7 +9232,7 @@ function DayPicker(initialProps) {
|
|
|
9207
9232
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
9208
9233
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
9209
9234
|
timeZone: props.timeZone,
|
|
9210
|
-
numerals: props.numerals
|
|
9235
|
+
numerals: props.numerals,
|
|
9211
9236
|
}, props.dateLib);
|
|
9212
9237
|
return {
|
|
9213
9238
|
dateLib,
|
|
@@ -9215,7 +9240,7 @@ function DayPicker(initialProps) {
|
|
|
9215
9240
|
formatters: getFormatters(props.formatters),
|
|
9216
9241
|
labels: { ...defaultLabels, ...props.labels },
|
|
9217
9242
|
locale,
|
|
9218
|
-
classNames: { ...getDefaultClassNames(), ...props.classNames }
|
|
9243
|
+
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
9219
9244
|
};
|
|
9220
9245
|
}, [
|
|
9221
9246
|
props.locale,
|
|
@@ -9230,16 +9255,16 @@ function DayPicker(initialProps) {
|
|
|
9230
9255
|
props.components,
|
|
9231
9256
|
props.formatters,
|
|
9232
9257
|
props.labels,
|
|
9233
|
-
props.classNames
|
|
9258
|
+
props.classNames,
|
|
9234
9259
|
]);
|
|
9235
|
-
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;
|
|
9236
|
-
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown } = formatters;
|
|
9260
|
+
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
9261
|
+
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
9237
9262
|
const calendar = useCalendar(props, dateLib);
|
|
9238
|
-
const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;
|
|
9263
|
+
const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth, } = calendar;
|
|
9239
9264
|
const getModifiers = createGetModifiers(days, props, navStart, navEnd, dateLib);
|
|
9240
|
-
const { isSelected, select, selected: selectedValue } = useSelection(props, dateLib) ?? {};
|
|
9265
|
+
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
9241
9266
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
9242
|
-
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } = labels;
|
|
9267
|
+
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
9243
9268
|
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
9244
9269
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
9245
9270
|
const handlePreviousClick = useCallback(() => {
|
|
@@ -9273,18 +9298,18 @@ function DayPicker(initialProps) {
|
|
|
9273
9298
|
const keyMap = {
|
|
9274
9299
|
ArrowLeft: [
|
|
9275
9300
|
e.shiftKey ? "month" : "day",
|
|
9276
|
-
props.dir === "rtl" ? "after" : "before"
|
|
9301
|
+
props.dir === "rtl" ? "after" : "before",
|
|
9277
9302
|
],
|
|
9278
9303
|
ArrowRight: [
|
|
9279
9304
|
e.shiftKey ? "month" : "day",
|
|
9280
|
-
props.dir === "rtl" ? "before" : "after"
|
|
9305
|
+
props.dir === "rtl" ? "before" : "after",
|
|
9281
9306
|
],
|
|
9282
9307
|
ArrowDown: [e.shiftKey ? "year" : "week", "after"],
|
|
9283
9308
|
ArrowUp: [e.shiftKey ? "year" : "week", "before"],
|
|
9284
9309
|
PageUp: [e.shiftKey ? "year" : "month", "before"],
|
|
9285
9310
|
PageDown: [e.shiftKey ? "year" : "month", "after"],
|
|
9286
9311
|
Home: ["startOfWeek", "before"],
|
|
9287
|
-
End: ["endOfWeek", "after"]
|
|
9312
|
+
End: ["endOfWeek", "after"],
|
|
9288
9313
|
};
|
|
9289
9314
|
if (keyMap[e.key]) {
|
|
9290
9315
|
e.preventDefault();
|
|
@@ -9314,7 +9339,7 @@ function DayPicker(initialProps) {
|
|
|
9314
9339
|
className: [classNames[UI.Root], props.className]
|
|
9315
9340
|
.filter(Boolean)
|
|
9316
9341
|
.join(" "),
|
|
9317
|
-
style: { ...styles?.[UI.Root], ...props.style }
|
|
9342
|
+
style: { ...styles?.[UI.Root], ...props.style },
|
|
9318
9343
|
}), [classNames, props.className, props.style, styles]);
|
|
9319
9344
|
const dataAttributes = getDataAttributes(props);
|
|
9320
9345
|
const rootElRef = useRef(null);
|
|
@@ -9322,7 +9347,7 @@ function DayPicker(initialProps) {
|
|
|
9322
9347
|
classNames,
|
|
9323
9348
|
months,
|
|
9324
9349
|
focused,
|
|
9325
|
-
dateLib
|
|
9350
|
+
dateLib,
|
|
9326
9351
|
});
|
|
9327
9352
|
const contextValue = {
|
|
9328
9353
|
dayPickerProps: props,
|
|
@@ -9338,25 +9363,25 @@ function DayPicker(initialProps) {
|
|
|
9338
9363
|
classNames,
|
|
9339
9364
|
styles,
|
|
9340
9365
|
labels,
|
|
9341
|
-
formatters
|
|
9366
|
+
formatters,
|
|
9342
9367
|
};
|
|
9343
9368
|
return (React__default.createElement(dayPickerContext.Provider, { value: contextValue },
|
|
9344
9369
|
React__default.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], ...dataAttributes },
|
|
9345
9370
|
React__default.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
9346
9371
|
!props.hideNavigation && !navLayout && (React__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
|
|
9347
9372
|
months.map((calendarMonth, displayIndex) => {
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9373
|
+
return (React__default.createElement(components.Month, { "data-animated-month": props.animate ? "true" : undefined, className: classNames[UI.Month], style: styles?.[UI.Month],
|
|
9374
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
9375
|
+
key: displayIndex, displayIndex: displayIndex, calendarMonth: calendarMonth },
|
|
9351
9376
|
navLayout === "around" &&
|
|
9352
9377
|
!props.hideNavigation &&
|
|
9353
9378
|
displayIndex === 0 && (React__default.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
9354
9379
|
React__default.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
9355
9380
|
React__default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (React__default.createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
|
|
9356
9381
|
captionLayout === "dropdown" ||
|
|
9357
|
-
captionLayout === "dropdown-months" ? (React__default.createElement(components.MonthsDropdown, { className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options:
|
|
9382
|
+
captionLayout === "dropdown-months" ? (React__default.createElement(components.MonthsDropdown, { className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: styles?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (React__default.createElement("span", null, formatMonthDropdown(calendarMonth.date, dateLib))),
|
|
9358
9383
|
captionLayout === "dropdown" ||
|
|
9359
|
-
captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options:
|
|
9384
|
+
captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default.createElement("span", null, formatYearDropdown(calendarMonth.date, dateLib))),
|
|
9360
9385
|
React__default.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
9361
9386
|
border: 0,
|
|
9362
9387
|
clip: "rect(0 0 0 0)",
|
|
@@ -9367,8 +9392,10 @@ function DayPicker(initialProps) {
|
|
|
9367
9392
|
position: "absolute",
|
|
9368
9393
|
width: "1px",
|
|
9369
9394
|
whiteSpace: "nowrap",
|
|
9370
|
-
wordWrap: "normal"
|
|
9371
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
9395
|
+
wordWrap: "normal",
|
|
9396
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
9397
|
+
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
9398
|
+
React__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
9372
9399
|
navLayout === "around" &&
|
|
9373
9400
|
!props.hideNavigation &&
|
|
9374
9401
|
displayIndex === numberOfMonths - 1 && (React__default.createElement(components.NextMonthButton, { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
@@ -9380,11 +9407,13 @@ function DayPicker(initialProps) {
|
|
|
9380
9407
|
undefined, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },
|
|
9381
9408
|
!props.hideWeekdays && (React__default.createElement(components.Weekdays, { "data-animated-weekdays": props.animate ? "true" : undefined, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },
|
|
9382
9409
|
showWeekNumber && (React__default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader())),
|
|
9383
|
-
weekdays.map((weekday
|
|
9384
|
-
React__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week
|
|
9410
|
+
weekdays.map((weekday) => (React__default.createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
|
|
9411
|
+
React__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
9385
9412
|
return (React__default.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
9386
|
-
showWeekNumber && (
|
|
9387
|
-
|
|
9413
|
+
showWeekNumber && (
|
|
9414
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
9415
|
+
React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
9416
|
+
locale,
|
|
9388
9417
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
9389
9418
|
week.days.map((day) => {
|
|
9390
9419
|
const { date } = day;
|
|
@@ -9407,14 +9436,18 @@ function DayPicker(initialProps) {
|
|
|
9407
9436
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
9408
9437
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
9409
9438
|
: undefined;
|
|
9410
|
-
return (
|
|
9439
|
+
return (
|
|
9440
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
9441
|
+
React__default.createElement(components.Day, { key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": dateLib.format(date, "yyyy-MM-dd"), "data-month": day.outside
|
|
9411
9442
|
? dateLib.format(date, "yyyy-MM")
|
|
9412
9443
|
: undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React__default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: modifiers.disabled || undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
|
|
9413
9444
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
9414
9445
|
})));
|
|
9415
9446
|
})))));
|
|
9416
9447
|
})),
|
|
9417
|
-
props.footer && (
|
|
9448
|
+
props.footer && (
|
|
9449
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
9450
|
+
React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
9418
9451
|
}
|
|
9419
9452
|
|
|
9420
9453
|
const Popover = ({ children }) => {
|
|
@@ -9471,7 +9504,7 @@ const DatePicker = ({
|
|
|
9471
9504
|
onClick: handleClear,
|
|
9472
9505
|
className: "datepicker-clear-button",
|
|
9473
9506
|
"aria-label": "Clear selected date",
|
|
9474
|
-
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
9507
|
+
children: /* @__PURE__ */ jsx(X$1, { size: 16 })
|
|
9475
9508
|
}
|
|
9476
9509
|
)
|
|
9477
9510
|
] }) }),
|
|
@@ -9541,7 +9574,7 @@ const DateRangePicker$1 = ({
|
|
|
9541
9574
|
onClick: handleClear,
|
|
9542
9575
|
className: "datepicker-clear-button",
|
|
9543
9576
|
"aria-label": "Clear selected date range",
|
|
9544
|
-
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
9577
|
+
children: /* @__PURE__ */ jsx(X$1, { size: 16 })
|
|
9545
9578
|
}
|
|
9546
9579
|
)
|
|
9547
9580
|
] }) }),
|
|
@@ -9562,7 +9595,7 @@ const DateRangePicker$1 = ({
|
|
|
9562
9595
|
] });
|
|
9563
9596
|
};
|
|
9564
9597
|
|
|
9565
|
-
var r$
|
|
9598
|
+
var r$2={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return "string"==typeof r?r.length>0:"number"==typeof r},n$1=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return {r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o$2=function(r){return {r:n$1(r.r),g:n$1(r.g),b:n$1(r.b),a:n$1(r.a,3)}},i$1=/^#([0-9a-f]{3,8})$/i,s$1=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h$1=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return {h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b$1=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return {r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return {h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return {h:n$1(r.h),s:n$1(r.s),l:n$1(r.l),a:n$1(r.a,3)}},f=function(r){return b$1((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e;},c=function(r){return {h:(t=h$1(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u;},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y$1={string:[[function(r){var t=i$1.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n$1(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n$1(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r$2[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return {h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b$1(h)},"hsv"]]},N$2=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return [e,t[n][1]]}return [null,void 0]},x$1=function(r){return "string"==typeof r?N$2(r.trim(),y$1.string):"object"==typeof r&&null!==r?N$2(r,y$1.object):[null,void 0]},M$1=function(r,t){var n=c(r);return {h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H$1=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},$$2=function(r,t){var n=c(r);return {h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x$1(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1};}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n$1(H$1(this.rgba),2)},r.prototype.isDark=function(){return H$1(this.rgba)<.5},r.prototype.isLight=function(){return H$1(this.rgba)>=.5},r.prototype.toHex=function(){return r=o$2(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s$1(n$1(255*a)):"","#"+s$1(t)+s$1(e)+s$1(u)+i;var r,t,e,u,a,i;},r.prototype.toRgb=function(){return o$2(this.rgba)},r.prototype.toRgbString=function(){return r=o$2(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u;},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u;},r.prototype.toHsv=function(){return r=h$1(this.rgba),{h:n$1(r.h),s:n$1(r.s),v:n$1(r.v),a:n$1(r.a,3)};var r;},r.prototype.invert=function(){return w$1({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r;},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w$1(M$1(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w$1(M$1(this.rgba,-r))},r.prototype.grayscale=function(){return w$1(M$1(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w$1($$2(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w$1($$2(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return "number"==typeof r?w$1({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n$1(this.rgba.a,3);var t;},r.prototype.hue=function(r){var t=c(this.rgba);return "number"==typeof r?w$1({h:r,s:t.s,l:t.l,a:t.a}):n$1(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w$1(r).toHex()},r}(),w$1=function(r){return r instanceof j?r:new j(r)},S$1=[],k$1=function(r){r.forEach(function(r){S$1.indexOf(r)<0&&(r(j,y$1),S$1.push(r));});};
|
|
9566
9599
|
|
|
9567
9600
|
function namesPlugin(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return "transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g);}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"]);}
|
|
9568
9601
|
|
|
@@ -10165,7 +10198,7 @@ const FileUploadModal = ({
|
|
|
10165
10198
|
type: "button",
|
|
10166
10199
|
onClick: onClose,
|
|
10167
10200
|
className: "close-button",
|
|
10168
|
-
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
10201
|
+
children: /* @__PURE__ */ jsx(X$1, { size: 20 })
|
|
10169
10202
|
}
|
|
10170
10203
|
)
|
|
10171
10204
|
] }),
|
|
@@ -10863,7 +10896,7 @@ var asyncTag = '[object AsyncFunction]',
|
|
|
10863
10896
|
* _.isFunction(/abc/);
|
|
10864
10897
|
* // => false
|
|
10865
10898
|
*/
|
|
10866
|
-
function isFunction$
|
|
10899
|
+
function isFunction$4(value) {
|
|
10867
10900
|
if (!isObject$4(value)) {
|
|
10868
10901
|
return false;
|
|
10869
10902
|
}
|
|
@@ -10955,7 +10988,7 @@ function baseIsNative(value) {
|
|
|
10955
10988
|
if (!isObject$4(value) || isMasked(value)) {
|
|
10956
10989
|
return false;
|
|
10957
10990
|
}
|
|
10958
|
-
var pattern = isFunction$
|
|
10991
|
+
var pattern = isFunction$4(value) ? reIsNative : reIsHostCtor;
|
|
10959
10992
|
return pattern.test(toSource(value));
|
|
10960
10993
|
}
|
|
10961
10994
|
|
|
@@ -11826,7 +11859,7 @@ function baseKeys(object) {
|
|
|
11826
11859
|
* // => false
|
|
11827
11860
|
*/
|
|
11828
11861
|
function isArrayLike(value) {
|
|
11829
|
-
return value != null && isLength(value.length) && !isFunction$
|
|
11862
|
+
return value != null && isLength(value.length) && !isFunction$4(value);
|
|
11830
11863
|
}
|
|
11831
11864
|
|
|
11832
11865
|
/**
|
|
@@ -13255,7 +13288,7 @@ function useFormikContext() {
|
|
|
13255
13288
|
}
|
|
13256
13289
|
/** @private is the given object a Function? */
|
|
13257
13290
|
|
|
13258
|
-
var isFunction$
|
|
13291
|
+
var isFunction$3 = function isFunction(obj) {
|
|
13259
13292
|
return typeof obj === 'function';
|
|
13260
13293
|
};
|
|
13261
13294
|
/** @private is the given object an Object? */
|
|
@@ -13276,7 +13309,7 @@ var isString$2 = function isString(obj) {
|
|
|
13276
13309
|
/** @private is the given object/value a promise? */
|
|
13277
13310
|
|
|
13278
13311
|
var isPromise = function isPromise(value) {
|
|
13279
|
-
return isObject$3(value) && isFunction$
|
|
13312
|
+
return isObject$3(value) && isFunction$3(value.then);
|
|
13280
13313
|
};
|
|
13281
13314
|
/**
|
|
13282
13315
|
* Same as document.activeElement but wraps in a try-catch block. In IE it is
|
|
@@ -13598,7 +13631,7 @@ function useFormik(_ref) {
|
|
|
13598
13631
|
|
|
13599
13632
|
var runValidationSchema = useCallback(function (values, field) {
|
|
13600
13633
|
var validationSchema = props.validationSchema;
|
|
13601
|
-
var schema = isFunction$
|
|
13634
|
+
var schema = isFunction$3(validationSchema) ? validationSchema(field) : validationSchema;
|
|
13602
13635
|
var promise = field && schema.validateAt ? schema.validateAt(field, values) : validateYupSchema(values, schema);
|
|
13603
13636
|
return new Promise(function (resolve, reject) {
|
|
13604
13637
|
promise.then(function () {
|
|
@@ -13628,7 +13661,7 @@ function useFormik(_ref) {
|
|
|
13628
13661
|
}, []);
|
|
13629
13662
|
var runFieldLevelValidations = useCallback(function (values) {
|
|
13630
13663
|
var fieldKeysWithValidation = Object.keys(fieldRegistry.current).filter(function (f) {
|
|
13631
|
-
return isFunction$
|
|
13664
|
+
return isFunction$3(fieldRegistry.current[f].validate);
|
|
13632
13665
|
}); // Construct an array with all of the field validation functions
|
|
13633
13666
|
|
|
13634
13667
|
var fieldValidations = fieldKeysWithValidation.length > 0 ? fieldKeysWithValidation.map(function (f) {
|
|
@@ -13771,7 +13804,7 @@ function useFormik(_ref) {
|
|
|
13771
13804
|
// This will efficiently validate a single field by avoiding state
|
|
13772
13805
|
// changes if the validation function is synchronous. It's different from
|
|
13773
13806
|
// what is called when using validateForm.
|
|
13774
|
-
if (fieldRegistry.current[name] && isFunction$
|
|
13807
|
+
if (fieldRegistry.current[name] && isFunction$3(fieldRegistry.current[name].validate)) {
|
|
13775
13808
|
var value = getIn$1(state.values, name);
|
|
13776
13809
|
var maybePromise = fieldRegistry.current[name].validate(value);
|
|
13777
13810
|
|
|
@@ -13854,7 +13887,7 @@ function useFormik(_ref) {
|
|
|
13854
13887
|
});
|
|
13855
13888
|
}, []);
|
|
13856
13889
|
var setValues = useEventCallback(function (values, shouldValidate) {
|
|
13857
|
-
var resolvedValues = isFunction$
|
|
13890
|
+
var resolvedValues = isFunction$3(values) ? values(state.values) : values;
|
|
13858
13891
|
dispatch({
|
|
13859
13892
|
type: 'SET_VALUES',
|
|
13860
13893
|
payload: resolvedValues
|
|
@@ -13982,7 +14015,7 @@ function useFormik(_ref) {
|
|
|
13982
14015
|
}
|
|
13983
14016
|
});
|
|
13984
14017
|
var setFormikState = useCallback(function (stateOrCb) {
|
|
13985
|
-
if (isFunction$
|
|
14018
|
+
if (isFunction$3(stateOrCb)) {
|
|
13986
14019
|
dispatch({
|
|
13987
14020
|
type: 'SET_FORMIK_STATE',
|
|
13988
14021
|
payload: stateOrCb
|
|
@@ -14079,11 +14112,11 @@ function useFormik(_ref) {
|
|
|
14079
14112
|
});
|
|
14080
14113
|
});
|
|
14081
14114
|
var handleSubmit = useEventCallback(function (e) {
|
|
14082
|
-
if (e && e.preventDefault && isFunction$
|
|
14115
|
+
if (e && e.preventDefault && isFunction$3(e.preventDefault)) {
|
|
14083
14116
|
e.preventDefault();
|
|
14084
14117
|
}
|
|
14085
14118
|
|
|
14086
|
-
if (e && e.stopPropagation && isFunction$
|
|
14119
|
+
if (e && e.stopPropagation && isFunction$3(e.stopPropagation)) {
|
|
14087
14120
|
e.stopPropagation();
|
|
14088
14121
|
} // Warn if form submission is triggered by a <button> without a
|
|
14089
14122
|
// specified `type` attribute during development. This mitigates
|
|
@@ -14123,11 +14156,11 @@ function useFormik(_ref) {
|
|
|
14123
14156
|
return onSubmit(state.values, imperativeMethods);
|
|
14124
14157
|
});
|
|
14125
14158
|
var handleReset = useEventCallback(function (e) {
|
|
14126
|
-
if (e && e.preventDefault && isFunction$
|
|
14159
|
+
if (e && e.preventDefault && isFunction$3(e.preventDefault)) {
|
|
14127
14160
|
e.preventDefault();
|
|
14128
14161
|
}
|
|
14129
14162
|
|
|
14130
|
-
if (e && e.stopPropagation && isFunction$
|
|
14163
|
+
if (e && e.stopPropagation && isFunction$3(e.stopPropagation)) {
|
|
14131
14164
|
e.stopPropagation();
|
|
14132
14165
|
}
|
|
14133
14166
|
|
|
@@ -14195,7 +14228,7 @@ function useFormik(_ref) {
|
|
|
14195
14228
|
return !isEqual$1(initialValues.current, state.values);
|
|
14196
14229
|
}, [initialValues.current, state.values]);
|
|
14197
14230
|
var isValid = useMemo(function () {
|
|
14198
|
-
return typeof isInitialValid !== 'undefined' ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction$
|
|
14231
|
+
return typeof isInitialValid !== 'undefined' ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction$3(isInitialValid) ? isInitialValid(props) : isInitialValid : state.errors && Object.keys(state.errors).length === 0;
|
|
14199
14232
|
}, [isInitialValid, dirty, state.errors, props]);
|
|
14200
14233
|
|
|
14201
14234
|
var ctx = _extends({}, state, {
|
|
@@ -40959,7 +40992,7 @@ const Sidebar = ({
|
|
|
40959
40992
|
onClick: onToggleCollapse,
|
|
40960
40993
|
className: "collapse-button desktop-only",
|
|
40961
40994
|
"aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
40962
|
-
children: isCollapsed ? /* @__PURE__ */ jsx(Menu, {}) : /* @__PURE__ */ jsx(X, {})
|
|
40995
|
+
children: isCollapsed ? /* @__PURE__ */ jsx(Menu, {}) : /* @__PURE__ */ jsx(X$1, {})
|
|
40963
40996
|
}
|
|
40964
40997
|
)
|
|
40965
40998
|
] }),
|
|
@@ -42127,14 +42160,9 @@ function getWindowScrollBarX(element, rect) {
|
|
|
42127
42160
|
return rect.left + leftScroll;
|
|
42128
42161
|
}
|
|
42129
42162
|
|
|
42130
|
-
function getHTMLOffset(documentElement, scroll
|
|
42131
|
-
if (ignoreScrollbarX === void 0) {
|
|
42132
|
-
ignoreScrollbarX = false;
|
|
42133
|
-
}
|
|
42163
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
42134
42164
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
42135
|
-
const x = htmlRect.left + scroll.scrollLeft - (
|
|
42136
|
-
// RTL <body> scrollbar.
|
|
42137
|
-
getWindowScrollBarX(documentElement, htmlRect));
|
|
42165
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
42138
42166
|
const y = htmlRect.top + scroll.scrollTop;
|
|
42139
42167
|
return {
|
|
42140
42168
|
x,
|
|
@@ -42173,7 +42201,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
42173
42201
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
42174
42202
|
}
|
|
42175
42203
|
}
|
|
42176
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll
|
|
42204
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
42177
42205
|
return {
|
|
42178
42206
|
width: rect.width * scale.x,
|
|
42179
42207
|
height: rect.height * scale.y,
|
|
@@ -42207,6 +42235,10 @@ function getDocumentRect(element) {
|
|
|
42207
42235
|
};
|
|
42208
42236
|
}
|
|
42209
42237
|
|
|
42238
|
+
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
42239
|
+
// calculation is affected by unusual styles.
|
|
42240
|
+
// Most scrollbars leave 15-18px of space.
|
|
42241
|
+
const SCROLLBAR_MAX = 25;
|
|
42210
42242
|
function getViewportRect(element, strategy) {
|
|
42211
42243
|
const win = getWindow$1(element);
|
|
42212
42244
|
const html = getDocumentElement(element);
|
|
@@ -42224,6 +42256,24 @@ function getViewportRect(element, strategy) {
|
|
|
42224
42256
|
y = visualViewport.offsetTop;
|
|
42225
42257
|
}
|
|
42226
42258
|
}
|
|
42259
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
42260
|
+
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
42261
|
+
// visual width of the <html> but this is not considered in the size
|
|
42262
|
+
// of `html.clientWidth`.
|
|
42263
|
+
if (windowScrollbarX <= 0) {
|
|
42264
|
+
const doc = html.ownerDocument;
|
|
42265
|
+
const body = doc.body;
|
|
42266
|
+
const bodyStyles = getComputedStyle(body);
|
|
42267
|
+
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
42268
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
42269
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
42270
|
+
width -= clippingStableScrollbarWidth;
|
|
42271
|
+
}
|
|
42272
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
42273
|
+
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
42274
|
+
// by the scrollbar amount so there isn't extra space on the right.
|
|
42275
|
+
width += windowScrollbarX;
|
|
42276
|
+
}
|
|
42227
42277
|
return {
|
|
42228
42278
|
width,
|
|
42229
42279
|
height,
|
|
@@ -42705,7 +42755,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
42705
42755
|
* @copyright ReactTooltip Team
|
|
42706
42756
|
* @license MIT
|
|
42707
42757
|
*/
|
|
42708
|
-
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:false,base:false};function S({css:e,id:t=w,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),l||(l={});const{insertAt:i}=l;if(document.getElementById(t))return;const c=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&c.firstChild?c.insertBefore(s,c.firstChild):c.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=true;}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:l="top",offset:r=10,strategy:n="absolute",middlewares:i=[offset(Number(r)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:c,arrowSize:s=8})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};const a=i;return o?(a.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:l,strategy:n,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const i={left:`${e}px`,top:`${t}px`,border:c},{x:a,y:u}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},d=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",p=c&&{borderBottom:c,borderRight:c};let v=0;if(c){const e=`${c}`.match(/(\d+)px/);v=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:i,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=u?`${u}px`:"",right:"",bottom:"",...p,[d]:`-${s/2+v}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_$1=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null;};!l&&(e.apply(this,r),l=setTimeout(n,t));};return r.cancel=()=>{l&&(clearTimeout(l),l=null);},r},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,k=(e,t)=>{if(e===t)return true;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>k(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return false;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>k(e[o],t[o])))},T=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return false;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},L=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(T(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},C="undefined"!=typeof window?useLayoutEffect:useEffect,R=e=>{e.current&&(clearTimeout(e.current),e.current=null);},x="DEFAULT_TOOLTIP_ID",N={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},$=createContext({getTooltipData:()=>N});function z(e=x){return useContext($).getTooltipData(e)}var B={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},D={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const q=({forwardRef:t,id:l,className:i,classNameArrow:c,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=false,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:T=false,hidden:x=false,noArrow:N=false,clickable:$=false,closeOnEsc:I=false,closeOnScroll:j=false,closeOnResize:q=false,openEvents:H,closeEvents:M,globalCloseEvents:W,imperativeModeOnly:P,style:V,position:F,afterShow:K,afterHide:U,disableTooltip:X,content:Y,contentWrapperRef:G,isOpen:Z,defaultIsOpen:J=false,setIsOpen:Q,activeAnchor:ee,setActiveAnchor:te,border:oe,opacity:le,arrowColor:re,arrowSize:ne=8,role:ie="tooltip"})=>{var ce;const se=useRef(null),ae=useRef(null),ue=useRef(null),de=useRef(null),pe=useRef(null),[ve,me]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[fe,ye]=useState(false),[he,we]=useState(false),[be,Se]=useState(null),ge=useRef(false),Ee=useRef(null),{anchorRefs:Ae,setActiveAnchor:_e}=z(l),Oe=useRef(false),[ke,Te]=useState([]),Le=useRef(false),Ce=w||h.includes("click"),Re=Ce||(null==H?void 0:H.click)||(null==H?void 0:H.dblclick)||(null==H?void 0:H.mousedown),xe=H?{...H}:{mouseover:true,focus:true,mouseenter:false,click:false,dblclick:false,mousedown:false};!H&&Ce&&Object.assign(xe,{mouseenter:false,focus:false,mouseover:false,click:true});const Ne=M?{...M}:{mouseout:true,blur:true,mouseleave:false,click:false,dblclick:false,mouseup:false};!M&&Ce&&Object.assign(Ne,{mouseleave:false,blur:false,mouseout:false});const $e=W?{...W}:{escape:I||false,scroll:j||false,resize:q||false,clickOutsideAnchor:Re||false};P&&(Object.assign(xe,{mouseover:false,focus:false,mouseenter:false,click:false,dblclick:false,mousedown:false}),Object.assign(Ne,{mouseout:false,blur:false,mouseleave:false,click:false,dblclick:false,mouseup:false}),Object.assign($e,{escape:false,scroll:false,resize:false,clickOutsideAnchor:false})),C((()=>(Le.current=true,()=>{Le.current=false;})),[]);const Ie=e=>{Le.current&&(e&&we(true),setTimeout((()=>{Le.current&&(null==Q||Q(e),void 0===Z&&ye(e));}),10));};useEffect((()=>{if(void 0===Z)return ()=>null;Z&&we(true);const e=setTimeout((()=>{ye(Z);}),10);return ()=>{clearTimeout(e);}}),[Z]),useEffect((()=>{if(fe!==ge.current)if(R(pe),ge.current=fe,fe)null==K||K();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));pe.current=setTimeout((()=>{we(false),Se(null),null==U||U();}),e+25);}}),[fe]);const ze=e=>{me((t=>k(t,e)?t:e));},je=(e=A)=>{R(ue),he?Ie(true):ue.current=setTimeout((()=>{Ie(true);}),e);},Be=(e=O)=>{R(de),de.current=setTimeout((()=>{Oe.current||Ie(false);}),e);},De=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return te(null),void _e({current:null});A?je():Ie(true),te(o),_e({current:o}),R(de);},qe=()=>{$?Be(O||100):O?Be():Ie(false),R(ue);},He=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==be?void 0:be.place)&&void 0!==o?o:v,offset:m,elementReference:l,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{ze(e);}));},Me=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};He(o),Ee.current=o;},We=e=>{var t;if(!fe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=se.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...ke].some((e=>null==e?void 0:e.contains(o)))||(Ie(false),R(ue));},Pe=_$1(De,50),Ve=_$1(qe,50),Fe=e=>{Ve.cancel(),Pe(e);},Ke=()=>{Pe.cancel(),Ve();},Ue=useCallback((()=>{var e,t;const o=null!==(e=null==be?void 0:be.position)&&void 0!==e?e:F;o?He(o):T?Ee.current&&He(Ee.current):(null==ee?void 0:ee.isConnected)&&E({place:null!==(t=null==be?void 0:be.place)&&void 0!==t?t:v,offset:m,elementReference:ee,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{Le.current&&ze(e);}));}),[fe,ee,Y,V,v,null==be?void 0:be.place,m,b,F,null==be?void 0:be.position,T,ne]);useEffect((()=>{var e,t;const o=new Set(Ae);ke.forEach((e=>{(null==X?void 0:X(e))||o.add({current:e});}));const l=document.querySelector(`[id='${d}']`);l&&!(null==X?void 0:X(l))&&o.add({current:l});const r=()=>{Ie(false);},n=L(ee),i=L(se.current);$e.scroll&&(window.addEventListener("scroll",r),null==n||n.addEventListener("scroll",r),null==i||i.addEventListener("scroll",r));let c=null;$e.resize?window.addEventListener("resize",r):ee&&se.current&&(c=autoUpdate(ee,se.current,Ue,{ancestorResize:true,elementResize:true,layoutShift:true}));const s=e=>{"Escape"===e.key&&Ie(false);};$e.escape&&window.addEventListener("keydown",s),$e.clickOutsideAnchor&&window.addEventListener("click",We);const a=[],u=e=>Boolean((null==e?void 0:e.target)&&(null==ee?void 0:ee.contains(e.target))),p=e=>{fe&&u(e)||De(e);},v=e=>{fe&&u(e)&&qe();},m=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(xe).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Fe}):y.includes(e)&&a.push({event:e,listener:p}));})),Object.entries(Ne).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Ke}):y.includes(e)&&a.push({event:e,listener:v}));})),T&&a.push({event:"pointermove",listener:Me});const h=()=>{Oe.current=true;},w=()=>{Oe.current=false,qe();},b=$&&(Ne.mouseout||Ne.mouseleave);return b&&(null===(e=se.current)||void 0===e||e.addEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.addEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t);}));})),()=>{var e,t;$e.scroll&&(window.removeEventListener("scroll",r),null==n||n.removeEventListener("scroll",r),null==i||i.removeEventListener("scroll",r)),$e.resize?window.removeEventListener("resize",r):null==c||c(),$e.clickOutsideAnchor&&window.removeEventListener("click",We),$e.escape&&window.removeEventListener("keydown",s),b&&(null===(e=se.current)||void 0===e||e.removeEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.removeEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t);}));}));}}),[ee,Ue,he,Ae,ke,H,M,W,Ce,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.push(e.target):e.oldValue===l&&r.push(e.target);}if("childList"===e.type){if(ee){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,ee))&&(we(false),Ie(false),te(null),R(ue),R(de),true)}));}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||r.length)&&Te((e=>[...e.filter((e=>!r.includes(e))),...t]));}));return r.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["data-tooltip-id"],attributeOldValue:true}),()=>{r.disconnect();}}),[l,p,null==be?void 0:be.anchorSelect,ee]),useEffect((()=>{Ue();}),[Ue]),useEffect((()=>{if(!(null==G?void 0:G.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ue()));}));return e.observe(G.current),()=>{e.disconnect();}}),[Y,null==G?void 0:G.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...ke,t];ee&&o.includes(ee)||te(null!==(e=ke[0])&&void 0!==e?e:t);}),[d,ke,ee]),useEffect((()=>(J&&Ie(true),()=>{R(ue),R(de);})),[]),useEffect((()=>{var e;let t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p;if(!t&&l&&(t=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));Te(e);}catch(e){Te([]);}}),[l,p,null==be?void 0:be.anchorSelect]),useEffect((()=>{ue.current&&(R(ue),je(A));}),[A]);const Xe=null!==(ce=null==be?void 0:be.content)&&void 0!==ce?ce:Y,Ye=fe&&Object.keys(ve.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}Se(null!=e?e:null),(null==e?void 0:e.delay)?je(e.delay):Ie(true);},close:e=>{(null==e?void 0:e.delay)?Be(e.delay):Ie(false);},activeAnchor:ee,place:ve.place,isOpen:Boolean(he&&!x&&Xe&&Ye)}))),he&&!x&&Xe?React__default.createElement(g,{id:l,role:ie,className:classNames$1("react-tooltip",B.tooltip,D.tooltip,D[u],i,`react-tooltip__place-${ve.place}`,B[Ye?"show":"closing"],Ye?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B.fixed,$&&B.clickable),onTransitionEnd:e=>{R(pe),fe||"opacity"!==e.propertyName||(we(false),Se(null),null==U||U());},style:{...V,...ve.tooltipStyles,opacity:void 0!==le&&Ye?le:void 0},ref:se},Xe,React__default.createElement(g,{className:classNames$1("react-tooltip-arrow",B.arrow,D.arrow,c,N&&B.noArrow),style:{...ve.tooltipArrowStyles,background:re?`linear-gradient(to right bottom, transparent 50%, ${re} 50%)`:void 0,"--rt-arrow-size":`${ne}px`},ref:ae})):null},H=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),M=React__default.forwardRef((({id:t,anchorId:l,anchorSelect:n,content:i,html:c,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=false,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=false,hidden:k=false,noArrow:T=false,clickable:L=false,closeOnEsc:C=false,closeOnScroll:R=false,closeOnResize:x=false,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j=false,style:B,position:D,isOpen:M,defaultIsOpen:W=false,disableStyleInjection:P=false,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,role:J="tooltip"},Q)=>{const[ee,te]=useState(i),[oe,le]=useState(c),[re,ne]=useState(v),[ie,ce]=useState(p),[se,ae]=useState(m),[ue,de]=useState(E),[pe,ve]=useState(_),[me,fe]=useState(O),[ye,he]=useState(k),[we,be]=useState(f),[Se,ge]=useState(w),[Ee,Ae]=useState(S),[_e,Oe]=useState(null),[ke,Te]=useState(null),Le=useRef(P),{anchorRefs:Ce,activeAnchor:Re}=z(t),xe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null;}return t}),{}),Ne=e=>{const t={place:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:v);},content:e=>{te(null!=e?e:i);},html:e=>{le(null!=e?e:c);},variant:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ae(null===e?m:Number(e));},wrapper:e=>{var t;be(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");ge(null!=t?t:w);},"position-strategy":e=>{var t;Ae(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{de(null===e?E:Number(e));},"delay-hide":e=>{ve(null===e?_:Number(e));},float:e=>{fe(null===e?O:"true"===e);},hidden:e=>{he(null===e?k:"true"===e);},"class-name":e=>{Oe(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o);}));};useEffect((()=>{te(i);}),[i]),useEffect((()=>{le(c);}),[c]),useEffect((()=>{ne(v);}),[v]),useEffect((()=>{ce(p);}),[p]),useEffect((()=>{ae(m);}),[m]),useEffect((()=>{de(E);}),[E]),useEffect((()=>{ve(_);}),[_]),useEffect((()=>{fe(O);}),[O]),useEffect((()=>{he(k);}),[k]),useEffect((()=>{Ae(S);}),[S]),useEffect((()=>{Le.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(Ce);let r=n;if(!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),r)try{document.querySelectorAll(r).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`);}const i=document.querySelector(`[id='${l}']`);if(i&&o.add({current:i}),!o.size)return ()=>null;const c=null!==(e=null!=ke?ke:i)&&void 0!==e?e:Re.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=xe(c);Ne(o);}));})),a={attributes:true,childList:false,subtree:false};if(c){const e=xe(c);Ne(e),s.observe(c,a);}return ()=>{s.disconnect();}}),[Ce,Re,ke,l,n]),useEffect((()=>{(null==B?void 0:B.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==B?void 0:B.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let $e=h;const Ie=useRef(null);if(a){const t=a({content:(null==ke?void 0:ke.getAttribute("data-tooltip-content"))||ee||null,activeAnchor:ke});$e=t?React__default.createElement("div",{ref:Ie,className:"react-tooltip-content-wrapper"},t):null;}else ee&&($e=ee);oe&&($e=React__default.createElement(H,{content:oe}));const ze={forwardRef:Q,id:t,anchorId:l,anchorSelect:n,className:classNames$1(u,_e),classNameArrow:d,content:$e,contentWrapperRef:Ie,place:re,variant:ie,offset:se,wrapper:we,events:Se,openOnClick:b,positionStrategy:Ee,middlewares:g,delayShow:ue,delayHide:pe,float:me,hidden:ye,noArrow:T,clickable:L,closeOnEsc:C,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j,style:B,position:D,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,activeAnchor:ke,setActiveAnchor:e=>Te(e),role:J};return React__default.createElement(q,{...ze})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
42758
|
+
const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:false,base:false};function S({css:e,id:t=w,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||b[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=h),l||(l={});const{insertAt:i}=l;if(document.getElementById(t))return;const c=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&c.firstChild?c.insertBefore(s,c.firstChild):c.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),b[o]=true;}const E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:l="top",offset:r=10,strategy:n="absolute",middlewares:i=[offset(Number(r)),flip({fallbackAxisSideDirection:"start"}),shift({padding:5})],border:c,arrowSize:s=8})=>{if(!e)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return {tooltipStyles:{},tooltipArrowStyles:{},place:l};const a=i;return o?(a.push(arrow({element:o,padding:5})),computePosition(e,t,{placement:l,strategy:n,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const i={left:`${e}px`,top:`${t}px`,border:c},{x:a,y:u}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},d=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",p=c&&{borderBottom:c,borderRight:c};let v=0;if(c){const e=`${c}`.match(/(\d+)px/);v=(null==e?void 0:e[1])?Number(e[1]):1;}return {tooltipStyles:i,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=u?`${u}px`:"",right:"",bottom:"",...p,[d]:`-${s/2+v}px`},place:o}}))):computePosition(e,t,{placement:"bottom",strategy:n,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},A=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),_$1=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null;};!l&&(e.apply(this,r),l=setTimeout(n,t));};return r.cancel=()=>{l&&(clearTimeout(l),l=null);},r},O=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,k=(e,t)=>{if(e===t)return true;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>k(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return false;if(!O(e)||!O(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>k(e[o],t[o])))},T=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return false;const t=getComputedStyle(e);return ["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return "auto"===o||"scroll"===o}))},L$1=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(T(t))return t;t=t.parentElement;}return document.scrollingElement||document.documentElement},C="undefined"!=typeof window?useLayoutEffect:useEffect,R=e=>{e.current&&(clearTimeout(e.current),e.current=null);},x="DEFAULT_TOOLTIP_ID",N$1={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},$$1=createContext({getTooltipData:()=>N$1});function z$1(e=x){return useContext($$1).getTooltipData(e)}var B$1={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},D={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const q=({forwardRef:t,id:l,className:i,classNameArrow:c,variant:u="dark",anchorId:d,anchorSelect:p,place:v="top",offset:m=10,events:h=["hover"],openOnClick:w=false,positionStrategy:b="absolute",middlewares:S,wrapper:g,delayShow:A=0,delayHide:O=0,float:T=false,hidden:x=false,noArrow:N=false,clickable:$=false,closeOnEsc:I=false,closeOnScroll:j=false,closeOnResize:q=false,openEvents:H,closeEvents:M,globalCloseEvents:W,imperativeModeOnly:P,style:V,position:F,afterShow:K,afterHide:U,disableTooltip:X,content:Y,contentWrapperRef:G,isOpen:Z,defaultIsOpen:J=false,setIsOpen:Q,activeAnchor:ee,setActiveAnchor:te,border:oe,opacity:le,arrowColor:re,arrowSize:ne=8,role:ie="tooltip"})=>{var ce;const se=useRef(null),ae=useRef(null),ue=useRef(null),de=useRef(null),pe=useRef(null),[ve,me]=useState({tooltipStyles:{},tooltipArrowStyles:{},place:v}),[fe,ye]=useState(false),[he,we]=useState(false),[be,Se]=useState(null),ge=useRef(false),Ee=useRef(null),{anchorRefs:Ae,setActiveAnchor:_e}=z$1(l),Oe=useRef(false),[ke,Te]=useState([]),Le=useRef(false),Ce=w||h.includes("click"),Re=Ce||(null==H?void 0:H.click)||(null==H?void 0:H.dblclick)||(null==H?void 0:H.mousedown),xe=H?{...H}:{mouseover:true,focus:true,mouseenter:false,click:false,dblclick:false,mousedown:false};!H&&Ce&&Object.assign(xe,{mouseenter:false,focus:false,mouseover:false,click:true});const Ne=M?{...M}:{mouseout:true,blur:true,mouseleave:false,click:false,dblclick:false,mouseup:false};!M&&Ce&&Object.assign(Ne,{mouseleave:false,blur:false,mouseout:false});const $e=W?{...W}:{escape:I||false,scroll:j||false,resize:q||false,clickOutsideAnchor:Re||false};P&&(Object.assign(xe,{mouseover:false,focus:false,mouseenter:false,click:false,dblclick:false,mousedown:false}),Object.assign(Ne,{mouseout:false,blur:false,mouseleave:false,click:false,dblclick:false,mouseup:false}),Object.assign($e,{escape:false,scroll:false,resize:false,clickOutsideAnchor:false})),C((()=>(Le.current=true,()=>{Le.current=false;})),[]);const Ie=e=>{Le.current&&(e&&we(true),setTimeout((()=>{Le.current&&(null==Q||Q(e),void 0===Z&&ye(e));}),10));};useEffect((()=>{if(void 0===Z)return ()=>null;Z&&we(true);const e=setTimeout((()=>{ye(Z);}),10);return ()=>{clearTimeout(e);}}),[Z]),useEffect((()=>{if(fe!==ge.current)if(R(pe),ge.current=fe,fe)null==K||K();else {const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));pe.current=setTimeout((()=>{we(false),Se(null),null==U||U();}),e+25);}}),[fe]);const ze=e=>{me((t=>k(t,e)?t:e));},je=(e=A)=>{R(ue),he?Ie(true):ue.current=setTimeout((()=>{Ie(true);}),e);},Be=(e=O)=>{R(de),de.current=setTimeout((()=>{Oe.current||Ie(false);}),e);},De=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return te(null),void _e({current:null});A?je():Ie(true),te(o),_e({current:o}),R(de);},qe=()=>{$?Be(O||100):O?Be():Ie(false),R(ue);},He=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==be?void 0:be.place)&&void 0!==o?o:v,offset:m,elementReference:l,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{ze(e);}));},Me=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};He(o),Ee.current=o;},We=e=>{var t;if(!fe)return;const o=e.target;if(!o.isConnected)return;if(null===(t=se.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${d}']`),...ke].some((e=>null==e?void 0:e.contains(o)))||(Ie(false),R(ue));},Pe=_$1(De,50),Ve=_$1(qe,50),Fe=e=>{Ve.cancel(),Pe(e);},Ke=()=>{Pe.cancel(),Ve();},Ue=useCallback((()=>{var e,t;const o=null!==(e=null==be?void 0:be.position)&&void 0!==e?e:F;o?He(o):T?Ee.current&&He(Ee.current):(null==ee?void 0:ee.isConnected)&&E({place:null!==(t=null==be?void 0:be.place)&&void 0!==t?t:v,offset:m,elementReference:ee,tooltipReference:se.current,tooltipArrowReference:ae.current,strategy:b,middlewares:S,border:oe,arrowSize:ne}).then((e=>{Le.current&&ze(e);}));}),[fe,ee,Y,V,v,null==be?void 0:be.place,m,b,F,null==be?void 0:be.position,T,ne]);useEffect((()=>{var e,t;const o=new Set(Ae);ke.forEach((e=>{(null==X?void 0:X(e))||o.add({current:e});}));const l=document.querySelector(`[id='${d}']`);l&&!(null==X?void 0:X(l))&&o.add({current:l});const r=()=>{Ie(false);},n=L$1(ee),i=L$1(se.current);$e.scroll&&(window.addEventListener("scroll",r),null==n||n.addEventListener("scroll",r),null==i||i.addEventListener("scroll",r));let c=null;$e.resize?window.addEventListener("resize",r):ee&&se.current&&(c=autoUpdate(ee,se.current,Ue,{ancestorResize:true,elementResize:true,layoutShift:true}));const s=e=>{"Escape"===e.key&&Ie(false);};$e.escape&&window.addEventListener("keydown",s),$e.clickOutsideAnchor&&window.addEventListener("click",We);const a=[],u=e=>Boolean((null==e?void 0:e.target)&&(null==ee?void 0:ee.contains(e.target))),p=e=>{fe&&u(e)||De(e);},v=e=>{fe&&u(e)&&qe();},m=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(xe).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Fe}):y.includes(e)&&a.push({event:e,listener:p}));})),Object.entries(Ne).forEach((([e,t])=>{t&&(m.includes(e)?a.push({event:e,listener:Ke}):y.includes(e)&&a.push({event:e,listener:v}));})),T&&a.push({event:"pointermove",listener:Me});const h=()=>{Oe.current=true;},w=()=>{Oe.current=false,qe();},b=$&&(Ne.mouseout||Ne.mouseleave);return b&&(null===(e=se.current)||void 0===e||e.addEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.addEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t);}));})),()=>{var e,t;$e.scroll&&(window.removeEventListener("scroll",r),null==n||n.removeEventListener("scroll",r),null==i||i.removeEventListener("scroll",r)),$e.resize?window.removeEventListener("resize",r):null==c||c(),$e.clickOutsideAnchor&&window.removeEventListener("click",We),$e.escape&&window.removeEventListener("keydown",s),b&&(null===(e=se.current)||void 0===e||e.removeEventListener("mouseover",h),null===(t=se.current)||void 0===t||t.removeEventListener("mouseout",w)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t);}));}));}}),[ee,Ue,he,Ae,ke,H,M,W,Ce,A,O]),useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.push(e.target):e.oldValue===l&&r.push(e.target);}if("childList"===e.type){if(ee){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}t.some((e=>{var t;return !!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,ee))&&(we(false),Ie(false),te(null),R(ue),R(de),true)}));}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])));}catch(e){}}})),(t.length||r.length)&&Te((e=>[...e.filter((e=>!r.includes(e))),...t]));}));return r.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["data-tooltip-id"],attributeOldValue:true}),()=>{r.disconnect();}}),[l,p,null==be?void 0:be.anchorSelect,ee]),useEffect((()=>{Ue();}),[Ue]),useEffect((()=>{if(!(null==G?void 0:G.current))return ()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Ue()));}));return e.observe(G.current),()=>{e.disconnect();}}),[Y,null==G?void 0:G.current]),useEffect((()=>{var e;const t=document.querySelector(`[id='${d}']`),o=[...ke,t];ee&&o.includes(ee)||te(null!==(e=ke[0])&&void 0!==e?e:t);}),[d,ke,ee]),useEffect((()=>(J&&Ie(true),()=>{R(ue),R(de);})),[]),useEffect((()=>{var e;let t=null!==(e=null==be?void 0:be.anchorSelect)&&void 0!==e?e:p;if(!t&&l&&(t=`[data-tooltip-id='${l.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));Te(e);}catch(e){Te([]);}}),[l,p,null==be?void 0:be.anchorSelect]),useEffect((()=>{ue.current&&(R(ue),je(A));}),[A]);const Xe=null!==(ce=null==be?void 0:be.content)&&void 0!==ce?ce:Y,Ye=fe&&Object.keys(ve.tooltipStyles).length>0;return useImperativeHandle(t,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect);}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}Se(null!=e?e:null),(null==e?void 0:e.delay)?je(e.delay):Ie(true);},close:e=>{(null==e?void 0:e.delay)?Be(e.delay):Ie(false);},activeAnchor:ee,place:ve.place,isOpen:Boolean(he&&!x&&Xe&&Ye)}))),he&&!x&&Xe?React__default.createElement(g,{id:l,role:ie,className:classNames$1("react-tooltip",B$1.tooltip,D.tooltip,D[u],i,`react-tooltip__place-${ve.place}`,B$1[Ye?"show":"closing"],Ye?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&B$1.fixed,$&&B$1.clickable),onTransitionEnd:e=>{R(pe),fe||"opacity"!==e.propertyName||(we(false),Se(null),null==U||U());},style:{...V,...ve.tooltipStyles,opacity:void 0!==le&&Ye?le:void 0},ref:se},Xe,React__default.createElement(g,{className:classNames$1("react-tooltip-arrow",B$1.arrow,D.arrow,c,N&&B$1.noArrow),style:{...ve.tooltipArrowStyles,background:re?`linear-gradient(to right bottom, transparent 50%, ${re} 50%)`:void 0,"--rt-arrow-size":`${ne}px`},ref:ae})):null},H=({content:t})=>React__default.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),M=React__default.forwardRef((({id:t,anchorId:l,anchorSelect:n,content:i,html:c,render:a,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:w=["hover"],openOnClick:b=false,positionStrategy:S="absolute",middlewares:g,delayShow:E=0,delayHide:_=0,float:O=false,hidden:k=false,noArrow:T=false,clickable:L=false,closeOnEsc:C=false,closeOnScroll:R=false,closeOnResize:x=false,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j=false,style:B,position:D,isOpen:M,defaultIsOpen:W=false,disableStyleInjection:P=false,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,role:J="tooltip"},Q)=>{const[ee,te]=useState(i),[oe,le]=useState(c),[re,ne]=useState(v),[ie,ce]=useState(p),[se,ae]=useState(m),[ue,de]=useState(E),[pe,ve]=useState(_),[me,fe]=useState(O),[ye,he]=useState(k),[we,be]=useState(f),[Se,ge]=useState(w),[Ee,Ae]=useState(S),[_e,Oe]=useState(null),[ke,Te]=useState(null),Le=useRef(P),{anchorRefs:Ce,activeAnchor:Re}=z$1(t),xe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null;}return t}),{}),Ne=e=>{const t={place:e=>{var t;ne(null!==(t=e)&&void 0!==t?t:v);},content:e=>{te(null!=e?e:i);},html:e=>{le(null!=e?e:c);},variant:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p);},offset:e=>{ae(null===e?m:Number(e));},wrapper:e=>{var t;be(null!==(t=e)&&void 0!==t?t:f);},events:e=>{const t=null==e?void 0:e.split(" ");ge(null!=t?t:w);},"position-strategy":e=>{var t;Ae(null!==(t=e)&&void 0!==t?t:S);},"delay-show":e=>{de(null===e?E:Number(e));},"delay-hide":e=>{ve(null===e?_:Number(e));},float:e=>{fe(null===e?O:"true"===e);},hidden:e=>{he(null===e?k:"true"===e);},"class-name":e=>{Oe(e);}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o);}));};useEffect((()=>{te(i);}),[i]),useEffect((()=>{le(c);}),[c]),useEffect((()=>{ne(v);}),[v]),useEffect((()=>{ce(p);}),[p]),useEffect((()=>{ae(m);}),[m]),useEffect((()=>{de(E);}),[E]),useEffect((()=>{ve(_);}),[_]),useEffect((()=>{fe(O);}),[O]),useEffect((()=>{he(k);}),[k]),useEffect((()=>{Ae(S);}),[S]),useEffect((()=>{Le.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");}),[P]),useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}));}),[]),useEffect((()=>{var e;const o=new Set(Ce);let r=n;if(!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),r)try{document.querySelectorAll(r).forEach((e=>{o.add({current:e});}));}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`);}const i=document.querySelector(`[id='${l}']`);if(i&&o.add({current:i}),!o.size)return ()=>null;const c=null!==(e=null!=ke?ke:i)&&void 0!==e?e:Re.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=xe(c);Ne(o);}));})),a={attributes:true,childList:false,subtree:false};if(c){const e=xe(c);Ne(e),s.observe(c,a);}return ()=>{s.disconnect();}}),[Ce,Re,ke,l,n]),useEffect((()=>{(null==B?void 0:B.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),V&&!A("border",`${V}`)&&console.warn(`[react-tooltip] "${V}" is not a valid \`border\`.`),(null==B?void 0:B.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),F&&!A("opacity",`${F}`)&&console.warn(`[react-tooltip] "${F}" is not a valid \`opacity\`.`);}),[]);let $e=h;const Ie=useRef(null);if(a){const t=a({content:(null==ke?void 0:ke.getAttribute("data-tooltip-content"))||ee||null,activeAnchor:ke});$e=t?React__default.createElement("div",{ref:Ie,className:"react-tooltip-content-wrapper"},t):null;}else ee&&($e=ee);oe&&($e=React__default.createElement(H,{content:oe}));const ze={forwardRef:Q,id:t,anchorId:l,anchorSelect:n,className:classNames$1(u,_e),classNameArrow:d,content:$e,contentWrapperRef:Ie,place:re,variant:ie,offset:se,wrapper:we,events:Se,openOnClick:b,positionStrategy:Ee,middlewares:g,delayShow:ue,delayHide:pe,float:me,hidden:ye,noArrow:T,clickable:L,closeOnEsc:C,closeOnScroll:R,closeOnResize:x,openEvents:N,closeEvents:$,globalCloseEvents:I,imperativeModeOnly:j,style:B,position:D,isOpen:M,defaultIsOpen:W,border:V,opacity:F,arrowColor:K,arrowSize:U,setIsOpen:X,afterShow:Y,afterHide:G,disableTooltip:Z,activeAnchor:ke,setActiveAnchor:e=>Te(e),role:J};return React__default.createElement(q,{...ze})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||S({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||S({css:`
|
|
42709
42759
|
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"});}));
|
|
42710
42760
|
|
|
42711
42761
|
const Tooltip = ({
|
|
@@ -42823,7 +42873,7 @@ const WizardModal = ({
|
|
|
42823
42873
|
onClick: onClose,
|
|
42824
42874
|
className: "wizard-close-button",
|
|
42825
42875
|
"aria-label": "Close modal",
|
|
42826
|
-
children: /* @__PURE__ */ jsx(X, { size: 24 })
|
|
42876
|
+
children: /* @__PURE__ */ jsx(X$1, { size: 24 })
|
|
42827
42877
|
}
|
|
42828
42878
|
)
|
|
42829
42879
|
] }),
|
|
@@ -43549,7 +43599,7 @@ var isEmptyObject$1 = (value) => isObject$2(value) && !Object.keys(value).length
|
|
|
43549
43599
|
|
|
43550
43600
|
var isFileInput = (element) => element.type === 'file';
|
|
43551
43601
|
|
|
43552
|
-
var isFunction$
|
|
43602
|
+
var isFunction$2 = (value) => typeof value === 'function';
|
|
43553
43603
|
|
|
43554
43604
|
var isHTMLElement$1 = (value) => {
|
|
43555
43605
|
if (!isWeb) {
|
|
@@ -43606,7 +43656,7 @@ function unset(object, path) {
|
|
|
43606
43656
|
|
|
43607
43657
|
var objectHasFunction = (data) => {
|
|
43608
43658
|
for (const key in data) {
|
|
43609
|
-
if (isFunction$
|
|
43659
|
+
if (isFunction$2(data[key])) {
|
|
43610
43660
|
return true;
|
|
43611
43661
|
}
|
|
43612
43662
|
}
|
|
@@ -43760,7 +43810,7 @@ var getValidationModes = (mode) => ({
|
|
|
43760
43810
|
const ASYNC_FUNCTION = 'AsyncFunction';
|
|
43761
43811
|
var hasPromiseValidation = (fieldReference) => !!fieldReference &&
|
|
43762
43812
|
!!fieldReference.validate &&
|
|
43763
|
-
!!((isFunction$
|
|
43813
|
+
!!((isFunction$2(fieldReference.validate) &&
|
|
43764
43814
|
fieldReference.validate.constructor.name === ASYNC_FUNCTION) ||
|
|
43765
43815
|
(isObject$2(fieldReference.validate) &&
|
|
43766
43816
|
Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION)));
|
|
@@ -44039,7 +44089,7 @@ var validateField = async (field, disabledFieldNames, formValues, validateAllFie
|
|
|
44039
44089
|
}
|
|
44040
44090
|
}
|
|
44041
44091
|
if (validate) {
|
|
44042
|
-
if (isFunction$
|
|
44092
|
+
if (isFunction$2(validate)) {
|
|
44043
44093
|
const result = await validate(inputValue, formValues);
|
|
44044
44094
|
const validateError = getValidateError(result, inputRef);
|
|
44045
44095
|
if (validateError) {
|
|
@@ -44100,7 +44150,7 @@ function createFormControl(props = {}) {
|
|
|
44100
44150
|
submitCount: 0,
|
|
44101
44151
|
isDirty: false,
|
|
44102
44152
|
isReady: false,
|
|
44103
|
-
isLoading: isFunction$
|
|
44153
|
+
isLoading: isFunction$2(_options.defaultValues),
|
|
44104
44154
|
isValidating: false,
|
|
44105
44155
|
isSubmitted: false,
|
|
44106
44156
|
isSubmitting: false,
|
|
@@ -44678,7 +44728,7 @@ function createFormControl(props = {}) {
|
|
|
44678
44728
|
});
|
|
44679
44729
|
options && options.shouldFocus && ref && ref.focus && ref.focus();
|
|
44680
44730
|
};
|
|
44681
|
-
const watch = (name, defaultValue) => isFunction$
|
|
44731
|
+
const watch = (name, defaultValue) => isFunction$2(name)
|
|
44682
44732
|
? _subjects.state.subscribe({
|
|
44683
44733
|
next: (payload) => 'values' in payload &&
|
|
44684
44734
|
name(_getWatch(undefined, defaultValue), payload),
|
|
@@ -45032,7 +45082,7 @@ function createFormControl(props = {}) {
|
|
|
45032
45082
|
defaultValues: _defaultValues,
|
|
45033
45083
|
});
|
|
45034
45084
|
};
|
|
45035
|
-
const reset = (formValues, keepStateOptions) => _reset(isFunction$
|
|
45085
|
+
const reset = (formValues, keepStateOptions) => _reset(isFunction$2(formValues)
|
|
45036
45086
|
? formValues(_formValues)
|
|
45037
45087
|
: formValues, keepStateOptions);
|
|
45038
45088
|
const setFocus = (name, options = {}) => {
|
|
@@ -45045,7 +45095,7 @@ function createFormControl(props = {}) {
|
|
|
45045
45095
|
if (fieldRef.focus) {
|
|
45046
45096
|
fieldRef.focus();
|
|
45047
45097
|
options.shouldSelect &&
|
|
45048
|
-
isFunction$
|
|
45098
|
+
isFunction$2(fieldRef.select) &&
|
|
45049
45099
|
fieldRef.select();
|
|
45050
45100
|
}
|
|
45051
45101
|
}
|
|
@@ -45056,7 +45106,7 @@ function createFormControl(props = {}) {
|
|
|
45056
45106
|
...updatedFormState,
|
|
45057
45107
|
};
|
|
45058
45108
|
};
|
|
45059
|
-
const _resetDefaultValues = () => isFunction$
|
|
45109
|
+
const _resetDefaultValues = () => isFunction$2(_options.defaultValues) &&
|
|
45060
45110
|
_options.defaultValues().then((values) => {
|
|
45061
45111
|
reset(values, _options.resetOptions);
|
|
45062
45112
|
_subjects.state.next({
|
|
@@ -45483,7 +45533,7 @@ function useForm(props = {}) {
|
|
|
45483
45533
|
const [formState, updateFormState] = React__default.useState({
|
|
45484
45534
|
isDirty: false,
|
|
45485
45535
|
isValidating: false,
|
|
45486
|
-
isLoading: isFunction$
|
|
45536
|
+
isLoading: isFunction$2(props.defaultValues),
|
|
45487
45537
|
isSubmitted: false,
|
|
45488
45538
|
isSubmitting: false,
|
|
45489
45539
|
isSubmitSuccessful: false,
|
|
@@ -45495,7 +45545,7 @@ function useForm(props = {}) {
|
|
|
45495
45545
|
errors: props.errors || {},
|
|
45496
45546
|
disabled: props.disabled || false,
|
|
45497
45547
|
isReady: false,
|
|
45498
|
-
defaultValues: isFunction$
|
|
45548
|
+
defaultValues: isFunction$2(props.defaultValues)
|
|
45499
45549
|
? undefined
|
|
45500
45550
|
: props.defaultValues,
|
|
45501
45551
|
});
|
|
@@ -45505,7 +45555,7 @@ function useForm(props = {}) {
|
|
|
45505
45555
|
...props.formControl,
|
|
45506
45556
|
formState,
|
|
45507
45557
|
};
|
|
45508
|
-
if (props.defaultValues && !isFunction$
|
|
45558
|
+
if (props.defaultValues && !isFunction$2(props.defaultValues)) {
|
|
45509
45559
|
props.formControl.reset(props.defaultValues, props.resetOptions);
|
|
45510
45560
|
}
|
|
45511
45561
|
}
|
|
@@ -45591,7 +45641,7 @@ function useForm(props = {}) {
|
|
|
45591
45641
|
return _formControl.current;
|
|
45592
45642
|
}
|
|
45593
45643
|
|
|
45594
|
-
const r=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o$1=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o$1(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
|
|
45644
|
+
const r$1=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o$1=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r$1(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r$1(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o$1(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
|
|
45595
45645
|
|
|
45596
45646
|
function o(o,n,s$1){return void 0===s$1&&(s$1={}),function(a,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(o["sync"===s$1.mode?"validateSync":"validate"](a,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&o$1({},c),{values:s$1.raw?Object.assign({},a):t,errors:{}}}));}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return {values:{},errors:s((o=e,n=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,s=o&&o[t.type];e[t.path]=appendErrors(t.path,n,e,t.type,s?[].concat(s,t.message):t.message);}return e},{})),c)};var o,n;}))}catch(e){return Promise.reject(e)}}}
|
|
45597
45647
|
|
|
@@ -48063,7 +48113,7 @@ const isUndefined = typeOfTest('undefined');
|
|
|
48063
48113
|
*/
|
|
48064
48114
|
function isBuffer(val) {
|
|
48065
48115
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
48066
|
-
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
48116
|
+
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
48067
48117
|
}
|
|
48068
48118
|
|
|
48069
48119
|
/**
|
|
@@ -48108,7 +48158,7 @@ const isString = typeOfTest('string');
|
|
|
48108
48158
|
* @param {*} val The value to test
|
|
48109
48159
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
48110
48160
|
*/
|
|
48111
|
-
const isFunction = typeOfTest('function');
|
|
48161
|
+
const isFunction$1 = typeOfTest('function');
|
|
48112
48162
|
|
|
48113
48163
|
/**
|
|
48114
48164
|
* Determine if a value is a Number
|
|
@@ -48164,7 +48214,7 @@ const isEmptyObject = (val) => {
|
|
|
48164
48214
|
if (!isObject(val) || isBuffer(val)) {
|
|
48165
48215
|
return false;
|
|
48166
48216
|
}
|
|
48167
|
-
|
|
48217
|
+
|
|
48168
48218
|
try {
|
|
48169
48219
|
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
48170
48220
|
} catch (e) {
|
|
@@ -48216,7 +48266,7 @@ const isFileList = kindOfTest('FileList');
|
|
|
48216
48266
|
*
|
|
48217
48267
|
* @returns {boolean} True if value is a Stream, otherwise false
|
|
48218
48268
|
*/
|
|
48219
|
-
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
48269
|
+
const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
48220
48270
|
|
|
48221
48271
|
/**
|
|
48222
48272
|
* Determine if a value is a FormData
|
|
@@ -48229,10 +48279,10 @@ const isFormData = (thing) => {
|
|
|
48229
48279
|
let kind;
|
|
48230
48280
|
return thing && (
|
|
48231
48281
|
(typeof FormData === 'function' && thing instanceof FormData) || (
|
|
48232
|
-
isFunction(thing.append) && (
|
|
48282
|
+
isFunction$1(thing.append) && (
|
|
48233
48283
|
(kind = kindOf(thing)) === 'formdata' ||
|
|
48234
48284
|
// detect form-data instance
|
|
48235
|
-
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
|
48285
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
48236
48286
|
)
|
|
48237
48287
|
)
|
|
48238
48288
|
)
|
|
@@ -48357,7 +48407,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
48357
48407
|
* @returns {Object} Result of all merge properties
|
|
48358
48408
|
*/
|
|
48359
48409
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
48360
|
-
const {caseless} = isContextDefined(this) && this || {};
|
|
48410
|
+
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
48361
48411
|
const result = {};
|
|
48362
48412
|
const assignValue = (val, key) => {
|
|
48363
48413
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -48367,7 +48417,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
48367
48417
|
result[targetKey] = merge({}, val);
|
|
48368
48418
|
} else if (isArray(val)) {
|
|
48369
48419
|
result[targetKey] = val.slice();
|
|
48370
|
-
} else {
|
|
48420
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
48371
48421
|
result[targetKey] = val;
|
|
48372
48422
|
}
|
|
48373
48423
|
};
|
|
@@ -48390,7 +48440,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
48390
48440
|
*/
|
|
48391
48441
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
48392
48442
|
forEach(b, (val, key) => {
|
|
48393
|
-
if (thisArg && isFunction(val)) {
|
|
48443
|
+
if (thisArg && isFunction$1(val)) {
|
|
48394
48444
|
a[key] = bind(val, thisArg);
|
|
48395
48445
|
} else {
|
|
48396
48446
|
a[key] = val;
|
|
@@ -48606,13 +48656,13 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
48606
48656
|
const freezeMethods = (obj) => {
|
|
48607
48657
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
48608
48658
|
// skip restricted props in strict mode
|
|
48609
|
-
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
48659
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
48610
48660
|
return false;
|
|
48611
48661
|
}
|
|
48612
48662
|
|
|
48613
48663
|
const value = obj[name];
|
|
48614
48664
|
|
|
48615
|
-
if (!isFunction(value)) return;
|
|
48665
|
+
if (!isFunction$1(value)) return;
|
|
48616
48666
|
|
|
48617
48667
|
descriptor.enumerable = false;
|
|
48618
48668
|
|
|
@@ -48649,6 +48699,8 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
48649
48699
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
48650
48700
|
};
|
|
48651
48701
|
|
|
48702
|
+
|
|
48703
|
+
|
|
48652
48704
|
/**
|
|
48653
48705
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
48654
48706
|
*
|
|
@@ -48657,7 +48709,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
48657
48709
|
* @returns {boolean}
|
|
48658
48710
|
*/
|
|
48659
48711
|
function isSpecCompliantForm(thing) {
|
|
48660
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
48712
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
48661
48713
|
}
|
|
48662
48714
|
|
|
48663
48715
|
const toJSONObject = (obj) => {
|
|
@@ -48699,7 +48751,7 @@ const toJSONObject = (obj) => {
|
|
|
48699
48751
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
48700
48752
|
|
|
48701
48753
|
const isThenable = (thing) =>
|
|
48702
|
-
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
48754
|
+
thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
48703
48755
|
|
|
48704
48756
|
// original code
|
|
48705
48757
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -48723,7 +48775,7 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
48723
48775
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
48724
48776
|
})(
|
|
48725
48777
|
typeof setImmediate === 'function',
|
|
48726
|
-
isFunction(_global.postMessage)
|
|
48778
|
+
isFunction$1(_global.postMessage)
|
|
48727
48779
|
);
|
|
48728
48780
|
|
|
48729
48781
|
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
@@ -48732,7 +48784,7 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
|
|
48732
48784
|
// *********************
|
|
48733
48785
|
|
|
48734
48786
|
|
|
48735
|
-
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
48787
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
48736
48788
|
|
|
48737
48789
|
|
|
48738
48790
|
const utils$1 = {
|
|
@@ -48756,7 +48808,7 @@ const utils$1 = {
|
|
|
48756
48808
|
isFile,
|
|
48757
48809
|
isBlob,
|
|
48758
48810
|
isRegExp,
|
|
48759
|
-
isFunction,
|
|
48811
|
+
isFunction: isFunction$1,
|
|
48760
48812
|
isStream,
|
|
48761
48813
|
isURLSearchParams,
|
|
48762
48814
|
isTypedArray,
|
|
@@ -48882,11 +48934,18 @@ AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
|
48882
48934
|
return prop !== 'isAxiosError';
|
|
48883
48935
|
});
|
|
48884
48936
|
|
|
48885
|
-
|
|
48937
|
+
const msg = error && error.message ? error.message : 'Error';
|
|
48886
48938
|
|
|
48887
|
-
|
|
48939
|
+
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
48940
|
+
const errCode = code == null && error ? error.code : code;
|
|
48941
|
+
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
48942
|
+
|
|
48943
|
+
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
48944
|
+
if (error && axiosError.cause == null) {
|
|
48945
|
+
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
48946
|
+
}
|
|
48888
48947
|
|
|
48889
|
-
axiosError.name = error.name;
|
|
48948
|
+
axiosError.name = (error && error.name) || 'Error';
|
|
48890
48949
|
|
|
48891
48950
|
customProps && Object.assign(axiosError, customProps);
|
|
48892
48951
|
|
|
@@ -49177,9 +49236,7 @@ function encode(val) {
|
|
|
49177
49236
|
replace(/%3A/gi, ':').
|
|
49178
49237
|
replace(/%24/g, '$').
|
|
49179
49238
|
replace(/%2C/gi, ',').
|
|
49180
|
-
replace(/%20/g, '+')
|
|
49181
|
-
replace(/%5B/gi, '[').
|
|
49182
|
-
replace(/%5D/gi, ']');
|
|
49239
|
+
replace(/%20/g, '+');
|
|
49183
49240
|
}
|
|
49184
49241
|
|
|
49185
49242
|
/**
|
|
@@ -49504,7 +49561,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
49504
49561
|
return (encoder || JSON.stringify)(rawValue);
|
|
49505
49562
|
}
|
|
49506
49563
|
|
|
49507
|
-
const defaults = {
|
|
49564
|
+
const defaults$1 = {
|
|
49508
49565
|
|
|
49509
49566
|
transitional: transitionalDefaults,
|
|
49510
49567
|
|
|
@@ -49569,7 +49626,7 @@ const defaults = {
|
|
|
49569
49626
|
}],
|
|
49570
49627
|
|
|
49571
49628
|
transformResponse: [function transformResponse(data) {
|
|
49572
|
-
const transitional = this.transitional || defaults.transitional;
|
|
49629
|
+
const transitional = this.transitional || defaults$1.transitional;
|
|
49573
49630
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
49574
49631
|
const JSONRequested = this.responseType === 'json';
|
|
49575
49632
|
|
|
@@ -49582,7 +49639,7 @@ const defaults = {
|
|
|
49582
49639
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
49583
49640
|
|
|
49584
49641
|
try {
|
|
49585
|
-
return JSON.parse(data);
|
|
49642
|
+
return JSON.parse(data, this.parseReviver);
|
|
49586
49643
|
} catch (e) {
|
|
49587
49644
|
if (strictJSONParsing) {
|
|
49588
49645
|
if (e.name === 'SyntaxError') {
|
|
@@ -49626,7 +49683,7 @@ const defaults = {
|
|
|
49626
49683
|
};
|
|
49627
49684
|
|
|
49628
49685
|
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
49629
|
-
defaults.headers[method] = {};
|
|
49686
|
+
defaults$1.headers[method] = {};
|
|
49630
49687
|
});
|
|
49631
49688
|
|
|
49632
49689
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
@@ -49998,7 +50055,7 @@ utils$1.freezeMethods(AxiosHeaders$1);
|
|
|
49998
50055
|
* @returns {*} The resulting transformed data
|
|
49999
50056
|
*/
|
|
50000
50057
|
function transformData(fns, response) {
|
|
50001
|
-
const config = this || defaults;
|
|
50058
|
+
const config = this || defaults$1;
|
|
50002
50059
|
const context = response || config;
|
|
50003
50060
|
const headers = AxiosHeaders$1.from(context.headers);
|
|
50004
50061
|
let data = context.data;
|
|
@@ -50403,7 +50460,7 @@ function mergeConfig$1(config1, config2) {
|
|
|
50403
50460
|
const resolveConfig = (config) => {
|
|
50404
50461
|
const newConfig = mergeConfig$1({}, config);
|
|
50405
50462
|
|
|
50406
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
50463
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
50407
50464
|
|
|
50408
50465
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
50409
50466
|
|
|
@@ -50416,17 +50473,21 @@ const resolveConfig = (config) => {
|
|
|
50416
50473
|
);
|
|
50417
50474
|
}
|
|
50418
50475
|
|
|
50419
|
-
let contentType;
|
|
50420
|
-
|
|
50421
50476
|
if (utils$1.isFormData(data)) {
|
|
50422
50477
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
50423
|
-
headers.setContentType(undefined); //
|
|
50424
|
-
} else if ((
|
|
50425
|
-
//
|
|
50426
|
-
const
|
|
50427
|
-
headers
|
|
50478
|
+
headers.setContentType(undefined); // browser handles it
|
|
50479
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
50480
|
+
// Node.js FormData (like form-data package)
|
|
50481
|
+
const formHeaders = data.getHeaders();
|
|
50482
|
+
// Only set safe headers to avoid overwriting security headers
|
|
50483
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
50484
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
50485
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
50486
|
+
headers.set(key, val);
|
|
50487
|
+
}
|
|
50488
|
+
});
|
|
50428
50489
|
}
|
|
50429
|
-
}
|
|
50490
|
+
}
|
|
50430
50491
|
|
|
50431
50492
|
// Add xsrf header
|
|
50432
50493
|
// This is only done if running in a standard browser environment.
|
|
@@ -50543,15 +50604,18 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
50543
50604
|
};
|
|
50544
50605
|
|
|
50545
50606
|
// Handle low level network errors
|
|
50546
|
-
|
|
50547
|
-
|
|
50548
|
-
|
|
50549
|
-
|
|
50550
|
-
|
|
50551
|
-
|
|
50552
|
-
|
|
50607
|
+
request.onerror = function handleError(event) {
|
|
50608
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
50609
|
+
// (message may be empty; when present, surface it)
|
|
50610
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
50611
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
50612
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
50613
|
+
// attach the underlying event for consumers who want details
|
|
50614
|
+
err.event = event || null;
|
|
50615
|
+
reject(err);
|
|
50616
|
+
request = null;
|
|
50553
50617
|
};
|
|
50554
|
-
|
|
50618
|
+
|
|
50555
50619
|
// Handle timeout
|
|
50556
50620
|
request.ontimeout = function handleTimeout() {
|
|
50557
50621
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
@@ -50765,14 +50829,18 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
50765
50829
|
})
|
|
50766
50830
|
};
|
|
50767
50831
|
|
|
50768
|
-
const
|
|
50769
|
-
|
|
50832
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
50833
|
+
|
|
50834
|
+
const {isFunction} = utils$1;
|
|
50835
|
+
|
|
50836
|
+
const globalFetchAPI = (({Request, Response}) => ({
|
|
50837
|
+
Request, Response
|
|
50838
|
+
}))(utils$1.global);
|
|
50839
|
+
|
|
50840
|
+
const {
|
|
50841
|
+
ReadableStream: ReadableStream$1, TextEncoder
|
|
50842
|
+
} = utils$1.global;
|
|
50770
50843
|
|
|
50771
|
-
// used only inside the fetch adapter
|
|
50772
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
50773
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
50774
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
50775
|
-
);
|
|
50776
50844
|
|
|
50777
50845
|
const test = (fn, ...args) => {
|
|
50778
50846
|
try {
|
|
@@ -50782,211 +50850,268 @@ const test = (fn, ...args) => {
|
|
|
50782
50850
|
}
|
|
50783
50851
|
};
|
|
50784
50852
|
|
|
50785
|
-
const
|
|
50786
|
-
|
|
50853
|
+
const factory = (env) => {
|
|
50854
|
+
env = utils$1.merge.call({
|
|
50855
|
+
skipUndefined: true
|
|
50856
|
+
}, globalFetchAPI, env);
|
|
50787
50857
|
|
|
50788
|
-
const
|
|
50789
|
-
|
|
50790
|
-
|
|
50791
|
-
|
|
50792
|
-
duplexAccessed = true;
|
|
50793
|
-
return 'half';
|
|
50794
|
-
},
|
|
50795
|
-
}).headers.has('Content-Type');
|
|
50858
|
+
const {fetch: envFetch, Request, Response} = env;
|
|
50859
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
50860
|
+
const isRequestSupported = isFunction(Request);
|
|
50861
|
+
const isResponseSupported = isFunction(Response);
|
|
50796
50862
|
|
|
50797
|
-
|
|
50798
|
-
|
|
50863
|
+
if (!isFetchSupported) {
|
|
50864
|
+
return false;
|
|
50865
|
+
}
|
|
50799
50866
|
|
|
50800
|
-
const
|
|
50867
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
50801
50868
|
|
|
50802
|
-
const
|
|
50803
|
-
|
|
50869
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
50870
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
50871
|
+
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
|
|
50872
|
+
);
|
|
50804
50873
|
|
|
50874
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
50875
|
+
let duplexAccessed = false;
|
|
50805
50876
|
|
|
50806
|
-
const
|
|
50807
|
-
|
|
50808
|
-
|
|
50877
|
+
const hasContentType = new Request(platform.origin, {
|
|
50878
|
+
body: new ReadableStream$1(),
|
|
50879
|
+
method: 'POST',
|
|
50880
|
+
get duplex() {
|
|
50881
|
+
duplexAccessed = true;
|
|
50882
|
+
return 'half';
|
|
50883
|
+
},
|
|
50884
|
+
}).headers.has('Content-Type');
|
|
50809
50885
|
|
|
50810
|
-
|
|
50811
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
50812
|
-
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
50813
|
-
(_, config) => {
|
|
50814
|
-
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
50815
|
-
});
|
|
50886
|
+
return duplexAccessed && !hasContentType;
|
|
50816
50887
|
});
|
|
50817
|
-
})(new Response));
|
|
50818
50888
|
|
|
50819
|
-
const
|
|
50820
|
-
|
|
50821
|
-
return 0;
|
|
50822
|
-
}
|
|
50889
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
|
|
50890
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
|
50823
50891
|
|
|
50824
|
-
|
|
50825
|
-
|
|
50826
|
-
}
|
|
50892
|
+
const resolvers = {
|
|
50893
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
50894
|
+
};
|
|
50827
50895
|
|
|
50828
|
-
|
|
50829
|
-
|
|
50830
|
-
|
|
50831
|
-
|
|
50896
|
+
isFetchSupported && ((() => {
|
|
50897
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
50898
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
50899
|
+
let method = res && res[type];
|
|
50900
|
+
|
|
50901
|
+
if (method) {
|
|
50902
|
+
return method.call(res);
|
|
50903
|
+
}
|
|
50904
|
+
|
|
50905
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
50906
|
+
});
|
|
50832
50907
|
});
|
|
50833
|
-
|
|
50834
|
-
}
|
|
50908
|
+
})());
|
|
50835
50909
|
|
|
50836
|
-
|
|
50837
|
-
|
|
50838
|
-
|
|
50910
|
+
const getBodyLength = async (body) => {
|
|
50911
|
+
if (body == null) {
|
|
50912
|
+
return 0;
|
|
50913
|
+
}
|
|
50839
50914
|
|
|
50840
|
-
|
|
50841
|
-
|
|
50842
|
-
|
|
50915
|
+
if (utils$1.isBlob(body)) {
|
|
50916
|
+
return body.size;
|
|
50917
|
+
}
|
|
50843
50918
|
|
|
50844
|
-
|
|
50845
|
-
|
|
50846
|
-
|
|
50847
|
-
|
|
50919
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
50920
|
+
const _request = new Request(platform.origin, {
|
|
50921
|
+
method: 'POST',
|
|
50922
|
+
body,
|
|
50923
|
+
});
|
|
50924
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
50925
|
+
}
|
|
50848
50926
|
|
|
50849
|
-
|
|
50850
|
-
|
|
50927
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
50928
|
+
return body.byteLength;
|
|
50929
|
+
}
|
|
50851
50930
|
|
|
50852
|
-
|
|
50853
|
-
|
|
50931
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
50932
|
+
body = body + '';
|
|
50933
|
+
}
|
|
50854
50934
|
|
|
50855
|
-
|
|
50856
|
-
|
|
50857
|
-
|
|
50858
|
-
|
|
50859
|
-
data,
|
|
50860
|
-
signal,
|
|
50861
|
-
cancelToken,
|
|
50862
|
-
timeout,
|
|
50863
|
-
onDownloadProgress,
|
|
50864
|
-
onUploadProgress,
|
|
50865
|
-
responseType,
|
|
50866
|
-
headers,
|
|
50867
|
-
withCredentials = 'same-origin',
|
|
50868
|
-
fetchOptions
|
|
50869
|
-
} = resolveConfig(config);
|
|
50935
|
+
if (utils$1.isString(body)) {
|
|
50936
|
+
return (await encodeText(body)).byteLength;
|
|
50937
|
+
}
|
|
50938
|
+
};
|
|
50870
50939
|
|
|
50871
|
-
|
|
50940
|
+
const resolveBodyLength = async (headers, body) => {
|
|
50941
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
50872
50942
|
|
|
50873
|
-
|
|
50943
|
+
return length == null ? getBodyLength(body) : length;
|
|
50944
|
+
};
|
|
50874
50945
|
|
|
50875
|
-
|
|
50946
|
+
return async (config) => {
|
|
50947
|
+
let {
|
|
50948
|
+
url,
|
|
50949
|
+
method,
|
|
50950
|
+
data,
|
|
50951
|
+
signal,
|
|
50952
|
+
cancelToken,
|
|
50953
|
+
timeout,
|
|
50954
|
+
onDownloadProgress,
|
|
50955
|
+
onUploadProgress,
|
|
50956
|
+
responseType,
|
|
50957
|
+
headers,
|
|
50958
|
+
withCredentials = 'same-origin',
|
|
50959
|
+
fetchOptions
|
|
50960
|
+
} = resolveConfig(config);
|
|
50961
|
+
|
|
50962
|
+
let _fetch = envFetch || fetch;
|
|
50963
|
+
|
|
50964
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
50876
50965
|
|
|
50877
|
-
|
|
50966
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
50967
|
+
|
|
50968
|
+
let request = null;
|
|
50969
|
+
|
|
50970
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
50878
50971
|
composedSignal.unsubscribe();
|
|
50879
|
-
|
|
50972
|
+
});
|
|
50880
50973
|
|
|
50881
|
-
|
|
50974
|
+
let requestContentLength;
|
|
50882
50975
|
|
|
50883
|
-
|
|
50884
|
-
|
|
50885
|
-
|
|
50886
|
-
|
|
50887
|
-
|
|
50888
|
-
|
|
50889
|
-
|
|
50890
|
-
|
|
50891
|
-
|
|
50892
|
-
|
|
50976
|
+
try {
|
|
50977
|
+
if (
|
|
50978
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
50979
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
50980
|
+
) {
|
|
50981
|
+
let _request = new Request(url, {
|
|
50982
|
+
method: 'POST',
|
|
50983
|
+
body: data,
|
|
50984
|
+
duplex: "half"
|
|
50985
|
+
});
|
|
50893
50986
|
|
|
50894
|
-
|
|
50987
|
+
let contentTypeHeader;
|
|
50895
50988
|
|
|
50896
|
-
|
|
50897
|
-
|
|
50898
|
-
|
|
50989
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
50990
|
+
headers.setContentType(contentTypeHeader);
|
|
50991
|
+
}
|
|
50899
50992
|
|
|
50900
|
-
|
|
50901
|
-
|
|
50902
|
-
|
|
50903
|
-
|
|
50904
|
-
|
|
50993
|
+
if (_request.body) {
|
|
50994
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
50995
|
+
requestContentLength,
|
|
50996
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
50997
|
+
);
|
|
50905
50998
|
|
|
50906
|
-
|
|
50999
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
51000
|
+
}
|
|
50907
51001
|
}
|
|
50908
|
-
}
|
|
50909
51002
|
|
|
50910
|
-
|
|
50911
|
-
|
|
50912
|
-
|
|
51003
|
+
if (!utils$1.isString(withCredentials)) {
|
|
51004
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
51005
|
+
}
|
|
50913
51006
|
|
|
50914
|
-
|
|
50915
|
-
|
|
50916
|
-
|
|
50917
|
-
request = new Request(url, {
|
|
50918
|
-
...fetchOptions,
|
|
50919
|
-
signal: composedSignal,
|
|
50920
|
-
method: method.toUpperCase(),
|
|
50921
|
-
headers: headers.normalize().toJSON(),
|
|
50922
|
-
body: data,
|
|
50923
|
-
duplex: "half",
|
|
50924
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
50925
|
-
});
|
|
51007
|
+
// Cloudflare Workers throws when credentials are defined
|
|
51008
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
51009
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
50926
51010
|
|
|
50927
|
-
|
|
51011
|
+
const resolvedOptions = {
|
|
51012
|
+
...fetchOptions,
|
|
51013
|
+
signal: composedSignal,
|
|
51014
|
+
method: method.toUpperCase(),
|
|
51015
|
+
headers: headers.normalize().toJSON(),
|
|
51016
|
+
body: data,
|
|
51017
|
+
duplex: "half",
|
|
51018
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
51019
|
+
};
|
|
50928
51020
|
|
|
50929
|
-
|
|
51021
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
50930
51022
|
|
|
50931
|
-
|
|
50932
|
-
const options = {};
|
|
51023
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
50933
51024
|
|
|
50934
|
-
|
|
50935
|
-
options[prop] = response[prop];
|
|
50936
|
-
});
|
|
51025
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
50937
51026
|
|
|
50938
|
-
|
|
51027
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
51028
|
+
const options = {};
|
|
50939
51029
|
|
|
50940
|
-
|
|
50941
|
-
|
|
50942
|
-
|
|
50943
|
-
) || [];
|
|
51030
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
51031
|
+
options[prop] = response[prop];
|
|
51032
|
+
});
|
|
50944
51033
|
|
|
50945
|
-
|
|
50946
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
50947
|
-
flush && flush();
|
|
50948
|
-
unsubscribe && unsubscribe();
|
|
50949
|
-
}),
|
|
50950
|
-
options
|
|
50951
|
-
);
|
|
50952
|
-
}
|
|
51034
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
50953
51035
|
|
|
50954
|
-
|
|
51036
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
51037
|
+
responseContentLength,
|
|
51038
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
51039
|
+
) || [];
|
|
50955
51040
|
|
|
50956
|
-
|
|
51041
|
+
response = new Response(
|
|
51042
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
51043
|
+
flush && flush();
|
|
51044
|
+
unsubscribe && unsubscribe();
|
|
51045
|
+
}),
|
|
51046
|
+
options
|
|
51047
|
+
);
|
|
51048
|
+
}
|
|
50957
51049
|
|
|
50958
|
-
|
|
51050
|
+
responseType = responseType || 'text';
|
|
50959
51051
|
|
|
50960
|
-
|
|
50961
|
-
settle(resolve, reject, {
|
|
50962
|
-
data: responseData,
|
|
50963
|
-
headers: AxiosHeaders$1.from(response.headers),
|
|
50964
|
-
status: response.status,
|
|
50965
|
-
statusText: response.statusText,
|
|
50966
|
-
config,
|
|
50967
|
-
request
|
|
50968
|
-
});
|
|
50969
|
-
})
|
|
50970
|
-
} catch (err) {
|
|
50971
|
-
unsubscribe && unsubscribe();
|
|
51052
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
50972
51053
|
|
|
50973
|
-
|
|
50974
|
-
|
|
50975
|
-
|
|
50976
|
-
{
|
|
50977
|
-
|
|
50978
|
-
|
|
50979
|
-
|
|
51054
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
51055
|
+
|
|
51056
|
+
return await new Promise((resolve, reject) => {
|
|
51057
|
+
settle(resolve, reject, {
|
|
51058
|
+
data: responseData,
|
|
51059
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
51060
|
+
status: response.status,
|
|
51061
|
+
statusText: response.statusText,
|
|
51062
|
+
config,
|
|
51063
|
+
request
|
|
51064
|
+
});
|
|
51065
|
+
})
|
|
51066
|
+
} catch (err) {
|
|
51067
|
+
unsubscribe && unsubscribe();
|
|
51068
|
+
|
|
51069
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
51070
|
+
throw Object.assign(
|
|
51071
|
+
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
|
51072
|
+
{
|
|
51073
|
+
cause: err.cause || err
|
|
51074
|
+
}
|
|
51075
|
+
)
|
|
51076
|
+
}
|
|
51077
|
+
|
|
51078
|
+
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
50980
51079
|
}
|
|
51080
|
+
}
|
|
51081
|
+
};
|
|
51082
|
+
|
|
51083
|
+
const seedCache = new Map();
|
|
51084
|
+
|
|
51085
|
+
const getFetch = (config) => {
|
|
51086
|
+
let env = config ? config.env : {};
|
|
51087
|
+
const {fetch, Request, Response} = env;
|
|
51088
|
+
const seeds = [
|
|
51089
|
+
Request, Response, fetch
|
|
51090
|
+
];
|
|
51091
|
+
|
|
51092
|
+
let len = seeds.length, i = len,
|
|
51093
|
+
seed, target, map = seedCache;
|
|
51094
|
+
|
|
51095
|
+
while (i--) {
|
|
51096
|
+
seed = seeds[i];
|
|
51097
|
+
target = map.get(seed);
|
|
51098
|
+
|
|
51099
|
+
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
|
|
50981
51100
|
|
|
50982
|
-
|
|
51101
|
+
map = target;
|
|
50983
51102
|
}
|
|
50984
|
-
|
|
51103
|
+
|
|
51104
|
+
return target;
|
|
51105
|
+
};
|
|
51106
|
+
|
|
51107
|
+
getFetch();
|
|
50985
51108
|
|
|
50986
51109
|
const knownAdapters = {
|
|
50987
51110
|
http: httpAdapter,
|
|
50988
51111
|
xhr: xhrAdapter,
|
|
50989
|
-
fetch:
|
|
51112
|
+
fetch: {
|
|
51113
|
+
get: getFetch,
|
|
51114
|
+
}
|
|
50990
51115
|
};
|
|
50991
51116
|
|
|
50992
51117
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -51005,7 +51130,7 @@ const renderReason = (reason) => `- ${reason}`;
|
|
|
51005
51130
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
51006
51131
|
|
|
51007
51132
|
const adapters = {
|
|
51008
|
-
getAdapter: (adapters) => {
|
|
51133
|
+
getAdapter: (adapters, config) => {
|
|
51009
51134
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
51010
51135
|
|
|
51011
51136
|
const {length} = adapters;
|
|
@@ -51028,7 +51153,7 @@ const adapters = {
|
|
|
51028
51153
|
}
|
|
51029
51154
|
}
|
|
51030
51155
|
|
|
51031
|
-
if (adapter) {
|
|
51156
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
51032
51157
|
break;
|
|
51033
51158
|
}
|
|
51034
51159
|
|
|
@@ -51096,7 +51221,7 @@ function dispatchRequest(config) {
|
|
|
51096
51221
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
51097
51222
|
}
|
|
51098
51223
|
|
|
51099
|
-
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
|
|
51224
|
+
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
|
51100
51225
|
|
|
51101
51226
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
51102
51227
|
throwIfCancellationRequested(config);
|
|
@@ -51130,7 +51255,7 @@ function dispatchRequest(config) {
|
|
|
51130
51255
|
});
|
|
51131
51256
|
}
|
|
51132
51257
|
|
|
51133
|
-
const VERSION$1 = "1.
|
|
51258
|
+
const VERSION$1 = "1.12.2";
|
|
51134
51259
|
|
|
51135
51260
|
const validators$1 = {};
|
|
51136
51261
|
|
|
@@ -51386,8 +51511,6 @@ let Axios$1 = class Axios {
|
|
|
51386
51511
|
|
|
51387
51512
|
let newConfig = config;
|
|
51388
51513
|
|
|
51389
|
-
i = 0;
|
|
51390
|
-
|
|
51391
51514
|
while (i < len) {
|
|
51392
51515
|
const onFulfilled = requestInterceptorChain[i++];
|
|
51393
51516
|
const onRejected = requestInterceptorChain[i++];
|
|
@@ -51719,7 +51842,7 @@ function createInstance(defaultConfig) {
|
|
|
51719
51842
|
}
|
|
51720
51843
|
|
|
51721
51844
|
// Create the default instance to be exported
|
|
51722
|
-
const axios = createInstance(defaults);
|
|
51845
|
+
const axios = createInstance(defaults$1);
|
|
51723
51846
|
|
|
51724
51847
|
// Expose Axios class to allow class inheritance
|
|
51725
51848
|
axios.Axios = Axios$1;
|
|
@@ -70661,7 +70784,7 @@ const CustomDialog = ({
|
|
|
70661
70784
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
70662
70785
|
header?.customHeader && header.customHeader,
|
|
70663
70786
|
header?.title && !header?.customHeader && /* @__PURE__ */ jsx(DialogTitle, { className: "text-lg font-bold", children: header?.title }),
|
|
70664
|
-
header?.isCrossShow && /* @__PURE__ */ jsx("button", { onClick: () => setIsOpen(false), className: "p-2", children: /* @__PURE__ */ jsx(X, { className: "w-5 h-5" }) })
|
|
70787
|
+
header?.isCrossShow && /* @__PURE__ */ jsx("button", { onClick: () => setIsOpen(false), className: "p-2", children: /* @__PURE__ */ jsx(X$1, { className: "w-5 h-5" }) })
|
|
70665
70788
|
] }),
|
|
70666
70789
|
/* @__PURE__ */ jsx(
|
|
70667
70790
|
"div",
|
|
@@ -74913,15 +75036,14 @@ const baseConfig = {
|
|
|
74913
75036
|
"redo"
|
|
74914
75037
|
]
|
|
74915
75038
|
};
|
|
74916
|
-
const
|
|
75039
|
+
const CustomCKEditor = ({ value, onChange, config = {} }) => {
|
|
74917
75040
|
const mergedConfig = {
|
|
74918
75041
|
...baseConfig,
|
|
74919
75042
|
...config,
|
|
74920
|
-
|
|
74921
|
-
|
|
74922
|
-
placeholder: config.placeholder || baseConfig.placeholder
|
|
75043
|
+
toolbar: config.toolbar ?? baseConfig.toolbar,
|
|
75044
|
+
placeholder: config.placeholder ?? baseConfig.placeholder
|
|
74923
75045
|
};
|
|
74924
|
-
return /* @__PURE__ */ jsx(
|
|
75046
|
+
return /* @__PURE__ */ jsx(
|
|
74925
75047
|
CKEditor,
|
|
74926
75048
|
{
|
|
74927
75049
|
editor: ClassicEditor,
|
|
@@ -74929,20 +75051,96 @@ const CKEditorControlled = ({ value, onChange, config = {} }) => {
|
|
|
74929
75051
|
data: value,
|
|
74930
75052
|
onReady: (editor) => {
|
|
74931
75053
|
if (mergedConfig.height) {
|
|
74932
|
-
editor.ui.view.editable.element.style.minHeight =
|
|
75054
|
+
editor.ui.view.editable.element.style.minHeight = mergedConfig.height;
|
|
74933
75055
|
}
|
|
74934
75056
|
},
|
|
74935
|
-
onChange: (_, editor) =>
|
|
74936
|
-
const data = editor.getData();
|
|
74937
|
-
onChange(data);
|
|
74938
|
-
}
|
|
75057
|
+
onChange: (_, editor) => onChange(editor.getData())
|
|
74939
75058
|
}
|
|
74940
|
-
)
|
|
75059
|
+
);
|
|
74941
75060
|
};
|
|
74942
|
-
|
|
75061
|
+
|
|
75062
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
74943
75063
|
|
|
74944
75064
|
function Mt(t){if(typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",o.firstChild?o.insertBefore(e,o.firstChild):o.appendChild(e),e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t));}Mt(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
74945
|
-
`);
|
|
75065
|
+
`);var L=t=>typeof t=="number"&&!isNaN(t),N=t=>typeof t=="string",P=t=>typeof t=="function",mt=t=>N(t)||L(t),B=t=>N(t)||P(t)?t:null,pt=(t,o)=>t===false||L(t)&&t>0?t:o,z=t=>isValidElement(t)||N(t)||P(t)||L(t);function Z(t,o,e=300){let{scrollHeight:r,style:s}=t;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${e}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(o,e);});});}function $({enter:t,exit:o,appendPosition:e=false,collapse:r=true,collapseDuration:s=300}){return function({children:a,position:d,preventExitTransition:c,done:T,nodeRef:g,isIn:v,playToast:x}){let C=e?`${t}--${d}`:t,S=e?`${o}--${d}`:o,E=useRef(0);return useLayoutEffect(()=>{let f=g.current,p=C.split(" "),b=n=>{n.target===g.current&&(x(),f.removeEventListener("animationend",b),f.removeEventListener("animationcancel",b),E.current===0&&n.type!=="animationcancel"&&f.classList.remove(...p));};(()=>{f.classList.add(...p),f.addEventListener("animationend",b),f.addEventListener("animationcancel",b);})();},[]),useEffect(()=>{let f=g.current,p=()=>{f.removeEventListener("animationend",p),r?Z(f,T,s):T();};v||(c?p():(()=>{E.current=1,f.className+=` ${S}`,f.addEventListener("animationend",p);})());},[v]),React__default.createElement(React__default.Fragment,null,a)}}function J(t,o){return {content:tt(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:o}}function tt(t,o,e=false){return isValidElement(t)&&!N(t.type)?cloneElement(t,{closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:e}):P(t)?t({closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:e}):t}function yt({closeToast:t,theme:o,ariaLabel:e="close"}){return React__default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:r=>{r.stopPropagation(),t(true);},"aria-label":e},React__default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},React__default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function gt({delay:t,isRunning:o,closeToast:e,type:r="default",hide:s,className:l,controlledProgress:a,progress:d,rtl:c,isIn:T,theme:g}){let v=s||a&&d===0,x={animationDuration:`${t}ms`,animationPlayState:o?"running":"paused"};a&&(x.transform=`scaleX(${d})`);let C=clsx("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${r}`,{["Toastify__progress-bar--rtl"]:c}),S=P(l)?l({rtl:c,type:r,defaultClassName:C}):clsx(C,l),E={[a&&d>=1?"onTransitionEnd":"onAnimationEnd"]:a&&d<1?null:()=>{T&&e();}};return React__default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":v},React__default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${r}`}),React__default.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:S,style:x,...E}))}var Xt=1,at=()=>`${Xt++}`;function _t(t,o,e){let r=1,s=0,l=[],a=[],d=o,c=new Map,T=new Set,g=i=>(T.add(i),()=>T.delete(i)),v=()=>{a=Array.from(c.values()),T.forEach(i=>i());},x=({containerId:i,toastId:n,updateId:u})=>{let h=i?i!==t:t!==1,m=c.has(n)&&u==null;return h||m},C=(i,n)=>{c.forEach(u=>{var h;(n==null||n===u.props.toastId)&&((h=u.toggle)==null||h.call(u,i));});},S=i=>{var n,u;(u=(n=i.props)==null?void 0:n.onClose)==null||u.call(n,i.removalReason),i.isActive=false;},E=i=>{if(i==null)c.forEach(S);else {let n=c.get(i);n&&S(n);}v();},f=()=>{s-=l.length,l=[];},p=i=>{var m,_;let{toastId:n,updateId:u}=i.props,h=u==null;i.staleId&&c.delete(i.staleId),i.isActive=true,c.set(n,i),v(),e(J(i,h?"added":"updated")),h&&((_=(m=i.props).onOpen)==null||_.call(m));};return {id:t,props:d,observe:g,toggle:C,removeToast:E,toasts:c,clearQueue:f,buildToast:(i,n)=>{if(x(n))return;let{toastId:u,updateId:h,data:m,staleId:_,delay:k}=n,M=h==null;M&&s++;let A={...d,style:d.toastStyle,key:r++,...Object.fromEntries(Object.entries(n).filter(([D,Y])=>Y!=null)),toastId:u,updateId:h,data:m,isIn:false,className:B(n.className||d.toastClassName),progressClassName:B(n.progressClassName||d.progressClassName),autoClose:n.isLoading?false:pt(n.autoClose,d.autoClose),closeToast(D){c.get(u).removalReason=D,E(u);},deleteToast(){let D=c.get(u);if(D!=null){if(e(J(D,"removed")),c.delete(u),s--,s<0&&(s=0),l.length>0){p(l.shift());return}v();}}};A.closeButton=d.closeButton,n.closeButton===false||z(n.closeButton)?A.closeButton=n.closeButton:n.closeButton===true&&(A.closeButton=z(d.closeButton)?d.closeButton:true);let R={content:i,props:A,staleId:_};d.limit&&d.limit>0&&s>d.limit&&M?l.push(R):L(k)?setTimeout(()=>{p(R);},k):p(R);},setProps(i){d=i;},setToggle:(i,n)=>{let u=c.get(i);u&&(u.toggle=n);},isToastActive:i=>{var n;return (n=c.get(i))==null?void 0:n.isActive},getSnapshot:()=>a}}var I=new Map,F=[],st=new Set,Vt=t=>st.forEach(o=>o(t)),bt=()=>I.size>0;function Qt(){F.forEach(t=>nt(t.content,t.options)),F=[];}var vt=(t,{containerId:o})=>{var e;return (e=I.get(o||1))==null?void 0:e.toasts.get(t)};function X(t,o){var r;if(o)return !!((r=I.get(o))!=null&&r.isToastActive(t));let e=false;return I.forEach(s=>{s.isToastActive(t)&&(e=true);}),e}function ht(t){if(!bt()){F=F.filter(o=>t!=null&&o.options.toastId!==t);return}if(t==null||mt(t))I.forEach(o=>{o.removeToast(t);});else if(t&&("containerId"in t||"id"in t)){let o=I.get(t.containerId);o?o.removeToast(t.id):I.forEach(e=>{e.removeToast(t.id);});}}var Ct=(t={})=>{I.forEach(o=>{o.props.limit&&(!t.containerId||o.id===t.containerId)&&o.clearQueue();});};function nt(t,o){z(t)&&(bt()||F.push({content:t,options:o}),I.forEach(e=>{e.buildToast(t,o);}));}function xt(t){var o;(o=I.get(t.containerId||1))==null||o.setToggle(t.id,t.fn);}function rt(t,o){I.forEach(e=>{(o==null||!(o!=null&&o.containerId)||(o==null?void 0:o.containerId)===e.id)&&e.toggle(t,o==null?void 0:o.id);});}function Et(t){let o=t.containerId||1;return {subscribe(e){let r=_t(o,t,Vt);I.set(o,r);let s=r.observe(e);return Qt(),()=>{s(),I.delete(o);}},setProps(e){var r;(r=I.get(o))==null||r.setProps(e);},getSnapshot(){var e;return (e=I.get(o))==null?void 0:e.getSnapshot()}}}function Pt(t){return st.add(t),()=>{st.delete(t);}}function Wt(t){return t&&(N(t.toastId)||L(t.toastId))?t.toastId:at()}function U(t,o){return nt(t,o),o.toastId}function V(t,o){return {...o,type:o&&o.type||t,toastId:Wt(o)}}function Q(t){return (o,e)=>U(o,V(t,e))}function y(t,o){return U(t,V("default",o))}y.loading=(t,o)=>U(t,V("default",{isLoading:true,autoClose:false,closeOnClick:false,closeButton:false,draggable:false,...o}));function Gt(t,{pending:o,error:e,success:r},s){let l;o&&(l=N(o)?y.loading(o,s):y.loading(o.render,{...s,...o}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(T,g,v)=>{if(g==null){y.dismiss(l);return}let x={type:T,...a,...s,data:v},C=N(g)?{render:g}:g;return l?y.update(l,{...x,...C}):y(C.render,{...x,...C}),v},c=P(t)?t():t;return c.then(T=>d("success",r,T)).catch(T=>d("error",e,T)),c}y.promise=Gt;y.success=Q("success");y.info=Q("info");y.error=Q("error");y.warning=Q("warning");y.warn=y.warning;y.dark=(t,o)=>U(t,V("default",{theme:"dark",...o}));function qt(t){ht(t);}y.dismiss=qt;y.clearWaitingQueue=Ct;y.isActive=X;y.update=(t,o={})=>{let e=vt(t,o);if(e){let{props:r,content:s}=e,l={delay:100,...r,...o,toastId:o.toastId||t,updateId:at()};l.toastId!==t&&(l.staleId=t);let a=l.render||s;delete l.render,U(a,l);}};y.done=t=>{y.update(t,{progress:1});};y.onChange=Pt;y.play=t=>rt(true,t);y.pause=t=>rt(false,t);function It(t){var a;let{subscribe:o,getSnapshot:e,setProps:r}=useRef(Et(t)).current;r(t);let s=(a=useSyncExternalStore(o,e,e))==null?void 0:a.slice();function l(d){if(!s)return [];let c=new Map;return t.newestOnTop&&s.reverse(),s.forEach(T=>{let{position:g}=T.props;c.has(g)||c.set(g,[]),c.get(g).push(T);}),Array.from(c,T=>d(T[0],T[1]))}return {getToastToRender:l,isToastActive:X,count:s==null?void 0:s.length}}function At(t){let[o,e]=useState(false),[r,s]=useState(false),l=useRef(null),a=useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:true,canDrag:false,didMove:false}).current,{autoClose:d,pauseOnHover:c,closeToast:T,onClick:g,closeOnClick:v}=t;xt({id:t.toastId,containerId:t.containerId,fn:e}),useEffect(()=>{if(t.pauseOnFocusLoss)return x(),()=>{C();}},[t.pauseOnFocusLoss]);function x(){document.hasFocus()||p(),window.addEventListener("focus",f),window.addEventListener("blur",p);}function C(){window.removeEventListener("focus",f),window.removeEventListener("blur",p);}function S(m){if(t.draggable===true||t.draggable===m.pointerType){b();let _=l.current;a.canCloseOnClick=true,a.canDrag=true,_.style.transition="none",t.draggableDirection==="x"?(a.start=m.clientX,a.removalDistance=_.offsetWidth*(t.draggablePercent/100)):(a.start=m.clientY,a.removalDistance=_.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100);}}function E(m){let{top:_,bottom:k,left:M,right:A}=l.current.getBoundingClientRect();m.nativeEvent.type!=="touchend"&&t.pauseOnHover&&m.clientX>=M&&m.clientX<=A&&m.clientY>=_&&m.clientY<=k?p():f();}function f(){e(true);}function p(){e(false);}function b(){a.didMove=false,document.addEventListener("pointermove",n),document.addEventListener("pointerup",u);}function i(){document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",u);}function n(m){let _=l.current;if(a.canDrag&&_){a.didMove=true,o&&p(),t.draggableDirection==="x"?a.delta=m.clientX-a.start:a.delta=m.clientY-a.start,a.start!==m.clientX&&(a.canCloseOnClick=false);let k=t.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;_.style.transform=`translate3d(${k},0)`,_.style.opacity=`${1-Math.abs(a.delta/a.removalDistance)}`;}}function u(){i();let m=l.current;if(a.canDrag&&a.didMove&&m){if(a.canDrag=false,Math.abs(a.delta)>a.removalDistance){s(true),t.closeToast(true),t.collapseAll();return}m.style.transition="transform 0.2s, opacity 0.2s",m.style.removeProperty("transform"),m.style.removeProperty("opacity");}}let h={onPointerDown:S,onPointerUp:E};return d&&c&&(h.onMouseEnter=p,t.stacked||(h.onMouseLeave=f)),v&&(h.onClick=m=>{g&&g(m),a.canCloseOnClick&&T(true);}),{playToast:f,pauseToast:p,isRunning:o,preventExitTransition:r,toastRef:l,eventHandlers:h}}var Ot=typeof window!="undefined"?useLayoutEffect:useEffect;var G=({theme:t,type:o,isLoading:e,...r})=>React__default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${o})`,...r});function ao(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function so(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function no(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function ro(t){return React__default.createElement(G,{...t},React__default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function io(){return React__default.createElement("div",{className:"Toastify__spinner"})}var W={info:so,warning:ao,success:no,error:ro,spinner:io},lo=t=>t in W;function Nt({theme:t,type:o,isLoading:e,icon:r}){let s=null,l={theme:t,type:o};return r===false||(P(r)?s=r({...l,isLoading:e}):isValidElement(r)?s=cloneElement(r,l):e?s=W.spinner():lo(o)&&(s=W[o](l))),s}var wt=t=>{let{isRunning:o,preventExitTransition:e,toastRef:r,eventHandlers:s,playToast:l}=At(t),{closeButton:a,children:d,autoClose:c,onClick:T,type:g,hideProgressBar:v,closeToast:x,transition:C,position:S,className:E,style:f,progressClassName:p,updateId:b,role:i,progress:n,rtl:u,toastId:h,deleteToast:m,isIn:_,isLoading:k,closeOnClick:M,theme:A,ariaLabel:R}=t,D=clsx("Toastify__toast",`Toastify__toast-theme--${A}`,`Toastify__toast--${g}`,{["Toastify__toast--rtl"]:u},{["Toastify__toast--close-on-click"]:M}),Y=P(E)?E({rtl:u,position:S,type:g,defaultClassName:D}):clsx(D,E),ft=Nt(t),dt=!!n||!c,j={closeToast:x,type:g,theme:A},H=null;return a===false||(P(a)?H=a(j):isValidElement(a)?H=cloneElement(a,j):H=yt(j)),React__default.createElement(C,{isIn:_,done:m,position:S,preventExitTransition:e,nodeRef:r,playToast:l},React__default.createElement("div",{id:h,tabIndex:0,onClick:T,"data-in":_,className:Y,...s,style:f,ref:r,..._&&{role:i,"aria-label":R}},ft!=null&&React__default.createElement("div",{className:clsx("Toastify__toast-icon",{["Toastify--animate-icon Toastify__zoom-enter"]:!k})},ft),tt(d,t,!o),H,!t.customProgressBar&&React__default.createElement(gt,{...b&&!dt?{key:`p-${b}`}:{},rtl:u,theme:A,delay:c,isRunning:o,isIn:_,closeToast:x,hide:v,type:g,className:p,controlledProgress:dt,progress:n||0})))};var K=(t,o=false)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:o}),lt=$(K("bounce",true)),mo=$(K("slide",true));var _o={position:"top-right",transition:lt,autoClose:5e3,closeButton:true,pauseOnHover:true,pauseOnFocusLoss:true,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function Lt(t){let o={..._o,...t},e=t.stacked,[r,s]=useState(true),l=useRef(null),{getToastToRender:a,isToastActive:d,count:c}=It(o),{className:T,style:g,rtl:v,containerId:x,hotKeys:C}=o;function S(f){let p=clsx("Toastify__toast-container",`Toastify__toast-container--${f}`,{["Toastify__toast-container--rtl"]:v});return P(T)?T({position:f,rtl:v,defaultClassName:p}):clsx(p,B(T))}function E(){e&&(s(true),y.play());}return Ot(()=>{var f;if(e){let p=l.current.querySelectorAll('[data-in="true"]'),b=12,i=(f=o.position)==null?void 0:f.includes("top"),n=0,u=0;Array.from(p).reverse().forEach((h,m)=>{let _=h;_.classList.add("Toastify__toast--stacked"),m>0&&(_.dataset.collapsed=`${r}`),_.dataset.pos||(_.dataset.pos=i?"top":"bot");let k=n*(r?.2:1)+(r?0:b*m);_.style.setProperty("--y",`${i?k:k*-1}px`),_.style.setProperty("--g",`${b}`),_.style.setProperty("--s",`${1-(r?u:0)}`),n+=_.offsetHeight,u+=.025;});}},[r,c,e]),useEffect(()=>{function f(p){var i;let b=l.current;C(p)&&((i=b.querySelector('[tabIndex="0"]'))==null||i.focus(),s(false),y.pause()),p.key==="Escape"&&(document.activeElement===b||b!=null&&b.contains(document.activeElement))&&(s(true),y.play());}return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f);}},[C]),React__default.createElement("section",{ref:l,className:"Toastify",id:x,onMouseEnter:()=>{e&&(s(false),y.pause());},onMouseLeave:E,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":o["aria-label"]},a((f,p)=>{let b=p.length?{...g}:{...g,pointerEvents:"none"};return React__default.createElement("div",{tabIndex:-1,className:S(f),"data-stacked":e,style:b,key:`c-${f}`},p.map(({content:i,props:n})=>React__default.createElement(wt,{...n,stacked:e,collapseAll:E,isIn:d(n.toastId,n.containerId),key:`t-${n.key}`},i)))}))}
|
|
75066
|
+
|
|
75067
|
+
function ToastProvider({ children }) {
|
|
75068
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75069
|
+
children,
|
|
75070
|
+
/* @__PURE__ */ jsx(
|
|
75071
|
+
Lt,
|
|
75072
|
+
{
|
|
75073
|
+
position: "bottom-right",
|
|
75074
|
+
autoClose: 3500,
|
|
75075
|
+
newestOnTop: false,
|
|
75076
|
+
closeOnClick: true,
|
|
75077
|
+
rtl: false,
|
|
75078
|
+
pauseOnFocusLoss: false,
|
|
75079
|
+
draggable: true,
|
|
75080
|
+
pauseOnHover: true,
|
|
75081
|
+
transition: mo,
|
|
75082
|
+
limit: 4,
|
|
75083
|
+
closeButton: true,
|
|
75084
|
+
bodyClassName: "ui-toast__body",
|
|
75085
|
+
toastClassName: "ui-toast__toast",
|
|
75086
|
+
containerId: "ui-toast"
|
|
75087
|
+
}
|
|
75088
|
+
),
|
|
75089
|
+
/* @__PURE__ */ jsx("div", { id: "ui-toast-backdrop", "aria-hidden": "true" })
|
|
75090
|
+
] });
|
|
75091
|
+
}
|
|
75092
|
+
|
|
75093
|
+
const defaults = {
|
|
75094
|
+
containerId: "ui-toast",
|
|
75095
|
+
position: "bottom-right",
|
|
75096
|
+
autoClose: 3500,
|
|
75097
|
+
hideProgressBar: true,
|
|
75098
|
+
pauseOnFocusLoss: false,
|
|
75099
|
+
closeOnClick: true
|
|
75100
|
+
};
|
|
75101
|
+
let backdropCount = 0;
|
|
75102
|
+
const addBackdrop = () => {
|
|
75103
|
+
if (typeof document === "undefined") return;
|
|
75104
|
+
backdropCount += 1;
|
|
75105
|
+
document.body.classList.add("toast-backdrop");
|
|
75106
|
+
};
|
|
75107
|
+
const removeBackdrop = () => {
|
|
75108
|
+
if (typeof document === "undefined") return;
|
|
75109
|
+
backdropCount = Math.max(0, backdropCount - 1);
|
|
75110
|
+
if (backdropCount === 0) document.body.classList.remove("toast-backdrop");
|
|
75111
|
+
};
|
|
75112
|
+
const notify = {
|
|
75113
|
+
success: (msg, opts) => y.success(msg, { ...defaults, ...opts }),
|
|
75114
|
+
info: (msg, opts) => y.info(msg, { ...defaults, ...opts }),
|
|
75115
|
+
warn: (msg, opts) => y.warn(msg, { ...defaults, ...opts }),
|
|
75116
|
+
// Error: no autoClose + modal-like behavior via backdrop
|
|
75117
|
+
error: (msg, opts) => y.error(msg, {
|
|
75118
|
+
...defaults,
|
|
75119
|
+
autoClose: false,
|
|
75120
|
+
closeOnClick: false,
|
|
75121
|
+
draggable: false,
|
|
75122
|
+
onOpen: addBackdrop,
|
|
75123
|
+
onClose: removeBackdrop,
|
|
75124
|
+
...opts
|
|
75125
|
+
}),
|
|
75126
|
+
// Promise helper (error branch inherits the modal behavior)
|
|
75127
|
+
promise: (p, messages, opts) => y.promise(
|
|
75128
|
+
p,
|
|
75129
|
+
{
|
|
75130
|
+
pending: messages?.pending,
|
|
75131
|
+
success: messages?.success,
|
|
75132
|
+
error: {
|
|
75133
|
+
render: () => messages?.error || "Something went wrong.",
|
|
75134
|
+
autoClose: false,
|
|
75135
|
+
closeOnClick: false,
|
|
75136
|
+
draggable: false,
|
|
75137
|
+
onOpen: addBackdrop,
|
|
75138
|
+
onClose: removeBackdrop
|
|
75139
|
+
}
|
|
75140
|
+
},
|
|
75141
|
+
{ ...defaults, ...opts }
|
|
75142
|
+
)
|
|
75143
|
+
};
|
|
74946
75144
|
|
|
74947
|
-
export { AddUserGroupsRolesModal, Avatar, AvatarGroup, Badge, Breadcrumbs, Button$1 as Button, Checkbox, CustomDialog, DatePicker, DateRangePicker$1 as DateRangePicker, FileUploadModal, FullScreenLoader, GenericFilter, Input, Modal, MultiSelect, OptionsMenu, PageHeader, PageLayout, Pagination, RadioGroup, SearchBar, Select, Sidebar, Spinner, Textarea, ToggleSwitch, Tooltip, TreeView, UnifyedCoreButton, WizardModal, adGroupsListSearchApi, axiosDelete, axiosGet, axiosPatch, axiosPost, axiosPut, cookies$1 as cookies, createHttpClient, directoryPermissionsApi, filePermissionsApi, gateWayUrl, gatewayBase, getBaseUrl, getSnapshot, http, localStore, myDriveGatewayBaseV2, provisioningBase, rbacBase, searchRolesApi, sessionStore, userSearchBase };
|
|
75145
|
+
export { AddUserGroupsRolesModal, Avatar, AvatarGroup, Badge, Breadcrumbs, Button$1 as Button, Checkbox, CustomCKEditor, CustomDialog, DatePicker, DateRangePicker$1 as DateRangePicker, FileUploadModal, FullScreenLoader, GenericFilter, Input, Modal, MultiSelect, OptionsMenu, PageHeader, PageLayout, Pagination, RadioGroup, SearchBar, Select, Sidebar, Spinner, Textarea, ToastProvider, ToggleSwitch, Tooltip, TreeView, UnifyedCoreButton, WizardModal, adGroupsListSearchApi, axiosDelete, axiosGet, axiosPatch, axiosPost, axiosPut, cookies$1 as cookies, createHttpClient, directoryPermissionsApi, filePermissionsApi, gateWayUrl, gatewayBase, getBaseUrl, getSnapshot, http, localStore, myDriveGatewayBaseV2, notify, provisioningBase, rbacBase, searchRolesApi, sessionStore, userSearchBase };
|
|
74948
75146
|
//# sourceMappingURL=unifyedx-storybook-new.es.js.map
|