@wix/form-public 0.579.0 → 0.581.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -8437,8 +8437,8 @@ var init_metadata = __esm({
8437
8437
  // Deprecated.
8438
8438
  }, {
8439
8439
  key: "type",
8440
- value: function type(_type4) {
8441
- return this.numberingPlan.type(_type4);
8440
+ value: function type(_type5) {
8441
+ return this.numberingPlan.type(_type5);
8442
8442
  }
8443
8443
  // Deprecated.
8444
8444
  }, {
@@ -52131,12 +52131,38 @@ async function loadFieldViewerTranslations(locale) {
52131
52131
  }
52132
52132
  }
52133
52133
  }
52134
- var getLocaleDatasetTranslationsUrl = (locale = "en") => `https://static.parastorage.com/services/locale-dataset-data/1.4213.0/translations/messages_${locale}.json`;
52134
+ var LOCALE_DATASET_DATA_VERSION = "1.4238.0";
52135
+ var FALLBACK_LOCALE = "en";
52136
+ var getLocaleDatasetTranslationsUrl = (locale = FALLBACK_LOCALE) => `https://static.parastorage.com/services/locale-dataset-data/${LOCALE_DATASET_DATA_VERSION}/translations/messages_${locale}.json`;
52137
+ var fetchJson = async (url) => {
52138
+ const response = await fetch(url);
52139
+ if (!response.ok) {
52140
+ throw new Error(`Request to ${url} failed with status ${response.status}`);
52141
+ }
52142
+ return response.json();
52143
+ };
52135
52144
  var fetchLocaleDatasetTranslations = async (locale) => {
52136
- const url = getLocaleDatasetTranslationsUrl(locale);
52137
- const fallbackUrl = getLocaleDatasetTranslationsUrl();
52138
- const response = await fetch(url).catch(() => fetch(fallbackUrl));
52139
- return response?.json() ?? {};
52145
+ try {
52146
+ return await fetchJson(getLocaleDatasetTranslationsUrl(locale));
52147
+ } catch (error) {
52148
+ if (locale === FALLBACK_LOCALE) {
52149
+ console.warn("Failed to load locale dataset translations", error);
52150
+ return {};
52151
+ }
52152
+ console.warn(
52153
+ `Failed to load locale dataset translations for locale ${locale}, falling back to English`,
52154
+ error
52155
+ );
52156
+ try {
52157
+ return await fetchJson(getLocaleDatasetTranslationsUrl(FALLBACK_LOCALE));
52158
+ } catch (fallbackError) {
52159
+ console.warn(
52160
+ "Failed to load English locale dataset translations",
52161
+ fallbackError
52162
+ );
52163
+ return {};
52164
+ }
52165
+ }
52140
52166
  };
52141
52167
  async function createI18n(locale) {
52142
52168
  const i18nInstance = default2__default.default.createInstance();
@@ -52173,10 +52199,20 @@ var FormProvider = ({
52173
52199
  React178.useEffect(() => {
52174
52200
  const initializeI18n = async () => {
52175
52201
  try {
52176
- const newI18n = await createI18n(locale);
52177
- setI18nInstance(newI18n);
52202
+ setI18nInstance(await createI18n(locale));
52178
52203
  } catch (error) {
52179
52204
  console.error("Failed to initialize i18n:", error);
52205
+ if (locale === "en") {
52206
+ return;
52207
+ }
52208
+ try {
52209
+ setI18nInstance(await createI18n("en"));
52210
+ } catch (fallbackError) {
52211
+ console.error(
52212
+ "Failed to initialize i18n with English fallback:",
52213
+ fallbackError
52214
+ );
52215
+ }
52180
52216
  }
52181
52217
  };
52182
52218
  initializeI18n();
@@ -52417,2176 +52453,2174 @@ var SortOrder2;
52417
52453
  SortOrder3["DESC"] = "DESC";
52418
52454
  })(SortOrder2 || (SortOrder2 = {}));
52419
52455
 
52420
- // ../form-fields/dist/esm/date-localization/get-first-day-of-the-week.js
52421
- var DEFAULT_FIRST_DAY = 1;
52422
- function getFirstDayOfTheWeek(locale) {
52423
- try {
52424
- const intlLocale = new Intl.Locale(locale);
52425
- if (typeof intlLocale.getWeekInfo === "function") {
52426
- const firstDay = intlLocale.getWeekInfo().firstDay;
52427
- if (firstDay !== void 0) {
52428
- return firstDay === 7 ? 0 : firstDay;
52429
- }
52430
- }
52431
- return getFirstDayManual(locale);
52432
- } catch {
52433
- return getFirstDayManual(locale);
52434
- }
52456
+ // ../../node_modules/@internationalized/date/dist/private/utils.mjs
52457
+ function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
52458
+ return amount - numerator * Math.floor(amount / numerator);
52435
52459
  }
52436
- var REGIONS_STARTING_SATURDAY = [
52437
- "AF",
52438
- "BH",
52439
- "DJ",
52440
- "DZ",
52441
- "EG",
52442
- "IQ",
52443
- "IR",
52444
- "JO",
52445
- "KW",
52446
- "LY",
52447
- "OM",
52448
- "QA",
52449
- "SD",
52450
- "SY"
52451
- ];
52452
- var REGIONS_STARTING_SUNDAY = [
52453
- "AG",
52454
- "AS",
52455
- "BD",
52456
- "BR",
52457
- "BS",
52458
- "BT",
52459
- "BW",
52460
- "BZ",
52461
- "CA",
52462
- "CO",
52463
- "DM",
52464
- "DO",
52465
- "ET",
52466
- "GT",
52467
- "GU",
52468
- "HK",
52469
- "HN",
52470
- "ID",
52471
- "IL",
52472
- "IN",
52473
- "IS",
52474
- "JM",
52475
- "JP",
52476
- "KE",
52477
- "KH",
52478
- "KR",
52479
- "LA",
52480
- "MH",
52481
- "MM",
52482
- "MO",
52483
- "MT",
52484
- "MX",
52485
- "MZ",
52486
- "NI",
52487
- "NP",
52488
- "PA",
52489
- "PE",
52490
- "PH",
52491
- "PK",
52492
- "PR",
52493
- "PT",
52494
- "PY",
52495
- "SA",
52496
- "SG",
52497
- "SV",
52498
- "TH",
52499
- "TT",
52500
- "TW",
52501
- "UM",
52502
- "US",
52503
- "VE",
52504
- "VI",
52505
- "WS",
52506
- "YE",
52507
- "ZA",
52508
- "ZW"
52509
- ];
52510
- var LANGUAGES_STARTING_SATURDAY = [
52511
- "ar"
52512
- ];
52513
- var LANGUAGES_STARTING_SUNDAY = [
52514
- "en",
52515
- "he",
52516
- "hi",
52517
- "id",
52518
- "ja",
52519
- "ko",
52520
- "pt",
52521
- "tl",
52522
- "th"
52523
- ];
52524
- function getFirstDayManual(locale) {
52525
- try {
52526
- const intlLocale = new Intl.Locale(locale);
52527
- const language = intlLocale.language?.toLowerCase();
52528
- const region = intlLocale.region?.toUpperCase();
52529
- if (region) {
52530
- if (REGIONS_STARTING_SUNDAY.includes(region)) {
52531
- return 0;
52532
- }
52533
- if (REGIONS_STARTING_SATURDAY.includes(region)) {
52534
- return 6;
52535
- }
52536
- return DEFAULT_FIRST_DAY;
52537
- }
52538
- if (language) {
52539
- if (LANGUAGES_STARTING_SUNDAY.includes(language)) {
52540
- return 0;
52541
- }
52542
- if (LANGUAGES_STARTING_SATURDAY.includes(language)) {
52543
- return 6;
52544
- }
52545
- }
52546
- return DEFAULT_FIRST_DAY;
52547
- } catch {
52548
- return DEFAULT_FIRST_DAY;
52460
+
52461
+ // ../../node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.mjs
52462
+ var $93635573935797de$var$EPOCH = 1721426;
52463
+ function $93635573935797de$export$f297eb839006d339(era, year, month, day) {
52464
+ year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year);
52465
+ let y1 = year - 1;
52466
+ let monthOffset = -2;
52467
+ if (month <= 2) monthOffset = 0;
52468
+ else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1;
52469
+ return $93635573935797de$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
52470
+ }
52471
+ function $93635573935797de$export$553d7fa8e3805fc0(year) {
52472
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
52473
+ }
52474
+ function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) {
52475
+ return era === "BC" ? 1 - year : year;
52476
+ }
52477
+ function $93635573935797de$export$4475b7e617eb123c(year) {
52478
+ let era = "AD";
52479
+ if (year <= 0) {
52480
+ era = "BC";
52481
+ year = 1 - year;
52549
52482
  }
52483
+ return [
52484
+ era,
52485
+ year
52486
+ ];
52550
52487
  }
52551
-
52552
- // ../form-fields/dist/esm/ui/shared/headless-styles.js
52553
- var VISUALLY_HIDDEN_STYLE = {
52554
- position: "absolute",
52555
- width: 1,
52556
- height: 1,
52557
- margin: -1,
52558
- padding: 0,
52559
- border: 0,
52560
- clipPath: "inset(50%)",
52561
- overflow: "hidden",
52562
- whiteSpace: "nowrap"
52563
- };
52564
- var FIELDSET_RESET_STYLE = {
52565
- border: "none",
52566
- padding: 0,
52567
- margin: 0,
52568
- minWidth: 0
52488
+ var $93635573935797de$var$daysInMonth = {
52489
+ standard: [
52490
+ 31,
52491
+ 28,
52492
+ 31,
52493
+ 30,
52494
+ 31,
52495
+ 30,
52496
+ 31,
52497
+ 31,
52498
+ 30,
52499
+ 31,
52500
+ 30,
52501
+ 31
52502
+ ],
52503
+ leapyear: [
52504
+ 31,
52505
+ 29,
52506
+ 31,
52507
+ 30,
52508
+ 31,
52509
+ 30,
52510
+ 31,
52511
+ 31,
52512
+ 30,
52513
+ 31,
52514
+ 30,
52515
+ 31
52516
+ ]
52569
52517
  };
52570
- var AppointmentSlotPickerContext = React178.createContext(void 0);
52571
- var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
52572
- var getDateTitleId = (inputId) => `${inputId}-date-title`;
52573
- var useAppointmentSlotPickerContext = () => {
52574
- const context = React178.useContext(AppointmentSlotPickerContext);
52575
- if (typeof context === "undefined") {
52576
- throw new Error("Appointment parts must be used inside an <Appointment> component");
52518
+ var $93635573935797de$export$80ee6245ec4f29ec = class {
52519
+ fromJulianDay(jd) {
52520
+ let jd0 = jd;
52521
+ let depoch = jd0 - $93635573935797de$var$EPOCH;
52522
+ let quadricent = Math.floor(depoch / 146097);
52523
+ let dqc = ($09ec6a572d60460f$export$842a2cf37af977e1)(depoch, 146097);
52524
+ let cent = Math.floor(dqc / 36524);
52525
+ let dcent = ($09ec6a572d60460f$export$842a2cf37af977e1)(dqc, 36524);
52526
+ let quad = Math.floor(dcent / 1461);
52527
+ let dquad = ($09ec6a572d60460f$export$842a2cf37af977e1)(dcent, 1461);
52528
+ let yindex = Math.floor(dquad / 365);
52529
+ let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
52530
+ let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear);
52531
+ let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1);
52532
+ let leapAdj = 2;
52533
+ if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
52534
+ else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1;
52535
+ let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
52536
+ let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1;
52537
+ return new ($2aaf608024c21ca1$export$99faa760c7908e4f)(era, year, month, day);
52577
52538
  }
52578
- return context;
52579
- };
52580
-
52581
- // ../form-fields/dist/esm/ui/appointment-field/appointment-headless/appointment-dates-headless.js
52582
- var useIsLocked = () => {
52583
- const { disabled, readOnly } = useFieldPropsV2();
52584
- return !!disabled || !!readOnly;
52585
- };
52586
- var Dates = ({ children, className }) => {
52587
- const { days, selectDate, weekRangeLabel } = useAppointmentSlotPickerContext();
52588
- const previousWeekElement = findChildOfType(children, Dates.PreviousWeek);
52589
- const headingElement = findChildOfType(children, Dates.Heading);
52590
- const nextWeekElement = findChildOfType(children, Dates.NextWeek);
52591
- const dayElement = findChildOfType(children, Dates.Day) ?? /* @__PURE__ */ React178__default.default.createElement(Dates.Day, null);
52592
- const selectedKeys = React178.useMemo(() => days.filter((day) => day.isSelected).map((day) => day.key), [
52593
- days
52594
- ]);
52595
- const isLocked = useIsLocked();
52596
- const disabledKeys = React178.useMemo(() => days.filter((day) => isLocked || day.isDisabled).map((day) => day.key), [
52597
- days,
52598
- isLocked
52599
- ]);
52600
- const handleSelectionChange = (keys3) => {
52601
- if (keys3 === "all") {
52602
- return;
52603
- }
52604
- const [selectedKey] = [
52605
- ...keys3
52539
+ toJulianDay(date) {
52540
+ return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day);
52541
+ }
52542
+ getDaysInMonth(date) {
52543
+ return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
52544
+ }
52545
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52546
+ getMonthsInYear(date) {
52547
+ return 12;
52548
+ }
52549
+ getDaysInYear(date) {
52550
+ return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
52551
+ }
52552
+ getMaximumMonthsInYear() {
52553
+ return 12;
52554
+ }
52555
+ getMaximumDaysInMonth() {
52556
+ return 31;
52557
+ }
52558
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52559
+ getYearsInEra(date) {
52560
+ return 9999;
52561
+ }
52562
+ getEras() {
52563
+ return [
52564
+ "BC",
52565
+ "AD"
52606
52566
  ];
52607
- const day = days.find(({ key }) => key === selectedKey);
52608
- if (day) {
52609
- selectDate(day.date);
52610
- }
52611
- };
52612
- return /* @__PURE__ */ React178__default.default.createElement("div", {
52613
- className
52614
- }, previousWeekElement, headingElement, nextWeekElement, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBox, {
52615
- "aria-label": weekRangeLabel,
52616
- orientation: "horizontal",
52617
- selectionMode: "single",
52618
- selectedKeys,
52619
- disabledKeys,
52620
- onSelectionChange: handleSelectionChange
52621
- }, days.map((day) => applyInternalProps(dayElement, {
52622
- key: day.key,
52623
- day
52624
- }))));
52625
- };
52626
- var PreviousWeek = ({ children, className }) => {
52627
- const { changeWeek, canGoToPreviousWeek, previousWeekLabel, nextWeekLabel } = useAppointmentSlotPickerContext();
52628
- const isLocked = useIsLocked();
52629
- const buttonRef = React178.useRef(null);
52630
- const wasPressedRef = React178.useRef(false);
52631
- React178.useEffect(() => {
52632
- if (canGoToPreviousWeek || !wasPressedRef.current) {
52633
- return;
52634
- }
52635
- wasPressedRef.current = false;
52636
- const activeElement = document.activeElement;
52637
- if (activeElement !== document.body && activeElement !== buttonRef.current) {
52638
- return;
52639
- }
52640
- const buttons = buttonRef.current?.closest("fieldset")?.querySelectorAll("button") ?? [];
52641
- Array.from(buttons).find((button) => button.getAttribute("aria-label") === nextWeekLabel)?.focus();
52642
- }, [
52643
- canGoToPreviousWeek,
52644
- nextWeekLabel
52645
- ]);
52646
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
52647
- ref: buttonRef,
52648
- className,
52649
- "aria-label": previousWeekLabel,
52650
- isDisabled: !canGoToPreviousWeek || isLocked,
52651
- onPress: () => {
52652
- wasPressedRef.current = true;
52653
- changeWeek(-1);
52654
- }
52655
- }, children ?? "\u2039");
52656
- };
52657
- var NextWeek = ({ children, className }) => {
52658
- const { changeWeek, nextWeekLabel } = useAppointmentSlotPickerContext();
52659
- const isLocked = useIsLocked();
52660
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
52661
- className,
52662
- "aria-label": nextWeekLabel,
52663
- isDisabled: isLocked,
52664
- onPress: () => changeWeek(1)
52665
- }, children ?? "\u203A");
52666
- };
52667
- var Heading2 = ({ children, className }) => {
52668
- const { weekCaptionLabel, weekRangeLabel } = useAppointmentSlotPickerContext();
52669
- return /* @__PURE__ */ React178__default.default.createElement("span", {
52670
- className,
52671
- "aria-live": "polite"
52672
- }, children ? children({
52673
- label: weekCaptionLabel,
52674
- weekRange: weekRangeLabel
52675
- }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", {
52676
- "aria-hidden": "true"
52677
- }, weekCaptionLabel), /* @__PURE__ */ React178__default.default.createElement("span", {
52678
- style: VISUALLY_HIDDEN_STYLE
52679
- }, weekRangeLabel)));
52680
- };
52681
- var Day = ({ children, className, ...internal }) => {
52682
- const { day } = internal;
52683
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBoxItem, {
52684
- id: day.key,
52685
- className,
52686
- textValue: day.label,
52687
- "aria-label": day.isAvailable ? `${day.label}, ${day.availabilityLabel}` : day.label,
52688
- "data-available": day.isAvailable || void 0,
52689
- "data-today": day.isToday || void 0
52690
- }, children ? children({
52691
- ...day,
52692
- date: new Date(day.date)
52693
- }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", null, day.weekdayLabel), /* @__PURE__ */ React178__default.default.createElement("span", null, day.dayOfMonthLabel)));
52694
- };
52695
- Dates.PreviousWeek = PreviousWeek;
52696
- Dates.Heading = Heading2;
52697
- Dates.NextWeek = NextWeek;
52698
- Dates.Day = Day;
52699
- var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
52700
- var Slots = ({ children, className, ...internal }) => {
52701
- const { hasTimezoneNote, hasDateTitle } = internal;
52702
- const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
52703
- const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
52704
- const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
52705
- const groupRef = React178.useRef(null);
52706
- const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React178__default.default.createElement(Slots.Slot, null);
52707
- const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
52708
- const describedBy = [
52709
- ariaDescribedBy,
52710
- hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
52711
- ].filter(Boolean).join(" ") || void 0;
52712
- const focusSlotAt = (index2, options) => {
52713
- groupRef.current?.querySelectorAll(RADIO_INPUT_SELECTOR)?.[index2]?.focus(options);
52714
- };
52715
- useFocusFieldEvent(() => {
52716
- const hasSlots = !!groupRef.current?.querySelector(RADIO_INPUT_SELECTOR);
52717
- if (hasSlots) {
52718
- focusSlotAt(0, {
52719
- preventScroll: true
52720
- });
52721
- return;
52722
- }
52723
- const options = Array.from(document.getElementById(inputId)?.querySelectorAll('[role="option"]') ?? []);
52724
- const fallback = options.find((option2) => option2.getAttribute("aria-selected") === "true") ?? options.find((option2) => option2.getAttribute("aria-disabled") !== "true");
52725
- fallback?.focus({
52726
- preventScroll: true
52727
- });
52728
- }, fieldId);
52729
- React178.useEffect(() => {
52730
- if (pendingFocusIndex === void 0) {
52731
- return;
52732
- }
52733
- focusSlotAt(pendingFocusIndex);
52734
- consumePendingFocusIndex();
52735
- }, [
52736
- pendingFocusIndex,
52737
- slots.length
52738
- ]);
52739
- return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("div", {
52740
- role: "status",
52741
- style: VISUALLY_HIDDEN_STYLE
52742
- }, slots.length > 0 ? selectedDateLabel : void 0), /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioGroup, {
52743
- ref: groupRef,
52744
- className,
52745
- value: selectedSlotKey ?? null,
52746
- onChange: selectSlot,
52747
- isDisabled: disabled,
52748
- isReadOnly: readOnly,
52749
- isRequired: required,
52750
- isInvalid: hasError,
52751
- "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
52752
- "aria-describedby": describedBy,
52753
- "data-refetch": isReloadingSlots || void 0
52754
- }, slots.map((slot) => applyInternalProps(slotElement, {
52755
- key: slot.key,
52756
- slot
52757
- }))));
52758
- };
52759
- var Slot = ({ children, className, ...internal }) => {
52760
- const { slot } = internal;
52761
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioField, {
52762
- value: slot.key,
52763
- "aria-label": slot.timeRange
52764
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioButton, {
52765
- className
52766
- }, children ? children(slot) : slot.timeRange));
52767
- };
52768
- Slots.Slot = Slot;
52769
- var import_cloneDeep = __toESM(require_cloneDeep());
52770
- var createIndicatorNode = (requiredIndicatorType, t, className) => {
52771
- const indicator = requiredIndicatorType === types$1.RequiredIndicator.TEXT ? t("settings.required-indicator-text") : "*";
52772
- const str = (v) => ({
52773
- stringValue: v
52774
- });
52775
- const fields = {
52776
- "aria-hidden": str("true")
52777
- };
52778
- if (className) {
52779
- fields.className = str(className);
52780
52567
  }
52781
- return {
52782
- type: Node_Type.EXTERNAL,
52783
- id: "",
52784
- nodes: [],
52785
- externalData: {
52786
- fields
52787
- },
52788
- textData: {
52789
- text: indicator,
52790
- decorations: []
52568
+ isInverseEra(date) {
52569
+ return date.era === "BC";
52570
+ }
52571
+ balanceDate(date) {
52572
+ if (date.year <= 0) {
52573
+ date.era = date.era === "BC" ? "AD" : "BC";
52574
+ date.year = 1 - date.year;
52791
52575
  }
52792
- };
52576
+ }
52577
+ constructor() {
52578
+ this.identifier = "gregory";
52579
+ }
52793
52580
  };
52794
- var injectRequiredIndicator = (label, placement, indicatorNode) => {
52795
- const result2 = (0, import_cloneDeep.default)(label);
52796
- switch (placement) {
52797
- case types$1.RequiredIndicatorPlacement.BEFORE_FIELD_TITLE:
52798
- const firstNode = result2?.nodes.find(Boolean);
52799
- if (firstNode) {
52800
- firstNode.nodes ?? (firstNode.nodes = []);
52801
- firstNode.nodes.unshift(indicatorNode);
52802
- }
52803
- break;
52804
- case types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE:
52805
- const lastNode = result2?.nodes?.findLast(Boolean);
52806
- if (lastNode) {
52807
- lastNode.nodes ?? (lastNode.nodes = []);
52808
- lastNode.nodes.push(indicatorNode);
52581
+
52582
+ // ../../node_modules/@internationalized/date/dist/private/queries.mjs
52583
+ function $ad063034c8620db8$export$dbc69fd56b53d5e(a2, b) {
52584
+ return a2.isEqual?.(b) ?? b.isEqual?.(a2) ?? a2.identifier === b.identifier;
52585
+ }
52586
+ function $ad063034c8620db8$export$68781ddf31c0090f(a2, b) {
52587
+ return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
52588
+ }
52589
+ function $ad063034c8620db8$export$c19a80a9721b80f6(a2, b) {
52590
+ return $ad063034c8620db8$var$timeToMs(a2) - $ad063034c8620db8$var$timeToMs(b);
52591
+ }
52592
+ function $ad063034c8620db8$var$timeToMs(a2) {
52593
+ return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
52594
+ }
52595
+ var $ad063034c8620db8$var$localTimeZone = null;
52596
+ var $ad063034c8620db8$var$localTimeZoneOverride = false;
52597
+ function $ad063034c8620db8$export$aa8b41735afcabd2() {
52598
+ if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
52599
+ return $ad063034c8620db8$var$localTimeZone;
52600
+ }
52601
+ function $ad063034c8620db8$export$6ab69b273755230b() {
52602
+ return $ad063034c8620db8$var$localTimeZoneOverride;
52603
+ }
52604
+
52605
+ // ../../node_modules/@internationalized/date/dist/private/conversion.mjs
52606
+ function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) {
52607
+ date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
52608
+ let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(date.era, date.year);
52609
+ return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
52610
+ }
52611
+ function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
52612
+ let date = /* @__PURE__ */ new Date();
52613
+ date.setUTCHours(hour, minute, second, millisecond);
52614
+ date.setUTCFullYear(year, month - 1, day);
52615
+ return date.getTime();
52616
+ }
52617
+ function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) {
52618
+ if (timeZone === "UTC") return 0;
52619
+ if (ms > 0 && timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && !($ad063034c8620db8$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
52620
+ let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone);
52621
+ let utc2 = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0);
52622
+ return utc2 - Math.floor(ms / 1e3) * 1e3;
52623
+ }
52624
+ var $d07e34cce18680fd$var$formattersByTimeZone = /* @__PURE__ */ new Map();
52625
+ function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) {
52626
+ let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone);
52627
+ if (!formatter) {
52628
+ formatter = new Intl.DateTimeFormat("en-US", {
52629
+ timeZone,
52630
+ hour12: false,
52631
+ era: "short",
52632
+ year: "numeric",
52633
+ month: "numeric",
52634
+ day: "numeric",
52635
+ hour: "numeric",
52636
+ minute: "numeric",
52637
+ second: "numeric"
52638
+ });
52639
+ $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter);
52640
+ }
52641
+ let parts = formatter.formatToParts(new Date(ms));
52642
+ let namedParts = {};
52643
+ for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
52644
+ return {
52645
+ // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
52646
+ year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
52647
+ month: +namedParts.month,
52648
+ day: +namedParts.day,
52649
+ hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
52650
+ minute: +namedParts.minute,
52651
+ second: +namedParts.second
52652
+ };
52653
+ }
52654
+ var $d07e34cce18680fd$var$DAYMILLIS = 864e5;
52655
+ function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) {
52656
+ let found = earlier === later ? [
52657
+ earlier
52658
+ ] : [
52659
+ earlier,
52660
+ later
52661
+ ];
52662
+ return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute));
52663
+ }
52664
+ function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) {
52665
+ let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone);
52666
+ return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
52667
+ }
52668
+ function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
52669
+ let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date);
52670
+ if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
52671
+ if (timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && disambiguation === "compatible" && !($ad063034c8620db8$export$6ab69b273755230b)()) {
52672
+ dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new ($93635573935797de$export$80ee6245ec4f29ec)());
52673
+ let date2 = /* @__PURE__ */ new Date();
52674
+ let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
52675
+ date2.setFullYear(year, dateTime.month - 1, dateTime.day);
52676
+ date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
52677
+ return date2.getTime();
52678
+ }
52679
+ let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
52680
+ let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone);
52681
+ let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone);
52682
+ let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
52683
+ if (valid.length === 1) return valid[0];
52684
+ if (valid.length > 1) switch (disambiguation) {
52685
+ // 'compatible' means 'earlier' for "fall back" transitions
52686
+ case "compatible":
52687
+ case "earlier":
52688
+ return valid[0];
52689
+ case "later":
52690
+ return valid[valid.length - 1];
52691
+ case "reject":
52692
+ throw new RangeError("Multiple possible absolute times found");
52693
+ }
52694
+ switch (disambiguation) {
52695
+ case "earlier":
52696
+ return Math.min(ms - offsetBefore, ms - offsetAfter);
52697
+ // 'compatible' means 'later' for "spring forward" transitions
52698
+ case "compatible":
52699
+ case "later":
52700
+ return Math.max(ms - offsetBefore, ms - offsetAfter);
52701
+ case "reject":
52702
+ throw new RangeError("No such absolute time found");
52703
+ }
52704
+ }
52705
+ function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
52706
+ return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
52707
+ }
52708
+ function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
52709
+ let hour = 0, minute = 0, second = 0, millisecond = 0;
52710
+ if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
52711
+ else if ("hour" in date && !time) return date;
52712
+ if (time) ({ hour, minute, second, millisecond } = time);
52713
+ return new ($2aaf608024c21ca1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
52714
+ }
52715
+ function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
52716
+ if (($ad063034c8620db8$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
52717
+ let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
52718
+ let copy = date.copy();
52719
+ copy.calendar = calendar;
52720
+ copy.era = calendarDate.era;
52721
+ copy.year = calendarDate.year;
52722
+ copy.month = calendarDate.month;
52723
+ copy.day = calendarDate.day;
52724
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(copy);
52725
+ return copy;
52726
+ }
52727
+ function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) {
52728
+ let mutableDate = date.copy();
52729
+ let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0;
52730
+ $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0);
52731
+ if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
52732
+ mutableDate.month += duration.months || 0;
52733
+ $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate);
52734
+ $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate);
52735
+ mutableDate.day += (duration.weeks || 0) * 7;
52736
+ mutableDate.day += duration.days || 0;
52737
+ mutableDate.day += days;
52738
+ $435a2ceaa8778ed8$var$balanceDay(mutableDate);
52739
+ if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
52740
+ if (mutableDate.year < 1) {
52741
+ mutableDate.year = 1;
52742
+ mutableDate.month = 1;
52743
+ mutableDate.day = 1;
52744
+ }
52745
+ let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
52746
+ if (mutableDate.year > maxYear) {
52747
+ let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);
52748
+ mutableDate.year = maxYear;
52749
+ mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
52750
+ mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
52751
+ }
52752
+ if (mutableDate.month < 1) {
52753
+ mutableDate.month = 1;
52754
+ mutableDate.day = 1;
52755
+ }
52756
+ let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
52757
+ if (mutableDate.month > maxMonth) {
52758
+ mutableDate.month = maxMonth;
52759
+ mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
52760
+ }
52761
+ mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
52762
+ return mutableDate;
52763
+ }
52764
+ function $435a2ceaa8778ed8$var$addYears(date, years) {
52765
+ if (date.calendar.isInverseEra?.(date)) years = -years;
52766
+ date.year += years;
52767
+ }
52768
+ function $435a2ceaa8778ed8$var$balanceYearMonth(date) {
52769
+ while (date.month < 1) {
52770
+ $435a2ceaa8778ed8$var$addYears(date, -1);
52771
+ date.month += date.calendar.getMonthsInYear(date);
52772
+ }
52773
+ let monthsInYear = 0;
52774
+ while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
52775
+ date.month -= monthsInYear;
52776
+ $435a2ceaa8778ed8$var$addYears(date, 1);
52777
+ }
52778
+ }
52779
+ function $435a2ceaa8778ed8$var$balanceDay(date) {
52780
+ while (date.day < 1) {
52781
+ date.month--;
52782
+ $435a2ceaa8778ed8$var$balanceYearMonth(date);
52783
+ date.day += date.calendar.getDaysInMonth(date);
52784
+ }
52785
+ while (date.day > date.calendar.getDaysInMonth(date)) {
52786
+ date.day -= date.calendar.getDaysInMonth(date);
52787
+ date.month++;
52788
+ $435a2ceaa8778ed8$var$balanceYearMonth(date);
52789
+ }
52790
+ }
52791
+ function $435a2ceaa8778ed8$var$constrainMonthDay(date) {
52792
+ date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
52793
+ date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
52794
+ }
52795
+ function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) {
52796
+ if (date.calendar.constrainDate) date.calendar.constrainDate(date);
52797
+ date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
52798
+ $435a2ceaa8778ed8$var$constrainMonthDay(date);
52799
+ }
52800
+ function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) {
52801
+ let inverseDuration = {};
52802
+ for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
52803
+ return inverseDuration;
52804
+ }
52805
+ function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) {
52806
+ return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
52807
+ }
52808
+ function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) {
52809
+ let mutableDate = date.copy();
52810
+ if (fields.era != null) mutableDate.era = fields.era;
52811
+ if (fields.year != null) mutableDate.year = fields.year;
52812
+ if (fields.month != null) mutableDate.month = fields.month;
52813
+ if (fields.day != null) mutableDate.day = fields.day;
52814
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate);
52815
+ return mutableDate;
52816
+ }
52817
+ function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) {
52818
+ let mutableValue = value.copy();
52819
+ if (fields.hour != null) mutableValue.hour = fields.hour;
52820
+ if (fields.minute != null) mutableValue.minute = fields.minute;
52821
+ if (fields.second != null) mutableValue.second = fields.second;
52822
+ if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
52823
+ $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue);
52824
+ return mutableValue;
52825
+ }
52826
+ function $435a2ceaa8778ed8$var$balanceTime(time) {
52827
+ time.second += Math.floor(time.millisecond / 1e3);
52828
+ time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3);
52829
+ time.minute += Math.floor(time.second / 60);
52830
+ time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60);
52831
+ time.hour += Math.floor(time.minute / 60);
52832
+ time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60);
52833
+ let days = Math.floor(time.hour / 24);
52834
+ time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24);
52835
+ return days;
52836
+ }
52837
+ function $435a2ceaa8778ed8$export$7555de1e070510cb(time) {
52838
+ time.millisecond = Math.max(0, Math.min(time.millisecond, 999));
52839
+ time.second = Math.max(0, Math.min(time.second, 59));
52840
+ time.minute = Math.max(0, Math.min(time.minute, 59));
52841
+ time.hour = Math.max(0, Math.min(time.hour, 23));
52842
+ }
52843
+ function $435a2ceaa8778ed8$var$nonNegativeMod(a2, b) {
52844
+ let result2 = a2 % b;
52845
+ if (result2 < 0) result2 += b;
52846
+ return result2;
52847
+ }
52848
+ function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
52849
+ time.hour += duration.hours || 0;
52850
+ time.minute += duration.minutes || 0;
52851
+ time.second += duration.seconds || 0;
52852
+ time.millisecond += duration.milliseconds || 0;
52853
+ return $435a2ceaa8778ed8$var$balanceTime(time);
52854
+ }
52855
+ function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
52856
+ let res = time.copy();
52857
+ $435a2ceaa8778ed8$var$addTimeFields(res, duration);
52858
+ return res;
52859
+ }
52860
+ function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
52861
+ return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
52862
+ }
52863
+ function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
52864
+ let mutable = value.copy();
52865
+ switch (field) {
52866
+ case "era": {
52867
+ let eras = value.calendar.getEras();
52868
+ let eraIndex = eras.indexOf(value.era);
52869
+ if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
52870
+ eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);
52871
+ mutable.era = eras[eraIndex];
52872
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
52873
+ break;
52874
+ }
52875
+ case "year":
52876
+ if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;
52877
+ mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options?.round);
52878
+ if (mutable.year === -Infinity) mutable.year = 1;
52879
+ if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
52880
+ break;
52881
+ case "month":
52882
+ mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);
52883
+ break;
52884
+ case "day":
52885
+ mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);
52886
+ break;
52887
+ default:
52888
+ throw new Error("Unsupported field " + field);
52889
+ }
52890
+ if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
52891
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
52892
+ return mutable;
52893
+ }
52894
+ function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) {
52895
+ let mutable = value.copy();
52896
+ switch (field) {
52897
+ case "hour": {
52898
+ let hours = value.hour;
52899
+ let min4 = 0;
52900
+ let max4 = 23;
52901
+ if (options?.hourCycle === 12) {
52902
+ let isPM = hours >= 12;
52903
+ min4 = isPM ? 12 : 0;
52904
+ max4 = isPM ? 23 : 11;
52809
52905
  }
52906
+ mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min4, max4, options?.round);
52907
+ break;
52908
+ }
52909
+ case "minute":
52910
+ mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options?.round);
52911
+ break;
52912
+ case "second":
52913
+ mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options?.round);
52810
52914
  break;
52915
+ case "millisecond":
52916
+ mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options?.round);
52917
+ break;
52918
+ default:
52919
+ throw new Error("Unsupported field " + field);
52920
+ }
52921
+ return mutable;
52922
+ }
52923
+ function $435a2ceaa8778ed8$var$cycleValue(value, amount, min4, max4, round = false) {
52924
+ if (round) {
52925
+ value += Math.sign(amount);
52926
+ if (value < min4) value = max4;
52927
+ let div = Math.abs(amount);
52928
+ if (amount > 0) value = Math.ceil(value / div) * div;
52929
+ else value = Math.floor(value / div) * div;
52930
+ if (value > max4) value = min4;
52931
+ } else {
52932
+ value += amount;
52933
+ if (value < min4) value = max4 - (min4 - value - 1);
52934
+ else if (value > max4) value = min4 + (value - max4 - 1);
52935
+ }
52936
+ return value;
52937
+ }
52938
+
52939
+ // ../../node_modules/@internationalized/date/dist/private/string.mjs
52940
+ var $58246871e4652552$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
52941
+ var $58246871e4652552$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
52942
+ var $58246871e4652552$var$ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
52943
+ function $58246871e4652552$export$c9698ec7f05a07e1(value) {
52944
+ let m = value.match($58246871e4652552$var$TIME_RE);
52945
+ if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
52946
+ return new ($2aaf608024c21ca1$export$680ea196effce5f)($58246871e4652552$var$parseNumber(m[1], 0, 23), m[2] ? $58246871e4652552$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $58246871e4652552$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $58246871e4652552$var$parseNumber(m[4], 0, Infinity) * 1e3 : 0);
52947
+ }
52948
+ function $58246871e4652552$export$6b862160d295c8e(value) {
52949
+ let m = value.match($58246871e4652552$var$DATE_RE);
52950
+ if (!m) {
52951
+ if ($58246871e4652552$var$ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
52952
+ throw new Error("Invalid ISO 8601 date string: " + value);
52953
+ }
52954
+ let date = new ($2aaf608024c21ca1$export$99faa760c7908e4f)($58246871e4652552$var$parseNumber(m[1], 0, 9999), $58246871e4652552$var$parseNumber(m[2], 1, 12), 1);
52955
+ date.day = $58246871e4652552$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
52956
+ return date;
52957
+ }
52958
+ function $58246871e4652552$var$parseNumber(value, min4, max4) {
52959
+ let val = Number(value);
52960
+ if (val < min4 || val > max4) throw new RangeError(`Value out of range: ${min4} <= ${val} <= ${max4}`);
52961
+ return val;
52962
+ }
52963
+ function $58246871e4652552$export$f59dee82248f5ad4(time) {
52964
+ return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
52965
+ }
52966
+ function $58246871e4652552$export$60dfd74aa96791bd(date) {
52967
+ let gregorianDate = ($d07e34cce18680fd$export$b4a036af3fc0b032)(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
52968
+ let year;
52969
+ if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
52970
+ else year = String(gregorianDate.year).padStart(4, "0");
52971
+ return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
52972
+ }
52973
+ function $58246871e4652552$export$4223de14708adc63(date) {
52974
+ return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`;
52975
+ }
52976
+
52977
+ // ../../node_modules/@internationalized/date/dist/private/CalendarDate.mjs
52978
+ function $2aaf608024c21ca1$var$shiftArgs(args) {
52979
+ let calendar = typeof args[0] === "object" ? args.shift() : new ($93635573935797de$export$80ee6245ec4f29ec)();
52980
+ let era;
52981
+ if (typeof args[0] === "string") era = args.shift();
52982
+ else {
52983
+ let eras = calendar.getEras();
52984
+ era = eras[eras.length - 1];
52985
+ }
52986
+ let year = args.shift();
52987
+ let month = args.shift();
52988
+ let day = args.shift();
52989
+ return [
52990
+ calendar,
52991
+ era,
52992
+ year,
52993
+ month,
52994
+ day
52995
+ ];
52996
+ }
52997
+ var _type;
52998
+ var _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f {
52999
+ constructor(...args) {
53000
+ // This prevents TypeScript from allowing other types with the same fields to match.
53001
+ // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
53002
+ // If that behavior is desired, use the AnyCalendarDate interface instead.
53003
+ // @ts-ignore
53004
+ __privateAdd(this, _type);
53005
+ let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
53006
+ this.calendar = calendar;
53007
+ this.era = era;
53008
+ this.year = year;
53009
+ this.month = month;
53010
+ this.day = day;
53011
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
53012
+ }
53013
+ /** Returns a copy of this date. */
53014
+ copy() {
53015
+ if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
53016
+ else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
53017
+ }
53018
+ /** Returns a new `CalendarDate` with the given duration added to it. */
53019
+ add(duration) {
53020
+ return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
53021
+ }
53022
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */
53023
+ subtract(duration) {
53024
+ return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
53025
+ }
53026
+ /**
53027
+ * Returns a new `CalendarDate` with the given fields set to the provided values. Other fields
53028
+ * will be constrained accordingly.
53029
+ */
53030
+ set(fields) {
53031
+ return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(this, fields);
53032
+ }
53033
+ /**
53034
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
53035
+ * When the resulting value reaches the limits of the field, it wraps around.
53036
+ */
53037
+ cycle(field, amount, options) {
53038
+ return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
53039
+ }
53040
+ /**
53041
+ * Converts the date to a native JavaScript Date object, with the time set to midnight in the
53042
+ * given time zone.
53043
+ */
53044
+ toDate(timeZone) {
53045
+ return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone);
53046
+ }
53047
+ /** Converts the date to an ISO 8601 formatted string. */
53048
+ toString() {
53049
+ return ($58246871e4652552$export$60dfd74aa96791bd)(this);
53050
+ }
53051
+ /**
53052
+ * Compares this date with another. A negative result indicates that this date is before the given
53053
+ * one, and a positive date indicates that it is after.
53054
+ */
53055
+ compare(b) {
53056
+ return ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
53057
+ }
53058
+ };
53059
+ _type = new WeakMap();
53060
+ var $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f;
53061
+ var _type2;
53062
+ var _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f {
53063
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
53064
+ // This prevents TypeScript from allowing other types with the same fields to match.
53065
+ // @ts-ignore
53066
+ __privateAdd(this, _type2);
53067
+ this.hour = hour;
53068
+ this.minute = minute;
53069
+ this.second = second;
53070
+ this.millisecond = millisecond;
53071
+ ($435a2ceaa8778ed8$export$7555de1e070510cb)(this);
53072
+ }
53073
+ /** Returns a copy of this time. */
53074
+ copy() {
53075
+ return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
53076
+ }
53077
+ /** Returns a new `Time` with the given duration added to it. */
53078
+ add(duration) {
53079
+ return ($435a2ceaa8778ed8$export$7ed87b6bc2506470)(this, duration);
53080
+ }
53081
+ /** Returns a new `Time` with the given duration subtracted from it. */
53082
+ subtract(duration) {
53083
+ return ($435a2ceaa8778ed8$export$fe34d3a381cd7501)(this, duration);
53084
+ }
53085
+ /**
53086
+ * Returns a new `Time` with the given fields set to the provided values. Other fields will be
53087
+ * constrained accordingly.
53088
+ */
53089
+ set(fields) {
53090
+ return ($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields);
53091
+ }
53092
+ /**
53093
+ * Returns a new `Time` with the given field adjusted by a specified amount.
53094
+ * When the resulting value reaches the limits of the field, it wraps around.
53095
+ */
53096
+ cycle(field, amount, options) {
53097
+ return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
53098
+ }
53099
+ /** Converts the time to an ISO 8601 formatted string. */
53100
+ toString() {
53101
+ return ($58246871e4652552$export$f59dee82248f5ad4)(this);
53102
+ }
53103
+ /**
53104
+ * Compares this time with another. A negative result indicates that this time is before the given
53105
+ * one, and a positive time indicates that it is after.
53106
+ */
53107
+ compare(b) {
53108
+ return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, b);
53109
+ }
53110
+ };
53111
+ _type2 = new WeakMap();
53112
+ var $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f;
53113
+ var _type3;
53114
+ var _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f {
53115
+ constructor(...args) {
53116
+ // This prevents TypeScript from allowing other types with the same fields to match.
53117
+ // @ts-ignore
53118
+ __privateAdd(this, _type3);
53119
+ let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
53120
+ this.calendar = calendar;
53121
+ this.era = era;
53122
+ this.year = year;
53123
+ this.month = month;
53124
+ this.day = day;
53125
+ this.hour = args.shift() || 0;
53126
+ this.minute = args.shift() || 0;
53127
+ this.second = args.shift() || 0;
53128
+ this.millisecond = args.shift() || 0;
53129
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
52811
53130
  }
52812
- return result2;
52813
- };
52814
- var stopLinkEventPropagation = (event) => {
52815
- if (event.target instanceof Element && event.target.closest("a")) {
52816
- event.stopPropagation();
53131
+ /** Returns a copy of this date. */
53132
+ copy() {
53133
+ if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
53134
+ else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
52817
53135
  }
52818
- };
52819
- var LINK_EVENT_HANDLERS = {
52820
- onPointerDown: stopLinkEventPropagation,
52821
- onMouseDown: stopLinkEventPropagation,
52822
- onClick: stopLinkEventPropagation
52823
- };
52824
- var RichTextLabel = ({ className, requiredClassName, theme, children, ...internal }) => {
52825
- const { requiredIndicatorHidden = false, leadingElement } = internal;
52826
- const fieldProps = useFieldPropsV2();
52827
- const { label, required = false, disabled = false, requiredIndicatorType = types$1.RequiredIndicator.ASTERISK, requiredIndicatorPlacement = types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE } = fieldProps;
52828
- const { t } = useTranslation2();
52829
- const { language } = useConfig();
52830
- const labelWithIndicator = React178.useMemo(() => {
52831
- if (!required || requiredIndicatorHidden || !label) {
52832
- return label;
53136
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */
53137
+ add(duration) {
53138
+ return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
53139
+ }
53140
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
53141
+ subtract(duration) {
53142
+ return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
53143
+ }
53144
+ /**
53145
+ * Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields
53146
+ * will be constrained accordingly.
53147
+ */
53148
+ set(fields) {
53149
+ return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields), fields);
53150
+ }
53151
+ /**
53152
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
53153
+ * When the resulting value reaches the limits of the field, it wraps around.
53154
+ */
53155
+ cycle(field, amount, options) {
53156
+ switch (field) {
53157
+ case "era":
53158
+ case "year":
53159
+ case "month":
53160
+ case "day":
53161
+ return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
53162
+ default:
53163
+ return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
52833
53164
  }
52834
- const indicatorNode = createIndicatorNode(requiredIndicatorType, t, requiredClassName);
52835
- return injectRequiredIndicator(label, requiredIndicatorPlacement, indicatorNode);
52836
- }, [
52837
- required,
52838
- requiredIndicatorHidden,
52839
- label,
52840
- requiredIndicatorType,
52841
- requiredIndicatorPlacement,
52842
- t,
52843
- requiredClassName
52844
- ]);
52845
- return /* @__PURE__ */ React178__default.default.createElement("div", {
52846
- className,
52847
- ...disabled ? {} : LINK_EVENT_HANDLERS
52848
- }, leadingElement, children({
52849
- content: labelWithIndicator,
52850
- locale: language,
52851
- htmlAttributesPlugin
52852
- }));
52853
- };
52854
- var SelectionIndicator = ({ className, ...internal }) => {
52855
- const state = internal;
52856
- return /* @__PURE__ */ React178__default.default.createElement("div", {
52857
- "aria-hidden": "true",
52858
- className: typeof className === "function" ? className(state) : className
52859
- });
52860
- };
52861
-
52862
- // ../form-fields/dist/esm/ui/checkbox-field/checkbox-field-headless.js
52863
- var Checkbox = ({ children }) => {
52864
- const { id: id6, FieldLayout } = useFieldPropsV2();
52865
- const checkboxElement = findChildOfType(children, Checkbox.Checkbox);
52866
- const descriptionElement = findChildOfType(children, Checkbox.Description);
52867
- const errorElement = findChildOfType(children, Checkbox.Error);
52868
- return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
52869
- fieldId: id6,
52870
- renderLabel: () => null,
52871
- renderInput: () => checkboxElement,
52872
- renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
52873
- });
52874
- };
52875
- var CheckboxContainer = ({ children, className }) => {
52876
- const { id: id6, value, onChange, disabled, required, readOnly, onBlur, onFocus, hasError } = useFieldPropsV2();
52877
- const { inputId, ariaDescribedBy } = useFieldAttributes();
52878
- const ref = React178.useRef(null);
52879
- useFocusFieldEvent(() => {
52880
- ref.current?.focus({
52881
- preventScroll: true
52882
- });
52883
- }, id6);
52884
- useKeepPrehydrationValue(ref);
52885
- const labelElement = findChildOfType(children, CheckboxContainer.RichTextLabel);
52886
- const inputElement = findChildOfType(children, CheckboxContainer.Input);
52887
- const handleChange = React178.useCallback((isSelected) => {
52888
- onChange(isSelected);
52889
- }, [
52890
- onChange
52891
- ]);
52892
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
52893
- id: inputId,
52894
- "aria-describedby": ariaDescribedBy,
52895
- isSelected: Boolean(value),
52896
- onChange: handleChange,
52897
- isDisabled: disabled,
52898
- isReadOnly: readOnly,
52899
- isRequired: required,
52900
- isInvalid: hasError,
52901
- onBlur,
52902
- onFocus
52903
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
52904
- ref,
52905
- className
52906
- }, ({ isSelected, isHovered, isFocused }) => {
52907
- const input = applyInternalProps(inputElement, {
52908
- isSelected,
52909
- isHovered,
52910
- isFocused
52911
- });
52912
- return labelElement ? applyInternalProps(labelElement, {
52913
- leadingElement: input
52914
- }) : input;
52915
- }));
53165
+ }
53166
+ /** Converts the date to a native JavaScript Date object in the given time zone. */
53167
+ toDate(timeZone, disambiguation) {
53168
+ return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone, disambiguation);
53169
+ }
53170
+ /** Converts the date to an ISO 8601 formatted string. */
53171
+ toString() {
53172
+ return ($58246871e4652552$export$4223de14708adc63)(this);
53173
+ }
53174
+ /**
53175
+ * Compares this date with another. A negative result indicates that this date is before the given
53176
+ * one, and a positive date indicates that it is after.
53177
+ */
53178
+ compare(b) {
53179
+ let res = ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
53180
+ if (res === 0) return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, ($d07e34cce18680fd$export$b21e0b124e224484)(b));
53181
+ return res;
53182
+ }
52916
53183
  };
52917
- CheckboxContainer.RichTextLabel = RichTextLabel;
52918
- CheckboxContainer.Input = SelectionIndicator;
52919
- Checkbox.Checkbox = CheckboxContainer;
52920
- Checkbox.Description = Description;
52921
- Checkbox.Error = Error2;
53184
+ _type3 = new WeakMap();
53185
+ var $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f;
52922
53186
 
52923
- // ../../node_modules/ts-debounce/dist/src/index.esm.js
52924
- function r(r3, e, n) {
52925
- var i, t, o;
52926
- void 0 === n && (n = {});
52927
- var a2 = null != (i = n.isImmediate) && i, u = null != (t = n.callback) && t, c = n.maxWait, v = Date.now(), l = [];
52928
- function f() {
52929
- if (void 0 !== c) {
52930
- var r4 = Date.now() - v;
52931
- if (r4 + e >= c) return c - r4;
53187
+ // ../form-fields/dist/esm/date-localization/get-first-day-of-the-week.js
53188
+ var DEFAULT_FIRST_DAY = 1;
53189
+ function getFirstDayOfTheWeek(locale) {
53190
+ try {
53191
+ const intlLocale = new Intl.Locale(locale);
53192
+ if (typeof intlLocale.getWeekInfo === "function") {
53193
+ const firstDay = intlLocale.getWeekInfo().firstDay;
53194
+ if (firstDay !== void 0) {
53195
+ return firstDay === 7 ? 0 : firstDay;
53196
+ }
52932
53197
  }
52933
- return e;
53198
+ return getFirstDayManual(locale);
53199
+ } catch {
53200
+ return getFirstDayManual(locale);
52934
53201
  }
52935
- var d = function() {
52936
- var e2 = [].slice.call(arguments), n2 = this;
52937
- return new Promise(function(i2, t2) {
52938
- var c2 = a2 && void 0 === o;
52939
- if (void 0 !== o && clearTimeout(o), o = setTimeout(function() {
52940
- if (o = void 0, v = Date.now(), !a2) {
52941
- var i3 = r3.apply(n2, e2);
52942
- u && u(i3), l.forEach(function(r4) {
52943
- return (0, r4.resolve)(i3);
52944
- }), l = [];
52945
- }
52946
- }, f()), c2) {
52947
- var d2 = r3.apply(n2, e2);
52948
- return u && u(d2), i2(d2);
53202
+ }
53203
+ var REGIONS_STARTING_SATURDAY = [
53204
+ "AF",
53205
+ "BH",
53206
+ "DJ",
53207
+ "DZ",
53208
+ "EG",
53209
+ "IQ",
53210
+ "IR",
53211
+ "JO",
53212
+ "KW",
53213
+ "LY",
53214
+ "OM",
53215
+ "QA",
53216
+ "SD",
53217
+ "SY"
53218
+ ];
53219
+ var REGIONS_STARTING_SUNDAY = [
53220
+ "AG",
53221
+ "AS",
53222
+ "BD",
53223
+ "BR",
53224
+ "BS",
53225
+ "BT",
53226
+ "BW",
53227
+ "BZ",
53228
+ "CA",
53229
+ "CO",
53230
+ "DM",
53231
+ "DO",
53232
+ "ET",
53233
+ "GT",
53234
+ "GU",
53235
+ "HK",
53236
+ "HN",
53237
+ "ID",
53238
+ "IL",
53239
+ "IN",
53240
+ "IS",
53241
+ "JM",
53242
+ "JP",
53243
+ "KE",
53244
+ "KH",
53245
+ "KR",
53246
+ "LA",
53247
+ "MH",
53248
+ "MM",
53249
+ "MO",
53250
+ "MT",
53251
+ "MX",
53252
+ "MZ",
53253
+ "NI",
53254
+ "NP",
53255
+ "PA",
53256
+ "PE",
53257
+ "PH",
53258
+ "PK",
53259
+ "PR",
53260
+ "PT",
53261
+ "PY",
53262
+ "SA",
53263
+ "SG",
53264
+ "SV",
53265
+ "TH",
53266
+ "TT",
53267
+ "TW",
53268
+ "UM",
53269
+ "US",
53270
+ "VE",
53271
+ "VI",
53272
+ "WS",
53273
+ "YE",
53274
+ "ZA",
53275
+ "ZW"
53276
+ ];
53277
+ var LANGUAGES_STARTING_SATURDAY = [
53278
+ "ar"
53279
+ ];
53280
+ var LANGUAGES_STARTING_SUNDAY = [
53281
+ "en",
53282
+ "he",
53283
+ "hi",
53284
+ "id",
53285
+ "ja",
53286
+ "ko",
53287
+ "pt",
53288
+ "tl",
53289
+ "th"
53290
+ ];
53291
+ function getFirstDayManual(locale) {
53292
+ try {
53293
+ const intlLocale = new Intl.Locale(locale);
53294
+ const language = intlLocale.language?.toLowerCase();
53295
+ const region = intlLocale.region?.toUpperCase();
53296
+ if (region) {
53297
+ if (REGIONS_STARTING_SUNDAY.includes(region)) {
53298
+ return 0;
52949
53299
  }
52950
- l.push({ resolve: i2, reject: t2 });
52951
- });
52952
- };
52953
- return d.cancel = function(r4) {
52954
- void 0 !== o && clearTimeout(o), l.forEach(function(e2) {
52955
- return (0, e2.reject)(r4);
52956
- }), l = [];
52957
- }, d;
53300
+ if (REGIONS_STARTING_SATURDAY.includes(region)) {
53301
+ return 6;
53302
+ }
53303
+ return DEFAULT_FIRST_DAY;
53304
+ }
53305
+ if (language) {
53306
+ if (LANGUAGES_STARTING_SUNDAY.includes(language)) {
53307
+ return 0;
53308
+ }
53309
+ if (LANGUAGES_STARTING_SATURDAY.includes(language)) {
53310
+ return 6;
53311
+ }
53312
+ }
53313
+ return DEFAULT_FIRST_DAY;
53314
+ } catch {
53315
+ return DEFAULT_FIRST_DAY;
53316
+ }
52958
53317
  }
52959
53318
 
52960
- // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
52961
- var OTHER_ID = "Other";
52962
- var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
52963
- var getIsOtherOptionSelected = (value, optionsNames) => value.length > 0 && getValueIncludesOther(value, optionsNames);
52964
- var getOtherLabel = (addOtherLabel, t) => {
52965
- const otherLabelDefault = t?.("add-other.default-other-option-label");
52966
- return addOtherLabel || otherLabelDefault || OTHER_ID;
52967
- };
52968
- var getOtherValue = (value, addOtherLabel) => {
52969
- const addedSymbolsLength = 2;
52970
- const otherLabelLength = addOtherLabel ? addOtherLabel.length + addedSymbolsLength : 0;
52971
- const otherItem = value.find((item) => item.startsWith(`${addOtherLabel}: `)) || "";
52972
- return otherItem.slice(otherLabelLength);
52973
- };
52974
- var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
52975
-
52976
- // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
52977
- var CheckboxGroup = ({ children, className }) => {
52978
- const props2 = useFieldPropsV2();
52979
- const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
52980
- const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
52981
- const groupRef = React178.useRef(null);
52982
- useKeepPrehydrationValue(groupRef);
52983
- const labelElement = findChildOfType(children, CheckboxGroup.Label);
52984
- const optionsElement = findChildOfType(children, CheckboxGroup.Options);
52985
- const descriptionElement = findChildOfType(children, CheckboxGroup.Description);
52986
- const errorElement = findChildOfType(children, CheckboxGroup.Error);
52987
- const _value = React178.useMemo(() => value || [], [
52988
- value
52989
- ]);
52990
- const handleChange = React178.useCallback((newValue) => {
52991
- onChange?.(newValue);
52992
- }, [
52993
- onChange
52994
- ]);
52995
- return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
52996
- fieldId: id6,
52997
- renderLabel: () => labelElement,
52998
- renderInput: () => /* @__PURE__ */ React178__default.default.createElement(FieldsetHeadless, {
52999
- id: inputId,
53000
- ariaLabelledBy: labelId,
53001
- ariaDescribedBy,
53002
- required,
53003
- onBlur,
53004
- onFocus
53005
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxGroup, {
53006
- ref: groupRef,
53007
- className,
53008
- "aria-labelledby": labelId,
53009
- value: _value,
53010
- onChange: handleChange,
53011
- isDisabled: disabled,
53012
- isRequired: required,
53013
- isInvalid: hasError
53014
- }, optionsElement)),
53015
- renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
53016
- });
53319
+ // ../form-fields/dist/esm/ui/shared/headless-styles.js
53320
+ var VISUALLY_HIDDEN_STYLE = {
53321
+ position: "absolute",
53322
+ width: 1,
53323
+ height: 1,
53324
+ margin: -1,
53325
+ padding: 0,
53326
+ border: 0,
53327
+ clipPath: "inset(50%)",
53328
+ overflow: "hidden",
53329
+ whiteSpace: "nowrap"
53017
53330
  };
53018
- var Options = ({ children, className }) => {
53019
- const props2 = useFieldPropsV2();
53020
- const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
53021
- const { t } = useTranslation2();
53022
- const optionElement = findChildOfType(children, Options.Option);
53023
- const otherLabel = getOtherLabel(addOtherLabel, t);
53024
- return /* @__PURE__ */ React178__default.default.createElement("div", {
53025
- className,
53026
- "data-columns": numberOfColumns
53027
- }, options?.map((option2, index2) => {
53028
- const checkboxValue = option2.value ?? option2.label;
53029
- return applyInternalProps(optionElement, {
53030
- key: option2.id || option2.label,
53031
- value: checkboxValue,
53032
- label: option2.label,
53033
- isFirst: index2 === 0,
53034
- fieldId: id6
53035
- });
53036
- }), addOther && applyInternalProps(optionElement, {
53037
- key: OTHER_ID,
53038
- value: OTHER_ID,
53039
- label: otherLabel,
53040
- isOther: true
53041
- }));
53331
+ var FIELDSET_RESET_STYLE = {
53332
+ border: "none",
53333
+ padding: 0,
53334
+ margin: 0,
53335
+ minWidth: 0
53042
53336
  };
53043
- var OptionLabel = ({ className, ...internal }) => {
53044
- const { label } = internal;
53045
- return /* @__PURE__ */ React178__default.default.createElement("span", {
53046
- className
53047
- }, label);
53337
+ var AppointmentSlotPickerContext = React178.createContext(void 0);
53338
+ var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
53339
+ var getDateTitleId = (inputId) => `${inputId}-date-title`;
53340
+ var useAppointmentSlotPickerContext = () => {
53341
+ const context = React178.useContext(AppointmentSlotPickerContext);
53342
+ if (typeof context === "undefined") {
53343
+ throw new Error("Appointment parts must be used inside an <Appointment> component");
53344
+ }
53345
+ return context;
53048
53346
  };
53049
- var Checkbox2 = ({ children, className, ...internal }) => {
53050
- const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53051
- const props2 = useFieldPropsV2();
53052
- const { value: fieldValue, onChange, disabled, readOnly, hasError, options } = props2;
53053
- const checkboxRef = React178.useRef(null);
53054
- useFocusFieldEvent(() => {
53055
- if (isFirst) {
53056
- checkboxRef.current?.focus({
53057
- preventScroll: true
53058
- });
53059
- }
53060
- }, fieldId);
53061
- const labelElement = findChildOfType(children, Checkbox2.Label);
53062
- const inputElement = findChildOfType(children, Checkbox2.Input);
53063
- const _value = React178.useMemo(() => fieldValue || [], [
53064
- fieldValue
53065
- ]);
53066
- const actualValue = React178.useMemo(() => {
53067
- if (isOther) {
53068
- return _value.find((val) => val === label || val.startsWith(`${label}: `)) || label;
53069
- }
53070
- return value;
53071
- }, [
53072
- isOther,
53073
- _value,
53074
- label,
53075
- value
53076
- ]);
53077
- const handleOtherCheckboxChange = React178.useCallback((isSelected) => {
53078
- if (!isOther) {
53079
- return;
53080
- }
53081
- const optionsValues = getOptionsValues(options || []);
53082
- const removedOther = _value.filter((val) => optionsValues.includes(val));
53083
- const newValue = isSelected ? [
53084
- ...removedOther,
53085
- label
53086
- ] : removedOther;
53087
- onChange?.(newValue);
53088
- }, [
53089
- isOther,
53090
- label,
53091
- onChange,
53092
- options,
53093
- _value
53094
- ]);
53095
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
53096
- value: actualValue,
53097
- onChange: isOther ? handleOtherCheckboxChange : void 0,
53098
- isDisabled: disabled,
53099
- isReadOnly: readOnly,
53100
- isInvalid: hasError
53101
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
53102
- ref: checkboxRef,
53103
- className,
53104
- "data-hook": `checkbox-${label}`
53105
- }, ({ isSelected, isHovered, isFocused }) => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(inputElement, {
53106
- isSelected,
53107
- isHovered,
53108
- isFocused
53109
- }), applyInternalProps(labelElement, {
53110
- label
53111
- }))));
53347
+
53348
+ // ../form-fields/dist/esm/ui/appointment-field/appointment-headless/appointment-dates-headless.js
53349
+ var useIsLocked = () => {
53350
+ const { disabled, readOnly } = useFieldPropsV2();
53351
+ return !!disabled || !!readOnly;
53112
53352
  };
53113
- Checkbox2.Label = OptionLabel;
53114
- Checkbox2.Input = SelectionIndicator;
53115
- var Option = ({ children, ...internal }) => {
53116
- const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53117
- const props2 = useFieldPropsV2();
53118
- const { value: fieldValue, onChange, options, addOtherPlaceholder, otherInputCharacterLimit, disabled, readOnly, hasError } = props2;
53119
- const checkboxElement = findChildOfType(children, Checkbox2);
53120
- const otherInputElement = findChildOfType(children, OtherInput);
53121
- const _value = React178.useMemo(() => fieldValue || [], [
53122
- fieldValue
53353
+ var Dates = ({ children, className }) => {
53354
+ const { days, selectDate, weekRangeLabel } = useAppointmentSlotPickerContext();
53355
+ const previousWeekElement = findChildOfType(children, Dates.PreviousWeek);
53356
+ const headingElement = findChildOfType(children, Dates.Heading);
53357
+ const nextWeekElement = findChildOfType(children, Dates.NextWeek);
53358
+ const dayElement = findChildOfType(children, Dates.Day) ?? /* @__PURE__ */ React178__default.default.createElement(Dates.Day, null);
53359
+ const selectedKeys = React178.useMemo(() => days.filter((day) => day.isSelected).map((day) => day.key), [
53360
+ days
53123
53361
  ]);
53124
- const isOtherSelected = React178.useMemo(() => {
53125
- if (!isOther) {
53126
- return false;
53127
- }
53128
- const optionsValues = getOptionsValues(options || []);
53129
- return getIsOtherOptionSelected(_value, optionsValues);
53130
- }, [
53131
- isOther,
53132
- _value,
53133
- options
53362
+ const isLocked = useIsLocked();
53363
+ const disabledKeys = React178.useMemo(() => days.filter((day) => isLocked || day.isDisabled).map((day) => day.key), [
53364
+ days,
53365
+ isLocked
53134
53366
  ]);
53135
- return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(checkboxElement, {
53136
- value,
53137
- label,
53138
- isFirst,
53139
- isOther,
53140
- fieldId
53141
- }), isOther && isOtherSelected && applyInternalProps(otherInputElement, {
53142
- fieldValue: _value,
53143
- onChange,
53144
- label,
53145
- placeholder: addOtherPlaceholder,
53146
- maxLength: otherInputCharacterLimit,
53147
- disabled,
53148
- readOnly,
53149
- hasError,
53150
- ariaLabel: label,
53151
- addOtherLabel: label,
53152
- options
53153
- }));
53367
+ const handleSelectionChange = (keys3) => {
53368
+ if (keys3 === "all") {
53369
+ return;
53370
+ }
53371
+ const [selectedKey] = [
53372
+ ...keys3
53373
+ ];
53374
+ const day = days.find(({ key }) => key === selectedKey);
53375
+ if (day) {
53376
+ selectDate(day.date);
53377
+ }
53378
+ };
53379
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53380
+ className
53381
+ }, previousWeekElement, headingElement, nextWeekElement, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBox, {
53382
+ "aria-label": weekRangeLabel,
53383
+ orientation: "horizontal",
53384
+ selectionMode: "single",
53385
+ selectedKeys,
53386
+ disabledKeys,
53387
+ onSelectionChange: handleSelectionChange
53388
+ }, days.map((day) => applyInternalProps(dayElement, {
53389
+ key: day.key,
53390
+ day
53391
+ }))));
53154
53392
  };
53155
- var OtherInput = ({ className, inputClassName, ...internal }) => {
53156
- const { fieldValue, onChange, label, placeholder, maxLength, disabled, readOnly, hasError, ariaLabel, addOtherLabel, options } = internal;
53157
- const [otherValue, setOtherValue] = React178.useState(() => {
53158
- const optionsValues = getOptionsValues(options || []);
53159
- const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53160
- return isSelected ? getOtherValue(fieldValue, addOtherLabel) : "";
53161
- });
53393
+ var PreviousWeek = ({ children, className }) => {
53394
+ const { changeWeek, canGoToPreviousWeek, previousWeekLabel, nextWeekLabel } = useAppointmentSlotPickerContext();
53395
+ const isLocked = useIsLocked();
53396
+ const buttonRef = React178.useRef(null);
53397
+ const wasPressedRef = React178.useRef(false);
53162
53398
  React178.useEffect(() => {
53163
- const optionsValues = getOptionsValues(options || []);
53164
- const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53165
- setOtherValue(isSelected ? getOtherValue(fieldValue, addOtherLabel) : "");
53166
- }, [
53167
- fieldValue,
53168
- options,
53169
- addOtherLabel
53170
- ]);
53171
- const debouncedHandleChange = React178.useMemo(() => {
53172
- return r((input) => {
53173
- const optionsValues = getOptionsValues(options || []);
53174
- const removedOther = fieldValue.filter((val) => optionsValues.includes(val));
53175
- const _otherValue = input ? `${addOtherLabel}: ${input}` : label;
53176
- const newValue = [
53177
- ...removedOther,
53178
- _otherValue
53179
- ];
53180
- onChange(newValue);
53181
- }, 500);
53182
- }, [
53183
- onChange,
53184
- options,
53185
- fieldValue,
53186
- addOtherLabel,
53187
- label
53188
- ]);
53189
- const handleInputChange = React178.useCallback((input) => {
53190
- setOtherValue(input);
53191
- debouncedHandleChange(input);
53399
+ if (canGoToPreviousWeek || !wasPressedRef.current) {
53400
+ return;
53401
+ }
53402
+ wasPressedRef.current = false;
53403
+ const activeElement = document.activeElement;
53404
+ if (activeElement !== document.body && activeElement !== buttonRef.current) {
53405
+ return;
53406
+ }
53407
+ const buttons = buttonRef.current?.closest("fieldset")?.querySelectorAll("button") ?? [];
53408
+ Array.from(buttons).find((button) => button.getAttribute("aria-label") === nextWeekLabel)?.focus();
53192
53409
  }, [
53193
- debouncedHandleChange
53410
+ canGoToPreviousWeek,
53411
+ nextWeekLabel
53194
53412
  ]);
53195
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.TextField, {
53196
- "aria-label": ariaLabel,
53197
- value: otherValue,
53198
- onChange: handleInputChange,
53199
- isDisabled: disabled,
53200
- isReadOnly: readOnly,
53201
- isInvalid: hasError,
53202
- className
53203
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Input, {
53204
- className: inputClassName,
53205
- placeholder,
53206
- maxLength,
53207
- "aria-label": ariaLabel
53208
- }));
53209
- };
53210
- CheckboxGroup.Label = Label;
53211
- CheckboxGroup.Options = Options;
53212
- Options.Option = Option;
53213
- Option.Checkbox = Checkbox2;
53214
- Option.OtherInput = OtherInput;
53215
- CheckboxGroup.Description = Description;
53216
- CheckboxGroup.Error = Error2;
53217
-
53218
- // ../../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
53219
- function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
53220
- if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
53221
- preventScroll: true
53222
- });
53223
- else {
53224
- let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
53225
- element.focus();
53226
- $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
53227
- }
53228
- }
53229
- var $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
53230
- function $1969ac565cfec8d0$var$supportsPreventScroll() {
53231
- if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
53232
- $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
53233
- try {
53234
- let focusElem = document.createElement("div");
53235
- focusElem.focus({
53236
- get preventScroll() {
53237
- $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
53238
- return true;
53239
- }
53240
- });
53241
- } catch {
53413
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
53414
+ ref: buttonRef,
53415
+ className,
53416
+ "aria-label": previousWeekLabel,
53417
+ isDisabled: !canGoToPreviousWeek || isLocked,
53418
+ onPress: () => {
53419
+ wasPressedRef.current = true;
53420
+ changeWeek(-1);
53242
53421
  }
53243
- }
53244
- return $1969ac565cfec8d0$var$supportsPreventScrollCached;
53245
- }
53246
- function $1969ac565cfec8d0$var$getScrollableElements(element) {
53247
- let parent = element.parentNode;
53248
- let scrollableElements = [];
53249
- let rootScrollingElement = document.scrollingElement || document.documentElement;
53250
- while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
53251
- if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
53252
- element: parent,
53253
- scrollTop: parent.scrollTop,
53254
- scrollLeft: parent.scrollLeft
53255
- });
53256
- parent = parent.parentNode;
53257
- }
53258
- if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
53259
- element: rootScrollingElement,
53260
- scrollTop: rootScrollingElement.scrollTop,
53261
- scrollLeft: rootScrollingElement.scrollLeft
53262
- });
53263
- return scrollableElements;
53264
- }
53265
- function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
53266
- for (let { element, scrollTop, scrollLeft } of scrollableElements) {
53267
- element.scrollTop = scrollTop;
53268
- element.scrollLeft = scrollLeft;
53269
- }
53270
- }
53271
-
53272
- // ../../node_modules/react-aria/dist/private/utils/domHelpers.mjs
53273
- var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
53274
- if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
53275
- if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
53276
- return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
53422
+ }, children ?? "\u2039");
53277
53423
  };
53278
- var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
53279
- let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
53280
- return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
53424
+ var NextWeek = ({ children, className }) => {
53425
+ const { changeWeek, nextWeekLabel } = useAppointmentSlotPickerContext();
53426
+ const isLocked = useIsLocked();
53427
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
53428
+ className,
53429
+ "aria-label": nextWeekLabel,
53430
+ isDisabled: isLocked,
53431
+ onPress: () => changeWeek(1)
53432
+ }, children ?? "\u203A");
53281
53433
  };
53282
- function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
53283
- return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
53284
- }
53285
- function $d447af545b77c9f1$var$isWindow(value) {
53286
- return typeof value === "object" && value != null && "window" in value && value.window === value;
53287
- }
53288
- function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
53289
- return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
53290
- }
53291
- function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
53292
- return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
53293
- }
53294
-
53295
- // ../../node_modules/react-stately/dist/private/flags/flags.mjs
53296
- var $6a20a7989e6c817a$var$_shadowDOM = false;
53297
- function $6a20a7989e6c817a$export$98658e8c59125e6a() {
53298
- return $6a20a7989e6c817a$var$_shadowDOM;
53299
- }
53300
-
53301
- // ../../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
53302
- function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
53303
- if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
53304
- if (!node || !otherNode) return false;
53305
- let currentNode = otherNode;
53306
- while (currentNode !== null) {
53307
- if (currentNode === node) return true;
53308
- if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
53309
- currentNode = currentNode.assignedSlot.parentNode;
53310
- else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
53311
- currentNode = currentNode.host;
53312
- else currentNode = currentNode.parentNode;
53313
- }
53314
- return false;
53315
- }
53316
- var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
53317
- if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
53318
- let activeElement = doc.activeElement;
53319
- while (activeElement && "shadowRoot" in activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
53320
- return activeElement;
53434
+ var Heading2 = ({ children, className }) => {
53435
+ const { weekCaptionLabel, weekRangeLabel } = useAppointmentSlotPickerContext();
53436
+ return /* @__PURE__ */ React178__default.default.createElement("span", {
53437
+ className,
53438
+ "aria-live": "polite"
53439
+ }, children ? children({
53440
+ label: weekCaptionLabel,
53441
+ weekRange: weekRangeLabel
53442
+ }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", {
53443
+ "aria-hidden": "true"
53444
+ }, weekCaptionLabel), /* @__PURE__ */ React178__default.default.createElement("span", {
53445
+ style: VISUALLY_HIDDEN_STYLE
53446
+ }, weekRangeLabel)));
53321
53447
  };
53322
- function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
53323
- if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
53324
- if ("composedPath" in event) return event.composedPath()[0] ?? null;
53325
- else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
53326
- }
53327
- return event.target;
53328
- }
53329
- var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React178__default.default).useLayoutEffect : () => {
53448
+ var Day = ({ children, className, ...internal }) => {
53449
+ const { day } = internal;
53450
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBoxItem, {
53451
+ id: day.key,
53452
+ className,
53453
+ textValue: day.label,
53454
+ "aria-label": day.isAvailable ? `${day.label}, ${day.availabilityLabel}` : day.label,
53455
+ "data-available": day.isAvailable || void 0,
53456
+ "data-today": day.isToday || void 0
53457
+ }, children ? children({
53458
+ ...day,
53459
+ date: new Date(day.date)
53460
+ }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", null, day.weekdayLabel), /* @__PURE__ */ React178__default.default.createElement("span", null, day.dayOfMonthLabel)));
53330
53461
  };
53331
- function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
53332
- let event = nativeEvent;
53333
- event.nativeEvent = nativeEvent;
53334
- event.isDefaultPrevented = () => event.defaultPrevented;
53335
- event.isPropagationStopped = () => event.cancelBubble;
53336
- event.persist = () => {
53462
+ Dates.PreviousWeek = PreviousWeek;
53463
+ Dates.Heading = Heading2;
53464
+ Dates.NextWeek = NextWeek;
53465
+ Dates.Day = Day;
53466
+ var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
53467
+ var Slots = ({ children, className, ...internal }) => {
53468
+ const { hasTimezoneNote, hasDateTitle } = internal;
53469
+ const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
53470
+ const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
53471
+ const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
53472
+ const groupRef = React178.useRef(null);
53473
+ const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React178__default.default.createElement(Slots.Slot, null);
53474
+ const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
53475
+ const describedBy = [
53476
+ ariaDescribedBy,
53477
+ hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
53478
+ ].filter(Boolean).join(" ") || void 0;
53479
+ const focusSlotAt = (index2, options) => {
53480
+ groupRef.current?.querySelectorAll(RADIO_INPUT_SELECTOR)?.[index2]?.focus(options);
53337
53481
  };
53338
- return event;
53339
- }
53340
- function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
53341
- Object.defineProperty(event, "target", {
53342
- value: target
53343
- });
53344
- Object.defineProperty(event, "currentTarget", {
53345
- value: target
53346
- });
53347
- }
53348
- function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
53349
- let stateRef = (React178.useRef)({
53350
- isFocused: false,
53351
- observer: null
53352
- });
53353
- ($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
53354
- const state = stateRef.current;
53355
- return () => {
53356
- if (state.observer) {
53357
- state.observer.disconnect();
53358
- state.observer = null;
53359
- }
53360
- };
53361
- }, []);
53362
- return (React178.useCallback)((e) => {
53363
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53364
- if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
53365
- stateRef.current.isFocused = true;
53366
- let target = eventTarget;
53367
- let onBlurHandler = (e2) => {
53368
- stateRef.current.isFocused = false;
53369
- if (target.disabled) {
53370
- let event = $a92dc41f639950be$export$525bc4921d56d4a(e2);
53371
- onBlur?.(event);
53372
- }
53373
- if (stateRef.current.observer) {
53374
- stateRef.current.observer.disconnect();
53375
- stateRef.current.observer = null;
53376
- }
53377
- };
53378
- target.addEventListener("focusout", onBlurHandler, {
53379
- once: true
53380
- });
53381
- stateRef.current.observer = new MutationObserver(() => {
53382
- if (stateRef.current.isFocused && target.disabled) {
53383
- stateRef.current.observer?.disconnect();
53384
- let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
53385
- target.dispatchEvent(new FocusEvent("blur", {
53386
- relatedTarget: relatedTargetEl
53387
- }));
53388
- target.dispatchEvent(new FocusEvent("focusout", {
53389
- bubbles: true,
53390
- relatedTarget: relatedTargetEl
53391
- }));
53392
- }
53393
- });
53394
- stateRef.current.observer.observe(target, {
53395
- attributes: true,
53396
- attributeFilter: [
53397
- "disabled"
53398
- ]
53482
+ useFocusFieldEvent(() => {
53483
+ const hasSlots = !!groupRef.current?.querySelector(RADIO_INPUT_SELECTOR);
53484
+ if (hasSlots) {
53485
+ focusSlotAt(0, {
53486
+ preventScroll: true
53399
53487
  });
53488
+ return;
53400
53489
  }
53490
+ const options = Array.from(document.getElementById(inputId)?.querySelectorAll('[role="option"]') ?? []);
53491
+ const fallback = options.find((option2) => option2.getAttribute("aria-selected") === "true") ?? options.find((option2) => option2.getAttribute("aria-disabled") !== "true");
53492
+ fallback?.focus({
53493
+ preventScroll: true
53494
+ });
53495
+ }, fieldId);
53496
+ React178.useEffect(() => {
53497
+ if (pendingFocusIndex === void 0) {
53498
+ return;
53499
+ }
53500
+ focusSlotAt(pendingFocusIndex);
53501
+ consumePendingFocusIndex();
53401
53502
  }, [
53402
- onBlur
53503
+ pendingFocusIndex,
53504
+ slots.length
53403
53505
  ]);
53404
- }
53405
-
53406
- // ../../node_modules/react-aria/dist/private/utils/platform.mjs
53407
- function $2add3ce32c6007eb$var$testUserAgent(re) {
53408
- if (typeof window === "undefined" || window.navigator == null) return false;
53409
- let brands = window.navigator["userAgentData"]?.brands;
53410
- return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
53411
- }
53412
- function $2add3ce32c6007eb$var$testPlatform(re) {
53413
- return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
53414
- }
53415
- function $2add3ce32c6007eb$var$cached(fn) {
53416
- let res = null;
53417
- return () => {
53418
- if (res == null) res = fn();
53419
- return res;
53420
- };
53421
- }
53422
- var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
53423
- return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
53424
- });
53425
- var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
53426
- return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
53427
- });
53428
- var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
53429
- return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
53430
- $2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
53431
- });
53432
- var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
53433
- return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
53434
- });
53435
- var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
53436
- return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
53437
- });
53438
- var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
53439
- return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
53440
- });
53441
- var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
53442
- return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
53443
- });
53444
- var $2add3ce32c6007eb$export$b7d78993b74f766d = $2add3ce32c6007eb$var$cached(function() {
53445
- return $2add3ce32c6007eb$var$testUserAgent(/(Firefox|FxiOS)/i);
53446
- });
53447
-
53448
- // ../../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
53449
- function $b5c62b033c25b96d$export$60278871457622de(event) {
53450
- if (event.pointerType === "" && event.isTrusted) return true;
53451
- if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
53452
- return event.detail === 0 && !event.pointerType;
53453
- }
53454
- function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
53455
- let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
53456
- if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith("key") && target.target === "_blank") {
53457
- if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
53458
- else ctrlKey = true;
53459
- }
53460
- let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
53461
- keyIdentifier: "Enter",
53462
- metaKey,
53463
- ctrlKey,
53464
- altKey,
53465
- shiftKey
53466
- }) : new MouseEvent("click", {
53467
- metaKey,
53468
- ctrlKey,
53469
- altKey,
53470
- shiftKey,
53471
- detail: 1,
53472
- bubbles: true,
53473
- cancelable: true
53474
- });
53475
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
53476
- ($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
53477
- target.dispatchEvent(event);
53478
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
53479
- }
53480
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
53481
- var $8f5a2122b0992be3$var$currentModality = null;
53482
- var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
53483
- var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
53484
- var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53485
- var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
53486
- var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
53487
- Tab: true,
53488
- Escape: true
53506
+ return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("div", {
53507
+ role: "status",
53508
+ style: VISUALLY_HIDDEN_STYLE
53509
+ }, slots.length > 0 ? selectedDateLabel : void 0), /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioGroup, {
53510
+ ref: groupRef,
53511
+ className,
53512
+ value: selectedSlotKey ?? null,
53513
+ onChange: selectSlot,
53514
+ isDisabled: disabled,
53515
+ isReadOnly: readOnly,
53516
+ isRequired: required,
53517
+ isInvalid: hasError,
53518
+ "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
53519
+ "aria-describedby": describedBy,
53520
+ "data-refetch": isReloadingSlots || void 0
53521
+ }, slots.map((slot) => applyInternalProps(slotElement, {
53522
+ key: slot.key,
53523
+ slot
53524
+ }))));
53525
+ };
53526
+ var Slot = ({ children, className, ...internal }) => {
53527
+ const { slot } = internal;
53528
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioField, {
53529
+ value: slot.key,
53530
+ "aria-label": slot.timeRange
53531
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioButton, {
53532
+ className
53533
+ }, children ? children(slot) : slot.timeRange));
53489
53534
  };
53490
- function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e) {
53491
- for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e);
53492
- }
53493
- function $8f5a2122b0992be3$var$isValidKey(e) {
53494
- return !(e.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
53495
- }
53496
- function $8f5a2122b0992be3$var$handleKeyboardEvent(e) {
53497
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53498
- if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e)) {
53499
- $8f5a2122b0992be3$var$currentModality = "keyboard";
53500
- $8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e);
53501
- }
53502
- }
53503
- function $8f5a2122b0992be3$var$handlePointerEvent(e) {
53504
- $8f5a2122b0992be3$var$currentModality = "pointer";
53505
- "pointerType" in e ? e.pointerType : "mouse";
53506
- if (e.type === "mousedown" || e.type === "pointerdown") {
53507
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53508
- $8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e);
53509
- }
53510
- }
53511
- function $8f5a2122b0992be3$var$handleClickEvent(e) {
53512
- if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e)) {
53513
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53514
- $8f5a2122b0992be3$var$currentModality = "virtual";
53535
+ Slots.Slot = Slot;
53536
+ var import_cloneDeep = __toESM(require_cloneDeep());
53537
+ var createIndicatorNode = (requiredIndicatorType, t, className) => {
53538
+ const indicator = requiredIndicatorType === types$1.RequiredIndicator.TEXT ? t("settings.required-indicator-text") : "*";
53539
+ const str = (v) => ({
53540
+ stringValue: v
53541
+ });
53542
+ const fields = {
53543
+ "aria-hidden": str("true")
53544
+ };
53545
+ if (className) {
53546
+ fields.className = str(className);
53515
53547
  }
53516
- }
53517
- function $8f5a2122b0992be3$var$handleFocusEvent(e) {
53518
- let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53519
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
53520
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
53521
- if (target === ownerWindow) {
53522
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
53523
- return;
53548
+ return {
53549
+ type: Node_Type.EXTERNAL,
53550
+ id: "",
53551
+ nodes: [],
53552
+ externalData: {
53553
+ fields
53554
+ },
53555
+ textData: {
53556
+ text: indicator,
53557
+ decorations: []
53558
+ }
53559
+ };
53560
+ };
53561
+ var injectRequiredIndicator = (label, placement, indicatorNode) => {
53562
+ const result2 = (0, import_cloneDeep.default)(label);
53563
+ switch (placement) {
53564
+ case types$1.RequiredIndicatorPlacement.BEFORE_FIELD_TITLE:
53565
+ const firstNode = result2?.nodes.find(Boolean);
53566
+ if (firstNode) {
53567
+ firstNode.nodes ?? (firstNode.nodes = []);
53568
+ firstNode.nodes.unshift(indicatorNode);
53569
+ }
53570
+ break;
53571
+ case types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE:
53572
+ const lastNode = result2?.nodes?.findLast(Boolean);
53573
+ if (lastNode) {
53574
+ lastNode.nodes ?? (lastNode.nodes = []);
53575
+ lastNode.nodes.push(indicatorNode);
53576
+ }
53577
+ break;
53524
53578
  }
53525
- if (target === ownerDocument || !e.isTrusted) return;
53526
- if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
53527
- $8f5a2122b0992be3$var$currentModality = "virtual";
53528
- $8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e);
53579
+ return result2;
53580
+ };
53581
+ var stopLinkEventPropagation = (event) => {
53582
+ if (event.target instanceof Element && event.target.closest("a")) {
53583
+ event.stopPropagation();
53529
53584
  }
53530
- $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53531
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
53532
- }
53533
- function $8f5a2122b0992be3$var$handleWindowBlur() {
53534
- $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53535
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
53536
- }
53537
- function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
53538
- if (typeof window === "undefined" || typeof document === "undefined") return;
53539
- const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
53540
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53541
- if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
53542
- let focus = windowObject.HTMLElement.prototype.focus;
53543
- Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
53544
- configurable: true,
53545
- writable: true,
53546
- value: function() {
53547
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53548
- focus.apply(this, arguments);
53585
+ };
53586
+ var LINK_EVENT_HANDLERS = {
53587
+ onPointerDown: stopLinkEventPropagation,
53588
+ onMouseDown: stopLinkEventPropagation,
53589
+ onClick: stopLinkEventPropagation
53590
+ };
53591
+ var RichTextLabel = ({ className, requiredClassName, theme, children, ...internal }) => {
53592
+ const { requiredIndicatorHidden = false, leadingElement } = internal;
53593
+ const fieldProps = useFieldPropsV2();
53594
+ const { label, required = false, disabled = false, requiredIndicatorType = types$1.RequiredIndicator.ASTERISK, requiredIndicatorPlacement = types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE } = fieldProps;
53595
+ const { t } = useTranslation2();
53596
+ const { language } = useConfig();
53597
+ const labelWithIndicator = React178.useMemo(() => {
53598
+ if (!required || requiredIndicatorHidden || !label) {
53599
+ return label;
53549
53600
  }
53601
+ const indicatorNode = createIndicatorNode(requiredIndicatorType, t, requiredClassName);
53602
+ return injectRequiredIndicator(label, requiredIndicatorPlacement, indicatorNode);
53603
+ }, [
53604
+ required,
53605
+ requiredIndicatorHidden,
53606
+ label,
53607
+ requiredIndicatorType,
53608
+ requiredIndicatorPlacement,
53609
+ t,
53610
+ requiredClassName
53611
+ ]);
53612
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53613
+ className,
53614
+ ...disabled ? {} : LINK_EVENT_HANDLERS
53615
+ }, leadingElement, children({
53616
+ content: labelWithIndicator,
53617
+ locale: language,
53618
+ htmlAttributesPlugin
53619
+ }));
53620
+ };
53621
+ var SelectionIndicator = ({ className, ...internal }) => {
53622
+ const state = internal;
53623
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53624
+ "aria-hidden": "true",
53625
+ className: typeof className === "function" ? className(state) : className
53550
53626
  });
53551
- documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53552
- documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53553
- documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
53554
- windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
53555
- windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
53556
- if (typeof PointerEvent !== "undefined") {
53557
- documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
53558
- documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
53559
- documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
53560
- }
53561
- windowObject.addEventListener("beforeunload", () => {
53562
- $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
53563
- }, {
53564
- once: true
53565
- });
53566
- $8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
53567
- focus
53568
- });
53569
- }
53570
- var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
53571
- const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
53572
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53573
- if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
53574
- if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
53575
- Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
53576
- configurable: true,
53577
- writable: true,
53578
- value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
53627
+ };
53628
+
53629
+ // ../form-fields/dist/esm/ui/checkbox-field/checkbox-field-headless.js
53630
+ var Checkbox = ({ children }) => {
53631
+ const { id: id6, FieldLayout } = useFieldPropsV2();
53632
+ const checkboxElement = findChildOfType(children, Checkbox.Checkbox);
53633
+ const descriptionElement = findChildOfType(children, Checkbox.Description);
53634
+ const errorElement = findChildOfType(children, Checkbox.Error);
53635
+ return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
53636
+ fieldId: id6,
53637
+ renderLabel: () => null,
53638
+ renderInput: () => checkboxElement,
53639
+ renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
53579
53640
  });
53580
- documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53581
- documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53582
- documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
53583
- windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
53584
- windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
53585
- if (typeof PointerEvent !== "undefined") {
53586
- documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
53587
- documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
53588
- documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
53589
- }
53590
- $8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
53591
53641
  };
53592
- function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
53593
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53594
- let loadListener;
53595
- if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
53596
- else {
53597
- loadListener = () => {
53598
- $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
53599
- };
53600
- documentObject.addEventListener("DOMContentLoaded", loadListener);
53601
- }
53602
- return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
53603
- }
53604
- if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
53605
- function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
53606
- return $8f5a2122b0992be3$var$currentModality !== "pointer";
53607
- }
53608
- var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
53609
- "checkbox",
53610
- "radio",
53611
- "range",
53612
- "color",
53613
- "file",
53614
- "image",
53615
- "button",
53616
- "submit",
53617
- "reset"
53618
- ]);
53619
- function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e) {
53620
- let eventTarget = e ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) : void 0;
53621
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
53622
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
53623
- const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
53624
- const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
53625
- const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
53626
- const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
53627
- let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
53628
- isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
53629
- return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
53630
- }
53631
- function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
53632
- $8f5a2122b0992be3$var$setupGlobalFocusEvents();
53633
- (React178.useEffect)(() => {
53634
- if (opts?.enabled === false) return;
53635
- let handler = (modality, e) => {
53636
- if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) return;
53637
- fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
53638
- };
53639
- $8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
53640
- return () => {
53641
- $8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
53642
- };
53643
- }, deps);
53644
- }
53642
+ var CheckboxContainer = ({ children, className }) => {
53643
+ const { id: id6, value, onChange, disabled, required, readOnly, onBlur, onFocus, hasError } = useFieldPropsV2();
53644
+ const { inputId, ariaDescribedBy } = useFieldAttributes();
53645
+ const ref = React178.useRef(null);
53646
+ useFocusFieldEvent(() => {
53647
+ ref.current?.focus({
53648
+ preventScroll: true
53649
+ });
53650
+ }, id6);
53651
+ useKeepPrehydrationValue(ref);
53652
+ const labelElement = findChildOfType(children, CheckboxContainer.RichTextLabel);
53653
+ const inputElement = findChildOfType(children, CheckboxContainer.Input);
53654
+ const handleChange = React178.useCallback((isSelected) => {
53655
+ onChange(isSelected);
53656
+ }, [
53657
+ onChange
53658
+ ]);
53659
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
53660
+ id: inputId,
53661
+ "aria-describedby": ariaDescribedBy,
53662
+ isSelected: Boolean(value),
53663
+ onChange: handleChange,
53664
+ isDisabled: disabled,
53665
+ isReadOnly: readOnly,
53666
+ isRequired: required,
53667
+ isInvalid: hasError,
53668
+ onBlur,
53669
+ onFocus
53670
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
53671
+ ref,
53672
+ className
53673
+ }, ({ isSelected, isHovered, isFocused }) => {
53674
+ const input = applyInternalProps(inputElement, {
53675
+ isSelected,
53676
+ isHovered,
53677
+ isFocused
53678
+ });
53679
+ return labelElement ? applyInternalProps(labelElement, {
53680
+ leadingElement: input
53681
+ }) : input;
53682
+ }));
53683
+ };
53684
+ CheckboxContainer.RichTextLabel = RichTextLabel;
53685
+ CheckboxContainer.Input = SelectionIndicator;
53686
+ Checkbox.Checkbox = CheckboxContainer;
53687
+ Checkbox.Description = Description;
53688
+ Checkbox.Error = Error2;
53645
53689
 
53646
- // ../../node_modules/react-aria/dist/private/utils/chain.mjs
53647
- function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
53648
- return (...args) => {
53649
- for (let callback of callbacks) if (typeof callback === "function") callback(...args);
53650
- };
53651
- }
53652
- var $390e54f620492c70$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
53653
- if (typeof FinalizationRegistry !== "undefined") new FinalizationRegistry((heldValue) => {
53654
- $390e54f620492c70$export$d41a04c74483c6ef.delete(heldValue);
53655
- });
53656
- function $390e54f620492c70$export$cd8c9cb68f842629(idA, idB) {
53657
- if (idA === idB) return idA;
53658
- let setIdsA = $390e54f620492c70$export$d41a04c74483c6ef.get(idA);
53659
- if (setIdsA) {
53660
- setIdsA.forEach((ref) => ref.current = idB);
53661
- return idB;
53662
- }
53663
- let setIdsB = $390e54f620492c70$export$d41a04c74483c6ef.get(idB);
53664
- if (setIdsB) {
53665
- setIdsB.forEach((ref) => ref.current = idA);
53666
- return idA;
53690
+ // ../../node_modules/ts-debounce/dist/src/index.esm.js
53691
+ function r(r3, e, n) {
53692
+ var i, t, o;
53693
+ void 0 === n && (n = {});
53694
+ var a2 = null != (i = n.isImmediate) && i, u = null != (t = n.callback) && t, c = n.maxWait, v = Date.now(), l = [];
53695
+ function f() {
53696
+ if (void 0 !== c) {
53697
+ var r4 = Date.now() - v;
53698
+ if (r4 + e >= c) return c - r4;
53699
+ }
53700
+ return e;
53667
53701
  }
53668
- return idB;
53669
- }
53670
-
53671
- // ../../node_modules/react-aria/dist/private/utils/mergeRefs.mjs
53672
- function $4064df0d6f9620e1$export$c9058316764c140e(...refs) {
53673
- if (refs.length === 1 && refs[0]) return refs[0];
53674
- return (value) => {
53675
- let hasCleanup = false;
53676
- const cleanups = refs.map((ref) => {
53677
- const cleanup = $4064df0d6f9620e1$var$setRef(ref, value);
53678
- hasCleanup || (hasCleanup = typeof cleanup == "function");
53679
- return cleanup;
53702
+ var d = function() {
53703
+ var e2 = [].slice.call(arguments), n2 = this;
53704
+ return new Promise(function(i2, t2) {
53705
+ var c2 = a2 && void 0 === o;
53706
+ if (void 0 !== o && clearTimeout(o), o = setTimeout(function() {
53707
+ if (o = void 0, v = Date.now(), !a2) {
53708
+ var i3 = r3.apply(n2, e2);
53709
+ u && u(i3), l.forEach(function(r4) {
53710
+ return (0, r4.resolve)(i3);
53711
+ }), l = [];
53712
+ }
53713
+ }, f()), c2) {
53714
+ var d2 = r3.apply(n2, e2);
53715
+ return u && u(d2), i2(d2);
53716
+ }
53717
+ l.push({ resolve: i2, reject: t2 });
53680
53718
  });
53681
- if (hasCleanup) return () => {
53682
- cleanups.forEach((cleanup, i) => {
53683
- if (typeof cleanup === "function") cleanup();
53684
- else $4064df0d6f9620e1$var$setRef(refs[i], null);
53685
- });
53686
- };
53687
53719
  };
53688
- }
53689
- function $4064df0d6f9620e1$var$setRef(ref, value) {
53690
- if (typeof ref === "function") return ref(value);
53691
- else if (ref != null) ref.current = value;
53720
+ return d.cancel = function(r4) {
53721
+ void 0 !== o && clearTimeout(o), l.forEach(function(e2) {
53722
+ return (0, e2.reject)(r4);
53723
+ }), l = [];
53724
+ }, d;
53692
53725
  }
53693
53726
 
53694
- // ../../node_modules/clsx/dist/clsx.mjs
53695
- function r2(e) {
53696
- var t, f, n = "";
53697
- if ("string" == typeof e || "number" == typeof e) n += e;
53698
- else if ("object" == typeof e) if (Array.isArray(e)) {
53699
- var o = e.length;
53700
- for (t = 0; t < o; t++) e[t] && (f = r2(e[t])) && (n && (n += " "), n += f);
53701
- } else for (f in e) e[f] && (n && (n += " "), n += f);
53702
- return n;
53703
- }
53704
- function clsx() {
53705
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r2(e)) && (n && (n += " "), n += t);
53706
- return n;
53707
- }
53708
- var clsx_default = clsx;
53727
+ // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
53728
+ var OTHER_ID = "Other";
53729
+ var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
53730
+ var getIsOtherOptionSelected = (value, optionsNames) => value.length > 0 && getValueIncludesOther(value, optionsNames);
53731
+ var getOtherLabel = (addOtherLabel, t) => {
53732
+ const otherLabelDefault = t?.("add-other.default-other-option-label");
53733
+ return addOtherLabel || otherLabelDefault || OTHER_ID;
53734
+ };
53735
+ var getOtherValue = (value, addOtherLabel) => {
53736
+ const addedSymbolsLength = 2;
53737
+ const otherLabelLength = addOtherLabel ? addOtherLabel.length + addedSymbolsLength : 0;
53738
+ const otherItem = value.find((item) => item.startsWith(`${addOtherLabel}: `)) || "";
53739
+ return otherItem.slice(otherLabelLength);
53740
+ };
53741
+ var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
53709
53742
 
53710
- // ../../node_modules/react-aria/dist/private/utils/mergeProps.mjs
53711
- function $bbaa08b3cd72f041$export$9d1611c77c2fe928(...args) {
53712
- let result2 = {
53713
- ...args[0]
53714
- };
53715
- for (let i = 1; i < args.length; i++) {
53716
- let props2 = args[i];
53717
- for (let key in props2) {
53718
- let a2 = result2[key];
53719
- let b = props2[key];
53720
- if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
53721
- key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
53722
- 65 && key.charCodeAt(2) <= /* 'Z' */
53723
- 90) result2[key] = ($a4e76a5424781910$export$e08e3b67e392101e)(a2, b);
53724
- else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string") result2[key] = (clsx_default)(a2, b);
53725
- else if (key === "id" && a2 && b) result2.id = ($390e54f620492c70$export$cd8c9cb68f842629)(a2, b);
53726
- else if (key === "ref" && a2 && b) result2.ref = ($4064df0d6f9620e1$export$c9058316764c140e)(a2, b);
53727
- else result2[key] = b !== void 0 ? b : a2;
53743
+ // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
53744
+ var CheckboxGroup = ({ children, className }) => {
53745
+ const props2 = useFieldPropsV2();
53746
+ const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
53747
+ const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
53748
+ const groupRef = React178.useRef(null);
53749
+ useKeepPrehydrationValue(groupRef);
53750
+ const labelElement = findChildOfType(children, CheckboxGroup.Label);
53751
+ const optionsElement = findChildOfType(children, CheckboxGroup.Options);
53752
+ const descriptionElement = findChildOfType(children, CheckboxGroup.Description);
53753
+ const errorElement = findChildOfType(children, CheckboxGroup.Error);
53754
+ const _value = React178.useMemo(() => value || [], [
53755
+ value
53756
+ ]);
53757
+ const handleChange = React178.useCallback((newValue) => {
53758
+ onChange?.(newValue);
53759
+ }, [
53760
+ onChange
53761
+ ]);
53762
+ return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
53763
+ fieldId: id6,
53764
+ renderLabel: () => labelElement,
53765
+ renderInput: () => /* @__PURE__ */ React178__default.default.createElement(FieldsetHeadless, {
53766
+ id: inputId,
53767
+ ariaLabelledBy: labelId,
53768
+ ariaDescribedBy,
53769
+ required,
53770
+ onBlur,
53771
+ onFocus
53772
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxGroup, {
53773
+ ref: groupRef,
53774
+ className,
53775
+ "aria-labelledby": labelId,
53776
+ value: _value,
53777
+ onChange: handleChange,
53778
+ isDisabled: disabled,
53779
+ isRequired: required,
53780
+ isInvalid: hasError
53781
+ }, optionsElement)),
53782
+ renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
53783
+ });
53784
+ };
53785
+ var Options = ({ children, className }) => {
53786
+ const props2 = useFieldPropsV2();
53787
+ const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
53788
+ const { t } = useTranslation2();
53789
+ const optionElement = findChildOfType(children, Options.Option);
53790
+ const otherLabel = getOtherLabel(addOtherLabel, t);
53791
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53792
+ className,
53793
+ "data-columns": numberOfColumns
53794
+ }, options?.map((option2, index2) => {
53795
+ const checkboxValue = option2.value ?? option2.label;
53796
+ return applyInternalProps(optionElement, {
53797
+ key: option2.id || option2.label,
53798
+ value: checkboxValue,
53799
+ label: option2.label,
53800
+ isFirst: index2 === 0,
53801
+ fieldId: id6
53802
+ });
53803
+ }), addOther && applyInternalProps(optionElement, {
53804
+ key: OTHER_ID,
53805
+ value: OTHER_ID,
53806
+ label: otherLabel,
53807
+ isOther: true
53808
+ }));
53809
+ };
53810
+ var OptionLabel = ({ className, ...internal }) => {
53811
+ const { label } = internal;
53812
+ return /* @__PURE__ */ React178__default.default.createElement("span", {
53813
+ className
53814
+ }, label);
53815
+ };
53816
+ var Checkbox2 = ({ children, className, ...internal }) => {
53817
+ const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53818
+ const props2 = useFieldPropsV2();
53819
+ const { value: fieldValue, onChange, disabled, readOnly, hasError, options } = props2;
53820
+ const checkboxRef = React178.useRef(null);
53821
+ useFocusFieldEvent(() => {
53822
+ if (isFirst) {
53823
+ checkboxRef.current?.focus({
53824
+ preventScroll: true
53825
+ });
53728
53826
  }
53729
- }
53730
- return result2;
53731
- }
53732
- function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props2) {
53733
- let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props2;
53734
- const onBlur = (React178.useCallback)((e) => {
53735
- if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
53736
- if (onBlurProp) onBlurProp(e);
53737
- if (onFocusChange) onFocusChange(false);
53738
- return true;
53827
+ }, fieldId);
53828
+ const labelElement = findChildOfType(children, Checkbox2.Label);
53829
+ const inputElement = findChildOfType(children, Checkbox2.Input);
53830
+ const _value = React178.useMemo(() => fieldValue || [], [
53831
+ fieldValue
53832
+ ]);
53833
+ const actualValue = React178.useMemo(() => {
53834
+ if (isOther) {
53835
+ return _value.find((val) => val === label || val.startsWith(`${label}: `)) || label;
53739
53836
  }
53837
+ return value;
53740
53838
  }, [
53741
- onBlurProp,
53742
- onFocusChange
53839
+ isOther,
53840
+ _value,
53841
+ label,
53842
+ value
53743
53843
  ]);
53744
- const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
53745
- const onFocus = (React178.useCallback)((e) => {
53746
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53747
- const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
53748
- const activeElement = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
53749
- if (eventTarget === e.currentTarget && eventTarget === activeElement) {
53750
- if (onFocusProp) onFocusProp(e);
53751
- if (onFocusChange) onFocusChange(true);
53752
- onSyntheticFocus(e);
53844
+ const handleOtherCheckboxChange = React178.useCallback((isSelected) => {
53845
+ if (!isOther) {
53846
+ return;
53753
53847
  }
53848
+ const optionsValues = getOptionsValues(options || []);
53849
+ const removedOther = _value.filter((val) => optionsValues.includes(val));
53850
+ const newValue = isSelected ? [
53851
+ ...removedOther,
53852
+ label
53853
+ ] : removedOther;
53854
+ onChange?.(newValue);
53754
53855
  }, [
53755
- onFocusChange,
53756
- onFocusProp,
53757
- onSyntheticFocus
53856
+ isOther,
53857
+ label,
53858
+ onChange,
53859
+ options,
53860
+ _value
53758
53861
  ]);
53759
- return {
53760
- focusProps: {
53761
- onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
53762
- onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
53763
- }
53764
- };
53765
- }
53766
- function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
53767
- const objRef = (React178.useRef)(null);
53768
- const cleanupRef = (React178.useRef)(void 0);
53769
- const refEffect = (React178.useCallback)((instance) => {
53770
- if (typeof ref === "function") {
53771
- const refCallback = ref;
53772
- const refCleanup = refCallback(instance);
53773
- return () => {
53774
- if (typeof refCleanup === "function") refCleanup();
53775
- else refCallback(null);
53776
- };
53777
- } else if (ref) {
53778
- ref.current = instance;
53779
- return () => {
53780
- ref.current = null;
53781
- };
53862
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
53863
+ value: actualValue,
53864
+ onChange: isOther ? handleOtherCheckboxChange : void 0,
53865
+ isDisabled: disabled,
53866
+ isReadOnly: readOnly,
53867
+ isInvalid: hasError
53868
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
53869
+ ref: checkboxRef,
53870
+ className,
53871
+ "data-hook": `checkbox-${label}`
53872
+ }, ({ isSelected, isHovered, isFocused }) => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(inputElement, {
53873
+ isSelected,
53874
+ isHovered,
53875
+ isFocused
53876
+ }), applyInternalProps(labelElement, {
53877
+ label
53878
+ }))));
53879
+ };
53880
+ Checkbox2.Label = OptionLabel;
53881
+ Checkbox2.Input = SelectionIndicator;
53882
+ var Option = ({ children, ...internal }) => {
53883
+ const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53884
+ const props2 = useFieldPropsV2();
53885
+ const { value: fieldValue, onChange, options, addOtherPlaceholder, otherInputCharacterLimit, disabled, readOnly, hasError } = props2;
53886
+ const checkboxElement = findChildOfType(children, Checkbox2);
53887
+ const otherInputElement = findChildOfType(children, OtherInput);
53888
+ const _value = React178.useMemo(() => fieldValue || [], [
53889
+ fieldValue
53890
+ ]);
53891
+ const isOtherSelected = React178.useMemo(() => {
53892
+ if (!isOther) {
53893
+ return false;
53782
53894
  }
53895
+ const optionsValues = getOptionsValues(options || []);
53896
+ return getIsOtherOptionSelected(_value, optionsValues);
53783
53897
  }, [
53784
- ref
53898
+ isOther,
53899
+ _value,
53900
+ options
53785
53901
  ]);
53786
- return (React178.useMemo)(
53787
- () => ({
53788
- get current() {
53789
- return objRef.current;
53790
- },
53791
- set current(value) {
53792
- objRef.current = value;
53793
- if (cleanupRef.current) {
53794
- cleanupRef.current();
53795
- cleanupRef.current = void 0;
53796
- }
53797
- if (value != null) cleanupRef.current = refEffect(value);
53798
- }
53799
- }),
53800
- // oxlint-disable-next-line react/react-compiler
53801
- [
53802
- refEffect
53803
- ]
53804
- );
53805
- }
53806
- var $fe16bffc7a557bf0$var$useEarlyEffect = (React178__default.default)["useInsertionEffect"] ?? ($c4867b2f328c2698$export$e5c5a5f917a5871c);
53807
- function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
53808
- const ref = (React178.useRef)(null);
53809
- $fe16bffc7a557bf0$var$useEarlyEffect(() => {
53810
- ref.current = fn;
53902
+ return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(checkboxElement, {
53903
+ value,
53904
+ label,
53905
+ isFirst,
53906
+ isOther,
53907
+ fieldId
53908
+ }), isOther && isOtherSelected && applyInternalProps(otherInputElement, {
53909
+ fieldValue: _value,
53910
+ onChange,
53911
+ label,
53912
+ placeholder: addOtherPlaceholder,
53913
+ maxLength: otherInputCharacterLimit,
53914
+ disabled,
53915
+ readOnly,
53916
+ hasError,
53917
+ ariaLabel: label,
53918
+ addOtherLabel: label,
53919
+ options
53920
+ }));
53921
+ };
53922
+ var OtherInput = ({ className, inputClassName, ...internal }) => {
53923
+ const { fieldValue, onChange, label, placeholder, maxLength, disabled, readOnly, hasError, ariaLabel, addOtherLabel, options } = internal;
53924
+ const [otherValue, setOtherValue] = React178.useState(() => {
53925
+ const optionsValues = getOptionsValues(options || []);
53926
+ const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53927
+ return isSelected ? getOtherValue(fieldValue, addOtherLabel) : "";
53928
+ });
53929
+ React178.useEffect(() => {
53930
+ const optionsValues = getOptionsValues(options || []);
53931
+ const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53932
+ setOtherValue(isSelected ? getOtherValue(fieldValue, addOtherLabel) : "");
53811
53933
  }, [
53812
- fn
53934
+ fieldValue,
53935
+ options,
53936
+ addOtherLabel
53813
53937
  ]);
53814
- return (React178.useCallback)((...args) => {
53815
- const f = ref.current;
53816
- return f?.(...args);
53817
- }, []);
53818
- }
53819
- function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
53820
- let globalListeners = (React178.useRef)(/* @__PURE__ */ new Map());
53821
- let addGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
53822
- let fn = options?.once ? (...args) => {
53823
- globalListeners.current.delete(listener);
53824
- listener(...args);
53825
- } : listener;
53826
- globalListeners.current.set(listener, {
53827
- type,
53828
- eventTarget,
53829
- fn,
53830
- options
53831
- });
53832
- eventTarget.addEventListener(type, fn, options);
53833
- }, []);
53834
- let removeGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
53835
- let fn = globalListeners.current.get(listener)?.fn || listener;
53836
- eventTarget.removeEventListener(type, fn, options);
53837
- globalListeners.current.delete(listener);
53838
- }, []);
53839
- let removeAllGlobalListeners = (React178.useCallback)(() => {
53840
- globalListeners.current.forEach((value, key) => {
53841
- removeGlobalListener(value.eventTarget, value.type, key, value.options);
53842
- });
53938
+ const debouncedHandleChange = React178.useMemo(() => {
53939
+ return r((input) => {
53940
+ const optionsValues = getOptionsValues(options || []);
53941
+ const removedOther = fieldValue.filter((val) => optionsValues.includes(val));
53942
+ const _otherValue = input ? `${addOtherLabel}: ${input}` : label;
53943
+ const newValue = [
53944
+ ...removedOther,
53945
+ _otherValue
53946
+ ];
53947
+ onChange(newValue);
53948
+ }, 500);
53843
53949
  }, [
53844
- removeGlobalListener
53950
+ onChange,
53951
+ options,
53952
+ fieldValue,
53953
+ addOtherLabel,
53954
+ label
53845
53955
  ]);
53846
- (React178.useEffect)(() => {
53847
- return removeAllGlobalListeners;
53956
+ const handleInputChange = React178.useCallback((input) => {
53957
+ setOtherValue(input);
53958
+ debouncedHandleChange(input);
53848
53959
  }, [
53849
- removeAllGlobalListeners
53960
+ debouncedHandleChange
53850
53961
  ]);
53851
- return {
53852
- addGlobalListener,
53853
- removeGlobalListener,
53854
- removeAllGlobalListeners
53855
- };
53856
- }
53857
-
53858
- // ../../node_modules/@internationalized/date/dist/private/utils.mjs
53859
- function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
53860
- return amount - numerator * Math.floor(amount / numerator);
53861
- }
53862
-
53863
- // ../../node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.mjs
53864
- var $93635573935797de$var$EPOCH = 1721426;
53865
- function $93635573935797de$export$f297eb839006d339(era, year, month, day) {
53866
- year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year);
53867
- let y1 = year - 1;
53868
- let monthOffset = -2;
53869
- if (month <= 2) monthOffset = 0;
53870
- else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1;
53871
- return $93635573935797de$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
53872
- }
53873
- function $93635573935797de$export$553d7fa8e3805fc0(year) {
53874
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
53875
- }
53876
- function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) {
53877
- return era === "BC" ? 1 - year : year;
53878
- }
53879
- function $93635573935797de$export$4475b7e617eb123c(year) {
53880
- let era = "AD";
53881
- if (year <= 0) {
53882
- era = "BC";
53883
- year = 1 - year;
53884
- }
53885
- return [
53886
- era,
53887
- year
53888
- ];
53889
- }
53890
- var $93635573935797de$var$daysInMonth = {
53891
- standard: [
53892
- 31,
53893
- 28,
53894
- 31,
53895
- 30,
53896
- 31,
53897
- 30,
53898
- 31,
53899
- 31,
53900
- 30,
53901
- 31,
53902
- 30,
53903
- 31
53904
- ],
53905
- leapyear: [
53906
- 31,
53907
- 29,
53908
- 31,
53909
- 30,
53910
- 31,
53911
- 30,
53912
- 31,
53913
- 31,
53914
- 30,
53915
- 31,
53916
- 30,
53917
- 31
53918
- ]
53919
- };
53920
- var $93635573935797de$export$80ee6245ec4f29ec = class {
53921
- fromJulianDay(jd) {
53922
- let jd0 = jd;
53923
- let depoch = jd0 - $93635573935797de$var$EPOCH;
53924
- let quadricent = Math.floor(depoch / 146097);
53925
- let dqc = ($09ec6a572d60460f$export$842a2cf37af977e1)(depoch, 146097);
53926
- let cent = Math.floor(dqc / 36524);
53927
- let dcent = ($09ec6a572d60460f$export$842a2cf37af977e1)(dqc, 36524);
53928
- let quad = Math.floor(dcent / 1461);
53929
- let dquad = ($09ec6a572d60460f$export$842a2cf37af977e1)(dcent, 1461);
53930
- let yindex = Math.floor(dquad / 365);
53931
- let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
53932
- let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear);
53933
- let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1);
53934
- let leapAdj = 2;
53935
- if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
53936
- else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1;
53937
- let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
53938
- let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1;
53939
- return new ($2aaf608024c21ca1$export$99faa760c7908e4f)(era, year, month, day);
53940
- }
53941
- toJulianDay(date) {
53942
- return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day);
53943
- }
53944
- getDaysInMonth(date) {
53945
- return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
53946
- }
53947
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
53948
- getMonthsInYear(date) {
53949
- return 12;
53950
- }
53951
- getDaysInYear(date) {
53952
- return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
53953
- }
53954
- getMaximumMonthsInYear() {
53955
- return 12;
53956
- }
53957
- getMaximumDaysInMonth() {
53958
- return 31;
53959
- }
53960
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
53961
- getYearsInEra(date) {
53962
- return 9999;
53963
- }
53964
- getEras() {
53965
- return [
53966
- "BC",
53967
- "AD"
53968
- ];
53969
- }
53970
- isInverseEra(date) {
53971
- return date.era === "BC";
53972
- }
53973
- balanceDate(date) {
53974
- if (date.year <= 0) {
53975
- date.era = date.era === "BC" ? "AD" : "BC";
53976
- date.year = 1 - date.year;
53977
- }
53978
- }
53979
- constructor() {
53980
- this.identifier = "gregory";
53981
- }
53962
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.TextField, {
53963
+ "aria-label": ariaLabel,
53964
+ value: otherValue,
53965
+ onChange: handleInputChange,
53966
+ isDisabled: disabled,
53967
+ isReadOnly: readOnly,
53968
+ isInvalid: hasError,
53969
+ className
53970
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Input, {
53971
+ className: inputClassName,
53972
+ placeholder,
53973
+ maxLength,
53974
+ "aria-label": ariaLabel
53975
+ }));
53982
53976
  };
53977
+ CheckboxGroup.Label = Label;
53978
+ CheckboxGroup.Options = Options;
53979
+ Options.Option = Option;
53980
+ Option.Checkbox = Checkbox2;
53981
+ Option.OtherInput = OtherInput;
53982
+ CheckboxGroup.Description = Description;
53983
+ CheckboxGroup.Error = Error2;
53983
53984
 
53984
- // ../../node_modules/@internationalized/date/dist/private/queries.mjs
53985
- function $ad063034c8620db8$export$dbc69fd56b53d5e(a2, b) {
53986
- return a2.isEqual?.(b) ?? b.isEqual?.(a2) ?? a2.identifier === b.identifier;
53987
- }
53988
- function $ad063034c8620db8$export$68781ddf31c0090f(a2, b) {
53989
- return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
53990
- }
53991
- function $ad063034c8620db8$export$c19a80a9721b80f6(a2, b) {
53992
- return $ad063034c8620db8$var$timeToMs(a2) - $ad063034c8620db8$var$timeToMs(b);
53993
- }
53994
- function $ad063034c8620db8$var$timeToMs(a2) {
53995
- return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
53996
- }
53997
- var $ad063034c8620db8$var$localTimeZone = null;
53998
- var $ad063034c8620db8$var$localTimeZoneOverride = false;
53999
- function $ad063034c8620db8$export$aa8b41735afcabd2() {
54000
- if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
54001
- return $ad063034c8620db8$var$localTimeZone;
54002
- }
54003
- function $ad063034c8620db8$export$6ab69b273755230b() {
54004
- return $ad063034c8620db8$var$localTimeZoneOverride;
54005
- }
54006
-
54007
- // ../../node_modules/@internationalized/date/dist/private/conversion.mjs
54008
- function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) {
54009
- date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
54010
- let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(date.era, date.year);
54011
- return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
54012
- }
54013
- function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
54014
- let date = /* @__PURE__ */ new Date();
54015
- date.setUTCHours(hour, minute, second, millisecond);
54016
- date.setUTCFullYear(year, month - 1, day);
54017
- return date.getTime();
54018
- }
54019
- function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) {
54020
- if (timeZone === "UTC") return 0;
54021
- if (ms > 0 && timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && !($ad063034c8620db8$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
54022
- let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone);
54023
- let utc2 = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0);
54024
- return utc2 - Math.floor(ms / 1e3) * 1e3;
54025
- }
54026
- var $d07e34cce18680fd$var$formattersByTimeZone = /* @__PURE__ */ new Map();
54027
- function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) {
54028
- let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone);
54029
- if (!formatter) {
54030
- formatter = new Intl.DateTimeFormat("en-US", {
54031
- timeZone,
54032
- hour12: false,
54033
- era: "short",
54034
- year: "numeric",
54035
- month: "numeric",
54036
- day: "numeric",
54037
- hour: "numeric",
54038
- minute: "numeric",
54039
- second: "numeric"
54040
- });
54041
- $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter);
54042
- }
54043
- let parts = formatter.formatToParts(new Date(ms));
54044
- let namedParts = {};
54045
- for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
54046
- return {
54047
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
54048
- year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
54049
- month: +namedParts.month,
54050
- day: +namedParts.day,
54051
- hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
54052
- minute: +namedParts.minute,
54053
- second: +namedParts.second
54054
- };
54055
- }
54056
- var $d07e34cce18680fd$var$DAYMILLIS = 864e5;
54057
- function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) {
54058
- let found = earlier === later ? [
54059
- earlier
54060
- ] : [
54061
- earlier,
54062
- later
54063
- ];
54064
- return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute));
54065
- }
54066
- function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) {
54067
- let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone);
54068
- return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
54069
- }
54070
- function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
54071
- let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date);
54072
- if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
54073
- if (timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && disambiguation === "compatible" && !($ad063034c8620db8$export$6ab69b273755230b)()) {
54074
- dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new ($93635573935797de$export$80ee6245ec4f29ec)());
54075
- let date2 = /* @__PURE__ */ new Date();
54076
- let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
54077
- date2.setFullYear(year, dateTime.month - 1, dateTime.day);
54078
- date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
54079
- return date2.getTime();
54080
- }
54081
- let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
54082
- let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone);
54083
- let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone);
54084
- let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
54085
- if (valid.length === 1) return valid[0];
54086
- if (valid.length > 1) switch (disambiguation) {
54087
- // 'compatible' means 'earlier' for "fall back" transitions
54088
- case "compatible":
54089
- case "earlier":
54090
- return valid[0];
54091
- case "later":
54092
- return valid[valid.length - 1];
54093
- case "reject":
54094
- throw new RangeError("Multiple possible absolute times found");
54095
- }
54096
- switch (disambiguation) {
54097
- case "earlier":
54098
- return Math.min(ms - offsetBefore, ms - offsetAfter);
54099
- // 'compatible' means 'later' for "spring forward" transitions
54100
- case "compatible":
54101
- case "later":
54102
- return Math.max(ms - offsetBefore, ms - offsetAfter);
54103
- case "reject":
54104
- throw new RangeError("No such absolute time found");
54105
- }
54106
- }
54107
- function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
54108
- return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
54109
- }
54110
- function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
54111
- let hour = 0, minute = 0, second = 0, millisecond = 0;
54112
- if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
54113
- else if ("hour" in date && !time) return date;
54114
- if (time) ({ hour, minute, second, millisecond } = time);
54115
- return new ($2aaf608024c21ca1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
54116
- }
54117
- function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
54118
- if (($ad063034c8620db8$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
54119
- let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
54120
- let copy = date.copy();
54121
- copy.calendar = calendar;
54122
- copy.era = calendarDate.era;
54123
- copy.year = calendarDate.year;
54124
- copy.month = calendarDate.month;
54125
- copy.day = calendarDate.day;
54126
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(copy);
54127
- return copy;
54128
- }
54129
-
54130
- // ../../node_modules/@internationalized/date/dist/private/manipulation.mjs
54131
- function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) {
54132
- let mutableDate = date.copy();
54133
- let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0;
54134
- $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0);
54135
- if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
54136
- mutableDate.month += duration.months || 0;
54137
- $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate);
54138
- $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate);
54139
- mutableDate.day += (duration.weeks || 0) * 7;
54140
- mutableDate.day += duration.days || 0;
54141
- mutableDate.day += days;
54142
- $435a2ceaa8778ed8$var$balanceDay(mutableDate);
54143
- if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
54144
- if (mutableDate.year < 1) {
54145
- mutableDate.year = 1;
54146
- mutableDate.month = 1;
54147
- mutableDate.day = 1;
54148
- }
54149
- let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
54150
- if (mutableDate.year > maxYear) {
54151
- let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);
54152
- mutableDate.year = maxYear;
54153
- mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
54154
- mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
54155
- }
54156
- if (mutableDate.month < 1) {
54157
- mutableDate.month = 1;
54158
- mutableDate.day = 1;
54159
- }
54160
- let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
54161
- if (mutableDate.month > maxMonth) {
54162
- mutableDate.month = maxMonth;
54163
- mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
53985
+ // ../../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
53986
+ function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
53987
+ if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
53988
+ preventScroll: true
53989
+ });
53990
+ else {
53991
+ let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
53992
+ element.focus();
53993
+ $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
54164
53994
  }
54165
- mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
54166
- return mutableDate;
54167
- }
54168
- function $435a2ceaa8778ed8$var$addYears(date, years) {
54169
- if (date.calendar.isInverseEra?.(date)) years = -years;
54170
- date.year += years;
54171
53995
  }
54172
- function $435a2ceaa8778ed8$var$balanceYearMonth(date) {
54173
- while (date.month < 1) {
54174
- $435a2ceaa8778ed8$var$addYears(date, -1);
54175
- date.month += date.calendar.getMonthsInYear(date);
54176
- }
54177
- let monthsInYear = 0;
54178
- while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
54179
- date.month -= monthsInYear;
54180
- $435a2ceaa8778ed8$var$addYears(date, 1);
53996
+ var $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
53997
+ function $1969ac565cfec8d0$var$supportsPreventScroll() {
53998
+ if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
53999
+ $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
54000
+ try {
54001
+ let focusElem = document.createElement("div");
54002
+ focusElem.focus({
54003
+ get preventScroll() {
54004
+ $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
54005
+ return true;
54006
+ }
54007
+ });
54008
+ } catch {
54009
+ }
54181
54010
  }
54011
+ return $1969ac565cfec8d0$var$supportsPreventScrollCached;
54182
54012
  }
54183
- function $435a2ceaa8778ed8$var$balanceDay(date) {
54184
- while (date.day < 1) {
54185
- date.month--;
54186
- $435a2ceaa8778ed8$var$balanceYearMonth(date);
54187
- date.day += date.calendar.getDaysInMonth(date);
54188
- }
54189
- while (date.day > date.calendar.getDaysInMonth(date)) {
54190
- date.day -= date.calendar.getDaysInMonth(date);
54191
- date.month++;
54192
- $435a2ceaa8778ed8$var$balanceYearMonth(date);
54013
+ function $1969ac565cfec8d0$var$getScrollableElements(element) {
54014
+ let parent = element.parentNode;
54015
+ let scrollableElements = [];
54016
+ let rootScrollingElement = document.scrollingElement || document.documentElement;
54017
+ while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
54018
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
54019
+ element: parent,
54020
+ scrollTop: parent.scrollTop,
54021
+ scrollLeft: parent.scrollLeft
54022
+ });
54023
+ parent = parent.parentNode;
54193
54024
  }
54025
+ if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
54026
+ element: rootScrollingElement,
54027
+ scrollTop: rootScrollingElement.scrollTop,
54028
+ scrollLeft: rootScrollingElement.scrollLeft
54029
+ });
54030
+ return scrollableElements;
54194
54031
  }
54195
- function $435a2ceaa8778ed8$var$constrainMonthDay(date) {
54196
- date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
54197
- date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
54198
- }
54199
- function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) {
54200
- if (date.calendar.constrainDate) date.calendar.constrainDate(date);
54201
- date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
54202
- $435a2ceaa8778ed8$var$constrainMonthDay(date);
54203
- }
54204
- function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) {
54205
- let inverseDuration = {};
54206
- for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
54207
- return inverseDuration;
54208
- }
54209
- function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) {
54210
- return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
54032
+ function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
54033
+ for (let { element, scrollTop, scrollLeft } of scrollableElements) {
54034
+ element.scrollTop = scrollTop;
54035
+ element.scrollLeft = scrollLeft;
54036
+ }
54211
54037
  }
54212
- function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) {
54213
- let mutableDate = date.copy();
54214
- if (fields.era != null) mutableDate.era = fields.era;
54215
- if (fields.year != null) mutableDate.year = fields.year;
54216
- if (fields.month != null) mutableDate.month = fields.month;
54217
- if (fields.day != null) mutableDate.day = fields.day;
54218
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate);
54219
- return mutableDate;
54038
+
54039
+ // ../../node_modules/react-aria/dist/private/utils/domHelpers.mjs
54040
+ var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
54041
+ if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
54042
+ if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
54043
+ return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
54044
+ };
54045
+ var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
54046
+ let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
54047
+ return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
54048
+ };
54049
+ function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
54050
+ return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
54220
54051
  }
54221
- function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) {
54222
- let mutableValue = value.copy();
54223
- if (fields.hour != null) mutableValue.hour = fields.hour;
54224
- if (fields.minute != null) mutableValue.minute = fields.minute;
54225
- if (fields.second != null) mutableValue.second = fields.second;
54226
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
54227
- $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue);
54228
- return mutableValue;
54052
+ function $d447af545b77c9f1$var$isWindow(value) {
54053
+ return typeof value === "object" && value != null && "window" in value && value.window === value;
54229
54054
  }
54230
- function $435a2ceaa8778ed8$var$balanceTime(time) {
54231
- time.second += Math.floor(time.millisecond / 1e3);
54232
- time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3);
54233
- time.minute += Math.floor(time.second / 60);
54234
- time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60);
54235
- time.hour += Math.floor(time.minute / 60);
54236
- time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60);
54237
- let days = Math.floor(time.hour / 24);
54238
- time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24);
54239
- return days;
54055
+ function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
54056
+ return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
54240
54057
  }
54241
- function $435a2ceaa8778ed8$export$7555de1e070510cb(time) {
54242
- time.millisecond = Math.max(0, Math.min(time.millisecond, 999));
54243
- time.second = Math.max(0, Math.min(time.second, 59));
54244
- time.minute = Math.max(0, Math.min(time.minute, 59));
54245
- time.hour = Math.max(0, Math.min(time.hour, 23));
54058
+ function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
54059
+ return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
54246
54060
  }
54247
- function $435a2ceaa8778ed8$var$nonNegativeMod(a2, b) {
54248
- let result2 = a2 % b;
54249
- if (result2 < 0) result2 += b;
54250
- return result2;
54061
+
54062
+ // ../../node_modules/react-stately/dist/private/flags/flags.mjs
54063
+ var $6a20a7989e6c817a$var$_shadowDOM = false;
54064
+ function $6a20a7989e6c817a$export$98658e8c59125e6a() {
54065
+ return $6a20a7989e6c817a$var$_shadowDOM;
54251
54066
  }
54252
- function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
54253
- time.hour += duration.hours || 0;
54254
- time.minute += duration.minutes || 0;
54255
- time.second += duration.seconds || 0;
54256
- time.millisecond += duration.milliseconds || 0;
54257
- return $435a2ceaa8778ed8$var$balanceTime(time);
54067
+
54068
+ // ../../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
54069
+ function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
54070
+ if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
54071
+ if (!node || !otherNode) return false;
54072
+ let currentNode = otherNode;
54073
+ while (currentNode !== null) {
54074
+ if (currentNode === node) return true;
54075
+ if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
54076
+ currentNode = currentNode.assignedSlot.parentNode;
54077
+ else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
54078
+ currentNode = currentNode.host;
54079
+ else currentNode = currentNode.parentNode;
54080
+ }
54081
+ return false;
54258
54082
  }
54259
- function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
54260
- let res = time.copy();
54261
- $435a2ceaa8778ed8$var$addTimeFields(res, duration);
54262
- return res;
54083
+ var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
54084
+ if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
54085
+ let activeElement = doc.activeElement;
54086
+ while (activeElement && "shadowRoot" in activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
54087
+ return activeElement;
54088
+ };
54089
+ function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
54090
+ if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
54091
+ if ("composedPath" in event) return event.composedPath()[0] ?? null;
54092
+ else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
54093
+ }
54094
+ return event.target;
54263
54095
  }
54264
- function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
54265
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
54096
+ var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React178__default.default).useLayoutEffect : () => {
54097
+ };
54098
+ function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
54099
+ let event = nativeEvent;
54100
+ event.nativeEvent = nativeEvent;
54101
+ event.isDefaultPrevented = () => event.defaultPrevented;
54102
+ event.isPropagationStopped = () => event.cancelBubble;
54103
+ event.persist = () => {
54104
+ };
54105
+ return event;
54266
54106
  }
54267
- function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
54268
- let mutable = value.copy();
54269
- switch (field) {
54270
- case "era": {
54271
- let eras = value.calendar.getEras();
54272
- let eraIndex = eras.indexOf(value.era);
54273
- if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
54274
- eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);
54275
- mutable.era = eras[eraIndex];
54276
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
54277
- break;
54278
- }
54279
- case "year":
54280
- if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;
54281
- mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options?.round);
54282
- if (mutable.year === -Infinity) mutable.year = 1;
54283
- if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
54284
- break;
54285
- case "month":
54286
- mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);
54287
- break;
54288
- case "day":
54289
- mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);
54290
- break;
54291
- default:
54292
- throw new Error("Unsupported field " + field);
54293
- }
54294
- if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
54295
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
54296
- return mutable;
54107
+ function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
54108
+ Object.defineProperty(event, "target", {
54109
+ value: target
54110
+ });
54111
+ Object.defineProperty(event, "currentTarget", {
54112
+ value: target
54113
+ });
54297
54114
  }
54298
- function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) {
54299
- let mutable = value.copy();
54300
- switch (field) {
54301
- case "hour": {
54302
- let hours = value.hour;
54303
- let min4 = 0;
54304
- let max4 = 23;
54305
- if (options?.hourCycle === 12) {
54306
- let isPM = hours >= 12;
54307
- min4 = isPM ? 12 : 0;
54308
- max4 = isPM ? 23 : 11;
54115
+ function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
54116
+ let stateRef = (React178.useRef)({
54117
+ isFocused: false,
54118
+ observer: null
54119
+ });
54120
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
54121
+ const state = stateRef.current;
54122
+ return () => {
54123
+ if (state.observer) {
54124
+ state.observer.disconnect();
54125
+ state.observer = null;
54309
54126
  }
54310
- mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min4, max4, options?.round);
54311
- break;
54127
+ };
54128
+ }, []);
54129
+ return (React178.useCallback)((e) => {
54130
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54131
+ if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
54132
+ stateRef.current.isFocused = true;
54133
+ let target = eventTarget;
54134
+ let onBlurHandler = (e2) => {
54135
+ stateRef.current.isFocused = false;
54136
+ if (target.disabled) {
54137
+ let event = $a92dc41f639950be$export$525bc4921d56d4a(e2);
54138
+ onBlur?.(event);
54139
+ }
54140
+ if (stateRef.current.observer) {
54141
+ stateRef.current.observer.disconnect();
54142
+ stateRef.current.observer = null;
54143
+ }
54144
+ };
54145
+ target.addEventListener("focusout", onBlurHandler, {
54146
+ once: true
54147
+ });
54148
+ stateRef.current.observer = new MutationObserver(() => {
54149
+ if (stateRef.current.isFocused && target.disabled) {
54150
+ stateRef.current.observer?.disconnect();
54151
+ let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
54152
+ target.dispatchEvent(new FocusEvent("blur", {
54153
+ relatedTarget: relatedTargetEl
54154
+ }));
54155
+ target.dispatchEvent(new FocusEvent("focusout", {
54156
+ bubbles: true,
54157
+ relatedTarget: relatedTargetEl
54158
+ }));
54159
+ }
54160
+ });
54161
+ stateRef.current.observer.observe(target, {
54162
+ attributes: true,
54163
+ attributeFilter: [
54164
+ "disabled"
54165
+ ]
54166
+ });
54312
54167
  }
54313
- case "minute":
54314
- mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options?.round);
54315
- break;
54316
- case "second":
54317
- mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options?.round);
54318
- break;
54319
- case "millisecond":
54320
- mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options?.round);
54321
- break;
54322
- default:
54323
- throw new Error("Unsupported field " + field);
54324
- }
54325
- return mutable;
54326
- }
54327
- function $435a2ceaa8778ed8$var$cycleValue(value, amount, min4, max4, round = false) {
54328
- if (round) {
54329
- value += Math.sign(amount);
54330
- if (value < min4) value = max4;
54331
- let div = Math.abs(amount);
54332
- if (amount > 0) value = Math.ceil(value / div) * div;
54333
- else value = Math.floor(value / div) * div;
54334
- if (value > max4) value = min4;
54335
- } else {
54336
- value += amount;
54337
- if (value < min4) value = max4 - (min4 - value - 1);
54338
- else if (value > max4) value = min4 + (value - max4 - 1);
54339
- }
54340
- return value;
54168
+ }, [
54169
+ onBlur
54170
+ ]);
54341
54171
  }
54342
54172
 
54343
- // ../../node_modules/@internationalized/date/dist/private/string.mjs
54344
- var $58246871e4652552$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
54345
- var $58246871e4652552$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
54346
- var $58246871e4652552$var$ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
54347
- function $58246871e4652552$export$c9698ec7f05a07e1(value) {
54348
- let m = value.match($58246871e4652552$var$TIME_RE);
54349
- if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
54350
- return new ($2aaf608024c21ca1$export$680ea196effce5f)($58246871e4652552$var$parseNumber(m[1], 0, 23), m[2] ? $58246871e4652552$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $58246871e4652552$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $58246871e4652552$var$parseNumber(m[4], 0, Infinity) * 1e3 : 0);
54351
- }
54352
- function $58246871e4652552$export$6b862160d295c8e(value) {
54353
- let m = value.match($58246871e4652552$var$DATE_RE);
54354
- if (!m) {
54355
- if ($58246871e4652552$var$ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
54356
- throw new Error("Invalid ISO 8601 date string: " + value);
54357
- }
54358
- let date = new ($2aaf608024c21ca1$export$99faa760c7908e4f)($58246871e4652552$var$parseNumber(m[1], 0, 9999), $58246871e4652552$var$parseNumber(m[2], 1, 12), 1);
54359
- date.day = $58246871e4652552$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
54360
- return date;
54361
- }
54362
- function $58246871e4652552$var$parseNumber(value, min4, max4) {
54363
- let val = Number(value);
54364
- if (val < min4 || val > max4) throw new RangeError(`Value out of range: ${min4} <= ${val} <= ${max4}`);
54365
- return val;
54366
- }
54367
- function $58246871e4652552$export$f59dee82248f5ad4(time) {
54368
- return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
54369
- }
54370
- function $58246871e4652552$export$60dfd74aa96791bd(date) {
54371
- let gregorianDate = ($d07e34cce18680fd$export$b4a036af3fc0b032)(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
54372
- let year;
54373
- if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
54374
- else year = String(gregorianDate.year).padStart(4, "0");
54375
- return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
54173
+ // ../../node_modules/react-aria/dist/private/utils/platform.mjs
54174
+ function $2add3ce32c6007eb$var$testUserAgent(re) {
54175
+ if (typeof window === "undefined" || window.navigator == null) return false;
54176
+ let brands = window.navigator["userAgentData"]?.brands;
54177
+ return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
54376
54178
  }
54377
- function $58246871e4652552$export$4223de14708adc63(date) {
54378
- return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`;
54179
+ function $2add3ce32c6007eb$var$testPlatform(re) {
54180
+ return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
54379
54181
  }
54380
-
54381
- // ../../node_modules/@internationalized/date/dist/private/CalendarDate.mjs
54382
- function $2aaf608024c21ca1$var$shiftArgs(args) {
54383
- let calendar = typeof args[0] === "object" ? args.shift() : new ($93635573935797de$export$80ee6245ec4f29ec)();
54384
- let era;
54385
- if (typeof args[0] === "string") era = args.shift();
54386
- else {
54387
- let eras = calendar.getEras();
54388
- era = eras[eras.length - 1];
54389
- }
54390
- let year = args.shift();
54391
- let month = args.shift();
54392
- let day = args.shift();
54393
- return [
54394
- calendar,
54395
- era,
54396
- year,
54397
- month,
54398
- day
54399
- ];
54182
+ function $2add3ce32c6007eb$var$cached(fn) {
54183
+ let res = null;
54184
+ return () => {
54185
+ if (res == null) res = fn();
54186
+ return res;
54187
+ };
54400
54188
  }
54401
- var _type;
54402
- var _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f {
54403
- constructor(...args) {
54404
- // This prevents TypeScript from allowing other types with the same fields to match.
54405
- // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
54406
- // If that behavior is desired, use the AnyCalendarDate interface instead.
54407
- // @ts-ignore
54408
- __privateAdd(this, _type);
54409
- let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
54410
- this.calendar = calendar;
54411
- this.era = era;
54412
- this.year = year;
54413
- this.month = month;
54414
- this.day = day;
54415
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
54416
- }
54417
- /** Returns a copy of this date. */
54418
- copy() {
54419
- if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
54420
- else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
54421
- }
54422
- /** Returns a new `CalendarDate` with the given duration added to it. */
54423
- add(duration) {
54424
- return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
54425
- }
54426
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */
54427
- subtract(duration) {
54428
- return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
54429
- }
54430
- /**
54431
- * Returns a new `CalendarDate` with the given fields set to the provided values. Other fields
54432
- * will be constrained accordingly.
54433
- */
54434
- set(fields) {
54435
- return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(this, fields);
54436
- }
54437
- /**
54438
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
54439
- * When the resulting value reaches the limits of the field, it wraps around.
54440
- */
54441
- cycle(field, amount, options) {
54442
- return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
54443
- }
54444
- /**
54445
- * Converts the date to a native JavaScript Date object, with the time set to midnight in the
54446
- * given time zone.
54447
- */
54448
- toDate(timeZone) {
54449
- return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone);
54450
- }
54451
- /** Converts the date to an ISO 8601 formatted string. */
54452
- toString() {
54453
- return ($58246871e4652552$export$60dfd74aa96791bd)(this);
54454
- }
54455
- /**
54456
- * Compares this date with another. A negative result indicates that this date is before the given
54457
- * one, and a positive date indicates that it is after.
54458
- */
54459
- compare(b) {
54460
- return ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
54189
+ var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
54190
+ return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
54191
+ });
54192
+ var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
54193
+ return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
54194
+ });
54195
+ var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
54196
+ return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
54197
+ $2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
54198
+ });
54199
+ var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
54200
+ return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
54201
+ });
54202
+ var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
54203
+ return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
54204
+ });
54205
+ var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
54206
+ return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
54207
+ });
54208
+ var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
54209
+ return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
54210
+ });
54211
+ var $2add3ce32c6007eb$export$b7d78993b74f766d = $2add3ce32c6007eb$var$cached(function() {
54212
+ return $2add3ce32c6007eb$var$testUserAgent(/(Firefox|FxiOS)/i);
54213
+ });
54214
+
54215
+ // ../../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
54216
+ function $b5c62b033c25b96d$export$60278871457622de(event) {
54217
+ if (event.pointerType === "" && event.isTrusted) return true;
54218
+ if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
54219
+ return event.detail === 0 && !event.pointerType;
54220
+ }
54221
+ function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
54222
+ let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
54223
+ if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith("key") && target.target === "_blank") {
54224
+ if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
54225
+ else ctrlKey = true;
54461
54226
  }
54227
+ let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
54228
+ keyIdentifier: "Enter",
54229
+ metaKey,
54230
+ ctrlKey,
54231
+ altKey,
54232
+ shiftKey
54233
+ }) : new MouseEvent("click", {
54234
+ metaKey,
54235
+ ctrlKey,
54236
+ altKey,
54237
+ shiftKey,
54238
+ detail: 1,
54239
+ bubbles: true,
54240
+ cancelable: true
54241
+ });
54242
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
54243
+ ($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
54244
+ target.dispatchEvent(event);
54245
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
54246
+ }
54247
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
54248
+ var $8f5a2122b0992be3$var$currentModality = null;
54249
+ var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
54250
+ var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
54251
+ var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54252
+ var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
54253
+ var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
54254
+ Tab: true,
54255
+ Escape: true
54462
54256
  };
54463
- _type = new WeakMap();
54464
- var $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f;
54465
- var _type2;
54466
- var _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f {
54467
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
54468
- // This prevents TypeScript from allowing other types with the same fields to match.
54469
- // @ts-ignore
54470
- __privateAdd(this, _type2);
54471
- this.hour = hour;
54472
- this.minute = minute;
54473
- this.second = second;
54474
- this.millisecond = millisecond;
54475
- ($435a2ceaa8778ed8$export$7555de1e070510cb)(this);
54476
- }
54477
- /** Returns a copy of this time. */
54478
- copy() {
54479
- return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
54257
+ function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e) {
54258
+ for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e);
54259
+ }
54260
+ function $8f5a2122b0992be3$var$isValidKey(e) {
54261
+ return !(e.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
54262
+ }
54263
+ function $8f5a2122b0992be3$var$handleKeyboardEvent(e) {
54264
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54265
+ if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e)) {
54266
+ $8f5a2122b0992be3$var$currentModality = "keyboard";
54267
+ $8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e);
54480
54268
  }
54481
- /** Returns a new `Time` with the given duration added to it. */
54482
- add(duration) {
54483
- return ($435a2ceaa8778ed8$export$7ed87b6bc2506470)(this, duration);
54269
+ }
54270
+ function $8f5a2122b0992be3$var$handlePointerEvent(e) {
54271
+ $8f5a2122b0992be3$var$currentModality = "pointer";
54272
+ "pointerType" in e ? e.pointerType : "mouse";
54273
+ if (e.type === "mousedown" || e.type === "pointerdown") {
54274
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54275
+ $8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e);
54484
54276
  }
54485
- /** Returns a new `Time` with the given duration subtracted from it. */
54486
- subtract(duration) {
54487
- return ($435a2ceaa8778ed8$export$fe34d3a381cd7501)(this, duration);
54277
+ }
54278
+ function $8f5a2122b0992be3$var$handleClickEvent(e) {
54279
+ if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e)) {
54280
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54281
+ $8f5a2122b0992be3$var$currentModality = "virtual";
54488
54282
  }
54489
- /**
54490
- * Returns a new `Time` with the given fields set to the provided values. Other fields will be
54491
- * constrained accordingly.
54492
- */
54493
- set(fields) {
54494
- return ($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields);
54283
+ }
54284
+ function $8f5a2122b0992be3$var$handleFocusEvent(e) {
54285
+ let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54286
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
54287
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
54288
+ if (target === ownerWindow) {
54289
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
54290
+ return;
54495
54291
  }
54496
- /**
54497
- * Returns a new `Time` with the given field adjusted by a specified amount.
54498
- * When the resulting value reaches the limits of the field, it wraps around.
54499
- */
54500
- cycle(field, amount, options) {
54501
- return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
54292
+ if (target === ownerDocument || !e.isTrusted) return;
54293
+ if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
54294
+ $8f5a2122b0992be3$var$currentModality = "virtual";
54295
+ $8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e);
54502
54296
  }
54503
- /** Converts the time to an ISO 8601 formatted string. */
54504
- toString() {
54505
- return ($58246871e4652552$export$f59dee82248f5ad4)(this);
54297
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54298
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
54299
+ }
54300
+ function $8f5a2122b0992be3$var$handleWindowBlur() {
54301
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54302
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
54303
+ }
54304
+ function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
54305
+ if (typeof window === "undefined" || typeof document === "undefined") return;
54306
+ const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
54307
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54308
+ if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
54309
+ let focus = windowObject.HTMLElement.prototype.focus;
54310
+ Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
54311
+ configurable: true,
54312
+ writable: true,
54313
+ value: function() {
54314
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54315
+ focus.apply(this, arguments);
54316
+ }
54317
+ });
54318
+ documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54319
+ documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54320
+ documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
54321
+ windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
54322
+ windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
54323
+ if (typeof PointerEvent !== "undefined") {
54324
+ documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
54325
+ documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
54326
+ documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
54506
54327
  }
54507
- /**
54508
- * Compares this time with another. A negative result indicates that this time is before the given
54509
- * one, and a positive time indicates that it is after.
54510
- */
54511
- compare(b) {
54512
- return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, b);
54328
+ windowObject.addEventListener("beforeunload", () => {
54329
+ $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
54330
+ }, {
54331
+ once: true
54332
+ });
54333
+ $8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
54334
+ focus
54335
+ });
54336
+ }
54337
+ var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
54338
+ const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
54339
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54340
+ if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
54341
+ if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
54342
+ Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
54343
+ configurable: true,
54344
+ writable: true,
54345
+ value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
54346
+ });
54347
+ documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54348
+ documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54349
+ documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
54350
+ windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
54351
+ windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
54352
+ if (typeof PointerEvent !== "undefined") {
54353
+ documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
54354
+ documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
54355
+ documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
54513
54356
  }
54357
+ $8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
54514
54358
  };
54515
- _type2 = new WeakMap();
54516
- var $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f;
54517
- var _type3;
54518
- var _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f {
54519
- constructor(...args) {
54520
- // This prevents TypeScript from allowing other types with the same fields to match.
54521
- // @ts-ignore
54522
- __privateAdd(this, _type3);
54523
- let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
54524
- this.calendar = calendar;
54525
- this.era = era;
54526
- this.year = year;
54527
- this.month = month;
54528
- this.day = day;
54529
- this.hour = args.shift() || 0;
54530
- this.minute = args.shift() || 0;
54531
- this.second = args.shift() || 0;
54532
- this.millisecond = args.shift() || 0;
54533
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
54534
- }
54535
- /** Returns a copy of this date. */
54536
- copy() {
54537
- if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
54538
- else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
54539
- }
54540
- /** Returns a new `CalendarDateTime` with the given duration added to it. */
54541
- add(duration) {
54542
- return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
54359
+ function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
54360
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54361
+ let loadListener;
54362
+ if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
54363
+ else {
54364
+ loadListener = () => {
54365
+ $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
54366
+ };
54367
+ documentObject.addEventListener("DOMContentLoaded", loadListener);
54543
54368
  }
54544
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
54545
- subtract(duration) {
54546
- return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
54369
+ return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
54370
+ }
54371
+ if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
54372
+ function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
54373
+ return $8f5a2122b0992be3$var$currentModality !== "pointer";
54374
+ }
54375
+ var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
54376
+ "checkbox",
54377
+ "radio",
54378
+ "range",
54379
+ "color",
54380
+ "file",
54381
+ "image",
54382
+ "button",
54383
+ "submit",
54384
+ "reset"
54385
+ ]);
54386
+ function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e) {
54387
+ let eventTarget = e ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) : void 0;
54388
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
54389
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
54390
+ const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
54391
+ const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
54392
+ const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
54393
+ const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
54394
+ let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
54395
+ isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
54396
+ return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
54397
+ }
54398
+ function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
54399
+ $8f5a2122b0992be3$var$setupGlobalFocusEvents();
54400
+ (React178.useEffect)(() => {
54401
+ if (opts?.enabled === false) return;
54402
+ let handler = (modality, e) => {
54403
+ if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) return;
54404
+ fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
54405
+ };
54406
+ $8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
54407
+ return () => {
54408
+ $8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
54409
+ };
54410
+ }, deps);
54411
+ }
54412
+
54413
+ // ../../node_modules/react-aria/dist/private/utils/chain.mjs
54414
+ function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
54415
+ return (...args) => {
54416
+ for (let callback of callbacks) if (typeof callback === "function") callback(...args);
54417
+ };
54418
+ }
54419
+ var $390e54f620492c70$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
54420
+ if (typeof FinalizationRegistry !== "undefined") new FinalizationRegistry((heldValue) => {
54421
+ $390e54f620492c70$export$d41a04c74483c6ef.delete(heldValue);
54422
+ });
54423
+ function $390e54f620492c70$export$cd8c9cb68f842629(idA, idB) {
54424
+ if (idA === idB) return idA;
54425
+ let setIdsA = $390e54f620492c70$export$d41a04c74483c6ef.get(idA);
54426
+ if (setIdsA) {
54427
+ setIdsA.forEach((ref) => ref.current = idB);
54428
+ return idB;
54547
54429
  }
54548
- /**
54549
- * Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields
54550
- * will be constrained accordingly.
54551
- */
54552
- set(fields) {
54553
- return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields), fields);
54430
+ let setIdsB = $390e54f620492c70$export$d41a04c74483c6ef.get(idB);
54431
+ if (setIdsB) {
54432
+ setIdsB.forEach((ref) => ref.current = idA);
54433
+ return idA;
54554
54434
  }
54555
- /**
54556
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
54557
- * When the resulting value reaches the limits of the field, it wraps around.
54558
- */
54559
- cycle(field, amount, options) {
54560
- switch (field) {
54561
- case "era":
54562
- case "year":
54563
- case "month":
54564
- case "day":
54565
- return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
54566
- default:
54567
- return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
54435
+ return idB;
54436
+ }
54437
+
54438
+ // ../../node_modules/react-aria/dist/private/utils/mergeRefs.mjs
54439
+ function $4064df0d6f9620e1$export$c9058316764c140e(...refs) {
54440
+ if (refs.length === 1 && refs[0]) return refs[0];
54441
+ return (value) => {
54442
+ let hasCleanup = false;
54443
+ const cleanups = refs.map((ref) => {
54444
+ const cleanup = $4064df0d6f9620e1$var$setRef(ref, value);
54445
+ hasCleanup || (hasCleanup = typeof cleanup == "function");
54446
+ return cleanup;
54447
+ });
54448
+ if (hasCleanup) return () => {
54449
+ cleanups.forEach((cleanup, i) => {
54450
+ if (typeof cleanup === "function") cleanup();
54451
+ else $4064df0d6f9620e1$var$setRef(refs[i], null);
54452
+ });
54453
+ };
54454
+ };
54455
+ }
54456
+ function $4064df0d6f9620e1$var$setRef(ref, value) {
54457
+ if (typeof ref === "function") return ref(value);
54458
+ else if (ref != null) ref.current = value;
54459
+ }
54460
+
54461
+ // ../../node_modules/clsx/dist/clsx.mjs
54462
+ function r2(e) {
54463
+ var t, f, n = "";
54464
+ if ("string" == typeof e || "number" == typeof e) n += e;
54465
+ else if ("object" == typeof e) if (Array.isArray(e)) {
54466
+ var o = e.length;
54467
+ for (t = 0; t < o; t++) e[t] && (f = r2(e[t])) && (n && (n += " "), n += f);
54468
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
54469
+ return n;
54470
+ }
54471
+ function clsx() {
54472
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r2(e)) && (n && (n += " "), n += t);
54473
+ return n;
54474
+ }
54475
+ var clsx_default = clsx;
54476
+
54477
+ // ../../node_modules/react-aria/dist/private/utils/mergeProps.mjs
54478
+ function $bbaa08b3cd72f041$export$9d1611c77c2fe928(...args) {
54479
+ let result2 = {
54480
+ ...args[0]
54481
+ };
54482
+ for (let i = 1; i < args.length; i++) {
54483
+ let props2 = args[i];
54484
+ for (let key in props2) {
54485
+ let a2 = result2[key];
54486
+ let b = props2[key];
54487
+ if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
54488
+ key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
54489
+ 65 && key.charCodeAt(2) <= /* 'Z' */
54490
+ 90) result2[key] = ($a4e76a5424781910$export$e08e3b67e392101e)(a2, b);
54491
+ else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string") result2[key] = (clsx_default)(a2, b);
54492
+ else if (key === "id" && a2 && b) result2.id = ($390e54f620492c70$export$cd8c9cb68f842629)(a2, b);
54493
+ else if (key === "ref" && a2 && b) result2.ref = ($4064df0d6f9620e1$export$c9058316764c140e)(a2, b);
54494
+ else result2[key] = b !== void 0 ? b : a2;
54568
54495
  }
54569
54496
  }
54570
- /** Converts the date to a native JavaScript Date object in the given time zone. */
54571
- toDate(timeZone, disambiguation) {
54572
- return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone, disambiguation);
54573
- }
54574
- /** Converts the date to an ISO 8601 formatted string. */
54575
- toString() {
54576
- return ($58246871e4652552$export$4223de14708adc63)(this);
54577
- }
54578
- /**
54579
- * Compares this date with another. A negative result indicates that this date is before the given
54580
- * one, and a positive date indicates that it is after.
54581
- */
54582
- compare(b) {
54583
- let res = ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
54584
- if (res === 0) return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, ($d07e34cce18680fd$export$b21e0b124e224484)(b));
54585
- return res;
54586
- }
54587
- };
54588
- _type3 = new WeakMap();
54589
- var $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f;
54497
+ return result2;
54498
+ }
54499
+ function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props2) {
54500
+ let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props2;
54501
+ const onBlur = (React178.useCallback)((e) => {
54502
+ if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
54503
+ if (onBlurProp) onBlurProp(e);
54504
+ if (onFocusChange) onFocusChange(false);
54505
+ return true;
54506
+ }
54507
+ }, [
54508
+ onBlurProp,
54509
+ onFocusChange
54510
+ ]);
54511
+ const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
54512
+ const onFocus = (React178.useCallback)((e) => {
54513
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54514
+ const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
54515
+ const activeElement = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
54516
+ if (eventTarget === e.currentTarget && eventTarget === activeElement) {
54517
+ if (onFocusProp) onFocusProp(e);
54518
+ if (onFocusChange) onFocusChange(true);
54519
+ onSyntheticFocus(e);
54520
+ }
54521
+ }, [
54522
+ onFocusChange,
54523
+ onFocusProp,
54524
+ onSyntheticFocus
54525
+ ]);
54526
+ return {
54527
+ focusProps: {
54528
+ onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
54529
+ onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
54530
+ }
54531
+ };
54532
+ }
54533
+ function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
54534
+ const objRef = (React178.useRef)(null);
54535
+ const cleanupRef = (React178.useRef)(void 0);
54536
+ const refEffect = (React178.useCallback)((instance) => {
54537
+ if (typeof ref === "function") {
54538
+ const refCallback = ref;
54539
+ const refCleanup = refCallback(instance);
54540
+ return () => {
54541
+ if (typeof refCleanup === "function") refCleanup();
54542
+ else refCallback(null);
54543
+ };
54544
+ } else if (ref) {
54545
+ ref.current = instance;
54546
+ return () => {
54547
+ ref.current = null;
54548
+ };
54549
+ }
54550
+ }, [
54551
+ ref
54552
+ ]);
54553
+ return (React178.useMemo)(
54554
+ () => ({
54555
+ get current() {
54556
+ return objRef.current;
54557
+ },
54558
+ set current(value) {
54559
+ objRef.current = value;
54560
+ if (cleanupRef.current) {
54561
+ cleanupRef.current();
54562
+ cleanupRef.current = void 0;
54563
+ }
54564
+ if (value != null) cleanupRef.current = refEffect(value);
54565
+ }
54566
+ }),
54567
+ // oxlint-disable-next-line react/react-compiler
54568
+ [
54569
+ refEffect
54570
+ ]
54571
+ );
54572
+ }
54573
+ var $fe16bffc7a557bf0$var$useEarlyEffect = (React178__default.default)["useInsertionEffect"] ?? ($c4867b2f328c2698$export$e5c5a5f917a5871c);
54574
+ function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
54575
+ const ref = (React178.useRef)(null);
54576
+ $fe16bffc7a557bf0$var$useEarlyEffect(() => {
54577
+ ref.current = fn;
54578
+ }, [
54579
+ fn
54580
+ ]);
54581
+ return (React178.useCallback)((...args) => {
54582
+ const f = ref.current;
54583
+ return f?.(...args);
54584
+ }, []);
54585
+ }
54586
+ function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
54587
+ let globalListeners = (React178.useRef)(/* @__PURE__ */ new Map());
54588
+ let addGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
54589
+ let fn = options?.once ? (...args) => {
54590
+ globalListeners.current.delete(listener);
54591
+ listener(...args);
54592
+ } : listener;
54593
+ globalListeners.current.set(listener, {
54594
+ type,
54595
+ eventTarget,
54596
+ fn,
54597
+ options
54598
+ });
54599
+ eventTarget.addEventListener(type, fn, options);
54600
+ }, []);
54601
+ let removeGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
54602
+ let fn = globalListeners.current.get(listener)?.fn || listener;
54603
+ eventTarget.removeEventListener(type, fn, options);
54604
+ globalListeners.current.delete(listener);
54605
+ }, []);
54606
+ let removeAllGlobalListeners = (React178.useCallback)(() => {
54607
+ globalListeners.current.forEach((value, key) => {
54608
+ removeGlobalListener(value.eventTarget, value.type, key, value.options);
54609
+ });
54610
+ }, [
54611
+ removeGlobalListener
54612
+ ]);
54613
+ (React178.useEffect)(() => {
54614
+ return removeAllGlobalListeners;
54615
+ }, [
54616
+ removeAllGlobalListeners
54617
+ ]);
54618
+ return {
54619
+ addGlobalListener,
54620
+ removeGlobalListener,
54621
+ removeAllGlobalListeners
54622
+ };
54623
+ }
54590
54624
  function $2c9edc598a03d523$export$420e68273165f4ec(props2) {
54591
54625
  let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props2;
54592
54626
  let state = (React178.useRef)({