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