@baseline-ui/core 3.6.0 → 3.8.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/Accordion.mjs +1 -1
- package/dist/ActionGroup.mjs +1 -1
- package/dist/ActionIconButton.mjs +1 -1
- package/dist/AlertDialog.mjs +1 -1
- package/dist/AudioPlayer.mjs +1 -1
- package/dist/Box.mjs +1 -1
- package/dist/ButtonSelect.mjs +1 -1
- package/dist/Calendar.css +1 -1
- package/dist/Calendar.mjs +1 -1
- package/dist/ColorInput.mjs +1 -1
- package/dist/ColorSwatch.mjs +1 -1
- package/dist/ColorSwatchPicker.mjs +1 -1
- package/dist/ComboBox.mjs +1 -1
- package/dist/DateField.css +1 -1
- package/dist/DateField.mjs +1 -1
- package/dist/Dialog.mjs +1 -1
- package/dist/Disclosure.mjs +1 -1
- package/dist/Drawer.mjs +1 -1
- package/dist/Editor.css +1 -1
- package/dist/Editor.mjs +1 -1
- package/dist/FileInput.mjs +1 -1
- package/dist/FileList.css +1 -1
- package/dist/FileList.mjs +1 -1
- package/dist/FileUploader.css +1 -1
- package/dist/FileUploader.mjs +1 -1
- package/dist/FreehandCanvas.mjs +1 -1
- package/dist/GridList.mjs +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.css +10 -0
- package/dist/Image.mjs +1 -0
- package/dist/ImageDropZone.mjs +1 -1
- package/dist/ImageGallery.mjs +1 -1
- package/dist/InlineAlert.mjs +1 -1
- package/dist/InlineToolbar.mjs +2 -2
- package/dist/Kbd.mjs +1 -1
- package/dist/ListBox.mjs +1 -1
- package/dist/Markdown.css +1 -1
- package/dist/Markdown.mjs +1 -1
- package/dist/Menu.mjs +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/NumberInput.mjs +1 -1
- package/dist/Pagination.mjs +1 -1
- package/dist/PointPicker.mjs +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/Portal.mjs +1 -1
- package/dist/Preview.mjs +1 -1
- package/dist/RadioGroup.mjs +1 -1
- package/dist/Reaction.mjs +1 -1
- package/dist/SearchInput.mjs +1 -1
- package/dist/Select.mjs +1 -1
- package/dist/Slider.mjs +1 -1
- package/dist/StatusCard.mjs +1 -1
- package/dist/Stepper.mjs +1 -1
- package/dist/Switch.css +1 -1
- package/dist/Switch.mjs +1 -1
- package/dist/Tabs.mjs +1 -1
- package/dist/Tag.mjs +1 -1
- package/dist/TagGroup.mjs +1 -1
- package/dist/TaggedPagination.mjs +1 -1
- package/dist/TextInput.mjs +1 -1
- package/dist/ThemeProvider.mjs +1 -1
- package/dist/TimeField.mjs +1 -1
- package/dist/Toast.mjs +1 -1
- package/dist/ToggleIconButton.mjs +1 -1
- package/dist/Toolbar.mjs +1 -1
- package/dist/Tooltip.mjs +1 -1
- package/dist/TreeView.css +1 -1
- package/dist/TreeView.mjs +1 -1
- package/dist/UNSAFE_ListBox.mjs +1 -1
- package/dist/{chunk-UY76QEJC.mjs → chunk-2BG2JLFC.mjs} +1 -1
- package/dist/{chunk-XG6JJCCJ.mjs → chunk-2JRDTJWJ.mjs} +1 -1
- package/dist/{chunk-JTKDC2CM.mjs → chunk-2OXYNLVN.mjs} +1 -1
- package/dist/{chunk-C2B7L5CL.mjs → chunk-2TXFCYPO.mjs} +1 -1
- package/dist/{chunk-266F6F4Y.mjs → chunk-3IPRT57V.mjs} +1 -1
- package/dist/{chunk-ARCCPNHM.mjs → chunk-3TLWTZRL.mjs} +1 -1
- package/dist/chunk-3WX5PZ6X.mjs +10 -0
- package/dist/{chunk-6M77HEKA.mjs → chunk-464QF4AV.mjs} +2 -2
- package/dist/chunk-46VEK5WC.mjs +10 -0
- package/dist/chunk-54WJJ3EM.mjs +10 -0
- package/dist/chunk-54ZKQAA3.mjs +10 -0
- package/dist/chunk-57YWI7EG.mjs +10 -0
- package/dist/{chunk-7OUGARUO.mjs → chunk-5GW36EQJ.mjs} +1 -1
- package/dist/{chunk-XDTZXNGJ.mjs → chunk-5YKRWGEJ.mjs} +1 -1
- package/dist/chunk-64IFEFOT.mjs +30 -0
- package/dist/{chunk-HABKIEKC.mjs → chunk-655SS7D4.mjs} +1 -1
- package/dist/chunk-65PMDBYL.mjs +10 -0
- package/dist/{chunk-LRF3YZWU.mjs → chunk-6CEV43ZA.mjs} +1 -1
- package/dist/chunk-6MUTSHZO.mjs +10 -0
- package/dist/chunk-6TRBOQVN.mjs +10 -0
- package/dist/chunk-73UBSCJ2.mjs +10 -0
- package/dist/chunk-7JE2SRIH.mjs +10 -0
- package/dist/chunk-AGERZJ3X.mjs +10 -0
- package/dist/{chunk-ZI7HJRJA.mjs → chunk-CTTNZESA.mjs} +1 -1
- package/dist/{chunk-O7XK2WIX.mjs → chunk-DIL5HL6K.mjs} +2 -2
- package/dist/{chunk-PYV5J322.mjs → chunk-EFFODO2N.mjs} +1 -1
- package/dist/{chunk-XYK5KKOH.mjs → chunk-EJYSTNXD.mjs} +2 -2
- package/dist/{chunk-GDIKHTP3.mjs → chunk-EXX7ZFGI.mjs} +1 -1
- package/dist/{chunk-5VNC6UYE.mjs → chunk-F3THHK5C.mjs} +1 -1
- package/dist/{chunk-F67SYAEW.mjs → chunk-FWPWBCOS.mjs} +1 -1
- package/dist/{chunk-ZXEWW3E7.mjs → chunk-G5MSZV5O.mjs} +1 -1
- package/dist/{chunk-RITIRWKN.mjs → chunk-GIT77HDD.mjs} +2 -2
- package/dist/chunk-GJ6ZPLFR.mjs +10 -0
- package/dist/{chunk-XSORBGUU.mjs → chunk-GYIIVZDE.mjs} +1 -1
- package/dist/{chunk-3PU6C5US.mjs → chunk-HKVAL4BB.mjs} +2 -2
- package/dist/{chunk-2KX2HY2H.mjs → chunk-HU75NQMI.mjs} +1 -1
- package/dist/chunk-HV7DKEN7.mjs +10 -0
- package/dist/chunk-K3WFKO7R.mjs +10 -0
- package/dist/chunk-KOPAIJJU.mjs +10 -0
- package/dist/{chunk-7EQIV4GX.mjs → chunk-LDWNE2JT.mjs} +1 -1
- package/dist/{chunk-IC5SBDP3.mjs → chunk-LLSXABBJ.mjs} +1 -1
- package/dist/{chunk-6LP7UKPC.mjs → chunk-MHO7BDER.mjs} +1 -1
- package/dist/chunk-MN7USKSC.mjs +10 -0
- package/dist/{chunk-RUHZRYDJ.mjs → chunk-N7MIERZH.mjs} +1 -1
- package/dist/{chunk-FF7H33Z5.mjs → chunk-NLVJYKSA.mjs} +1 -1
- package/dist/chunk-OBEPT4LR.mjs +10 -0
- package/dist/{chunk-VJUSOXPW.mjs → chunk-OHTPDCQA.mjs} +1 -1
- package/dist/{chunk-G2T6UJ66.mjs → chunk-OTDBW5FO.mjs} +1 -1
- package/dist/chunk-PMMLDGSP.mjs +10 -0
- package/dist/{chunk-HJGMXLKN.mjs → chunk-PSAOTHYG.mjs} +1 -1
- package/dist/chunk-PSUCNVCE.mjs +10 -0
- package/dist/{chunk-SH7ZI4CA.mjs → chunk-RIVN2JT3.mjs} +1 -1
- package/dist/{chunk-K4N2ADJO.mjs → chunk-RRYP54UI.mjs} +1 -1
- package/dist/{chunk-SLFKSR3T.mjs → chunk-SAATXQOW.mjs} +1 -1
- package/dist/chunk-SCUNJNIO.mjs +0 -0
- package/dist/chunk-SND4G3LM.mjs +10 -0
- package/dist/{chunk-GJTOYWLJ.mjs → chunk-SOWGXN5P.mjs} +1 -1
- package/dist/{chunk-XKUZVQ2A.mjs → chunk-TCVES3WI.mjs} +1 -1
- package/dist/{chunk-7KZEJYIU.mjs → chunk-TU7JTGGE.mjs} +1 -1
- package/dist/{chunk-GFKZXGWJ.mjs → chunk-UCDGZFQ7.mjs} +1 -1
- package/dist/{chunk-VZ5CLAIL.mjs → chunk-UCIAWI4E.mjs} +1 -1
- package/dist/chunk-VE2UA2AH.mjs +0 -0
- package/dist/{chunk-JDIGAVFU.mjs → chunk-VIMSH5F5.mjs} +1 -1
- package/dist/chunk-VPVF5N62.mjs +10 -0
- package/dist/chunk-VQ2K6Q3G.mjs +10 -0
- package/dist/{chunk-WB7EFOP7.mjs → chunk-VQPEDDH6.mjs} +1 -1
- package/dist/{chunk-HCQI7MNN.mjs → chunk-WQBA2P6W.mjs} +1 -1
- package/dist/{chunk-LQHFBXCW.mjs → chunk-X3ACY7IY.mjs} +2 -2
- package/dist/chunk-XC2S3RLC.mjs +10 -0
- package/dist/{chunk-7HVUCDKZ.mjs → chunk-XWKTG7NR.mjs} +1 -1
- package/dist/{chunk-2CXZQGP5.mjs → chunk-YLL2APKH.mjs} +1 -1
- package/dist/{chunk-ZNLIC44U.mjs → chunk-YNJD34U4.mjs} +1 -1
- package/dist/{chunk-J2KZM2I2.mjs → chunk-Z73YU5ZQ.mjs} +1 -1
- package/dist/{chunk-4T7P66ZA.mjs → chunk-ZE2B6BS7.mjs} +1 -1
- package/dist/{chunk-RFVLSR2P.mjs → chunk-ZLDFLERD.mjs} +1 -1
- package/dist/hooks/useMedia.mjs +1 -1
- package/dist/hooks/useTextSelection.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +455 -113
- package/dist/index.js +22 -21
- package/dist/index.mjs +1 -1
- package/dist/utils/selection.mjs +1 -0
- package/package.json +5 -5
- package/sbom.json +13 -13
- package/dist/chunk-335C37NB.mjs +0 -10
- package/dist/chunk-3RWM6E56.mjs +0 -10
- package/dist/chunk-3YVVIFY7.mjs +0 -10
- package/dist/chunk-42SQX2EB.mjs +0 -10
- package/dist/chunk-AMLFQDKI.mjs +0 -10
- package/dist/chunk-EIB7MPRA.mjs +0 -10
- package/dist/chunk-GAT5QH2M.mjs +0 -10
- package/dist/chunk-GTHN5ZCZ.mjs +0 -10
- package/dist/chunk-GYKBMDSJ.mjs +0 -10
- package/dist/chunk-IHES52NR.mjs +0 -10
- package/dist/chunk-JKOCFSBH.mjs +0 -10
- package/dist/chunk-KX2GDQKJ.mjs +0 -10
- package/dist/chunk-LV5AUNI2.mjs +0 -10
- package/dist/chunk-NMGKHMH3.mjs +0 -10
- package/dist/chunk-O4YMXTNR.mjs +0 -10
- package/dist/chunk-QC76UPJB.mjs +0 -29
- package/dist/chunk-RFVPGD6N.mjs +0 -10
- package/dist/chunk-RXVMJVRX.mjs +0 -10
- package/dist/chunk-TTJTZLW5.mjs +0 -10
- package/dist/chunk-ZP6QG5FX.mjs +0 -10
- /package/dist/{chunk-MAJ74VNE.mjs → chunk-HMAVZPRE.mjs} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$c}from'./chunk-5BAHJXOI.mjs';import {a as a$b}from'./chunk-YF63IQQR.mjs';import {a as a$2}from'./chunk-CY6W27WG.mjs';import {a as a$4}from'./chunk-6QQEK5I6.mjs';import {d as d$1}from'./chunk-W6QO7FPZ.mjs';import {a as a$9}from'./chunk-DIL5HL6K.mjs';import {a as a$7,b as b$4}from'./chunk-XMGPNXZH.mjs';import {e,d as d$3}from'./chunk-GMALMQWI.mjs';import {a as a$a}from'./chunk-CV6JQGJ3.mjs';import {b as b$1,a as a$h}from'./chunk-KG2EHFYA.mjs';import {a,b as b$3}from'./chunk-YHI2PD3M.mjs';import {b as b$2}from'./chunk-N2XGJKZG.mjs';import {d,f,b as b$5}from'./chunk-GQIS4QBN.mjs';import {a as a$g}from'./chunk-Y2MIU76N.mjs';import {a as a$e}from'./chunk-AI6WQPRX.mjs';import {a as a$6}from'./chunk-FPM5UJRF.mjs';import {a as a$3}from'./chunk-4QBHQCCK.mjs';import {a as a$8}from'./chunk-STMDFIUL.mjs';import {b}from'./chunk-4S4GGUSH.mjs';import {j}from'./chunk-KUDCYGII.mjs';import {d as d$2}from'./chunk-F7WPMQ3P.mjs';import {u,h as h$1}from'./chunk-PPHSLODC.mjs';import {c}from'./chunk-3WKDIXCM.mjs';import {a as a$5}from'./chunk-SVIYLH7R.mjs';import {a as a$f,c as c$1}from'./chunk-ETM4MNG4.mjs';import {j as j$1,a as a$d,h,i,e as e$1}from'./chunk-SD43KVTU.mjs';import {a as a$1}from'./chunk-JQQGRJ5J.mjs';import ga,{useRef,useMemo,useEffect,useState}from'react';import {DateFormatter,isEqualCalendar,toCalendar,GregorianCalendar,CalendarDate,now,getLocalTimeZone,toCalendarDate,toCalendarDateTime}from'@internationalized/date';import {jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var te={"ar-AE":{calendar:"\u0627\u0644\u062A\u0642\u0648\u064A\u0645",day:"\u064A\u0648\u0645",dayPeriod:"\u0635/\u0645",endDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621",era:"\u0627\u0644\u0639\u0635\u0631",hour:"\u0627\u0644\u0633\u0627\u0639\u0627\u062A",minute:"\u0627\u0644\u062F\u0642\u0627\u0626\u0642",month:"\u0627\u0644\u0634\u0647\u0631",second:"\u0627\u0644\u062B\u0648\u0627\u0646\u064A",selectedDateDescription:e=>`\u062A\u0627\u0631\u064A\u062E \u0645\u062D\u062F\u062F: ${e.date}`,selectedRangeDescription:e=>`\u0627\u0644\u0645\u062F\u0649 \u0627\u0644\u0632\u0645\u0646\u064A \u0627\u0644\u0645\u062D\u062F\u062F: ${e.startDate} \u0625\u0644\u0649 ${e.endDate}`,selectedTimeDescription:e=>`\u0627\u0644\u0648\u0642\u062A \u0627\u0644\u0645\u062D\u062F\u062F: ${e.time}`,startDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621",timeZoneName:"\u0627\u0644\u062A\u0648\u0642\u064A\u062A",weekday:"\u0627\u0644\u064A\u0648\u0645",year:"\u0627\u0644\u0633\u0646\u0629"},"bg-BG":{calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D",dayPeriod:"\u043F\u0440.\u043E\u0431./\u0441\u043B.\u043E\u0431.",endDate:"\u041A\u0440\u0430\u0439\u043D\u0430 \u0434\u0430\u0442\u0430",era:"\u0435\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:e=>`\u0418\u0437\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${e.date}`,selectedRangeDescription:e=>`\u0418\u0437\u0431\u0440\u0430\u043D \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: ${e.startDate} \u0434\u043E ${e.endDate}`,selectedTimeDescription:e=>`\u0418\u0437\u0431\u0440\u0430\u043D\u043E \u0432\u0440\u0435\u043C\u0435: ${e.time}`,startDate:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430 \u0434\u0430\u0442\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0435\u043D \u043E\u0442 \u0441\u0435\u0434\u043C\u0438\u0446\u0430\u0442\u0430",year:"\u0433\u043E\u0434\u0438\u043D\u0430"},"cs-CZ":{calendar:"Kalend\xE1\u0159",day:"den",dayPeriod:"\u010D\xE1st dne",endDate:"Kone\u010Dn\xE9 datum",era:"letopo\u010Det",hour:"hodina",minute:"minuta",month:"m\u011Bs\xEDc",second:"sekunda",selectedDateDescription:e=>`Vybran\xE9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xE9 obdob\xED: ${e.startDate} a\u017E ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xFD \u010Das: ${e.time}`,startDate:"Po\u010D\xE1te\u010Dn\xED datum",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"den v t\xFDdnu",year:"rok"},"da-DK":{calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xE6ra",hour:"time",minute:"minut",month:"m\xE5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xE5r"},"de-DE":{calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xE4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgew\xE4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xE4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xE4hlte Zeit: ${e.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"},"el-GR":{calendar:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BB\u03CC\u03B3\u03B9\u03BF",day:"\u03B7\u03BC\u03AD\u03C1\u03B1",dayPeriod:"\u03C0.\u03BC./\u03BC.\u03BC.",endDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2",era:"\u03C0\u03B5\u03C1\u03AF\u03BF\u03B4\u03BF\u03C2",hour:"\u03CE\u03C1\u03B1",minute:"\u03BB\u03B5\u03C0\u03C4\u03CC",month:"\u03BC\u03AE\u03BD\u03B1\u03C2",second:"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF",selectedDateDescription:e=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1: ${e.date}`,selectedRangeDescription:e=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03BF \u03B5\u03CD\u03C1\u03BF\u03C2: ${e.startDate} \u03AD\u03C9\u03C2 ${e.endDate}`,selectedTimeDescription:e=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03CE\u03C1\u03B1: ${e.time}`,startDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2",timeZoneName:"\u03B6\u03CE\u03BD\u03B7 \u03CE\u03C1\u03B1\u03C2",weekday:"\u03BA\u03B1\u03B8\u03B7\u03BC\u03B5\u03C1\u03B9\u03BD\u03AE",year:"\u03AD\u03C4\u03BF\u03C2"},"en-US":{era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`},"es-ES":{calendar:"Calendario",day:"d\xEDa",dayPeriod:"a.\xA0m./p.\xA0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xEDa de la semana",year:"a\xF1o"},"et-EE":{calendar:"Kalender",day:"p\xE4ev",dayPeriod:"enne/p\xE4rast l\xF5unat",endDate:"L\xF5ppkuup\xE4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuup\xE4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuup\xE4ev",timeZoneName:"ajav\xF6\xF6nd",weekday:"n\xE4dalap\xE4ev",year:"aasta"},"fi-FI":{calendar:"Kalenteri",day:"p\xE4iv\xE4",dayPeriod:"vuorokaudenaika",endDate:"P\xE4\xE4ttymisp\xE4iv\xE4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu p\xE4iv\xE4m\xE4\xE4r\xE4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xE4li: ${e.startDate} \u2013 ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamisp\xE4iv\xE4",timeZoneName:"aikavy\xF6hyke",weekday:"viikonp\xE4iv\xE4",year:"vuosi"},"fr-FR":{calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xE8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date s\xE9lectionn\xE9e\xA0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xE9lectionn\xE9e\xA0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xA0: ${e.time}`,startDate:"Date de d\xE9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xE9e"},"he-IL":{calendar:"\u05DC\u05D5\u05D7 \u05E9\u05E0\u05D4",day:"\u05D9\u05D5\u05DD",dayPeriod:"\u05DC\u05E4\u05E0\u05D4\u05F4\u05E6/\u05D0\u05D7\u05D4\u05F4\u05E6",endDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05E1\u05D9\u05D5\u05DD",era:"\u05EA\u05E7\u05D5\u05E4\u05D4",hour:"\u05E9\u05E2\u05D4",minute:"\u05D3\u05E7\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",second:"\u05E9\u05E0\u05D9\u05D9\u05D4",selectedDateDescription:e=>`\u05EA\u05D0\u05E8\u05D9\u05DA \u05E0\u05D1\u05D7\u05E8: ${e.date}`,selectedRangeDescription:e=>`\u05D8\u05D5\u05D5\u05D7 \u05E0\u05D1\u05D7\u05E8: ${e.startDate} \u05E2\u05D3 ${e.endDate}`,selectedTimeDescription:e=>`\u05D6\u05DE\u05DF \u05E0\u05D1\u05D7\u05E8: ${e.time}`,startDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05EA\u05D7\u05DC\u05D4",timeZoneName:"\u05D0\u05D6\u05D5\u05E8 \u05D6\u05DE\u05DF",weekday:"\u05D9\u05D5\u05DD \u05D1\u05E9\u05D1\u05D5\u05E2",year:"\u05E9\u05E0\u05D4"},"hr-HR":{calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum zavr\u0161etka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum po\u010Detka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"},"hu-HU":{calendar:"Napt\xE1r",day:"nap",dayPeriod:"napszak",endDate:"Befejez\u0151 d\xE1tum",era:"\xE9ra",hour:"\xF3ra",minute:"perc",month:"h\xF3nap",second:"m\xE1sodperc",selectedDateDescription:e=>`Kijel\xF6lt d\xE1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xF6lt tartom\xE1ny: ${e.startDate}\u2013${e.endDate}`,selectedTimeDescription:e=>`Kijel\xF6lt id\u0151: ${e.time}`,startDate:"Kezd\u0151 d\xE1tum",timeZoneName:"id\u0151z\xF3na",weekday:"h\xE9t napja",year:"\xE9v"},"it-IT":{calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"},"ja-JP":{calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",day:"\u65E5",dayPeriod:"\u5348\u524D/\u5348\u5F8C",endDate:"\u7D42\u4E86\u65E5",era:"\u6642\u4EE3",hour:"\u6642",minute:"\u5206",month:"\u6708",second:"\u79D2",selectedDateDescription:e=>`\u9078\u629E\u3057\u305F\u65E5\u4ED8 : ${e.date}`,selectedRangeDescription:e=>`\u9078\u629E\u7BC4\u56F2 : ${e.startDate} \u304B\u3089 ${e.endDate}`,selectedTimeDescription:e=>`\u9078\u629E\u3057\u305F\u6642\u9593 : ${e.time}`,startDate:"\u958B\u59CB\u65E5",timeZoneName:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",weekday:"\u66DC\u65E5",year:"\u5E74"},"ko-KR":{calendar:"\uB2EC\uB825",day:"\uC77C",dayPeriod:"\uC624\uC804/\uC624\uD6C4",endDate:"\uC885\uB8CC\uC77C",era:"\uC5F0\uD638",hour:"\uC2DC",minute:"\uBD84",month:"\uC6D4",second:"\uCD08",selectedDateDescription:e=>`\uC120\uD0DD \uC77C\uC790: ${e.date}`,selectedRangeDescription:e=>`\uC120\uD0DD \uBC94\uC704: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\uC120\uD0DD \uC2DC\uAC04: ${e.time}`,startDate:"\uC2DC\uC791\uC77C",timeZoneName:"\uC2DC\uAC04\uB300",weekday:"\uC694\uC77C",year:"\uB144"},"lt-LT":{calendar:"Kalendorius",day:"diena",dayPeriod:"iki piet\u0173 / po piet\u0173",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minut\u0117",month:"m\u0117nuo",second:"sekund\u0117",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Prad\u017Eios data",timeZoneName:"laiko juosta",weekday:"savait\u0117s diena",year:"metai"},"lv-LV":{calendar:"Kalend\u0101rs",day:"diena",dayPeriod:"priek\u0161pusdien\u0101/p\u0113cpusdien\u0101",endDate:"Beigu datums",era:"\u0113ra",hour:"stundas",minute:"min\u016Btes",month:"m\u0113nesis",second:"sekundes",selectedDateDescription:e=>`Atlas\u012Btais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u012Btais diapazons: no ${e.startDate} l\u012Bdz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u012Btais laiks: ${e.time}`,startDate:"S\u0101kuma datums",timeZoneName:"laika josla",weekday:"ned\u0113\u013Cas diena",year:"gads"},"nb-NO":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xE5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xE5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xE5r"},"nl-NL":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"},"pl-PL":{calendar:"Kalendarz",day:"dzie\u0144",dayPeriod:"rano / po po\u0142udniu / wieczorem",endDate:"Data ko\u0144cowa",era:"era",hour:"godzina",minute:"minuta",month:"miesi\u0105c",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data pocz\u0105tkowa",timeZoneName:"strefa czasowa",weekday:"dzie\u0144 tygodnia",year:"rok"},"pt-BR":{calendar:"Calend\xE1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"},"pt-PT":{calendar:"Calend\xE1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xE9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de In\xEDcio",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"},"ro-RO":{calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dat\u0103 final",era:"er\u0103",hour:"or\u0103",minute:"minut",month:"lun\u0103",second:"secund\u0103",selectedDateDescription:e=>`Dat\u0103 selectat\u0103: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xE2n\u0103 la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u0103: ${e.time}`,startDate:"Dat\u0103 \xEEnceput",timeZoneName:"fus orar",weekday:"ziua din s\u0103pt\u0103m\xE2n\u0103",year:"an"},"ru-RU":{calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",day:"\u0434\u0435\u043D\u044C",dayPeriod:"AM/PM",endDate:"\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",era:"\u044D\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u044F\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:e=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430: ${e.date}`,selectedRangeDescription:e=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: \u0441 ${e.startDate} \u043F\u043E ${e.endDate}`,selectedTimeDescription:e=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F: ${e.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u043D\u0435\u0434\u0435\u043B\u0438",year:"\u0433\u043E\u0434"},"sk-SK":{calendar:"Kalend\xE1r",day:"de\u0148",dayPeriod:"AM/PM",endDate:"D\xE1tum ukon\u010Denia",era:"letopo\u010Det",hour:"hodina",minute:"min\xFAta",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybrat\xFD d\xE1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xFD rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xFD \u010Das: ${e.time}`,startDate:"D\xE1tum za\u010Datia",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"de\u0148 t\xFD\u017Ed\u0148a",year:"rok"},"sl-SI":{calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u010Dje: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u010Das: ${e.time}`,startDate:"Datum za\u010Detka",timeZoneName:"\u010Dasovni pas",weekday:"dan v tednu",year:"leto"},"sr-SP":{calendar:"Kalendar",day:"\u0434\u0430\u043D",dayPeriod:"\u043F\u0440\u0435 \u043F\u043E\u0434\u043D\u0435/\u043F\u043E \u043F\u043E\u0434\u043D\u0435",endDate:"Datum zavr\u0161etka",era:"\u0435\u0440\u0430",hour:"\u0441\u0430\u0442",minute:"\u043C\u0438\u043D\u0443\u0442",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum po\u010Detka",timeZoneName:"\u0432\u0440\u0435\u043C\u0435\u043D\u0441\u043A\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0430\u043D \u0443 \u043D\u0435\u0434\u0435\u0459\u0438",year:"\u0433\u043E\u0434\u0438\u043D\u0430"},"sv-SE":{calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xE5nad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xE5r"},"tr-TR":{calendar:"Takvim",day:"g\xFCn",dayPeriod:"\xD6\xD6/\xD6S",endDate:"Biti\u015F Tarihi",era:"\xE7a\u011F",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Se\xE7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xE7ilen Aral\u0131k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xE7ilen Zaman: ${e.time}`,startDate:"Ba\u015Flang\u0131\xE7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftan\u0131n g\xFCn\xFC",year:"y\u0131l"},"uk-UA":{calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D\u044C",dayPeriod:"\u0434\u043F/\u043F\u043F",endDate:"\u0414\u0430\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F",era:"\u0435\u0440\u0430",hour:"\u0433\u043E\u0434\u0438\u043D\u0430",minute:"\u0445\u0432\u0438\u043B\u0438\u043D\u0430",month:"\u043C\u0456\u0441\u044F\u0446\u044C",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:e=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${e.date}`,selectedRangeDescription:e=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D: ${e.startDate} \u2014 ${e.endDate}`,selectedTimeDescription:e=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0447\u0430\u0441: ${e.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0438\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u0442\u0438\u0436\u043D\u044F",year:"\u0440\u0456\u043A"},"zh-CN":{calendar:"\u65E5\u5386",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7ED3\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:e=>`\u9009\u5B9A\u7684\u65E5\u671F\uFF1A${e.date}`,selectedRangeDescription:e=>`\u9009\u5B9A\u7684\u8303\u56F4\uFF1A${e.startDate} \u81F3 ${e.endDate}`,selectedTimeDescription:e=>`\u9009\u5B9A\u7684\u65F6\u95F4\uFF1A${e.time}`,startDate:"\u5F00\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"},"zh-TW":{calendar:"\u65E5\u66C6",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7D50\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:e=>`\u9078\u5B9A\u7684\u65E5\u671F\uFF1A${e.date}`,selectedRangeDescription:e=>`\u9078\u5B9A\u7684\u7BC4\u570D\uFF1A${e.startDate} \u81F3 ${e.endDate}`,selectedTimeDescription:e=>`\u9078\u5B9A\u7684\u6642\u9593\uFF1A${e.time}`,startDate:"\u958B\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"}};function Je(e$1,a,t){let{direction:r}=b$2(),i=useMemo(()=>e(a),[a]),{keyboardProps:n}=j({shortcuts:{"Alt+ArrowDown":()=>{if("setOpen"in e$1){e$1.setOpen(true);return}return false},"Alt+ArrowUp":()=>{if("setOpen"in e$1){e$1.setOpen(true);return}return false},ArrowLeft:o=>{if(t)return false;if(r==="rtl"){if(a.current){let c=j$1(o),m=Ye(a.current,c.getBoundingClientRect().left,-1);if(m){m.focus();return}}}else {i.focusPrevious();return}return false},ArrowRight:o=>{if(t)return false;if(r==="rtl"){if(a.current){let c=j$1(o),m=Ye(a.current,c.getBoundingClientRect().left,1);if(m){m.focus();return}}}else {i.focusNext();return}return false}},allowRepeats:true}),u=o=>{if(!a.current)return;let c=d$3(a.current,{tabbable:true});if(o&&(c.currentNode=o,o=c.previousNode()),!o){let m;do m=c.lastChild(),m&&(o=m);while(m)}for(;o?.hasAttribute("data-placeholder");){let m=c.previousNode();if(m&&m.hasAttribute("data-placeholder"))o=m;else break}o&&o.focus();},{pressProps:s}=d$2({preventFocusOnPress:true,allowTextSelectionOnPress:true});return c(s,n,{onPointerDown(o){o.pointerType==="mouse"&&u(j$1(o));},onPointerUp(o){(o.pointerType==="touch"||o.pointerType==="pen")&&u(j$1(o));},onMouseDown(o){typeof PointerEvent>"u"&&u(j$1(o));},onTouchEnd(o){typeof PointerEvent>"u"&&u(j$1(o));}})}function Ye(e,a,t){let r=d$3(e,{tabbable:true}),i=r.nextNode(),n=null,u=1/0;for(;i;){let o=i.getBoundingClientRect().left-a,c=Math.abs(o);Math.sign(o)===t&&c<u&&(n=i,u=c),i=r.nextNode();}return n}var pe=new WeakMap,De="__reactAriaDateFieldRole",Da="__reactAriaDateFieldFocusManager";function Xe(e$1,a,t){let{isInvalid:r,validationErrors:i,validationDetails:n}=a.displayValidation,{labelProps:u,fieldProps:s,descriptionProps:o,errorMessageProps:c$1}=a$2({...e$1,labelElementType:"span",isInvalid:r,errorMessage:e$1.errorMessage||i,ref:t}),m=useRef(null),{focusWithinProps:y}=b({...e$1,onFocusWithin(S){m.current=a.value,e$1.onFocus?.(S);},onBlurWithin:S=>{a.confirmPlaceholder(),a.value!==m.current&&a.commitValidation(),e$1.onBlur?.(S);},onFocusWithinChange:e$1.onFocusChange}),h=b$1(te,"@react-aria/datepicker"),p=a.maxGranularity==="hour"?"selectedTimeDescription":"selectedDateDescription",D=a.maxGranularity==="hour"?"time":"date",v=a.value?h.format(p,{[D]:a.formatValue({month:"long"})}):"",P=d(v,t),x=e$1[De]==="presentation"?s["aria-describedby"]:[P["aria-describedby"],s["aria-describedby"]].filter(Boolean).join(" ")||void 0,F=e$1[Da],g=useMemo(()=>F||e(t),[F,t]),V=Je(a,t,e$1[De]==="presentation");pe.set(a,{ariaLabel:e$1["aria-label"],ariaLabelledBy:[u.id,e$1["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:x,focusManager:g});let w=useRef(e$1.autoFocus),R;e$1[De]==="presentation"?R={role:"presentation"}:R=c(s,{role:"group","aria-disabled":e$1.isDisabled||void 0,"aria-describedby":x}),useEffect(()=>{w.current&&g.focusFirst(),w.current=false;},[g]),a$3(e$1.inputRef,a.defaultValue,a.setValue),a$4({...e$1,focus(){g.focusFirst();}},a,e$1.inputRef);let T={type:"hidden",name:e$1.name,form:e$1.form,value:a.value?.toString()||"",disabled:e$1.isDisabled};e$1.validationBehavior==="native"&&(T.type="text",T.hidden=true,T.required=e$1.isRequired,T.onChange=()=>{});let A=a$5(e$1);return {labelProps:{...u,onClick:()=>{g.focusFirst();}},fieldProps:c(A,R,V,y,{onKeyDown:e$1.onKeyDown,onKeyUp:e$1.onKeyUp,style:{unicodeBidi:"isolate"}}),inputProps:T,descriptionProps:o,errorMessageProps:c$1,isInvalid:r,validationErrors:i,validationDetails:n}}function st(e,a,t){let r=Xe(e,a,t);return r.inputProps.value=a.timeValue?.toString()||"",r}function ea(){let{locale:e}=b$2(),a=a$h(te,"@react-aria/datepicker");return useMemo(()=>{try{return new Intl.DisplayNames(e,{type:"dateTimeField"})}catch{return new fe(e,a)}},[e,a])}var fe=class{locale;dictionary;constructor(a,t){this.locale=a,this.dictionary=t;}of(a){return this.dictionary.getStringForLocale(a,this.locale)}};function he(e,a,t){let r=useRef(""),{locale:i$1,direction:n}=b$2(),u$1=ea(),{ariaLabel:s,ariaLabelledBy:o,ariaDescribedBy:c$2,focusManager:m}=pe.get(a),[y,h$2]=useState(null),p=e.isPlaceholder?"":e.text,D=useMemo(()=>a.dateFormatter.resolvedOptions(),[a.dateFormatter]),v=a$a({month:"long",timeZone:D.timeZone}),P=a$a({hour:"numeric",hour12:D.hour12,timeZone:D.timeZone});if(e.type==="month"&&!e.isPlaceholder){let l=v.format(a.dateValue);p=l!==p?`${p} \u2013 ${l}`:l;}else e.type==="hour"&&!e.isPlaceholder&&(p=P.format(a.dateValue));let{spinButtonProps:x}=a$b({value:e.value??void 0,textValue:p,minValue:e.minValue,maxValue:e.maxValue,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly||!e.isEditable,isRequired:a.isRequired,onIncrement:()=>{r.current="",a.increment(e.type);},onDecrement:()=>{r.current="",a.decrement(e.type);},onIncrementPage:()=>{r.current="",a.incrementPage(e.type);},onDecrementPage:()=>{r.current="",a.decrementPage(e.type);},onIncrementToMax:()=>{r.current="",a.incrementToMax(e.type);},onDecrementToMin:()=>{r.current="",a.decrementToMin(e.type);}}),F=useMemo(()=>new b$4(i$1,{maximumFractionDigits:0}),[i$1]),g=()=>{if(e.text===e.placeholder&&m.focusPrevious(),F.isValidPartialNumber(e.text)&&!a.isReadOnly&&!e.isPlaceholder){let l=e.text.slice(0,-1),b=F.parse(l);l=b===0?"":l,l.length===0||b===0?a.clearSegment(e.type):a.setSegment(e.type,b),r.current=l;}else (e.type==="dayPeriod"||e.type==="era")&&a.clearSegment(e.type);},{keyboardProps:V}=j({shortcuts:{Backspace:()=>{g();},Delete:()=>{g();},"Mod+a":()=>{}},allowRepeats:true}),{startsWith:w}=a$c({sensitivity:"base"}),R=a$a({hour:"numeric",hour12:true}),T=useMemo(()=>{let l=new Date;return l.setHours(0),R.formatToParts(l).find(b=>b.type==="dayPeriod").value},[R]),A=useMemo(()=>{let l=new Date;return l.setHours(12),R.formatToParts(l).find(b=>b.type==="dayPeriod").value},[R]),S=a$a({year:"numeric",era:"narrow",timeZone:"UTC"}),J=useMemo(()=>{if(e.type!=="era")return [];let l=toCalendar(new CalendarDate(1,1,1),a.calendar),b=a.calendar.getEras().map($=>{let le=l.set({year:1,month:1,day:1,era:$}).toDate("UTC"),f=S.formatToParts(le).find(z=>z.type==="era")?.value??$;return {era:$,formatted:f}}),k=va(b.map($=>$.formatted));if(k)for(let $ of b)$.formatted=$.formatted.slice(k);return b},[S,a.calendar,e.type]),O=l=>{if(a.isDisabled||a.isReadOnly)return;let b=r.current+l;switch(e.type){case "dayPeriod":if(w(T,l))a.setSegment("dayPeriod",0);else if(w(A,l))a.setSegment("dayPeriod",1);else break;m.focusNext();break;case "era":{let k=J.find($=>w($.formatted,l));k&&(a.setSegment("era",k.era),m.focusNext());break}case "day":case "hour":case "minute":case "second":case "month":case "year":{if(!F.isValidPartialNumber(b))return;let k=F.parse(b),$=k;if(e.maxValue!==void 0&&k>e.maxValue&&($=F.parse(l)),isNaN(k))return;a.setSegment(e.type,$),e.maxValue!==void 0&&(+(k+"0")>e.maxValue||b.length>=String(e.maxValue).length)?(r.current="",m.focusNext()):r.current=b;break}}};useEffect(()=>{h$2(a$d(t.current));},[t]);let L=()=>{r.current="",t.current&&f(t.current,{containingElement:b$5(t.current)}),y?.defaultView?.getSelection()?.collapse(t.current);},Q=u(()=>{let b=t.current?.getRootNode()?.getSelection?.()??y?.defaultView?.getSelection();b?.anchorNode&&h(t.current,b?.anchorNode)&&i(y)===t.current&&b.collapse(t.current);});useEffect(()=>e$1(y,"selectionchange",Q),[y,Q]);let X=useRef("");a$e(t,"beforeinput",l=>{if(t.current)switch(l.preventDefault(),l.inputType){case "deleteContentBackward":case "deleteContentForward":F.isValidPartialNumber(e.text)&&!a.isReadOnly&&g();break;case "insertCompositionText":X.current=t.current.textContent,t.current.textContent=t.current.textContent;break;default:l.data!=null&&O(l.data);break}}),a$e(t,"input",l=>{let{inputType:b,data:k}=l;b==="insertCompositionText"&&(t.current&&(t.current.textContent=X.current),k!=null&&(w(T,k)||w(A,k))&&O(k));}),a$f(()=>{let l=t.current;return ()=>{i(a$d(l))===l&&(m.focusPrevious()||m.focusNext());}},[t,m]);let ne=h$1()||e.type==="timeZoneName"?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{},ie=useMemo(()=>a.segments.find(l=>l.isEditable),[a.segments]);e!==ie&&!a.isInvalid&&(c$2=void 0);let oe=c$1(),j$1=!a.isDisabled&&!a.isReadOnly&&e.isEditable,I=e.type==="literal"?"":u$1.of(e.type),U=a$g({"aria-label":`${I}${s?`, ${s}`:""}${o?", ":""}`,"aria-labelledby":o});if(e.type==="literal")return {segmentProps:{"aria-hidden":true}};let K={caretColor:"transparent"};if(n==="rtl"){K.unicodeBidi="embed";let l=D[e.type];(l==="numeric"||l==="2-digit")&&(K.direction="ltr");}return {segmentProps:c(x,U,{id:oe,...ne,...V,"aria-invalid":a.isInvalid?"true":void 0,"aria-describedby":c$2,"aria-readonly":a.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:j$1,suppressContentEditableWarning:j$1,spellCheck:j$1?"false":void 0,autoCorrect:j$1?"off":void 0,[parseInt(ga.version,10)>=17?"enterKeyHint":"enterkeyhint"]:j$1?"next":void 0,inputMode:a.isDisabled||e.type==="dayPeriod"||e.type==="era"||!j$1?void 0:"numeric",tabIndex:a.isDisabled?void 0:0,onFocus:L,style:K,onPointerDown(l){l.stopPropagation();},onMouseDown(l){l.stopPropagation();}})}}function va(e){e.sort();let a=e[0],t=e[e.length-1];for(let r=0;r<a.length;r++)if(a[r]!==t[r])return r;return 0}var ra={"ar-AE":{rangeOverflow:e=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${e.maxValue} \u0623\u0648 \u0642\u0628\u0644 \u0630\u0644\u0643.`,rangeReversed:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621 \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0642\u0628\u0644 \u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621.",rangeUnderflow:e=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${e.minValue} \u0623\u0648 \u0628\u0639\u062F \u0630\u0644\u0643.`,unavailableDate:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0645\u062D\u062F\u062F\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629."},"bg-BG":{rangeOverflow:e=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${e.maxValue} \u0438\u043B\u0438 \u043F\u043E-\u0440\u0430\u043D\u043D\u0430.`,rangeReversed:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 \u043F\u0440\u0435\u0434\u0438 \u043A\u0440\u0430\u0439\u043D\u0430\u0442\u0430.",rangeUnderflow:e=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${e.minValue} \u0438\u043B\u0438 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.`,unavailableDate:"\u0418\u0437\u0431\u0440\u0430\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435 \u0435 \u043D\u0430\u043B\u0438\u0447\u043D\u0430."},"cs-CZ":{rangeOverflow:e=>`Hodnota mus\xED b\xFDt ${e.maxValue} nebo d\u0159\xEDv\u011Bj\u0161\xED.`,rangeReversed:"Datum zah\xE1jen\xED mus\xED p\u0159edch\xE1zet datu ukon\u010Den\xED.",rangeUnderflow:e=>`Hodnota mus\xED b\xFDt ${e.minValue} nebo pozd\u011Bj\u0161\xED.`,unavailableDate:"Vybran\xE9 datum nen\xED k dispozici."},"da-DK":{rangeOverflow:e=>`V\xE6rdien skal v\xE6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xE6re f\xF8r slutdatoen.",rangeUnderflow:e=>`V\xE6rdien skal v\xE6re ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xE6ngelig."},"de-DE":{rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xFCher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xE4ter sein.`,unavailableDate:"Das ausgew\xE4hlte Datum ist nicht verf\xFCgbar."},"el-GR":{rangeOverflow:e=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${e.maxValue} \u03AE \u03C0\u03B1\u03BB\u03B1\u03B9\u03CC\u03C4\u03B5\u03C1\u03B7.`,rangeReversed:"\u0397 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2.",rangeUnderflow:e=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${e.minValue} \u03AE \u03BC\u03B5\u03C4\u03B1\u03B3\u03B5\u03BD\u03AD\u03C3\u03C4\u03B5\u03C1\u03B7.`,unavailableDate:"\u0397 \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B7."},"en-US":{rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."},"es-ES":{rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xF3n.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."},"et-EE":{rangeOverflow:e=>`V\xE4\xE4rtus peab olema ${e.maxValue} v\xF5i varasem.`,rangeReversed:"Alguskuup\xE4ev peab olema enne l\xF5ppkuup\xE4eva.",rangeUnderflow:e=>`V\xE4\xE4rtus peab olema ${e.minValue} v\xF5i hilisem.`,unavailableDate:"Valitud kuup\xE4ev pole saadaval."},"fi-FI":{rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xE4 aikaisempi.`,rangeReversed:"Aloitusp\xE4iv\xE4n on oltava ennen lopetusp\xE4iv\xE4\xE4.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xE4 my\xF6h\xE4isempi.`,unavailableDate:"Valittu p\xE4iv\xE4m\xE4\xE4r\xE4 ei ole k\xE4ytett\xE4viss\xE4."},"fr-FR":{rangeOverflow:e=>`La valeur doit \xEAtre ${e.maxValue} ou ant\xE9rieure.`,rangeReversed:"La date de d\xE9but doit \xEAtre ant\xE9rieure \xE0 la date de fin.",rangeUnderflow:e=>`La valeur doit \xEAtre ${e.minValue} ou ult\xE9rieure.`,unavailableDate:"La date s\xE9lectionn\xE9e n\u2019est pas disponible."},"he-IL":{rangeOverflow:e=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${e.maxValue} \u05D0\u05D5 \u05DE\u05D5\u05E7\u05D3\u05DD \u05D9\u05D5\u05EA\u05E8.`,rangeReversed:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05D4\u05EA\u05D7\u05DC\u05D4 \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05E0\u05D9 \u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E1\u05D9\u05D5\u05DD.",rangeUnderflow:e=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${e.minValue} \u05D0\u05D5 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.`,unavailableDate:"\u05D4\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E0\u05D1\u05D7\u05E8 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF."},"hr-HR":{rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum po\u010Detka mora biti prije datuma zavr\u0161etka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."},"hu-HU":{rangeOverflow:e=>`Az \xE9rt\xE9knek ${e.maxValue} vagy kor\xE1bbinak kell lennie.`,rangeReversed:"A kezd\u0151 d\xE1tumnak a befejez\u0151 d\xE1tumn\xE1l kor\xE1bbinak kell lennie.",rangeUnderflow:e=>`Az \xE9rt\xE9knek ${e.minValue} vagy k\xE9s\u0151bbinek kell lennie.`,unavailableDate:"A kiv\xE1lasztott d\xE1tum nem \xE9rhet\u0151 el."},"it-IT":{rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."},"ja-JP":{rangeOverflow:e=>`\u5024\u306F ${e.maxValue} \u4EE5\u4E0B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u306F\u7D42\u4E86\u65E5\u3088\u308A\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",rangeUnderflow:e=>`\u5024\u306F ${e.minValue} \u4EE5\u4E0A\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,unavailableDate:"\u9078\u629E\u3057\u305F\u65E5\u4ED8\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002"},"ko-KR":{rangeOverflow:e=>`\uAC12\uC740 ${e.maxValue} \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,rangeReversed:"\uC2DC\uC791\uC77C\uC740 \uC885\uB8CC\uC77C \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",rangeUnderflow:e=>`\uAC12\uC740 ${e.minValue} \uC774\uD6C4\uC5EC\uC57C \uD569\uB2C8\uB2E4.`,unavailableDate:"\uC120\uD0DD\uD55C \uB0A0\uC9DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},"lt-LT":{rangeOverflow:e=>`Reik\u0161m\u0117 turi b\u016Bti ${e.maxValue} arba ankstesn\u0117.`,rangeReversed:"Prad\u017Eios data turi b\u016Bti ankstesn\u0117 nei pabaigos data.",rangeUnderflow:e=>`Reik\u0161m\u0117 turi b\u016Bti ${e.minValue} arba naujesn\u0117.`,unavailableDate:"Pasirinkta data nepasiekiama."},"lv-LV":{rangeOverflow:e=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${e.maxValue} vai agr\u0101kai.`,rangeReversed:"S\u0101kuma datumam ir j\u0101b\u016Bt pirms beigu datuma.",rangeUnderflow:e=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${e.minValue} vai v\u0113l\u0101kai.`,unavailableDate:"Atlas\u012Btais datums nav pieejams."},"nb-NO":{rangeOverflow:e=>`Verdien m\xE5 v\xE6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xE5 v\xE6re f\xF8r sluttdatoen.",rangeUnderflow:e=>`Verdien m\xE5 v\xE6re ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."},"nl-NL":{rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."},"pl-PL":{rangeOverflow:e=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${e.maxValue} lub wcze\u015Bniejsz\u0105.`,rangeReversed:"Data rozpocz\u0119cia musi by\u0107 wcze\u015Bniejsza ni\u017C data zako\u0144czenia.",rangeUnderflow:e=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${e.minValue} lub p\xF3\u017Aniejsz\u0105.`,unavailableDate:"Wybrana data jest niedost\u0119pna."},"pt-BR":{rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xE0 data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."},"pt-PT":{rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de in\xEDcio deve ser anterior \xE0 data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."},"ro-RO":{rangeOverflow:e=>`Valoarea trebuie s\u0103 fie ${e.maxValue} sau anterioar\u0103.`,rangeReversed:"Data de \xEEnceput trebuie s\u0103 fie anterioar\u0103 datei de sf\xE2r\u0219it.",rangeUnderflow:e=>`Valoarea trebuie s\u0103 fie ${e.minValue} sau ulterioar\u0103.`,unavailableDate:"Data selectat\u0103 nu este disponibil\u0103."},"ru-RU":{rangeOverflow:e=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 ${e.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0434\u0430\u0442\u0435 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F.",rangeUnderflow:e=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 ${e.minValue}.`,unavailableDate:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."},"sk-SK":{rangeOverflow:e=>`Hodnota mus\xED by\u0165 ${e.maxValue} alebo skor\u0161ia.`,rangeReversed:"D\xE1tum za\u010Diatku mus\xED by\u0165 skor\u0161\xED ako d\xE1tum konca.",rangeUnderflow:e=>`Hodnota mus\xED by\u0165 ${e.minValue} alebo neskor\u0161ia.`,unavailableDate:"Vybrat\xFD d\xE1tum je nedostupn\xFD."},"sl-SI":{rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u0161a.`,rangeReversed:"Za\u010Detni datum mora biti pred kon\u010Dnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u0161a.`,unavailableDate:"Izbrani datum ni na voljo."},"sr-SP":{rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum po\u010Detka mora biti pre datuma zavr\u0161etka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."},"sv-SE":{rangeOverflow:e=>`V\xE4rdet m\xE5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xE5ste vara f\xF6re slutdatumet.",rangeUnderflow:e=>`V\xE4rdet m\xE5ste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet \xE4r inte tillg\xE4ngligt."},"tr-TR":{rangeOverflow:e=>`De\u011Fer, ${e.maxValue} veya \xF6ncesi olmal\u0131d\u0131r.`,rangeReversed:"Ba\u015Flang\u0131\xE7 tarihi biti\u015F tarihinden \xF6nce olmal\u0131d\u0131r.",rangeUnderflow:e=>`De\u011Fer, ${e.minValue} veya sonras\u0131 olmal\u0131d\u0131r.`,unavailableDate:"Se\xE7ilen tarih kullan\u0131lam\u0131yor."},"uk-UA":{rangeOverflow:e=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435 ${e.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443 \u043C\u0430\u0454 \u043F\u0435\u0440\u0435\u0434\u0443\u0432\u0430\u0442\u0438 \u0434\u0430\u0442\u0456 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F.",rangeUnderflow:e=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u0440\u0430\u043D\u0456\u0448\u0435 ${e.minValue}.`,unavailableDate:"\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."},"zh-CN":{rangeOverflow:e=>`\u503C\u5FC5\u987B\u662F ${e.maxValue} \u6216\u66F4\u65E9\u65E5\u671F\u3002`,rangeReversed:"\u5F00\u59CB\u65E5\u671F\u5FC5\u987B\u65E9\u4E8E\u7ED3\u675F\u65E5\u671F\u3002",rangeUnderflow:e=>`\u503C\u5FC5\u987B\u662F ${e.minValue} \u6216\u66F4\u665A\u65E5\u671F\u3002`,unavailableDate:"\u6240\u9009\u65E5\u671F\u4E0D\u53EF\u7528\u3002"},"zh-TW":{rangeOverflow:e=>`\u503C\u5FC5\u9808\u662F ${e.maxValue} \u6216\u66F4\u65E9\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u671F\u5FC5\u9808\u5728\u7D50\u675F\u65E5\u671F\u4E4B\u524D\u3002",rangeUnderflow:e=>`\u503C\u5FC5\u9808\u662F ${e.minValue} \u6216\u66F4\u665A\u3002`,unavailableDate:"\u6240\u9078\u65E5\u671F\u7121\u6CD5\u4F7F\u7528\u3002"}};var xa=new a(ra);function Sa(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return e}function ia(e,a$1,t,r,i){let n=e!=null&&t!=null&&e.compare(t)>0,u=e!=null&&a$1!=null&&e.compare(a$1)<0,s=e!=null&&r?.(e)||false,o=n||u||s,c=[];if(o){let m=Sa(),y=a.getGlobalDictionaryForPackage("@react-stately/datepicker")||xa,h=new b$3(m,y),p=new DateFormatter(m,q({},i)),D=p.resolvedOptions().timeZone;u&&a$1!=null&&c.push(h.format("rangeUnderflow",{minValue:p.format(a$1.toDate(D))})),n&&t!=null&&c.push(h.format("rangeOverflow",{maxValue:p.format(t.toDate(D))})),s&&c.push(h.format("unavailableDate"));}return {isInvalid:o,validationErrors:c,validationDetails:{badInput:s,customError:false,patternMismatch:false,rangeOverflow:n,rangeUnderflow:u,stepMismatch:false,tooLong:false,tooShort:false,typeMismatch:false,valueMissing:false,valid:!o}}}var Fa={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},Ra={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function q(e,a){e={...a.shouldForceLeadingZeros?Ra:Fa,...e};let r=a.granularity||"minute",i=Object.keys(e),n=i.indexOf(a.maxGranularity??"year");n<0&&(n=0);let u=i.indexOf(r);if(u<0&&(u=2),n>u)throw new Error("maxGranularity must be greater than granularity");let s=i.slice(n,u+1).reduce((c,m)=>(c[m]=e[m],c),{});return a.hourCycle!=null&&(s.hour12=a.hourCycle===12),s.timeZone=a.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&a.timeZone&&!a.hideTimeZone&&(s.timeZoneName="short"),a.showEra&&n===0&&(s.era="short"),s}function ge(e,a){if(e===null)return null;if(e)return toCalendar(e,a)}function oa(e,a,t,r){if(e)return ge(e,t);let i=toCalendar(now(r??getLocalTimeZone()).set({hour:0,minute:0,second:0,millisecond:0}),t);return a==="year"||a==="month"||a==="day"?toCalendarDate(i):r?i:toCalendarDateTime(i)}function la(e,a){let t=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&a&&!(a in e))throw new Error("Invalid granularity "+a+" for value "+e.toString());let[i,n]=useState([r,t]);e&&(i[0]!==r||i[1]!==t)&&n([r,t]),a||(a=e?r:i[0]);let u=e?t:i[1];return [a,u]}var Oa=new a({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"\u12D3\u12D3\u12D3\u12D3",month:"\u121A\u121C",day:"\u1240\u1240"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"\u0633\u0646\u0629",month:"\u0634\u0647\u0631",day:"\u064A\u0648\u0645"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bg:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bn:{year:"yyyy",month:"\u09AE\u09BF\u09AE\u09BF",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"\u0633\u0627\u06B5",month:"\u0645\u0627\u0646\u06AF",day:"\u0695\u06C6\u0698"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"\u017A\u017A"},el:{year:"\u03B5\u03B5\u03B5\u03B5",month:"\u03BC\u03BC",day:"\u03B7\u03B7"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"\u0633\u0627\u0644",month:"\u0645\u0627\u0647",day:"\u0631\u0648\u0632"},ff:{year:"hhhh",month:"ll",day:"\xF1\xF1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"\u05E9\u05E0\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",day:"\u05D9\u05D5\u05DD"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xE9\xE9\xE9\xE9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},is:{year:"\xE1\xE1\xE1\xE1",month:"mm",day:"dd"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"\u5E74",month:"\u6708",day:"\u65E5"},ka:{year:"\u10EC\u10EC\u10EC\u10EC",month:"\u10D7\u10D7",day:"\u10E0\u10E0"},kk:{year:"\u0436\u0436\u0436\u0436",month:"\u0430\u0430",day:"\u043A\u043A"},kn:{year:"\u0CB5\u0CB5\u0CB5\u0CB5",month:"\u0CAE\u0CBF\u0CAE\u0CC0",day:"\u0CA6\u0CBF\u0CA6\u0CBF"},ko:{year:"\uC5F0\uB3C4",month:"\uC6D4",day:"\uC77C"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"\u0E9B\u0E9B\u0E9B\u0E9B",month:"\u0E94\u0E94",day:"\u0EA7\u0EA7"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"\u0D35\u0D7C\u0D37\u0D02",month:"\u0D2E\u0D3E\u0D38\u0D02",day:"\u0D24\u0D40\u0D2F\u0D24\u0D3F"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},no:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},"sr-Latn":{year:"gggg",month:"mm",day:"dd"},sv:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"\u0441\u0441\u0441\u0441",month:"\u043C\u043C",day:"\u0440\u0440"},th:{year:"\u0E1B\u0E1B\u0E1B\u0E1B",month:"\u0E14\u0E14",day:"\u0E27\u0E27"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"\u0440\u0440\u0440\u0440",month:"\u043C\u043C",day:"\u0434\u0434"},"zh-CN":{year:"\u5E74",month:"\u6708",day:"\u65E5"},"zh-TW":{year:"\u5E74",month:"\u6708",day:"\u65E5"}},"en");function da(e,a,t){return e==="era"||e==="dayPeriod"?a:e==="year"||e==="month"||e==="day"?Oa.getStringForLocale(e,t):"\u2013\u2013"}var C=class e{calendar;era;year;month;day;hour;hourCycle;dayPeriod;minute;second;millisecond;offset;constructor(a,t,r){if(this.era=r?.era??null,this.calendar=a,this.year=r?.year??null,this.month=r?.month??null,this.day=r?.day??null,this.hour=r?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=r?.minute??null,this.second=r?.second??null,this.millisecond=r?.millisecond??null,this.offset="offset"in(r??{})?r.offset:null,this.hour!=null){let[i,n]=B(this.hour,t);this.dayPeriod=i,this.hour=n;}}copy(){let a=new e(this.calendar,this.hourCycle);return a.era=this.era,a.year=this.year,a.month=this.month,a.day=this.day,a.hour=this.hour,a.dayPeriod=this.dayPeriod,a.minute=this.minute,a.second=this.second,a.millisecond=this.millisecond,a.offset=this.offset,a}isComplete(a){return a.every(t=>this[t]!=null)}validate(a,t){return t.every(r=>{if((r==="hour"||r==="dayPeriod")&&"hour"in a){let[i,n]=B(a.hour,this.hourCycle);return this.dayPeriod===i&&this.hour===n}return this[r]===a[r]})}isCleared(a){return a.every(t=>this[t]===null)}set(a,t,r){let i=this.copy();return i[a]=t,a==="hour"&&i.dayPeriod==null&&"hour"in r&&(i.dayPeriod=B(r.hour,this.hourCycle)[0]),a==="year"&&i.era==null&&(i.era=r.era),a!=="second"&&a!=="literal"&&a!=="timeZoneName"&&(i.offset=null),i}clear(a){let t=this.copy();return t[a]=null,a==="year"&&(t.era=null),t.offset=null,t}cycle(a,t,r,i){let n=this.copy();if(n[a]==null&&a!=="dayPeriod"&&a!=="era"){if(a==="hour"&&"hour"in r){let[u,s]=B(r.hour,this.hourCycle);n.dayPeriod=u,n.hour=s;}else n[a]=r[a];return a==="year"&&n.era==null&&(n.era=r.era),n}switch(a){case "era":{let u=this.calendar.getEras(),s=u.indexOf(n.era);s=Z(s,t,0,u.length-1),n.era=u[s];break}case "year":{let u=new CalendarDate(this.calendar,this.era??r.era,this.year??r.year,this.month??1,this.day??1);u=u.cycle(a,t,{round:a==="year"}),n.era=u.era,n.year=u.year;break}case "month":n.month=Z(n.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case "day":n.day=Z(n.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case "hour":{let u=i.some(s=>["year","month","day"].includes(s));if("timeZone"in r&&(!u||n.year!=null&&n.month!=null&&n.day!=null)){let s=this.toValue(r);s=s.cycle("hour",t,{hourCycle:this.hourCycle==="h12"?12:24,round:false});let[o,c]=B(s.hour,this.hourCycle);n.hour=c,n.dayPeriod=o,n.offset=s.offset;}else {let s=n.hour??0,o=this.getSegmentLimits("hour");n.hour=Z(s,t,o.minValue,o.maxValue),n.dayPeriod==null&&"hour"in r&&(n.dayPeriod=B(r.hour,this.hourCycle)[0]);}break}case "dayPeriod":n.dayPeriod=Z(n.dayPeriod??0,t,0,1);break;case "minute":n.minute=Z(n.minute??0,t,0,59,true);break;case "second":n.second=Z(n.second??0,t,0,59,true);break}return n}toValue(a){if("hour"in a){let t=this.hour;t!=null?t=Ma(t,this.dayPeriod??0,this.hourCycle):(this.hourCycle==="h12"||this.hourCycle==="h11")&&(t=this.dayPeriod===1?12:0);let r=a.set({era:this.era??a.era,year:this.year??a.year,month:this.month??a.month,day:this.day??a.day,hour:t??a.hour,minute:this.minute??a.minute,second:this.second??a.second,millisecond:this.millisecond??a.millisecond});return "offset"in r&&this.offset!=null&&r.offset!==this.offset&&(r=r.add({milliseconds:r.offset-this.offset})),r}else return a.set({era:this.era??a.era,year:this.year??a.year,month:this.month??a.month,day:this.day??a.day})}getSegmentLimits(a){switch(a){case "era":{let t=this.calendar.getEras();return {value:this.era!=null?t.indexOf(this.era):t.length-1,minValue:0,maxValue:t.length-1}}case "year":return {value:this.year,minValue:1,maxValue:9999};case "month":return {value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case "day":return {value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case "dayPeriod":return {value:this.dayPeriod,minValue:0,maxValue:1};case "hour":{let t=0,r=23;return this.hourCycle==="h12"?(t=1,r=12):this.hourCycle==="h11"&&(t=0,r=11),{value:this.hour,minValue:t,maxValue:r}}case "minute":return {value:this.minute,minValue:0,maxValue:59};case "second":return {value:this.second,minValue:0,maxValue:59}}}};function Z(e,a,t,r,i=false){if(i){e+=Math.sign(a),e<t&&(e=r);let n=Math.abs(a);a>0?e=Math.ceil(e/n)*n:e=Math.floor(e/n)*n,e>r&&(e=t);}else e+=a,e<t?e=r-(t-e-1):e>r&&(e=t+(e-r-1));return e}function B(e,a){let t=e>=12?1:0;switch(a){case "h11":e>=12&&(e-=12);break;case "h12":e===0?e=12:e>12&&(e-=12);break;case "h23":t=null;break;case "h24":e+=1,t=null;}return [t,e]}function Ma(e,a,t){switch(t){case "h11":a===1&&(e+=12);break;case "h12":e===12&&(e=0),a===1&&(e+=12);break;case "h24":e-=1;break}return e}var Ve={year:true,month:true,day:true,hour:true,minute:true,second:true,dayPeriod:true,era:true},sa={year:5,month:2,day:7,hour:2,minute:15,second:15},Ea={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function fr(e){let{locale:a,createCalendar:t,hideTimeZone:r,isDisabled:i=false,isReadOnly:n=false,isRequired:u=false,minValue:s,maxValue:o,isDateUnavailable:c}=e,m=e.value||e.defaultValue||e.placeholderValue||null,[y,h]=la(m,e.granularity),p=h||"UTC";if(m&&!(y in m))throw new Error("Invalid granularity "+y+" for value "+m.toString());let[D,v]=useMemo(()=>{let f=new DateFormatter(a,{dateStyle:"short",timeStyle:"short",hour12:e.hourCycle!=null?e.hourCycle===12:void 0}).resolvedOptions();return [t(f.calendar),f.hourCycle]},[a,e.hourCycle,t]),[P,x]=a$6(e.value,e.defaultValue??null,e.onChange),[F]=useState(P),g=useMemo(()=>ge(P,D)??null,[P,D]),[V,w]=useState(()=>new C(D,v,g)),R=D.identifier==="gregory"&&V.era==="BC",T=useMemo(()=>({granularity:y,maxGranularity:e.maxGranularity??"year",timeZone:h,hideTimeZone:r,hourCycle:e.hourCycle,showEra:R,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,y,e.hourCycle,e.shouldForceLeadingZeros,h,r,R]),A=useMemo(()=>q({},T),[T]),S=useMemo(()=>new DateFormatter(a,A),[a,A]),J=useMemo(()=>S.resolvedOptions(),[S]),O=useMemo(()=>oa(e.placeholderValue,y,D,h),[e.placeholderValue,y,D,h]),L=useMemo(()=>{let d=v==="h11"||v==="h12",f=["era","year","month","day","hour",...d?["dayPeriod"]:[],"minute","second"],z=f.indexOf(e.maxGranularity||"era"),de=f.indexOf(y==="hour"&&d?"dayPeriod":y);return f.slice(z,de+1)},[e.maxGranularity,y,v]),[Q,X]=useState(g),[ne,ie]=useState(D),[oe,j]=useState(v);(g!==Q||v!==oe||!isEqualCalendar(D,ne))&&(V=new C(D,v,g),X(g),ie(D),j(v),w(V));let I=d=>{if(!(e.isDisabled||e.isReadOnly))if(d==null||d instanceof C&&d.isCleared(L))w(new C(D,v,g)),x(null);else if(!(d instanceof C))d=toCalendar(d,m?.calendar||new GregorianCalendar),w(new C(D,v,g)),x(d);else {if(d.isComplete(L)){let f=d.toValue(g??O);if(d.validate(f,L)){let z=toCalendar(f,m?.calendar||new GregorianCalendar);if(!P||z.compare(P)!==0){w(new C(D,v,g)),x(z);return}}}w(d);}},U=useMemo(()=>V.toValue(g??O).toDate(p),[V,p,g,O]),K=useMemo(()=>ja(U,V,S,J,D,a,y),[U,S,J,V,D,a,y]),l=(d,f)=>{I(V.cycle(d,f,O,L));},b=useMemo(()=>ia(P,s,o,c,T),[P,s,o,c,T]),k=d$1({...e,value:P,builtinValidation:b}),$=k.displayValidation.isInvalid,le=e.validationState||($?"invalid":null);return {...k,value:g,defaultValue:e.defaultValue??F,dateValue:U,calendar:D,setValue:I,segments:K,dateFormatter:S,validationState:le,isInvalid:$,granularity:y,maxGranularity:e.maxGranularity??"year",isDisabled:i,isReadOnly:n,isRequired:u,increment(d){l(d,1);},decrement(d){l(d,-1);},incrementPage(d){l(d,sa[d]||1);},decrementPage(d){l(d,-(sa[d]||1));},incrementToMax(d){let f=d==="hour"&&v==="h12"?11:V.getSegmentLimits(d).maxValue;I(V.set(d,f,O));},decrementToMin(d){let f=d==="hour"&&v==="h12"?12:V.getSegmentLimits(d).minValue;I(V.set(d,f,O));},setSegment(d,f){I(V.set(d,f,O));},confirmPlaceholder(){if(!(e.isDisabled||e.isReadOnly)&&V.isComplete(L)){let d=V.toValue(g??O),f=toCalendar(d,m?.calendar||new GregorianCalendar);(!P||f.compare(P)!==0)&&x(f),w(new C(D,v,g));}},clearSegment(d){let f=V;d!=="timeZoneName"&&d!=="literal"&&(f=V.clear(d)),I(f);},formatValue(d){if(!g)return "";let f=q(d,T);return new DateFormatter(a,f).format(U)},getDateFormatter(d,f){let z={...T,...f},de=q({},z);return new DateFormatter(d,de)}}}function ja(e,a,t,r,i,n,u){let s=["hour","minute","second"],o=t.formatToParts(e),c=new a$7(n,{useGrouping:false}),m=new a$7(n,{useGrouping:false,minimumIntegerDigits:2});for(let h of o)if(h.type==="year"||h.type==="month"||h.type==="day"||h.type==="hour"){let p=a[h.type]??0;r[h.type]==="2-digit"?h.value=m.format(p):h.value=c.format(p);}let y=[];for(let h of o){let p=Ea[h.type]||h.type,D=Ve[p];p==="era"&&i.getEras().length===1&&(D=false);let v=Ve[p]&&a[h.type]==null,P=Ve[p]?da(p,h.value,n):null,x={type:p,text:v?P:h.value,...a.getSegmentLimits(p),isPlaceholder:v,placeholder:P,isEditable:D};p==="hour"?(y.push({type:"literal",text:"\u2066",isPlaceholder:false,placeholder:"",isEditable:false}),y.push(x),p===u&&y.push({type:"literal",text:"\u2069",isPlaceholder:false,placeholder:"",isEditable:false})):s.includes(p)&&p===u?(y.push(x),y.push({type:"literal",text:"\u2069",isPlaceholder:false,placeholder:"",isEditable:false})):y.push(x);}return y}var ua=a$1({defaultClassName:"_1lrwegk0",variantClassNames:{isSeparator:{true:"_1yep5z611i"}},defaultVariants:{},compoundVariants:[]}),kr="_1yep5z63o _1yep5z63p _1yep5z63q _1yep5z629 _1yep5z62a _1yep5z62b _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z6kz _1yep5z6l0 _1yep5z6l1";var ke="\u2013";function Rr({segment:e,state:a}){let t=ga.useRef(null),{segmentProps:r}=he(e,a,t),{focusProps:i,isFocused:n}=a$8(),u=useMemo(()=>{let{text:s,type:o}=e;switch(o){case "hour":return s.replaceAll(ke,"H");case "minute":return s.replaceAll(ke,"M");case "second":return s.replaceAll(ke,"S");default:return s}},[e]);return jsx(a$9,{...c(r,i),typography:"label.md.medium",color:e.isPlaceholder?"text.placeholder":"text.primary",backgroundColor:n?"support.info.subtle":void 0,ref:t,marginLeft:e.type==="timeZoneName"?"xs":void 0,className:ua({isSeparator:e.type==="literal"&&!/\p{L}/u.test(e.text)}),children:e.isPlaceholder?u:e.text})}export{Xe as a,st as b,fr as c,kr as d,Rr as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1,r,d}from'./chunk-
|
|
1
|
+
import {a as a$1,r,d}from'./chunk-3IPRT57V.mjs';import {i,l}from'./chunk-6Z3GYFG5.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {createElement,useMemo}from'react';import {jsx}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-FX3THTOK.mjs';import {a as a$2}from'./chunk-2MS356Q7.mjs';import {b}from'./chunk-SZTFMBPY.mjs';import {e,f,d,h,g}from'./chunk-PG3WDHSK.mjs';import {b as b$1}from'./chunk-INFMXVHD.mjs';import {a as a$5}from'./chunk-
|
|
1
|
+
import {a as a$4}from'./chunk-FX3THTOK.mjs';import {a as a$2}from'./chunk-2MS356Q7.mjs';import {b}from'./chunk-SZTFMBPY.mjs';import {e,f,d,h,g}from'./chunk-PG3WDHSK.mjs';import {b as b$1}from'./chunk-INFMXVHD.mjs';import {a as a$5}from'./chunk-DIL5HL6K.mjs';import {a as a$3}from'./chunk-RSKKEGJZ.mjs';import {a as a$1}from'./chunk-STMDFIUL.mjs';import {c}from'./chunk-ETM4MNG4.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import j from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {a as a$s}from'./chunk-JI4SJ53O.mjs';import {a as a$9}from'./chunk-VQPEDDH6.mjs';import {a as a$2}from'./chunk-WDWBYTJG.mjs';import {b as b$3}from'./chunk-BPW4QRPV.mjs';import {a as a$p}from'./chunk-O7IU5NHN.mjs';import {a as a$t}from'./chunk-TDYBXLYP.mjs';import {a as a$q}from'./chunk-K3WFKO7R.mjs';import {b as b$b}from'./chunk-HZM2XZP4.mjs';import {b as b$6,a as a$n}from'./chunk-EJYSTNXD.mjs';import {b as b$4}from'./chunk-AGERZJ3X.mjs';import {b as b$8,c as c$2}from'./chunk-54ZKQAA3.mjs';import {f}from'./chunk-5GW36EQJ.mjs';import {a as a$k}from'./chunk-5BAHJXOI.mjs';import {a as a$7}from'./chunk-FCKJCFMD.mjs';import {a as a$l}from'./chunk-NGZRN4SF.mjs';import {a as a$r}from'./chunk-LDWNE2JT.mjs';import {a as a$g}from'./chunk-CTTNZESA.mjs';import {a as a$i}from'./chunk-Z73YU5ZQ.mjs';import {a as a$j}from'./chunk-RIVN2JT3.mjs';import {a as a$o}from'./chunk-6GV3YWV7.mjs';import {b as b$9,e as e$1}from'./chunk-VPVF5N62.mjs';import {b as b$7,f as f$1}from'./chunk-UZ672WDX.mjs';import {a as a$b}from'./chunk-JZXLV6JU.mjs';import {a as a$e}from'./chunk-R6TFTLMV.mjs';import {c as c$1,b as b$1}from'./chunk-IDIZSV2Y.mjs';import {b as b$a}from'./chunk-INFMXVHD.mjs';import {a as a$a}from'./chunk-DIL5HL6K.mjs';import {a as a$c}from'./chunk-2OXYNLVN.mjs';import {a as a$m}from'./chunk-CIPPPD6E.mjs';import {a as a$d}from'./chunk-5IC46G5J.mjs';import {b as b$5,j as j$1}from'./chunk-MBRNO6IW.mjs';import {a as a$1}from'./chunk-FPM5UJRF.mjs';import {a as a$5}from'./chunk-RSKKEGJZ.mjs';import {a as a$3}from'./chunk-STMDFIUL.mjs';import {a as a$4}from'./chunk-B3EZOXNU.mjs';import {j}from'./chunk-KUDCYGII.mjs';import {e}from'./chunk-PPHSLODC.mjs';import {b,c}from'./chunk-3WKDIXCM.mjs';import {a as a$h,c as c$3}from'./chunk-ETM4MNG4.mjs';import {a as a$8,b as b$2,j as j$2,h}from'./chunk-SD43KVTU.mjs';import {a as a$f}from'./chunk-UBLCUHRL.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import {BoldIcon,ItalicIcon,UnderlineIcon,ArrowUpCircleFilledIcon,AtIcon,XCircleFilledIcon,LinkIcon,XIcon}from'@baseline-ui/icons/20';import {layoutSprinkleValues,sprinkles}from'@baseline-ui/tokens';import wt,{useCallback,useImperativeHandle,useEffect,useRef,useState,useMemo,useId,useContext,useLayoutEffect,Fragment as Fragment$1}from'react';import {useGranularLayoutEffect}from'granular-hooks';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import bi from'just-camel-case';import {QuestionmarkCircleIcon,TextIcon,HighlightTextIcon}from'@baseline-ui/icons/24';import*as xr from'dompurify';import Oi from'just-kebab-case';import {createPortal}from'react-dom';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var Vo="f6jv6bm",Wo="_1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z6k8 _1yep5z6k9 _1yep5z6ka",it="_1yep5z689 _1yep5z68a _1yep5z68b _1yep5z65x _1yep5z65y _1yep5z65z",qo=a({defaultClassName:"f6jv6b0 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6g9",variantClassNames:{isInline:{true:"f6jv6b1"},isMinimal:{true:"_1yep5z6160 _1yep5z6161 _1yep5z6162 _1yep5z6w4 _1yep5z6w5 _1yep5z6w6 _1yep5z616i _1yep5z616j _1yep5z616k",false:"_1yep5z6163 _1yep5z6164 _1yep5z6165"}},defaultVariants:{},compoundVariants:[[{isInline:true,isMinimal:false},"_1yep5z61jn _1yep5z61jo _1yep5z61jp _1yep5z61kb _1yep5z61kc _1yep5z61kd _1yep5z61kz _1yep5z61l0 _1yep5z61l1 _1yep5z61ln _1yep5z61lo _1yep5z61lp _1yep5z61vj _1yep5z61vh _1yep5z61qi"]]}),xt=a({defaultClassName:"f6jv6b4 _1yep5z69 _1yep5z6a _1yep5z6b _1yep5z62l _1yep5z62m _1yep5z62n _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z6e3 _1yep5z6ey _1yep5z6m6",variantClassNames:{isDisabled:{true:"f6jv6b5 _1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),$o="f6jv6b6",Go="f6jv6bj _1yep5z6x7 _1yep5z6x8 _1yep5z6x9 _1yep5z6xv _1yep5z6xw _1yep5z6xx _1yep5z6yj _1yep5z6yk _1yep5z6yl _1yep5z6z7 _1yep5z6z8 _1yep5z6z9",Yo="f6jv6bk";var Xo="f6jv6bn _1yep5z63l _1yep5z63m _1yep5z63n _1yep5z619 _1yep5z61a _1yep5z61b _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z6me _1yep5z6m9 _1yep5z6m7 _1yep5z6id _1yep5z6ey",Zo=a({defaultClassName:"f6jv6bg _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z63 _1yep5z64 _1yep5z65 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6m6 _1yep5z6lq _1yep5z6lt _1yep5z6m5",variantClassNames:{isHovered:{true:"_1yep5z612u"},isDisabled:{true:"_1yep5z6zt"}},defaultVariants:{},compoundVariants:[]}),Jo="_1yep5z6ke _1yep5z6kf _1yep5z6kg",Qo="f6jv6bf f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6j5 _1yep5z6j6 _1yep5z6j7 _1yep5z6ey _1yep5z6e3 _1yep5z6m3",er=a({defaultClassName:"f6jv6bc _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6kk _1yep5z6kl _1yep5z6km",variantClassNames:{isInline:{true:"_1yep5z6q7 _1yep5z6q8 _1yep5z6q9 _1yep5z6190 _1yep5z618y _1yep5z613z",false:"_1yep5z6qa _1yep5z6qb _1yep5z6qc _1yep5z6xm _1yep5z6xn _1yep5z6xo _1yep5z6ya _1yep5z6yb _1yep5z6yc _1yep5z6yy _1yep5z6yz _1yep5z6z0 _1yep5z6zm _1yep5z6zn _1yep5z6zo"}},defaultVariants:{},compoundVariants:[]}),tr="f6jv6bl",nr="f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6j5 _1yep5z6j6 _1yep5z6j7 _1yep5z6ey",Wt=a({defaultClassName:"f6jv6b7",variantClassNames:{isInline:{true:"f6jv6b8",false:"f6jv6b9"}},defaultVariants:{},compoundVariants:[]}),qt="f6jv6ba _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1",yt="f6jv6bo";var $t=wt.forwardRef(({value:t,defaultValue:e,onChange:n,placeholder:o,spellCheck:r,textBoxRef:i,isInline:s,isMinimal:l,isDisabled:a,editableContentAriaLabel:c$1,editorHandle:d,autoFocus:u,saveOnEnter:f,onSave:p},h)=>{let m=wt.useRef(null),[k,I]=a$1(t,e||"",n),$=useCallback(E=>{I(E.currentTarget.value||"");},[I]),w=useCallback(E=>{a$2(E)||(f&&E.key==="Enter"&&!E.shiftKey||(E.ctrlKey||E.metaKey)&&E.key==="Enter")&&(E.preventDefault(),p());},[f,p]);useImperativeHandle(h,()=>({clear:()=>{I("");}}));let j=useCallback(E=>{E.currentTarget.style.height="16px",E.currentTarget.style.height=E.currentTarget.scrollHeight+"px";},[]);useGranularLayoutEffect(()=>{let E=m.current;E&&(E.style.height="16px",E.style.height=E.scrollHeight+"px");},[l],[k]),useImperativeHandle(d,()=>({setCaretPosition:E=>{m.current&&(m.current.focus(),m.current.setSelectionRange(E,E));},focus:()=>{m.current&&m.current.focus();}}));let N=u===true||u==="start"||u==="end",D=typeof u=="string"?u:void 0;useEffect(()=>{if(D&&m.current){let E=D==="start"?0:D==="end"?m.current.value.length:void 0;E!==void 0&&m.current.setSelectionRange(E,E);}},[D]);let{focusProps:Q,isFocused:U,isFocusVisible:pe}=a$3(),{hoverProps:x,isHovered:M}=a$4({isDisabled:a}),G=a$5({"data-focus-visible":pe,"data-hovered":M,"data-focused":U});return jsx("textarea",{...c(Q,x,G),ref:b(m,i),className:a$6({[xt()]:!l,[Wt({isInline:s})]:!l,[nr]:!l,[Qo]:l},"BaselineUI-Editor-PlainEditorEditingArea"),autoFocus:N,onChange:$,disabled:a,onInput:j,value:k,placeholder:o,spellCheck:r,"aria-label":c$1,onKeyDown:w})});$t.displayName="PlainEditor";var sr=[["Toolbar Focus","Alt+F10"],["Bold","Ctrl+B"],["Italic","Ctrl+I"],["Underline","Ctrl+U"],["Select All","Ctrl+A"],["Cut","Ctrl+X"],["Copy","Ctrl+C"],["Paste","Ctrl+V"],["Undo","Ctrl+Z"],["Redo","Ctrl+Shift+Z"],["Submit","Ctrl+Enter"],["Open Help Dialog","Ctrl+Shift+H"]],{dialog:{row:bt}}=layoutSprinkleValues,lr=({isOpen:t,onClose:e,toolbarFocusLabel:n,helpLabel:o,closeLabel:r,actionLabel:i,shortcutLabel:s,boldLabel:l,italicLabel:a,underlineLabel:c,selectAllLabel:d,cutLabel:u,copyLabel:f,pasteLabel:p,undoLabel:h,redoLabel:m,openHelpDialogLabel:k,submitLabel:I})=>{let{formatMessage:$}=b$1(),w=c$3(),j={toolbarFocus:n,help:o,close:r,action:i,shortcut:s,bold:l,italic:a,underline:c,selectAll:d,cut:u,copy:f,paste:p,undo:h,redo:m,openHelpDialog:k,submit:I},N=D=>j[D]??$(Ti[D]);return jsx(b$9,{isOpen:t,onOpenChange:D=>{D||e();},children:jsx(e$1,{enableDrawer:"auto",style:{zIndex:999999},children:jsxs(a$j,{"aria-labelledby":w,className:Go,drawerBackground:"subtle",children:[jsxs(a$a,{paddingLeft:bt.padding.horizontal.lg,paddingRight:bt.padding.horizontal.sm,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",backgroundColor:"background.primary.subtle",className:Yo,children:[jsx(a$o,{id:w,elementType:"h3",type:"title",size:"md",children:N("help")}),jsx(a$c,{icon:XIcon,size:"md",variant:"secondary","aria-label":N("close"),"data-testid":"editor-help-dialog-close-button",onPress:e})]}),jsx(a$b,{className:tr}),jsxs(a$a,{paddingX:bt.padding.horizontal.lg,role:"table","aria-labelledby":w,backgroundColor:"background.primary.subtle",children:[jsx("div",{role:"rowgroup",children:jsxs(a$a,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:bt.padding.vertical.md,color:"text.primary",children:[jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",children:N("action")}),jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",style:{textTransform:"capitalize"},children:N("shortcut")})]})}),jsx("div",{role:"rowgroup",children:sr.map(([D,Q],U)=>jsxs(Fragment$1,{children:[jsxs(a$a,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:bt.padding.vertical.xs,style:{minHeight:40},children:[jsx(a$o,{type:"subtitle",size:"sm",role:"cell",children:N(bi(D))}),jsx(a$o,{elementType:"kbd",type:"subtitle",size:"sm",role:"cell",children:a$p(Q,true)})]}),U!==sr.length-1&&jsx(a$b,{})]},D))})]})]})})})},Ti=c$1({toolbarFocus:{id:"bui.editor.toolbarFocus",defaultMessage:"Toolbar Focus"},help:{id:"bui.editor.help",defaultMessage:"Help"},close:{id:"bui.editor.close",defaultMessage:"Close"},action:{id:"bui.editor.action",defaultMessage:"Action"},shortcut:{id:"bui.editor.shortcut",defaultMessage:"Shortcut"},bold:{id:"bui.editor.bold",defaultMessage:"Bold"},italic:{id:"bui.editor.italic",defaultMessage:"Italic"},underline:{id:"bui.editor.underline",defaultMessage:"Underline"},selectAll:{id:"bui.editor.selectAll",defaultMessage:"Select All"},cut:{id:"bui.editor.cut",defaultMessage:"Cut"},copy:{id:"bui.editor.copy",defaultMessage:"Copy"},paste:{id:"bui.editor.paste",defaultMessage:"Paste"},undo:{id:"bui.editor.undo",defaultMessage:"Undo"},redo:{id:"bui.editor.redo",defaultMessage:"Redo"},openHelpDialog:{id:"bui.editor.openHelpDialog",defaultMessage:"Open Help Dialog"},submit:{id:"bui.editor.submit",defaultMessage:"Submit"}});var vi=a$7("#ffffff00").toString("hexa"),Mn=[{label:"Red",color:"#ff0000"},{label:"Green",color:"#00ff00"},{label:"Blue",color:"#0000ff"},{label:"Yellow",color:"#ffff00"},{label:"Cyan",color:"#00ffff"},{label:"Magenta",color:"#ff00ff"},{label:"Black",color:"#000000"},{label:"White",color:"#ffffff"},{label:"Gray",color:"#808080"},{label:"Orange",color:"#ffa500"},{label:"Brown",color:"#a52a2a"},{label:"Purple",color:"#800080"}];[...Mn,{label:"Transparent",color:vi}];var lt="p",X="a",ce="mention",Me="mention_input";function Ln(t,e){return typeof t=="object"&&t!==null&&"type"in t&&t.type===e}function g(t){return typeof t=="object"&&t!==null&&"text"in t&&!("type"in t)}function R(t){return Ln(t,X)}function oe(t){return Ln(t,ce)}function Z(t){return Ln(t,Me)}function re(t){return oe(t)||Z(t)}function ge(){return [{type:lt,children:[{text:""}]}]}function Et(t,e){return t.bold===e.bold&&t.italic===e.italic&&t.underline===e.underline&&b$b(t.color,e.color)&&b$b(t.backgroundColor,e.backgroundColor)&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize}function ar(t,e){return t.text===e.text&&Et(t,e)}function Ri(t,e){return g(t)?g(e)&&ar(t,e):g(e)||t.type!==e.type||t.children.length!==e.children.length||R(t)&&R(e)&&t.url!==e.url||oe(t)&&oe(e)&&(t.value!==e.value||t.displayName!==e.displayName)?false:t.children.every((n,o)=>ar(n,e.children[o]))}function dr(t,e){return t.length===e.length&&t.every((n,o)=>Sn(n,e[o]))}function Sn(t,e){return t.textAlign===e.textAlign&&t.children.length===e.children.length&&t.children.every((n,o)=>Ri(n,e.children[o]))}function Cn(t){let[e]=t.children;return t.children.length===1&&g(e)&&e.text===""}function ur(t,e){let n=(a,c)=>Sn(a,c)||Cn(a)&&Cn(c)&&a.textAlign===c.textAlign,o=Math.min(t.length,e.length),r=0;for(;r<o&&n(t[r],e[r]);)r+=1;let i=0;for(;i<o-r&&n(t[t.length-1-i],e[e.length-1-i]);)i+=1;let s=null,l=(a,c)=>{let d=e[c];!Cn(d)||Sn(t[a],d)||(s??=[...t],s[a]=d);};for(let a=0;a<r;a++)l(a,a);for(let a=0;a<i;a++)l(t.length-1-a,e.length-1-a);return s??t}function Gt(t,e){let n=false;for(let i=0;i<t.length;i++){let s=t[i];if(s.text===""&&!(e&&t.length===1)){n=true;break}if(i>0&&Et(t[i-1],s)){n=true;break}}if(!n)return t;let o=t.filter(i=>i.text!==""),r=[];for(let i of o){let s=r.at(-1);s!==void 0&&Et(s,i)?r[r.length-1]={...s,text:s.text+i.text}:r.push(i);}return r}function ki(t){let e=(i,s)=>i===0&&s===t.length||i>0&&re(t[i-1]),n=false,o=-1;for(let i=0;i<=t.length;i++){let s=t[i],l=i<t.length&&g(s);if(l&&o===-1)o=i;else if(!l&&o!==-1){let a=t.slice(o,i);if(Gt(a,e(o,i))!==a){n=true;break}o=-1;}}if(!n)return t;let r=[];o=-1;for(let i=0;i<=t.length;i++){let s=t[i],l=i<t.length&&g(s);if(l&&o===-1)o=i;else if(!l&&o!==-1){let a=t.slice(o,i),c=Gt(a,e(o,i));for(let d of c)r.push(d);o=-1;}!l&&i<t.length&&r.push(s);}return r}function Mi(t){let e=false;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];if(R(r)&&R(i)&&r.url===i.url){e=true;break}}if(!e)return t;let n=[];for(let o of t){let r=n.at(-1);if(R(o)&&r!==void 0&&R(r)&&r.url===o.url){let i=Gt([...r.children,...o.children],false);n[n.length-1]={...r,children:i};}else n.push(o);}return n}function Ci(t){let e=Gt(t.children,t.children.length===1);return e.reduce((o,r)=>o+r.text,"")===""?null:e===t.children?t:{...t,children:e}}function Si(t){let e=false,n=[];for(let a of t)if(R(a)){let c=Ci(a);c===null?e=true:(n.push(c),c!==a&&(e=true));}else n.push(a);let o=e?n:t,r=ki(o),i=Mi(r),s=(a,c)=>re(a[c])&&(c===a.length-1||!g(a[c+1])),l=i;if(i.some((a,c)=>s(i,c))){l=[];for(let[a,c]of i.entries())l.push(c),s(i,a)&&l.push({text:""});}return l.length===0?[{text:""}]:l===o&&!e?t:l}function L(t){if(t.length===0)return ge();let e=false,n=t.map(o=>{let r=Si(o.children);return r===o.children?o:(e=true,{...o,children:r})});return e?n:t}function Tt(t,e){let n=e>0&&e<t.length&&/[\uD800-\uDBFF]/.test(t[e-1]);return t.slice(0,n?e-1:e)}function Li(t,e){let n=[],o=e;for(let r of t){if(o<=0)break;n.push(r.text.length>o?{...r,text:Tt(r.text,o)}:r),o-=r.text.length;}return n}function Di(t,e){let n=[],o=e;for(let r of t){let i=B(r);if(i<=o)n.push(r),o-=i;else if(g(r)){n.push({...r,text:Tt(r.text,o)});break}else if(R(r)){n.push({...r,children:Li(r.children,o)});break}else break}return n}function cr(t){return t.reduce((e,n)=>e+B(n),0)}function Dn(t,e){if(A(t)<=e)return t;let n=[],o=e;for(let[r,i]of t.entries()){if(r>0){if(o===0)break;o-=1;}let s=Di(i.children,o);n.push({...i,children:s});let l=cr(s);if(l<cr(i.children))break;o-=l;}return L(n)}function fr(t){throw new Error(`Editor: unknown inline node "${String(t.type)}".`)}function zi(t){if(g(t))return t.text;switch(t.type){case X:return t.children.map(e=>e.text).join("");case ce:return t.displayName;case Me:return t.children[0].text;default:return fr(t)}}function zn(t){return t.map(e=>e.children.map(n=>zi(n)).join("")).join(`
|
|
11
|
+
`)}function B(t){if(g(t))return t.text.length;switch(t.type){case X:{let e=0;for(let n=0;n<t.children.length;n++)e+=t.children[n].text.length;return e}case ce:return t.displayName.length;case Me:return t.children[0].text.length;default:return fr(t)}}function A(t){if(t.length===0)return 0;let e=t.length-1;for(let n of t)for(let o of n.children)e+=B(o);return e}var vt=["color","backgroundColor"],hr=["color","backgroundColor","fontFamily","fontSize","textAlign"],Pi=1,wn=3;function Rt(t){return t.nodeType===Pi}function at(t,e){return t.tagName.toLowerCase()===e}function wi(t){if(!Rt(t))return false;let e=t.tagName.toLowerCase();return e==="p"||e==="div"}function Ai(t){return Rt(t)&&t.querySelector("p, div")!==null}var Ii=new RegExp("["+String.fromCodePoint(8203)+String.fromCodePoint(65279)+"]","g"),_i=String.fromCodePoint(160);function Ue(t){return t.replaceAll(Ii,"").replaceAll(_i," ")}function Yt(t,e,n){let o={...e},r=t.tagName.toLowerCase();(r==="b"||r==="strong")&&(o.bold=true),(r==="i"||r==="em")&&(o.italic=true),r==="u"&&(o.underline=true);let i=t.style;if(i){let s=i.fontWeight;(s==="bold"||Number.parseInt(s,10)>=600&&s!=="")&&(o.bold=true),i.fontStyle==="italic"&&(o.italic=true),i.textDecoration?.includes("underline")&&(o.underline=true);let l=i.color;l&&n.includes("color")&&(o.color=l);let a=i.backgroundColor;a&&n.includes("backgroundColor")&&(o.backgroundColor=a);let c=i.fontFamily;c&&n.includes("fontFamily")&&(o.fontFamily=c);let d=i.fontSize;d&&n.includes("fontSize")&&(o.fontSize=d);}return o}function Xt(t,e,n,o,r){for(let i=0;i<t.childNodes.length;i++){let s=t.childNodes[i];if(s.nodeType===wn){let a=s.nodeValue??"",c=Ue(a);c.length>0&&o.push(kt(c,e));continue}if(!Rt(s))continue;if(at(s,"span")&&s.dataset.userId!==void 0){let a=s.dataset.userId??"",c=s.textContent??"",d=c.startsWith("@")?c.slice(1):c;o.push({type:ce,value:a,displayName:d,children:[{text:""}]});continue}if(at(s,"span")&&s.dataset.mentionAnchor!==void 0){let a=s.textContent??"";o.push({type:Me,children:[{text:a}]});continue}if(at(s,"a")){let a=Yt(s,e,r);{let c=s.getAttribute("href")??"",d=[];mr(s,a,d,r);let u=An(d);u.some(p=>p.text.length>0)&&o.push({type:X,url:c,children:u});}continue}if(at(s,"br")){o.push({text:"\0BR\0"});continue}let l=Yt(s,e,r);Xt(s,l,n,o,r);}}function mr(t,e,n,o){for(let r=0;r<t.childNodes.length;r++){let i=t.childNodes[r];if(i.nodeType===wn){let l=i.nodeValue??"",a=Ue(l);a.length>0&&n.push(kt(a,e));continue}if(!Rt(i))continue;if(at(i,"br")){n.push({text:"\0BR\0"});continue}let s=Yt(i,e,o);mr(i,s,n,o);}}function kt(t,e){let n={text:t};return e.bold&&(n.bold=true),e.italic&&(n.italic=true),e.underline&&(n.underline=true),e.color&&(n.color=e.color),e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.fontFamily&&(n.fontFamily=e.fontFamily),e.fontSize&&(n.fontSize=e.fontSize),n}var gr="\0BR\0";function An(t){let e=[...t];if(e.length===1&&Pn(e[0]))return [{text:""}];let n=e.length,o=0;for(;o<n&&Pn(e[n-1-o]);)o+=1;let r=o>=2?o-1:0;n-=o;let i=[];for(let s=0;s<n;s++){let l=e[s];Pn(l)?pr(i):i.push(l);}for(let s=0;s<r;s++)pr(i);return i}function Pn(t){return "text"in t&&t.text===gr}function pr(t){let e=t.at(-1);e!==void 0&&"text"in e&&!("type"in e)?e.text+=`
|
|
12
|
+
`:t.push({text:`
|
|
13
|
+
`});}function Ni(t,e){let n=[];Xt(t,Yt(t,{},e),false,n,e);let o=An(n),r=e.includes("textAlign")?t.style?.textAlign:void 0;return {type:lt,...r?{textAlign:r}:{},children:o.length>0?o:[{text:""}]}}function Zt(t,e=vt){let n=t.childNodes;if(n.length===0)return ge();let o=[],r=[];function i(){if(r.length===0)return;let l=An(r);o.push({type:lt,children:l.length>0?l:[{text:""}]}),r=[];}function s(l){for(let a of l)if(wi(a))i(),o.push(Ni(a,e));else if(a.nodeType===wn){let c=a.nodeValue??"",d=Ue(c);d.trim().length>0&&r.push({text:d});}else Rt(a)&&(at(a,"br")?r.push({text:gr}):Ai(a)?(i(),s(a.childNodes)):Xt(a,{},false,r,e));}return s(n),i(),o.length===0?ge():L(o)}function Bi(t){return Object.entries(t).map(([e,n])=>`${Oi(e)}:${n}`).filter(([,e])=>!!e).join(";")}function In(t){return !t.color&&!t.backgroundColor&&!t.fontFamily&&!t.fontSize?"":Bi(a$5({color:Ve(t.color),backgroundColor:Ve(t.backgroundColor),fontFamily:Ve(t.fontFamily),fontSize:Ve(t.fontSize)}))}function yr(t){return "text"in t}function Ve(t){if(!(t===void 0||/[;{}]|url\(/i.test(t)))return t}function ct(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function xe(t){let e=t.trim(),n=e.replaceAll(/[\u0000- ]/g,""),o=/^([a-z][a-z0-9+.-]*):/i.exec(n);if(!o)return e;let r=o[1].toLowerCase();return new Set(["javascript","data","vbscript"]).has(r)?"":e}function _n(t){let e=t.trim();if(/^[/#?.]/.test(e))return e;let n=/^([^/:?#]+):\d+(?:[/?#]|$)/.exec(e)?.[1];if(n==="localhost"||n?.includes("."))return `https://${e}`;try{return new URL(e),e}catch{return `https://${e}`}}function br(t,e){if(!(e.mac?e.metaKey:e.ctrlKey))return {isLinkClick:false,url:null};let o=t?.closest?.("a")??null;if(!o)return {isLinkClick:false,url:null};let r=xe(o.getAttribute("href")??"");return {isLinkClick:true,url:r===""?null:r}}function Fi(t){return t.text.includes(`
|
|
14
|
+
`)?t.text.split(`
|
|
15
|
+
`).map(n=>{let o={text:n};return n.length>0&&(t.bold!==void 0&&(o.bold=t.bold),t.italic!==void 0&&(o.italic=t.italic),t.underline!==void 0&&(o.underline=t.underline),t.color!==void 0&&(o.color=t.color),t.backgroundColor!==void 0&&(o.backgroundColor=t.backgroundColor),t.fontFamily!==void 0&&(o.fontFamily=t.fontFamily),t.fontSize!==void 0&&(o.fontSize=t.fontSize)),o}):[t]}function Ki(t){let e=[[]],n=0;for(let o of t)if(yr(o)){let r=Fi(o);for(let i=0;i<r.length;i++)e[n].push(r[i]),i<r.length-1&&(n++,e[n]=[]);}else e[n].push(o);return e}function ie(t){if(!t)return "";function e(n){if(yr(n)){if(n.text==="")return "";let r=ct(n.text);n.bold&&(r=`<b>${r}</b>`),n.italic&&(r=`<i>${r}</i>`),n.underline&&(r=`<u>${r}</u>`);let i=In(n);return i&&(r=`<span style="${ct(i)}">${r}</span>`),r}let o=n.children?.map(r=>ie(r)).join("");switch(n.type){case lt:{let r=Ki(n.children),i=Ve(n.textAlign),s=i?`<p style="text-align:${ct(i)}">`:"<p>";return r.map(l=>{let a=l.map(c=>ie(c)).join("");return `${s}${a}</p>`}).join("")}case X:return `<a href="${ct(xe(n.url))}">${o}</a>`;case ce:return `<span data-user-id="${ct(n.value)}">${ct(n.displayName)}</span>`;default:return o}}return Array.isArray(t)?t.map(n=>e(n)).join(""):e(t)}function Nn(t,e=vt){let n=new DOMParser().parseFromString(xr.default.sanitize(t),"text/html");if(!n.body.querySelector("p, div")){let o=n.createElement("p");o.append(...n.body.childNodes),n.body.append(o);}return Zt(n.body,e)}var Hi=new Set(["(","[","{","<",'"',"'","`","\xAB"]),ji=new Set([".",",","!","?",":",";",'"',"'","`","\xBB"]),Ui=new Map([[")","("],["]","["],["}","{"]]);function Er(t,e){let n=0;for(let o of t)o===e&&n++;return n}function Jt(t){let e=0,n=t.length;for(;e<n&&Hi.has(t[e]);)e++;for(;n>e;){let s=t[n-1];if(ji.has(s)){n--;continue}let l=Ui.get(s);if(l!==void 0){let a=t.slice(e,n);if(Er(a,s)>Er(a,l)){n--;continue}}break}if(n<=e)return null;let o=t.slice(e,n),r;if(/^https?:\/\//i.test(o))r=o;else if(/^www\./i.test(o)){if(o.length<=4)return null;r=`https://${o}`;}else return null;let i;try{i=new URL(r);}catch{return null}return i.hostname===""?null:{start:e,end:n,url:r}}function Vi(t){let e=[],n=/\S+/g,o;for(;(o=n.exec(t))!==null;){let r=Jt(o[0]);if(r){let i=o.index+r.start,s=o.index+r.end;e.push({start:i,end:s,text:t.slice(i,s),url:r.url});}}return e}function Tr(t){let e=t.trim();if(e===""||/\s/.test(e))return null;let n=Jt(e);return n&&n.start===0&&n.end===e.length?n.url:null}function Wi(t){let e=Vi(t.text);if(e.length===0)return null;let n=[],o=0;for(let r of e)r.start>o&&n.push({...t,text:t.text.slice(o,r.start)}),n.push({type:X,url:r.url,children:[{...t,text:r.text}]}),o=r.end;return o<t.text.length&&n.push({...t,text:t.text.slice(o)}),n}function On(t){let e=false,n=t.map(o=>{let r=false,i=[];for(let s of o.children){let l=g(s)?Wi(s):null;l?(i.push(...l),r=true):i.push(s);}return r?(e=true,{...o,children:i}):o});return e?n:t}function vr(t){return oe(t)?0:B(t)}function Rr(t){return t.children.reduce((e,n)=>e+B(n),0)}function Bn(t,e,n){return Math.min(Math.max(t,e),n)}function J(t,e){return t.path[0]!==e.path[0]?t.path[0]<e.path[0]?-1:1:t.path[1]!==e.path[1]?t.path[1]<e.path[1]?-1:1:t.offset!==e.offset?t.offset<e.offset?-1:1:0}function z(t){return J(t.anchor,t.focus)===0}function Fn(t){return J(t.anchor,t.focus)<=0?t:{anchor:t.focus,focus:t.anchor}}function de(t,e){let n=Bn(e.path[0],0,t.length-1),o=t[n].children,r=Bn(e.path[1],0,o.length-1),i=Bn(e.offset,0,vr(o[r]));return {path:[n,r],offset:i}}function we(t){return {path:[0,0],offset:0}}function Ae(t){let e=t.length-1,n=t[e].children,o=n.length-1;return {path:[e,o],offset:vr(n[o])}}function P(t,e){let n=Math.max(e,0);for(let o=0;o<t.length;o++){let r=t[o],i=Rr(r);if(n>i){n-=i+1;continue}let s=r.children;for(let l=0;l<s.length;l++){let a=s[l],c=B(a);if(oe(a)){if(n===0)return {path:[o,l],offset:0};if(n<c)return {path:[o,l+1],offset:0}}else if(n<=c)return {path:[o,l],offset:n};n-=c;}}return Ae(t)}function C(t,e){let[n,o]=e.path,r=0;for(let s=0;s<n;s++)r+=Rr(t[s])+1;let i=t[n].children;for(let s=0;s<o;s++)r+=B(i[s]);return r+e.offset}function We(t){let e={};for(let[n,o]of Object.entries(t))o!==null&&Object.assign(e,{[n]:o});return e}var dt=Object.freeze({bold:false,italic:false,underline:false}),Kn=["color","backgroundColor","fontFamily","fontSize"];function Ie(t,e,n,o,r){let i=n==="atomic";if(t<o.path[0]||t>r.path[0])return null;let s=0;if(t===o.path[0]){if(e<o.path[1])return null;e===o.path[1]&&(s=i?0:o.offset);}let l=i?1:n;if(t===r.path[0]){if(e>r.path[1])return null;e===r.path[1]&&(l=i?r.offset>0?1:0:r.offset);}return s>=l?null:{from:s,to:l}}function Hn(t,e,n){let o=0;for(let r of t.children)n(r,Math.max(e.from-o,0),Math.min(e.to-o,r.text.length)),o+=r.text.length;}function Mr(t,e,n,o){for(let r=e.path[0];r<=n.path[0]&&r<t.length;r++){let i=t[r].children;for(let[s,l]of i.entries())if(!re(l)){if(g(l)){let a=Ie(r,s,l.text.length,e,n);a&&o(l,a.from,a.to);}else if(R(l)){let a=Ie(r,s,B(l),e,n);a&&Hn(l,a,(c,d,u)=>{d<u&&o(c,d,u);});}}}}function Cr(t){return g(t)?t:R(t)?t.children.at(-1)??null:null}function Sr(t,e){let n=de(t,e),o=t[n.path[0]].children,r=o[n.path[1]],i=n.path[1]>0?Cr(o[n.path[1]-1]):null;if(g(r))return n.offset>0?r:i??r;if(R(r)){if(n.offset===0)return i??r.children[0]??null;let s=0;for(let l of r.children)if(s+=l.text.length,n.offset<=s)return l;return r.children.at(-1)??null}return Z(r)?n.offset>0?r.children[0]:i??r.children[0]:i}function kr(t){let e={bold:!!t.bold,italic:!!t.italic,underline:!!t.underline};return t.color!==void 0&&(e.color=t.color),t.backgroundColor!==void 0&&(e.backgroundColor=t.backgroundColor),t.fontFamily!==void 0&&(e.fontFamily=t.fontFamily),t.fontSize!==void 0&&(e.fontSize=t.fontSize),e}function qi(t,e){let n={};t.bold!==void 0&&t.bold===e.bold&&(n.bold=t.bold),t.italic!==void 0&&t.italic===e.italic&&(n.italic=t.italic),t.underline!==void 0&&t.underline===e.underline&&(n.underline=t.underline);for(let o of Kn){let r=t[o],i=e[o];if(r===void 0&&i===void 0)continue;let s=o==="color"||o==="backgroundColor"?b$b(r??void 0,i??void 0):r===i;n[o]=s&&r!=null?r:null;}return n}function ye(t,e){if(z(e)){let s=Sr(t,e.focus);return s?kr(s):{...dt}}let n=Fn(e),o=de(t,n.anchor),r=de(t,n.focus),i=null;return Mr(t,o,r,s=>{let l=kr(s);i=i===null?l:qi(i,l);}),i??{...dt}}function Qt(t,e,n){if(n===t)return {doc:t,range:e};let o=L(n);return {doc:o,range:{anchor:P(o,C(t,de(t,e.anchor))),focus:P(o,C(t,de(t,e.focus)))}}}function Lr(t,e,n,o){let r={...t,text:t.text.slice(e,n)},i=o(r);if(Et(i,r))return null;let s=[];return e>0&&s.push({...t,text:t.text.slice(0,e)}),s.push(i),n<t.text.length&&s.push({...t,text:t.text.slice(n)}),s}function $i(t,e,n){let o=false,r=[];return Hn(t,e,(i,s,l)=>{let a=s<l?Lr(i,s,l,n):null;a?(r.push(...a),o=true):r.push(i);}),o?{...t,children:r}:null}function Dr(t,e,n,o){let r=false,i=t.map((s,l)=>{if(l<e.path[0]||l>n.path[0])return s;let a=false,c=[];for(let[d,u]of s.children.entries())if(g(u)){let f=Ie(l,d,u.text.length,e,n),p=f?Lr(u,f.from,f.to,o):null;p?(c.push(...p),a=true):c.push(u);}else if(R(u)){let f=Ie(l,d,B(u),e,n),p=f?$i(u,f,o):null;p?(c.push(p),a=true):c.push(u);}else c.push(u);return a?(r=true,{...s,children:c}):s});return r?i:t}function qe(t,e){let n=Fn(e);return [de(t,n.anchor),de(t,n.focus)]}function en(t,e,n){if(z(e))return {doc:t,range:e};let[o,r]=qe(t,e),i=false,s=true;return Mr(t,o,r,a=>{i=true,a[n]||(s=false);}),i?Qt(t,e,Dr(t,o,r,s?a=>{let c={...a};return delete c[n],c}:a=>a[n]?a:{...a,[n]:true})):{doc:t,range:e}}function tn(t,e,n,o){if(z(e))return {doc:t,range:e};let[r,i]=qe(t,e);return Qt(t,e,Dr(t,r,i,l=>{if(l[n]===o)return l;let a={...l};return o===void 0?delete a[n]:a[n]=o,a}))}function zr(t,e){let n=[],o=[],r=0;for(let i of t){let s=r+i.text.length;s<=e?n.push(i):r>=e?o.push(i):(n.push({...i,text:i.text.slice(0,e-r)}),o.push({...i,text:i.text.slice(e-r)})),r=s;}return [n,o]}function ue(t,e,n){if(e>=t.length)return [[...t],[]];let o=t.slice(0,e),r=t.slice(e+1),i=t[e];if(g(i))o.push({...i,text:i.text.slice(0,n)}),r.unshift({...i,text:i.text.slice(n)});else if(R(i)){let[s,l]=zr(i.children,n);o.push({...i,children:s}),r.unshift({...i,children:l});}else n===0?r.unshift(i):o.push(i);return [o,r]}function jn(t,e){let[n,o]=qe(t,e);for(let r=n.path[0];r<=o.path[0]&&r<t.length;r++)for(let[i,s]of t[r].children.entries()){if(!R(s))continue;let l={path:[r,i],offset:0},a={path:[r,i],offset:B(s)};if(J(n,a)<=0&&J(o,l)>=0)return {paragraphIndex:r,inlineIndex:i,link:s}}return null}function Pr(t,e){let n=jn(t,e);if(!n)return null;let{paragraphIndex:o,inlineIndex:r,link:i}=n;return {url:i.url,range:{anchor:{path:[o,r],offset:0},focus:{path:[o,r],offset:B(i)}}}}function wr(t,e){let[n,o]=qe(t,e);for(let r=n.path[0];r<=o.path[0]&&r<t.length;r++)for(let[i,s]of t[r].children.entries()){if(g(s))continue;let l=re(s)?"atomic":B(s);if(Ie(r,i,l,n,o))return true}return false}function Gi(t,e,n,o){let r=[],i=(s,l,a)=>{l<a&&r.push({...s,text:s.text.slice(l,a)});};for(let[s,l]of t[e].children.entries())if(!re(l)){if(g(l)){let a=Ie(e,s,l.text.length,n,o);a&&i(l,a.from,a.to);}else if(R(l)){let a=Ie(e,s,B(l),n,o);a&&Hn(l,a,i);}}return r}function Un(t,e,n){if(z(e))return {doc:t,range:e};let[o,r]=qe(t,e);for(let l=o.path[0];l<=r.path[0]&&l<t.length;l++)for(let[a,c]of t[l].children.entries())if(re(c)&&Ie(l,a,"atomic",o,r))return {doc:t,range:e};let i=false,s=t.map((l,a)=>{if(a<o.path[0]||a>r.path[0])return l;let c=Gi(t,a,o,r);if(c.length===0)return l;let d=l.children,[u]=a===o.path[0]?ue(d,o.path[1],o.offset):[[]],f=a===r.path[0]?ue(d,r.path[1],r.offset)[1]:[];return i=true,{...l,children:[...u,{type:X,url:n,children:c},...f]}});return i?Qt(t,e,s):{doc:t,range:e}}function Ar(t,e,n){let o=jn(t,e);if(!o||o.link.url===n)return {doc:t,range:e};let{paragraphIndex:r,inlineIndex:i,link:s}=o,l=t.map((a,c)=>c!==r?a:{...a,children:a.children.map((d,u)=>u===i?{...s,url:n}:d)});return {doc:L(l),range:e}}function Ir(t,e){let n=jn(t,e);if(!n)return {doc:t,range:e};let{paragraphIndex:o,inlineIndex:r,link:i}=n,s=t.map((l,a)=>a!==o?l:{...l,children:l.children.flatMap((c,d)=>d===r?i.children:[c])});return Qt(t,e,s)}function $e(t,e){if(z(e))return {doc:t,range:e};let[n,o]=qe(t,e);if(J(n,o)===0)return {doc:t,range:e};let r=C(t,n),i=ue(t[n.path[0]].children,n.path[1],n.offset)[0],s=ue(t[o.path[0]].children,o.path[1],o.offset)[1],l={...t[n.path[0]],children:[...i,...s]},a=L([...t.slice(0,n.path[0]),l,...t.slice(o.path[0]+1)]),c=P(a,r);return {doc:a,range:{anchor:c,focus:c}}}function Vn(t,e){if(z(e))return ge();let[n,o]=qe(t,e);if(J(n,o)===0)return ge();let r=t[n.path[0]],i=t[o.path[0]],s;if(r===i){let l=ue(r.children,o.path[1],o.offset)[0];s=[{...r,children:ue(l,n.path[1],n.offset)[1]}];}else s=[{...r,children:ue(r.children,n.path[1],n.offset)[1]},...t.slice(n.path[0]+1,o.path[0]),{...i,children:ue(i.children,o.path[1],o.offset)[0]}];return structuredClone(L(s.map(l=>({...l,children:l.children.map(a=>Z(a)?{text:a.children[0].text}:a)}))))}function Mt(t,e,n){let o=de(t,e);if(n==="")return {doc:t,range:{anchor:o,focus:o}};let r=Sr(t,o),i=r?{...r,text:n}:{text:n},s=o.path[0],l=t[s].children,a=l[o.path[1]],c;if(R(a)&&o.offset>0&&o.offset<B(a)){let[f,p]=zr(a.children,o.offset),h={...a,children:[...f,i,...p]};c=l.map((m,k)=>k===o.path[1]?h:m);}else {let[f,p]=ue(l,o.path[1],o.offset);c=[...f,i,...p];}let d=L(t.map((f,p)=>p===s?{...f,children:c}:f)),u=P(d,C(t,o)+n.length);return {doc:d,range:{anchor:u,focus:u}}}function Wn(t,e,n){let o=L(n),r=A(o),i=t,s;if(z(e))s=de(t,e.focus);else {let p=$e(t,e);i=p.doc,s=p.range.focus;}if(o.length===1&&r===0)return {doc:i,range:{anchor:s,focus:s}};let l=s.path[0],[a,c]=ue(i[l].children,s.path[1],s.offset),d=o.length===1?[{...i[l],children:[...a,...o[0].children,...c]}]:[{...i[l],children:[...a,...o[0].children]},...o.slice(1,-1),{...i[l],children:[...o.at(-1).children,...c]}],u=L([...i.slice(0,l),...d,...i.slice(l+1)]),f=P(u,C(i,s)+r);return {doc:u,range:{anchor:f,focus:f}}}function _r(t,e){if(z(e))return Mt(t,e.focus,`
|
|
16
|
+
`);let n=$e(t,e);return Mt(n.doc,n.range.focus,`
|
|
17
|
+
`)}function Nr(t,e){return Wn(t,e,[{type:"p",children:[{text:""}]},{type:"p",children:[{text:""}]}])}function Or(t,e){for(let[n,o]of t.entries()){let r=o.children.indexOf(e);if(r!==-1)return [n,r]}return null}function Br(t){for(let[e,n]of t.entries())for(let[o,r]of n.children.entries())if(Z(r))return [e,o];return null}function Fr(t){let e=Ae(t);return {anchor:e,focus:e}}function Kr(t,e){let n=t,o;if(z(e))o=de(t,e.focus);else {let u=$e(t,e);n=u.doc,o=u.range.focus;}let r={type:Me,children:[{text:""}]},i=o.path[0],[s,l]=ue(n[i].children,o.path[1],o.offset),a=L(n.map((u,f)=>f===i?{...u,children:[...s,r,...l]}:u)),d={path:Or(a,r)??[0,0],offset:0};return {doc:a,range:{anchor:d,focus:d}}}function Hr(t,e){let n=Br(t);if(!n)return {doc:t,range:Fr(t)};let[o,r]=n,i={type:ce,value:e.id,displayName:e.displayName,children:[{text:""}]},s=L(t.map((d,u)=>u===o?{...d,children:d.children.map((f,p)=>p===r?i:f)}:d)),[l,a]=Or(s,i)??[o,r],c={path:[l,a+1],offset:0};return {doc:s,range:{anchor:c,focus:c}}}function qn(t,e,n="end"){let o=Br(t);if(!o)return {doc:t,range:Fr(t)};let[r,i]=o,s=t[r].children,l=i>0?Cr(s[i-1]):null,a=l?{...l,text:e}:{text:e},c=C(t,{path:[r,i],offset:0})+(n==="end"?e.length:0),d=L(t.map((f,p)=>p===r?{...f,children:s.map((h,m)=>m===i?a:h)}:f)),u=P(d,c);return {doc:d,range:{anchor:u,focus:u}}}function Yi(t){for(let e of t.children)if(re(e)||R(e)&&e.children.map(o=>o.text).join("").length>0||g(e)&&e.text.length>0)return false;return true}function $n(t,e){let n=t.createElement("br");return e==="break"?n.dataset.editorNode="break":n.dataset.editorFiller="true",n}function jr(t,e,n,o){if(n.text==="")return;let r=n.text.split(`
|
|
18
|
+
`);for(let i=0;i<r.length;i++){let s=r[i],l=i===r.length-1;if(s.length>0){let c=t.createTextNode(s);if(n.underline){let f=t.createElement("u");f.append(c),c=f;}if(n.italic){let f=t.createElement("i");f.append(c),c=f;}if(n.bold){let f=t.createElement("b");f.append(c),c=f;}let d=t.createElement("span");d.dataset.editorNode="text";let u=In(n);u&&d.setAttribute("style",u),d.append(c),e.append(d);}l?s===""&&r.length>1&&o&&e.append($n(t,"filler")):e.append($n(t,"break"));}}function Xi(t,e,n,o){if(g(n)){jr(t,e,n,o);return}switch(n.type){case X:{let r=t.createElement("a");r.dataset.editorNode="link",r.setAttribute("href",xe(n.url)),r.className=a$t({size:"sm",variant:"inline"});for(let i of n.children)jr(t,r,i,false);e.append(r);break}case ce:{let r=t.createElement("span");r.setAttribute("contenteditable","false"),r.dataset.userId=n.value,r.dataset.editorNode="mention",r.textContent=`@${n.displayName}`,e.append(r);break}case Me:{let r=t.createElement("span");r.setAttribute("contenteditable","false"),r.dataset.mentionAnchor="true",r.dataset.editorNode="mention-input",r.textContent=n.children[0].text,e.append(r);break}}}function nn(t){return g(t)?t.text!=="":R(t)?t.children.some(e=>e.text!==""):true}function Zi(t,e){let n=t.createElement("p");n.dataset.editorNode="paragraph";let o=Ve(e.textAlign);if(o&&(n.style.textAlign=o),Yi(e)){let i=t.createElement("span");return i.dataset.editorNode="text",i.append($n(t,"filler")),n.append(i),n}let r=-1;for(let i=e.children.length-1;i>=0;i--)if(nn(e.children[i])){r=i;break}for(let[i,s]of e.children.entries())Xi(t,n,s,i===r);return n}function Ct(t,e){let n=e.ownerDocument,o=n.createDocumentFragment();for(let r of t)o.append(Zi(n,r));e.replaceChildren(o);}var Ji=1,Qi=3,es=11;function fe(t){return t.nodeType===Ji}function Vr(t){return t.nodeType===es&&"host"in t}function on(t){return t.nodeType===Qi}function St(t,e){return t.tagName.toLowerCase()===e}function ts(t){return St(t,"span")?t.getAttribute("contenteditable")==="false":false}function ns(t,e,n,o,r){if(o===t){let l=t.childNodes,a=Math.min(r,l.length);return a===0?{found:true,point:{path:[n,0],offset:0}}:os(e,n,a)}let i=t.childNodes,s=0;for(let l=0;l<e.children.length;l++){let a=e.children[l];if(g(a)){let c=rn(e.children,l),d=$r(a.text,i,s,n,l,o,r,c);if(d.found)return d;s+=Ye(a.text,c);}else if(R(a)){if(s>=i.length)continue;let c=i[s];if(!fe(c)||!St(c,"a")){s++;continue}let d=rs(a,c,n,l,o,r);if(d.found)return d;s++;}else if(oe(a)||Z(a)){if(s>=i.length)continue;let c=i[s];if(!fe(c)||!ts(c)){s++;continue}if(o===c||(fe(o)||on(o))&&h(c,o))return {found:true,point:{path:[n,l+1],offset:0}};s++;}}return {found:false}}function os(t,e,n){let o=0;for(let s=0;s<t.children.length;s++){let l=t.children[s],a=g(l)?Ye(l.text,rn(t.children,s)):1;if(o+a>=n){if(g(l))return {found:true,point:{path:[e,s],offset:qr(l.text,n-o)}};if(re(l))return {found:true,point:{path:[e,s+1],offset:0}};{let c=l.children.reduce((d,u)=>d+u.text.length,0);return {found:true,point:{path:[e,s],offset:c}}}}o+=a;}let r=t.children.length-1,i=t.children[r];if(g(i))return {found:true,point:{path:[e,r],offset:i.text.length}};if(re(i))return {found:true,point:{path:[e,r+1],offset:0}};if(R(i)){let s=i.children.reduce((l,a)=>l+a.text.length,0);return {found:true,point:{path:[e,r],offset:s}}}return {found:false}}function Wr(t){return !t.children.some(e=>nn(e))}function rn(t,e){for(let n=e+1;n<t.length;n++)if(nn(t[n]))return false;return true}function Ye(t,e){if(t==="")return 0;let n=t.split(`
|
|
19
|
+
`),o=0;for(let r=0;r<n.length;r++)n[r].length>0&&o++,r<n.length-1&&o++;return e&&t.endsWith(`
|
|
20
|
+
`)&&o++,o}function qr(t,e){if(t==="")return 0;let n=t.split(`
|
|
21
|
+
`),o=0,r=0;for(let i=0;i<n.length&&!(o>=e);i++){if(n[i].length>0){if(o+1>=e){r+=n[i].length,o++;break}r+=n[i].length,o++;}if(i<n.length-1){if(o+1>=e){r++,o++;break}r++,o++;}}return t.endsWith(`
|
|
22
|
+
`)&&o<e&&(r=t.length),Math.min(r,t.length)}function $r(t,e,n,o,r,i,s,l=false){if(t==="")return {found:false};let a=t.split(`
|
|
23
|
+
`),c=n,d=0;for(let u=0;u<a.length;u++){let f=a[u],p=u===a.length-1;if(f.length>0&&c<e.length){let h$1=e[c],m=sn(h$1);if(m!==null){if(i===m){let k=Math.min(s,f.length);return {found:true,point:{path:[o,r],offset:d+k}}}if(fe(i)&&h(i,m))return {found:true,point:{path:[o,r],offset:d+(s===0?0:f.length)}}}d+=f.length,c++;}if(p){if(p&&l&&t.endsWith(`
|
|
24
|
+
`)&&f===""&&c<e.length){let h=e[c];if(fe(h)&&St(h,"br")&&i===h)return {found:true,point:{path:[o,r],offset:d}};c++;}}else if(c<e.length){let h=e[c];if(fe(h)&&St(h,"br")&&i===h)return {found:true,point:{path:[o,r],offset:d+(s===0?0:1)}};d++,c++;}}return {found:false}}function rs(t,e,n,o,r,i){if(!fe(e))return {found:false};if(r===e){let c=e.childNodes,d=Math.min(i,c.length),u=0,f=0,p=0;for(let h of t.children){let m=Ye(h.text,false);if(p+m>=d){f=u+qr(h.text,d-p);break}u+=h.text.length,p+=m;}return p>=t.children.reduce((h,m)=>h+Ye(m.text,false),0)&&(f=t.children.reduce((h,m)=>h+m.text.length,0)),{found:true,point:{path:[n,o],offset:f}}}if(!h(e,r))return {found:false};let s=e.childNodes,l=0,a=0;for(let c of t.children){let d=$r(c.text,s,a,n,o,r,i);if(d.found)return {found:true,point:{path:[n,o],offset:l+d.point.offset}};l+=c.text.length,a+=Ye(c.text,false);}return {found:false}}function sn(t){if(on(t))return t;if(fe(t)){let e=t;for(;fe(e)&&e.childNodes.length===1;){let n=e.childNodes[0];if(on(n))return n;if(fe(n))e=n;else break}}return null}function Ge(t,e,n,o){try{if(n!==t&&!h(t,n)||e.length===0)return null;if(n===t){let i=Math.min(o,t.childNodes.length);if(i===0)return {path:[0,0],offset:0};let s=Math.min(i,e.length)-1,l=e[s];if(!l)return null;let a=l.children.length-1,c=l.children[a];if(!c)return null;let d=g(c)?c.text.length:R(c)?c.children.reduce((u,f)=>u+f.text.length,0):0;return {path:[s,a],offset:d}}let r=t.children;for(let i=0;i<e.length;i++){let s=r[i];if(!s)return null;let l=e[i];if(n!==s&&!h(s,n))continue;if(Wr(l))return {path:[i,0],offset:0};let a=ns(s,l,i,n,o);return a.found?a.point:null}return null}catch{return null}}function Ur(t,e,n){try{let[o,r]=n.path,i=n.offset;if(o<0||o>=e.length)return null;let s=e[o];if(r<0||r>=s.children.length)return null;let l=s.children[r],a=t.children[o];if(!a)return null;if(Wr(s))return {node:a.firstChild??a,offset:0};let c=a.childNodes,d=0;for(let u=0;u<r;u++){let f=s.children[u];g(f)?d+=Ye(f.text,rn(s.children,u)):d++;}if(g(l))return Gr(l.text,i,c,d,a,rn(s.children,r));if(R(l)){if(d>=c.length)return null;let u=c[d];return !fe(u)||!St(u,"a")?null:is(l,i,u)}else if(oe(l)||Z(l)){let u=d+1;if(u<c.length){let f=c[u];if(on(f))return {node:f,offset:0}}return {node:a,offset:Math.min(u,a.childNodes.length)}}return null}catch{return null}}function Gr(t,e,n,o,r,i=false){if(t==="")return {node:r,offset:o};let s=t.split(`
|
|
25
|
+
`),l=o,a=0;for(let c=0;c<s.length;c++){let d=s[c],u=c===s.length-1;if(d.length>0&&l<n.length){let f=n[l];if(e>=a&&e<=a+d.length){let p=sn(f);return p!==null?{node:p,offset:e-a}:{node:r,offset:l}}a+=d.length,l++;}if(u){if(u&&t.endsWith(`
|
|
26
|
+
`)&&d===""&&l<=n.length){if(e===a)return {node:r,offset:Math.min(l,r.childNodes.length)};i&&l++;}}else if(l<n.length){if(e===a)return {node:r,offset:l};a++,l++;}}if(l>o&&l-1<n.length){let c=n[l-1],d=sn(c);return d!==null?{node:d,offset:d.length}:{node:r,offset:l}}return {node:r,offset:Math.min(l,r.childNodes.length)}}function is(t,e,n){let o=n.childNodes,r=0,i=0;for(let s of t.children){let l=s.text.length;if(e<=r+l)return Gr(s.text,e-r,o,i,n);r+=l,i+=Ye(s.text,false);}if(o.length>0){let s=n.lastChild,l=s===null?null:sn(s);return l!==null?{node:l,offset:l.length}:{node:n,offset:o.length}}return {node:n,offset:0}}function ss(t,e){let n=t.getComposedRanges;if(typeof n!="function")return null;let o;try{o=n.call(t,{shadowRoots:[e]});}catch{try{o=n.call(t,e);}catch{return null}}let r=o?.[0];return r?{startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset}:null}function Gn(t,e){let n=e.rangeCount>0?e.getRangeAt(0):null,o=n?{startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}:null;if(o&&h(t,o.startContainer))return o;let r=t.getRootNode();if(Vr(r)){let i=ss(e,r);if(i&&h(t,i.startContainer))return i}return o}function ut(t,e){try{let n=a$q(t);if(!n)return null;let{anchorNode:o,focusNode:r}=n;if(o&&r&&h(t,o)&&h(t,r)){let a=Ge(t,e,o,n.anchorOffset),c=Ge(t,e,r,n.focusOffset);if(a!==null&&c!==null)return {anchor:a,focus:c}}let i=Gn(t,n);if(!i)return null;let s=Ge(t,e,i.startContainer,i.startOffset);if(s===null)return null;let l=Ge(t,e,i.endContainer,i.endOffset);return l===null?null:{anchor:s,focus:l}}catch{return null}}function ft(t,e,n){try{let o=Ur(t,e,n.anchor);if(o===null)return;let r=Ur(t,e,n.focus);if(r===null)return;let i=t.ownerDocument;if(!i)return;let s=a$q(t);if(!s)return;if(J(n.anchor,n.focus)>0||Vr(t.getRootNode())){s.setBaseAndExtent(o.node,o.offset,r.node,r.offset);return}let a=i.createRange();a.setStart(o.node,o.offset),a.setEnd(r.node,r.offset),s.removeAllRanges(),s.addRange(a);}catch{}}var an=class{constructor(e,n){this.getEl=e;this.getDoc=n;}getEl;getDoc;remembered=null;lastEmitted=null;writeDeferred=null;focusFromPointer=false;get range(){return this.remembered}set(e,n){if(this.remembered=e,!e||n==="remember")return false;if(n==="place"&&!this.hasFocus())return this.writeDeferred="render",false;let o=this.getEl();return o?(ft(o,this.getDoc(),e),true):false}markEmitted(){this.lastEmitted=this.remembered;}hasFocus(){let e=this.getEl();return e?h(e,f$1(e)):false}select(e,n){let o=this.getEl();if(!o)return false;let r=!this.remembered||!ln(this.remembered,e);return this.remembered=e,r&&(this.lastEmitted=e),this.writeDeferred="select",!n&&!this.hasFocus()||(o.focus(),this.writeDeferred=null,ft(o,this.getDoc(),e)),r}collapseToFocus(){if(!this.getEl())return false;let e=this.current();return !e||z(e)?false:this.select({anchor:e.focus,focus:e.focus},true)}onPointerDown(){this.writeDeferred=null,this.focusFromPointer=!this.hasFocus();}onFocus(){let e=this.focusFromPointer,n=this.writeDeferred;this.focusFromPointer=false,this.writeDeferred=null;let o=this.getEl();if(e||!o||!this.remembered)return;let r=this.getDoc(),i=n===null?ut(o,r):null;if(i&&!ls(r,i)){this.remembered=i;return}ft(o,r,this.remembered);}current(){let e=this.getEl();if(!e)return this.remembered;let n=ut(e,this.getDoc());return n&&this.adoptsLiveSelection(n)&&(this.remembered=n),this.remembered}adoptsLiveSelection(e){return this.writeDeferred===null?true:this.writeDeferred==="select"||z(e)?false:(this.writeDeferred=null,true)}adopt(e){let n=this.remembered;return this.remembered=e,!n||!ln(n,e)}follow(e){if(e&&!this.adoptsLiveSelection(e))return "ignored";if(e===null)return "silent";let n=this.remembered;return this.remembered=e,!n||!ln(n,e)||!this.lastEmitted||!ln(this.lastEmitted,e)?"changed":"silent"}};function ls(t,e){let n=we();return J(e.anchor,n)===0&&J(e.focus,n)===0}function ln(t,e){return t.anchor.path[0]===e.anchor.path[0]&&t.anchor.path[1]===e.anchor.path[1]&&t.anchor.offset===e.anchor.offset&&t.focus.path[0]===e.focus.path[0]&&t.focus.path[1]===e.focus.path[1]&&t.focus.offset===e.focus.offset}var Yr="typing";var cn=class{undoStack=[];redoStack=[];now;maxDepth;lastKind=null;lastTime=null;constructor(e={}){this.now=e.now??Date.now,this.maxDepth=e.maxDepth??100;}record(e,n){let o=this.now();this.redoStack.length>0&&(this.redoStack=[]);let r=n===Yr&&this.lastKind===Yr&&this.lastTime!==null&&o-this.lastTime<=1e3;this.lastKind=n,this.lastTime=o,!r&&(this.undoStack.push(e),this.undoStack.length>this.maxDepth&&this.undoStack.shift());}undo(e){let n=this.undoStack.pop();return n?(this.redoStack.push(e),this.lastKind=null,this.lastTime=null,n):null}redo(e){let n=this.redoStack.pop();return n?(this.undoStack.push(e),this.lastKind=null,this.lastTime=null,n):null}clear(){this.undoStack=[],this.redoStack=[],this.lastKind=null,this.lastTime=null;}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}};var dn=10,un=class{pending=null;preserveSelectionChanges=0;get marks(){return this.pending?.marks}get caretOffset(){return this.pending?.caretOffset}merge(e){return this.pending?.marks??e}clear(){this.pending=null;}toggle(e,n,o){let r=this.effectiveMarks(e,n);r[o]=!r[o],this.pending={marks:r,caretOffset:C(e,n.anchor)};}setValue(e,n,o,r){let i=this.effectiveMarks(e,n);r===void 0?delete i[o]:i[o]=r,this.pending={marks:i,caretOffset:C(e,n.anchor)};}effectiveMarks(e,n){return this.pending?{...this.pending.marks}:We(ye(e,n))}afterCommand(e,n,o,r){let i=this.pending?.marks;if(this.pending=null,e==="insertText"&&i){let s=Math.min(C(n,o.anchor),C(n,o.focus)),l=C(r.doc,r.range.focus),a=this.applyMarkSnapshot(r.doc,i,s,l),c=P(a,l);r={doc:a,range:{anchor:c,focus:c}};}return (e==="insertSoftBreak"||e==="insertParagraph")&&this.carryAcrossBreak(n,o,i,r),this.keepOfEmptiedDoc(n,r.doc),r}afterInput(e,n,o,r){this.keepOfEmptiedDoc(e,o),this.inheritOfEmptyRun(e,n);let i=o,s=r,l=false;if(!this.pending)return {doc:i,range:s,remarked:l};if(!r)return this.pending=null,{doc:i,range:s,remarked:l};let a=this.applyToTypedText(o,r,this.pending);return a.doc!==o&&(i=a.doc,s=a.range,l=true),this.pending={marks:this.pending.marks,caretOffset:C(i,a.range.anchor)},this.preserveSelectionChanges=dn,{doc:i,range:s,remarked:l}}onSelectionChange(e,n){this.preserveSelectionChanges>0?(this.preserveSelectionChanges-=1,this.pending&&n&&(this.pending={...this.pending,caretOffset:C(e,n.anchor)})):this.pending&&n&&C(e,n.anchor)!==this.pending.caretOffset&&(this.pending=null);}onGenuineCaretMove(){this.preserveSelectionChanges=0;}keepOfEmptiedDoc(e,n){A(e)===0||A(n)!==0||(this.pending={marks:this.pending?.marks??We(ye(e,{anchor:we(),focus:P(e,1)})),caretOffset:0},this.preserveSelectionChanges=dn);}inheritOfEmptyRun(e,n){if(this.pending)return;let o;if(A(e)===0)o=we();else if(n&&z(n)&&A([e[n.anchor.path[0]]])===0)o=n.anchor;else return;let r=We(ye(e,{anchor:o,focus:o}));Object.values(r).some(Boolean)&&(this.pending={marks:r,caretOffset:C(e,o)},this.preserveSelectionChanges=dn);}carryAcrossBreak(e,n,o,r){let i=o?{...o}:We(ye(e,n));!o&&!Object.values(i).some(Boolean)||(this.pending={marks:i,caretOffset:C(r.doc,r.range.anchor)},this.preserveSelectionChanges=dn);}applyToTypedText(e,n,o){let r=o.caretOffset,i=C(e,n.anchor);if(i<=r)return {doc:e,range:n};let s=this.applyMarkSnapshot(e,o.marks,r,i),l=P(s,i);return {doc:s,range:{anchor:l,focus:l}}}applyMarkSnapshot(e,n,o,r){let i=e,s=()=>({anchor:P(i,o),focus:P(i,r)});for(let l of ["bold","italic","underline"]){let a=s(),c=!!n[l],d=!!ye(i,a)[l];c!==d&&(i=en(i,a,l).doc);}for(let l of Kn){let a=s(),c=n[l],d=ye(i,a)[l];d!==null&&(l==="color"||l==="backgroundColor"?b$b(c,d):c===d)||(i=tn(i,a,l,c).doc);}return i}};function Zr(t){return g(t)?[t]:R(t)||Z(t)?t.children:[]}function Xr(t){return t.some(e=>!!e.textAlign||e.children.some(n=>Zr(n).some(o=>!!o.fontFamily||!!o.fontSize)))}function Jr(t,e,n){if(!Xr(t)&&!Xr(e))return t;let o=n.createElement("span"),r=(u,f)=>(o.style.removeProperty(Oi(u)),o.style[u]=f,o.style[u]),i={fontFamily:new Map,fontSize:new Map,textAlign:new Map},s=(u,f)=>{if(!f)return;let p=r(u,f);i[u].has(p)||i[u].set(p,f);};for(let u of e){s("textAlign",u.textAlign);for(let f of u.children)for(let p of Zr(f))s("fontFamily",p.fontFamily),s("fontSize",p.fontSize);}let l=(u,f)=>f===void 0?void 0:i[u].get(r(u,f))??f,a=u=>{let f={...u};for(let p of ["fontFamily","fontSize"]){let h=l(p,u[p]);h!==void 0&&(f[p]=h);}return f.fontFamily===u.fontFamily&&f.fontSize===u.fontSize?u:f},c=false,d=t.map(u=>{let f=l("textAlign",u.textAlign),p=u.children.map(h=>{if(g(h))return a(h);if(R(h)||Z(h)){let m=h.children.map(k=>a(k));return m.some((k,I)=>k!==h.children[I])?{...h,children:m}:h}return h});return f===u.textAlign&&p.every((h,m)=>h===u.children[m])?u:(c=true,{...u,...f===void 0?{}:{textAlign:f},children:p})});return c?d:t}var cs=1,ds=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]);function us(t){return (t.key==="ArrowLeft"||t.key==="ArrowRight")&&!t.shiftKey&&(t.ctrlKey||t.altKey||t.metaKey)}function Yn(t){if(t!==void 0&&!(Number.isInteger(t)&&t>=0))throw new Error(`Editor: maxLength must be a finite integer >= 0, received ${String(t)}.`)}var Lt=class t{doc=ge();lastKnownHtml="";lastAppliedValue=null;lastAppliedDoc=null;selection;composing=false;enterHasShift=false;pendingMarks=new un;history=new cn;opts;el=null;pendingExternalRender=null;keyboardShortcutsOverride=void 0;constructor(e={}){this.opts=e,this.selection=new an(()=>this.el,()=>this.doc),this.lastKnownHtml=ie(this.doc);}setKeyboardShortcutsEnabled(e){this.keyboardShortcutsOverride=e;}attach(e){this.maxLength(),this.el=e,Ct(this.doc,e),this.selection.set(this.selection.range,"write");let n=this.handleBeforeInputBound,o=this.handleInputBound,r=this.handlePasteBound,i=this.handleCopyBound,s=this.handleCompositionStartBound,l=this.handleCompositionEndBound,a=this.handleSelectionChangeBound,c=this.handlePointerDownBound,d=this.handleFocusBound,u=this.handleKeyDownBound,f=this.handleDocumentKeyDownBound,p=e.ownerDocument;return e.addEventListener("beforeinput",n),e.addEventListener("input",o),e.addEventListener("paste",r),e.addEventListener("copy",i),e.addEventListener("cut",i),e.addEventListener("compositionstart",s),e.addEventListener("compositionend",l),e.addEventListener("pointerdown",c),e.addEventListener("focus",d),e.addEventListener("keydown",u),p.addEventListener("selectionchange",a),p.addEventListener("keydown",f),()=>{e.removeEventListener("beforeinput",n),e.removeEventListener("input",o),e.removeEventListener("paste",r),e.removeEventListener("copy",i),e.removeEventListener("cut",i),e.removeEventListener("compositionstart",s),e.removeEventListener("compositionend",l),e.removeEventListener("pointerdown",c),e.removeEventListener("focus",d),e.removeEventListener("keydown",u),p.removeEventListener("selectionchange",a),p.removeEventListener("keydown",f),this.el===e&&(this.el=null);}}handleBeforeInputBound=e=>{let n=e;if(j$2(n)===this.el){if(this.opts.isReadOnly?.()){n.preventDefault();return}this.selection.current(),this.handleBeforeInput(n);}};handleInputBound=e=>{j$2(e)===this.el&&(this.composing||this.syncFromDom());};isClipboardTargetInEditor(e,n=false){let o=j$2(e);return !o||!h(this.el,o)?false:!(o.nodeType===cs?o:o.parentElement)?.closest(n?"input":'input, [contenteditable="false"]')}handlePasteBound=e=>{let n=e;if(!this.isClipboardTargetInEditor(n)||(n.preventDefault(),this.opts.isReadOnly?.())||this.composing)return;this.selection.current();let o;try{o=this.opts.onPaste?.(n),o&&(o=L(o));}catch(r){o=null,queueMicrotask(()=>{throw r});}if(o!==null){if(o!==void 0){this.exec("insertFragment",o);return}this.insertPastedData(n.clipboardData);}};handleCopyBound=e=>{let n=e;if(!this.opts.onCopy||!this.isClipboardTargetInEditor(n,true))return;let o=this.selection.current(),r=o!==null&&!z(o),i=this.doc,s=r?Vn(i,o):ge();this.opts.onCopy(n,s)&&(n.preventDefault(),r&&n.type==="cut"&&!this.opts.isReadOnly?.()&&this.doc===i&&(this.select(o),this.exec("deleteRange")));};handleKeyDownBound=e=>{this.enterHasShift=e.key==="Enter"&&e.shiftKey,ds.has(e.key)&&this.pendingMarks.onGenuineCaretMove();};handleDocumentKeyDownBound=e=>{e.defaultPrevented||!this.el||!e.composedPath().includes(this.el)||!us(e)||this.selection.collapseToFocus()&&this.emitSelectionChange();};handlePointerDownBound=()=>{this.pendingMarks.onGenuineCaretMove(),this.selection.onPointerDown();};handleFocusBound=()=>{this.selection.onFocus();};handleCompositionStartBound=()=>{this.composing=true;};handleCompositionEndBound=()=>{if(this.composing=false,this.pendingExternalRender){let e=this.pendingExternalRender;this.pendingExternalRender=null,e();return}this.syncFromDom();};handleSelectionChangeBound=()=>{this.el&&this.handleSelectionChange();};getDoc(e){return e?Vn(this.doc,e):this.doc}getValue(){return ie(this.doc)}setValue(e,n={}){if(e===this.lastKnownHtml||e===this.lastAppliedValue)return;let o,r;try{o=L(Nn(e,this.allowedStyles())),r=ie(o);}catch(i){process.env.NODE_ENV!=="production"&&console.error("[Editor] setValue failed to parse value:",i);return}this.lastAppliedValue=e,this.lastAppliedDoc=null,this.replaceDoc(o,r,n);}setDoc(e,n={}){if(e===this.doc||e===this.lastAppliedDoc)return;let o=L(e);this.lastAppliedDoc=e,!dr(o,this.doc)&&(this.lastAppliedValue=null,this.replaceDoc(o,ie(o),n));}replaceDoc(e,n,o){let r=this.selection.range?C(this.doc,this.selection.range.anchor):null,i=null;if(r!==null){let s=P(e,Math.min(r,A(e)));i={anchor:s,focus:s};}this.history.clear(),this.commit(e,i,{type:"external",html:n,emit:!!o.emit});}static docHasMentionInput(e){return e.some(n=>n.children.some(o=>Z(o)))}exec(e,...n){let o=this.selection.current(),r=this.doc,i=o??this.collapsedAtDocEnd(),s={doc:r,range:o},l;try{let a=this.fitToCapacity(e,n,i);if(a===null)return;l=this.dispatchCommand(e,a);}catch(a){process.env.NODE_ENV!=="production"&&console.error(`[Editor] command "${e}" threw:`,a);return}if(e==="confirmMention"){let a=this.maxLength();a!==void 0&&A(l.doc)>Math.max(a,A(r))&&(l=qn(r,""));}if(l.doc===r){if(e==="toggleMark"&&z(i)){let[a]=n;this.pendingMarks.toggle(this.doc,i,a),this.emitSelectionChange();return}if(e==="setMarkValue"&&z(i)){let[a,c]=n;this.pendingMarks.setValue(this.doc,i,a,c),this.emitSelectionChange();return}this.pendingMarks.clear();return}l=this.pendingMarks.afterCommand(e,r,i,l),this.history.record(s,e),this.commit(l.doc,l.range,{type:"command"});}fitToCapacity(e,n,o){let r=this.capacity(o);if(r===void 0)return n;switch(e){case "insertText":{let[i]=n,s=Tt(i,r);return s===""?null:[s]}case "removeMentionInput":{let[i,s]=n;return [Tt(i,r),s]}case "insertFragment":{let[i]=n;if(r===0)return null;let s=Dn(i,r);return A(s)===0&&A(i)>0?null:[s]}case "insertSoftBreak":case "insertParagraph":return r===0?null:n;default:return n}}maxLength(){let e=this.opts.maxLength?.();return Yn(e),e}clampToMaxLength(e){let n=ut(this.el,e),o=this.maxLength(),r=o===void 0?void 0:Math.max(o,A(this.doc));if(r===void 0||A(e)<=r)return {doc:e,range:n,overflowed:false};let i=n?C(e,n.focus):this.insertionEnd(e),s=A(e)-r;if(i===void 0||i<s){let c=Dn(e,r);if(i===void 0)return {doc:c,range:n,overflowed:true};let d=P(c,Math.min(i,r));return {doc:c,range:{anchor:d,focus:d},overflowed:true}}let l=i-s;/[\uDC00-\uDFFF]/.test(zn(e)[l]??"")&&(l-=1);let a=$e(e,{anchor:P(e,l),focus:P(e,i)});return {doc:a.doc,range:a.range,overflowed:true}}insertionEnd(e){let n=this.selection.range;if(!n)return;let o=C(this.doc,n.anchor),r=C(this.doc,n.focus),i=A(this.doc)-Math.abs(o-r);return Math.min(o,r)+A(e)-i}capacity(e){let n=this.maxLength();if(n===void 0)return;let o=Math.abs(C(this.doc,e.anchor)-C(this.doc,e.focus)),r=A(this.doc);return Math.max(0,Math.max(n,r)-(r-o))}undo(){if(!this.history.canUndo)return;let e={doc:this.doc,range:this.selection.range},n=this.history.undo(e);n&&this.commit(n.doc,n.range,{type:"history"});}redo(){if(!this.history.canRedo)return;let e={doc:this.doc,range:this.selection.range},n=this.history.redo(e);n&&this.commit(n.doc,n.range,{type:"history"});}canUndo(){return this.history.canUndo}canRedo(){return this.history.canRedo}focus(){this.el?.focus();}setCaretPosition(e){if(!this.el)return;let n=P(this.doc,e);this.select({anchor:n,focus:n});}select(e,n){this.selection.select(e,n?.focus!==false)&&(this.pendingMarks.clear(),this.emitSelectionChange());}selectStart(){this.setCaretPosition(0);}selectEnd(){let e=Ae(this.doc);this.select({anchor:e,focus:e});}selectAll(e){this.select({anchor:we(this.doc),focus:Ae(this.doc)},e);}getSelectionState(){return this.buildSelectionState(this.selection.current())}buildSelectionState(e){let n=e?ye(this.doc,e):{...dt},o=this.pendingMarks.merge(n),r=e?Pr(this.doc,e):null;return {marks:o,link:r,range:e}}notifyChange(e,n){let o;try{this.opts.onChange?.(n);}catch(r){o={error:r};}if(this.doc===e&&this.opts.onDocChange?.(e),o)throw o.error}emitSelectionChange(){this.selection.markEmitted(),this.opts.onSelectionChange&&this.opts.onSelectionChange(this.buildSelectionState(this.selection.range));}commit(e,n,o){let r=o.type==="external"?o.html:ie(e),i=o.type==="external"&&t.docHasMentionInput(this.doc);this.doc=e,this.lastKnownHtml=r,(o.type==="history"||o.type==="external")&&this.pendingMarks.clear(),this.selection.set(n,"remember"),o.type!=="external"&&(this.lastAppliedValue=null,this.lastAppliedDoc=null);let s=this.el;switch(o.type){case "command":case "history":{s&&!this.composing&&(Ct(e,s),this.selection.set(n,"place"));break}case "native":{s&&o.rerender&&(Ct(e,s),this.selection.set(n,"write"));break}case "external":{if(!s)break;let l=()=>{this.el&&(Ct(e,this.el),n&&!this.selection.set(n,"place")&&!o.emit&&this.emitSelectionChange());};this.composing?this.pendingExternalRender=l:l();break}}o.type==="external"&&(i&&!t.docHasMentionInput(e)&&this.opts.onMentionInputRemoved?.(),!o.emit)||((o.type!=="native"||o.contentChanged)&&this.notifyChange(e,r),this.emitSelectionChange());}insertOverflowingText(e){if(!e.data)return false;let n=this.capacity(this.selection.current()??this.collapsedAtDocEnd());if(n===void 0||e.data.length<=n)return false;e.preventDefault();let o=this.pendingMarks.marks;return o?this.exec("insertFragment",[{type:"p",children:[kt(e.data,o)]}]):this.exec("insertText",e.data),true}handleNativeInsert(e){return e.inputType==="insertText"?this.insertOverflowingText(e):e.inputType==="insertReplacementText"&&this.replaceTargetText(e)}replaceTargetText(e){let n=this.el,o=e.getTargetRanges?.()[0],r=e.data??e.dataTransfer?.getData("text/plain");if(!n||!o||!r)return false;let i=Ge(n,this.doc,o.startContainer,o.startOffset),s=Ge(n,this.doc,o.endContainer,o.endOffset);if(!i||!s)return false;e.preventDefault();let l=kt(r,We(ye(this.doc,{anchor:i,focus:s}))),a=this.doc[i.path[0]]?.children[i.path[1]],c=R(a)&&i.path[0]===s.path[0]&&i.path[1]===s.path[1];return ft(n,this.doc,{anchor:i,focus:s}),this.exec("insertFragment",[{type:"p",children:[c?{...a,children:[l]}:l]}]),true}breakCommand(e){return e==="insertParagraph"&&!this.enterHasShift&&this.opts.enterInsertsParagraph?.()?"insertParagraph":"insertSoftBreak"}handleBeforeInput(e){let{inputType:n}=e;if(n==="insertParagraph"||n==="insertLineBreak"){e.preventDefault();let r=this.detectAutoLinkBeforeCaret(),i=this.doc;this.exec(this.breakCommand(n)),r&&this.applyAutoLink(r,i);return}if(n==="insertText"&&e.data===" "){let r=this.detectAutoLinkBeforeCaret();if(r){e.preventDefault();let i=this.doc;this.exec("insertText"," "),this.applyAutoLink(r,i);return}}if(this.handleNativeInsert(e))return;if(n==="insertFromPaste"||n==="insertFromDrop"){e.preventDefault(),this.handlePasteInput(e);return}let o=this.keyboardShortcutsOverride??this.opts.areKeyboardShortcutsEnabled?.()??true;if(n==="formatBold"){e.preventDefault(),o&&this.exec("toggleMark","bold");return}if(n==="formatItalic"){e.preventDefault(),o&&this.exec("toggleMark","italic");return}if(n==="formatUnderline"){e.preventDefault(),o&&this.exec("toggleMark","underline");return}if(n==="historyUndo"){e.preventDefault(),o&&this.undo();return}if(n==="historyRedo"){e.preventDefault(),o&&this.redo();return}if(n==="insertText"&&e.data==="@"&&this.shouldTriggerMention()&&this.opts.canStartMention?.()!==false){e.preventDefault();let r=this.doc;this.exec("insertMentionInput"),this.doc===r?this.exec("insertText","@"):this.opts.onMentionTrigger?.();}}shouldTriggerMention(){if(!this.selection.range)return true;if(!z(this.selection.range))return false;let e=this.selection.range,[n,o]=e.anchor.path,r=e.anchor.offset,i=this.doc;if(n>=i.length)return true;let s=i[n];if(o>=s.children.length)return true;let l=s.children[o];if(r===0&&o===0)return true;let a=null;if(g(l)){let c=l.text;if(r>0)a=c[r-1];else if(o>0)a=this.lastCharOf(s.children[o-1]);else return true}else if(R(l)){let c=l.children.map(d=>d.text).join("");if(r>0)a=c[r-1]??null;else if(o>0)a=this.lastCharOf(s.children[o-1]);else return true}else if(r===0&&o>0)a=this.lastCharOf(s.children[o-1]);else return true;return a===null?true:/^[\s"']$/.test(a)}lastCharOf(e){if(g(e)){let n=e.text;return n.length>0?n.at(-1)??null:null}if(R(e)){let o=(e.children??[]).at(-1);return o&&o.text.length>0?o.text.at(-1)??null:null}if(oe(e)){let n=e.displayName??"";return n.length>0?n.at(-1)??null:null}return null}allowedStyles(){return this.opts.htmlStyles?.()??vt}autoLinkEnabled(){return this.opts.autoLink?.()??true}detectAutoLinkBeforeCaret(){return !this.autoLinkEnabled()||this.composing?null:this.findAutoLinkBeforeCaret()}findAutoLinkBeforeCaret(){let e=this.selection.range;if(!e||!z(e))return null;let n=e.anchor,o=this.doc,r=n.path[0];if(r>=o.length)return null;let i=o[r].children,s=n.path[1],l=n.offset;if(s>=i.length){s=i.length-1;let f=i[s];if(!f||!g(f))return null;l=f.text.length;}else {let f=i[s];g(f)&&l>f.text.length&&(l=f.text.length);}let a=i[s];if(g(a)&&l<a.text.length&&!/\s/.test(a.text[l]))return null;let c="";for(;;){let f=i[s];if(!f||!g(f))break;if(l>0){let p=f.text[l-1];if(/\s/.test(p))break;c=p+c,l-=1;}else {if(s===0)break;let p=i[s-1];if(!g(p))break;s-=1,l=p.text.length;}}if(c==="")return null;let d=Jt(c);if(!d)return null;let u=C(o,{path:[r,s],offset:l});return {startAbs:u+d.start,endAbs:u+d.end,url:d.url}}applyAutoLink(e,n){if(this.doc===n)return;let o=xe(e.url);if(o==="")return;let r=this.doc,i={anchor:P(r,e.startAbs),focus:P(r,e.endAbs)},s={doc:r,range:this.selection.range},l=Un(r,i,o);if(l.doc===r)return;let a=this.selection.range?C(r,this.selection.range.anchor):e.endAbs;this.history.record(s,"wrapLink");let c=P(l.doc,a);this.commit(l.doc,{anchor:c,focus:c},{type:"command"});}handlePasteInput(e){this.insertPastedData(e.dataTransfer);}resolvePastedMentions(e){let n=this.opts.resolveMention;return n?e.map(o=>({...o,children:o.children.map(r=>{if(!oe(r))return r;let i=n(r.value);return i===void 0?{text:`@${r.displayName}`}:{...r,displayName:i}})})):e}insertPastedData(e){if(!e)return;let n=this.autoLinkEnabled(),o=e.getData("text/plain");if(n&&o){let i=this.selection.range;if(i&&!z(i)&&i.anchor.path[0]===i.focus.path[0]){let s=Tr(o),l=s?xe(s):"";if(l&&!wr(this.doc,i)){this.exec("wrapLink",l);return}}}let r=e.getData("text/html");if(r)try{let i=L(this.resolvePastedMentions(Nn(r)));n&&(i=L(On(i))),this.exec("insertFragment",i);return}catch(i){process.env.NODE_ENV!=="production"&&console.error("[Editor] failed to parse pasted HTML:",i);}if(o){let i=Ue(o.replaceAll(`\r
|
|
27
|
+
`,`
|
|
28
|
+
`).replaceAll("\r",`
|
|
29
|
+
`)),s=L([{type:"p",children:[{text:i}]}]);n&&(s=L(On(s))),this.exec("insertFragment",s);}}syncFromDom(){if(!this.el||this.composing)return;let e=this.doc,n={doc:e,range:this.selection.range},{doc:o,range:r,overflowed:i}=this.clampToMaxLength(ur(Jr(Zt(this.el,hr),e,this.el.ownerDocument),e)),l=ie(o)!==this.lastKnownHtml;if(!l&&!i){r&&this.selection.adopt(r)&&this.emitSelectionChange();return}l&&this.history.record(n,"typing");let a=o,c=r,d=i;if(!c&&n.range){let f=Math.max(A(o)-A(e),0),p=this.pendingMarks.caretOffset??C(e,n.range.anchor),h=P(o,p+f);c={anchor:h,focus:h};}let u=this.pendingMarks.afterInput(e,n.range,o,c);a=u.doc,c=u.range,u.remarked&&(d=true),this.commit(a,c,{type:"native",rerender:d,contentChanged:l});}handleSelectionChange(){if(!this.el)return;let e=a$q(this.el);if(!e)return;let n=Gn(this.el,e);if(!n||!h(this.el,n.startContainer))return;let o=ut(this.el,this.doc),r=this.selection.follow(o);r!=="ignored"&&(this.pendingMarks.onSelectionChange(this.doc,o),r==="changed"&&this.emitSelectionChange());}dispatchCommand(e,n){let o=this.doc,r=this.selection.range??this.collapsedAtDocEnd();switch(e){case "toggleMark":{let[i]=n;return en(o,r,i)}case "setMarkValue":{let[i,s]=n;return tn(o,r,i,s)}case "wrapLink":{let[i]=n;return Un(o,r,i)}case "updateLinkUrl":{let[i]=n;return Ar(o,r,i)}case "unwrapLink":return Ir(o,r);case "deleteRange":return $e(o,r);case "insertText":{let[i]=n;if(!z(r)){let s=$e(o,r);return Mt(s.doc,s.range.focus,i)}return Mt(o,r.anchor,i)}case "insertFragment":{let[i]=n;return Wn(o,r,i)}case "insertSoftBreak":return _r(o,r);case "insertParagraph":return Nr(o,r);case "insertMentionInput":return Kr(o,r);case "confirmMention":{let[i]=n;return Hr(o,i)}case "removeMentionInput":{let[i,s]=n;return qn(o,i,s)}default:return {doc:o,range:r}}}collapsedAtDocEnd(){let e=Ae(this.doc);return {anchor:e,focus:e}}};var Dt=wt.createContext(null);function Ce(){let t=wt.useContext(Dt);if(!t)throw new Error("useEditorContext must be used within an EditorProvider");return t}var fn=Object.freeze({marks:dt,link:null,range:null});function ps(t){let e=Ue(t.replaceAll(/<br\s*\/?>/gi,"").replaceAll(/<p\s[^>]*>/gi,"<p>"));return e==="<p></p>"||e===""||e==="<p> </p>"}function Xn(t={}){let{value:e,defaultValue:n,doc:o,defaultDoc:r,onChange:i,onDocChange:s,isDisabled:l,keyboardShortcuts:a,onSelectionChange:c,onMentionTrigger:d,onMentionInputRemoved:u,canStartMention:f,resolveMention:p,onPaste:h,onCopy:m,maxLength:k,htmlStyles:I,isReadOnly:$,autoLink:w,enterInsertsParagraph:j}=t;if(e!==void 0&&i===void 0&&a$d("use-editor-value-without-onchange","useEditor: `value` without `onChange` is controlled but cannot reflect edits \u2014 they are discarded on the next render. Use `defaultValue` for initial content, or add `onChange`."),(e!==void 0||n!==void 0)&&(o!==void 0||r!==void 0)||o!==void 0&&r!==void 0)throw new Error("useEditor: pass at most one of `doc` and `defaultDoc`, and not together with `value` or `defaultValue`.");o!==void 0&&s===void 0&&a$d("use-editor-doc-without-ondocchange","useEditor: `doc` without `onDocChange` is controlled but cannot reflect edits \u2014 they are discarded on the next render. Use `defaultDoc` for initial content, or add `onDocChange`."),Yn(k);let[D,Q]=useState(fn),U=o??r,[pe,x]=useState(()=>U?ie(L(U)):e??n??""),M=useMemo(()=>o===void 0?void 0:ie(L(o)),[o]),G=useRef(i);G.current=i;let E=useRef(s);E.current=s;let Ee=useRef(c);Ee.current=c;let he=useRef(d);he.current=d;let Te=useRef(u);Te.current=u;let ve=useRef(f);ve.current=f;let ee=useRef(p);ee.current=p;let V=useRef(h);V.current=h;let Se=useRef(m);Se.current=m;let Le=useRef(k);Le.current=k;let Ne=useRef(I);Ne.current=I;let Qe=useRef($);Qe.current=$;let Oe=useRef(l);Oe.current=l;let Be=useRef(a);Be.current=a;let le=useRef(w);le.current=w;let De=useRef(j);De.current=j;let y=useRef(null);if(y.current===null){y.current=new Lt({onChange:v=>{x(v),G.current?.(v);},onDocChange:v=>{E.current?.(v);},onSelectionChange:v=>{Q(v),Ee.current?.(v);},onMentionTrigger:()=>{he.current?.();},onMentionInputRemoved:()=>{Te.current?.();},canStartMention:()=>ve.current?.()??false,get resolveMention(){return ee.current},get onPaste(){return V.current},get onCopy(){return Se.current},maxLength:()=>Le.current,htmlStyles:()=>Ne.current,autoLink:()=>le.current!==false,isReadOnly:()=>Qe.current?.()??!!Oe.current,areKeyboardShortcutsEnabled:()=>Be.current!==false,enterInsertsParagraph:()=>!!De.current});let b=e??n;U?y.current.setDoc(U):b&&typeof DOMParser<"u"&&y.current.setValue(b);}let S=y.current;a$h(()=>{o!==void 0?S.setDoc(o):e!==void 0&&S.setValue(e);}),useEffect(()=>{l&&Q(fn);},[l]);let Re=M??e??pe,ze=ps(Re),Pe=S.canUndo(),T=S.canRedo();return useMemo(()=>({core:S,selectionState:D,value:Re,isEmpty:ze,isDisabled:!!l,keyboardShortcuts:a!==false,canUndo:Pe,canRedo:T,focus:()=>{S.focus();},selectStart:()=>{S.selectStart();},selectEnd:()=>{S.selectEnd();},setCaretPosition:b=>{S.setCaretPosition(b);},undo:()=>{S.undo();},redo:()=>{S.redo();},getValue:()=>S.getValue(),setValue:(b,v)=>{S.setValue(b,v);},getDoc:b=>S.getDoc(b),setDoc:(b,v)=>{S.setDoc(b,v);},selectAll:b=>{S.selectAll(b);},select:(b,v)=>{S.select(b,v);},getSelectionState:()=>S.getSelectionState(),exec:(b,...v)=>{S.exec(b,...v);},isMarkActive:b=>!!D.marks[b],toggleMark:b=>{S.exec("toggleMark",b);},setMark:(b,v)=>{S.exec("setMarkValue",b,v);}}),[S,D,Re,ze,l,a,Pe,T])}function oi(t,e){let n=t.ctrlKey||t.metaKey,o=t.key.toLowerCase();if(n&&!t.altKey&&o==="z")return t.preventDefault(),t.shiftKey?e.redo():e.undo(),true;if(t.ctrlKey&&!t.altKey&&!t.shiftKey&&o==="y")return t.preventDefault(),e.redo(),true;if(n&&!t.shiftKey&&!t.altKey){if(o==="b")return t.preventDefault(),e.toggleMark("bold"),true;if(o==="i")return t.preventDefault(),e.toggleMark("italic"),true;if(o==="u")return t.preventDefault(),e.toggleMark("underline"),true}return false}function Jn(t,e={}){let n=ys(t),{ref:o,autoFocus:r,onKeyDown:i,keyboardShortcuts:s}=e,l=s??n.keyboardShortcuts,a=useId(),c=useRef(null),d=useRef(null),u=useCallback(m=>{d.current&&(d.current(),d.current=null),m&&(d.current=n.core.attach(m));},[n.core]),f=useMemo(()=>b(c,u,o??null),[u,o]);useEffect(()=>(n.core.setKeyboardShortcutsEnabled(s),()=>{n.core.setKeyboardShortcutsEnabled(void 0);}),[n.core,s]);let p=useRef(false);useEffect(()=>{if(!p.current)switch(p.current=true,r){case true:{n.focus();break}case "start":{n.selectStart();break}case "end":{n.selectEnd();break}}},[n.core]);let{keyboardProps:h}=j({onKeyDown:m=>{i?.(m)||l&&oi(m,n)||m.continuePropagation();}});return {editableProps:{...h,id:a,ref:f,contentEditable:!n.isDisabled,suppressContentEditableWarning:true,role:"textbox","aria-multiline":true,"data-editor-root":"true"}}}function ys(t){let e=useContext(Dt);if(t)return t;if(!e)throw new Error("useEditable must be passed an editor or used within an EditorProvider");return e}var Qn=({editor:t,children:e})=>jsx(Dt.Provider,{value:t,children:e});var pn=({markName:t,icon:e,ariaLabel:n,isDisabled:o})=>{let{core:r,selectionState:i}=Ce(),s=!!i.marks[t];return jsx(a$g,{variant:"tertiary",isSelected:s,size:"sm",icon:e,"aria-label":n,"data-testid":`editor-${t}-button`,isDisabled:o,onPress:()=>{r.exec("toggleMark",t),r.focus();},preventFocusOnPress:true})},to=({colorKey:t,"aria-label":e,isDisabled:n})=>{let{core:o,selectionState:r}=Ce(),i=t==="color"?r.marks.color:r.marks.backgroundColor,s=wt.useRef(null),l=useCallback(()=>{s.current=r.range;},[r.range]),a=useCallback(p=>{setTimeout(()=>{let h=o.getSelectionState().range??s.current;h&&o.select(h),o.exec("setMarkValue",t,p);},0);},[o,t]),c=useCallback(p=>{a(p);},[a]),d=useCallback(()=>{a();},[a]),u=useCallback(({ref:p,triggerProps:h})=>jsx(a$c,{icon:t==="color"?TextIcon:HighlightTextIcon,"aria-label":e,"data-testid":t==="color"?"editor-font-color-button":"editor-background-color-button",size:"md",variant:"popover",isDisabled:n,className:it,preventFocusOnPress:true,...h,ref:p}),[t,e,n]),f=useCallback(p=>{p?c(p.toString("rgba")):d();},[d,c]);return jsx(b$4,{presets:Mn,allowRemoval:true,pickerMode:"lazy",placement:"top end",colorLabel:false,renderTriggerButton:u,onTriggerPress:l,value:i||"#000000",onChange:f,isDisabled:n})};var Xe={Add:"add",Edit:"edit",Show:"show"},ii=({isDisabled:t,addLinkLabel:e,editLinkLabel:n,removeLinkLabel:o,linkAnnotationLabel:r,linkCancelLabel:i,linkSaveLabel:s})=>{let{formatMessage:l}=b$1(),{core:a}=Ce();return jsxs(b$5,{type:"dialog",children:[jsx(j$1,{children:jsx(a$c,{icon:LinkIcon,size:"sm",isDisabled:t,"aria-label":e??l(Ze.addLink),"data-testid":"editor-add-link-button",className:it,preventFocusOnPress:true})}),jsx(a$i,{className:sprinkles({boxShadow:"medium"}),placement:"top end",children:({close:c})=>jsx(a$j,{size:"content",style:{minWidth:240},children:jsx(Ms,{addLinkLabel:e,editLinkLabel:n,removeLinkLabel:o,linkAnnotationLabel:r,linkCancelLabel:i,linkSaveLabel:s,close:()=>{c(),setTimeout(()=>{a.focus();},0);}})})})]})},Ms=({close:t,addLinkLabel:e,editLinkLabel:n,removeLinkLabel:o,linkAnnotationLabel:r,linkCancelLabel:i,linkSaveLabel:s})=>{let{core:l,selectionState:a}=Ce(),{formatMessage:c}=b$1(),d=a.link?.url,[u,f]=wt.useState(d?Xe.Show:Xe.Add),[p,h]=wt.useState(d||""),m=jsx(a$a,{padding:"lg",children:jsx(a$r,{label:r??c(Ze.link),value:p,autoFocus:true,onChange:h,placeholder:"https://yourdomain.com","data-testid":"editor-link-input"})});return jsxs(Fragment,{children:[u===Xe.Add&&jsxs(Fragment,{children:[m,jsx(a$a,{display:"flex",justifyContent:"flex-end",padding:"lg",className:Vo,children:jsx(b$a,{isDisabled:!a$s(p,true)||xe(p)==="",label:e??c(Ze.addLink),"data-testid":"editor-link-add-button",size:"sm",onPress:()=>{l.exec("wrapLink",_n(p)),t?.();},preventFocusOnPress:true})})]}),u===Xe.Show&&jsxs(Fragment,{children:[jsx(a$a,{padding:"lg",children:jsx(a$o,{type:"subtitle",size:"sm",children:d})}),jsxs(a$a,{display:"flex",justifyContent:"flex-end",padding:"lg",gap:"lg",borderColor:"border.subtle",borderWidth:1,borderStyle:"solid",children:[jsx(b$a,{label:n??c(Ze.editLink),"data-testid":"editor-link-edit-button",size:"sm",variant:"secondary",onPress:()=>{f(Xe.Edit);},style:{flex:1,justifyContent:"center"}}),jsx(b$a,{label:o??c(Ze.removeLink),"data-testid":"editor-link-remove-button",size:"sm",onPress:()=>{l.exec("unwrapLink"),t?.();},preventFocusOnPress:true,style:{flex:1,justifyContent:"center"}})]})]}),u===Xe.Edit&&jsxs(Fragment,{children:[m,jsxs(a$a,{display:"flex",justifyContent:"flex-end",padding:"lg",gap:"lg",borderColor:"border.subtle",borderWidth:1,borderStyle:"solid",children:[jsx(b$a,{label:i??c(Ze.cancel),"data-testid":"editor-link-cancel-button",size:"sm",variant:"secondary",onPress:()=>{f(Xe.Show),t?.();}}),jsx(b$a,{label:s??c(Ze.save),"data-testid":"editor-link-save-button",size:"sm",isDisabled:!a$s(p,true)||xe(p)==="",onPress:()=>{l.exec("updateLinkUrl",_n(p)),t?.();}})]})]})]})},Ze=c$1({addLink:{id:"bui.editor.addLink",defaultMessage:"Add Link"},editLink:{id:"bui.editor.editLink",defaultMessage:"Edit Link"},removeLink:{id:"bui.editor.removeLink",defaultMessage:"Remove Link"},cancel:{id:"bui.editor.cancel",defaultMessage:"Cancel"},save:{id:"bui.editor.save",defaultMessage:"Save"},link:{id:"bui.editor.linkAnnotation",defaultMessage:"Link"}});var oo=wt.createContext({items:[],containerRef:{current:null},maxMentionableUsersSuggestions:10}),ws=({key:t,value:e},{isDisabled:n,optionProps:o,isFocused:r,_state:i},s)=>{let{hoverProps:l}=a$4({isDisabled:n}),{label:a,data:c$1}=e;return jsxs(Fragment,{children:[jsxs("li",{...c(o,l),className:Zo({isDisabled:n,isHovered:r}),"data-active":r||void 0,ref:s,children:[jsx(a$a,{elementType:"span",display:"flex","aria-hidden":true,children:jsx(a$f,{name:a,...c$1?.avatar})}),jsxs(a$a,{display:"flex",flexDirection:"column",children:[jsx(a$o,{type:"subtitle",size:"sm",children:a}),jsx(a$o,{type:"helper",size:"sm",children:c$1?.description})]})]}),t===i.collection.getLastKey()?null:jsx(a$b,{})]})};function no(t){return t.displayName?.trim()||t.name?.trim()||t.id}function ro(t){return t.displayName??no(t)}function io({anchor:t,onClose:e,mentionLabel:n}){let{core:o}=Ce(),{containerRef:r,items:i,maxMentionableUsersSuggestions:s}=useContext(oo),[l,a]=useState(""),{contains:c$1}=a$k({sensitivity:"base"}),{formatMessage:d}=b$1(),u=useRef(false),f$1=useCallback(()=>{u.current=true,e();},[e]),p=useMemo(()=>{let x=i.filter(M=>l===""||c$1(no(M),l)).map(M=>({id:M.id,label:no(M),data:M}));return s?x.slice(0,s):x},[i,s,l,c$1]),h=useCallback(x=>jsx(a$l,{textValue:x.label,children:x.label},x.id),[]),m=useCallback(x=>{if(u.current||x==null)return;let M=i.find(G=>G.id===x);M&&(f$1(),o.exec("confirmMention",{id:M.id,displayName:ro(M)}),o.exec("insertText"," "),o.focus());},[f$1,o,i]),k=b$6({items:p,children:h,menuTrigger:"focus",onSelectionChange:m}),I=useCallback(x=>{if(u.current)return;f$1();let M=x==="backspace"?"":`@${k.inputValue}`;o.exec("removeMentionInput",M,x==="arrowStart"?"start":"end"),o.focus();},[f$1,o,k.inputValue]),$=useRef(null),w=useRef(null),j=useRef(null),N=useRef(null);a$m({ref:N,onInteractOutside:()=>{k.close();}});let{inputProps:D,listBoxProps:Q}=a$n({defaultItems:p,inputRef:w,buttonRef:$,listBoxRef:j,popoverRef:N,menuTrigger:"focus","aria-label":n??d(As.mention)},k);useLayoutEffect(()=>{w.current?.focus(),setTimeout(()=>{w.current?.focus();});},[]);let U=useCallback(x=>{let M=x.currentTarget,G=M.selectionStart===0&&M.selectionEnd===0,E=M.selectionStart===M.value.length&&M.selectionEnd===M.value.length;if(x.key==="Backspace"&&G)x.preventDefault(),I("backspace");else if(x.key==="Escape")I("escape");else if(x.key==="ArrowLeft"||x.key==="ArrowRight"){let ee=V=>x.key==="ArrowLeft"!=(b$2(V).getComputedStyle(V).direction==="rtl");(ee(M)?G:E)&&(x.preventDefault(),I(ee(t)?"arrowStart":"arrowEnd"));}let Ee=x.metaKey||x.ctrlKey,he=x.key.toLowerCase(),Te=Ee&&!x.shiftKey&&he==="z"&&o.canUndo(),ve=(Ee&&x.shiftKey&&he==="z"||x.ctrlKey&&he==="y")&&o.canRedo();(Te||ve)&&(x.preventDefault(),Te?o.undo():o.redo(),f$1(),o.focus());},[t,I,f$1,o]),pe=useMemo(()=>{if(!CSS.supports("field-sizing","content")){let x=b$2(w.current),M=w.current?x?.getComputedStyle(w.current).font:void 0;return {width:M?b$7({text:k.inputValue,font:M,element:w.current}).width+10:"4ch"}}},[k.inputValue]);return jsxs(Fragment,{children:[createPortal(jsx("input",{...c(D,{onKeyDown:U,onBlur:()=>{I("blur");},onChange:x=>{a(x.target.value);}}),style:pe,dir:/\p{L}/u.test(k.inputValue)?"auto":void 0,className:Xo,ref:w}),t),jsx(b$8.Provider,{value:k,children:jsx(a$i,{triggerRef:r,isNonModal:true,ref:N,state:k,crossOffset:-2,children:jsx(c$2,{...Q,items:void 0,ref:j,"data-testid":"editor-mention-listbox",className:a$6(f,sprinkles({width:"full"})),renderOption:ws})})})]})}io.displayName="MentionInputOverlay";var As=c$1({mention:{defaultMessage:"Mention",id:"bui.editor.mention"}});var ao=wt.forwardRef(({value:t,defaultValue:e$1,onChange:n,style:o,spellCheck:r,placeholder:i,isInline:s,isDisabled:l,editableContentAriaLabel:a,containerRef:c,onHelpDialogOpenRequest:d,mentionableUsers:u,editorHandle:f,maxMentionableUsersSuggestions:p,autoFocus:h,editorRef:m,saveOnEnter:k,onSave:I,autoLink:$,mentionLabel:w,boldLabel:j,italicLabel:N,underlineLabel:D,fontColorLabel:Q,backgroundColorLabel:U,helpLabel:pe,addLinkLabel:x,editLinkLabel:M,removeLinkLabel:G,linkAnnotationLabel:E,linkCancelLabel:Ee,linkSaveLabel:he},Te)=>{let ve=useRef(null),ee=useRef(null),{formatMessage:V}=b$1(),[Se,Le]=useState(null),Ne=useRef(0),[Qe,Oe]=useState(false),Be=()=>{let T=ee.current?.querySelector("[data-mention-anchor]");T&&(Ne.current+=1,Le({anchor:T,id:Ne.current}));},le=Xn({value:t,defaultValue:e$1,onChange:n,isDisabled:l,onMentionTrigger:Be,onMentionInputRemoved:()=>{Le(null);},canStartMention:()=>(u?.length??0)>0,resolveMention:T=>{let b=u?.find(v=>v.id===T);return b&&ro(b)},autoLink:$}),De=le.core;wt.useEffect(()=>{m&&(m.current=De);},[De,m]);let y=T=>a$2(T)?false:k&&T.key==="Enter"&&!T.shiftKey||(T.ctrlKey||T.metaKey)&&T.key==="Enter"?(T.preventDefault(),I(),true):T.altKey&&T.key==="F10"?(T.preventDefault(),ve.current?.querySelector("button")?.focus(),true):false,{editableProps:S}=Jn(le,{ref:ee,autoFocus:h,onKeyDown:y}),Re=T=>{if(l)return;let{isLinkClick:b,url:v}=br(T.target,{metaKey:T.metaKey,ctrlKey:T.ctrlKey,mac:e()});b&&(T.preventDefault(),v&&b$2(T.currentTarget).open(v,"_blank","noopener,noreferrer"));};wt.useEffect(()=>{let T=ee.current;if(!T||l)return;let b=a$8(T),v=b$2(T),Fe=Ke=>{Oe(e()?Ke.metaKey:Ke.ctrlKey);},mt=()=>{Oe(false);};return b.addEventListener("keydown",Fe),b.addEventListener("keyup",Fe),v.addEventListener("blur",mt),()=>{b.removeEventListener("keydown",Fe),b.removeEventListener("keyup",Fe),v.removeEventListener("blur",mt),mt();}},[l]),useImperativeHandle(Te,()=>({startMention:()=>{u?.length&&(ee.current?.querySelector("input[role='combobox']")||(De.exec("insertMentionInput"),Be()));}})),useImperativeHandle(f,()=>({setCaretPosition:T=>{le.setCaretPosition(T);},focus:()=>{le.focus();}}));let ze=useMemo(()=>({items:u||[],containerRef:c,maxMentionableUsersSuggestions:p}),[u,c,p]),Pe=le.isEmpty;return jsx(oo.Provider,{value:ze,children:jsxs(Qn,{editor:le,children:[jsxs(a$9,{className:a$6(qt,"BaselineUI-Editor-RichEditorToolbar"),"aria-controls":S.id,ref:ve,children:[jsxs(a$a,{display:"flex",flexDirection:"row",role:"group",gap:"xs",paddingX:"sm",children:[jsx(pn,{markName:"bold",icon:BoldIcon,ariaLabel:j??V(ht.bold),isDisabled:l}),jsx(pn,{markName:"italic",icon:ItalicIcon,ariaLabel:N??V(ht.italic),isDisabled:l}),jsx(pn,{markName:"underline",icon:UnderlineIcon,ariaLabel:D??V(ht.underline),isDisabled:l})]}),jsx(a$b,{orientation:"vertical",className:yt}),jsx(to,{colorKey:"color","aria-label":Q??V(ht.fontColor),isDisabled:l}),jsx(a$b,{orientation:"vertical",className:yt}),jsx(to,{colorKey:"backgroundColor","aria-label":U??V(ht.backgroundColor),isDisabled:l}),jsx(a$b,{orientation:"vertical",className:yt}),jsx(ii,{isDisabled:l,addLinkLabel:x,editLinkLabel:M,removeLinkLabel:G,linkAnnotationLabel:E,linkCancelLabel:Ee,linkSaveLabel:he}),jsx(a$b,{orientation:"vertical",className:yt}),jsx(a$c,{className:it,icon:QuestionmarkCircleIcon,size:"sm","aria-label":pe??V(ht.help),"data-testid":"editor-help-button",onPress:d})]}),jsx(a$b,{variant:"secondary"}),jsxs("div",{style:{position:"relative"},children:[!!(i&&Pe)&&jsx("span",{"aria-hidden":true,"aria-disabled":true,"data-testid":"editor-placeholder",style:{position:"absolute",pointerEvents:"none",userSelect:"none",top:0,left:0,right:0},className:a$6(xt({isDisabled:l}),$o,"BaselineUI-Editor-RichEditorPlaceholder"),children:i}),jsx("div",{...S,onClick:Re,"data-mod-held":Qe?"":void 0,"aria-label":a,"aria-placeholder":i,spellCheck:r,style:o,className:a$6(xt({isDisabled:l}),Wt({isInline:s}),"BaselineUI-Editor-RichEditorEditingArea")})]}),Se!==null&&jsx(io,{anchor:Se.anchor,mentionLabel:w,onClose:()=>{Le(null);}},Se.id)]})})});ao.displayName="RichEditor";var ht=c$1({bold:{defaultMessage:"Bold",id:"bui.editor.bold"},italic:{defaultMessage:"Italic",id:"bui.editor.italic"},underline:{defaultMessage:"Underline",id:"bui.editor.underline"},backgroundColor:{defaultMessage:"Background Color",id:"bui.editor.backgroundColor"},fontColor:{defaultMessage:"Font Color",id:"bui.editor.fontColor"},help:{defaultMessage:"Help",id:"bui.editor.help"}});var di=wt.memo(wt.forwardRef(({className:t,style:e,"data-block-id":n,"data-block-class":o,enableRichText:r=false,onCancel:i,onSave:s,isInline:l=true,submitButtonIcon:a=ArrowUpCircleFilledIcon,submitButtonAriaLabel:c$1,cancelButtonAriaLabel:d,"aria-label":u,"aria-describedby":f,"aria-labelledby":p,"aria-details":h,editableContentAriaLabel:m="Editing Area",footerButtons:k,clearOnCancel:I,clearOnSave:$,mentionLabel:w,boldLabel:j$1,italicLabel:N,underlineLabel:D,fontColorLabel:Q,backgroundColorLabel:U,helpLabel:pe,closeLabel:x,actionLabel:M,shortcutLabel:G,toolbarFocusLabel:E,selectAllLabel:Ee,cutLabel:he,copyLabel:Te,pasteLabel:ve,undoLabel:ee,redoLabel:V,openHelpDialogLabel:Se,submitLabel:Le,addLinkLabel:Ne,editLinkLabel:Qe,removeLinkLabel:Oe,linkAnnotationLabel:Be,linkCancelLabel:le,linkSaveLabel:De,...y},S)=>{let Re=useRef(null),{formatMessage:ze}=b$1(),Pe=useRef(null),T=useRef(null),b$2=useRef(null),v=!r&&y.variant==="minimal",Fe=useRef(null),[mt,Ke]=wt.useState(y.value||y.defaultValue),xn=y.value!==void 0&&y.onChange!==void 0;r&&y.value!==void 0&&!y.onChange&&a$d("editor-rich-value-uncontrolled","Editor: `value` without `onChange` in rich text mode sets the initial content only. Use `defaultValue` for uncontrolled content, or add `onChange` to control the value.");let po=y.value!==void 0&&(!r||xn),yn=y.value;wt.useEffect(()=>{po&&yn!==void 0&&Ke(yn);},[po,yn]);let bn=y.isDisabled||y.isSaveDisabled||!b$3(mt||""),{fieldProps:ui}=a$e({"aria-label":u,"aria-labelledby":p,"aria-describedby":f,"aria-details":h,labelElementType:"div"});v&&!y.avatarName&&console.warn("Editor: When using the minimal `variant` and `enableRichText` is `false`, you should provide an `avatarName`.");let En=useCallback(()=>{Ke(""),r?Re.current?.setValue("<p></p>",{emit:true}):T.current?.clear();},[r]),It=useCallback(()=>{bn||(s?.(r?Re.current?.getValue()??"":Pe.current.value),$&&En());},[En,$,r,s,bn]),ho=jsx(a$c,{variant:"ghost","aria-label":c$1||ze(uo.save),icon:a,isDisabled:bn,"data-testid":"editor-save-button",size:"md",excludeFromTabOrder:v,className:a$6({[Jo]:v},"BaselineUI-Editor-Save"),onPress:It,preventFocusOnPress:true}),[fi,Tn]=wt.useState(false),{keyboardProps:pi}=j({onKeyDown:W=>{(W.metaKey||W.ctrlKey)&&W.shiftKey&&W.key.toLowerCase()==="h"?(W.preventDefault(),Tn(true)):W.continuePropagation();}}),mo=useCallback(W=>{Ke(W),y.onChange?.(W);},[y]);return jsxs("div",{...c(ui,r?pi:{}),role:"application",ref:b(b$2,S),style:e,"data-block-id":n,"data-block-class":o,className:a$6(qo({isInline:l,isMinimal:v}),"BaselineUI-Editor",t),"aria-disabled":y.isDisabled,children:[v?jsxs(Fragment,{children:[l?jsx(a$f,{className:Wo,name:y.avatarName||""}):null,jsxs("div",{className:er({isInline:l}),children:[jsx($t,{isMinimal:v,textBoxRef:Pe,ref:T,isInline:l,editableContentAriaLabel:m,...y,onChange:mo,onSave:It}),ho]})]}):jsxs(Fragment,{children:[r?jsx(ao,{containerRef:b$2,ref:Fe,editorRef:Re,isInline:l,editableContentAriaLabel:m,onHelpDialogOpenRequest:()=>{Tn(true);},mentionLabel:w,boldLabel:j$1,italicLabel:N,underlineLabel:D,fontColorLabel:Q,backgroundColorLabel:U,helpLabel:pe,addLinkLabel:Ne,editLinkLabel:Qe,removeLinkLabel:Oe,linkAnnotationLabel:Be,linkCancelLabel:le,linkSaveLabel:De,...y,value:xn?y.value:void 0,defaultValue:y.defaultValue??(xn?void 0:y.value),onChange:mo,onSave:It}):jsxs(Fragment,{children:[!l&&jsx(a$b,{variant:"secondary"}),jsx($t,{onCancel:i,textBoxRef:Pe,ref:T,isInline:l,editableContentAriaLabel:m,...y,onChange:W=>{Ke(W),y.onChange?.(W);},onSave:It})]}),jsx(a$b,{variant:"secondary"}),jsxs("div",{className:a$6(qt,sprinkles({justifyContent:"space-between"}),"BaselineUI-Editor-Footer"),children:[jsxs(a$a,{paddingX:"sm",gap:"sm",display:"flex",children:[r&&y.mentionableUsers?jsx(a$c,{icon:AtIcon,size:"sm","aria-label":w??ze(uo.mention),"data-testid":"editor-mention-button",onPress:()=>Fe.current?.startMention(),preventFocusOnPress:true,className:"BaselineUI-Editor-Mention"}):null,k?.map(({type:W,props:_t},go)=>W==="action"?jsx(a$c,{..._t,size:"sm",isDisabled:y.isDisabled||_t.isDisabled},go):jsx(a$g,{..._t,size:"sm",variant:"tertiary",isDisabled:y.isDisabled||_t.isDisabled},go))]}),jsxs(a$a,{children:[!!i&&jsx(a$c,{variant:"secondary",icon:XCircleFilledIcon,isDisabled:y.isDisabled,"data-testid":"editor-cancel-button",size:"md",onPress:()=>{i(),I&&En();},"aria-label":d||ze(uo.cancel),className:"BaselineUI-Editor-Cancel"}),ho]})]})]}),jsx(lr,{isOpen:fi,onClose:()=>{Tn(false);},toolbarFocusLabel:E,helpLabel:pe,closeLabel:x,actionLabel:M,shortcutLabel:G,boldLabel:j$1,italicLabel:N,underlineLabel:D,selectAllLabel:Ee,cutLabel:he,copyLabel:Te,pasteLabel:ve,undoLabel:ee,redoLabel:V,openHelpDialogLabel:Se,submitLabel:Le})]})}));di.displayName="Editor";var uo=c$1({cancel:{defaultMessage:"Cancel",id:"bui.editor.cancel"},save:{defaultMessage:"Save",id:"bui.editor.save"},mention:{defaultMessage:"Mention",id:"bui.editor.mention"}});
|
|
30
|
+
export{zn as a,J as b,we as c,Ae as d,Lt as e,Ce as f,fn as g,Xn as h,oi as i,Jn as j,Qn as k,di as l};
|
|
@@ -7,4 +7,4 @@ import {b}from'./chunk-N2XGJKZG.mjs';import {b as b$2}from'./chunk-CU6D2EA6.mjs'
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
var $=1e7;function xt(t,e,l){let o=st(e.body,l);return t==="left"?{...o,left:-$/2,width:$,totalWidth:$,scroll:{...o.scroll,left:0}}:{...o,top:-$/2,height:$,totalHeight:$,scroll:{...o.scroll,top:0}}}var B={top:"top",bottom:"top",left:"left",right:"left"},G={top:"bottom",bottom:"top",left:"right",right:"left"},Mt={top:"left",left:"top"},it={top:"height",left:"width"},Rt={width:"totalWidth",height:"totalHeight"},J={};function It(t){let e=b$1(t);return typeof e<"u"&&e.visualViewport?e.visualViewport:null}function st(t,e){let l=a(t),o=0,n=0,s=0,i=0,c=0,u=0,r={},m=(e?.scale??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let h=l.documentElement;s=h.clientWidth,i=h.clientHeight,o=e?.width??s,n=e?.height??i,r.top=h.scrollTop||t.scrollTop,r.left=h.scrollLeft||t.scrollLeft,e&&(c=Math.max(0,e.pageTop-(r.top??0)),u=Math.max(0,e.pageLeft-(r.left??0)));}else (({width:o,height:n,top:c,left:u}=Z(t,false))),r.top=t.scrollTop,r.left=t.scrollLeft,s=o,i=n;return j()&&(t.tagName==="BODY"||t.tagName==="HTML")&&m&&(r.top=0,r.left=0,c=e?.pageTop??0,u=e?.pageLeft??0),{width:o,height:n,totalWidth:s,totalHeight:i,scroll:r,top:c,left:u}}function vt(t){return {top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Q(t,e,l,o,n,s,i){let c=n.scroll[t]??0,u=o[it[t]],r=i[t]+o.scroll[B[t]]+s,m=i[t]+o.scroll[B[t]]+u-s,h=e-c+o.scroll[B[t]]+i[t]-o[B[t]],d=e-c+l+o.scroll[B[t]]+i[t]-o[B[t]];return h<r?r-h:d>m?Math.max(m-d,r-h):0}function St(t){let l=b$1(t).getComputedStyle(t);return {top:parseInt(l.marginTop,10)||0,bottom:parseInt(l.marginBottom,10)||0,left:parseInt(l.marginLeft,10)||0,right:parseInt(l.marginRight,10)||0}}function rt(t){if(J[t])return J[t];let[e,l]=t.split(" "),o=B[e]||"right",n=Mt[o];B[l]||(l="center");let s=it[o],i=it[n];return J[t]={placement:e,crossPlacement:l,axis:o,crossAxis:n,size:s,crossSize:i},J[t]}function tt(t,e,l,o,n,s,i,c,u,r,m){let{placement:h,crossPlacement:d,axis:y,crossAxis:f,size:L,crossSize:w}=o,b={};b[f]=t[f]??0,d==="center"?b[f]+=((t[w]??0)-(l[w]??0))/2:d!==f&&(b[f]+=(t[w]??0)-(l[w]??0)),b[f]+=s;let E=t[f]-l[w]+u+r,C=t[f]+t[w]-u-r;if(b[f]=a$2(b[f],E,C),h===y){let D=c?m[L]:m[Rt[L]];b[G[y]]=Math.floor(D-t[y]+n);}else b[y]=Math.floor(t[y]+t[L]+n);return b}function zt(t,e,l,o,n,s,i,c,u,r,m){let h=(t.top!=null?t.top:u[Rt.height]-(t.bottom??0)-i)-(u.scroll.top??0),d=r?l.top:0,y={top:Math.max(e.top+d,(m?.offsetTop??e.top)+d),bottom:Math.min(e.top+e.height+d,(m?.offsetTop??0)+(m?.height??0))};return c!=="top"?Math.max(0,y.bottom-h-((n.top??0)+(n.bottom??0)+s)):Math.max(0,h+i-y.top-((n.top??0)+(n.bottom??0)+s))}function wt(t,e,l,o,n,s,i,c){let{placement:u,axis:r,size:m}=s;return u===r?Math.max(0,l[r]-(i.scroll[r]??0)-(t[r]+(c?e[r]:0))-(o[r]??0)-o[G[r]]-n):Math.max(0,t[m]+t[r]+(c?e[r]:0)-l[r]-l[m]+(i.scroll[r]??0)-(o[r]??0)-o[G[r]]-n)}function Ft(t,e,l,o,n,s,i,c,u,r,m,h,d,y,f,L,w,b,E,C,D,_){let a=rt(t),{size:A,crossAxis:p,crossSize:R,placement:M,crossPlacement:T}=a,P=tt(e,c,l,a,m,h,r,d,f,L,u),S=m,k=E?$:wt(c,r,e,n,s+m,a,u,w);if(i&&l[A]>k){let j=rt(`${G[M]} ${T}`),X=tt(e,c,l,j,m,h,r,d,f,L,u);wt(c,r,e,n,s+m,j,u,w)>k&&(a=j,P=X,S=m);}if(_==="anchor"&&C&&(a.placement==="top"||a.placement==="bottom")){let j=E?0:Q(p,P[p],l[R],c,u,s,r);if(j!==0){let X=a.crossPlacement==="center"?j>0?"left":"right":G[a.crossPlacement];if(X){let lt=rt(`${a.placement} ${X}`),pt=tt(e,c,l,lt,m,h,r,d,f,L,u),Ot=E?0:Q(p,pt[p],l[R],c,u,s,r);Math.abs(Ot)<Math.abs(j)&&(a=lt,P=pt);}}}let I="bottom";a.axis==="top"?a.placement==="top"?I="top":a.placement==="bottom"&&(I="bottom"):a.crossAxis==="top"&&(a.crossPlacement==="top"?I="bottom":a.crossPlacement==="bottom"&&(I="top"));let V=_==="anchor"&&C&&(a.placement==="top"||a.placement==="bottom")&&a.crossPlacement!=="center",z=V||E?0:Q(p,P[p],l[R],c,u,s,r);P[p]+=z;let x=E||!D?void 0:zt(P,c,r,d,n,s,l.height,I,u,w,b);y&&(x==null||y<x)&&(x=y),l.height=x!=null?Math.min(l.height,x):l.height,P=tt(e,c,l,a,S,h,r,d,f,L,u),z=V||E?0:Q(p,P[p],l[R],c,u,s,r),P[p]+=z;let v={},g=e[p]-P[p]-n[B[p]],H=g+.5*e[R],F=f/2+L,W=B[p]==="left"?(n.left??0)+(n.right??0):(n.top??0)+(n.bottom??0),N=l[R]-W-f/2-L,ot=e[p]+f/2-(P[p]+n[B[p]]),Ht=e[p]+e[R]-f/2-(P[p]+n[B[p]]),Lt=a$2(H,ot,Ht);v[p]=a$2(Lt,F,N),{placement:M,crossPlacement:T}=a,f?g=v[p]:T==="right"?g+=e[R]:T==="center"&&(g+=e[R]/2);let mt=M==="left"||M==="top"?l[A]:0,Ct={x:M==="top"||M==="bottom"?g:mt,y:M==="left"||M==="right"?g:mt};return {position:P,maxHeight:x,arrowOffsetLeft:v.left,arrowOffsetTop:v.top,placement:M,triggerAnchorPoint:Ct}}function Tt(t){let{placement:e,targetNode:l,overlayNode:o,scrollNode:n,padding:s,shouldFlip:i,boundaryElement:c,boundaryAxis:u="both",horizontalBoundaryBehavior:r="shift",offset:m,crossOffset:h$1,maxHeight:d,arrowSize:y=0,arrowBoundaryOffset:f=0,targetRect:L}=t,w=a(o),b=b$1(o),E=It(o),C=o instanceof b.HTMLElement?Bt(o):w.documentElement,D=C===w.documentElement,_=b.getComputedStyle(C).position,a$1=!!_&&_!=="static",A=D?Z(l,false,L):Et(l,C,false,L);if(!D){let{marginTop:F,marginLeft:W}=b.getComputedStyle(l);A.top+=parseInt(F,10)||0,A.left+=parseInt(W,10)||0;}let p=Z(o,true),R=St(o);p.width+=(R.left??0)+(R.right??0),p.height+=(R.top??0)+(R.bottom??0);let M=vt(n),T=c===null,P=c??w.body,S=!T&&u!=="vertical",k=!T&&u!=="horizontal",I=st(P,E),V=S?I:xt("left",w,E),z=k?I:xt("top",w,E),x={...z,left:V.left,width:V.width,totalWidth:V.totalWidth,scroll:{top:z.scroll.top,left:V.scroll.left}},v=st(C,E);a$1&&!D&&(x.top-=v.top,x.left-=v.left,v.top=0,v.left=0);let g=T?{top:0,left:0,width:0,height:0}:Et(P,C,false),H=!T&&h(P,C)&&C!==P;return Ft(e,A,p,M,R,s,i,x,v,g,m,h$1,a$1,d,y,f,H,E,T,S,k,r)}function et(t,e){let l=b$1(t),{top:o,left:n,width:s,height:i}=t.getBoundingClientRect();return e&&t instanceof l.HTMLElement&&(s=t.offsetWidth,i=t.offsetHeight),{top:o,left:n,width:s,height:i}}function Z(t,e,l){let o=a(t),{top:n,left:s,width:i,height:c}=l||et(t,e),{scrollTop:u,scrollLeft:r,clientTop:m,clientLeft:h}=o.documentElement;return {top:n+u-m,left:s+r-h,width:i,height:c}}function Et(t,e,l,o){let n=b$1(t),s=n.getComputedStyle(t),i;if(s.position==="fixed")i=o||et(t,l);else {i=Z(t,l,o);let c=Z(e,l),u=n.getComputedStyle(e);c.top+=(parseInt(u.borderTopWidth,10)||0)-e.scrollTop,c.left+=(parseInt(u.borderLeftWidth,10)||0)-e.scrollLeft,i.top-=c.top,i.left-=c.left;}return i.top-=parseInt(s.marginTop,10)||0,i.left-=parseInt(s.marginLeft,10)||0,i}function Bt(t){let e=a(t),l=b$1(t),o=t.offsetParent;if(o&&o===e.body&&l.getComputedStyle(o).position==="static"&&!At(o)&&(o=e.documentElement),o==null)for(o=t.parentElement;o&&!At(o);)o=o.parentElement;return o||e.documentElement}function At(t){let l=b$1(t).getComputedStyle(t);return l.transform!=="none"||/transform|perspective/.test(l.willChange)||l.filter!=="none"||l.contain==="paint"||"backdropFilter"in l&&l.backdropFilter!=="none"||"WebkitBackdropFilter"in l&&l.WebkitBackdropFilter!=="none"}function at(t){return typeof document>"u"?null:b$1(t).visualViewport??null}function oe(t){let{direction:e$2}=b(),{arrowSize:l$1,targetRef:o,overlayRef:n,arrowRef:s,scrollRef:i$1=n,placement:c="bottom",containerPadding:u=12,shouldFlip:r=true,boundaryElement:m,boundaryAxis:h$1="both",horizontalBoundaryBehavior:d="shift",offset:y=0,crossOffset:f=0,shouldUpdatePosition:L=true,shouldCloseOnScroll:w=true,isOpen:b$3=true,onClose:E,maxHeight:C,arrowBoundaryOffset:D=0,getTargetRect:_}=t,a$2=m??(typeof document<"u"?o.current?.ownerDocument.body??n.current?.ownerDocument.body??document.body:void 0),[A,p]=useState(null),R=[L,c,n.current,o.current,s?.current,i$1.current,u,r,a$2,h$1,d,y,f,b$3,e$2,C,D,l$1],M=useRef(at(n.current)?.scale);useEffect(()=>{b$3&&(M.current=at(n.current)?.scale);},[b$3,n]);let T=useCallback(()=>{if(L===false||!b$3||!n.current||!o.current||a$2===void 0||at(n.current)?.scale!==M.current)return;let z=a(n.current),x=i(z),v=b$1(z.body),g=null;if(i$1.current&&h(i$1.current,x)){let W=x?.getBoundingClientRect(),N=i$1.current.getBoundingClientRect();g={type:"top",offset:(W?.top??0)-N.top},g.offset>N.height/2&&(g.type="bottom",g.offset=(W?.bottom??0)-N.bottom);}let H=n.current;!C&&n.current&&(H.style.top="0px",H.style.bottom="",H.style.maxHeight=(v.visualViewport?.height??v.innerHeight)+"px");let F=Tt({placement:Vt(c,e$2),overlayNode:n.current,targetNode:o.current,scrollNode:i$1.current||n.current,padding:u,shouldFlip:r,boundaryElement:a$2,boundaryAxis:h$1,horizontalBoundaryBehavior:d,offset:y,crossOffset:f,maxHeight:C,arrowSize:l$1??(s?.current?et(s.current,true).width:0),arrowBoundaryOffset:D,targetRect:_?.(o.current)});if(F.position){if(H.style.top="",H.style.bottom="",H.style.left="",H.style.right="",Object.keys(F.position).forEach(W=>H.style[W]=F.position[W]+"px"),H.style.maxHeight=F.maxHeight!=null?F.maxHeight+"px":"",g&&x&&i$1.current){let W=x.getBoundingClientRect(),N=i$1.current.getBoundingClientRect(),ot=W[g.type]-N[g.type];i$1.current.scrollTop+=ot-g.offset;}p(F);}},R);a$1(T,R);let P=a$2?b$1(a$2):o.current?b$1(o.current):n.current?b$1(n.current):void 0;Dt(T,P);let S=useRef(null),k=useCallback(()=>{S.current!==null&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{S.current=null,T();});},[T]);useEffect(()=>()=>{S.current!==null&&cancelAnimationFrame(S.current);},[]),e({ref:n,onResize:k}),e({ref:o,onResize:k});let I=useRef(false);a$1(()=>{let z,x=()=>{I.current=true,clearTimeout(z),z=setTimeout(()=>{I.current=false;},500),T();},g=b$1(n.current).visualViewport,H=()=>{I.current&&x();};g?.addEventListener("resize",x),g?.addEventListener("scroll",H);let F=e$1(l(window),"scroll",H);return ()=>{g?.removeEventListener("resize",x),g?.removeEventListener("scroll",H),F();}},[T]);let V=useCallback(()=>{I.current||E?.();},[E,I]);return b$2({triggerRef:o,isOpen:b$3,onClose:w?E&&V:null}),{overlayProps:{style:{position:A?"absolute":"fixed",top:A?void 0:0,left:A?void 0:0,zIndex:1e5,...A?.position,maxHeight:A==null?"100vh":A.maxHeight!=null?`${A.maxHeight}px`:""}},placement:A?.placement??null,triggerAnchorPoint:A?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:A?.arrowOffsetLeft,top:A?.arrowOffsetTop}},updatePosition:T}}function Dt(t,e=window){a$1(()=>(e?.addEventListener("resize",t,false),()=>{e?.removeEventListener("resize",t,false);}),[t,e]);}function Vt(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}export{oe as a};
|
|
10
|
+
var $=1e7;function xt(t,e,l){let o=st(e.body,l);return t==="left"?{...o,left:-$/2,width:$,totalWidth:$,scroll:{...o.scroll,left:0}}:{...o,top:-$/2,height:$,totalHeight:$,scroll:{...o.scroll,top:0}}}var B={top:"top",bottom:"top",left:"left",right:"left"},G={top:"bottom",bottom:"top",left:"right",right:"left"},Mt={top:"left",left:"top"},it={top:"height",left:"width"},Rt={width:"totalWidth",height:"totalHeight"},J={};function It(t){let e=b$1(t);return typeof e<"u"&&e.visualViewport?e.visualViewport:null}function st(t,e){let l=a(t),o=0,n=0,s=0,i=0,c=0,u=0,r={},m=(e?.scale??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let h=l.documentElement;s=h.clientWidth,i=h.clientHeight,o=e?.width??s,n=e?.height??i,r.top=h.scrollTop||t.scrollTop,r.left=h.scrollLeft||t.scrollLeft,e&&(c=Math.max(0,e.pageTop-(r.top??0)),u=Math.max(0,e.pageLeft-(r.left??0)));}else (({width:o,height:n,top:c,left:u}=Z(t,false))),r.top=t.scrollTop,r.left=t.scrollLeft,s=o,i=n;return j()&&(t.tagName==="BODY"||t.tagName==="HTML")&&m&&(r.top=0,r.left=0,c=e?.pageTop??0,u=e?.pageLeft??0),{width:o,height:n,totalWidth:s,totalHeight:i,scroll:r,top:c,left:u}}function vt(t){return {top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Q(t,e,l,o,n,s,i){let c=n.scroll[t]??0,u=o[it[t]],r=i[t]+o.scroll[B[t]]+s,m=i[t]+o.scroll[B[t]]+u-s,h=e-c+o.scroll[B[t]]+i[t]-o[B[t]],d=e-c+l+o.scroll[B[t]]+i[t]-o[B[t]];return h<r?r-h:d>m?Math.max(m-d,r-h):0}function St(t){let l=b$1(t).getComputedStyle(t);return {top:parseInt(l.marginTop,10)||0,bottom:parseInt(l.marginBottom,10)||0,left:parseInt(l.marginLeft,10)||0,right:parseInt(l.marginRight,10)||0}}function rt(t){if(J[t])return J[t];let[e,l]=t.split(" "),o=B[e]||"right",n=Mt[o];B[l]||(l="center");let s=it[o],i=it[n];return J[t]={placement:e,crossPlacement:l,axis:o,crossAxis:n,size:s,crossSize:i},J[t]}function tt(t,e,l,o,n,s,i,c,u,r,m){let{placement:h,crossPlacement:d,axis:y,crossAxis:f,size:L,crossSize:w}=o,b={};b[f]=t[f]??0,d==="center"?b[f]+=((t[w]??0)-(l[w]??0))/2:d!==f&&(b[f]+=(t[w]??0)-(l[w]??0)),b[f]+=s;let E=t[f]-l[w]+u+r,C=t[f]+t[w]-u-r;if(b[f]=a$2(b[f],E,C),h===y){let D=c?m[L]:m[Rt[L]];b[G[y]]=Math.floor(D-t[y]+n);}else b[y]=Math.floor(t[y]+t[L]+n);return b}function zt(t,e,l,o,n,s,i,c,u,r,m){let h=(t.top!=null?t.top:u[Rt.height]-(t.bottom??0)-i)-(u.scroll.top??0),d=r?l.top:0,y={top:Math.max(e.top+d,(m?.offsetTop??e.top)+d),bottom:Math.min(e.top+e.height+d,(m?.offsetTop??0)+(m?.height??0))};return c!=="top"?Math.max(0,y.bottom-h-((n.top??0)+(n.bottom??0)+s)):Math.max(0,h+i-y.top-((n.top??0)+(n.bottom??0)+s))}function wt(t,e,l,o,n,s,i,c){let{placement:u,axis:r,size:m}=s;return u===r?Math.max(0,l[r]-(i.scroll[r]??0)-(t[r]+(c?e[r]:0))-(o[r]??0)-o[G[r]]-n):Math.max(0,t[m]+t[r]+(c?e[r]:0)-l[r]-l[m]+(i.scroll[r]??0)-(o[r]??0)-o[G[r]]-n)}function Ft(t,e,l,o,n,s,i,c,u,r,m,h,d,y,f,L,w,b,E,C,D,_){let a=rt(t),{size:A,crossAxis:p,crossSize:R,placement:M,crossPlacement:T}=a,P=tt(e,c,l,a,m,h,r,d,f,L,u),S=m,k=E?$:wt(c,r,e,n,s+m,a,u,w);if(i&&l[A]>k){let j=rt(`${G[M]} ${T}`),X=tt(e,c,l,j,m,h,r,d,f,L,u);wt(c,r,e,n,s+m,j,u,w)>k&&(a=j,P=X,S=m);}if(_==="anchor"&&C&&(a.placement==="top"||a.placement==="bottom")){let j=E?0:Q(p,P[p],l[R],c,u,s,r);if(j!==0){let X=a.crossPlacement==="center"?j>0?"left":"right":G[a.crossPlacement];if(X){let lt=rt(`${a.placement} ${X}`),pt=tt(e,c,l,lt,m,h,r,d,f,L,u),Ot=E?0:Q(p,pt[p],l[R],c,u,s,r);Math.abs(Ot)<Math.abs(j)&&(a=lt,P=pt);}}}let I="bottom";a.axis==="top"?a.placement==="top"?I="top":a.placement==="bottom"&&(I="bottom"):a.crossAxis==="top"&&(a.crossPlacement==="top"?I="bottom":a.crossPlacement==="bottom"&&(I="top"));let V=_==="anchor"&&C&&(a.placement==="top"||a.placement==="bottom")&&a.crossPlacement!=="center",z=V||E?0:Q(p,P[p],l[R],c,u,s,r);P[p]+=z;let x=E||!D?void 0:zt(P,c,r,d,n,s,l.height,I,u,w,b);y&&(x==null||y<x)&&(x=y),l.height=x!=null?Math.min(l.height,x):l.height,P=tt(e,c,l,a,S,h,r,d,f,L,u),z=V||E?0:Q(p,P[p],l[R],c,u,s,r),P[p]+=z;let v={},g=e[p]-P[p]-n[B[p]],H=g+.5*e[R],F=f/2+L,W=B[p]==="left"?(n.left??0)+(n.right??0):(n.top??0)+(n.bottom??0),N=l[R]-W-f/2-L,ot=e[p]+f/2-(P[p]+n[B[p]]),Ht=e[p]+e[R]-f/2-(P[p]+n[B[p]]),Lt=a$2(H,ot,Ht);v[p]=a$2(Lt,F,N),{placement:M,crossPlacement:T}=a,f?g=v[p]:T==="right"?g+=e[R]:T==="center"&&(g+=e[R]/2);let mt=M==="left"||M==="top"?l[A]:0,Ct={x:M==="top"||M==="bottom"?g:mt,y:M==="left"||M==="right"?g:mt};return {position:P,maxHeight:x,arrowOffsetLeft:v.left,arrowOffsetTop:v.top,placement:M,triggerAnchorPoint:Ct}}function Tt(t){let{placement:e,targetNode:l,overlayNode:o,scrollNode:n,padding:s,shouldFlip:i,boundaryElement:c,boundaryAxis:u="both",horizontalBoundaryBehavior:r="shift",offset:m,crossOffset:h$1,maxHeight:d,arrowSize:y=0,arrowBoundaryOffset:f=0,targetRect:L}=t,w=a(o),b=b$1(o),E=It(o),C=o instanceof b.HTMLElement?Bt(o):w.documentElement,D=C===w.documentElement,_=b.getComputedStyle(C).position,a$1=!!_&&_!=="static",A=D?Z(l,false,L):Et(l,C,false,L);if(!D){let{marginTop:F,marginLeft:W}=b.getComputedStyle(l);A.top+=parseInt(F,10)||0,A.left+=parseInt(W,10)||0;}let p=Z(o,true),R=St(o);p.width+=(R.left??0)+(R.right??0),p.height+=(R.top??0)+(R.bottom??0);let M=vt(n),T=c===null,P=c??w.body,S=!T&&u!=="vertical",k=!T&&u!=="horizontal",I=st(P,E),V=S?I:xt("left",w,E),z=k?I:xt("top",w,E),x={...z,left:V.left,width:V.width,totalWidth:V.totalWidth,scroll:{top:z.scroll.top,left:V.scroll.left}},v=st(C,E);a$1&&!D&&(x.top-=v.top,x.left-=v.left,v.top=0,v.left=0);let g=T?{top:0,left:0,width:0,height:0}:Et(P,C,false),H=!T&&h(P,C)&&C!==P;return Ft(e,A,p,M,R,s,i,x,v,g,m,h$1,a$1,d,y,f,H,E,T,S,k,r)}function et(t,e){let l=b$1(t),{top:o,left:n,width:s,height:i}=t.getBoundingClientRect();return e&&t instanceof l.HTMLElement&&(s=t.offsetWidth,i=t.offsetHeight),{top:o,left:n,width:s,height:i}}function Z(t,e,l){let o=a(t),{top:n,left:s,width:i,height:c}=l||et(t,e),{scrollTop:u,scrollLeft:r,clientTop:m,clientLeft:h}=o.documentElement;return {top:n+u-m,left:s+r-h,width:i,height:c}}function Et(t,e,l,o){let n=b$1(t),s=n.getComputedStyle(t),i;if(s.position==="fixed")i=o||et(t,l);else {i=Z(t,l,o);let c=Z(e,l),u=n.getComputedStyle(e);c.top+=(parseInt(u.borderTopWidth,10)||0)-e.scrollTop,c.left+=(parseInt(u.borderLeftWidth,10)||0)-e.scrollLeft,i.top-=c.top,i.left-=c.left;}return i.top-=parseInt(s.marginTop,10)||0,i.left-=parseInt(s.marginLeft,10)||0,i}function Bt(t){let e=a(t),l=b$1(t),o=t.offsetParent;if(o&&o===e.body&&l.getComputedStyle(o).position==="static"&&!At(o)&&(o=e.documentElement),o==null)for(o=t.parentElement;o&&!At(o);)o=o.parentElement;return o||e.documentElement}function At(t){let l=b$1(t).getComputedStyle(t);return l.transform!=="none"||/transform|perspective/.test(l.willChange)||l.filter!=="none"||l.contain==="paint"||"backdropFilter"in l&&l.backdropFilter!=="none"||"WebkitBackdropFilter"in l&&l.WebkitBackdropFilter!=="none"}function at(t){return typeof document>"u"?null:b$1(t).visualViewport??null}function oe(t){let{direction:e$2}=b(),{arrowSize:l$1,targetRef:o,overlayRef:n,arrowRef:s,scrollRef:i$1=n,placement:c="bottom",containerPadding:u=12,shouldFlip:r=true,boundaryElement:m,boundaryAxis:h$1="both",horizontalBoundaryBehavior:d="shift",offset:y=0,crossOffset:f=0,shouldUpdatePosition:L=true,shouldCloseOnScroll:w=true,isOpen:b$3=true,onClose:E,maxHeight:C,arrowBoundaryOffset:D=0,getTargetRect:_}=t,a$2=m??(typeof document<"u"?o.current?.ownerDocument.body??n.current?.ownerDocument.body??document.body:void 0),[A,p]=useState(null),R=[L,c,n.current,o.current,s?.current,i$1.current,u,r,a$2,h$1,d,y,f,b$3,e$2,C,D,l$1],M=useRef(at(n.current)?.scale);useEffect(()=>{b$3&&(M.current=at(n.current)?.scale);},[b$3,n]);let T=useCallback(()=>{if(L===false||!b$3||!n.current||!o.current||a$2===void 0||at(n.current)?.scale!==M.current)return;let z=a(n.current),x=i(z),v=b$1(z.body),g=null;if(i$1.current&&h(i$1.current,x)){let W=x?.getBoundingClientRect(),N=i$1.current.getBoundingClientRect();g={type:"top",offset:(W?.top??0)-N.top},g.offset>N.height/2&&(g.type="bottom",g.offset=(W?.bottom??0)-N.bottom);}let H=n.current;!C&&n.current&&(H.style.top="0px",H.style.bottom="",H.style.maxHeight=(v.visualViewport?.height??v.innerHeight)+"px");let F=Tt({placement:Vt(c,e$2),overlayNode:n.current,targetNode:o.current,scrollNode:i$1.current||n.current,padding:u,shouldFlip:r,boundaryElement:a$2,boundaryAxis:h$1,horizontalBoundaryBehavior:d,offset:y,crossOffset:f,maxHeight:C,arrowSize:l$1??(s?.current?et(s.current,true).width:0),arrowBoundaryOffset:D,targetRect:_?.(o.current)});if(F.position){if(H.style.top="",H.style.bottom="",H.style.left="",H.style.right="",Object.keys(F.position).forEach(W=>H.style[W]=F.position[W]+"px"),H.style.maxHeight=F.maxHeight!=null?F.maxHeight+"px":"",g&&x&&i$1.current){let W=x.getBoundingClientRect(),N=i$1.current.getBoundingClientRect(),ot=W[g.type]-N[g.type];i$1.current.scrollTop+=ot-g.offset;}p(F);}},R);a$1(T,R);let P=a$2?b$1(a$2):o.current?b$1(o.current):n.current?b$1(n.current):void 0;Dt(T,P);let S=useRef(null),k=useCallback(()=>{S.current!==null&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{S.current=null,T();});},[T]);useEffect(()=>()=>{S.current!==null&&cancelAnimationFrame(S.current);},[]),e({ref:n,onResize:k}),e({ref:o,onResize:k});let I=useRef(false);a$1(()=>{let z,x=()=>{I.current=true,clearTimeout(z),z=setTimeout(()=>{I.current=false;},500),T();},g=b$1(n.current).visualViewport,H=()=>{I.current&&x();};g?.addEventListener("resize",x),g?.addEventListener("scroll",H);let F=e$1(l(n.current),"scroll",H);return ()=>{g?.removeEventListener("resize",x),g?.removeEventListener("scroll",H),F();}},[T]);let V=useCallback(()=>{I.current||E?.();},[E,I]);return b$2({triggerRef:o,isOpen:b$3,onClose:w?E&&V:null}),{overlayProps:{style:{position:A?"absolute":"fixed",top:A?void 0:0,left:A?void 0:0,zIndex:1e5,...A?.position,maxHeight:A==null?"100vh":A.maxHeight!=null?`${A.maxHeight}px`:""}},placement:A?.placement??null,triggerAnchorPoint:A?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:A?.arrowOffsetLeft,top:A?.arrowOffsetTop}},updatePosition:T}}function Dt(t,e=typeof window<"u"?window:void 0){a$1(()=>(e?.addEventListener("resize",t,false),()=>{e?.removeEventListener("resize",t,false);}),[t,e]);}function Vt(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}export{oe as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$a}from'./chunk-5HXTXIE5.mjs';import {a as a$3}from'./chunk-MZIQ27JP.mjs';import {d,a as a$9,c as c$2,b as b$3}from'./chunk-5MUEJ5WI.mjs';import {a as a$8}from'./chunk-RO5ZRU3Y.mjs';import {a as a$5}from'./chunk-6GV3YWV7.mjs';import {a}from'./chunk-R6TFTLMV.mjs';import {b,c as c$3}from'./chunk-IDIZSV2Y.mjs';import {b as b$2}from'./chunk-INFMXVHD.mjs';import {a as a$6}from'./chunk-2OXYNLVN.mjs';import {b as b$1}from'./chunk-K5RYVERS.mjs';import {a as a$4}from'./chunk-2VY4FAOY.mjs';import {a as a$1}from'./chunk-STMDFIUL.mjs';import {a as a$2}from'./chunk-B3EZOXNU.mjs';import {j}from'./chunk-KUDCYGII.mjs';import {c as c$1,b as b$4}from'./chunk-3WKDIXCM.mjs';import {c}from'./chunk-ETM4MNG4.mjs';import {a as a$7}from'./chunk-4QEH5CGK.mjs';import {UndoIcon,RedoIcon}from'@baseline-ui/icons/16';import {useGranularEffect}from'granular-hooks';import {getStroke}from'perfect-freehand';import h,{useState,useCallback,useMemo,useRef}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
function le({line:t,options:o}){let r=useRef([]),m=useMemo(()=>{let i=Math.ceil(t.length/g),d;for(let a=0;a<i;a++)if(!(!(a===i-1)&&!!r.current[a])){let C=t.slice(a*g-(a>0?1:0),a*g+g);d=a$a(getStroke(C.map(([k,v,l])=>({x:k,y:v,pressure:l})),o)),C.length>=(a>0?g+1:g)&&(r.current[a]=d);}return d},[t,o]);return [...r.current,m]}var g=180;var Xe={size:1,thinning:0,smoothing:0,streamline:0,easing:t=>t,start:{taper:0,easing:t=>t,cap:true},end:{taper:0,easing:t=>t,cap:true},simulatePressure:false},pe=h.forwardRef(({className:t,style:o,canvasClassName:r,canvasStyle:m,isBound:i=true,strokeWidth:d$1=2,strokeColor:a$a="#3A87FD",onChange:P,defaultValue:H,onChangeEnd:C,enableHistory:k=false,isInline:v=true,isDisabled:l,placeholder:E,clearLabel:R,undoLabel:ve,redoLabel:ge,footerClassName:Pe,canvasRef:Ce,value:N,footerStyle:ke,"data-block-id":ye,"data-block-class":Se,"aria-label":T,description:be="This is a canvas for drawing using a mouse or touch input.",...c$3},Fe)=>{let U=b(),De=h.useRef(null),[u,S]=h.useState(N||H||[]),z=h.useMemo(()=>({...Xe,...c$3}),[c$3]),[p,V]=h.useState(),I=c(),{labelProps:Ee,fieldProps:Re}=a({...c$3,"aria-label":T===void 0&&!c$3.label&&!c$3["aria-labelledby"]?"Drawing canvas":T,labelElementType:"span"}),{isFocusVisible:Me,focusProps:we}=a$1({within:true}),{hoverProps:Oe,isHovered:Le}=a$2({isDisabled:l}),{undo:x,redo:G,canRedo:K,canUndo:B,push:W}=a$3(u,{onAction:e=>{e&&(S(e),C?.(e));},isDisabled:!k}),{keyboardProps:He}=j({onKeyDown:e=>{e.key==="Backspace"?A():e.key==="z"&&(e.metaKey||e.ctrlKey)&&(e.shiftKey?K&&G():B&&x());}}),[Ne,_]=useState(false),Te=useCallback(e=>{let f=e.currentTarget.getBoundingClientRect();V(f),e.target.setPointerCapture(e.pointerId);let y=[e.clientX-f.x,e.clientY-f.y,e.pressure];S(s=>[...s,[y]]),_(true);},[]),Ue=useCallback(e=>{if(e.buttons!==1||!p)return;let y=he(e.nativeEvent).map(s=>[i?a$4(s.clientX-p.left,0,p.width):s.clientX-p.left,i?a$4(s.clientY-p.top,0,p.height):s.clientY-p.top,s.pressure]);S(s=>{let M=[...s];return M[s.length-1]=[...M[s.length-1],...y],M});},[p,i]),ze=()=>{p&&(C?.(u),W(u),_(false),V(void 0));};useGranularEffect(()=>{P?.(u);},[u],[P]);let A=()=>{S([]),W([]);};return jsxs("div",{ref:b$4(De,Fe),className:a$7(b$3,"BaselineUI-FreehandCanvas",t),style:o,"aria-disabled":l,"data-block-id":ye,"data-block-class":Se,children:[c$3.label||k?jsxs("div",{className:d({isInline:v}),children:[c$3.label?jsx(a$5,{type:"label",size:"sm",...Ee,children:c$3.label}):jsx("span",{}),k?jsxs("div",{children:[jsx(a$6,{variant:"secondary",size:"sm",isDisabled:!B||l,icon:UndoIcon,onPress:x,"aria-label":ve||U.formatMessage(ce.undo)}),jsx(a$6,{variant:"secondary",size:"sm",isDisabled:!K||l,icon:RedoIcon,onPress:G,"aria-label":ge||U.formatMessage(ce.redo)})]}):null]}):null,jsxs("div",{role:"application",...c$1(we,He,Oe,Re),tabIndex:l?void 0:0,className:a$7(a$8({isInline:v,isHovered:Le}),a$9({isFocusVisible:Me,isInline:v,isDisabled:!!l}),r),"aria-describedby":[I,c$3["aria-describedby"]].filter(Boolean).join(" "),style:m,ref:Ce,children:[jsx(b$1,{children:jsx("div",{id:I,children:be})}),jsx("svg",{width:m?.width||"100%",height:m?.height||"100%",onPointerDown:Te,onPointerMove:Ue,onPointerUp:ze,children:(N||u).map((e,f,y)=>f<y.length-1||!Ne?jsx(fe,{line:e,options:z,strokeColor:a$a,strokeWidth:d$1},f):jsx(ue,{line:e,options:z,strokeColor:a$a,strokeWidth:d$1},f))})]}),E||R?jsx("div",{style:ke,className:a$7(c$2({isInline:v,isDisabled:l}),Pe),children:(u.length||!E)&&R?jsx(b$2,{size:"sm",variant:"ghost",label:R,isDisabled:l,onPress:A}):jsx(b$2,{size:"sm",variant:"ghost",label:E,isDisabled:true})}):null]})});pe.displayName="FreehandCanvas";var fe=h.memo(({line:t,options:o,strokeColor:r,strokeWidth:m})=>{let i=useMemo(()=>a$a(getStroke(t.map(([d,a,P])=>({x:d,y:a,pressure:P})),o)),[t,o]);return jsx("path",{d:i,stroke:r,strokeWidth:m})});fe.displayName="Stroke";var ue=h.memo(({line:t,options:o,strokeColor:r,strokeWidth:m})=>{let i=le({line:t,options:o});return jsx(Fragment,{children:i.map((d,a)=>jsx("path",{d,stroke:r,strokeWidth:m},a))})});ue.displayName="SplitStroke";function he(t){if(typeof t.getCoalescedEvents=="function"){let o=t.getCoalescedEvents();return o.length>0?o.flatMap(r=>he(r)):[t]}return [t]}var ce=c$3({undo:{defaultMessage:"Undo",id:"bui.freehandCanvas.undo"},redo:{defaultMessage:"Redo",id:"bui.freehandCanvas.redo"}});export{pe as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-OVJT5F2R.mjs';import {e}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-OVJT5F2R.mjs';import {e}from'./chunk-3IPRT57V.mjs';import {c}from'./chunk-6DYTFYPO.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import {jsx}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$4}from'./chunk-G77E7EDE.mjs';import {a as a$6}from'./chunk-LSPDPDB6.mjs';import {d}from'./chunk-QMV2O57M.mjs';import {a as a$1}from'./chunk-NGZRN4SF.mjs';import {c,b}from'./chunk-IDIZSV2Y.mjs';import {b as b$1}from'./chunk-KG2EHFYA.mjs';import {b as b$2}from'./chunk-K5RYVERS.mjs';import {a as a$5}from'./chunk-FPM5UJRF.mjs';import {a as a$9}from'./chunk-STMDFIUL.mjs';import {a as a$8}from'./chunk-B3EZOXNU.mjs';import {a as a$2}from'./chunk-RT4LMB6X.mjs';import {c as c$1}from'./chunk-3WKDIXCM.mjs';import {a as a$7}from'./chunk-SVIYLH7R.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import fe,{useMemo,useCallback,useEffect,useRef}from'react';import {CheckmarkIcon}from'@baseline-ui/icons/12';import {CheckmarkIcon as CheckmarkIcon$1}from'@baseline-ui/icons/16';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var Y={"ar-AE":{steplist:"\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u062E\u0637\u0648\u0627\u062A"},"bg-BG":{steplist:"\u0421\u043F\u0438\u0441\u044A\u043A \u0441\u044A\u0441 \u0441\u0442\u044A\u043F\u043A\u0438"},"cs-CZ":{steplist:"Seznam krok\u016F"},"da-DK":{steplist:"Trinliste"},"de-DE":{steplist:"Schrittliste"},"el-GR":{steplist:"\u039B\u03AF\u03C3\u03C4\u03B1 \u03B2\u03B7\u03BC\u03AC\u03C4\u03C9\u03BD"},"en-US":{steplist:"Step List"},"es-ES":{steplist:"Lista de pasos"},"et-EE":{steplist:"Sammude loend"},"fi-FI":{steplist:"Vaiheluettelo"},"fr-FR":{steplist:"Liste des \xE9tapes"},"he-IL":{steplist:"\u05E8\u05E9\u05D9\u05DE\u05EA \u05E6\u05E2\u05D3\u05D9\u05DD"},"hr-HR":{steplist:"Lista koraka"},"hu-HU":{steplist:"L\xE9p\xE9sek list\xE1ja"},"it-IT":{steplist:"Elenco dei passaggi"},"ja-JP":{steplist:"\u624B\u9806\u30EA\u30B9\u30C8"},"ko-KR":{steplist:"\uB2E8\uACC4 \uBAA9\uB85D"},"lt-LT":{steplist:"\u017Dingsni\u0173 s\u0105ra\u0161as"},"lv-LV":{steplist:"Darb\u012Bbu saraksts"},"nb-NO":{steplist:"Trinnliste"},"nl-NL":{steplist:"Stappenlijst"},"pl-PL":{steplist:"Lista krok\xF3w"},"pt-BR":{steplist:"Lista de etapas"},"pt-PT":{steplist:"Lista de passos"},"ro-RO":{steplist:"Lista de pa\u0219i"},"ru-RU":{steplist:"\u0421\u043F\u0438\u0441\u043E\u043A \u0448\u0430\u0433\u043E\u0432"},"sk-SK":{steplist:"Zoznam krokov"},"sl-SI":{steplist:"Seznam korakov"},"sr-SP":{steplist:"Lista koraka"},"sv-SE":{steplist:"Steglista"},"tr-TR":{steplist:"Ad\u0131m Listesi"},"uk-UA":{steplist:"\u0421\u043F\u0438\u0441\u043E\u043A \u043A\u0440\u043E\u043A\u0456\u0432"},"zh-CN":{steplist:"\u6B65\u9AA4\u5217\u8868"},"zh-TW":{steplist:"\u6B65\u9A5F\u6E05\u55AE"}};function D(p,t,a){let{"aria-label":s}=p,{listProps:i}=a$6({...p,...t,allowsTabNavigation:true,ref:a}),r=b$1(Y,"@react-aria/steplist");return {listProps:{...{...c$1(i,a$7(p,{labelable:true})),"aria-label":s||r.format("steplist")},tabIndex:void 0}}}function N(p){let t=a$4({...p,onSelectionChange:p.onSelectionChange?e=>{e!=null&&p.onSelectionChange?.(e);}:void 0}),[a,s]=a$5(p.lastCompletedStep,p.defaultLastCompletedStep??null,p.onLastCompletedStepChange),{setSelectedKey:i,selectedKey:r,collection:l}=t,{indexMap:n,keysLinkedList:_}=useMemo(()=>me(l),[l]),z=r!=null?n.get(r):0,c=useCallback(e=>e===void 0?false:e!==null&&a!==null&&n.has(e)&&n.has(a)&&n.get(e)<=n.get(a),[n,a]),g=useCallback((e,d)=>{let y=null;if(e&&e.size>0)for(y=e.getFirstKey();y!==e.getLastKey()&&y&&(d.has(y)||c(y));)y=e.getKeyAfter(y);return y},[c]);useEffect(()=>{let e=t.selectedKey;(t.selectionManager.isEmpty||e==null||!t.collection.getItem(e))&&(e=g(t.collection,t.disabledKeys),e!==null&&t.selectionManager.replaceSelection(e)),t.selectionManager.focusedKey==null&&t.selectionManager.setFocusedKey(e);let d=(a!==null?n.get(a):-1)??-1;z!==void 0&&z>0&&z>d+1&&e!==null&&_.has(e)&&s(_.get(e));});function m(e){if(p.isDisabled||t.disabledKeys.has(e)||p.isReadOnly)return false;if(c(e))return true;let d=_.get(e);return c(d)||e===t.collection.getFirstKey()}function h(e){let d=_.get(e);d&&!c(d)&&s(d),i(e);}return {...t,setSelectedKey:h,setLastCompletedStep:s,isCompleted:c,isSelectable:m}}function me(p){let t=new Map,a=new Map,s=0,i;for(let r of p)t.set(r.key,s),a.set(r.key,i?.key),i=r,s++;return {indexMap:t,keysLinkedList:a}}var ee=a({defaultClassName:"_41r3q2q _1yep5z6kb _1yep5z6kc _1yep5z6kd",variantClassNames:{variant:{condensed:"_41r3q2r _1yep5z618j",expanded:"_41r3q2s _1yep5z6us _1yep5z6ut _1yep5z6uu _1yep5z6sg _1yep5z6sh _1yep5z6si _1yep5z6173 _1yep5z6174 _1yep5z6175"},status:{complete:"_1yep5z6136",active:"_41r3q2u",incomplete:"_41r3q2v"},isDisabled:{true:"_41r3q2w"}},defaultVariants:{},compoundVariants:[[{status:"complete",isDisabled:true},"_1yep5z61pt"]]}),te=a({defaultClassName:"_1yep5z6ez",variantClassNames:{size:{sm:"_1yep5z610e",md:"_1yep5z610h"},isDisabled:{true:"_1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),se=a({defaultClassName:"_41r3q28 _1yep5z6b0 _1yep5z6b1 _1yep5z6b2 _1yep5z6bo _1yep5z6bp _1yep5z6bq _1yep5z6cc _1yep5z6cd _1yep5z6ce _1yep5z6d0 _1yep5z6d1 _1yep5z6d2 _1yep5z6mf _1yep5z6mh _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z6m0",variantClassNames:{size:{sm:"_41r3q29 _1yep5z610e",md:"_41r3q2a _1yep5z610h"},status:{complete:"_41r3q2b _1yep5z6136 _1yep5z611n",active:"_1yep5z612s _1yep5z611h _1yep5z6142",incomplete:"_1yep5z612s _1yep5z611h _1yep5z613z"},isDisabled:{true:"_41r3q2e"},isFocusVisible:{true:"_41r3q2f"}},defaultVariants:{},compoundVariants:[[{status:"complete",isDisabled:true},"_41r3q2g _1yep5z61pt _1yep5z61o6"],[{status:"active",isDisabled:true},"_1yep5z61pb _1yep5z61o4 _1yep5z61qp"],[{status:"incomplete",isDisabled:true},"_1yep5z61pb _1yep5z61o4 _1yep5z61qp"]]}),pe=a({defaultClassName:"_41r3q23 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1",variantClassNames:{variant:{condensed:"_1yep5z618j _1yep5z6vy _1yep5z6vz _1yep5z6w0",expanded:"_41r3q25 _1yep5z6173 _1yep5z6174 _1yep5z6175"},isLast:{true:"_41r3q26"}},defaultVariants:{},compoundVariants:[]}),ae="_41r3q27 _1yep5z60 _1yep5z61 _1yep5z62 _1yep5z62c _1yep5z62d _1yep5z62e _1yep5z63i _1yep5z63j _1yep5z63k _1yep5z616 _1yep5z617 _1yep5z618 _1yep5z6al _1yep5z6am _1yep5z6an _1yep5z6b9 _1yep5z6ba _1yep5z6bb _1yep5z6bx _1yep5z6by _1yep5z6bz _1yep5z6cl _1yep5z6cm _1yep5z6cn _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69i _1yep5z69j _1yep5z69k _1yep5z6m5",ie=a({defaultClassName:"_41r3q20 _1yep5z613 _1yep5z614 _1yep5z615 _1yep5z63f _1yep5z63g _1yep5z63h _1yep5z64l _1yep5z64m _1yep5z64n _1yep5z629 _1yep5z62a _1yep5z62b _1yep5z65r _1yep5z65s _1yep5z65t _1yep5z683 _1yep5z684 _1yep5z685 _1yep5z699 _1yep5z69a _1yep5z69b _1yep5z66x _1yep5z66y _1yep5z66z _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj",variantClassNames:{variant:{condensed:"_1yep5z616i _1yep5z616j _1yep5z616k _1yep5z6vy _1yep5z6vz _1yep5z6w0",expanded:"_1yep5z616c _1yep5z616d _1yep5z616e _1yep5z618m _1yep5z618l _1yep5z6wy _1yep5z6wz _1yep5z6x0"}},defaultVariants:{},compoundVariants:[]}),re="_41r3q2h _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z6jw _1yep5z6jx _1yep5z6jy _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z6kk _1yep5z6kl _1yep5z6km _1yep5z69c _1yep5z69d _1yep5z69e",oe=a({defaultClassName:"_1yep5z6ey",variantClassNames:{size:{sm:"_1yep5z610h",md:"_1yep5z610k"},isDisabled:{true:"_1yep5z611l"}},defaultVariants:{},compoundVariants:[]});function A(p,t,a){let{key:s}=p,{selectionManager:i,selectedKey:r}=t,l=!t.isSelectable(s),{itemProps:n}=d({isDisabled:l,key:s,ref:a,selectionManager:i});return {stepProps:{...n,role:"link","aria-current":r===s?"step":void 0,"aria-disabled":l?true:void 0,tabIndex:l?void 0:0}}}function ne({state:p,item:t,size:a,variant:s,index:i,isLast:r,stepLabel:l,completedLabel:n,isDisabled:_}){let z=useRef(null),c=b(),{stepProps:g}=A({key:t.key},p,z),m=_||p.disabledKeys.has(t.key),{hoverProps:h,isHovered:e}=a$8({isDisabled:m}),{focusProps:d,isFocused:y,isFocusVisible:v}=a$9(),k=p.isCompleted(t.key),q=p.selectedKey===t.key,b$1=k?"complete":q?"active":"incomplete",S=t["aria-label"],C=!!S&&!t.description,j=s==="expanded"&&!!t.title&&!C,P=s==="expanded"&&!!t.description,o=t.title||((typeof l=="function"?l({index:i+1}):l)??c.formatMessage(le.step,{index:i+1})),x=n??c.formatMessage(le.completed),M=a==="sm"?CheckmarkIcon:CheckmarkIcon$1;return jsxs("li",{className:a$3("BaselineUI-Stepper-Item",pe({variant:s,isLast:r})),"data-status":b$1,children:[jsxs("a",{...c$1(g,h,d),ref:z,"aria-label":k&&S?[x,S].join(" "):S||void 0,className:a$3("BaselineUI-Stepper-StepLink",ae),"data-status":b$1,"data-hovered":e||void 0,"data-focused":y||void 0,"data-focus-visible":v||void 0,"data-disabled":m||void 0,children:[jsx("span",{className:a$3("BaselineUI-Stepper-Indicator",se({size:a,status:b$1,isDisabled:m,isFocusVisible:v})),"aria-hidden":"true",children:k?jsx(M,{}):jsx("span",{children:i+1})}),k?jsx(b$2,{children:x}):null,j?jsxs("span",{className:a$3("BaselineUI-Stepper-Text",re),children:[jsx("span",{className:a$3("BaselineUI-Stepper-Title",oe({size:a,isDisabled:m})),children:t.title}),P?jsx("span",{className:a$3("BaselineUI-Stepper-Description",te({size:a,isDisabled:m})),children:t.description}):null]}):S?null:jsx(b$2,{children:o})]}),!r&&jsx("span",{className:a$3("BaselineUI-Stepper-Connector",ee({variant:s,status:b$1,isDisabled:m})),"aria-hidden":"true"})]})}var le=c({step:{defaultMessage:"Step {index}",id:"bui.stepper.step"},completed:{defaultMessage:"Completed",id:"bui.stepper.completed"}});var de=fe.forwardRef(function(t,a){let{items:s,variant:i="expanded",size:r="md",selectedStep:l,defaultSelectedStep:n,onSelectionChange:_,lastCompletedStep:z,defaultLastCompletedStep:c,onLastCompletedStepChange:g,isDisabled:m,className:h,style:e,"aria-label":d,stepLabel:y,completedLabel:v}=t,k=b(),q=useMemo(()=>new Set(s.filter(o=>o.isDisabled).map(o=>o.key)),[s]),b$1=useMemo(()=>s.map(o=>jsx(a$1,{textValue:o.title??String(o.key),children:o.title??""},o.key)),[s]),S=useMemo(()=>new Map(s.map(o=>[o.key,o])),[s]),C=N({children:b$1,selectedKey:l,defaultSelectedKey:n,onSelectionChange:_,lastCompletedStep:z,defaultLastCompletedStep:c,onLastCompletedStepChange:g,disabledKeys:q,isDisabled:m}),j=a$2(a),{listProps:P}=D({children:b$1,"aria-label":d||k.formatMessage(be.label)},C,j);return jsx("ol",{...P,ref:j,className:a$3("BaselineUI-Stepper",ie({variant:i}),h),style:e,"data-variant":i,"data-size":r,children:[...C.collection].map((o,x,M)=>{let E=S.get(o.key);return E?jsx(ne,{state:C,item:E,size:r,variant:i,index:x,isLast:x===M.length-1,stepLabel:y,completedLabel:v,isDisabled:m},o.key):null})})});de.displayName="Stepper";var be=c({label:{defaultMessage:"Progress",id:"bui.stepper.label"}});export{de as a};
|