diff --git a/build/_locales/ca/messages.json b/build/_locales/ca/messages.json index 173a880..fad58cf 100644 --- a/build/_locales/ca/messages.json +++ b/build/_locales/ca/messages.json @@ -95,9 +95,10 @@ "message": "Mostra més opcions", "description": "Etiqueta de 'Mostra més opcions' en el pop-up" }, + "systemAudioLabel": { - "message": "Inclou l'àudio de la pestanya", - "description": "Etiqueta de l'àudio de la pestanya/sistema" + "message": "Inclou l'àudio del sistema", + "description": "Etiqueta de l'àudio del sistema/pestanya" }, "hideToolbarLabel": { "message": "Amaga la barra d'eines", @@ -787,5 +788,29 @@ "restoreRecording": { "message": "Restaurar l'última gravació", "description": "Botó per restaurar l'última gravació al quadre emergent" + }, + "havingIssuesButton": { + "message": "Tens problemes?", + "description": "Botó de problemes a l'editor" + }, + "havingIssuesModalTitle": { + "message": "No pots veure la teva gravació?", + "description": "Títol del modal de problemes a l'editor" + }, + "havingIssuesModalDescription": { + "message": "Si has completat la teva gravació i et trobes en aquesta pàgina sense veure el teu vídeo, pots intentar descarregar les dades de vídeo en brut si estan disponibles. També pots posar-te en contacte i enviar un informe d'error.", + "description": "Descripció del modal de problemes a l'editor" + }, + "havingIssuesModalButton": { + "message": "Descarregar dades de vídeo en brut", + "description": "Botó del modal de problemes a l'editor" + }, + "havingIssuesModalButton2": { + "message": "Informar d'un error", + "description": "Segon botó del modal de problemes a l'editor" + }, + "noRecordingFound": { + "message": "No s'ha trobat cap gravació, ho sento :(", + "description": "Alerta de no s'ha trobat cap gravació a l'editor" } } diff --git a/build/_locales/de/messages.json b/build/_locales/de/messages.json index 7d80381..cce5645 100644 --- a/build/_locales/de/messages.json +++ b/build/_locales/de/messages.json @@ -96,8 +96,8 @@ "description": "Label für die Schaltfläche 'Weitere Optionen anzeigen'" }, "systemAudioLabel": { - "message": "Tab/Audiosystem einschließen", - "description": "Label für die Schaltfläche 'Tab/Audiosystem einschließen'" + "message": "Systemaudio einschließen", + "description": "Tab/Systemaudio-Beschriftung" }, "hideToolbarLabel": { "message": "Symbolleiste ausblenden", @@ -786,5 +786,29 @@ "restoreRecording": { "message": "Letzte Aufnahme wiederherstellen", "description": "Schaltfläche zum Wiederherstellen der letzten Aufnahme im Popup-Fenster" + }, + "havingIssuesButton": { + "message": "Haben Sie Probleme?", + "description": "Schaltfläche 'Probleme' im Editor" + }, + "havingIssuesModalTitle": { + "message": "Können Sie Ihre Aufnahme nicht sehen?", + "description": "Titel des Modalfensters 'Probleme' im Editor" + }, + "havingIssuesModalDescription": { + "message": "Wenn Sie Ihre Aufnahme abgeschlossen haben und sich auf dieser Seite befinden, ohne Ihr Video zu sehen, können Sie versuchen, die Rohvideodaten herunterzuladen, sofern verfügbar. Sie können auch Kontakt aufnehmen und einen Fehlerbericht senden.", + "description": "Beschreibung des Modalfensters 'Probleme' im Editor" + }, + "havingIssuesModalButton": { + "message": "Rohvideodaten herunterladen", + "description": "Schaltfläche im Modalfenster 'Probleme' im Editor" + }, + "havingIssuesModalButton2": { + "message": "Fehler melden", + "description": "Zweite Schaltfläche im Modalfenster 'Probleme' im Editor" + }, + "noRecordingFound": { + "message": "Keine Aufzeichnung gefunden, tut uns leid :(", + "description": "Meldung 'Keine Aufzeichnung gefunden' im Editor" } } diff --git a/build/_locales/en/messages.json b/build/_locales/en/messages.json index a357725..227e818 100644 --- a/build/_locales/en/messages.json +++ b/build/_locales/en/messages.json @@ -96,7 +96,7 @@ "description": "Show more options label" }, "systemAudioLabel": { - "message": "Include tab audio", + "message": "Include system audio", "description": "Tab/system audio label" }, "hideToolbarLabel": { @@ -786,5 +786,29 @@ "restoreRecording": { "message": "Restore last recording", "description": "Restore last recording button in popup" + }, + "havingIssuesButton": { + "message": "Having issues?", + "description": "Having issues button in editor" + }, + "havingIssuesModalTitle": { + "message": "Can't see your recording?", + "description": "Having issues modal title in editor" + }, + "havingIssuesModalDescription": { + "message": "If you've completed your recording and find yourself on this page without seeing your video, you can attempt to download the raw video data if it's available. You can also reach out and submit a bug report.", + "description": "Having issues modal description in editor" + }, + "havingIssuesModalButton": { + "message": "Download raw video data", + "description": "Having issues modal button in editor" + }, + "havingIssuesModalButton2": { + "message": "Report bug", + "description": "Having issues modal button 2 in editor" + }, + "noRecordingFound": { + "message": "No recording found, sorry :(", + "description": "No recording found alert in editor" } } diff --git a/build/_locales/es/messages.json b/build/_locales/es/messages.json index 675382a..eec74cb 100644 --- a/build/_locales/es/messages.json +++ b/build/_locales/es/messages.json @@ -95,9 +95,10 @@ "message": "Mostrar más opciones", "description": "Etiqueta de mostrar más opciones" }, + "systemAudioLabel": { - "message": "Incluir el audio de la pestaña", - "description": "Etiqueta de audio del sistema/pestaña" + "message": "Incluir audio del sistema", + "description": "Etiqueta de audio del sistema/tabulador" }, "hideToolbarLabel": { "message": "Ocultar barra de herramientas", @@ -787,5 +788,29 @@ "restoreRecording": { "message": "Restablecer última grabación", "description": "Botón para restaurar la última grabación en el popup" + }, + "havingIssuesButton": { + "message": "¿Tienes problemas?", + "description": "Botón de problemas en el editor" + }, + "havingIssuesModalTitle": { + "message": "¿No puedes ver tu grabación?", + "description": "Título del modal de problemas en el editor" + }, + "havingIssuesModalDescription": { + "message": "Si has completado tu grabación y te encuentras en esta página sin ver tu video, puedes intentar descargar los datos de video sin procesar si están disponibles. También puedes ponerte en contacto y enviar un informe de error.", + "description": "Descripción del modal de problemas en el editor" + }, + "havingIssuesModalButton": { + "message": "Descargar datos de video sin procesar", + "description": "Botón del modal de problemas en el editor" + }, + "havingIssuesModalButton2": { + "message": "Informar un error", + "description": "Segundo botón del modal de problemas en el editor" + }, + "noRecordingFound": { + "message": "No se encontró ninguna grabación, lo siento :(", + "description": "Alerta de no se encontró ninguna grabación en el editor" } } diff --git a/build/_locales/fr/messages.json b/build/_locales/fr/messages.json index cb724a2..2fea0da 100644 --- a/build/_locales/fr/messages.json +++ b/build/_locales/fr/messages.json @@ -95,8 +95,9 @@ "message": "Afficher plus d'options", "description": "Étiquette Afficher plus d'options" }, + "systemAudioLabel": { - "message": "Inclure l'audio de l'onglet", + "message": "Inclure l'audio système", "description": "Étiquette de l'audio système/onglet" }, "hideToolbarLabel": { @@ -786,5 +787,29 @@ "restoreRecording": { "message": "Restaurer l'enregistrement précédent", "description": "Bouton pour restaurer l'enregistrement précédent dans la fenêtre contextuelle" + }, + "havingIssuesButton": { + "message": "Vous rencontrez des problèmes ?", + "description": "Bouton de signalement de problèmes dans l'éditeur" + }, + "havingIssuesModalTitle": { + "message": "Vous ne pouvez pas voir votre enregistrement ?", + "description": "Titre de la fenêtre modale de signalement de problèmes dans l'éditeur" + }, + "havingIssuesModalDescription": { + "message": "Si vous avez terminé votre enregistrement et que vous vous trouvez sur cette page sans voir votre vidéo, vous pouvez essayer de télécharger les données brutes de la vidéo si elles sont disponibles. Vous pouvez également nous contacter et soumettre un rapport de bug.", + "description": "Description de la fenêtre modale de signalement de problèmes dans l'éditeur" + }, + "havingIssuesModalButton": { + "message": "Télécharger les données brutes de la vidéo", + "description": "Bouton de téléchargement dans la fenêtre modale de signalement de problèmes dans l'éditeur" + }, + "havingIssuesModalButton2": { + "message": "Signaler un bug", + "description": "Deuxième bouton dans la fenêtre modale de signalement de problèmes dans l'éditeur" + }, + "noRecordingFound": { + "message": "Aucun enregistrement trouvé, désolé :(", + "description": "Message d'alerte en cas d'absence d'enregistrement dans l'éditeur" } } diff --git a/build/_locales/hi/messages.json b/build/_locales/hi/messages.json index 3a7a185..b7a57a4 100644 --- a/build/_locales/hi/messages.json +++ b/build/_locales/hi/messages.json @@ -95,8 +95,9 @@ "message": "अधिक विकल्प दिखाएं", "description": "अधिक विकल्प लेबल" }, + "systemAudioLabel": { - "message": "टैब/सिस्टम ऑडियो शामिल करें", + "message": "सिस्टम ऑडियो शामिल करें", "description": "टैब/सिस्टम ऑडियो लेबल" }, "hideToolbarLabel": { @@ -786,5 +787,29 @@ "restoreRecording": { "message": "आखिरी रिकॉर्डिंग को पुनर्स्थापित करें", "description": "पॉपअप में आखिरी रिकॉर्डिंग को पुनर्स्थापित करने के लिए बटन" + }, + "havingIssuesButton": { + "message": "कोई समस्या है?", + "description": "संपादक में समस्या बटन" + }, + "havingIssuesModalTitle": { + "message": "अपनी रिकॉर्डिंग देख नहीं सकते?", + "description": "संपादक में समस्या मॉडल टाइटल" + }, + "havingIssuesModalDescription": { + "message": "अगर आपने अपनी रिकॉर्डिंग पूरी की है और इस पृष्ठ पर अपने वीडियो को देखते बिना पाए हैं, तो यदि यह उपलब्ध है, आप वीडियो के रॉ डेटा को डाउनलोड करने का प्रयास कर सकते हैं। आप भी हमसे संपर्क कर सकते हैं और एक बग रिपोर्ट सबमिट कर सकते हैं।", + "description": "संपादक में समस्या मॉडल विवरण" + }, + "havingIssuesModalButton": { + "message": "रॉ वीडियो डेटा डाउनलोड करें", + "description": "संपादक में समस्या मॉडल बटन" + }, + "havingIssuesModalButton2": { + "message": "बग रिपोर्ट करें", + "description": "संपादक में समस्या मॉडल बटन 2" + }, + "noRecordingFound": { + "message": "कोई रिकॉर्डिंग नहीं मिली, दुखी हैं :(", + "description": "संपादक में कोई रिकॉर्डिंग नहीं मिली अलर्ट" } } diff --git a/build/_locales/id/messages.json b/build/_locales/id/messages.json index c799011..d58528e 100644 --- a/build/_locales/id/messages.json +++ b/build/_locales/id/messages.json @@ -95,9 +95,10 @@ "message": "Tampilkan opsi lebih lanjut", "description": "Label tampilkan opsi lebih lanjut" }, + "systemAudioLabel": { - "message": "Sertakan audio tab", - "description": "Label tab/audio sistem" + "message": "Sertakan audio sistem", + "description": "Label audio sistem/tab" }, "hideToolbarLabel": { "message": "Sembunyikan toolbar", @@ -786,5 +787,29 @@ "restoreRecording": { "message": "Kembalikan Rekaman Terakhir", "description": "Tombol untuk mengembalikan rekaman terakhir di popup" + }, + "havingIssuesButton": { + "message": "Mengalami masalah?", + "description": "Tombol masalah di editor" + }, + "havingIssuesModalTitle": { + "message": "Tidak dapat melihat rekaman Anda?", + "description": "Judul modal masalah di editor" + }, + "havingIssuesModalDescription": { + "message": "Jika Anda telah menyelesaikan rekaman Anda dan mendapati diri Anda berada di halaman ini tanpa melihat video Anda, Anda dapat mencoba mengunduh data video mentah jika tersedia. Anda juga dapat menghubungi kami dan mengirimkan laporan bug.", + "description": "Deskripsi modal masalah di editor" + }, + "havingIssuesModalButton": { + "message": "Unduh data video mentah", + "description": "Tombol modal masalah di editor" + }, + "havingIssuesModalButton2": { + "message": "Laporkan bug", + "description": "Tombol kedua dalam modal masalah di editor" + }, + "noRecordingFound": { + "message": "Tidak ada rekaman yang ditemukan, maaf :(", + "description": "Peringatan tidak ada rekaman ditemukan di editor" } } diff --git a/build/_locales/it/messages.json b/build/_locales/it/messages.json index 8c089bb..d2810b8 100644 --- a/build/_locales/it/messages.json +++ b/build/_locales/it/messages.json @@ -95,9 +95,10 @@ "message": "Mostra più opzioni", "description": "Etichetta per mostrare più opzioni" }, + "systemAudioLabel": { - "message": "Includi l'audio del sistema/scheda", - "description": "Etichetta dell'audio di sistema/scheda" + "message": "Includi l'audio di sistema", + "description": "Etichetta audio di sistema/etichetta tab" }, "hideToolbarLabel": { "message": "Nascondi la barra degli strumenti", @@ -787,5 +788,29 @@ "restoreRecording": { "message": "Ripristina l'ultima registrazione", "description": "Pulsante per ripristinare l'ultima registrazione nella finestra popup" + }, + "havingIssuesButton": { + "message": "Riscontri problemi?", + "description": "Pulsante dei problemi nell'editor" + }, + "havingIssuesModalTitle": { + "message": "Non riesci a vedere la tua registrazione?", + "description": "Titolo del modal dei problemi nell'editor" + }, + "havingIssuesModalDescription": { + "message": "Se hai completato la tua registrazione e ti trovi su questa pagina senza vedere il tuo video, puoi tentare di scaricare i dati video grezzi se sono disponibili. Puoi anche metterti in contatto e inviare una segnalazione di errore.", + "description": "Descrizione del modal dei problemi nell'editor" + }, + "havingIssuesModalButton": { + "message": "Scarica dati video grezzi", + "description": "Pulsante nel modal dei problemi nell'editor" + }, + "havingIssuesModalButton2": { + "message": "Segnala un errore", + "description": "Secondo pulsante nel modal dei problemi nell'editor" + }, + "noRecordingFound": { + "message": "Nessuna registrazione trovata, mi dispiace :(", + "description": "Avviso di nessuna registrazione trovata nell'editor" } } diff --git a/build/_locales/ko/messages.json b/build/_locales/ko/messages.json index 8c03a0e..6752047 100644 --- a/build/_locales/ko/messages.json +++ b/build/_locales/ko/messages.json @@ -96,8 +96,8 @@ "description": "Show more options label" }, "systemAudioLabel": { - "message": "탭 오디오 포함", - "description": "Tab/system audio label" + "message": "시스템 오디오 포함", + "description": "탭/시스템 오디오 레이블" }, "hideToolbarLabel": { "message": "툴바 숨기기", @@ -786,5 +786,29 @@ "restoreRecording": { "message": "최근 녹음 복원", "description": "팝업에서 최근 녹음 복원 버튼" + }, + "havingIssuesButton": { + "message": "문제가 있나요?", + "description": "에디터 내 문제 버튼" + }, + "havingIssuesModalTitle": { + "message": "녹화물이 보이지 않나요?", + "description": "에디터 내 문제 모달 제목" + }, + "havingIssuesModalDescription": { + "message": "녹화를 완료하고 비디오를 보지 못한 채 이 페이지에 남아 있다면, 사용 가능한 경우 원시 비디오 데이터를 다운로드하거나 버그 보고서를 제출할 수 있습니다.", + "description": "에디터 내 문제 모달 설명" + }, + "havingIssuesModalButton": { + "message": "원시 비디오 데이터 다운로드", + "description": "에디터 내 문제 모달 버튼" + }, + "havingIssuesModalButton2": { + "message": "버그 신고", + "description": "에디터 내 문제 모달 두 번째 버튼" + }, + "noRecordingFound": { + "message": "녹화된 것을 찾을 수 없습니다, 죄송합니다 :(", + "description": "에디터 내 녹화된 것을 찾을 수 없음 경고" } } diff --git a/build/_locales/pl/messages.json b/build/_locales/pl/messages.json index 291de70..655e1d6 100644 --- a/build/_locales/pl/messages.json +++ b/build/_locales/pl/messages.json @@ -95,9 +95,10 @@ "message": "Pokaż więcej opcji", "description": "Etykieta przycisku Pokaż więcej opcji" }, + "systemAudioLabel": { - "message": "Uwzględnij dźwięk systemu", - "description": "Etykieta dźwięku systemowego/tablicy" + "message": "Uwzględnij dźwięk systemowy", + "description": "Etykieta dźwięku systemowego/karta" }, "hideToolbarLabel": { "message": "Ukryj pasek narzędzi", @@ -786,5 +787,29 @@ "restoreRecording": { "message": "Przywróć ostatnie nagranie", "description": "Przycisk przywracania ostatniego nagrania w okienku" + }, + "havingIssuesButton": { + "message": "Masz problemy?", + "description": "Przycisk problemów w edytorze" + }, + "havingIssuesModalTitle": { + "message": "Nie widzisz swojego nagrania?", + "description": "Tytuł okna modalnego problemów w edytorze" + }, + "havingIssuesModalDescription": { + "message": "Jeśli ukończyłeś nagrywanie i znajdujesz się na tej stronie, nie widząc swojego filmu, możesz spróbować pobrać surowe dane wideo, jeśli są dostępne. Możesz również skontaktować się z nami i zgłosić błąd.", + "description": "Opis okna modalnego problemów w edytorze" + }, + "havingIssuesModalButton": { + "message": "Pobierz surowe dane wideo", + "description": "Przycisk w oknie modalnym problemów w edytorze" + }, + "havingIssuesModalButton2": { + "message": "Zgłoś błąd", + "description": "Drugi przycisk w oknie modalnym problemów w edytorze" + }, + "noRecordingFound": { + "message": "Nie znaleziono nagrania, przepraszamy :(", + "description": "Komunikat o braku nagrania w edytorze" } } diff --git a/build/_locales/pt_BR/messages.json b/build/_locales/pt_BR/messages.json index 5fddd6c..54fb6c1 100644 --- a/build/_locales/pt_BR/messages.json +++ b/build/_locales/pt_BR/messages.json @@ -95,9 +95,10 @@ "message": "Mostrar mais opções", "description": "Etiqueta de mostrar mais opções" }, + "systemAudioLabel": { - "message": "Incluir áudio da página", - "description": "Etiqueta de áudio da página/sistema" + "message": "Incluir áudio do sistema", + "description": "Rótulo de áudio do sistema/guia" }, "hideToolbarLabel": { "message": "Ocultar barra de ferramentas", @@ -786,5 +787,29 @@ "restoreRecording": { "message": "Restaurar a última gravação", "description": "Botão para restaurar a última gravação no popup" + }, + "havingIssuesButton": { + "message": "Enfrentando problemas?", + "description": "Botão de problemas no editor" + }, + "havingIssuesModalTitle": { + "message": "Não consegue ver sua gravação?", + "description": "Título do modal de problemas no editor" + }, + "havingIssuesModalDescription": { + "message": "Se você concluiu sua gravação e está nesta página sem ver seu vídeo, você pode tentar baixar os dados brutos do vídeo, se estiverem disponíveis. Você também pode entrar em contato e enviar um relatório de erro.", + "description": "Descrição do modal de problemas no editor" + }, + "havingIssuesModalButton": { + "message": "Baixar dados brutos do vídeo", + "description": "Botão do modal de problemas no editor" + }, + "havingIssuesModalButton2": { + "message": "Reportar erro", + "description": "Segundo botão do modal de problemas no editor" + }, + "noRecordingFound": { + "message": "Nenhuma gravação encontrada, desculpe :(", + "description": "Alerta de nenhuma gravação encontrada no editor" } } diff --git a/build/_locales/pt_PT/messages.json b/build/_locales/pt_PT/messages.json index 7245ee8..e175164 100644 --- a/build/_locales/pt_PT/messages.json +++ b/build/_locales/pt_PT/messages.json @@ -95,9 +95,10 @@ "message": "Mostrar mais opções", "description": "Etiqueta de mostrar mais opções" }, + "systemAudioLabel": { - "message": "Incluir áudio da página", - "description": "Etiqueta de áudio da página/sistema" + "message": "Incluir áudio do sistema", + "description": "Etiqueta de áudio do sistema/guia" }, "hideToolbarLabel": { "message": "Ocultar barra de ferramentas", @@ -787,5 +788,29 @@ "restoreRecording": { "message": "Restaurar a última gravação", "description": "Botão para restaurar a última gravação no popup" + }, + "havingIssuesButton": { + "message": "A ter problemas?", + "description": "Botão de problemas no editor" + }, + "havingIssuesModalTitle": { + "message": "Não consegue ver a sua gravação?", + "description": "Título do modal de problemas no editor" + }, + "havingIssuesModalDescription": { + "message": "Se completou a sua gravação e se encontra nesta página sem conseguir ver o seu vídeo, pode tentar descarregar os dados brutos do vídeo, se estiverem disponíveis. Também pode entrar em contacto e enviar um relatório de erro.", + "description": "Descrição do modal de problemas no editor" + }, + "havingIssuesModalButton": { + "message": "Descarregar dados brutos do vídeo", + "description": "Botão do modal de problemas no editor" + }, + "havingIssuesModalButton2": { + "message": "Reportar erro", + "description": "Segundo botão do modal de problemas no editor" + }, + "noRecordingFound": { + "message": "Não foi encontrada nenhuma gravação, lamento :(", + "description": "Alerta de não foi encontrada nenhuma gravação no editor" } } diff --git a/build/_locales/ru/messages.json b/build/_locales/ru/messages.json index e2cc9fc..af879ff 100644 --- a/build/_locales/ru/messages.json +++ b/build/_locales/ru/messages.json @@ -95,9 +95,10 @@ "message": "Показать больше опций", "description": "Метка для показа больше опций" }, + "systemAudioLabel": { - "message": "Включить аудио вкладки", - "description": "Метка для аудио вкладки/системного аудио" + "message": "Включить системный звук", + "description": "Метка системного звука/вкладка" }, "hideToolbarLabel": { "message": "Скрыть панель инструментов", @@ -786,5 +787,29 @@ "restoreRecording": { "message": "Восстановить последнюю запись", "description": "Кнопка восстановления последней записи во всплывающем окне" + }, + "havingIssuesButton": { + "message": "Возникли проблемы?", + "description": "Кнопка проблем в редакторе" + }, + "havingIssuesModalTitle": { + "message": "Не видите свою запись?", + "description": "Заголовок модального окна проблем в редакторе" + }, + "havingIssuesModalDescription": { + "message": "Если вы завершили запись и оказались на этой странице, не видя свое видео, вы можете попробовать скачать необработанные видеоданные, если они доступны. Вы также можете связаться с нами и отправить отчет об ошибке.", + "description": "Описание модального окна проблем в редакторе" + }, + "havingIssuesModalButton": { + "message": "Скачать необработанные видеоданные", + "description": "Кнопка в модальном окне проблем в редакторе" + }, + "havingIssuesModalButton2": { + "message": "Сообщить о проблеме", + "description": "Вторая кнопка в модальном окне проблем в редакторе" + }, + "noRecordingFound": { + "message": "Запись не найдена, извините :(", + "description": "Предупреждение о отсутствии записи в редакторе" } } diff --git a/build/_locales/ta/messages.json b/build/_locales/ta/messages.json index 3718f01..e8e4295 100644 --- a/build/_locales/ta/messages.json +++ b/build/_locales/ta/messages.json @@ -96,8 +96,8 @@ "description": "மேலும் விருப்பங்கள் செய்தி" }, "systemAudioLabel": { - "message": "தளம் / அமைப்பு ஒலி சேர்க்க", - "description": "தள / அமைப்பு ஒலி செய்தி" + "message": "அமைப்பு ஒலியை சேர்க்கவும்", + "description": "அமைப்பு ஒலி குறியீடு/அறை" }, "hideToolbarLabel": { "message": "கட்டுப்பாடு மறை", @@ -786,5 +786,29 @@ "restoreRecording": { "message": "கடைசி பதிவு மீட்டமை", "description": "பாப் பப் வரிசையில் கடைசி பதிவு மீட்டமை பட்டன்" + }, + "havingIssuesButton": { + "message": "பிரச்சினைகள் உள்ளனவா?", + "description": "எடிட்டரில் பிரச்சினைகள் பொத்தான்" + }, + "havingIssuesModalTitle": { + "message": "உங்கள் ரெக்கார்டிங் காணாதுவா?", + "description": "எடிட்டரில் பிரச்சினை படிக்கு தலைப்பு" + }, + "havingIssuesModalDescription": { + "message": "உங்கள் ரெக்கார்டிங் முடிந்துவிட்டது மற்றும் உங்கள் வீடியோவை காணாத அவகாச வீடியோ தரவை பெற்ற பிறகு, அது கிடைக்கின்றால் உங்கள் அசையப்பட்ட வீடியோ தரவை பதிவிறக்க முயற்சிக்கலாம். அந்த தரவு கிடைக்கின்றதில், பிழை அறிக்கை அனுப்பி அழைக்கலாம்.", + "description": "எடிட்டரில் பிரச்சினை படிவம்" + }, + "havingIssuesModalButton": { + "message": "அவகாச வீடியோ தரவை பதிவிறக்குங்கள்", + "description": "எடிட்டரில் பிரச்சினை படிக்கு பொத்தான்" + }, + "havingIssuesModalButton2": { + "message": "பிழை அறிக்கை செய்க", + "description": "எடிட்டரில் பிரச்சினை படிக்கு இரண்டாவது பொத்தான்" + }, + "noRecordingFound": { + "message": "ஒரு பதிவுக்கு காணப்பட்டதில்லை, மன்னிக்கவும் :(", + "description": "எடிட்டரில் ஒரு பதிவுக்கு காணப்பட்டதில்லை எச்சரிக்கை" } } diff --git a/build/_locales/tr/messages.json b/build/_locales/tr/messages.json index 1af0fd6..21e5908 100644 --- a/build/_locales/tr/messages.json +++ b/build/_locales/tr/messages.json @@ -96,8 +96,8 @@ "description": "Daha fazla seçenekler etiketi" }, "systemAudioLabel": { - "message": "Sesleri dahil et", - "description": "Sistem/ses sekmesi etiketi" + "message": "Sistem sesini dahil et", + "description": "Sistem sesi etiketi/sekmeleri" }, "hideToolbarLabel": { "message": "Araç çubuğunu gizle", @@ -786,5 +786,29 @@ "restoreRecording": { "message": "Son kaydı geri yükle", "description": "Açılır penceredeki son kaydı geri yükle düğmesi" + }, + "havingIssuesButton": { + "message": "Sorun mu yaşıyorsunuz?", + "description": "Editörde sorunlar düğmesi" + }, + "havingIssuesModalTitle": { + "message": "Kaydınızı göremiyor musunuz?", + "description": "Editörde sorunlar modal başlığı" + }, + "havingIssuesModalDescription": { + "message": "Kaydınızı tamamladınız ve videonuzu görmeyen bir sayfadaysanız, mevcutsa ham video verilerini indirmeyi deneyebilirsiniz. Ayrıca bize ulaşabilir ve bir hata raporu gönderebilirsiniz.", + "description": "Editörde sorunlar modal açıklaması" + }, + "havingIssuesModalButton": { + "message": "Ham video verilerini indir", + "description": "Editörde sorunlar modal düğmesi" + }, + "havingIssuesModalButton2": { + "message": "Hata Bildir", + "description": "Editörde sorunlar modal düğme 2" + }, + "noRecordingFound": { + "message": "Kayıt bulunamadı, üzgünüz :(", + "description": "Editörde kayıt bulunamadı uyarısı" } } diff --git a/build/_locales/uk/messages.json b/build/_locales/uk/messages.json index 94f42ce..675204c 100644 --- a/build/_locales/uk/messages.json +++ b/build/_locales/uk/messages.json @@ -95,9 +95,10 @@ "message": "Показати більше опцій", "description": "Show more options label" }, + "systemAudioLabel": { - "message": "Включити звук вкладки", - "description": "Tab/system audio label" + "message": "Включити системний звук", + "description": "Мітка системного аудіо/вкладка" }, "hideToolbarLabel": { "message": "Приховати панель інструментів", @@ -786,5 +787,29 @@ "restoreRecording": { "message": "Відновити останнє запис", "description": "Кнопка відновлення останнього запису в спливаючому вікні" + }, + "havingIssuesButton": { + "message": "Виникли проблеми?", + "description": "Кнопка проблем в редакторі" + }, + "havingIssuesModalTitle": { + "message": "Не бачите свого запису?", + "description": "Заголовок модального вікна проблем в редакторі" + }, + "havingIssuesModalDescription": { + "message": "Якщо ви завершили запис і опинилися на цій сторінці без можливості переглянути своє відео, ви можете спробувати завантажити сиру відеоінформацію, якщо вона доступна. Ви також можете зв'язатися з нами і подати звіт про помилку.", + "description": "Опис модального вікна проблем в редакторі" + }, + "havingIssuesModalButton": { + "message": "Завантажити сиру відеоінформацію", + "description": "Кнопка в модальному вікні проблем в редакторі" + }, + "havingIssuesModalButton2": { + "message": "Повідомити про помилку", + "description": "Друга кнопка в модальному вікні проблем в редакторі" + }, + "noRecordingFound": { + "message": "Запис не знайдено, вибачте :(", + "description": "Попередження про відсутність запису в редакторі" } } diff --git a/build/_locales/zh_CN/messages.json b/build/_locales/zh_CN/messages.json index 8361fb5..f5258fe 100644 --- a/build/_locales/zh_CN/messages.json +++ b/build/_locales/zh_CN/messages.json @@ -96,8 +96,8 @@ "description": "Show more options label" }, "systemAudioLabel": { - "message": "包括标签音频", - "description": "Tab/system audio label" + "message": "包括系统音频", + "description": "选项卡/系统音频标签" }, "hideToolbarLabel": { "message": "隐藏工具栏", @@ -782,5 +782,29 @@ "restoreRecording": { "message": "恢复最近的录音", "description": "弹出窗口中恢复最近的录音按钮" + }, + "havingIssuesButton": { + "message": "遇到问题了吗?", + "description": "编辑器中的问题按钮" + }, + "havingIssuesModalTitle": { + "message": "无法查看您的录像?", + "description": "编辑器中的问题模态框标题" + }, + "havingIssuesModalDescription": { + "message": "如果您已经完成录制并发现自己在此页面上看不到您的视频,您可以尝试下载原始视频数据(如果可用)。您还可以联系我们并提交错误报告。", + "description": "编辑器中的问题模态框描述" + }, + "havingIssuesModalButton": { + "message": "下载原始视频数据", + "description": "编辑器中的问题模态框按钮" + }, + "havingIssuesModalButton2": { + "message": "报告问题", + "description": "编辑器中的问题模态框第二个按钮" + }, + "noRecordingFound": { + "message": "未找到录制,抱歉 :(", + "description": "编辑器中的未找到录制警告" } } diff --git a/build/_locales/zh_TW/messages.json b/build/_locales/zh_TW/messages.json index 78d065d..bfee860 100644 --- a/build/_locales/zh_TW/messages.json +++ b/build/_locales/zh_TW/messages.json @@ -95,9 +95,10 @@ "message": "显示更多选项", "description": "Show more options label" }, + "systemAudioLabel": { - "message": "包括标签音频", - "description": "Tab/system audio label" + "message": "包括系統音訊", + "description": "標籤/系統音訊標籤" }, "hideToolbarLabel": { "message": "隐藏工具栏", @@ -786,5 +787,29 @@ "restoreRecording": { "message": "還原最近的錄音", "description": "在彈出視窗中還原最近的錄音按鈕" + }, + "havingIssuesButton": { + "message": "遇到問題了嗎?", + "description": "編輯器中的問題按鈕" + }, + "havingIssuesModalTitle": { + "message": "無法查看您的錄影?", + "description": "編輯器中的問題模式對話框標題" + }, + "havingIssuesModalDescription": { + "message": "如果您已經完成錄製並發現自己在此頁面上看不到您的視頻,您可以嘗試下載原始視頻數據(如果可用)。您還可以聯繫我們並提交錯誤報告。", + "description": "編輯器中的問題模式對話框描述" + }, + "havingIssuesModalButton": { + "message": "下載原始視頻數據", + "description": "編輯器中的問題模式對話框按鈕" + }, + "havingIssuesModalButton2": { + "message": "報告問題", + "description": "編輯器中的問題模式對話框第二個按鈕" + }, + "noRecordingFound": { + "message": "未找到錄製,抱歉 :(", + "description": "編輯器中的未找到錄製警告" } } diff --git a/build/background.bundle.js b/build/background.bundle.js index caed32e..1f904d5 100644 --- a/build/background.bundle.js +++ b/build/background.bundle.js @@ -5,4 +5,4 @@ https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */ -e.exports=function e(t,r,n){function o(i,c){if(!r[i]){if(!t[i]){if(a)return a(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var u=r[i]={exports:{}};t[i][0].call(u.exports,(function(e){var r=t[i][1][e];return o(r||e)}),u,u.exports,e,t,r,n)}return r[i].exports}for(var a=void 0,i=0;i=43)}})).catch((function(){return!1}))}function k(e){return"boolean"==typeof m?u.resolve(m):x(e).then((function(e){return m=e}))}function E(e){var t=g[e.name],r={};r.promise=new u((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function _(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var r=g[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function I(e,t){return new u((function(r,n){if(g[e.name]=g[e.name]||M(),e.db){if(!t)return r(e.db);E(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var a=i.open.apply(i,o);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(p)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},r(t),_(e)}}))}function T(e){return I(e,!1)}function N(e){return I(e,!0)}function D(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function j(e){return new u((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function L(e){return s([w(atob(e.data))],{type:e.type})}function O(e){return e&&e.__local_forage_encoded_blob}function C(e){var t=this,r=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return f(r,e,e),r}function A(e){E(e);for(var t=g[e.name],r=t.forages,n=0;n0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),N(e)})).then((function(){return A(e).then((function(){R(e,t,r,n-1)}))})).catch(r);r(o)}}function M(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function B(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=g[r.name];o||(o=M(),g[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=C);var a=[];function i(){return u.resolve()}for(var c=0;c>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&a;return u}function pe(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=V[(3&r[t])<<4|r[t+1]>>4],n+=V[(15&r[t+1])<<2|r[t+2]>>6],n+=V[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function me(e,t){var r="";if(e&&(r=he.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===he.call(e.buffer))){var n,o=X;e instanceof ArrayBuffer?(n=e,o+=ee):(n=e.buffer,"[object Int8Array]"===r?o+=re:"[object Uint8Array]"===r?o+=ne:"[object Uint8ClampedArray]"===r?o+=oe:"[object Int16Array]"===r?o+=ae:"[object Uint16Array]"===r?o+=ce:"[object Int32Array]"===r?o+=ie:"[object Uint32Array]"===r?o+=se:"[object Float32Array]"===r?o+=ue:"[object Float64Array]"===r?o+=le:t(new Error("Failed to get type for BinaryArray"))),t(o+pe(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r=Y+e.type+"~"+pe(this.result);t(X+te+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function ge(e){if(e.substring(0,Z)!==X)return JSON.parse(e);var t,r=e.substring(fe),n=e.substring(Z,fe);if(n===te&&H.test(r)){var o=r.match(H);t=o[1],r=r.substring(o[0].length)}var a=de(r);switch(n){case ee:return a;case te:return s([a],{type:t});case re:return new Int8Array(a);case ne:return new Uint8Array(a);case oe:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case ce:return new Uint16Array(a);case ie:return new Int32Array(a);case se:return new Uint32Array(a);case ue:return new Float32Array(a);case le:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}}var ye={serialize:me,deserialize:ge,stringToBuffer:de,bufferToString:pe};function ve(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function be(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new u((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(o){ve(o,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=ye,o}function we(e,t,r,n,o,a){e.executeSql(r,n,o,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,c){c.rows.length?a(e,i):ve(e,t,(function(){e.executeSql(r,n,o,a)}),a)}),a):a(e,i)}),a)}function xe(e,t){var r=this;e=h(e);var n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,t),n}function ke(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName,[],(function(r,n){for(var a=n.rows,i=a.length,c=0;c0)return void a(Ee.apply(o,[e,c,r,n-1]));i(t)}}))}))})).catch(i)}));return l(a,r),a}function _e(e,t,r){return Ee.apply(this,[e,t,r,1])}function Se(e,t){var r=this;e=h(e);var n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,t),n}function Ie(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,e),r}function Te(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,e),r}function Ne(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,t),n}function De(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],o=0;o '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var o=[],a=0;a0}function Be(e){var t=this,r={};if(e)for(var n in e)r[n]=e[n];return r.keyPrefix=Ae(e,t._defaultConfig),Me()?(t._dbInfo=r,r.serializer=ye,u.resolve()):u.reject()}function Pe(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return l(r,e),r}function Fe(e,t){var r=this;e=h(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return l(n,t),n}function Ue(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,a=localStorage.length,i=1,c=0;c=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):u.reject("Invalid arguments"),l(n,t),n}var Qe={_driver:"localStorageWrapper",_initStorage:Be,_support:Ce(),iterate:Ue,getItem:Fe,setItem:ze,removeItem:Je,clear:Pe,length:Ge,key:$e,keys:qe,dropInstance:Ke},We=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ve=function(e,t){for(var r=e.length,n=0;n{"use strict";var n=r(5877);e.exports={generate:function(){var e=n.v1();return e.substr(14,4)+e.substr(9,4)+e.substr(0,8)+e.substr(19,4)+e.substr(24,e.length)},toBinary16:function(e){return new Buffer(e,"hex")},fromBinary16:function(e){return e.toString("hex")}}},5877:(e,t,r)=>{var n=r(3570),o=r(1171),a=o;a.v1=n,a.v4=o,e.exports=a},5327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:(e,t,r)=>{var n,o,a=r(5217),i=r(5327),c=0,s=0;e.exports=function(e,t,r){var u=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==h){var d=a();null==f&&(f=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:s+1,g=p-c+(m-s)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>c)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,s=m,o=h;var y=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;l[u++]=y>>>24&255,l[u++]=y>>>16&255,l[u++]=y>>>8&255,l[u++]=255&y;var v=p/4294967296*1e4&268435455;l[u++]=v>>>8&255,l[u++]=255&v,l[u++]=v>>>24&15|16,l[u++]=v>>>16&255,l[u++]=h>>>8|128,l[u++]=255&h;for(var b=0;b<6;++b)l[u+b]=f[b];return t||i(l)}},1171:(e,t,r)=>{var n=r(5217),o=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var c=0;c<16;++c)t[a+c]=i[c];return t||o(i)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new O(n||[]);return i(a,"_invoke",{value:N(e,r,c)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var p="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(C([])));_&&_!==o&&a.call(_,s)&&(k=_);var S=x.prototype=b.prototype=Object.create(k);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(t,r){function n(o,i,c,s){var u=d(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function N(e,t,n){var o=p;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=D(c,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var u=d(e,t,n);if("normal"===u.type){if(o=n.done?y:m,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function D(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,D(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,v;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function C(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),v}},n}function n(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}const o=function(){var e,r=(e=t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,chrome.identity.getAuthToken({interactive:!0});case 3:if(r=e.sent){e.next=6;break}throw new Error("User cancelled sign-in or failed to get token");case 6:return e.next=8,new Promise((function(e){return chrome.storage.local.set({token:r.token},(function(){return e()}))}));case 8:return e.next=10,chrome.identity.getProfileUserInfo();case 10:return e.sent,e.abrupt("return",r.token);case 14:return e.prev=14,e.t0=e.catch(0),console.error("Error signing in:",e.t0.message),e.abrupt("return",null);case 19:case"end":return e.stop()}}),e,null,[[0,14]])})),function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,s,"next",e)}function s(e){n(i,o,a,c,s,"throw",e)}c(void 0)}))});return function(){return r.apply(this,arguments)}}();function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,i=Object.create(a.prototype),c=new O(n||[]);return o(i,"_invoke",{value:N(e,r,c)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(C([])));_&&_!==r&&n.call(_,s)&&(k=_);var S=x.prototype=b.prototype=Object.create(k);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=d(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==a(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function N(t,r,n){var o=p;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=D(c,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var u=d(t,r,n);if("normal"===u.type){if(o=n.done?y:m,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function D(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,D(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function c(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,s,"next",e)}function s(e){c(a,n,o,i,s,"throw",e)}i(void 0)}))}}const u=function(){var e=s(i().mark((function e(t,r,n){var a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=function(){return c=s(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){chrome.storage.local.get(["token"],function(){var r=s(i().mark((function r(n){var a,c,s,u;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!chrome.runtime.lastError){r.next=4;break}t(new Error(chrome.runtime.lastError)),r.next=24;break;case 4:if((a=n.token)&&null!==a){r.next=13;break}return r.next=8,o();case 8:(c=r.sent)&&null!==c||t(new Error("Sign-in failed")),e(c),r.next=24;break;case 13:r.prev=13,s=JSON.parse(atob(a.split(".")[1])),r.next=21;break;case 17:return r.prev=17,r.t0=r.catch(13),chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})),r.abrupt("return");case 21:u=1e3*s.exp,Date.now()>=u?chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})):e(a);case 24:case"end":return r.stop()}}),r,null,[[13,17]])})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)},a=function(){return c.apply(this,arguments)},e.abrupt("return",new Promise(function(){var e=s(i().mark((function e(o,c){var s,u,l,f,h,d,p,m,g;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a();case 3:if((s=e.sent)&&null!==s){e.next=6;break}throw new Error("Sign-in failed");case 6:return u=new Headers({Authorization:"Bearer ".concat(s),"Content-Type":t.type}),e.next=9,fetch("https://www.googleapis.com/upload/drive/v3/files?uploadType=media",{method:"POST",headers:u,body:t});case 9:if((l=e.sent).ok){e.next=16;break}return e.next=13,l.json();case 13:throw f=e.sent,console.error("Error uploading to Google Drive:",l.status,f.error.message),new Error("Error uploading to Google Drive: ".concat(l.status));case 16:return e.next=18,l.json();case 18:if(h=e.sent,d=h.id){e.next=23;break}throw console.error("File ID is undefined"),new Error("File ID is undefined");case 23:return p={name:r},e.next=26,fetch("https://www.googleapis.com/drive/v3/files/".concat(d),{method:"PATCH",headers:new Headers({Authorization:"Bearer ".concat(s),"Content-Type":"application/json; charset=UTF-8"}),body:JSON.stringify(p)});case 26:if((m=e.sent).ok){e.next=33;break}return e.next=30,m.json();case 30:throw g=e.sent,console.error("Error updating file metadata:",m.status,g.error.message),new Error("Error updating file metadata: ".concat(m.status));case 33:n({status:"ok",url:d}),chrome.tabs.create({url:"https://drive.google.com/file/d/".concat(d,"/view")}),o("https://drive.google.com/file/d/".concat(d,"/view")),e.next=43;break;case 38:e.prev=38,e.t0=e.catch(0),console.error("Error uploading to Google Drive:",e.t0.message),n({status:"ew",url:null}),c(e.t0);case 43:case"end":return e.stop()}}),e,null,[[0,38]])})));return function(t,r){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}();var l=r(9483),f=r.n(l);function h(e){if(e){if("string"!=typeof e)return this.userErrors.push("Collection name in collection() method must be a string and not an object, number or boolean."),this;{this.collectionName=e;let t=this.dbName;return e in this.lf||(this.lf[e]=f().createInstance({driver:f().INDEXEDDB,name:t,storeName:e})),this}}return this.userErrors.push("No collection name specified in collection() method."),this}function d(e){return e?"string"!=typeof e&&"object"!=typeof e?this.userErrors.push("Document criteria specified in doc() method must not be a number or boolean. Use a string (with a key) or an object (with criteria) e.g. { id: 1 }"):this.docSelectionCriteria=e:this.userErrors.push("No document criteria specified in doc() method. Use a string (with a key) or an object (with criteria) e.g. { id: 1 }"),this}function p(e,t){return e?"string"!=typeof e?this.userErrors.push("First parameter in orderBy() method must be a string (a field name) e.g. 'name'"):this.orderByProperty=e:this.userErrors.push("No field name specified in orderBy() method. Use a string e.g. 'name'"),t&&("asc"!==t&&"desc"!==t?this.userErrors.push("Second parameter in orderBy() method must be a string set to 'asc' or 'desc'."):this.orderByDirection=t),this}function m(e){return e?Number.isInteger(e)?this.limitBy=e:this.userErrors.push("Limit parameter in limit() method must be an integer (e.g. 3) and not a float, boolean, string or object."):this.userErrors.push("No integer specified in limit() method."),this}function g(e,t){return Object.keys(t).every((r=>"object"==typeof t[r]?g(e[r],t[r]):t[r]===e[r]))}const y={baseStyle:"\n padding: 2px 5px;\n background-color: #124F5C;\n border-radius: 4px;\n color: white; \n ",colors:{log:"#124F5C",error:"#ed2939",warn:"#f39c12"},log(e,t){0},error(e,t){0},warn(e,t){0}};function v(){this.collectionName=null,this.orderByProperty=null,this.orderByDirection=null,this.limitBy=null,this.docSelectionCriteria=null,this.userErrors=[]}function b(){let e;return this.collectionName||this.docSelectionCriteria?this.collectionName&&!this.docSelectionCriteria?e="collection":this.collectionName&&this.docSelectionCriteria&&(e="doc"):e="db",e}function w(){for(let e=0;e{let t=this.collectionName,r=this.orderByProperty,n=this.orderByDirection,o=this.limitBy,a=[];return this.lf[t].iterate(((t,r)=>{let n={};n=e.keys?{key:r,data:t}:t,a.push(n)})).then((()=>{let i=`Got "${t}" collection`;return r&&(i+=`, ordered by "${r}"`,e.keys?a.sort(((e,t)=>e.data[r].toString().localeCompare(t.data[r].toString()))):a.sort(((e,t)=>e[r].toString().localeCompare(t[r].toString())))),"desc"==n&&(i+=" (descending)",a.reverse()),o&&(i+=`, limited to ${o}`,a=a.splice(0,o)),i+=":",y.log.call(this,i,a),v.call(this),a}))},this.getDocument=()=>{let e=this.collectionName,t=this.docSelectionCriteria,r=[],n={};return this.getDocumentByCriteria=()=>this.lf[e].iterate(((e,n)=>{g(e,t)&&r.push(e)})).then((()=>{if(r.length)return n=r[0],y.log.call(this,`Got Document with ${JSON.stringify(t)}:`,n),v.call(this),n;y.error.call(this,`Could not find Document in "${e}" collection with criteria: ${JSON.stringify(t)}`)})),this.getDocumentByKey=()=>this.lf[e].getItem(t).then((r=>(n=r,n?y.log.call(this,`Got Document with key ${JSON.stringify(t)}:`,n):y.error.call(this,`Could not find Document in "${e}" collection with Key: ${JSON.stringify(t)}`),v.call(this),n))).catch((r=>{y.error.call(this,`Could not find Document in "${e}" collection with Key: ${JSON.stringify(t)}`),v.call(this)})),"object"==typeof t?this.getDocumentByCriteria():this.getDocumentByKey()},"object"!=typeof e||e instanceof Array!=0?this.userErrors.push('Data passed to .get() must be an object. Not an array, string, number or boolean. The object must contain a "keys" property set to true or false, e.g. { keys: true }'):e.hasOwnProperty("keys")?"boolean"!=typeof e.keys&&this.userErrors.push('Property "keys" passed into get() method must be assigned a boolean value (true or false). Not a string or integer.'):this.userErrors.push('Object passed to get() method must contain a "keys" property set to boolean true or false, e.g. { keys: true }'),this.userErrors.length)return w.call(this),null;{let e=b.call(this);if("collection"==e)return this.getCollection();if("doc"==e)return this.getDocument()}}function k(e,t){return v.call(this),y.log.call(this,e,t),{success:!0,message:e,data:t}}function E(e){return v.call(this),y.error.call(this,e),`Error: ${e}`}let _=r(2024);function S(e,t){if(e?"object"==typeof e&&e instanceof Array==0||this.userErrors.push("Data passed to .add() must be an object. Not an array, string, number or boolean."):this.userErrors.push('No data specified in add() method. You must use an object, e.g { id: 1, name: "Bill", age: 47 }'),!this.userErrors.length){let r=this.collectionName;return new Promise(((n,o)=>{let a=null;return a=t||_.generate(),this.lf[r].setItem(a,e).then((()=>{n(k.call(this,`Document added to "${r}" collection.`,{key:a,data:e}))})).catch((e=>{o(E.call(this,`Could not add Document to ${r} collection.`))}))}))}w.call(this)}function I(e){for(var t=1;t{this.updateDocumentByCriteria=()=>{let a=[];this.lf[t].iterate(((t,n)=>{if(g(t,r)){let r=I(t,e);a.push({key:n,newDocument:r})}})).then((()=>{a.length||o(E.call(this,`No Documents found in ${t} Collection with criteria ${JSON.stringify(r)}.`)),a.length>1&&y.warn.call(this,`Multiple documents (${a.length}) with ${JSON.stringify(r)} found for updating.`)})).then((()=>{a.forEach(((i,c)=>{this.lf[t].setItem(i.key,i.newDocument).then((o=>{c===a.length-1&&n(k.call(this,`${a.length} Document${a.length>1?"s":""} in "${t}" collection with ${JSON.stringify(r)} updated.`,e))})).catch((e=>{o(E.call(this,`Could not update ${a.length} Documents in ${t} Collection.`))}))}))}))},this.updateDocumentByKey=()=>{let a={};this.lf[t].getItem(r).then((o=>{a=I(o,e),this.lf[t].setItem(r,a),n(k.call(this,`Document in "${t}" collection with key ${JSON.stringify(r)} updated.`,a))})).catch((e=>{o(E.call(this,`No Document found in "${t}" collection with key ${JSON.stringify(r)}`))}))},e?"object"==typeof e&&e instanceof Array==0||this.userErrors.push("Data passed to .update() must be an object. Not an array, string, number or boolean."):this.userErrors.push('No update object provided to update() method. Use an object e.g. { name: "William" }'),this.userErrors.length?w.call(this):"object"==typeof r?this.updateDocumentByCriteria():this.updateDocumentByKey()}))}function N(e,t={keys:!1}){let r=this.collectionName,n=this.docSelectionCriteria,o=b.call(this);return new Promise(((a,i)=>{if(this.setCollection=()=>{this.lf[r].clear().then((()=>{if(t.keys){console.log("keys provided");let t=0;e.forEach((e=>{e.hasOwnProperty("_key")||t++})),t?i(E.call(this,"Documents provided to .set() in an array must each have a _key property set to a string.")):(e.forEach((e=>{let t=e._key;delete e._key,this.add(e,t)})),a(k.call(this,`Collection "${r}" set with ${e.length} Documents.`,e)))}else e.forEach((e=>{this.add(e)})),a(k.call(this,`Collection "${r}" set with ${e.length} Documents.`,e))})).catch((t=>{i(E.call(this,`Could not set ${r} Collection with data ${JSON.stringify(e)}.`))}))},this.setDocument=()=>(this.setDocumentByCriteria=()=>{let t=[];this.lf[r].iterate(((r,o)=>{g(r,n)&&t.push({key:o,newDocument:e})})).then((()=>{t.length||i(E.call(this,`No Documents found in ${r} Collection with criteria ${JSON.stringify(n)}.`)),t.length>1&&y.warn.call(this,`Multiple documents (${t.length}) with ${JSON.stringify(n)} found for setting.`)})).then((()=>{t.forEach(((o,c)=>{this.lf[r].setItem(o.key,o.newDocument).then((o=>{c===t.length-1&&a(k.call(this,`${t.length} Document${t.length>1?"s":""} in "${r}" collection with ${JSON.stringify(n)} was set.`,e))})).catch((e=>{i(E.call(this,`Could not set ${t.length} Documents in ${r} Collection.`))}))}))}))},this.setDocumentByKey=()=>{this.lf[r].setItem(n,e).then((t=>{a(k.call(this,`Document in "${r}" collection with key ${JSON.stringify(n)} was set.`,e))})).catch((e=>{i(E.call(this,`Document in "${r}" collection with key ${JSON.stringify(n)} could not be set.`))}))},"object"==typeof n?this.setDocumentByCriteria():this.setDocumentByKey()),e?"doc"===o?"object"==typeof e&&e instanceof Array==0||this.userErrors.push("Data passed to .set() must be an object. Not an array, string, number or boolean."):"collection"===o&&("object"==typeof e&&e instanceof Array==1||this.userErrors.push("Data passed to .set() must be an array of objects. Not an object, string, number or boolean.")):this.userErrors.push('No new Document object provided to set() method. Use an object e.g. { id: 1, name: "Bill", age: 47 }'),this.userErrors.length)w.call(this);else{if("collection"==o)return this.setCollection();if("doc"==o)return this.setDocument()}}))}function D(){return new Promise(((e,t)=>{if(this.deleteDatabase=()=>{let t=this.dbName;indexedDB.deleteDatabase(t),e(k.call(this,`Database "${t}" deleted.`,{database:t}))},this.deleteCollection=()=>{let r=this.dbName,n=this.collectionName;this.addToDeleteCollectionQueue=e=>{this.deleteCollectionQueue.queue.push(e),this.runDeleteCollectionQueue()},this.runDeleteCollectionQueue=()=>{0==this.deleteCollectionQueue.running&&(this.deleteCollectionQueue.running=!0,this.deleteNextCollectionFromQueue())},this.deleteNextCollectionFromQueue=()=>{if(this.deleteCollectionQueue.queue.length){let n=this.deleteCollectionQueue.queue[0];this.deleteCollectionQueue.queue.shift(),this.lf[n].dropInstance({name:r,storeName:n}).then((()=>{this.deleteNextCollectionFromQueue(),e(k.call(this,`Collection "${n}" deleted.`,{collection:n}))})).catch((e=>{t(e.call(this,`Collection "${n}" could not be deleted.`))}))}else this.deleteCollectionQueue.running=!1},this.addToDeleteCollectionQueue(n)},this.deleteDocument=()=>{let r=this.collectionName,n=this.docSelectionCriteria;return this.deleteDocumentByCriteria=()=>{let o=[];this.lf[r].iterate(((e,t)=>{g(e,n)&&o.push(t)})).then((()=>{o.length||t(E.call(this,`No Documents found in "${r}" Collection with criteria ${JSON.stringify(n)}. No documents deleted.`)),o.length>1&&y.warn.call(this,`Multiple documents (${o.length}) with ${JSON.stringify(n)} found.`)})).then((()=>{o.forEach(((a,i)=>{this.lf[r].removeItem(a).then((()=>{i===o.length-1&&e(k.call(this,`${o.length} Document${o.length>1?"s":""} with ${JSON.stringify(n)} deleted.`,{keys:o}))})).catch((e=>{t(E.call(this,`Could not delete ${o.length} Documents in ${r} Collection.`))}))}))}))},this.deleteDocumentByKey=()=>{this.lf[r].getItem(n).then((o=>{o?this.lf[r].removeItem(n).then((()=>{e(k.call(this,`Document with key ${JSON.stringify(n)} deleted.`,{key:n}))})).catch((function(e){t(E.call(this,`No Document found in "${r}" Collection with key ${JSON.stringify(n)}. No document was deleted.`))})):t(E.call(this,`No Document found in "${r}" Collection with key ${JSON.stringify(n)}. No document was deleted.`))}))},"object"==typeof n?this.deleteDocumentByCriteria():this.deleteDocumentByKey()},this.userErrors.length)w.call(this);else{let e=b.call(this);if("db"==e)return this.deleteDatabase();if("collection"==e)return this.deleteCollection();if("doc"==e)return this.deleteDocument()}}))}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function L(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=A(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new L(n||[]);return o(i,"_invoke",{value:I(e,r,c)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};u(w,i,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(C([])));k&&k!==r&&n.call(k,i)&&(w=k);var E=b.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,a,i,c){var s=f(e[o],e,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==j(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function I(t,r,n){var o=h;return function(a,i){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=T(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?m:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=43)}})).catch((function(){return!1}))}function k(e){return"boolean"==typeof m?u.resolve(m):x(e).then((function(e){return m=e}))}function E(e){var t=g[e.name],r={};r.promise=new u((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function _(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var r=g[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function I(e,t){return new u((function(r,n){if(g[e.name]=g[e.name]||M(),e.db){if(!t)return r(e.db);E(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var a=i.open.apply(i,o);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(p)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},r(t),_(e)}}))}function T(e){return I(e,!1)}function N(e){return I(e,!0)}function D(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function j(e){return new u((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function L(e){return s([w(atob(e.data))],{type:e.type})}function O(e){return e&&e.__local_forage_encoded_blob}function C(e){var t=this,r=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return f(r,e,e),r}function A(e){E(e);for(var t=g[e.name],r=t.forages,n=0;n0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),N(e)})).then((function(){return A(e).then((function(){R(e,t,r,n-1)}))})).catch(r);r(o)}}function M(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function B(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=g[r.name];o||(o=M(),g[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=C);var a=[];function i(){return u.resolve()}for(var c=0;c>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&a;return u}function pe(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=V[(3&r[t])<<4|r[t+1]>>4],n+=V[(15&r[t+1])<<2|r[t+2]>>6],n+=V[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function me(e,t){var r="";if(e&&(r=he.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===he.call(e.buffer))){var n,o=X;e instanceof ArrayBuffer?(n=e,o+=ee):(n=e.buffer,"[object Int8Array]"===r?o+=re:"[object Uint8Array]"===r?o+=ne:"[object Uint8ClampedArray]"===r?o+=oe:"[object Int16Array]"===r?o+=ae:"[object Uint16Array]"===r?o+=ce:"[object Int32Array]"===r?o+=ie:"[object Uint32Array]"===r?o+=se:"[object Float32Array]"===r?o+=ue:"[object Float64Array]"===r?o+=le:t(new Error("Failed to get type for BinaryArray"))),t(o+pe(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r=Y+e.type+"~"+pe(this.result);t(X+te+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function ge(e){if(e.substring(0,Z)!==X)return JSON.parse(e);var t,r=e.substring(fe),n=e.substring(Z,fe);if(n===te&&H.test(r)){var o=r.match(H);t=o[1],r=r.substring(o[0].length)}var a=de(r);switch(n){case ee:return a;case te:return s([a],{type:t});case re:return new Int8Array(a);case ne:return new Uint8Array(a);case oe:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case ce:return new Uint16Array(a);case ie:return new Int32Array(a);case se:return new Uint32Array(a);case ue:return new Float32Array(a);case le:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}}var ye={serialize:me,deserialize:ge,stringToBuffer:de,bufferToString:pe};function ve(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function be(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new u((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(o){ve(o,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=ye,o}function we(e,t,r,n,o,a){e.executeSql(r,n,o,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,c){c.rows.length?a(e,i):ve(e,t,(function(){e.executeSql(r,n,o,a)}),a)}),a):a(e,i)}),a)}function xe(e,t){var r=this;e=h(e);var n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,t),n}function ke(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName,[],(function(r,n){for(var a=n.rows,i=a.length,c=0;c0)return void a(Ee.apply(o,[e,c,r,n-1]));i(t)}}))}))})).catch(i)}));return l(a,r),a}function _e(e,t,r){return Ee.apply(this,[e,t,r,1])}function Se(e,t){var r=this;e=h(e);var n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,t),n}function Ie(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,e),r}function Te(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,e),r}function Ne(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,t),n}function De(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],o=0;o '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var o=[],a=0;a0}function Be(e){var t=this,r={};if(e)for(var n in e)r[n]=e[n];return r.keyPrefix=Ae(e,t._defaultConfig),Me()?(t._dbInfo=r,r.serializer=ye,u.resolve()):u.reject()}function Pe(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return l(r,e),r}function Fe(e,t){var r=this;e=h(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return l(n,t),n}function Ue(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,a=localStorage.length,i=1,c=0;c=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):u.reject("Invalid arguments"),l(n,t),n}var Qe={_driver:"localStorageWrapper",_initStorage:Be,_support:Ce(),iterate:Ue,getItem:Fe,setItem:ze,removeItem:Je,clear:Pe,length:Ge,key:$e,keys:qe,dropInstance:Ke},We=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ve=function(e,t){for(var r=e.length,n=0;n{"use strict";var n=r(5877);e.exports={generate:function(){var e=n.v1();return e.substr(14,4)+e.substr(9,4)+e.substr(0,8)+e.substr(19,4)+e.substr(24,e.length)},toBinary16:function(e){return new Buffer(e,"hex")},fromBinary16:function(e){return e.toString("hex")}}},5877:(e,t,r)=>{var n=r(3570),o=r(1171),a=o;a.v1=n,a.v4=o,e.exports=a},5327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:(e,t,r)=>{var n,o,a=r(5217),i=r(5327),c=0,s=0;e.exports=function(e,t,r){var u=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==h){var d=a();null==f&&(f=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:s+1,g=p-c+(m-s)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>c)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,s=m,o=h;var y=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;l[u++]=y>>>24&255,l[u++]=y>>>16&255,l[u++]=y>>>8&255,l[u++]=255&y;var v=p/4294967296*1e4&268435455;l[u++]=v>>>8&255,l[u++]=255&v,l[u++]=v>>>24&15|16,l[u++]=v>>>16&255,l[u++]=h>>>8|128,l[u++]=255&h;for(var b=0;b<6;++b)l[u+b]=f[b];return t||i(l)}},1171:(e,t,r)=>{var n=r(5217),o=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var c=0;c<16;++c)t[a+c]=i[c];return t||o(i)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new O(n||[]);return i(a,"_invoke",{value:N(e,r,c)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var p="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(C([])));_&&_!==o&&a.call(_,s)&&(k=_);var S=x.prototype=b.prototype=Object.create(k);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(t,r){function n(o,i,c,s){var u=d(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function N(e,t,n){var o=p;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=D(c,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var u=d(e,t,n);if("normal"===u.type){if(o=n.done?y:m,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function D(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,D(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,v;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function C(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),v}},n}function n(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}const o=function(){var e,r=(e=t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,chrome.identity.getAuthToken({interactive:!0});case 3:if(r=e.sent){e.next=6;break}throw new Error("User cancelled sign-in or failed to get token");case 6:return e.next=8,new Promise((function(e){return chrome.storage.local.set({token:r.token},(function(){return e()}))}));case 8:return e.next=10,chrome.identity.getProfileUserInfo();case 10:return e.sent,e.abrupt("return",r.token);case 14:return e.prev=14,e.t0=e.catch(0),console.error("Error signing in:",e.t0.message),e.abrupt("return",null);case 19:case"end":return e.stop()}}),e,null,[[0,14]])})),function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,s,"next",e)}function s(e){n(i,o,a,c,s,"throw",e)}c(void 0)}))});return function(){return r.apply(this,arguments)}}();function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,i=Object.create(a.prototype),c=new O(n||[]);return o(i,"_invoke",{value:N(e,r,c)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function x(){}var k={};f(k,s,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(C([])));_&&_!==r&&n.call(_,s)&&(k=_);var S=x.prototype=b.prototype=Object.create(k);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=d(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==a(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function N(t,r,n){var o=p;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=D(c,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var u=d(t,r,n);if("normal"===u.type){if(o=n.done?y:m,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function D(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,D(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function c(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,s,"next",e)}function s(e){c(a,n,o,i,s,"throw",e)}i(void 0)}))}}const u=function(){var e=s(i().mark((function e(t,r,n){var a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=function(){return c=s(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){chrome.storage.local.get(["token"],function(){var r=s(i().mark((function r(n){var a,c,s,u;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!chrome.runtime.lastError){r.next=4;break}t(new Error(chrome.runtime.lastError)),r.next=24;break;case 4:if((a=n.token)&&null!==a){r.next=13;break}return r.next=8,o();case 8:(c=r.sent)&&null!==c||t(new Error("Sign-in failed")),e(c),r.next=24;break;case 13:r.prev=13,s=JSON.parse(atob(a.split(".")[1])),r.next=21;break;case 17:return r.prev=17,r.t0=r.catch(13),chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})),r.abrupt("return");case 21:u=1e3*s.exp,Date.now()>=u?chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})):e(a);case 24:case"end":return r.stop()}}),r,null,[[13,17]])})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)},a=function(){return c.apply(this,arguments)},e.abrupt("return",new Promise(function(){var e=s(i().mark((function e(o,c){var s,u,l,f,h,d,p,m,g;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a();case 3:if((s=e.sent)&&null!==s){e.next=6;break}throw new Error("Sign-in failed");case 6:return u=new Headers({Authorization:"Bearer ".concat(s),"Content-Type":t.type}),e.next=9,fetch("https://www.googleapis.com/upload/drive/v3/files?uploadType=media",{method:"POST",headers:u,body:t});case 9:if((l=e.sent).ok){e.next=16;break}return e.next=13,l.json();case 13:throw f=e.sent,console.error("Error uploading to Google Drive:",l.status,f.error.message),new Error("Error uploading to Google Drive: ".concat(l.status));case 16:return e.next=18,l.json();case 18:if(h=e.sent,d=h.id){e.next=23;break}throw console.error("File ID is undefined"),new Error("File ID is undefined");case 23:return p={name:r},e.next=26,fetch("https://www.googleapis.com/drive/v3/files/".concat(d),{method:"PATCH",headers:new Headers({Authorization:"Bearer ".concat(s),"Content-Type":"application/json; charset=UTF-8"}),body:JSON.stringify(p)});case 26:if((m=e.sent).ok){e.next=33;break}return e.next=30,m.json();case 30:throw g=e.sent,console.error("Error updating file metadata:",m.status,g.error.message),new Error("Error updating file metadata: ".concat(m.status));case 33:n({status:"ok",url:d}),chrome.tabs.create({url:"https://drive.google.com/file/d/".concat(d,"/view")}),o("https://drive.google.com/file/d/".concat(d,"/view")),e.next=43;break;case 38:e.prev=38,e.t0=e.catch(0),console.error("Error uploading to Google Drive:",e.t0.message),n({status:"ew",url:null}),c(e.t0);case 43:case"end":return e.stop()}}),e,null,[[0,38]])})));return function(t,r){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}();var l=r(9483),f=r.n(l);function h(e){if(e){if("string"!=typeof e)return this.userErrors.push("Collection name in collection() method must be a string and not an object, number or boolean."),this;{this.collectionName=e;let t=this.dbName;return e in this.lf||(this.lf[e]=f().createInstance({driver:f().INDEXEDDB,name:t,storeName:e})),this}}return this.userErrors.push("No collection name specified in collection() method."),this}function d(e){return e?"string"!=typeof e&&"object"!=typeof e?this.userErrors.push("Document criteria specified in doc() method must not be a number or boolean. Use a string (with a key) or an object (with criteria) e.g. { id: 1 }"):this.docSelectionCriteria=e:this.userErrors.push("No document criteria specified in doc() method. Use a string (with a key) or an object (with criteria) e.g. { id: 1 }"),this}function p(e,t){return e?"string"!=typeof e?this.userErrors.push("First parameter in orderBy() method must be a string (a field name) e.g. 'name'"):this.orderByProperty=e:this.userErrors.push("No field name specified in orderBy() method. Use a string e.g. 'name'"),t&&("asc"!==t&&"desc"!==t?this.userErrors.push("Second parameter in orderBy() method must be a string set to 'asc' or 'desc'."):this.orderByDirection=t),this}function m(e){return e?Number.isInteger(e)?this.limitBy=e:this.userErrors.push("Limit parameter in limit() method must be an integer (e.g. 3) and not a float, boolean, string or object."):this.userErrors.push("No integer specified in limit() method."),this}function g(e,t){return Object.keys(t).every((r=>"object"==typeof t[r]?g(e[r],t[r]):t[r]===e[r]))}const y={baseStyle:"\n padding: 2px 5px;\n background-color: #124F5C;\n border-radius: 4px;\n color: white; \n ",colors:{log:"#124F5C",error:"#ed2939",warn:"#f39c12"},log(e,t){0},error(e,t){0},warn(e,t){0}};function v(){this.collectionName=null,this.orderByProperty=null,this.orderByDirection=null,this.limitBy=null,this.docSelectionCriteria=null,this.userErrors=[]}function b(){let e;return this.collectionName||this.docSelectionCriteria?this.collectionName&&!this.docSelectionCriteria?e="collection":this.collectionName&&this.docSelectionCriteria&&(e="doc"):e="db",e}function w(){for(let e=0;e{let t=this.collectionName,r=this.orderByProperty,n=this.orderByDirection,o=this.limitBy,a=[];return this.lf[t].iterate(((t,r)=>{let n={};n=e.keys?{key:r,data:t}:t,a.push(n)})).then((()=>{let i=`Got "${t}" collection`;return r&&(i+=`, ordered by "${r}"`,e.keys?a.sort(((e,t)=>e.data[r].toString().localeCompare(t.data[r].toString()))):a.sort(((e,t)=>e[r].toString().localeCompare(t[r].toString())))),"desc"==n&&(i+=" (descending)",a.reverse()),o&&(i+=`, limited to ${o}`,a=a.splice(0,o)),i+=":",y.log.call(this,i,a),v.call(this),a}))},this.getDocument=()=>{let e=this.collectionName,t=this.docSelectionCriteria,r=[],n={};return this.getDocumentByCriteria=()=>this.lf[e].iterate(((e,n)=>{g(e,t)&&r.push(e)})).then((()=>{if(r.length)return n=r[0],y.log.call(this,`Got Document with ${JSON.stringify(t)}:`,n),v.call(this),n;y.error.call(this,`Could not find Document in "${e}" collection with criteria: ${JSON.stringify(t)}`)})),this.getDocumentByKey=()=>this.lf[e].getItem(t).then((r=>(n=r,n?y.log.call(this,`Got Document with key ${JSON.stringify(t)}:`,n):y.error.call(this,`Could not find Document in "${e}" collection with Key: ${JSON.stringify(t)}`),v.call(this),n))).catch((r=>{y.error.call(this,`Could not find Document in "${e}" collection with Key: ${JSON.stringify(t)}`),v.call(this)})),"object"==typeof t?this.getDocumentByCriteria():this.getDocumentByKey()},"object"!=typeof e||e instanceof Array!=0?this.userErrors.push('Data passed to .get() must be an object. Not an array, string, number or boolean. The object must contain a "keys" property set to true or false, e.g. { keys: true }'):e.hasOwnProperty("keys")?"boolean"!=typeof e.keys&&this.userErrors.push('Property "keys" passed into get() method must be assigned a boolean value (true or false). Not a string or integer.'):this.userErrors.push('Object passed to get() method must contain a "keys" property set to boolean true or false, e.g. { keys: true }'),this.userErrors.length)return w.call(this),null;{let e=b.call(this);if("collection"==e)return this.getCollection();if("doc"==e)return this.getDocument()}}function k(e,t){return v.call(this),y.log.call(this,e,t),{success:!0,message:e,data:t}}function E(e){return v.call(this),y.error.call(this,e),`Error: ${e}`}let _=r(2024);function S(e,t){if(e?"object"==typeof e&&e instanceof Array==0||this.userErrors.push("Data passed to .add() must be an object. Not an array, string, number or boolean."):this.userErrors.push('No data specified in add() method. You must use an object, e.g { id: 1, name: "Bill", age: 47 }'),!this.userErrors.length){let r=this.collectionName;return new Promise(((n,o)=>{let a=null;return a=t||_.generate(),this.lf[r].setItem(a,e).then((()=>{n(k.call(this,`Document added to "${r}" collection.`,{key:a,data:e}))})).catch((e=>{o(E.call(this,`Could not add Document to ${r} collection.`))}))}))}w.call(this)}function I(e){for(var t=1;t{this.updateDocumentByCriteria=()=>{let a=[];this.lf[t].iterate(((t,n)=>{if(g(t,r)){let r=I(t,e);a.push({key:n,newDocument:r})}})).then((()=>{a.length||o(E.call(this,`No Documents found in ${t} Collection with criteria ${JSON.stringify(r)}.`)),a.length>1&&y.warn.call(this,`Multiple documents (${a.length}) with ${JSON.stringify(r)} found for updating.`)})).then((()=>{a.forEach(((i,c)=>{this.lf[t].setItem(i.key,i.newDocument).then((o=>{c===a.length-1&&n(k.call(this,`${a.length} Document${a.length>1?"s":""} in "${t}" collection with ${JSON.stringify(r)} updated.`,e))})).catch((e=>{o(E.call(this,`Could not update ${a.length} Documents in ${t} Collection.`))}))}))}))},this.updateDocumentByKey=()=>{let a={};this.lf[t].getItem(r).then((o=>{a=I(o,e),this.lf[t].setItem(r,a),n(k.call(this,`Document in "${t}" collection with key ${JSON.stringify(r)} updated.`,a))})).catch((e=>{o(E.call(this,`No Document found in "${t}" collection with key ${JSON.stringify(r)}`))}))},e?"object"==typeof e&&e instanceof Array==0||this.userErrors.push("Data passed to .update() must be an object. Not an array, string, number or boolean."):this.userErrors.push('No update object provided to update() method. Use an object e.g. { name: "William" }'),this.userErrors.length?w.call(this):"object"==typeof r?this.updateDocumentByCriteria():this.updateDocumentByKey()}))}function N(e,t={keys:!1}){let r=this.collectionName,n=this.docSelectionCriteria,o=b.call(this);return new Promise(((a,i)=>{if(this.setCollection=()=>{this.lf[r].clear().then((()=>{if(t.keys){console.log("keys provided");let t=0;e.forEach((e=>{e.hasOwnProperty("_key")||t++})),t?i(E.call(this,"Documents provided to .set() in an array must each have a _key property set to a string.")):(e.forEach((e=>{let t=e._key;delete e._key,this.add(e,t)})),a(k.call(this,`Collection "${r}" set with ${e.length} Documents.`,e)))}else e.forEach((e=>{this.add(e)})),a(k.call(this,`Collection "${r}" set with ${e.length} Documents.`,e))})).catch((t=>{i(E.call(this,`Could not set ${r} Collection with data ${JSON.stringify(e)}.`))}))},this.setDocument=()=>(this.setDocumentByCriteria=()=>{let t=[];this.lf[r].iterate(((r,o)=>{g(r,n)&&t.push({key:o,newDocument:e})})).then((()=>{t.length||i(E.call(this,`No Documents found in ${r} Collection with criteria ${JSON.stringify(n)}.`)),t.length>1&&y.warn.call(this,`Multiple documents (${t.length}) with ${JSON.stringify(n)} found for setting.`)})).then((()=>{t.forEach(((o,c)=>{this.lf[r].setItem(o.key,o.newDocument).then((o=>{c===t.length-1&&a(k.call(this,`${t.length} Document${t.length>1?"s":""} in "${r}" collection with ${JSON.stringify(n)} was set.`,e))})).catch((e=>{i(E.call(this,`Could not set ${t.length} Documents in ${r} Collection.`))}))}))}))},this.setDocumentByKey=()=>{this.lf[r].setItem(n,e).then((t=>{a(k.call(this,`Document in "${r}" collection with key ${JSON.stringify(n)} was set.`,e))})).catch((e=>{i(E.call(this,`Document in "${r}" collection with key ${JSON.stringify(n)} could not be set.`))}))},"object"==typeof n?this.setDocumentByCriteria():this.setDocumentByKey()),e?"doc"===o?"object"==typeof e&&e instanceof Array==0||this.userErrors.push("Data passed to .set() must be an object. Not an array, string, number or boolean."):"collection"===o&&("object"==typeof e&&e instanceof Array==1||this.userErrors.push("Data passed to .set() must be an array of objects. Not an object, string, number or boolean.")):this.userErrors.push('No new Document object provided to set() method. Use an object e.g. { id: 1, name: "Bill", age: 47 }'),this.userErrors.length)w.call(this);else{if("collection"==o)return this.setCollection();if("doc"==o)return this.setDocument()}}))}function D(){return new Promise(((e,t)=>{if(this.deleteDatabase=()=>{let t=this.dbName;indexedDB.deleteDatabase(t),e(k.call(this,`Database "${t}" deleted.`,{database:t}))},this.deleteCollection=()=>{let r=this.dbName,n=this.collectionName;this.addToDeleteCollectionQueue=e=>{this.deleteCollectionQueue.queue.push(e),this.runDeleteCollectionQueue()},this.runDeleteCollectionQueue=()=>{0==this.deleteCollectionQueue.running&&(this.deleteCollectionQueue.running=!0,this.deleteNextCollectionFromQueue())},this.deleteNextCollectionFromQueue=()=>{if(this.deleteCollectionQueue.queue.length){let n=this.deleteCollectionQueue.queue[0];this.deleteCollectionQueue.queue.shift(),this.lf[n].dropInstance({name:r,storeName:n}).then((()=>{this.deleteNextCollectionFromQueue(),e(k.call(this,`Collection "${n}" deleted.`,{collection:n}))})).catch((e=>{t(e.call(this,`Collection "${n}" could not be deleted.`))}))}else this.deleteCollectionQueue.running=!1},this.addToDeleteCollectionQueue(n)},this.deleteDocument=()=>{let r=this.collectionName,n=this.docSelectionCriteria;return this.deleteDocumentByCriteria=()=>{let o=[];this.lf[r].iterate(((e,t)=>{g(e,n)&&o.push(t)})).then((()=>{o.length||t(E.call(this,`No Documents found in "${r}" Collection with criteria ${JSON.stringify(n)}. No documents deleted.`)),o.length>1&&y.warn.call(this,`Multiple documents (${o.length}) with ${JSON.stringify(n)} found.`)})).then((()=>{o.forEach(((a,i)=>{this.lf[r].removeItem(a).then((()=>{i===o.length-1&&e(k.call(this,`${o.length} Document${o.length>1?"s":""} with ${JSON.stringify(n)} deleted.`,{keys:o}))})).catch((e=>{t(E.call(this,`Could not delete ${o.length} Documents in ${r} Collection.`))}))}))}))},this.deleteDocumentByKey=()=>{this.lf[r].getItem(n).then((o=>{o?this.lf[r].removeItem(n).then((()=>{e(k.call(this,`Document with key ${JSON.stringify(n)} deleted.`,{key:n}))})).catch((function(e){t(E.call(this,`No Document found in "${r}" Collection with key ${JSON.stringify(n)}. No document was deleted.`))})):t(E.call(this,`No Document found in "${r}" Collection with key ${JSON.stringify(n)}. No document was deleted.`))}))},"object"==typeof n?this.deleteDocumentByCriteria():this.deleteDocumentByKey()},this.userErrors.length)w.call(this);else{let e=b.call(this);if("db"==e)return this.deleteDatabase();if("collection"==e)return this.deleteCollection();if("doc"==e)return this.deleteDocument()}}))}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function L(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=A(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new L(n||[]);return o(i,"_invoke",{value:I(e,r,c)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};u(w,i,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(C([])));k&&k!==r&&n.call(k,i)&&(w=k);var E=b.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,a,i,c){var s=f(e[o],e,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==j(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function I(t,r,n){var o=h;return function(a,i){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=T(c,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?m:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function C(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=y},i=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0<_(o,t)))break e;e[r]=t,e[n]=o,n=r}}function E(e){return void 0===(e=e[0])?null:e}function C(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r_(a,n))void 0!==l&&0>_(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==l&&0>_(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var T=[],O=[],k=1,P=null,j=3,A=!1,M=!1,D=!1;function R(e){for(var t=E(O);null!==t;){if(null===t.callback)C(O);else{if(!(t.startTime<=e))break;C(O),t.sortIndex=t.expirationTime,S(T,t)}t=E(O)}}function I(e){if(D=!1,R(e),!M)if(null!==E(T))M=!0,n(F);else{var t=E(O);null!==t&&r(I,t.startTime-e)}}function F(e,n){M=!1,D&&(D=!1,o()),A=!0;var i=j;try{for(R(n),P=E(T);null!==P&&(!(P.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=P.callback;if("function"==typeof a){P.callback=null,j=P.priorityLevel;var s=a(P.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?P.callback=s:P===E(T)&&C(T),R(n)}else C(T);P=E(T)}if(null!==P)var l=!0;else{var c=E(O);null!==c&&r(I,c.startTime-n),l=!1}return l}finally{P=null,j=i,A=!1}}var L=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){M||A||(M=!0,n(F))},t.unstable_getCurrentPriorityLevel=function(){return j},t.unstable_getFirstCallbackNode=function(){return E(T)},t.unstable_next=function(e){switch(j){case 1:case 2:case 3:var t=3;break;default:t=j}var n=j;j=t;try{return e()}finally{j=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=L,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=j;j=e;try{return t()}finally{j=n}},t.unstable_scheduleCallback=function(e,i,a){var s=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0s?(e.sortIndex=a,S(O,e),null===E(T)&&e===E(O)&&(D?o():D=!0,r(I,a-s))):(e.sortIndex=l,S(T,e),M||A||(M=!0,n(F))),e},t.unstable_wrapCallback=function(e){var t=j;return function(){var n=j;j=t;try{return e.apply(this,arguments)}finally{j=n}}}},3840:(e,t,n)=>{"use strict";e.exports=n(53)},4960:()=>{},6759:()=>{},6272:()=>{}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>a[e]=()=>n[e]));return a.default=()=>n,o.d(i,a),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0,(()=>{"use strict";var e=o(7294),t=o.t(e,2),n=o(9060);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const n=r.map((t=>(0,e.createContext)(t)));return function(r){const o=(null==r?void 0:r[t])||n;return(0,e.useMemo)((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const i=(0,e.createContext)(o),a=r.length;function s(n){const{scope:r,children:o,...s}=n,l=(null==r?void 0:r[t][a])||i,c=(0,e.useMemo)((()=>s),Object.values(s));return(0,e.createElement)(l.Provider,{value:c},o)}return r=[...r,o],s.displayName=n+"Provider",[s,function(r,s){const l=(null==s?void 0:s[t][a])||i,c=(0,e.useContext)(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},s(o,...n)]}function s(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return(0,e.useMemo)((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}function l(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function c(...t){return(0,e.useCallback)(l(...t),t)}const u=(0,e.forwardRef)(((t,n)=>{const{children:o,...i}=t,a=e.Children.toArray(o),s=a.find(h);if(s){const t=s.props.children,o=a.map((n=>n===s?e.Children.count(t)>1?e.Children.only(null):(0,e.isValidElement)(t)?t.props.children:null:n));return(0,e.createElement)(f,r({},i,{ref:n}),(0,e.isValidElement)(t)?(0,e.cloneElement)(t,void 0,o):null)}return(0,e.createElement)(f,r({},i,{ref:n}),o)}));u.displayName="Slot";const f=(0,e.forwardRef)(((t,n)=>{const{children:r,...o}=t;return(0,e.isValidElement)(r)?(0,e.cloneElement)(r,{...p(o,r.props),ref:n?l(n,r.ref):r.ref}):e.Children.count(r)>1?e.Children.only(null):null}));f.displayName="SlotClone";const d=({children:t})=>(0,e.createElement)(e.Fragment,null,t);function h(t){return(0,e.isValidElement)(t)&&t.type===d}function p(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function g(t){const n=t+"CollectionProvider",[r,o]=a(n),[i,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:n,children:r}=t,o=e.useRef(null),a=e.useRef(new Map).current;return e.createElement(i,{scope:n,itemMap:a,collectionRef:o},r)},f=t+"CollectionSlot",d=e.forwardRef(((t,n)=>{const{scope:r,children:o}=t,i=c(n,s(f,r).collectionRef);return e.createElement(u,{ref:i},o)})),h=t+"CollectionItemSlot",p="data-radix-collection-item",g=e.forwardRef(((t,n)=>{const{scope:r,children:o,...i}=t,a=e.useRef(null),l=c(n,a),f=s(h,r);return e.useEffect((()=>(f.itemMap.set(a,{ref:a,...i}),()=>{f.itemMap.delete(a)}))),e.createElement(u,{[p]:"",ref:l},o)}));return[{Provider:l,Slot:d,ItemSlot:g},function(n){const r=s(t+"CollectionConsumer",n),o=e.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},o]}const m=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?e.useLayoutEffect:()=>{},v=t["useId".toString()]||(()=>{});let b=0;function y(t){const[n,r]=e.useState(v());return m((()=>{t||r((e=>null!=e?e:String(b++)))}),[t]),t||(n?`radix-${n}`:"")}const w=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const o=(0,e.forwardRef)(((t,o)=>{const{asChild:i,...a}=t,s=i?u:n;return(0,e.useEffect)((()=>{window[Symbol.for("radix-ui")]=!0}),[]),(0,e.createElement)(s,r({},a,{ref:o}))}));return o.displayName=`Primitive.${n}`,{...t,[n]:o}}),{});function x(e,t){e&&(0,n.flushSync)((()=>e.dispatchEvent(t)))}function S(t){const n=(0,e.useRef)(t);return(0,e.useEffect)((()=>{n.current=t})),(0,e.useMemo)((()=>(...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])}function E({prop:t,defaultProp:n,onChange:r=(()=>{})}){const[o,i]=function({defaultProp:t,onChange:n}){const r=(0,e.useState)(t),[o]=r,i=(0,e.useRef)(o),a=S(n);return(0,e.useEffect)((()=>{i.current!==o&&(a(o),i.current=o)}),[o,i,a]),r}({defaultProp:n,onChange:r}),a=void 0!==t,s=a?t:o,l=S(r);return[s,(0,e.useCallback)((e=>{if(a){const n="function"==typeof e?e(t):e;n!==t&&l(n)}else i(e)}),[a,t,i,l])]}const C=(0,e.createContext)(void 0);function _(t){const n=(0,e.useContext)(C);return t||n||"ltr"}const T="rovingFocusGroup.onEntryFocus",O={bubbles:!1,cancelable:!0},k="RovingFocusGroup",[P,j,A]=g(k),[M,D]=a(k,[A]),[R,I]=M(k),F=(0,e.forwardRef)(((t,n)=>(0,e.createElement)(P.Provider,{scope:t.__scopeRovingFocusGroup},(0,e.createElement)(P.Slot,{scope:t.__scopeRovingFocusGroup},(0,e.createElement)(L,r({},t,{ref:n})))))),L=(0,e.forwardRef)(((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:s=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:d,onEntryFocus:h,...p}=t,g=(0,e.useRef)(null),m=c(n,g),v=_(l),[b=null,y]=E({prop:u,defaultProp:f,onChange:d}),[x,C]=(0,e.useState)(!1),k=S(h),P=j(o),A=(0,e.useRef)(!1),[M,D]=(0,e.useState)(0);return(0,e.useEffect)((()=>{const e=g.current;if(e)return e.addEventListener(T,k),()=>e.removeEventListener(T,k)}),[k]),(0,e.createElement)(R,{scope:o,orientation:a,dir:v,loop:s,currentTabStopId:b,onItemFocus:(0,e.useCallback)((e=>y(e)),[y]),onItemShiftTab:(0,e.useCallback)((()=>C(!0)),[]),onFocusableItemAdd:(0,e.useCallback)((()=>D((e=>e+1))),[]),onFocusableItemRemove:(0,e.useCallback)((()=>D((e=>e-1))),[])},(0,e.createElement)(w.div,r({tabIndex:x||0===M?-1:0,"data-orientation":a},p,{ref:m,style:{outline:"none",...t.style},onMouseDown:i(t.onMouseDown,(()=>{A.current=!0})),onFocus:i(t.onFocus,(e=>{const t=!A.current;if(e.target===e.currentTarget&&t&&!x){const t=new CustomEvent(T,O);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=P().filter((e=>e.focusable));W([e.find((e=>e.active)),e.find((e=>e.id===b)),...e].filter(Boolean).map((e=>e.ref.current)))}}A.current=!1})),onBlur:i(t.onBlur,(()=>C(!1)))})))})),N="RovingFocusGroupItem",z=(0,e.forwardRef)(((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:s=!1,tabStopId:l,...c}=t,u=y(),f=l||u,d=I(N,o),h=d.currentTabStopId===f,p=j(o),{onFocusableItemAdd:g,onFocusableItemRemove:m}=d;return(0,e.useEffect)((()=>{if(a)return g(),()=>m()}),[a,g,m]),(0,e.createElement)(P.ItemSlot,{scope:o,id:f,focusable:a,active:s},(0,e.createElement)(w.span,r({tabIndex:h?0:-1,"data-orientation":d.orientation},c,{ref:n,onMouseDown:i(t.onMouseDown,(e=>{a?d.onItemFocus(f):e.preventDefault()})),onFocus:i(t.onFocus,(()=>d.onItemFocus(f))),onKeyDown:i(t.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:B[r]}(e,d.orientation,d.dir);if(void 0!==t){e.preventDefault();let o=p().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>W(o)))}var n,r}))})))})),B={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function W(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const H=F,U=z;const X=t=>{const{present:r,children:o}=t,i=function(t){const[r,o]=(0,e.useState)(),i=(0,e.useRef)({}),a=(0,e.useRef)(t),s=(0,e.useRef)("none"),l=t?"mounted":"unmounted",[c,u]=function(t,n){return(0,e.useReducer)(((e,t)=>{const r=n[e][t];return null!=r?r:e}),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,e.useEffect)((()=>{const e=V(i.current);s.current="mounted"===c?e:"none"}),[c]),m((()=>{const e=i.current,n=a.current;if(n!==t){const r=s.current,o=V(e);if(t)u("MOUNT");else if("none"===o||"none"===(null==e?void 0:e.display))u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,u]),m((()=>{if(r){const e=e=>{const t=V(i.current).includes(e.animationName);e.target===r&&t&&(0,n.flushSync)((()=>u("ANIMATION_END")))},t=e=>{e.target===r&&(s.current=V(i.current))};return r.addEventListener("animationstart",t),r.addEventListener("animationcancel",e),r.addEventListener("animationend",e),()=>{r.removeEventListener("animationstart",t),r.removeEventListener("animationcancel",e),r.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[r,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:(0,e.useCallback)((e=>{e&&(i.current=getComputedStyle(e)),o(e)}),[])}}(r),a="function"==typeof o?o({present:i.isPresent}):e.Children.only(o),s=c(i.ref,a.ref);return"function"==typeof o||i.isPresent?(0,e.cloneElement)(a,{ref:s}):null};function V(e){return(null==e?void 0:e.animationName)||"none"}X.displayName="Presence";const Y="Tabs",[G,q]=a(Y,[D]),K=D(),[$,Q]=G(Y),Z=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:o,value:i,onValueChange:a,defaultValue:s,orientation:l="horizontal",dir:c,activationMode:u="automatic",...f}=t,d=_(c),[h,p]=E({prop:i,onChange:a,defaultProp:s});return(0,e.createElement)($,{scope:o,baseId:y(),value:h,onValueChange:p,orientation:l,dir:d,activationMode:u},(0,e.createElement)(w.div,r({dir:d,"data-orientation":l},f,{ref:n})))})),J="TabsList",ee=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:o,loop:i=!0,...a}=t,s=Q(J,o),l=K(o);return(0,e.createElement)(H,r({asChild:!0},l,{orientation:s.orientation,dir:s.dir,loop:i}),(0,e.createElement)(w.div,r({role:"tablist","aria-orientation":s.orientation},a,{ref:n})))})),te="TabsTrigger",ne=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:o,value:a,disabled:s=!1,...l}=t,c=Q(te,o),u=K(o),f=ie(c.baseId,a),d=ae(c.baseId,a),h=a===c.value;return(0,e.createElement)(U,r({asChild:!0},u,{focusable:!s,active:h}),(0,e.createElement)(w.button,r({type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f},l,{ref:n,onMouseDown:i(t.onMouseDown,(e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(a)})),onKeyDown:i(t.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(a)})),onFocus:i(t.onFocus,(()=>{const e="manual"!==c.activationMode;h||s||!e||c.onValueChange(a)}))})))})),re="TabsContent",oe=(0,e.forwardRef)(((t,n)=>{const{__scopeTabs:o,value:i,forceMount:a,children:s,...l}=t,c=Q(re,o),u=ie(c.baseId,i),f=ae(c.baseId,i),d=i===c.value,h=(0,e.useRef)(d);return(0,e.useEffect)((()=>{const e=requestAnimationFrame((()=>h.current=!1));return()=>cancelAnimationFrame(e)}),[]),(0,e.createElement)(X,{present:a||d},(({present:o})=>(0,e.createElement)(w.div,r({"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!o,id:f,tabIndex:0},l,{ref:n,style:{...t.style,animationDuration:h.current?"0s":void 0}}),o&&s)))}));function ie(e,t){return`${e}-trigger-${t}`}function ae(e,t){return`${e}-content-${t}`}const se=Z,le=ee,ce=ne,ue=oe;var fe="chrome-extension://"+chrome.i18n.getMessage("@@extension_id")+"/assets",de="".concat(fe,"/dropdown.svg"),he="".concat(fe,"/mic-on.svg"),pe="".concat(fe,"/mic-off.svg"),ge="".concat(fe,"/camera-on.svg"),me="".concat(fe,"/camera-off.svg"),ve="".concat(fe,"/check-white.svg"),be=("".concat(fe,"/waveform.svg"),"".concat(fe,"/record-tab-active.svg")),ye="".concat(fe,"/record-tab-inactive.svg"),we="".concat(fe,"/video-tab-active.svg"),xe="".concat(fe,"/video-tab-inactive.svg"),Se="".concat(fe,"/screen-tab-on.svg"),Ee="".concat(fe,"/screen-tab-off.svg"),Ce="".concat(fe,"/region-tab-on.svg"),_e="".concat(fe,"/region-tab-off.svg"),Te=("".concat(fe,"/audio-tab-on.svg"),"".concat(fe,"/audio-tab-off.svg"),"".concat(fe,"/mockup-tab-on.svg")),Oe="".concat(fe,"/mockup-tab-off.svg"),ke="".concat(fe,"/temp-logo.png"),Pe="".concat(fe,"/temp/figma.webp"),je="".concat(fe,"/temp/twitter.webp"),Ae="".concat(fe,"/temp/designsystem.webp"),Me="".concat(fe,"/temp/marketing.webp"),De="".concat(fe,"/temp/substack.webp"),Re="".concat(fe,"/copy-link.svg"),Ie="".concat(fe,"/more-actions.svg"),Fe="".concat(fe,"/pfp.png"),Le="".concat(fe,"/canvas/handle.png"),Ne="".concat(fe,"/canvas/rotate.png"),ze="".concat(fe,"/canvas/middle-handle.png"),Be="".concat(fe,"/canvas/middle-handle-v.png"),We=("".concat(fe,"/cursors/default.svg"),"".concat(fe,"/camera-tab-icon-on.svg")),He="".concat(fe,"/camera-tab-icon-off.svg"),Ue="".concat(fe,"/camera-off-blue.svg"),Xe="".concat(fe,"/mic-off-blue.svg"),Ve=o(1193),Ye=o.n(Ve),Ge=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qe=function(){return qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;nNumber(u)?u:T})}if(E||this.props.lockAspectRatio&&!S&&!C){T=w+(b-g)/r;this.setState({maxWidth:T>Number(u)?u:T})}if((C||S)&&this.resizable){T=(m-y)/r+this.resizable.size.height;this.setState({maxHeight:T>Number(f)?f:T})}if(_||this.props.lockAspectRatio&&!C&&!S){T=x+(y-m)/r;this.setState({maxHeight:T>Number(f)?f:T})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(e,t,n)},n.prototype.onResize=function(e,t,n,r){var o={x:this.originalPosition.x,y:this.originalPosition.y},i=-r.width,a=-r.height;-1!==["top","left","topLeft","bottomLeft","topRight"].indexOf(t)&&("bottomLeft"===t?o.x+=i:("topRight"===t||(o.x+=i),o.y+=a)),o.x===this.draggable.state.x&&o.y===this.draggable.state.y||this.draggable.setState(o),this.updateOffsetFromParent();var s=this.offsetFromParent,l=this.getDraggablePosition().x+s.left,c=this.getDraggablePosition().y+s.top;this.resizingPosition={x:l,y:c},this.props.onResize&&this.props.onResize(e,t,n,r,{x:l,y:c})},n.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var o=this.getMaxSizesFromProps(),i=o.maxWidth,a=o.maxHeight;this.setState({maxWidth:i,maxHeight:a}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},n.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},n.prototype.updatePosition=function(e){this.draggable.setState(e)},n.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||null===n)return{top:0,left:0};var r=t.getBoundingClientRect(),o=r.left,i=r.top,a=n.getBoundingClientRect(),s=this.getDraggablePosition(),l=t.scrollLeft,c=t.scrollTop;this.offsetFromParent={left:a.left-o+l-s.x*e,top:a.top-i+c-s.y*e}},n.prototype.render=function(){var t=this.props,n=t.disableDragging,r=t.style,o=t.dragHandleClassName,i=t.position,a=t.onMouseDown,s=t.onMouseUp,l=t.dragAxis,c=t.dragGrid,u=t.bounds,f=t.enableUserSelectHack,d=t.cancel,h=t.children,p=(t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop,t.resizeHandleStyles),g=t.resizeHandleClasses,m=t.resizeHandleComponent,v=t.enableResizing,b=t.resizeGrid,y=t.resizeHandleWrapperClass,w=t.resizeHandleWrapperStyle,x=t.scale,S=t.allowAnyClick,E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0||(o[n]=e[n]);return o}function wt(e,t){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wt(e,t)}var xt=function(){return xt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&("always"===t||"once"===t&&!It[s])){for(var O=0,k=C.length;O desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=i,e.prepend(n)}if(u){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var o=document.createElement("title");o.innerHTML=u,e.prepend(o)}try{h(e)}catch(e){m(e)}},cacheRequests:f,evalScripts:a,httpRequestWithCredentials:s,renumerateIRIElements:l})}},a.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},a.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},a.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(r({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},a.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},a.render=function(){var t=this.props;t.afterInjection,t.beforeInjection,t.desc,t.evalScripts;var n=t.fallback;t.httpRequestWithCredentials;var o=t.loading;t.renumerateIRIElements,t.src,t.title,t.useRequestCache;var i=t.wrapper,a=yt(t,Bt),s=i;return e.createElement(s,r({},a,{ref:this.refCallback},"svg"===i?{xmlns:Wt,xmlnsXlink:Ht}:{}),this.state.isLoading&&o&&e.createElement(o,null),this.state.hasError&&n&&e.createElement(n,null))},i}(e.Component);Ut.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},Ut.propTypes={afterInjection:Nt.func,beforeInjection:Nt.func,desc:Nt.string,evalScripts:Nt.oneOf(["always","once","never"]),fallback:Nt.oneOfType([Nt.func,Nt.object,Nt.string]),httpRequestWithCredentials:Nt.bool,loading:Nt.oneOfType([Nt.func,Nt.object,Nt.string]),onError:Nt.func,renumerateIRIElements:Nt.bool,src:Nt.string.isRequired,title:Nt.string,useRequestCache:Nt.bool,wrapper:Nt.oneOf(["div","span","svg"])};var Xt="chrome-extension://"+chrome.i18n.getMessage("@@extension_id")+"/assets/",Vt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/grab-icon.svg",width:t.width,height:t.height})},Yt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/stop-icon.svg",width:t.width,height:t.height})},Gt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/draw-icon.svg",width:t.width,height:t.height})},qt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/pause-icon.svg",width:t.width,height:t.height})},Kt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/resume-icon.svg",width:t.width,height:t.height})},$t=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/cursor-icon.svg",width:t.width,height:t.height})},Qt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/mic-icon.svg",width:t.width,height:t.height})},Zt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/restart-icon.svg",width:t.width,height:t.height})},Jt=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/discard-icon.svg",width:t.width,height:t.height})},en=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/eyedropper-icon.svg",width:t.width,height:t.height})},tn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/stroke-1-icon.svg",width:t.width,height:t.height,className:t.className,style:{textAlign:"center",margin:"auto",display:"block",width:"100%",height:"100%"}})},nn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/stroke-2-icon.svg",width:t.width,height:t.height,className:t.className,style:{textAlign:"center",margin:"auto",display:"block",width:"100%",height:"100%"}})},rn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/stroke-3-icon.svg",width:t.width,height:t.height,className:t.className,style:{textAlign:"center",margin:"auto",display:"block",width:"100%",height:"100%"}})},on=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/target-cursor-icon.svg",width:t.width,height:t.height})},an=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/highlight-cursor-icon.svg",width:t.width,height:t.height})},sn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/text-icon.svg",width:t.width,height:t.height})},ln=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/arrow-icon.svg",width:t.width,height:t.height})},cn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/eraser-icon.svg",width:t.width,height:t.height})},un=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/undo-icon.svg",width:t.width,height:t.height})},fn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/redo-icon.svg",width:t.width,height:t.height})},dn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/image-icon.svg",width:t.width,height:t.height})},hn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/transform-icon.svg",width:t.width,height:t.height})},pn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/highlighter-icon.svg",width:t.width,height:t.height})},gn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/rectangle-icon.svg",width:t.width,height:t.height})},mn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/circle-icon.svg",width:t.width,height:t.height})},vn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/triangle-icon.svg",width:t.width,height:t.height})},bn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/rectangle-filled-icon.svg",width:t.width,height:t.height})},yn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/circle-filled-icon.svg",width:t.width,height:t.height})},wn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/triangle-filled-icon.svg",width:t.width,height:t.height})},xn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/trash-icon.svg",width:t.width,height:t.height})},Sn=function(t){return e.createElement(Ut,{src:Xt+"camera-icons/close.svg",width:t.width,height:t.height})},En=function(t){return e.createElement(Ut,{src:Xt+"camera-icons/camera-resize.svg",width:t.width,height:t.height})},Cn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/camera-icon.svg",width:t.width,height:t.height})},_n=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/blur-icon.svg",width:t.width,height:t.height})},Tn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/alert-icon.svg",width:t.width,height:t.height})},On=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/time-icon.svg",width:t.width,height:t.height})},kn=function(t){return e.createElement(Ut,{src:Xt+"tool-icons/spotlight-cursor-icon.svg",width:t.width,height:t.height})},Pn=function(t){return e.createElement(Ut,{src:Xt+"camera-icons/pip.svg",width:t.width,height:t.height})},jn=function(t){return e.createElement(Ut,{src:Xt+"close-icon-popup.svg",width:t.width,height:t.height})},An=function(t){return e.createElement(Ut,{src:Xt+"more-icon-popup.svg",width:t.width,height:t.height})},Mn=function(t){return e.createElement(Ut,{src:Xt+"/helper/onboarding-arrow.svg",width:t.width,height:t.height})},Dn=function(t){return e.createElement(Ut,{src:Xt+"/tool-icons/close-button.svg",width:t.width,height:t.height})},Rn=function(t){return e.createElement(Ut,{src:Xt+"/tool-icons/help-icon.svg",width:t.width,height:t.height})};function In(e,[t,n]){return Math.min(n,Math.max(t,e))}function Fn(t,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=S(t);(0,e.useEffect)((()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e),()=>n.removeEventListener("keydown",e)}),[r,n])}const Ln="dismissableLayer.update",Nn="dismissableLayer.pointerDownOutside",zn="dismissableLayer.focusOutside";let Bn;const Wn=(0,e.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hn=(0,e.forwardRef)(((t,n)=>{var o;const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:d,...h}=t,p=(0,e.useContext)(Wn),[g,m]=(0,e.useState)(null),v=null!==(o=null==g?void 0:g.ownerDocument)&&void 0!==o?o:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,b]=(0,e.useState)({}),y=c(n,(e=>m(e))),x=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(E),_=g?x.indexOf(g):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,O=_>=C,k=function(t,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=S(t),o=(0,e.useRef)(!1),i=(0,e.useRef)((()=>{}));return(0,e.useEffect)((()=>{const e=e=>{if(e.target&&!o.current){const t={originalEvent:e};function a(){Xn(Nn,r,t,{discrete:!0})}"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=a,n.addEventListener("click",i.current,{once:!0})):a()}o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...p.branches].some((e=>e.contains(t)));O&&!n&&(null==l||l(e),null==f||f(e),e.defaultPrevented||null==d||d())}),v),P=function(t,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=S(t),o=(0,e.useRef)(!1);return(0,e.useEffect)((()=>{const e=e=>{if(e.target&&!o.current){Xn(zn,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...p.branches].some((e=>e.contains(t)))||(null==u||u(e),null==f||f(e),e.defaultPrevented||null==d||d())}),v);return Fn((e=>{_===p.layers.size-1&&(null==s||s(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))}),v),(0,e.useEffect)((()=>{if(g)return a&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(Bn=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),Un(),()=>{a&&1===p.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=Bn)}}),[g,v,a,p]),(0,e.useEffect)((()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),Un())}),[g,p]),(0,e.useEffect)((()=>{const e=()=>b({});return document.addEventListener(Ln,e),()=>document.removeEventListener(Ln,e)}),[]),(0,e.createElement)(w.div,r({},h,{ref:y,style:{pointerEvents:T?O?"auto":"none":void 0,...t.style},onFocusCapture:i(t.onFocusCapture,P.onFocusCapture),onBlurCapture:i(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:i(t.onPointerDownCapture,k.onPointerDownCapture)}))}));function Un(){const e=new CustomEvent(Ln);document.dispatchEvent(e)}function Xn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?x(o,i):o.dispatchEvent(i)}let Vn=0;function Yn(){(0,e.useEffect)((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Gn()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Gn()),Vn++,()=>{1===Vn&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Vn--}}),[])}function Gn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const qn="focusScope.autoFocusOnMount",Kn="focusScope.autoFocusOnUnmount",$n={bubbles:!1,cancelable:!0},Qn=(0,e.forwardRef)(((t,n)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=t,[u,f]=(0,e.useState)(null),d=S(a),h=S(s),p=(0,e.useRef)(null),g=c(n,(e=>f(e))),m=(0,e.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,e.useEffect)((()=>{if(i){function e(e){if(m.paused||!u)return;const t=e.target;u.contains(t)?p.current=t:tr(p.current,{select:!0})}function t(e){if(m.paused||!u)return;const t=e.relatedTarget;null!==t&&(u.contains(t)||tr(p.current,{select:!0}))}function n(e){const t=document.activeElement;for(const n of e)n.removedNodes.length>0&&(null!=u&&u.contains(t)||tr(u))}document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[i,u,m.paused]),(0,e.useEffect)((()=>{if(u){nr.add(m);const t=document.activeElement;if(!u.contains(t)){const n=new CustomEvent(qn,$n);u.addEventListener(qn,d),u.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tr(r,{select:t}),document.activeElement!==n)return}((e=Zn(u),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&tr(u))}return()=>{u.removeEventListener(qn,d),setTimeout((()=>{const e=new CustomEvent(Kn,$n);u.addEventListener(Kn,h),u.dispatchEvent(e),e.defaultPrevented||tr(null!=t?t:document.body,{select:!0}),u.removeEventListener(Kn,h),nr.remove(m)}),0)}}var e}),[u,d,h,m]);const v=(0,e.useCallback)((e=>{if(!o&&!i)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Zn(e),n=Jn(t,e),r=Jn(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&tr(i,{select:!0})):(e.preventDefault(),o&&tr(r,{select:!0})):n===t&&e.preventDefault()}}),[o,i,m.paused]);return(0,e.createElement)(w.div,r({tabIndex:-1},l,{ref:g,onKeyDown:v}))}));function Zn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jn(e,t){for(const n of e)if(!er(n,{upTo:t}))return n}function er(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function tr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const nr=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=rr(e,t),e.unshift(t)},remove(t){var n;e=rr(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function rr(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const or=["top","right","bottom","left"],ir=Math.min,ar=Math.max,sr=Math.round,lr=Math.floor,cr=e=>({x:e,y:e}),ur={left:"right",right:"left",bottom:"top",top:"bottom"},fr={start:"end",end:"start"};function dr(e,t,n){return ar(e,ir(t,n))}function hr(e,t){return"function"==typeof e?e(t):e}function pr(e){return e.split("-")[0]}function gr(e){return e.split("-")[1]}function mr(e){return"x"===e?"y":"x"}function vr(e){return"y"===e?"height":"width"}function br(e){return["top","bottom"].includes(pr(e))?"y":"x"}function yr(e){return mr(br(e))}function wr(e){return e.replace(/start|end/g,(e=>fr[e]))}function xr(e){return e.replace(/left|right|bottom|top/g,(e=>ur[e]))}function Sr(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Er(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Cr(e,t,n){let{reference:r,floating:o}=e;const i=br(t),a=yr(t),s=vr(a),l=pr(t),c="y"===i,u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(gr(t)){case"start":h[a]-=d*(n&&c?-1:1);break;case"end":h[a]+=d*(n&&c?-1:1)}return h}async function _r(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=hr(t,e),p=Sr(h),g=s[d?"floating"===f?"reference":"floating":f],m=Er(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===f?{...a.floating,x:r,y:o}:a.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=Er(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:l}):v);return{top:(m.top-w.top+p.top)/y.y,bottom:(w.bottom-m.bottom+p.bottom)/y.y,left:(m.left-w.left+p.left)/y.x,right:(w.right-m.right+p.right)/y.x}}const Tr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=hr(e,t)||{};if(null==c)return{};const f=Sr(u),d={x:n,y:r},h=yr(o),p=vr(h),g=await a.getDimensions(c),m="y"===h,v=m?"top":"left",b=m?"bottom":"right",y=m?"clientHeight":"clientWidth",w=i.reference[p]+i.reference[h]-d[h]-i.floating[p],x=d[h]-i.reference[h],S=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let E=S?S[y]:0;E&&await(null==a.isElement?void 0:a.isElement(S))||(E=s.floating[y]||i.floating[p]);const C=w/2-x/2,_=E/2-g[p]/2-1,T=ir(f[v],_),O=ir(f[b],_),k=T,P=E-g[p]-O,j=E/2-g[p]/2+C,A=dr(k,j,P),M=!l.arrow&&null!=gr(o)&&j!=A&&i.reference[p]/2-(je+"-"+o)),t&&(i=i.concat(i.map(wr)))),i}(s,g,p,y));const x=[s,...w],S=await _r(t,m),E=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(S[v]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=gr(e),o=yr(e),i=vr(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=xr(a)),[a,xr(a)]}(o,a,y);E.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:o,overflows:E}],!E.every((e=>e<=0))){var _,T;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(T=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}};function kr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pr(e){return or.some((t=>e[t]>=0))}const jr=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hr(e,t);switch(r){case"referenceHidden":{const e=kr(await _r(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pr(e)}}}case"escaped":{const e=kr(await _r(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pr(e)}}}default:return{}}}}};const Ar=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=pr(n),s=gr(n),l="y"===br(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,f=hr(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},Mr=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=hr(e,t),c={x:n,y:r},u=await _r(t,l),f=br(pr(o)),d=mr(f);let h=c[d],p=c[f];if(i){const e="y"===d?"bottom":"right";h=dr(h+u["y"===d?"top":"left"],h,h-u[e])}if(a){const e="y"===f?"bottom":"right";p=dr(p+u["y"===f?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:h,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},Dr=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=hr(e,t),u={x:n,y:r},f=br(o),d=mr(f);let h=u[d],p=u[f];const g=hr(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;hn&&(h=n)}if(c){var v,b;const e="y"===d?"width":"height",t=["top","left"].includes(pr(o)),n=i.reference[f]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[f])||0)+(t?0:m.crossAxis),r=i.reference[f]+i.reference[e]+(t?0:(null==(b=a.offset)?void 0:b[f])||0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}},Rr=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=(()=>{}),...s}=hr(e,t),l=await _r(t,s),c=pr(n),u=gr(n),f="y"===br(n),{width:d,height:h}=r.floating;let p,g;"top"===c||"bottom"===c?(p=c,g=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,p="end"===u?"top":"bottom");const m=h-l[p],v=d-l[g],b=!t.middlewareData.shift;let y=m,w=v;if(f){const e=d-l.left-l.right;w=u||b?ir(v,e):e}else{const e=h-l.top-l.bottom;y=u||b?ir(m,e):e}if(b&&!u){const e=ar(l.left,0),t=ar(l.right,0),n=ar(l.top,0),r=ar(l.bottom,0);f?w=d-2*(0!==e||0!==t?e+t:ar(l.left,l.right)):y=h-2*(0!==n||0!==r?n+r:ar(l.top,l.bottom))}await a({...t,availableWidth:w,availableHeight:y});const x=await o.getDimensions(i.floating);return d!==x.width||h!==x.height?{reset:{rects:!0}}:{}}}};function Ir(e){return Nr(e)?(e.nodeName||"").toLowerCase():"#document"}function Fr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Lr(e){var t;return null==(t=(Nr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Nr(e){return e instanceof Node||e instanceof Fr(e).Node}function zr(e){return e instanceof Element||e instanceof Fr(e).Element}function Br(e){return e instanceof HTMLElement||e instanceof Fr(e).HTMLElement}function Wr(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Fr(e).ShadowRoot)}function Hr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ur(e){return["table","td","th"].includes(Ir(e))}function Xr(e){const t=Vr(),n=Gr(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Vr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Yr(e){return["html","body","#document"].includes(Ir(e))}function Gr(e){return Fr(e).getComputedStyle(e)}function qr(e){return zr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Kr(e){if("html"===Ir(e))return e;const t=e.assignedSlot||e.parentNode||Wr(e)&&e.host||Lr(e);return Wr(t)?t.host:t}function $r(e){const t=Kr(e);return Yr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Br(t)&&Hr(t)?t:$r(t)}function Qr(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=$r(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Fr(o);return i?t.concat(a,a.visualViewport||[],Hr(o)?o:[],a.frameElement&&n?Qr(a.frameElement):[]):t.concat(o,Qr(o,[],n))}function Zr(e){const t=Gr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Br(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=sr(n)!==i||sr(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Jr(e){return zr(e)?e:e.contextElement}function eo(e){const t=Jr(e);if(!Br(t))return cr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zr(t);let a=(i?sr(n.width):n.width)/r,s=(i?sr(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const to=cr(0);function no(e){const t=Fr(e);return Vr()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:to}function ro(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Jr(e);let a=cr(1);t&&(r?zr(r)&&(a=eo(r)):a=eo(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Fr(e))&&t}(i,n,r)?no(i):cr(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const e=Fr(i),t=r&&zr(r)?Fr(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=eo(n),t=n.getBoundingClientRect(),r=Gr(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,f*=e.y,l+=o,c+=i,n=Fr(n).frameElement}}return Er({width:u,height:f,x:l,y:c})}function oo(e){return ro(Lr(e)).left+qr(e).scrollLeft}function io(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Fr(e),r=Lr(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Vr();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Lr(e),n=qr(e),r=e.ownerDocument.body,o=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+oo(e);const s=-n.scrollTop;return"rtl"===Gr(r).direction&&(a+=ar(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Lr(e));else if(zr(t))r=function(e,t){const n=ro(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Br(e)?eo(e):cr(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=no(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Er(r)}function ao(e,t){const n=Kr(e);return!(n===t||!zr(n)||Yr(n))&&("fixed"===Gr(n).position||ao(n,t))}function so(e,t,n){const r=Br(t),o=Lr(t),i="fixed"===n,a=ro(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=cr(0);if(r||!r&&!i)if(("body"!==Ir(t)||Hr(o))&&(s=qr(t)),r){const e=ro(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=oo(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function lo(e,t){return Br(e)&&"fixed"!==Gr(e).position?t?t(e):e.offsetParent:null}function co(e,t){const n=Fr(e);if(!Br(e))return n;let r=lo(e,t);for(;r&&Ur(r)&&"static"===Gr(r).position;)r=lo(r,t);return r&&("html"===Ir(r)||"body"===Ir(r)&&"static"===Gr(r).position&&!Xr(r))?n:r||function(e){let t=Kr(e);for(;Br(t)&&!Yr(t);){if(Xr(t))return t;t=Kr(t)}return null}(e)||n}const uo={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Br(n),i=Lr(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s=cr(1);const l=cr(0);if((o||!o&&"fixed"!==r)&&(("body"!==Ir(n)||Hr(i))&&(a=qr(n)),Br(n))){const e=ro(n);s=eo(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Lr,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=Qr(e,[],!1).filter((e=>zr(e)&&"body"!==Ir(e))),o=null;const i="fixed"===Gr(e).position;let a=i?Kr(e):e;for(;zr(a)&&!Yr(a);){const t=Gr(a),n=Xr(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Hr(a)&&!n&&ao(e,a))?r=r.filter((e=>e!==a)):o=t,a=Kr(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=io(t,n,o);return e.top=ar(r.top,e.top),e.right=ir(r.right,e.right),e.bottom=ir(r.bottom,e.bottom),e.left=ar(r.left,e.left),e}),io(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:co,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||co,i=this.getDimensions;return{reference:so(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return Zr(e)},getScale:eo,isElement:zr,isRTL:function(e){return"rtl"===Gr(e).direction}};function fo(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Jr(e),u=o||i?[...c?Qr(c):[],...Qr(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&s?function(e,t){let n,r=null;const o=Lr(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const h={rootMargin:-lr(u)+"px "+-lr(o.clientWidth-(c+f))+"px "+-lr(o.clientHeight-(u+d))+"px "+-lr(c)+"px",threshold:ar(0,ir(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}p=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let d,h=-1,p=null;a&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{p&&p.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let g=l?ro(e):null;return l&&function t(){const r=ro(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(d)}}const ho=(e,t,n)=>{const r=new Map,o={platform:uo,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Cr(c,r,l),d=r,h={},p=0;for(let n=0;n({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Tr({element:n.current,padding:r}).fn(t):{}:n?Tr({element:n,padding:r}).fn(t):{};var o}});var go="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function mo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!mo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!mo(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function vo(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bo(e,t){const n=vo(e);return Math.round(t*n)/n}function yo(t){const n=e.useRef(t);return go((()=>{n.current=t})),n}function wo(t){void 0===t&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:f}=t,[d,h]=e.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[p,g]=e.useState(i);mo(p,i)||g(i);const[m,v]=e.useState(null),[b,y]=e.useState(null),w=e.useCallback((e=>{e!=C.current&&(C.current=e,v(e))}),[v]),x=e.useCallback((e=>{e!==_.current&&(_.current=e,y(e))}),[y]),S=s||m,E=l||b,C=e.useRef(null),_=e.useRef(null),T=e.useRef(d),O=yo(u),k=yo(a),P=e.useCallback((()=>{if(!C.current||!_.current)return;const e={placement:r,strategy:o,middleware:p};k.current&&(e.platform=k.current),ho(C.current,_.current,e).then((e=>{const t={...e,isPositioned:!0};j.current&&!mo(T.current,t)&&(T.current=t,n.flushSync((()=>{h(t)})))}))}),[p,r,o,k]);go((()=>{!1===f&&T.current.isPositioned&&(T.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[f]);const j=e.useRef(!1);go((()=>(j.current=!0,()=>{j.current=!1})),[]),go((()=>{if(S&&(C.current=S),E&&(_.current=E),S&&E){if(O.current)return O.current(S,E,P);P()}}),[S,E,P,O]);const A=e.useMemo((()=>({reference:C,floating:_,setReference:w,setFloating:x})),[w,x]),M=e.useMemo((()=>({reference:S,floating:E})),[S,E]),D=e.useMemo((()=>{const e={position:o,left:0,top:0};if(!M.floating)return e;const t=bo(M.floating,d.x),n=bo(M.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...vo(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,c,M.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:P,refs:A,elements:M,floatingStyles:D})),[d,P,A,M,D])}function xo(t){const[n,r]=(0,e.useState)(void 0);return m((()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})}));return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)}),[t]),n}const So="Popper",[Eo,Co]=a(So),[_o,To]=Eo(So),Oo=t=>{const{__scopePopper:n,children:r}=t,[o,i]=(0,e.useState)(null);return(0,e.createElement)(_o,{scope:n,anchor:o,onAnchorChange:i},r)},ko="PopperAnchor",Po=(0,e.forwardRef)(((t,n)=>{const{__scopePopper:o,virtualRef:i,...a}=t,s=To(ko,o),l=(0,e.useRef)(null),u=c(n,l);return(0,e.useEffect)((()=>{s.onAnchorChange((null==i?void 0:i.current)||l.current)})),i?null:(0,e.createElement)(w.div,r({},a,{ref:u}))})),jo="PopperContent",[Ao,Mo]=Eo(jo),Do=(0,e.forwardRef)(((t,n)=>{var o,i,a,s,l,u,f,d;const{__scopePopper:h,side:p="bottom",sideOffset:g=0,align:v="center",alignOffset:b=0,arrowPadding:y=0,collisionBoundary:x=[],collisionPadding:E=0,sticky:C="partial",hideWhenDetached:_=!1,avoidCollisions:T=!0,onPlaced:O,...k}=t,P=To(jo,h),[j,A]=(0,e.useState)(null),M=c(n,(e=>A(e))),[D,R]=(0,e.useState)(null),I=xo(D),F=null!==(o=null==I?void 0:I.width)&&void 0!==o?o:0,L=null!==(i=null==I?void 0:I.height)&&void 0!==i?i:0,N=p+("center"!==v?"-"+v:""),z="number"==typeof E?E:{top:0,right:0,bottom:0,left:0,...E},B=Array.isArray(x)?x:[x],W=B.length>0,H={padding:z,boundary:B.filter(Ro),altBoundary:W},{refs:U,floatingStyles:X,placement:V,isPositioned:Y,middlewareData:G}=wo({strategy:"fixed",placement:N,whileElementsMounted:fo,elements:{reference:P.anchor},middleware:[Ar({mainAxis:g+L,alignmentAxis:b}),T&&Mr({mainAxis:!0,crossAxis:!1,limiter:"partial"===C?Dr():void 0,...H}),T&&Or({...H}),Rr({...H,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),D&&po({element:D,padding:y}),Io({arrowWidth:F,arrowHeight:L}),_&&jr({strategy:"referenceHidden"})]}),[q,K]=Fo(V),$=S(O);m((()=>{Y&&(null==$||$())}),[Y,$]);const Q=null===(a=G.arrow)||void 0===a?void 0:a.x,Z=null===(s=G.arrow)||void 0===s?void 0:s.y,J=0!==(null===(l=G.arrow)||void 0===l?void 0:l.centerOffset),[ee,te]=(0,e.useState)();return m((()=>{j&&te(window.getComputedStyle(j).zIndex)}),[j]),(0,e.createElement)("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:Y?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[null===(u=G.transformOrigin)||void 0===u?void 0:u.x,null===(f=G.transformOrigin)||void 0===f?void 0:f.y].join(" ")},dir:t.dir},(0,e.createElement)(Ao,{scope:h,placedSide:q,onArrowChange:R,arrowX:Q,arrowY:Z,shouldHideArrow:J},(0,e.createElement)(w.div,r({"data-side":q,"data-align":K},k,{ref:M,style:{...k.style,animation:Y?void 0:"none",opacity:null!==(d=G.hide)&&void 0!==d&&d.referenceHidden?0:void 0}}))))}));function Ro(e){return null!==e}const Io=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[h,p]=Fo(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+f/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+d/2;let b="",y="";return"bottom"===h?(b=u?g:`${m}px`,y=-d+"px"):"top"===h?(b=u?g:`${m}px`,y=`${l.floating.height+d}px`):"right"===h?(b=-d+"px",y=u?g:`${v}px`):"left"===h&&(b=`${l.floating.width+d}px`,y=u?g:`${v}px`),{data:{x:b,y}}}});function Fo(e){const[t,n="center"]=e.split("-");return[t,n]}const Lo=Oo,No=Po,zo=Do,Bo=(0,e.forwardRef)(((t,o)=>{var i;const{container:a=(null===globalThis||void 0===globalThis||null===(i=globalThis.document)||void 0===i?void 0:i.body),...s}=t;return a?n.createPortal((0,e.createElement)(w.div,r({},s,{ref:o})),a):null}));function Wo(t){const n=(0,e.useRef)({value:t,previous:t});return(0,e.useMemo)((()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous)),[t])}const Ho=(0,e.forwardRef)(((t,n)=>(0,e.createElement)(w.span,r({},t,{ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}})))),Uo=Ho;var Xo=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Vo=new WeakMap,Yo=new WeakMap,Go={},qo=0,Ko=function(e){return e&&(e.host||Ko(e.parentNode))},$o=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Ko(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Go[n]||(Go[n]=new WeakMap);var i=Go[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(s.has(e))u(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(Vo.get(e)||0)+1,c=(i.get(e)||0)+1;Vo.set(e,l),i.set(e,c),a.push(e),1===l&&o&&Yo.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return u(t),s.clear(),qo++,function(){a.forEach((function(e){var t=Vo.get(e)-1,o=i.get(e)-1;Vo.set(e,t),i.set(e,o),t||(Yo.has(e)||e.removeAttribute(r),Yo.delete(e)),o||e.removeAttribute(n)})),--qo||(Vo=new WeakMap,Vo=new WeakMap,Yo=new WeakMap,Go={})}},Qo=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Xo(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),$o(r,o,n,"aria-hidden")):function(){return null}},Zo="right-scroll-bar-position",Jo="width-before-scroll-bar";function ei(t,n){return r=n||null,o=function(e){return t.forEach((function(t){return function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}(t,e)}))},(i=(0,e.useState)((function(){return{value:r,callback:o,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}}))[0]).callback=o,i.facade;var r,o,i}function ti(e){return e}function ni(e,t){void 0===t&&(t=ti);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}var ri=function(e){void 0===e&&(e={});var t=ni(null);return t.options=xt({async:!0,ssr:!1},e),t}(),oi=function(){},ii=e.forwardRef((function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:oi,onWheelCapture:oi,onTouchMoveCapture:oi}),i=o[0],a=o[1],s=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,d=t.shards,h=t.sideCar,p=t.noIsolation,g=t.inert,m=t.allowPinchZoom,v=t.as,b=void 0===v?"div":v,y=St(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=h,x=ei([r,n]),S=xt(xt({},y),i);return e.createElement(e.Fragment,null,f&&e.createElement(w,{sideCar:ri,removeScrollBar:u,shards:d,noIsolation:p,inert:g,setCallbacks:a,allowPinchZoom:!!m,lockRef:r}),s?e.cloneElement(e.Children.only(l),xt(xt({},S),{ref:x})):e.createElement(b,xt({},S,{className:c,ref:x}),l))}));ii.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ii.classNames={fullWidth:Jo,zeroRight:Zo};var ai,si=function(t){var n=t.sideCar,r=St(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,xt({},r))};si.isSideCarExport=!0;function li(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ai||o.nc;return t&&e.setAttribute("nonce",t),e}var ci=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=li())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ui=function(){var t,n=(t=ci(),function(n,r){e.useEffect((function(){return t.add(n),function(){t.remove()}}),[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},fi={left:0,top:0,right:0,gap:0},di=function(e){return parseInt(e||"",10)||0},hi=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return fi;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[di(n),di(r),di(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},pi=ui(),gi=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Zo," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Jo," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Zo," .").concat(Zo," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Jo," .").concat(Jo," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},mi=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o,a=e.useMemo((function(){return hi(i)}),[i]);return e.createElement(pi,{styles:gi(a,!n,i,r?"":"!important")})},vi=!1;if("undefined"!=typeof window)try{var bi=Object.defineProperty({},"passive",{get:function(){return vi=!0,!0}});window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch(e){vi=!1}var yi=!!vi&&{passive:!1},wi=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},xi=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Si(e,n)){var r=Ei(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Si=function(e,t){return"v"===e?function(e){return wi(e,"overflowY")}(t):function(e){return wi(e,"overflowX")}(t)},Ei=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Ci=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_i=function(e){return[e.deltaX,e.deltaY]},Ti=function(e){return e&&"current"in e?e.current:e},Oi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},ki=0,Pi=[];const ji=(Ai=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(ki++)[0],a=e.useState((function(){return ui()}))[0],s=e.useRef(t);e.useEffect((function(){s.current=t}),[t]),e.useEffect((function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var e=Et([t.lockRef.current],(t.shards||[]).map(Ti),!0).filter(Boolean);return e.forEach((function(e){return e.classList.add("allow-interactivity-".concat(i))})),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(i))}))}}}),[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!s.current.allowPinchZoom;var n,i=Ci(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,f=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===f&&"range"===u.type)return!1;var d=xi(f,u);if(!d)return!0;if(d?n=f:(n="v"===f?"h":"v",d=xi(f,u)),!d)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var h=o.current||n;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,f=0,d=0;do{var h=Ei(e,s),p=h[0],g=h[1]-h[2]-i*p;(p||g)&&Si(e,s)&&(f+=g,d+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&0===f||!o&&a>f)||!u&&(o&&0===d||!o&&-a>d))&&(c=!0),c}(h,t,e,"h"===h?l:c,!0)}),[]),c=e.useCallback((function(e){var t=e;if(Pi.length&&Pi[Pi.length-1]===a){var r="deltaY"in t?_i(t):Ci(t),o=n.current.filter((function(e){return e.name===t.type&&e.target===t.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Ti).filter(Boolean).filter((function(e){return e.contains(t.target)}));(i.length>0?l(t,i[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),u=e.useCallback((function(e,t,r,o){var i={name:e,delta:t,target:r,should:o};n.current.push(i),setTimeout((function(){n.current=n.current.filter((function(e){return e!==i}))}),1)}),[]),f=e.useCallback((function(e){r.current=Ci(e),o.current=void 0}),[]),d=e.useCallback((function(e){u(e.type,_i(e),e.target,l(e,t.lockRef.current))}),[]),h=e.useCallback((function(e){u(e.type,Ci(e),e.target,l(e,t.lockRef.current))}),[]);e.useEffect((function(){return Pi.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,yi),document.addEventListener("touchmove",c,yi),document.addEventListener("touchstart",f,yi),function(){Pi=Pi.filter((function(e){return e!==a})),document.removeEventListener("wheel",c,yi),document.removeEventListener("touchmove",c,yi),document.removeEventListener("touchstart",f,yi)}}),[]);var p=t.removeScrollBar,g=t.inert;return e.createElement(e.Fragment,null,g?e.createElement(a,{styles:Oi(i)}):null,p?e.createElement(mi,{gapMode:"margin"}):null)},ri.useMedium(Ai),si);var Ai,Mi=e.forwardRef((function(t,n){return e.createElement(ii,xt({},t,{ref:n,sideCar:ji}))}));Mi.classNames=ii.classNames;const Di=Mi,Ri=[" ","Enter","ArrowUp","ArrowDown"],Ii=[" ","Enter"],Fi="Select",[Li,Ni,zi]=g(Fi),[Bi,Wi]=a(Fi,[zi,Co]),Hi=Co(),[Ui,Xi]=Bi(Fi),[Vi,Yi]=Bi(Fi),Gi=t=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:i,onOpenChange:a,value:s,defaultValue:l,onValueChange:c,dir:u,name:f,autoComplete:d,disabled:h,required:p}=t,g=Hi(n),[m,v]=(0,e.useState)(null),[b,w]=(0,e.useState)(null),[x,S]=(0,e.useState)(!1),C=_(u),[T=!1,O]=E({prop:o,defaultProp:i,onChange:a}),[k,P]=E({prop:s,defaultProp:l,onChange:c}),j=(0,e.useRef)(null),A=!m||Boolean(m.closest("form")),[M,D]=(0,e.useState)(new Set),R=Array.from(M).map((e=>e.props.value)).join(";");return(0,e.createElement)(Lo,g,(0,e.createElement)(Ui,{required:p,scope:n,trigger:m,onTriggerChange:v,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:y(),value:k,onValueChange:P,open:T,onOpenChange:O,dir:C,triggerPointerDownPosRef:j,disabled:h},(0,e.createElement)(Li.Provider,{scope:n},(0,e.createElement)(Vi,{scope:t.__scopeSelect,onNativeOptionAdd:(0,e.useCallback)((e=>{D((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:(0,e.useCallback)((e=>{D((t=>{const n=new Set(t);return n.delete(e),n}))}),[])},r)),A?(0,e.createElement)(ja,{key:R,"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:k,onChange:e=>P(e.target.value),disabled:h},void 0===k?(0,e.createElement)("option",{value:""}):null,Array.from(M)):null))},qi="SelectTrigger",Ki=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,disabled:a=!1,...s}=t,l=Hi(o),u=Xi(qi,o),f=u.disabled||a,d=c(n,u.onTriggerChange),h=Ni(o),[p,g,m]=Aa((e=>{const t=h().filter((e=>!e.disabled)),n=t.find((e=>e.value===u.value)),r=Ma(t,e,n);void 0!==r&&u.onValueChange(r.value)})),v=()=>{f||(u.onOpenChange(!0),m())};return(0,e.createElement)(No,r({asChild:!0},l),(0,e.createElement)(w.button,r({type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":void 0===u.value?"":void 0},s,{ref:d,onClick:i(s.onClick,(e=>{e.currentTarget.focus()})),onPointerDown:i(s.onPointerDown,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&(v(),u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)},e.preventDefault())})),onKeyDown:i(s.onKeyDown,(e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),t&&" "===e.key||Ri.includes(e.key)&&(v(),e.preventDefault())}))})))})),$i="SelectValue",Qi=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,className:i,style:a,children:s,placeholder:l,...u}=t,f=Xi($i,o),{onValueNodeHasChildrenChange:d}=f,h=void 0!==s,p=c(n,f.onValueNodeChange);return m((()=>{d(h)}),[d,h]),(0,e.createElement)(w.span,r({},u,{ref:p,style:{pointerEvents:"none"}}),void 0===f.value&&void 0!==l?l:s)})),Zi=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,children:i,...a}=t;return(0,e.createElement)(w.span,r({"aria-hidden":!0},a,{ref:n}),i||"▼")})),Ji=t=>(0,e.createElement)(Bo,r({asChild:!0},t)),ea="SelectContent",ta=(0,e.forwardRef)(((t,o)=>{const i=Xi(ea,t.__scopeSelect),[a,s]=(0,e.useState)();if(m((()=>{s(new DocumentFragment)}),[]),!i.open){const r=a;return r?(0,n.createPortal)((0,e.createElement)(ra,{scope:t.__scopeSelect},(0,e.createElement)(Li.Slot,{scope:t.__scopeSelect},(0,e.createElement)("div",null,t.children))),r):null}return(0,e.createElement)(ia,r({},t,{ref:o}))})),na=10,[ra,oa]=Bi(ea),ia=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:f,side:d,sideOffset:h,align:p,alignOffset:g,arrowPadding:m,collisionBoundary:v,collisionPadding:b,sticky:y,hideWhenDetached:w,avoidCollisions:x,...S}=t,E=Xi(ea,o),[C,_]=(0,e.useState)(null),[T,O]=(0,e.useState)(null),k=c(n,(e=>_(e))),[P,j]=(0,e.useState)(null),[A,M]=(0,e.useState)(null),D=Ni(o),[R,I]=(0,e.useState)(!1),F=(0,e.useRef)(!1);(0,e.useEffect)((()=>{if(C)return Qo(C)}),[C]),Yn();const L=(0,e.useCallback)((e=>{const[t,...n]=D().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(null==n||n.scrollIntoView({block:"nearest"}),n===t&&T&&(T.scrollTop=0),n===r&&T&&(T.scrollTop=T.scrollHeight),null==n||n.focus(),document.activeElement!==o)return}}),[D,T]),N=(0,e.useCallback)((()=>L([P,C])),[L,P,C]);(0,e.useEffect)((()=>{R&&N()}),[R,N]);const{onOpenChange:z,triggerPointerDownPosRef:B}=E;(0,e.useEffect)((()=>{if(C){let e={x:0,y:0};const t=t=>{var n,r,o,i;e={x:Math.abs(Math.round(t.pageX)-(null!==(n=null===(r=B.current)||void 0===r?void 0:r.x)&&void 0!==n?n:0)),y:Math.abs(Math.round(t.pageY)-(null!==(o=null===(i=B.current)||void 0===i?void 0:i.y)&&void 0!==o?o:0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():C.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),B.current=null};return null!==B.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[C,z,B]),(0,e.useEffect)((()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[z]);const[W,H]=Aa((e=>{const t=D().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=Ma(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),U=(0,e.useCallback)(((e,t,n)=>{const r=!F.current&&!n;(void 0!==E.value&&E.value===t||r)&&(j(e),r&&(F.current=!0))}),[E.value]),X=(0,e.useCallback)((()=>null==C?void 0:C.focus()),[C]),V=(0,e.useCallback)(((e,t,n)=>{const r=!F.current&&!n;(void 0!==E.value&&E.value===t||r)&&M(e)}),[E.value]),Y="popper"===a?sa:aa,G=Y===sa?{side:d,sideOffset:h,align:p,alignOffset:g,arrowPadding:m,collisionBoundary:v,collisionPadding:b,sticky:y,hideWhenDetached:w,avoidCollisions:x}:{};return(0,e.createElement)(ra,{scope:o,content:C,viewport:T,onViewportChange:O,itemRefCallback:U,selectedItem:P,onItemLeave:X,itemTextRefCallback:V,focusSelectedItem:N,selectedItemText:A,position:a,isPositioned:R,searchRef:W},(0,e.createElement)(Di,{as:u,allowPinchZoom:!0},(0,e.createElement)(Qn,{asChild:!0,trapped:E.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:i(s,(e=>{var t;null===(t=E.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}))},(0,e.createElement)(Hn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>E.onOpenChange(!1)},(0,e.createElement)(Y,r({role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:e=>e.preventDefault()},S,G,{onPlaced:()=>I(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:i(S.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||H(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=D().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout((()=>L(t))),e.preventDefault()}}))}))))))})),aa=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,onPlaced:i,...a}=t,s=Xi(ea,o),l=oa(ea,o),[u,f]=(0,e.useState)(null),[d,h]=(0,e.useState)(null),p=c(n,(e=>h(e))),g=Ni(o),v=(0,e.useRef)(!1),b=(0,e.useRef)(!0),{viewport:y,selectedItem:x,selectedItemText:S,focusSelectedItem:E}=l,C=(0,e.useCallback)((()=>{if(s.trigger&&s.valueNode&&u&&d&&y&&x&&S){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=S.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),c=window.innerWidth-na,f=In(i,[na,c-l]);u.style.minWidth=s+"px",u.style.left=f+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),c=window.innerWidth-na,f=In(i,[na,c-l]);u.style.minWidth=s+"px",u.style.right=f+"px"}const o=g(),a=window.innerHeight-2*na,l=y.scrollHeight,c=window.getComputedStyle(d),f=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),p=parseInt(c.borderBottomWidth,10),m=f+h+l+parseInt(c.paddingBottom,10)+p,b=Math.min(5*x.offsetHeight,m),w=window.getComputedStyle(y),E=parseInt(w.paddingTop,10),C=parseInt(w.paddingBottom,10),_=e.top+e.height/2-na,T=a-_,O=x.offsetHeight/2,k=f+h+(x.offsetTop+O),P=m-k;if(k<=_){const e=x===o[o.length-1].ref.current;u.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=k+Math.max(T,O+(e?C:0)+t+p);u.style.height=n+"px"}else{const e=x===o[0].ref.current;u.style.top="0px";const t=Math.max(_,f+y.offsetTop+(e?E:0)+O)+P;u.style.height=t+"px",y.scrollTop=k-_+y.offsetTop}u.style.margin=`${na}px 0`,u.style.minHeight=b+"px",u.style.maxHeight=a+"px",null==i||i(),requestAnimationFrame((()=>v.current=!0))}}),[g,s.trigger,s.valueNode,u,d,y,x,S,s.dir,i]);m((()=>C()),[C]);const[_,T]=(0,e.useState)();m((()=>{d&&T(window.getComputedStyle(d).zIndex)}),[d]);const O=(0,e.useCallback)((e=>{e&&!0===b.current&&(C(),null==E||E(),b.current=!1)}),[C,E]);return(0,e.createElement)(la,{scope:o,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:O},(0,e.createElement)("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_}},(0,e.createElement)(w.div,r({},a,{ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}}))))})),sa=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,align:i="start",collisionPadding:a=na,...s}=t,l=Hi(o);return(0,e.createElement)(zo,r({},l,s,{ref:n,align:i,collisionPadding:a,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))})),[la,ca]=Bi(ea,{}),ua="SelectViewport",fa=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,...a}=t,s=oa(ua,o),l=ca(ua,o),u=c(n,s.onViewportChange),f=(0,e.useRef)(0);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),(0,e.createElement)(Li.Slot,{scope:o},(0,e.createElement)(w.div,r({"data-radix-select-viewport":"",role:"presentation"},a,{ref:u,style:{position:"relative",flex:1,overflow:"auto",...a.style},onScroll:i(a.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(null!=r&&r.current&&n){const e=Math.abs(f.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*na,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a0?s:0,n.style.justifyContent="flex-end")}}}f.current=t.scrollTop}))}))))})),da="SelectGroup",[ha,pa]=Bi(da),ga=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,...i}=t,a=y();return(0,e.createElement)(ha,{scope:o,id:a},(0,e.createElement)(w.div,r({role:"group","aria-labelledby":a},i,{ref:n})))})),ma="SelectItem",[va,ba]=Bi(ma),ya=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,value:a,disabled:s=!1,textValue:l,...u}=t,f=Xi(ma,o),d=oa(ma,o),h=f.value===a,[p,g]=(0,e.useState)(null!=l?l:""),[m,v]=(0,e.useState)(!1),b=c(n,(e=>{var t;return null===(t=d.itemRefCallback)||void 0===t?void 0:t.call(d,e,a,s)})),x=y(),S=()=>{s||(f.onValueChange(a),f.onOpenChange(!1))};return(0,e.createElement)(va,{scope:o,value:a,disabled:s,textId:x,isSelected:h,onItemTextChange:(0,e.useCallback)((e=>{g((t=>{var n;return t||(null!==(n=null==e?void 0:e.textContent)&&void 0!==n?n:"").trim()}))}),[])},(0,e.createElement)(Li.ItemSlot,{scope:o,value:a,disabled:s,textValue:p},(0,e.createElement)(w.div,r({role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":h&&m,"data-state":h?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1},u,{ref:b,onFocus:i(u.onFocus,(()=>v(!0))),onBlur:i(u.onBlur,(()=>v(!1))),onPointerUp:i(u.onPointerUp,S),onPointerMove:i(u.onPointerMove,(e=>{var t;s?null===(t=d.onItemLeave)||void 0===t||t.call(d):e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:i(u.onPointerLeave,(e=>{var t;e.currentTarget===document.activeElement&&(null===(t=d.onItemLeave)||void 0===t||t.call(d))})),onKeyDown:i(u.onKeyDown,(e=>{var t;""!==(null===(t=d.searchRef)||void 0===t?void 0:t.current)&&" "===e.key||(Ii.includes(e.key)&&S()," "===e.key&&e.preventDefault())}))}))))})),wa="SelectItemText",xa=(0,e.forwardRef)(((t,o)=>{const{__scopeSelect:i,className:a,style:s,...l}=t,u=Xi(wa,i),f=oa(wa,i),d=ba(wa,i),h=Yi(wa,i),[p,g]=(0,e.useState)(null),v=c(o,(e=>g(e)),d.onItemTextChange,(e=>{var t;return null===(t=f.itemTextRefCallback)||void 0===t?void 0:t.call(f,e,d.value,d.disabled)})),b=null==p?void 0:p.textContent,y=(0,e.useMemo)((()=>(0,e.createElement)("option",{key:d.value,value:d.value,disabled:d.disabled},b)),[d.disabled,d.value,b]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=h;return m((()=>(x(y),()=>S(y))),[x,S,y]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(w.span,r({id:d.textId},l,{ref:v})),d.isSelected&&u.valueNode&&!u.valueNodeHasChildren?(0,n.createPortal)(l.children,u.valueNode):null)})),Sa="SelectItemIndicator",Ea=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,...i}=t;return ba(Sa,o).isSelected?(0,e.createElement)(w.span,r({"aria-hidden":!0},i,{ref:n})):null})),Ca="SelectScrollUpButton",_a=(0,e.forwardRef)(((t,n)=>{const o=oa(Ca,t.__scopeSelect),i=ca(Ca,t.__scopeSelect),[a,s]=(0,e.useState)(!1),l=c(n,i.onScrollButtonChange);return m((()=>{if(o.viewport&&o.isPositioned){const e=o.viewport;function t(){const t=e.scrollTop>0;s(t)}return t(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}}),[o.viewport,o.isPositioned]),a?(0,e.createElement)(ka,r({},t,{ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}})):null})),Ta="SelectScrollDownButton",Oa=(0,e.forwardRef)(((t,n)=>{const o=oa(Ta,t.__scopeSelect),i=ca(Ta,t.__scopeSelect),[a,s]=(0,e.useState)(!1),l=c(n,i.onScrollButtonChange);return m((()=>{if(o.viewport&&o.isPositioned){const e=o.viewport;function t(){const t=e.scrollHeight-e.clientHeight,n=Math.ceil(e.scrollTop)e.removeEventListener("scroll",t)}}),[o.viewport,o.isPositioned]),a?(0,e.createElement)(ka,r({},t,{ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}})):null})),ka=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,onAutoScroll:a,...s}=t,l=oa("SelectScrollButton",o),c=(0,e.useRef)(null),u=Ni(o),f=(0,e.useCallback)((()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)}),[]);return(0,e.useEffect)((()=>()=>f()),[f]),m((()=>{var e;const t=u().find((e=>e.ref.current===document.activeElement));null==t||null===(e=t.ref.current)||void 0===e||e.scrollIntoView({block:"nearest"})}),[u]),(0,e.createElement)(w.div,r({"aria-hidden":!0},s,{ref:n,style:{flexShrink:0,...s.style},onPointerDown:i(s.onPointerDown,(()=>{null===c.current&&(c.current=window.setInterval(a,50))})),onPointerMove:i(s.onPointerMove,(()=>{var e;null===(e=l.onItemLeave)||void 0===e||e.call(l),null===c.current&&(c.current=window.setInterval(a,50))})),onPointerLeave:i(s.onPointerLeave,(()=>{f()}))}))})),Pa=(0,e.forwardRef)(((t,n)=>{const{__scopeSelect:o,...i}=t;return(0,e.createElement)(w.div,r({"aria-hidden":!0},i,{ref:n}))})),ja=(0,e.forwardRef)(((t,n)=>{const{value:o,...i}=t,a=(0,e.useRef)(null),s=c(n,a),l=Wo(o);return(0,e.useEffect)((()=>{const e=a.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==o&&n){const t=new Event("change",{bubbles:!0});n.call(e,o),e.dispatchEvent(t)}}),[l,o]),(0,e.createElement)(Ho,{asChild:!0},(0,e.createElement)("select",r({},i,{ref:s,defaultValue:o})))}));function Aa(t){const n=S(t),r=(0,e.useRef)(""),o=(0,e.useRef)(0),i=(0,e.useCallback)((e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout((()=>e("")),1e3))}(t)}),[n]),a=(0,e.useCallback)((()=>{r.current="",window.clearTimeout(o.current)}),[]);return(0,e.useEffect)((()=>()=>window.clearTimeout(o.current)),[]),[r,i,a]}function Ma(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(a=e,s=Math.max(o,0),a.map(((e,t)=>a[(s+t)%a.length])));var a,s;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}ja.displayName="BubbleSelect";const Da=Gi,Ra=Ki,Ia=Qi,Fa=Zi,La=Ji,Na=ta,za=fa,Ba=ga,Wa=ya,Ha=xa,Ua=Ea,Xa=_a,Va=Oa,Ya=Pa;var Ga=o(5893);var qa=["shift","alt","meta","mod","ctrl"],Ka={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function $a(e){return(Ka[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}"undefined"!=typeof document&&(document.addEventListener("keydown",(function(e){void 0!==e.key&&Za([$a(e.key),$a(e.code)])})),document.addEventListener("keyup",(function(e){void 0!==e.key&&Ja([$a(e.key),$a(e.code)])}))),"undefined"!=typeof window&&window.addEventListener("blur",(function(){Qa.clear()}));var Qa=new Set;function Za(e){var t=Array.isArray(e)?e:[e];Qa.has("meta")&&Qa.forEach((function(e){return!function(e){return qa.includes(e)}(e)&&Qa.delete(e.toLowerCase())})),t.forEach((function(e){return Qa.add(e.toLowerCase())}))}function Ja(e){var t=Array.isArray(e)?e:[e];"meta"===e?Qa.clear():t.forEach((function(e){return Qa.delete(e.toLowerCase())}))}"undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function es(e){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},es(e)}function ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ns(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function cs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function us(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(_((function(e){return us(us({},e),{},{defaultAudioInput:t[0].deviceId,micActive:!0})})),chrome.storage.local.set({defaultAudioInput:t[0].deviceId,micActive:!0})),n.length>0&&(_((function(e){return us(us({},e),{},{defaultVideoInput:n[0].deviceId,cameraActive:!0})})),chrome.storage.local.set({defaultVideoInput:n[0].deviceId,cameraActive:!0})),(t.length>0||n.length>0)&&(_((function(e){return us(us({},e),{},{setDevices:!0})})),chrome.storage.local.set({setDevices:!0})))}else _((function(e){return us(us({},e),{},{cameraPermission:!1,microphonePermission:!1})})),a.current.askForPermissions&&a.current.openModal(chrome.i18n.getMessage("permissionsModalTitle"),chrome.i18n.getMessage("permissionsModalDescription"),chrome.i18n.getMessage("permissionsModalDismiss"),chrome.i18n.getMessage("permissionsModalNoShowAgain"),(function(){}),(function(){S()}),chrome.runtime.getURL("assets/helper/permissions.webp"),chrome.i18n.getMessage("learnMoreDot"),f,!0,!1)}(e.data):"screenity-permissions-loaded"===e.data.type&&_((function(e){return us(us({},e),{},{permissionsLoaded:!0})}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}}),[]);var E=ds((0,e.useState)((fs(fs(fs(fs(fs(fs(fs(fs(fs(fs(n={color:"#4597F7",strokeWidth:2,drawingMode:!1,tool:"pen",undoStack:[],redoStack:[],canvas:null,swatch:1,time:0,timer:0,recording:!1,startRecording:h,restartRecording:p,stopRecording:g,pauseRecording:m,resumeRecording:v,dismissRecording:b,startStreaming:y,openModal:null,openToast:null,audioInput:[],videoInput:[],setDevices:!1,defaultAudioInput:"none",defaultVideoInput:"none",cameraActive:!1,micActive:!1,paused:!1,toolbarPosition:{left:!0,right:!1,bottom:!0,top:!1,offsetX:0,offsetY:100},popupPosition:{left:!1,right:!0,top:!0,bottom:!1,offsetX:0,offsetY:0,fixed:!0},cameraDimensions:{size:200,x:100,y:100},cameraFlipped:!1,backgroundEffect:"blur",backgroundEffectsActive:!1,countdown:!0,showExtension:!1,showPopup:!1,blurMode:!1,recordingType:"screen",customRegion:!0,regionWidth:800,surface:"default",regionHeight:500,regionX:100,regionY:100,fromRegion:!1,cropTarget:null,hideToolbar:!1,alarm:!1,alarmTime:300,fromAlarm:!1,pendingRecording:!1,askForPermissions:!0,cameraPermission:!0,microphonePermission:!0,askMicrophone:!0,recordingShortcut:"⌥⇧W"},"recordingShortcut","⌥⇧D"),"cursorMode","none"),"shape","rectangle"),"shapeFill",!1),"pushToTalk",!1),"zoomEnabled",!1),"offscreenRecording",!1),"isAddingImage",!1),"pipEnded",!1),"tabCaptureFrame",!1),fs(fs(fs(fs(fs(fs(fs(fs(fs(fs(n,"showOnboardingArrow",!1),"offline",!1),"updateChrome",!1),"permissionsChecked",!1),"permissionsLoaded",!1),"parentRef",null),"shadowRef",null),"settingsOpen",!1),"hideUIAlerts",!1),"toolbarHover",!1),fs(fs(fs(fs(n,"hideUI",!1),"bigTab","record"),"askDismiss",!0),"quality","max"))),2),C=E[0],_=E[1];a.current=C,(0,e.useEffect)((function(){var e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);e&&parseInt(e[2],10)<109&&_((function(e){return us(us({},e),{},{updateChrome:!0})}))}),[]),(0,e.useEffect)((function(){C&&"function"==typeof C.openModal&&_((function(e){return us(us({},e),{},{tryRestartRecording:w,tryDismissRecording:x})}))}),[C.openModal]),(0,e.useEffect)((function(){if(C.recording&&!C.paused&&!C.alarm){i((function(e){return e+1}));var e=setInterval((function(){i((function(e){return e+1}))}),1e3);return function(){return clearInterval(e)}}if(C.alarm&&!C.paused&&C.recording&&C.timer>0){var t=setInterval((function(){i((function(e){return e-1}))}),1e3);return function(){return clearInterval(t)}}}),[C.recording,C.paused]),(0,e.useEffect)((function(){C.customRegion||_((function(e){return us(us({},e),{},{cropTarget:null})}))}),[C.customRegion]),(0,e.useEffect)((function(){C.hideToolbar&&C.hideUI&&_((function(e){return us(us({},e),{},{drawingMode:!1,blurMode:!1})}))}),[C.hideToolbar,C.hideUI]);var T=(0,e.useCallback)((function(e,t,n){if("time"===e.type)chrome.storage.local.get(["recording"],(function(t){t.recording&&i(e.time)}));else if("toggle-popup"===e.type)_((function(e){return us(us({},e),{},{showExtension:!e.showExtension,showPopup:!0})})),i(0);else if("ready-to-record"===e.type)_((function(e){return us(us({},e),{},{showPopup:!1})}));else if("stop-recording-tab"===e.type)chrome.storage.local.set({recording:!1}),_((function(e){return us(us({},e),{},{recording:!1,paused:!1,showExtension:!1,showPopup:!0})}));else if("recording-ended"===e.type)a.current.showPopup||a.current.pendingRecording||_((function(e){return us(us({},e),{},{showExtension:!1,recording:!1,paused:!1,time:0,timer:0})}));else if("recording-error"===e.type)_((function(e){return us(us({},e),{},{pendingRecording:!1})}));else if("start-stream"===e.type){if(a.current.recording)return;_((function(e){return us(us({},e),{},{showExtension:!0,showPopup:!0})})),("camera"!=a.current.recordingType||"none"!=a.current.defaultVideoInput&&a.current.cameraActive)&&a.current.startStreaming()}else if("commands"===e.type){var r=e.commands.find((function(e){return"start-recording"===e.name})),o=e.commands.find((function(e){return"cancel-recording"===e.name}));_((function(e){return us(us({},e),{},{recordingShortcut:r.shortcut,dismissRecordingShortcut:o.shortcut})}))}else"cancel-recording"===e.type?C.dismissRecording():"pause-recording"===e.type?a.current.paused?C.resumeRecording():C.pauseRecording():"set-surface"===e.type?_((function(t){return us(us({},t),{},{surface:e.surface})})):"pip-ended"===e.type?(a.current.recording||a.current.pendingRecording)&&_((function(e){return us(us({},e),{},{pipEnded:!0})})):"pip-started"===e.type?(a.current.recording||a.current.pendingRecording)&&_((function(e){return us(us({},e),{},{pipEnded:!1})})):"setup-complete"===e.type?_((function(e){return us(us({},e),{},{showOnboardingArrow:!0})})):"hide-popup-recording"===e.type?_((function(e){return us(us({},e),{},{showPopup:!1,showExtension:!1})})):"stream-error"===e.type?a.current.openModal(chrome.i18n.getMessage("streamErrorModalTitle"),chrome.i18n.getMessage("streamErrorModalDescription"),chrome.i18n.getMessage("permissionsModalDismiss"),null,(function(){}),(function(){})):"recording-check"===e.type&&a.showExtension}));(0,e.useEffect)((function(){chrome.storage.local.set({pendingRecording:C.pendingRecording})}),[C.pendingRecording]),(0,e.useEffect)((function(){chrome.storage.local.get(["recordingStartTime"],(function(e){if(e.recordingStartTime&&a.current.recording){var t=e.recordingStartTime,n=(new Date).getTime()-t,r=Math.floor(n/1e3);C.alarm?i(C.alarmTime-r):i(r)}}))}),[]),(0,e.useEffect)((function(){C.pushToTalk&&(_((function(e){return us(us({},e),{},{micActive:!1})})),chrome.storage.local.set({micActive:!1}),chrome.runtime.sendMessage({type:"set-mic-active-tab",active:!1,defaultAudioInput:C.defaultAudioInput}))}),[C.pushToTalk]),(0,e.useEffect)((function(){return chrome.runtime.onMessage.addListener(T),function(){chrome.runtime.onMessage.removeListener(T)}}),[]),(0,e.useEffect)((function(){C.backgroundEffectsActive?chrome.runtime.sendMessage({type:"background-effects-active"}):chrome.runtime.sendMessage({type:"background-effects-inactive"})}),[C.backgroundEffectsActive]),(0,e.useEffect)((function(){C.backgroundEffectsActive&&chrome.runtime.sendMessage({type:"set-background-effect",effect:C.backgroundEffect})}),[C.backgroundEffect,C.backgroundEffectsActive]),(0,e.useEffect)((function(){if(C.parentRef&&!(navigator.platform.toUpperCase().indexOf("MAC")>=0)){var e=C.parentRef;e.querySelectorAll("*").forEach((function(e){e.classList.add("screenity-scrollbar")}));var t=new MutationObserver((function(e){var t,n=ls(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("childList"===r.type){var o=Array.from(r.addedNodes),i=Array.from(r.removedNodes);o.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&e.classList.add("screenity-scrollbar")})),i.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&e.classList.remove("screenity-scrollbar")}))}}}catch(e){n.e(e)}finally{n.f()}}));return t.observe(e,{childList:!0,subtree:!0}),function(){t.disconnect()}}}),[C.parentRef]),(0,e.useEffect)((function(){if(C.shadowRef&&!(navigator.platform.toUpperCase().indexOf("MAC")>=0)){var e=C.shadowRef.shadowRoot;e.querySelectorAll("*").forEach((function(e){e.classList.add("screenity-scrollbar")}));var t=new MutationObserver((function(e){var t,n=ls(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("childList"===r.type){var o=Array.from(r.addedNodes),i=Array.from(r.removedNodes);o.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&e.classList.add("screenity-scrollbar")})),i.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&e.classList.remove("screenity-scrollbar")}))}}}catch(e){n.e(e)}finally{n.f()}}));return t.observe(e,{childList:!0,subtree:!0}),function(){t.disconnect()}}}),[C.parentRef,C.shadowRef,C.bigTab,C.recordingType]),(0,e.useEffect)((function(){C.hideUI||_((function(e){return us(us({},e),{},{hideUIAlerts:!1,hideToolbar:!1,toolbarHover:!1})}))}),[C.hideUI]);return(0,e.useEffect)((function(){chrome.storage.local.get(["audioInput","videoInput","defaultAudioInput","defaultVideoInput","cameraDimensions","cameraFlipped","cameraActive","micActive","recording","backgroundEffect","backgroundEffectsActive","toolbarPosition","countdown","recordingType","customRegion","regionWidth","regionHeight","regionX","regionY","hideToolbar","alarm","alarmTime","pendingRecording","askForPermissions","cursorMode","pushToTalk","askMicrophone","offscreenRecording","zoomEnabled","setDevices","popupPosition","surface","hideUIAlerts","hideUI","bigTab","toolbarHover","askDismiss","swatch","color","strokeWidth","quality"],(function(e){_((function(t){return us(us({},t),{},{audioInput:void 0!==e.audioInput&&null!==e.audioInput?e.audioInput:t.audioInput,videoInput:void 0!==e.videoInput&&null!==e.videoInput?e.videoInput:t.videoInput,defaultAudioInput:void 0!==e.defaultAudioInput&&null!==e.defaultAudioInput?e.defaultAudioInput:t.defaultAudioInput,defaultVideoInput:void 0!==e.defaultVideoInput&&null!==e.defaultVideoInput?e.defaultVideoInput:t.defaultVideoInput,cameraDimensions:void 0!==e.cameraDimensions&&null!==e.cameraDimensions?e.cameraDimensions:t.cameraDimensions,cameraFlipped:void 0!==e.cameraFlipped&&null!==e.cameraFlipped?e.cameraFlipped:t.cameraFlipped,cameraActive:void 0!==e.cameraActive&&null!==e.cameraActive?e.cameraActive:t.cameraActive,micActive:void 0!==e.micActive&&null!==e.micActive?e.micActive:t.micActive,backgroundEffect:void 0!==e.backgroundEffect&&null!==e.backgroundEffect?e.backgroundEffect:t.backgroundEffect,backgroundEffectsActive:void 0!==e.backgroundEffectsActive&&null!==e.backgroundEffectsActive?e.backgroundEffectsActive:t.backgroundEffectsActive,toolbarPosition:void 0!==e.toolbarPosition&&null!==e.toolbarPosition?e.toolbarPosition:t.toolbarPosition,countdown:void 0!==e.countdown&&null!==e.countdown?e.countdown:t.countdown,recording:void 0!==e.recording&&null!==e.recording?e.recording:t.recording,recordingType:void 0!==e.recordingType&&null!==e.recordingType?e.recordingType:t.recordingType,customRegion:void 0!==e.customRegion&&null!==e.customRegion?e.customRegion:t.customRegion,regionWidth:void 0!==e.regionWidth&&null!==e.regionWidth?e.regionWidth:t.regionWidth,regionHeight:void 0!==e.regionHeight&&null!==e.regionHeight?e.regionHeight:t.regionHeight,regionX:void 0!==e.regionX&&null!==e.regionX?e.regionX:t.regionX,regionY:void 0!==e.regionY&&null!==e.regionY?e.regionY:t.regionY,hideToolbar:void 0!==e.hideToolbar&&null!==e.hideToolbar?e.hideToolbar:t.hideToolbar,alarm:void 0!==e.alarm&&null!==e.alarm?e.alarm:t.alarm,alarmTime:void 0!==e.alarmTime&&null!==e.alarmTime?e.alarmTime:t.alarmTime,pendingRecording:void 0!==e.pendingRecording&&null!==e.pendingRecording?e.pendingRecording:t.pendingRecording,askForPermissions:void 0!==e.askForPermissions&&null!==e.askForPermissions?e.askForPermissions:t.askForPermissions,cursorMode:void 0!==e.cursorMode&&null!==e.cursorMode?e.cursorMode:t.cursorMode,pushToTalk:void 0!==e.pushToTalk&&null!==e.pushToTalk?e.pushToTalk:t.pushToTalk,zoomEnabled:void 0!==e.zoomEnabled&&null!==e.zoomEnabled?e.zoomEnabled:t.zoomEnabled,askMicrophone:void 0!==e.askMicrophone&&null!==e.askMicrophone?e.askMicrophone:t.askMicrophone,offscreenRecording:void 0!==e.offscreenRecording&&null!==e.offscreenRecording?e.offscreenRecording:t.offscreenRecording,setDevices:void 0!==e.setDevices&&null!==e.setDevices?e.setDevices:t.setDevices,popupPosition:void 0!==e.popupPosition&&null!==e.popupPosition?e.popupPosition:t.popupPosition,surface:void 0!==e.surface&&null!==e.surface?e.surface:t.surface,hideUIAlerts:void 0!==e.hideUIAlerts&&null!==e.hideUIAlerts?e.hideUIAlerts:t.hideUIAlerts,hideUI:void 0!==e.hideUI&&null!==e.hideUI?e.hideUI:t.hideUI,bigTab:void 0!==e.bigTab&&null!==e.bigTab?e.bigTab:t.bigTab,toolbarHover:void 0!==e.toolbarHover&&null!==e.toolbarHover?e.toolbarHover:t.toolbarHover,askDismiss:void 0!==e.askDismiss&&null!==e.askDismiss?e.askDismiss:t.askDismiss,swatch:void 0!==e.swatch&&null!==e.swatch?e.swatch:t.swatch,color:void 0!==e.color&&null!==e.color?e.color:t.color,strokeWidth:void 0!==e.strokeWidth&&null!==e.strokeWidth?e.strokeWidth:t.strokeWidth,quality:void 0!==e.quality&&null!==e.quality?e.quality:t.quality})})),void 0!==e.backgroundEffect&&null!==e.backgroundEffect||chrome.storage.local.set({backgroundEffect:"blur"}),e.backgroundEffectsActive&&chrome.runtime.sendMessage({type:"backgroundEffectsActive"}),e.recording&&"region"===e.recordingType?_((function(e){return us(us({},e),{},{recording:!1})})):e.recording&&chrome.runtime.sendMessage({type:"check-recording"}),e.alarm?_((function(t){return us(us({},t),{},{time:parseFloat(e.alarmTime),timer:parseFloat(e.alarmTime)})})):e.recording||_((function(e){return us(us({},e),{},{time:0,timer:0})})),chrome.storage.local.set({restarting:!1})}))}),[]),e.createElement(gs.Provider,{value:[C,_,o,i]},t.children,e.createElement(as,{shortcuts:C.shortcuts}))};function vs(e){return vs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vs(e)}var bs=["children","className"];function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function xs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ss(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e.createElement(Ya,{className:"SelectSeparator"}),"mic"==t.type&&r.audioInput.length>0&&e.createElement(Ya,{className:"SelectSeparator"}),e.createElement(Ba,null,"camera"==t.type&&r.videoInput.map((function(t){return e.createElement(Ts,{value:t.deviceId,key:t.deviceId},t.label)})),"mic"==t.type&&r.audioInput.map((function(t){return e.createElement(Ts,{value:t.deviceId,key:t.deviceId},t.label)})))),e.createElement(Va,{className:"SelectScrollButton"}))))},ks="Switch",[Ps,js]=a(ks),[As,Ms]=Ps(ks),Ds=(0,e.forwardRef)(((t,n)=>{const{__scopeSwitch:o,name:a,checked:s,defaultChecked:l,required:u,disabled:f,value:d="on",onCheckedChange:h,...p}=t,[g,m]=(0,e.useState)(null),v=c(n,(e=>m(e))),b=(0,e.useRef)(!1),y=!g||Boolean(g.closest("form")),[x=!1,S]=E({prop:s,defaultProp:l,onChange:h});return(0,e.createElement)(As,{scope:o,checked:x,disabled:f},(0,e.createElement)(w.button,r({type:"button",role:"switch","aria-checked":x,"aria-required":u,"data-state":Ls(x),"data-disabled":f?"":void 0,disabled:f,value:d},p,{ref:v,onClick:i(t.onClick,(e=>{S((e=>!e)),y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())}))})),y&&(0,e.createElement)(Fs,{control:g,bubbles:!b.current,name:a,value:d,checked:x,required:u,disabled:f,style:{transform:"translateX(-100%)"}}))})),Rs="SwitchThumb",Is=(0,e.forwardRef)(((t,n)=>{const{__scopeSwitch:o,...i}=t,a=Ms(Rs,o);return(0,e.createElement)(w.span,r({"data-state":Ls(a.checked),"data-disabled":a.disabled?"":void 0},i,{ref:n}))})),Fs=t=>{const{control:n,checked:o,bubbles:i=!0,...a}=t,s=(0,e.useRef)(null),l=Wo(o),c=xo(n);return(0,e.useEffect)((()=>{const e=s.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==o&&n){const t=new Event("click",{bubbles:i});n.call(e,o),e.dispatchEvent(t)}}),[l,o,i]),(0,e.createElement)("input",r({type:"checkbox","aria-hidden":!0,defaultChecked:o},a,{tabIndex:-1,ref:s,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Ls(e){return e?"checked":"unchecked"}const Ns=Ds,zs=Is;function Bs(e){return Bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bs(e)}function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hs(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{const{__scopeCollapsible:o,open:i,defaultOpen:a,disabled:s,onOpenChange:l,...c}=t,[u=!1,f]=E({prop:i,defaultProp:a,onChange:l});return(0,e.createElement)(rl,{scope:o,disabled:s,contentId:y(),open:u,onOpenToggle:(0,e.useCallback)((()=>f((e=>!e))),[f])},(0,e.createElement)(w.div,r({"data-state":fl(u),"data-disabled":s?"":void 0},c,{ref:n})))})),al="CollapsibleTrigger",sl=(0,e.forwardRef)(((t,n)=>{const{__scopeCollapsible:o,...a}=t,s=ol(al,o);return(0,e.createElement)(w.button,r({type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":fl(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled},a,{ref:n,onClick:i(t.onClick,s.onOpenToggle)}))})),ll="CollapsibleContent",cl=(0,e.forwardRef)(((t,n)=>{const{forceMount:o,...i}=t,a=ol(ll,t.__scopeCollapsible);return(0,e.createElement)(X,{present:o||a.open},(({present:t})=>(0,e.createElement)(ul,r({},i,{ref:n,present:t}))))})),ul=(0,e.forwardRef)(((t,n)=>{const{__scopeCollapsible:o,present:i,children:a,...s}=t,l=ol(ll,o),[u,f]=(0,e.useState)(i),d=(0,e.useRef)(null),h=c(n,d),p=(0,e.useRef)(0),g=p.current,v=(0,e.useRef)(0),b=v.current,y=l.open||u,x=(0,e.useRef)(y),S=(0,e.useRef)();return(0,e.useEffect)((()=>{const e=requestAnimationFrame((()=>x.current=!1));return()=>cancelAnimationFrame(e)}),[]),m((()=>{const e=d.current;if(e){S.current=S.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();p.current=t.height,v.current=t.width,x.current||(e.style.transitionDuration=S.current.transitionDuration,e.style.animationName=S.current.animationName),f(i)}}),[l.open,i]),(0,e.createElement)(w.div,r({"data-state":fl(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y},s,{ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...t.style}}),y&&a)}));function fl(e){return e?"open":"closed"}const dl=il,hl=sl,pl=cl;function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n59&&(e.target.value=59),r((function(e){return vl(vl({},e),{},{fromAlarm:!0})})),c(e.target.value))},value:l,onBlur:function(e){""===e.target.value&&(e.target.value=0,c(0))},onFocus:function(e){e.target.select()}}),e.createElement("span",null,"M")),e.createElement("div",{className:"time-set-input"},e.createElement("input",{placeholder:"0",onChange:function(e){isNaN(e.target.value)||(e.target.value>59&&(e.target.value=59),r((function(e){return vl(vl({},e),{},{fromAlarm:!0})})),d(e.target.value))},value:f,onBlur:function(e){""===e.target.value&&(e.target.value=0,d(0))},onFocus:function(e){e.target.select()}}),e.createElement("span",null,"S")))};function Sl(e){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sl(e)}function El(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?"⌥⇧E":"Alt⇧E";return(0,e.useEffect)((function(){var e;c(!!(e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./))&&parseInt(e[2],10))}),[]),(0,e.useEffect)((function(){a((function(e){return Cl(Cl({},e),{},{settingsOpen:n})}))}),[n]),e.createElement(dl,{className:"CollapsibleRoot",open:n,onOpenChange:r},e.createElement(hl,{className:"CollapsibleTrigger"},e.createElement("div",{className:"CollapsibleLabel"},"✨ ",chrome.i18n.getMessage("showMoreOptionsLabel")," ",e.createElement("img",{src:de}))),e.createElement(pl,null,e.createElement(Ys,{label:chrome.i18n.getMessage("hideToolbarLabel"),name:"hideUI",value:"hideUI"}),e.createElement(Ys,{label:chrome.i18n.getMessage("countdownLabel"),name:"countdown",value:"countdown"}),e.createElement(Ys,{label:chrome.i18n.getMessage("alarmLabel"),name:"alarm",value:"alarm"}),i.alarm&&e.createElement(xl,null),e.createElement(Ys,{label:chrome.i18n.getMessage("micReminderPopup"),name:"askMicrophone",value:"askMicrophone"}),"region"!=i.recordingType&&"camera"!=i.recordingType&&(null===l||l>=109)&&e.createElement(Ys,{label:chrome.i18n.getMessage("stayInPagePopup"),name:"offscreenRecording",value:"offscreenRecording"}),e.createElement(Ys,{label:chrome.i18n.getMessage("zoomToPointPopup")+" ("+u+")",name:"zoomEnabled",value:"zoomEnabled",experimental:!0})))},Pl=(0,e.forwardRef)(((t,n)=>{const{pressed:o,defaultPressed:a=!1,onPressedChange:s,...l}=t,[c=!1,u]=E({prop:o,onChange:s,defaultProp:a});return(0,e.createElement)(w.button,r({type:"button","aria-pressed":c,"data-state":c?"on":"off","data-disabled":t.disabled?"":void 0},l,{ref:n,onClick:i(t.onClick,(()=>{t.disabled||u(!c)}))}))})),jl=Pl,Al="ToggleGroup",[Ml,Dl]=a(Al,[D]),Rl=D(),Il=e.forwardRef(((t,n)=>{const{type:o,...i}=t;if("single"===o){const t=i;return e.createElement(Nl,r({},t,{ref:n}))}if("multiple"===o){const t=i;return e.createElement(zl,r({},t,{ref:n}))}throw new Error(`Missing prop \`type\` expected on \`${Al}\``)})),[Fl,Ll]=Ml(Al),Nl=e.forwardRef(((t,n)=>{const{value:o,defaultValue:i,onValueChange:a=(()=>{}),...s}=t,[l,c]=E({prop:o,defaultProp:i,onChange:a});return e.createElement(Fl,{scope:t.__scopeToggleGroup,type:"single",value:l?[l]:[],onItemActivate:c,onItemDeactivate:e.useCallback((()=>c("")),[c])},e.createElement(Hl,r({},s,{ref:n})))})),zl=e.forwardRef(((t,n)=>{const{value:o,defaultValue:i,onValueChange:a=(()=>{}),...s}=t,[l=[],c]=E({prop:o,defaultProp:i,onChange:a}),u=e.useCallback((e=>c(((t=[])=>[...t,e]))),[c]),f=e.useCallback((e=>c(((t=[])=>t.filter((t=>t!==e))))),[c]);return e.createElement(Fl,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:f},e.createElement(Hl,r({},s,{ref:n})))})),[Bl,Wl]=Ml(Al),Hl=e.forwardRef(((t,n)=>{const{__scopeToggleGroup:o,disabled:i=!1,rovingFocus:a=!0,orientation:s,dir:l,loop:c=!0,...u}=t,f=Rl(o),d=_(l),h={role:"group",dir:d,...u};return e.createElement(Bl,{scope:o,rovingFocus:a,disabled:i},a?e.createElement(H,r({asChild:!0},f,{orientation:s,dir:d,loop:c}),e.createElement(w.div,r({},h,{ref:n}))):e.createElement(w.div,r({},h,{ref:n})))})),Ul="ToggleGroupItem",Xl=e.forwardRef(((t,n)=>{const o=Ll(Ul,t.__scopeToggleGroup),i=Wl(Ul,t.__scopeToggleGroup),a=Rl(t.__scopeToggleGroup),s=o.value.includes(t.value),l=i.disabled||t.disabled,c={...t,pressed:s,disabled:l},u=e.useRef(null);return i.rovingFocus?e.createElement(U,r({asChild:!0},a,{focusable:!l,active:s,ref:u}),e.createElement(Vl,r({},c,{ref:n}))):e.createElement(Vl,r({},c,{ref:n}))})),Vl=e.forwardRef(((t,n)=>{const{__scopeToggleGroup:o,value:i,...a}=t,s=Ll(Ul,o),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c="single"===s.type?l:void 0;return e.createElement(Pl,r({},c,a,{ref:n,onPressedChange:e=>{e?s.onItemActivate(i):s.onItemDeactivate(i)}}))})),Yl=Il,Gl=Xl;function ql(e){return ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ql(e)}function Kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $l(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;(0,e.useEffect)((function(){var e=chrome.i18n.getMessage("@@ui_locale");e.includes("en")||(h("https://translate.google.com/translate?sl=en&tl=".concat(e,"&u=https://help.screenity.io/getting-started/77KizPC8MHVGfpKpqdux9D/what-are-the-technical-requirements-for-using-screenity/6kdB6qru6naVD8ZLFvX3m9")),m("https://translate.google.com/translate?sl=en&tl=".concat(e,"&u=https://help.screenity.io/troubleshooting/9Jy5RGjNrBB42hqUdREQ7W/how-to-grant-screenity-permission-to-record-your-camera-and-microphone/x6U69TnrbMjy5CQ96Er2E9")))}),[]),(0,e.useEffect)((function(){var e=Math.floor(r.alarmTime/60),t=r.alarmTime-60*e;t<10&&(t="0"+t),u(e+":"+t)}),[]),(0,e.useEffect)((function(){var e=Math.floor(r.alarmTime/60),t=r.alarmTime-60*e;t<10&&(t="0"+t),u(e+":"+t)}),[r.alarmTime]);return(0,e.useEffect)((function(){"undefined"==typeof CropTarget?(s(!1),o((function(e){return rc(rc({},e),{},{customRegion:!1})}))):s(!0)}),[]),(0,e.useEffect)((function(){r.recording&&o((function(e){return rc(rc({},e),{},{pendingRecording:!1})}))}),[r.recording]),e.createElement("div",null,r.updateChrome&&e.createElement("div",{className:"popup-warning"},e.createElement("div",{className:"popup-warning-left"},e.createElement(Tn,null)),e.createElement("div",{className:"popup-warning-middle"},e.createElement("div",{className:"popup-warning-title"},chrome.i18n.getMessage("customAreaRecordingDisabledTitle")),e.createElement("div",{className:"popup-warning-description"},chrome.i18n.getMessage("customAreaRecordingDisabledDescription"))),e.createElement("div",{className:"popup-warning-right"},e.createElement("a",{href:d,target:"_blank"},chrome.i18n.getMessage("customAreaRecordingDisabledAction")))),!a&&"region"===r.recordingType&&!r.offline&&e.createElement("div",{className:"popup-warning"},e.createElement("div",{className:"popup-warning-left"},e.createElement(Tn,null)),e.createElement("div",{className:"popup-warning-middle"},e.createElement("div",{className:"popup-warning-title"},chrome.i18n.getMessage("customAreaRecordingDisabledTitle")),e.createElement("div",{className:"popup-warning-description"},chrome.i18n.getMessage("customAreaRecordingDisabledDescription"))),e.createElement("div",{className:"popup-warning-right"},e.createElement("a",{href:"https://support.google.com/chrome/answer/95414?hl=en-GB&co=GENIE.Platform%3DDesktop",target:"_blank"},chrome.i18n.getMessage("customAreaRecordingDisabledAction")))),!r.cameraPermission&&e.createElement("button",{className:"permission-button",onClick:function(){r.openModal(chrome.i18n.getMessage("permissionsModalTitle"),chrome.i18n.getMessage("permissionsModalDescription"),null,chrome.i18n.getMessage("permissionsModalDismiss"),(function(){}),(function(){}),chrome.runtime.getURL("assets/helper/permissions.webp"),chrome.i18n.getMessage("learnMoreDot"),g,!0,!1)}},e.createElement("img",{src:Ue}),e.createElement("span",null,chrome.i18n.getMessage("allowCameraAccessButton"))),r.cameraPermission&&e.createElement(Os,{type:"camera",shadowRef:t.shadowRef}),r.cameraPermission&&"none"!=r.defaultVideoInput&&r.cameraActive&&e.createElement("div",null,e.createElement(Ys,{label:chrome.i18n.getMessage("flipCameraLabel"),name:"flip-camera",value:"cameraFlipped"}),e.createElement(Ys,{label:chrome.i18n.getMessage("backgroundEffectsLabel"),name:"background-effects-active",value:"backgroundEffectsActive"}),r.backgroundEffectsActive&&e.createElement(ec,null)),!r.microphonePermission&&e.createElement("button",{className:"permission-button",onClick:function(){return r.openModal(chrome.i18n.getMessage("permissionsModalTitle"),chrome.i18n.getMessage("permissionsModalDescription"),null,chrome.i18n.getMessage("permissionsModalDismiss"),(function(){}),(function(){}),chrome.runtime.getURL("assets/helper/permissions.webp"),chrome.i18n.getMessage("learnMoreDot"),g,!0,!1)}},e.createElement("img",{src:Xe}),e.createElement("span",null,chrome.i18n.getMessage("allowMicrophoneAccessButton"))),r.microphonePermission&&e.createElement(Os,{type:"mic",shadowRef:t.shadowRef}),(r.microphonePermission&&"none"!=r.defaultAudioInput&&r.micActive||r.microphonePermission&&r.pushToTalk)&&e.createElement("div",null,e.createElement("iframe",{style:{width:"100%",height:"30px",zIndex:9999999999,position:"relative"},allow:"camera; microphone",src:chrome.runtime.getURL("waveform.html")}),e.createElement(Ys,{label:b?chrome.i18n.getMessage("pushToTalkLabel")+" (⌥⇧U)":chrome.i18n.getMessage("pushToTalkLabel")+" (Alt⇧U)",name:"pushToTalk",value:"pushToTalk"})),"region"===r.recordingType&&a&&e.createElement("div",null,e.createElement("div",{className:"popup-content-divider"}),e.createElement(Ys,{label:chrome.i18n.getMessage("customAreaLabel"),name:"customRegion",value:"customRegion"}),r.customRegion&&e.createElement(Js,null)),e.createElement("button",{role:"button",className:"main-button recording-button",ref:v,tabIndex:"0",onClick:function(){r.startStreaming()},disabled:r.pendingRecording||(!r.cameraPermission||!r.cameraActive)&&"camera"===r.recordingType},r.alarm&&r.alarmTime>0&&e.createElement("div",{className:"alarm-time-button"},e.createElement(On,null),c),e.createElement("span",{className:"main-button-label"},r.pendingRecording?chrome.i18n.getMessage("recordButtonInProgressLabel"):r.cameraPermission&&r.cameraActive||"camera"!==r.recordingType?chrome.i18n.getMessage("recordButtonLabel"):chrome.i18n.getMessage("recordButtonNoCameraLabel")),e.createElement("span",{className:"main-button-shortcut"},r.recordingShortcut)),e.createElement(kl,null))};function lc(e){return lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lc(e)}function cc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uc(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{var o;const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:d,...h}=t,p=(0,e.useContext)(Tc),[g,m]=(0,e.useState)(null),v=null!==(o=null==g?void 0:g.ownerDocument)&&void 0!==o?o:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,b]=(0,e.useState)({}),y=c(n,(e=>m(e))),x=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(E),_=g?x.indexOf(g):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,O=_>=C,k=function(t,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=S(t),o=(0,e.useRef)(!1),i=(0,e.useRef)((()=>{}));return(0,e.useEffect)((()=>{const e=e=>{if(e.target&&!o.current){const t={originalEvent:e};function a(){jc(Ec,r,t,{discrete:!0})}"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=a,n.addEventListener("click",i.current,{once:!0})):a()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...p.branches].some((e=>e.contains(t)));O&&!n&&(null==l||l(e),null==f||f(e),e.defaultPrevented||null==d||d())}),v),P=function(t,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=S(t),o=(0,e.useRef)(!1);return(0,e.useEffect)((()=>{const e=e=>{if(e.target&&!o.current){jc(Cc,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...p.branches].some((e=>e.contains(t)))||(null==u||u(e),null==f||f(e),e.defaultPrevented||null==d||d())}),v);return Fn((e=>{_===p.layers.size-1&&(null==s||s(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))}),v),(0,e.useEffect)((()=>{if(g)return a&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(_c=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),Pc(),()=>{a&&1===p.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=_c)}}),[g,v,a,p]),(0,e.useEffect)((()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),Pc())}),[g,p]),(0,e.useEffect)((()=>{const e=()=>b({});return document.addEventListener(Sc,e),()=>document.removeEventListener(Sc,e)}),[]),(0,e.createElement)(w.div,r({},h,{ref:y,style:{pointerEvents:T?O?"auto":"none":void 0,...t.style},onFocusCapture:i(t.onFocusCapture,P.onFocusCapture),onBlurCapture:i(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:i(t.onPointerDownCapture,k.onPointerDownCapture)}))})),kc=(0,e.forwardRef)(((t,n)=>{const o=(0,e.useContext)(Tc),i=(0,e.useRef)(null),a=c(n,i);return(0,e.useEffect)((()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}}),[o.branches]),(0,e.createElement)(w.div,r({},t,{ref:a}))}));function Pc(){const e=new CustomEvent(Sc);document.dispatchEvent(e)}function jc(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?x(o,i):o.dispatchEvent(i)}const Ac=Oc,Mc=kc,Dc="focusScope.autoFocusOnMount",Rc="focusScope.autoFocusOnUnmount",Ic={bubbles:!1,cancelable:!0},Fc=(0,e.forwardRef)(((t,n)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=t,[u,f]=(0,e.useState)(null),d=S(a),h=S(s),p=(0,e.useRef)(null),g=c(n,(e=>f(e))),m=(0,e.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,e.useEffect)((()=>{if(i){function e(e){if(m.paused||!u)return;const t=e.target;u.contains(t)?p.current=t:Bc(p.current,{select:!0})}function t(e){if(m.paused||!u)return;const t=e.relatedTarget;null!==t&&(u.contains(t)||Bc(p.current,{select:!0}))}function n(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Bc(u)}document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[i,u,m.paused]),(0,e.useEffect)((()=>{if(u){Wc.add(m);const t=document.activeElement;if(!u.contains(t)){const n=new CustomEvent(Dc,Ic);u.addEventListener(Dc,d),u.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bc(r,{select:t}),document.activeElement!==n)return}((e=Lc(u),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Bc(u))}return()=>{u.removeEventListener(Dc,d),setTimeout((()=>{const e=new CustomEvent(Rc,Ic);u.addEventListener(Rc,h),u.dispatchEvent(e),e.defaultPrevented||Bc(null!=t?t:document.body,{select:!0}),u.removeEventListener(Rc,h),Wc.remove(m)}),0)}}var e}),[u,d,h,m]);const v=(0,e.useCallback)((e=>{if(!o&&!i)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Lc(e),n=Nc(t,e),r=Nc(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&Bc(i,{select:!0})):(e.preventDefault(),o&&Bc(r,{select:!0})):n===t&&e.preventDefault()}}),[o,i,m.paused]);return(0,e.createElement)(w.div,r({tabIndex:-1},l,{ref:g,onKeyDown:v}))}));function Lc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nc(e,t){for(const n of e)if(!zc(n,{upTo:t}))return n}function zc(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Bc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Wc=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Hc(e,t),e.unshift(t)},remove(t){var n;e=Hc(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Hc(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Uc="Popper",[Xc,Vc]=a(Uc),[Yc,Gc]=Xc(Uc),qc=t=>{const{__scopePopper:n,children:r}=t,[o,i]=(0,e.useState)(null);return(0,e.createElement)(Yc,{scope:n,anchor:o,onAnchorChange:i},r)},Kc="PopperAnchor",$c=(0,e.forwardRef)(((t,n)=>{const{__scopePopper:o,virtualRef:i,...a}=t,s=Gc(Kc,o),l=(0,e.useRef)(null),u=c(n,l);return(0,e.useEffect)((()=>{s.onAnchorChange((null==i?void 0:i.current)||l.current)})),i?null:(0,e.createElement)(w.div,r({},a,{ref:u}))})),Qc="PopperContent",[Zc,Jc]=Xc(Qc),eu=(0,e.forwardRef)(((t,n)=>{var o,i,a,s,l,u,f,d;const{__scopePopper:h,side:p="bottom",sideOffset:g=0,align:v="center",alignOffset:b=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:E=[],collisionPadding:C=0,sticky:_="partial",hideWhenDetached:T=!1,updatePositionStrategy:O="optimized",onPlaced:k,...P}=t,j=Gc(Qc,h),[A,M]=(0,e.useState)(null),D=c(n,(e=>M(e))),[R,I]=(0,e.useState)(null),F=xo(R),L=null!==(o=null==F?void 0:F.width)&&void 0!==o?o:0,N=null!==(i=null==F?void 0:F.height)&&void 0!==i?i:0,z=p+("center"!==v?"-"+v:""),B="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},W=Array.isArray(E)?E:[E],H=W.length>0,U={padding:B,boundary:W.filter(tu),altBoundary:H},{refs:X,floatingStyles:V,placement:Y,isPositioned:G,middlewareData:q}=wo({strategy:"fixed",placement:z,whileElementsMounted:(...e)=>fo(...e,{animationFrame:"always"===O}),elements:{reference:j.anchor},middleware:[Ar({mainAxis:g+N,alignmentAxis:b}),x&&Mr({mainAxis:!0,crossAxis:!1,limiter:"partial"===_?Dr():void 0,...U}),x&&Or({...U}),Rr({...U,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),R&&po({element:R,padding:y}),nu({arrowWidth:L,arrowHeight:N}),T&&jr({strategy:"referenceHidden",...U})]}),[K,$]=ru(Y),Q=S(k);m((()=>{G&&(null==Q||Q())}),[G,Q]);const Z=null===(a=q.arrow)||void 0===a?void 0:a.x,J=null===(s=q.arrow)||void 0===s?void 0:s.y,ee=0!==(null===(l=q.arrow)||void 0===l?void 0:l.centerOffset),[te,ne]=(0,e.useState)();return m((()=>{A&&ne(window.getComputedStyle(A).zIndex)}),[A]),(0,e.createElement)("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:G?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[null===(u=q.transformOrigin)||void 0===u?void 0:u.x,null===(f=q.transformOrigin)||void 0===f?void 0:f.y].join(" ")},dir:t.dir},(0,e.createElement)(Zc,{scope:h,placedSide:K,onArrowChange:I,arrowX:Z,arrowY:J,shouldHideArrow:ee},(0,e.createElement)(w.div,r({"data-side":K,"data-align":$},P,{ref:D,style:{...P.style,animation:G?void 0:"none",opacity:null!==(d=q.hide)&&void 0!==d&&d.referenceHidden?0:void 0}}))))}));function tu(e){return null!==e}const nu=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[h,p]=ru(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+f/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+d/2;let b="",y="";return"bottom"===h?(b=u?g:`${m}px`,y=-d+"px"):"top"===h?(b=u?g:`${m}px`,y=`${l.floating.height+d}px`):"right"===h?(b=-d+"px",y=u?g:`${v}px`):"left"===h&&(b=`${l.floating.width+d}px`,y=u?g:`${v}px`),{data:{x:b,y}}}});function ru(e){const[t,n="center"]=e.split("-");return[t,n]}const ou=qc,iu=$c,au=eu,su=(0,e.forwardRef)(((t,o)=>{var i;const{container:a=(null===globalThis||void 0===globalThis||null===(i=globalThis.document)||void 0===i?void 0:i.body),...s}=t;return a?n.createPortal((0,e.createElement)(w.div,r({},s,{ref:o})),a):null})),lu=["Enter"," "],cu=["ArrowUp","PageDown","End"],uu=["ArrowDown","PageUp","Home",...cu],fu="Menu",[du,hu,pu]=g(fu),[gu,mu]=a(fu,[pu,Vc,D]),vu=Vc(),bu=D(),[yu,wu]=gu(fu),[xu,Su]=gu(fu),Eu=t=>{const{__scopeMenu:n,open:r=!1,children:o,dir:i,onOpenChange:a,modal:s=!0}=t,l=vu(n),[c,u]=(0,e.useState)(null),f=(0,e.useRef)(!1),d=S(a),h=_(i);return(0,e.useEffect)((()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),(0,e.createElement)(ou,l,(0,e.createElement)(yu,{scope:n,open:r,onOpenChange:d,content:c,onContentChange:u},(0,e.createElement)(xu,{scope:n,onClose:(0,e.useCallback)((()=>d(!1)),[d]),isUsingKeyboardRef:f,dir:h,modal:s},o)))},Cu=(0,e.forwardRef)(((t,n)=>{const{__scopeMenu:o,...i}=t,a=vu(o);return(0,e.createElement)(iu,r({},a,i,{ref:n}))})),_u="MenuPortal",[Tu,Ou]=gu(_u,{forceMount:void 0}),ku=t=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=t,a=wu(_u,n);return(0,e.createElement)(Tu,{scope:n,forceMount:r},(0,e.createElement)(X,{present:r||a.open},(0,e.createElement)(su,{asChild:!0,container:i},o)))},Pu="MenuContent",[ju,Au]=gu(Pu),Mu=(0,e.forwardRef)(((t,n)=>{const o=Ou(Pu,t.__scopeMenu),{forceMount:i=o.forceMount,...a}=t,s=wu(Pu,t.__scopeMenu),l=Su(Pu,t.__scopeMenu);return(0,e.createElement)(du.Provider,{scope:t.__scopeMenu},(0,e.createElement)(X,{present:i||s.open},(0,e.createElement)(du.Slot,{scope:t.__scopeMenu},l.modal?(0,e.createElement)(Du,r({},a,{ref:n})):(0,e.createElement)(Ru,r({},a,{ref:n})))))})),Du=(0,e.forwardRef)(((t,n)=>{const o=wu(Pu,t.__scopeMenu),a=(0,e.useRef)(null),s=c(n,a);return(0,e.useEffect)((()=>{const e=a.current;if(e)return Qo(e)}),[]),(0,e.createElement)(Iu,r({},t,{ref:s,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:i(t.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)}))})),Ru=(0,e.forwardRef)(((t,n)=>{const o=wu(Pu,t.__scopeMenu);return(0,e.createElement)(Iu,r({},t,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)}))})),Iu=(0,e.forwardRef)(((t,n)=>{const{__scopeMenu:o,loop:a=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:f,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:v,onDismiss:b,disableOutsideScroll:y,...w}=t,x=wu(Pu,o),S=Su(Pu,o),E=vu(o),C=bu(o),_=hu(o),[T,O]=(0,e.useState)(null),k=(0,e.useRef)(null),P=c(n,k,x.onContentChange),j=(0,e.useRef)(0),A=(0,e.useRef)(""),M=(0,e.useRef)(0),D=(0,e.useRef)(null),R=(0,e.useRef)("right"),I=(0,e.useRef)(0),F=y?Di:e.Fragment,L=y?{as:u,allowPinchZoom:!0}:void 0,N=e=>{var t,n;const r=A.current+e,o=_().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){A.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};(0,e.useEffect)((()=>()=>window.clearTimeout(j.current)),[]),Yn();const z=(0,e.useCallback)((e=>{var t,n;return R.current===(null===(t=D.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;er!=c>r&&n<(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}(n,t)}(e,null===(n=D.current)||void 0===n?void 0:n.area)}),[]);return(0,e.createElement)(ju,{scope:o,searchRef:A,onItemEnter:(0,e.useCallback)((e=>{z(e)&&e.preventDefault()}),[z]),onItemLeave:(0,e.useCallback)((e=>{var t;z(e)||(null===(t=k.current)||void 0===t||t.focus(),O(null))}),[z]),onTriggerLeave:(0,e.useCallback)((e=>{z(e)&&e.preventDefault()}),[z]),pointerGraceTimerRef:M,onPointerGraceIntentChange:(0,e.useCallback)((e=>{D.current=e}),[])},(0,e.createElement)(F,L,(0,e.createElement)(Fc,{asChild:!0,trapped:s,onMountAutoFocus:i(l,(e=>{var t;e.preventDefault(),null===(t=k.current)||void 0===t||t.focus()})),onUnmountAutoFocus:f},(0,e.createElement)(Oc,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:v,onDismiss:b},(0,e.createElement)(H,r({asChild:!0},C,{dir:S.dir,orientation:"vertical",loop:a,currentTabStopId:T,onCurrentTabStopIdChange:O,onEntryFocus:i(h,(e=>{S.isUsingKeyboardRef.current||e.preventDefault()}))}),(0,e.createElement)(au,r({role:"menu","aria-orientation":"vertical","data-state":Qu(x.open),"data-radix-menu-content":"",dir:S.dir},E,w,{ref:P,style:{outline:"none",...w.style},onKeyDown:i(w.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&N(e.key));const o=k.current;if(e.target!==o)return;if(!uu.includes(e.key))return;e.preventDefault();const i=_().filter((e=>!e.disabled)).map((e=>e.ref.current));cu.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:i(t.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),A.current="")})),onPointerMove:i(t.onPointerMove,ef((e=>{const t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>I.current?"right":"left";R.current=t,I.current=e.clientX}})))})))))))})),Fu="MenuItem",Lu="menu.itemSelect",Nu=(0,e.forwardRef)(((t,n)=>{const{disabled:o=!1,onSelect:a,...s}=t,l=(0,e.useRef)(null),u=Su(Fu,t.__scopeMenu),f=Au(Fu,t.__scopeMenu),d=c(n,l),h=(0,e.useRef)(!1);return(0,e.createElement)(zu,r({},s,{ref:d,disabled:o,onClick:i(t.onClick,(()=>{const e=l.current;if(!o&&e){const t=new CustomEvent(Lu,{bubbles:!0,cancelable:!0});e.addEventListener(Lu,(e=>null==a?void 0:a(e)),{once:!0}),x(e,t),t.defaultPrevented?h.current=!1:u.onClose()}})),onPointerDown:e=>{var n;null===(n=t.onPointerDown)||void 0===n||n.call(t,e),h.current=!0},onPointerUp:i(t.onPointerUp,(e=>{var t;h.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:i(t.onKeyDown,(e=>{const t=""!==f.searchRef.current;o||t&&" "===e.key||lu.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),zu=(0,e.forwardRef)(((t,n)=>{const{__scopeMenu:o,disabled:a=!1,textValue:s,...l}=t,u=Au(Fu,o),f=bu(o),d=(0,e.useRef)(null),h=c(n,d),[p,g]=(0,e.useState)(!1),[m,v]=(0,e.useState)("");return(0,e.useEffect)((()=>{const e=d.current;var t;e&&v((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[l.children]),(0,e.createElement)(du.ItemSlot,{scope:o,disabled:a,textValue:null!=s?s:m},(0,e.createElement)(U,r({asChild:!0},f,{focusable:!a}),(0,e.createElement)(w.div,r({role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0},l,{ref:h,onPointerMove:i(t.onPointerMove,ef((e=>{if(a)u.onItemLeave(e);else if(u.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:i(t.onPointerLeave,ef((e=>u.onItemLeave(e)))),onFocus:i(t.onFocus,(()=>g(!0))),onBlur:i(t.onBlur,(()=>g(!1)))}))))})),Bu=(0,e.forwardRef)(((t,n)=>{const{checked:o=!1,onCheckedChange:a,...s}=t;return(0,e.createElement)(Vu,{scope:t.__scopeMenu,checked:o},(0,e.createElement)(Nu,r({role:"menuitemcheckbox","aria-checked":Zu(o)?"mixed":o},s,{ref:n,"data-state":Ju(o),onSelect:i(s.onSelect,(()=>null==a?void 0:a(!!Zu(o)||!o)),{checkForDefaultPrevented:!1})})))})),Wu="MenuRadioGroup",[Hu,Uu]=gu(Wu,{value:void 0,onValueChange:()=>{}}),Xu="MenuItemIndicator",[Vu,Yu]=gu(Xu,{checked:!1}),Gu=(0,e.forwardRef)(((t,n)=>{const{__scopeMenu:o,forceMount:i,...a}=t,s=Yu(Xu,o);return(0,e.createElement)(X,{present:i||Zu(s.checked)||!0===s.checked},(0,e.createElement)(w.span,r({},a,{ref:n,"data-state":Ju(s.checked)})))})),qu="MenuSub",[Ku,$u]=gu(qu);function Qu(e){return e?"open":"closed"}function Zu(e){return"indeterminate"===e}function Ju(e){return Zu(e)?"indeterminate":e?"checked":"unchecked"}function ef(e){return t=>"mouse"===t.pointerType?e(t):void 0}const tf=Eu,nf=Cu,rf=ku,of=Mu,af=Nu,sf=Bu,lf=Gu,cf="DropdownMenu",[uf,ff]=a(cf,[mu]),df=mu(),[hf,pf]=uf(cf),gf=t=>{const{__scopeDropdownMenu:n,children:o,dir:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=t,u=df(n),f=(0,e.useRef)(null),[d=!1,h]=E({prop:a,defaultProp:s,onChange:l});return(0,e.createElement)(hf,{scope:n,triggerId:y(),triggerRef:f,contentId:y(),open:d,onOpenChange:h,onOpenToggle:(0,e.useCallback)((()=>h((e=>!e))),[h]),modal:c},(0,e.createElement)(tf,r({},u,{open:d,onOpenChange:h,dir:i,modal:c}),o))},mf="DropdownMenuTrigger",vf=(0,e.forwardRef)(((t,n)=>{const{__scopeDropdownMenu:o,disabled:a=!1,...s}=t,c=pf(mf,o),u=df(o);return(0,e.createElement)(nf,r({asChild:!0},u),(0,e.createElement)(w.button,r({type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":a?"":void 0,disabled:a},s,{ref:l(n,c.triggerRef),onPointerDown:i(t.onPointerDown,(e=>{a||0!==e.button||!1!==e.ctrlKey||(c.onOpenToggle(),c.open||e.preventDefault())})),onKeyDown:i(t.onKeyDown,(e=>{a||(["Enter"," "].includes(e.key)&&c.onOpenToggle(),"ArrowDown"===e.key&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})))})),bf=t=>{const{__scopeDropdownMenu:n,...o}=t,i=df(n);return(0,e.createElement)(rf,r({},i,o))},yf="DropdownMenuContent",wf=(0,e.forwardRef)(((t,n)=>{const{__scopeDropdownMenu:o,...a}=t,s=pf(yf,o),l=df(o),c=(0,e.useRef)(!1);return(0,e.createElement)(of,r({id:s.contentId,"aria-labelledby":s.triggerId},l,a,{ref:n,onCloseAutoFocus:i(t.onCloseAutoFocus,(e=>{var t;c.current||null===(t=s.triggerRef.current)||void 0===t||t.focus(),c.current=!1,e.preventDefault()})),onInteractOutside:i(t.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.modal&&!r||(c.current=!0)})),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))})),xf=(0,e.forwardRef)(((t,n)=>{const{__scopeDropdownMenu:o,...i}=t,a=df(o);return(0,e.createElement)(af,r({},a,i,{ref:n}))})),Sf=(0,e.forwardRef)(((t,n)=>{const{__scopeDropdownMenu:o,...i}=t,a=df(o);return(0,e.createElement)(sf,r({},a,i,{ref:n}))})),Ef=(0,e.forwardRef)(((t,n)=>{const{__scopeDropdownMenu:o,...i}=t,a=df(o);return(0,e.createElement)(lf,r({},a,i,{ref:n}))})),Cf=gf,_f=vf,Tf=bf,Of=wf,kf=xf,Pf=Sf,jf=Ef;function Af(e){return Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Af(e)}function Mf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Df(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nwindow.innerWidth+10&&(t=window.innerWidth+10),n+r+40>window.innerHeight&&(n=window.innerHeight-r-40),i.current.popupPosition.fixed&&twindow.innerWidth&&(m(n),r=window.innerWidth+10),t.y<0?(m(n),i=0):t.y+s+40>window.innerHeight&&(m(n),i=window.innerHeight-s-40),d.current.updatePosition({x:r,y:i}),setTimeout((function(){m("")}),250),o((function(e){return Bf(Bf({},e),{},{popupPosition:Bf(Bf({},e.popupPosition),{},{offsetX:r,offsetY:i,left:rwindow.innerWidth;c&&(p=window.innerWidth-r),f&&(g=window.innerHeight-i),o((function(e){return Bf(Bf({},e),{},{popupPosition:Bf(Bf({},e.popupPosition),{},{offsetX:p,offsetY:g,left:l,right:c,top:u,bottom:f,fixed:v})})})),chrome.storage.local.set({popupPosition:{offsetX:p,offsetY:g,left:l,right:c,top:u,bottom:f,fixed:v}})};return(0,e.useEffect)((function(){var e=r.popupPosition.offsetX,t=r.popupPosition.offsetY;r.popupPosition.bottom&&(t=window.innerHeight-r.popupPosition.offsetY),r.popupPosition.right&&(e=window.innerWidth-r.popupPosition.offsetX),d.current.updatePosition({x:e,y:t}),I(null,{x:e,y:t})}),[]),e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh"}},e.createElement("div",{className:"ToolbarBounds "+b}),e.createElement(bt,{default:{x:r.popupPosition.offsetX,y:r.popupPosition.offsetY},className:"react-draggable "+g+" "+b+" "+x,enableResizing:!1,dragHandleClassName:"drag-area",onDragStart:function(e,t){S("ToolbarDragging")},onDrag:function(e,t){var n=h.current.getBoundingClientRect().width,r=h.current.getBoundingClientRect().height;t.x-40window.innerWidth+10||t.y<0||t.y+r+40>window.innerHeight?y("ToolbarShake"):y("")},onDragStop:I,ref:d},e.createElement("div",{className:"popup-container",ref:h},e.createElement("div",{className:O?"popup-drag-head":"popup-drag-head drag-area"}),e.createElement("div",{className:O?"popup-controls open":"popup-controls drag-area"},e.createElement(Lf,{shadowRef:t.shadowRef,open:O,setOpen:k}),e.createElement("div",{style:{marginBottom:"-4px",cursor:"pointer"},onClick:function(){window.open(D,"_blank")}},e.createElement(Rn,null)),e.createElement("div",{className:"popup-control popup-close",onClick:function(){o(Bf(Bf({},r),{},{showExtension:!1}))}},e.createElement(jn,null))),e.createElement("div",{className:"popup-cutout"},e.createElement("img",{src:u})),e.createElement("div",{className:"popup-nav"}),e.createElement("div",{className:"popup-content"},C&&e.createElement(xc,{setOnboarding:_}),!C&&e.createElement(se,{className:"TabsRoot tl",defaultValue:"record",onValueChange:function(e){l(e),f("record"===e?ke:Fe),o((function(t){return Bf(Bf({},t),{},{bigTab:e})}))}},e.createElement(le,{className:"TabsList tl","data-value":s,"aria-label":"Manage your account",tabIndex:0},e.createElement("div",{className:"pill-anim",ref:A}),e.createElement(ce,{className:"TabsTrigger tl",value:"record",ref:P,tabIndex:0},e.createElement("div",{className:"TabsTriggerIcon"},e.createElement("img",{src:"record"===s?be:ye})),chrome.i18n.getMessage("recordTab")),e.createElement(ce,{className:"TabsTrigger tl",value:"dashboard",ref:j,tabIndex:0},e.createElement("div",{className:"TabsTriggerIcon"},e.createElement("img",{src:"dashboard"===s?we:xe})),chrome.i18n.getMessage("videosTab"))),e.createElement(ue,{className:"TabsContent tl",value:"record"},e.createElement(pc,{shadowRef:t.shadowRef})),e.createElement(ue,{className:"TabsContent tl",value:"dashboard"},e.createElement(bc,null)))),r.settingsOpen&&e.createElement("div",{className:"HelpSection",onClick:function(){window.open(D,"_blank")}},e.createElement("span",{className:"HelpIcon"},e.createElement(Rn,null)),chrome.i18n.getMessage("helpPopup")))))},Vf="horizontal",Yf=["horizontal","vertical"],Gf=(0,e.forwardRef)(((t,n)=>{const{decorative:o,orientation:i=Vf,...a}=t,s=qf(i)?i:Vf,l=o?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return(0,e.createElement)(w.div,r({"data-orientation":s},l,a,{ref:n}))}));function qf(e){return Yf.includes(e)}Gf.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!qf(r)?new Error(function(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:\n - horizontal\n - vertical\n\nDefaulting to \`${Vf}\`.`}(o,n)):null}};const Kf=Gf,$f="Toolbar",[Qf,Zf]=a($f,[D,Dl]),Jf=D(),ed=Dl(),[td,nd]=Qf($f),rd=(0,e.forwardRef)(((t,n)=>{const{__scopeToolbar:o,orientation:i="horizontal",dir:a,loop:s=!0,...l}=t,c=Jf(o),u=_(a);return(0,e.createElement)(td,{scope:o,orientation:i,dir:u},(0,e.createElement)(H,r({asChild:!0},c,{orientation:i,dir:u,loop:s}),(0,e.createElement)(w.div,r({role:"toolbar","aria-orientation":i,dir:u},l,{ref:n}))))})),od="ToolbarSeparator",id=(0,e.forwardRef)(((t,n)=>{const{__scopeToolbar:o,...i}=t,a=nd(od,o);return(0,e.createElement)(Kf,r({orientation:"horizontal"===a.orientation?"vertical":"horizontal"},i,{ref:n}))})),ad=(0,e.forwardRef)(((t,n)=>{const{__scopeToolbar:o,...i}=t,a=Jf(o);return(0,e.createElement)(U,r({asChild:!0},a,{focusable:!t.disabled}),(0,e.createElement)(w.button,r({type:"button"},i,{ref:n})))})),sd="ToolbarToggleGroup",ld=(0,e.forwardRef)(((t,n)=>{const{__scopeToolbar:o,...i}=t,a=nd(sd,o),s=ed(o);return(0,e.createElement)(Yl,r({"data-orientation":a.orientation,dir:a.dir},s,i,{ref:n,rovingFocus:!1}))})),cd=(0,e.forwardRef)(((t,n)=>{const{__scopeToolbar:o,...i}=t,a=ed(o),s={__scopeToolbar:t.__scopeToolbar};return(0,e.createElement)(ad,r({asChild:!0},s),(0,e.createElement)(Gl,r({},a,i,{ref:n})))})),ud=rd,fd=id,dd=ad,hd=ld,pd=cd,[gd,md]=a("Tooltip",[Vc]),vd=Vc(),bd="TooltipProvider",yd=700,wd="tooltip.open",[xd,Sd]=gd(bd),Ed=t=>{const{__scopeTooltip:n,delayDuration:r=yd,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:a}=t,[s,l]=(0,e.useState)(!0),c=(0,e.useRef)(!1),u=(0,e.useRef)(0);return(0,e.useEffect)((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),(0,e.createElement)(xd,{scope:n,isOpenDelayed:s,delayDuration:r,onOpen:(0,e.useCallback)((()=>{window.clearTimeout(u.current),l(!1)}),[]),onClose:(0,e.useCallback)((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l(!0)),o)}),[o]),isPointerInTransitRef:c,onPointerInTransitChange:(0,e.useCallback)((e=>{c.current=e}),[]),disableHoverableContent:i},a)},Cd="Tooltip",[_d,Td]=gd(Cd),Od=t=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=t,c=Sd(Cd,t.__scopeTooltip),u=vd(n),[f,d]=(0,e.useState)(null),h=y(),p=(0,e.useRef)(0),g=null!=s?s:c.disableHoverableContent,m=null!=l?l:c.delayDuration,v=(0,e.useRef)(!1),[b=!1,w]=E({prop:o,defaultProp:i,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(wd))):c.onClose(),null==a||a(e)}}),x=(0,e.useMemo)((()=>b?v.current?"delayed-open":"instant-open":"closed"),[b]),S=(0,e.useCallback)((()=>{window.clearTimeout(p.current),v.current=!1,w(!0)}),[w]),C=(0,e.useCallback)((()=>{window.clearTimeout(p.current),w(!1)}),[w]),_=(0,e.useCallback)((()=>{window.clearTimeout(p.current),p.current=window.setTimeout((()=>{v.current=!0,w(!0)}),m)}),[m,w]);return(0,e.useEffect)((()=>()=>window.clearTimeout(p.current)),[]),(0,e.createElement)(ou,u,(0,e.createElement)(_d,{scope:n,contentId:h,open:b,stateAttribute:x,trigger:f,onTriggerChange:d,onTriggerEnter:(0,e.useCallback)((()=>{c.isOpenDelayed?_():S()}),[c.isOpenDelayed,_,S]),onTriggerLeave:(0,e.useCallback)((()=>{g?C():window.clearTimeout(p.current)}),[C,g]),onOpen:S,onClose:C,disableHoverableContent:g},r))},kd="TooltipTrigger",Pd=(0,e.forwardRef)(((t,n)=>{const{__scopeTooltip:o,...a}=t,s=Td(kd,o),l=Sd(kd,o),u=vd(o),f=c(n,(0,e.useRef)(null),s.onTriggerChange),d=(0,e.useRef)(!1),h=(0,e.useRef)(!1),p=(0,e.useCallback)((()=>d.current=!1),[]);return(0,e.useEffect)((()=>()=>document.removeEventListener("pointerup",p)),[p]),(0,e.createElement)(iu,r({asChild:!0},u),(0,e.createElement)(w.button,r({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},a,{ref:f,onPointerMove:i(t.onPointerMove,(e=>{"touch"!==e.pointerType&&(h.current||l.isPointerInTransitRef.current||(s.onTriggerEnter(),h.current=!0))})),onPointerLeave:i(t.onPointerLeave,(()=>{s.onTriggerLeave(),h.current=!1})),onPointerDown:i(t.onPointerDown,(()=>{d.current=!0,document.addEventListener("pointerup",p,{once:!0})})),onFocus:i(t.onFocus,(()=>{d.current||s.onOpen()})),onBlur:i(t.onBlur,s.onClose),onClick:i(t.onClick,s.onClose)})))})),jd="TooltipPortal",[Ad,Md]=gd(jd,{forceMount:void 0}),Dd=t=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=t,a=Td(jd,n);return(0,e.createElement)(Ad,{scope:n,forceMount:r},(0,e.createElement)(X,{present:r||a.open},(0,e.createElement)(su,{asChild:!0,container:i},o)))},Rd="TooltipContent",Id=(0,e.forwardRef)(((t,n)=>{const o=Md(Rd,t.__scopeTooltip),{forceMount:i=o.forceMount,side:a="top",...s}=t,l=Td(Rd,t.__scopeTooltip);return(0,e.createElement)(X,{present:i||l.open},l.disableHoverableContent?(0,e.createElement)(zd,r({side:a},s,{ref:n})):(0,e.createElement)(Fd,r({side:a},s,{ref:n})))})),Fd=(0,e.forwardRef)(((t,n)=>{const o=Td(Rd,t.__scopeTooltip),i=Sd(Rd,t.__scopeTooltip),a=(0,e.useRef)(null),s=c(n,a),[l,u]=(0,e.useState)(null),{trigger:f,onClose:d}=o,h=a.current,{onPointerInTransitChange:p}=i,g=(0,e.useCallback)((()=>{u(null),p(!1)}),[p]),m=(0,e.useCallback)(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.xt.x?1:e.yt.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);u(i),p(!0)}),[p]);return(0,e.useEffect)((()=>()=>g()),[g]),(0,e.useEffect)((()=>{if(f&&h){const e=e=>m(e,h),t=e=>m(e,f);return f.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{f.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}}),[f,h,m,g]),(0,e.useEffect)((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=(null==f?void 0:f.contains(t))||(null==h?void 0:h.contains(t)),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;er!=c>r&&n<(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}(n,l);r?g():o&&(g(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[f,h,l,d,g]),(0,e.createElement)(zd,r({},t,{ref:s}))})),[Ld,Nd]=gd(Cd,{isInside:!1}),zd=(0,e.forwardRef)(((t,n)=>{const{__scopeTooltip:o,children:i,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,u=Td(Rd,o),f=vd(o),{onClose:h}=u;return(0,e.useEffect)((()=>(document.addEventListener(wd,h),()=>document.removeEventListener(wd,h))),[h]),(0,e.useEffect)((()=>{if(u.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,h]),(0,e.createElement)(Oc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h},(0,e.createElement)(au,r({"data-state":u.stateAttribute},f,c,{ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),(0,e.createElement)(d,null,i),(0,e.createElement)(Ld,{scope:o,isInside:!0},(0,e.createElement)(Uo,{id:u.contentId,role:"tooltip"},a||i))))}));const Bd=Ed,Wd=Od,Hd=Pd,Ud=Dd,Xd=Id;function Vd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{const{__scopePopover:n,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!1}=t,l=Zd(n),c=(0,e.useRef)(null),[u,f]=(0,e.useState)(!1),[d=!1,h]=E({prop:o,defaultProp:i,onChange:a});return(0,e.createElement)(ou,l,(0,e.createElement)(Jd,{scope:n,contentId:y(),triggerRef:c,open:d,onOpenChange:h,onOpenToggle:(0,e.useCallback)((()=>h((e=>!e))),[h]),hasCustomAnchor:u,onCustomAnchorAdd:(0,e.useCallback)((()=>f(!0)),[]),onCustomAnchorRemove:(0,e.useCallback)((()=>f(!1)),[]),modal:s},r))},nh="PopoverTrigger",rh=(0,e.forwardRef)(((t,n)=>{const{__scopePopover:o,...a}=t,s=eh(nh,o),l=Zd(o),u=c(n,s.triggerRef),f=(0,e.createElement)(w.button,r({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":hh(s.open)},a,{ref:u,onClick:i(t.onClick,s.onOpenToggle)}));return s.hasCustomAnchor?f:(0,e.createElement)(iu,r({asChild:!0},l),f)})),oh="PopoverPortal",[ih,ah]=$d(oh,{forceMount:void 0}),sh=t=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=t,a=eh(oh,n);return(0,e.createElement)(ih,{scope:n,forceMount:r},(0,e.createElement)(X,{present:r||a.open},(0,e.createElement)(su,{asChild:!0,container:i},o)))},lh="PopoverContent",ch=(0,e.forwardRef)(((t,n)=>{const o=ah(lh,t.__scopePopover),{forceMount:i=o.forceMount,...a}=t,s=eh(lh,t.__scopePopover);return(0,e.createElement)(X,{present:i||s.open},s.modal?(0,e.createElement)(uh,r({},a,{ref:n})):(0,e.createElement)(fh,r({},a,{ref:n})))})),uh=(0,e.forwardRef)(((t,n)=>{const o=eh(lh,t.__scopePopover),a=(0,e.useRef)(null),s=c(n,a),l=(0,e.useRef)(!1);return(0,e.useEffect)((()=>{const e=a.current;if(e)return Qo(e)}),[]),(0,e.createElement)(Di,{as:u,allowPinchZoom:!0},(0,e.createElement)(dh,r({},t,{ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i(t.onCloseAutoFocus,(e=>{var t;e.preventDefault(),l.current||null===(t=o.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:i(t.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;l.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:i(t.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})))})),fh=(0,e.forwardRef)(((t,n)=>{const o=eh(lh,t.__scopePopover),i=(0,e.useRef)(!1),a=(0,e.useRef)(!1);return(0,e.createElement)(dh,r({},t,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var n,r;(null===(n=t.onCloseAutoFocus)||void 0===n||n.call(t,e),e.defaultPrevented)||(i.current||null===(r=o.triggerRef.current)||void 0===r||r.focus(),e.preventDefault());i.current=!1,a.current=!1},onInteractOutside:e=>{var n,r;null===(n=t.onInteractOutside)||void 0===n||n.call(t,e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const s=e.target;(null===(r=o.triggerRef.current)||void 0===r?void 0:r.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}}))})),dh=(0,e.forwardRef)(((t,n)=>{const{__scopePopover:o,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,...h}=t,p=eh(lh,o),g=Zd(o);return Yn(),(0,e.createElement)(Fc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:s},(0,e.createElement)(Oc,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onDismiss:()=>p.onOpenChange(!1)},(0,e.createElement)(au,r({"data-state":hh(p.open),role:"dialog",id:p.contentId},g,h,{ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}));function hh(e){return e?"open":"closed"}const ph=th,gh=rh,mh=sh,vh=ch;var bh=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),yh=255,wh=100,xh=e=>{var{r:t,g:n,b:r,a:o}=e,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*wh:0,v:i/yh*wh,a:o}},Sh=e=>{var{h:t,s:n,v:r,a:o}=e,i=(200-n)*r/wh;return{h:t,s:i>0&&i<200?n*r/wh/(i<=wh?i:200-i)*wh:0,l:i/2,a:o}},Eh=(Math.PI,e=>{var{r:t,g:n,b:r}=e;return"#"+(e=>new Array(7-e.length).join("0")+e)((t<<16|n<<8|r).toString(16))}),Ch=e=>{var{r:t,g:n,b:r,a:o}=e,i="number"==typeof o&&(255*o|256).toString(16).slice(1);return""+Eh({r:t,g:n,b:r,a:o})+(i||"")},_h=e=>xh(Th(e)),Th=e=>{var t=e.replace("#","");/^#?/.test(e)&&3===t.length&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var n=new RegExp("[A-Za-z0-9]{2}","g"),[r,o,i=0,a]=e.match(n).map((e=>parseInt(e,16)));return{r,g:o,b:i,a:(null!=a?a:255)/yh}},Oh=e=>{var{h:t,s:n,v:o,a:i}=e,a=t/60,s=n/wh,l=o/wh,c=Math.floor(a)%6,u=a-Math.floor(a),f=yh*l*(1-s),d=yh*l*(1-s*u),h=yh*l*(1-s*(1-u));l*=yh;var p={};switch(c){case 0:p.r=l,p.g=h,p.b=f;break;case 1:p.r=d,p.g=l,p.b=f;break;case 2:p.r=f,p.g=l,p.b=h;break;case 3:p.r=f,p.g=d,p.b=l;break;case 4:p.r=h,p.g=f,p.b=l;break;case 5:p.r=l,p.g=f,p.b=d}return p.r=Math.round(p.r),p.g=Math.round(p.g),p.b=Math.round(p.b),r({},p,{a:i})},kh=e=>Eh(Oh(e));function Ph(t){var n=(0,e.useRef)(t);return(0,e.useEffect)((()=>{n.current=t})),(0,e.useCallback)(((e,t)=>n.current&&n.current(e,t)),[])}var jh=e=>"touches"in e,Ah=e=>{!jh(e)&&e.preventDefault&&e.preventDefault()},Mh=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e{var n=e.getBoundingClientRect(),r=jh(t)?t.touches[0]:t;return{left:Mh((r.pageX-(n.left+window.pageXOffset))/n.width),top:Mh((r.pageY-(n.top+window.pageYOffset))/n.height),width:n.width,height:n.height,x:r.pageX-(n.left+window.pageXOffset),y:r.pageY-(n.top+window.pageYOffset)}},Rh=["prefixCls","className","onMove","onDown"],Ih=e.forwardRef(((t,n)=>{var{prefixCls:o="w-color-interactive",className:i,onMove:a,onDown:s}=t,l=yt(t,Rh),c=(0,e.useRef)(null),u=(0,e.useRef)(!1),[f,d]=(0,e.useState)(!1),h=Ph(a),p=Ph(s),g=(0,e.useCallback)((e=>{Ah(e),(jh(e)?e.touches.length>0:e.buttons>0)&&c.current?h&&h(Dh(c.current,e),e):d(!1)}),[h]),m=(0,e.useCallback)((()=>d(!1)),[]),v=(0,e.useCallback)((e=>{var t=e?window.addEventListener:window.removeEventListener;t(u.current?"touchmove":"mousemove",g),t(u.current?"touchend":"mouseup",m)}),[]);(0,e.useEffect)((()=>(v(f),()=>{f&&v(!1)})),[f,v]);var b=(0,e.useCallback)((e=>{Ah(e.nativeEvent),(e=>!(u.current&&!jh(e)||(u.current=jh(e),0)))(e.nativeEvent)&&(p&&p(Dh(c.current,e.nativeEvent),e.nativeEvent),d(!0))}),[p]);return(0,Ga.jsx)("div",r({},l,{className:[o,i||""].filter(Boolean).join(" "),style:r({},l.style,{touchAction:"none"}),ref:c,tabIndex:0,onMouseDown:b,onTouchStart:b}))}));Ih.displayName="Interactive";const Fh=Ih;var Lh=e=>{var{className:t,color:n,left:o,top:i,style:a,prefixCls:s}=e,l=r({},a,{position:"absolute",top:i,left:o}),c=s+"-pointer "+(t||"");return(0,Ga.jsx)("div",{className:c,style:l,children:(0,Ga.jsx)("div",{className:s+"-fill",style:{width:10,height:10,transform:"translate(-5px, -5px)",boxShadow:"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",borderRadius:"50%",backgroundColor:"#fff"},children:(0,Ga.jsx)("div",{style:{inset:0,borderRadius:"50%",position:"absolute",backgroundColor:n}})})})},Nh=2*Math.PI,zh=(e,t)=>(e%t+t)%t,Bh=(e,t)=>Math.sqrt(e*e+t*t);function Wh(e){var{width:t=0}=e,n=t/2;return{width:t,radius:n,cx:n,cy:n}}function Hh(e){var{width:t=0}=e;return t/2}function Uh(e,t,n){var r=e.angle||0,o=e.direction;return n&&"clockwise"===o?t=r+t:"clockwise"===o?t=360-r+t:n&&"anticlockwise"===o?t=r+180-t:"anticlockwise"===o&&(t=r-t),zh(t,360)}var Xh=["prefixCls","radius","pointer","className","style","width","height","oval","direction","angle","color","onChange"],Vh=e.forwardRef(((e,t)=>{var{prefixCls:n="w-color-wheel",radius:o=0,pointer:i,className:a,style:s,width:l=200,height:c=200,oval:u,direction:f="anticlockwise",angle:d=180,color:h,onChange:p}=e,g=yt(e,Xh),m="string"==typeof h&&bh(h)?_h(h):h||{},v=h?kh(m):"",b=function(e,t){var{cx:n,cy:r}=Wh(e),o=Hh(e),i=(180+Uh(e,t.h,!0))*(Nh/360),a=t.s/100*o,s="clockwise"===e.direction?-1:1;return{x:n+a*Math.cos(i)*s,y:r+a*Math.sin(i)*s}}({width:l},m),y={top:"0",left:"0",color:v},w=(e,t)=>{var n=function(e,t,n){var{cx:r,cy:o}=Wh(e),i=Hh(e);t=r-t,n=o-n;var a=Uh(e,Math.atan2(-n,-t)*(360/Nh)),s=Math.min(Bh(t,n),i);return{h:Math.round(a),s:Math.round(100/i*s)}}({width:l},l-e.x,c-e.y),r={h:n.h,s:n.s,v:m.v,a:m.a};p&&p((e=>{var t,n,r,o,i,a,s,l;return"string"==typeof e&&bh(e)?(a=_h(e),s=e):"string"!=typeof e&&(a=e),a&&(r=(e=>{var{h:t,s:n,v:r}=e;return{h:t,s:n,v:r}})(a),i=Sh(a),o=Oh(a),l=Ch(o),s=kh(a),n=(e=>{var{h:t,s:n,l:r}=e;return{h:t,s:n,l:r}})(i),t=(e=>{var{r:t,g:n,b:r}=e;return{r:t,g:n,b:r}})(o)),{rgb:t,hsl:n,hsv:r,rgba:o,hsla:i,hsva:a,hex:s,hexa:l}})(r))},x={zIndex:1,transform:"translate("+b.x+"px, "+b.y+"px) "+("x"===u||"X"===u?"scaleY(2)":"y"===u||"Y"===u?"scaleX(2)":"")},S=i&&"function"==typeof i?i(r({prefixCls:n,style:x},y)):(0,Ga.jsx)(Lh,r({prefixCls:n,style:x},y));return(0,Ga.jsxs)(Fh,r({className:[n,a||""].filter(Boolean).join(" ")},g,{style:r({position:"relative",width:l,transform:"x"===u||"X"===u?"scaleY(0.5)":"y"===u||"Y"===u?"scaleX(0.5)":"",height:c},s),ref:t,onMove:w,onDown:w,children:[S,(0,Ga.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"anticlockwise"===f?"conic-gradient(red, yellow, lime, aqua, blue, magenta, red)":"conic-gradient(red, magenta, blue, aqua, lime, yellow, red)",transform:"rotateZ("+(d+90)+"deg)",inset:0}}),(0,Ga.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"radial-gradient(circle closest-side, #fff, transparent)",inset:0}}),(0,Ga.jsx)("div",{style:{backgroundColor:"#000",borderRadius:"50%",position:"absolute",inset:0,opacity:"number"==typeof m.v?1-m.v/100:0}})]}))}));Vh.displayName="Wheel";const Yh=Vh;function Gh(e){return Gh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gh(e)}function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var r=Sp(e.undoStack),o=Sp(e.redoStack),i=r.pop();o.push(i);var a=r[r.length-1];n.clear(),n.renderAll(),n.loadFromJSON(a,(function(){n.discardActiveObject(),n.renderAll()})),t(wp(wp({},e),{},{undoStack:r,redoStack:o}))}}},_p=function(e,t){if(e.canvas){var n=e.canvas;if(e.redoStack.length>0){var r=Sp(e.undoStack),o=Sp(e.redoStack),i=o.pop();r.push(i),n.loadFromJSON(i,(function(){n.discardActiveObject(),n.renderAll()})),t(wp(wp({},e),{},{undoStack:r,redoStack:o}))}}},Tp=function(e,t){if(e.canvas){var n=e.canvas.toJSON(["id","selectable","evented","hasControls","hasBorders","hasRotatingPoint","subTargetCheck","originX","originY","perPixelTargetFind","skipAutoWidthAdjustment"]),r=JSON.stringify(n),o=[].concat(Sp(e.undoStack),[r]);t(wp(wp({},e),{},{undoStack:o,redoStack:[]}))}};function Op(e){return Op="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Op(e)}function kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{const{__scopeToast:n,label:r="Notification",duration:o=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:s}=t,[l,c]=(0,e.useState)(null),[u,f]=(0,e.useState)(0),d=(0,e.useRef)(!1),h=(0,e.useRef)(!1);return(0,e.createElement)(qp.Provider,{scope:n},(0,e.createElement)(Jp,{scope:n,label:r,duration:o,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:(0,e.useCallback)((()=>f((e=>e+1))),[]),onToastRemove:(0,e.useCallback)((()=>f((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h},s))};tg.propTypes={label(e){if(e.label&&"string"==typeof e.label&&!e.label.trim()){return new Error(`Invalid prop \`label\` supplied to \`${Gp}\`. Expected non-empty \`string\`.`)}return null}};const ng="ToastViewport",rg=["F8"],og="toast.viewportPause",ig="toast.viewportResume",ag=(0,e.forwardRef)(((t,n)=>{const{__scopeToast:o,hotkey:i=rg,label:a="Notifications ({hotkey})",...s}=t,l=eg(ng,o),u=Kp(o),f=(0,e.useRef)(null),d=(0,e.useRef)(null),h=(0,e.useRef)(null),p=(0,e.useRef)(null),g=c(n,p,l.onViewportChange),m=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=l.toastCount>0;(0,e.useEffect)((()=>{const e=e=>{var t;i.every((t=>e[t]||e.code===t))&&(null===(t=p.current)||void 0===t||t.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[i]),(0,e.useEffect)((()=>{const e=f.current,t=p.current;if(v&&e&&t){const n=()=>{if(!l.isClosePausedRef.current){const e=new CustomEvent(og);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){const e=new CustomEvent(ig);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&r()},i=()=>{e.contains(document.activeElement)||r()};return e.addEventListener("focusin",n),e.addEventListener("focusout",o),e.addEventListener("pointermove",n),e.addEventListener("pointerleave",i),window.addEventListener("blur",n),window.addEventListener("focus",r),()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",n),e.removeEventListener("pointerleave",i),window.removeEventListener("blur",n),window.removeEventListener("focus",r)}}}),[v,l.isClosePausedRef]);const b=(0,e.useCallback)((({tabbingDirection:e})=>{const t=u().map((t=>{const n=t.ref.current,r=[n,...Cg(n)];return"forwards"===e?r:r.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[u]);return(0,e.useEffect)((()=>{const e=p.current;if(e){const t=t=>{const n=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!n){const n=document.activeElement,a=t.shiftKey;var r;if(t.target===e&&a)return void(null===(r=d.current)||void 0===r||r.focus());const s=b({tabbingDirection:a?"backwards":"forwards"}),l=s.findIndex((e=>e===n));var o,i;if(_g(s.slice(l+1)))t.preventDefault();else a?null===(o=d.current)||void 0===o||o.focus():null===(i=h.current)||void 0===i||i.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[u,b]),(0,e.createElement)(Mc,{ref:f,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"}},v&&(0,e.createElement)(lg,{ref:d,onFocusFromOutsideViewport:()=>{_g(b({tabbingDirection:"forwards"}))}}),(0,e.createElement)(qp.Slot,{scope:o},(0,e.createElement)(w.ol,r({tabIndex:-1},s,{ref:g}))),v&&(0,e.createElement)(lg,{ref:h,onFocusFromOutsideViewport:()=>{_g(b({tabbingDirection:"backwards"}))}}))})),sg="ToastFocusProxy",lg=(0,e.forwardRef)(((t,n)=>{const{__scopeToast:o,onFocusFromOutsideViewport:i,...a}=t,s=eg(sg,o);return(0,e.createElement)(Ho,r({"aria-hidden":!0,tabIndex:0},a,{ref:n,style:{position:"fixed"},onFocus:e=>{var t;const n=e.relatedTarget;!(null!==(t=s.viewport)&&void 0!==t&&t.contains(n))&&i()}}))})),cg="Toast",ug=(0,e.forwardRef)(((t,n)=>{const{forceMount:o,open:a,defaultOpen:s,onOpenChange:l,...c}=t,[u=!0,f]=E({prop:a,defaultProp:s,onChange:l});return(0,e.createElement)(X,{present:o||u},(0,e.createElement)(hg,r({open:u},c,{ref:n,onClose:()=>f(!1),onPause:S(t.onPause),onResume:S(t.onResume),onSwipeStart:i(t.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:i(t.onSwipeMove,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${n}px`)})),onSwipeCancel:i(t.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:i(t.onSwipeEnd,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${n}px`),f(!1)}))})))})),[fg,dg]=Qp(cg,{onClose(){}}),hg=(0,e.forwardRef)(((t,o)=>{const{__scopeToast:a,type:s="foreground",duration:l,open:u,onClose:f,onEscapeKeyDown:d,onPause:h,onResume:p,onSwipeStart:g,onSwipeMove:m,onSwipeCancel:v,onSwipeEnd:b,...y}=t,x=eg(cg,a),[E,C]=(0,e.useState)(null),_=c(o,(e=>C(e))),T=(0,e.useRef)(null),O=(0,e.useRef)(null),k=l||x.duration,P=(0,e.useRef)(0),j=(0,e.useRef)(k),A=(0,e.useRef)(0),{onToastAdd:M,onToastRemove:D}=x,R=S((()=>{var e;(null==E?void 0:E.contains(document.activeElement))&&(null===(e=x.viewport)||void 0===e||e.focus()),f()})),I=(0,e.useCallback)((e=>{e&&e!==1/0&&(window.clearTimeout(A.current),P.current=(new Date).getTime(),A.current=window.setTimeout(R,e))}),[R]);(0,e.useEffect)((()=>{const e=x.viewport;if(e){const t=()=>{I(j.current),null==p||p()},n=()=>{const e=(new Date).getTime()-P.current;j.current=j.current-e,window.clearTimeout(A.current),null==h||h()};return e.addEventListener(og,n),e.addEventListener(ig,t),()=>{e.removeEventListener(og,n),e.removeEventListener(ig,t)}}}),[x.viewport,k,h,p,I]),(0,e.useEffect)((()=>{u&&!x.isClosePausedRef.current&&I(k)}),[u,k,x.isClosePausedRef,I]),(0,e.useEffect)((()=>(M(),()=>D())),[M,D]);const F=(0,e.useMemo)((()=>E?xg(E):null),[E]);return x.viewport?(0,e.createElement)(e.Fragment,null,F&&(0,e.createElement)(pg,{__scopeToast:a,role:"status","aria-live":"foreground"===s?"assertive":"polite","aria-atomic":!0},F),(0,e.createElement)(fg,{scope:a,onClose:R},(0,n.createPortal)((0,e.createElement)(qp.ItemSlot,{scope:a},(0,e.createElement)(Ac,{asChild:!0,onEscapeKeyDown:i(d,(()=>{x.isFocusedToastEscapeKeyDownRef.current||R(),x.isFocusedToastEscapeKeyDownRef.current=!1}))},(0,e.createElement)(w.li,r({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":x.swipeDirection},y,{ref:_,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:i(t.onKeyDown,(e=>{"Escape"===e.key&&(null==d||d(e.nativeEvent),e.nativeEvent.defaultPrevented||(x.isFocusedToastEscapeKeyDownRef.current=!0,R()))})),onPointerDown:i(t.onPointerDown,(e=>{0===e.button&&(T.current={x:e.clientX,y:e.clientY})})),onPointerMove:i(t.onPointerMove,(e=>{if(!T.current)return;const t=e.clientX-T.current.x,n=e.clientY-T.current.y,r=Boolean(O.current),o=["left","right"].includes(x.swipeDirection),i=["left","up"].includes(x.swipeDirection)?Math.min:Math.max,a=o?i(0,t):0,s=o?0:i(0,n),l="touch"===e.pointerType?10:2,c={x:a,y:s},u={originalEvent:e,delta:c};r?(O.current=c,Sg("toast.swipeMove",m,u,{discrete:!1})):Eg(c,x.swipeDirection,l)?(O.current=c,Sg("toast.swipeStart",g,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(n)>l)&&(T.current=null)})),onPointerUp:i(t.onPointerUp,(e=>{const t=O.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),O.current=null,T.current=null,t){const n=e.currentTarget,r={originalEvent:e,delta:t};Eg(t,x.swipeDirection,x.swipeThreshold)?Sg("toast.swipeEnd",b,r,{discrete:!0}):Sg("toast.swipeCancel",v,r,{discrete:!0}),n.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})))),x.viewport))):null}));hg.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){return new Error(`Invalid prop \`type\` supplied to \`${cg}\`. Expected \`foreground | background\`.`)}return null}};const pg=t=>{const{__scopeToast:n,children:r,...o}=t,i=eg(cg,n),[a,s]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!1);return function(e=(()=>{})){const t=S(e);m((()=>{let e=0,n=0;return e=window.requestAnimationFrame((()=>n=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}}),[t])}((()=>s(!0))),(0,e.useEffect)((()=>{const e=window.setTimeout((()=>c(!0)),1e3);return()=>window.clearTimeout(e)}),[]),l?null:(0,e.createElement)(su,{asChild:!0},(0,e.createElement)(Ho,o,a&&(0,e.createElement)(e.Fragment,null,i.label," ",r)))},gg=(0,e.forwardRef)(((t,n)=>{const{__scopeToast:o,...i}=t;return(0,e.createElement)(w.div,r({},i,{ref:n}))})),mg="ToastAction",vg=(0,e.forwardRef)(((t,n)=>{const{altText:o,...i}=t;return o?(0,e.createElement)(wg,{altText:o,asChild:!0},(0,e.createElement)(yg,r({},i,{ref:n}))):null}));vg.propTypes={altText:e=>e.altText?null:new Error(`Missing prop \`altText\` expected on \`${mg}\``)};const bg="ToastClose",yg=(0,e.forwardRef)(((t,n)=>{const{__scopeToast:o,...a}=t,s=dg(bg,o);return(0,e.createElement)(wg,{asChild:!0},(0,e.createElement)(w.button,r({type:"button"},a,{ref:n,onClick:i(t.onClick,s.onClose)})))})),wg=(0,e.forwardRef)(((t,n)=>{const{__scopeToast:o,altText:i,...a}=t;return(0,e.createElement)(w.div,r({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0},a,{ref:n}))}));function xg(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const n=e.ariaHidden||e.hidden||"none"===e.style.display,r=""===e.dataset.radixToastAnnounceExclude;if(!n)if(r){const n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...xg(e))}})),t}function Sg(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?x(o,i):o.dispatchEvent(i)}const Eg=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return"left"===t||"right"===t?i&&r>n:!i&&o>n};function Cg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _g(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}const Tg=tg,Og=ag,kg=ug,Pg=gg,jg=vg;function Ag(e){return Ag="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ag(e)}function Mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dg(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=10?(r+=(e<10?"0":"")+e+":",D.current.style.width="58px"):e>0?(r+=e+":",D.current.style.width="48px"):(D.current.style.width="42px",r+=t>0?(t<10?"0":"")+t+":":"00:"),T(r+=(n<10?"0":"")+n)}}),[o]),(0,e.useLayoutEffect)((function(){function e(e){var t=l.current.getDraggablePosition().x,n=l.current.getDraggablePosition().y,r=c.current.getBoundingClientRect().width,o=c.current.getBoundingClientRect().height;t+r+30>window.innerWidth&&(t=window.innerWidth-r-30),n+o-60>window.innerHeight&&(n=window.innerHeight-o+60),l.current.updatePosition({x:t,y:n})}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}}),[]);var R=function(e,t){b(""),x("");var n=t.x,o=t.y,i=c.current.getBoundingClientRect().width,a=c.current.getBoundingClientRect().height;t.x<-10?(g("ToolbarElastic"),n=-10):t.x+i+30>window.innerWidth&&(g("ToolbarElastic"),n=window.innerWidth-i-30),t.y<130?d("ToolbarBottom"):d("ToolbarTop"),t.y<80?(g("ToolbarElastic"),o=80):t.y+a-60>window.innerHeight&&(g("ToolbarElastic"),o=window.innerHeight-a+60),l.current.updatePosition({x:n,y:o}),setTimeout((function(){g("")}),250),r((function(e){return Gg(Gg({},e),{},{toolbarPosition:Gg(Gg({},e.toolbarPosition),{},{offsetX:n,offsetY:o,left:nwindow.innerWidth||t.y<60||t.y+r-80>window.innerHeight?b("ToolbarShake"):b("")},onDragStop:R,ref:l},e.createElement(ud,{className:"ToolbarRoot "+f+" "+k+" "+A,ref:c},e.createElement(qd,{grab:!0,type:"button",content:""},e.createElement(Vt,null)),e.createElement("div",{className:"ToolbarRecordingControls"},e.createElement(qd,{type:"button",content:chrome.i18n.getMessage("finishRecordingTooltip"),disabled:!n.recording,onClick:function(){n.stopRecording()}},e.createElement(Yt,{width:"20",height:"20"})),e.createElement("div",{className:"ToolbarRecordingTime",ref:D},_),e.createElement(qd,{type:"button",content:chrome.i18n.getMessage("restartRecordingTooltip"),disabled:!n.recording,onClick:function(){n.tryRestartRecording()}},e.createElement(Zt,null)),!n.paused&&e.createElement(qd,{type:"button",content:chrome.i18n.getMessage("pauseRecordingTooltip"),disabled:!n.recording,onClick:function(){n.pauseRecording()}},e.createElement(qt,null)),n.recording&&n.paused&&e.createElement(qd,{type:"button",resume:!0,content:chrome.i18n.getMessage("resumeRecordingTooltip"),disabled:!n.recording,onClick:function(){n.resumeRecording()}},e.createElement(Kt,null)),e.createElement(qd,{type:"button",content:chrome.i18n.getMessage("cancelRecordingTooltip"),disabled:!n.recording,onClick:function(){n.tryDismissRecording()}},e.createElement(Jt,null))),e.createElement(fd,{className:"ToolbarSeparator"}),e.createElement(hd,{type:"single",className:"ToolbarToggleGroup",value:a,onValueChange:function(e){s(e)}},e.createElement("div",{className:"ToolbarToggleWrap"},n.showOnboardingArrow&&e.createElement("div",{className:"OnboardingArrow"},e.createElement("div",{className:"OnboardingText"},chrome.i18n.getMessage("clickHereDrawOnboarding")),e.createElement("div",{className:"ArrowShape"},e.createElement(Mn,null))),e.createElement(qd,{type:"mode",content:chrome.i18n.getMessage("toggleDrawingToolsTooltip"),value:"draw"},"draw"===a&&e.createElement(Dn,null),"draw"!==a&&e.createElement(Gt,null)),e.createElement(Np,{visible:"draw"===a?"show-toolbar":""})),e.createElement("div",{className:"ToolbarToggleWrap"},e.createElement(qd,{type:"mode",content:chrome.i18n.getMessage("toggleBlurToolTooltip"),value:"blur"},"blur"===a&&e.createElement(Dn,null),"blur"!==a&&e.createElement(_n,null)),e.createElement(Yp,{visible:"blur"===a?"show-toolbar":""})),e.createElement("div",{className:"ToolbarToggleWrap"},e.createElement(qd,{type:"mode",content:chrome.i18n.getMessage("toggleCursorOptionsTooltip"),value:"cursor"},"target"===n.cursorMode&&e.createElement(on,null),"highlight"===n.cursorMode&&e.createElement(an,null),"spotlight"===n.cursorMode&&e.createElement(kn,null),"none"===n.cursorMode&&e.createElement($t,null)),e.createElement(Vp,{visible:"cursor"===a?"show-toolbar":"",mode:a,setMode:s})),e.createElement(fd,{className:"ToolbarSeparator"}),e.createElement(Xg,null),(!n.cameraActive||"none"===n.defaultVideoInput)&&"camera-only"!=n.recordingType&&e.createElement(qd,{type:"button",content:n.cameraActive&&n.cameraPermission?chrome.i18n.getMessage("disableCameraTooltip"):!n.cameraActive&&n.cameraPermission?chrome.i18n.getMessage("enableCameraTooltip"):chrome.i18n.getMessage("noCameraPermissionsTooltip"),value:"camera",onClick:function(){r((function(e){return Gg(Gg({},e),{},{cameraActive:!0})})),chrome.storage.local.set({cameraActive:!0}),r((function(e){return Gg(Gg({},e),{},{pipEnded:!0})}))},disabled:!n.cameraPermission||"none"===n.defaultVideoInput},e.createElement(Cn,null))))))};const Zg=function(){return e.createElement("div",{className:"toolbar-page"},e.createElement(Qg,null))};function Jg(e){return Jg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jg(e)}function em(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tm(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn.x&&o.set({left:Math.abs(n.x)}),a>n.y&&o.set({top:Math.abs(n.y)}),"rectangle"===s.shape||"triangle"===s.shape?(o.set({width:Math.abs(i-n.x)}),o.set({height:Math.abs(a-n.y)})):"circle"===s.shape&&o.set({radius:Math.abs(n.x-i)/2}),e.requestRenderAll()}},f=function(i){"shape"===s.tool&&(l=!1,e.renderAll(),r(Dm(Dm({},t),{},{tool:"select"}),n),e.setActiveObject(o),e.renderAll())};return e.on("mouse:down",c),e.on("mouse:move",u),e.on("mouse:up",f),{removeEventListeners:function(){e.off("mouse:down",c),e.off("mouse:move",u),e.off("mouse:up",f)}}};function Fm(e){return Fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fm(e)}function Lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nm(e){for(var t=1;t0)r=r.slice(0,-1);else{var o=t.charCode||t.keyCode;r+=String.fromCharCode(o)}var i=r,a=document.createElement("canvas").getContext("2d");a.font=n.fontSize+"px "+n.fontFamily;var s=a.measureText(i),l=Math.max(n.width,s.width+2);if(s.width>n.width)n.set({left:n.left-(l-n.width)/2}),e.renderAll(),n.set("width",l);else{var c=function(e,t){var n=0,r=document.createElement("canvas"),o=r.getContext("2d");o.font=t.fontSize+"px "+t.fontFamily;for(var i=0;i1&&(o.forEach((function(e){"select-group"===e.id&&e._objects.forEach((function(e){"select-stroke"===e.id&&e.set({opacity:1})}))})),e.renderAll())}},s=function(t){e.getObjects().forEach((function(t){"group"==t.type&&t._objects.forEach((function(t){"select-stroke"===t.id&&(t.set({opacity:0}),e.renderAll())}))}))};return e.on("mouse:up",o),e.on("path:created",i),e.on("selection:created",a),e.on("selection:updated",a),e.on("selection:cleared",s),{removeEventListeners:function(){e.off("mouse:up",o),e.off("path:created",i),e.off("selection:created",a),e.off("selection:updated",a),e.off("selection:cleared",s)}}};const Hm=function(e,t,n){"select"===t.tool?e.getObjects().length>0&&(e.forEachObject((function(e){e.set({selectable:!0,perPixelTargetFind:!1})})),e.selection=!0,e.renderAll()):(e.selection=!1,e.renderAll());var r=function(n){if("select"===t.tool&&!t.isAddingImage&&n.target&&n.target!=e.getActiveObject()){if("group"===n.target.type&&"select-group"===n.target.id)n.target._objects.find((function(e){return"select-stroke"===e.id})).set({opacity:1});else"group"===n.target.type&&"arrowGroup"===n.target.id?n.target._objects.forEach((function(e){"arrowLineControl"===e.id&&e.set({opacity:1})})):n.target._renderControls(n.target.canvas.contextTop,{hasControls:!1});e.renderAll()}},o=function(n){if("select"===t.tool&&n.target){if(n.target!=e.getActiveObject())if("group"===n.target.type&&"select-group"===n.target.id)n.target._objects.find((function(e){return"select-stroke"===e.id})).set({opacity:0}),e.renderAll();else"group"===n.target.type&&"arrowGroup"===n.target.id&&(n.target._objects.forEach((function(e){"arrowLineControl"===e.id&&e.set({opacity:0})})),e.renderAll());n.target.canvas.clearContext(n.target.canvas.contextTop),e.renderAll()}},i=function(e){t.isAddingImage||"select"===t.tool&&e.target&&e.target.canvas&&e.target.canvas.clearContext(e.target.canvas.contextTop)};return e.on("mouse:over",r),e.on("mouse:out",o),e.on("mouse:down",i),{removeEventListeners:function(){e.off("mouse:over",r),e.off("mouse:out",o),e.off("mouse:down",i)}}};function Um(e){return Um="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Um(e)}function Xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vm(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){var e=setInterval((function(){a((function(e){return e-1}))}),1e3);return function(){return clearInterval(e)}}}),[f,i]);(0,e.useEffect)((function(){v.current=n.countdown}),[n.countdown]);var w=(0,e.useCallback)((function(e,t,r){if("ready-to-record"===e.type)if(v.current)d(!0),c(!0),null!==p.current&&null!==h.current&&(a(3),y.current=!1,b.current.style.pointerEvents="all",setTimeout((function(){null!==p.current&&null!==h.current&&(p.current.style.transform="scale(1)",h.current.style.transform="rotate(90deg)")}),10),setTimeout((function(){null!==p.current&&(p.current.style.transform="scale(.8)")}),1e3*i/2)),setTimeout((function(){if(!y.current){c(!1),d(!1),y.current=!1,a(3),b.current.style.pointerEvents="none";var e=new Audio(chrome.runtime.getURL("/assets/sounds/beep2.mp3"));e.volume=.5,e.play(),setTimeout((function(){n.startRecording()}),500)}}),1e3*i);else if(!y.current){var o=new Audio(chrome.runtime.getURL("/assets/sounds/beep2.mp3"));o.volume=.5,o.play(),c(!1),d(!1),setTimeout((function(){n.startRecording()}),500)}}),[v,n]);return(0,e.useEffect)((function(){return chrome.runtime.onMessage.addListener(w),function(){d(!1),c(!1),a(3),chrome.runtime.onMessage.removeListener(w)}}),[]),e.createElement("div",{className:f?"countdown recording-countdown":"countdown",onClick:function(){f&&(y.current=!0,b.current.style.pointerEvents="none",d(!1),c(!1),a(3),n.dismissRecording(),r((function(e){return Jm(Jm({},e),{},{recording:!1,showPopup:!0,showExtension:!0})})))},ref:b},l&&e.createElement("div",null,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1"},e.createElement("defs",null,e.createElement("filter",{id:"goo"},e.createElement("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"10"}),e.createElement("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10",result:"goo"})))),e.createElement("div",{className:"countdown-circle"},e.createElement("div",{className:"countdown-number"},i),e.createElement("div",{className:"background",ref:h},e.createElement("div",{className:"circle",ref:p}),e.createElement("div",{className:"c c2",ref:g}),e.createElement("div",{className:"c c3",ref:m}))),e.createElement("div",{className:"countdown-info"},chrome.i18n.getMessage("countdownMessage")),e.createElement("div",{className:"countdown-overlay"})))},ov="Dialog",[iv,av]=a(ov),[sv,lv]=iv(ov),cv=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=(0,e.useRef)(null),c=(0,e.useRef)(null),[u=!1,f]=E({prop:o,defaultProp:i,onChange:a});return(0,e.createElement)(sv,{scope:n,triggerRef:l,contentRef:c,contentId:y(),titleId:y(),descriptionId:y(),open:u,onOpenChange:f,onOpenToggle:(0,e.useCallback)((()=>f((e=>!e))),[f]),modal:s},r)},uv="DialogTrigger",fv=(0,e.forwardRef)(((t,n)=>{const{__scopeDialog:o,...a}=t,s=lv(uv,o),l=c(n,s.triggerRef);return(0,e.createElement)(w.button,r({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":jv(s.open)},a,{ref:l,onClick:i(t.onClick,s.onOpenToggle)}))})),dv="DialogPortal",[hv,pv]=iv(dv,{forceMount:void 0}),gv=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=t,a=lv(dv,n);return(0,e.createElement)(hv,{scope:n,forceMount:r},e.Children.map(o,(t=>(0,e.createElement)(X,{present:r||a.open},(0,e.createElement)(su,{asChild:!0,container:i},t)))))},mv="DialogOverlay",vv=(0,e.forwardRef)(((t,n)=>{const o=pv(mv,t.__scopeDialog),{forceMount:i=o.forceMount,...a}=t,s=lv(mv,t.__scopeDialog);return s.modal?(0,e.createElement)(X,{present:i||s.open},(0,e.createElement)(bv,r({},a,{ref:n}))):null})),bv=(0,e.forwardRef)(((t,n)=>{const{__scopeDialog:o,...i}=t,a=lv(mv,o);return(0,e.createElement)(Di,{as:u,allowPinchZoom:!0,shards:[a.contentRef]},(0,e.createElement)(w.div,r({"data-state":jv(a.open)},i,{ref:n,style:{pointerEvents:"auto",...i.style}})))})),yv="DialogContent",wv=(0,e.forwardRef)(((t,n)=>{const o=pv(yv,t.__scopeDialog),{forceMount:i=o.forceMount,...a}=t,s=lv(yv,t.__scopeDialog);return(0,e.createElement)(X,{present:i||s.open},s.modal?(0,e.createElement)(xv,r({},a,{ref:n})):(0,e.createElement)(Sv,r({},a,{ref:n})))})),xv=(0,e.forwardRef)(((t,n)=>{const o=lv(yv,t.__scopeDialog),a=(0,e.useRef)(null),s=c(n,o.contentRef,a);return(0,e.useEffect)((()=>{const e=a.current;if(e)return Qo(e)}),[]),(0,e.createElement)(Ev,r({},t,{ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i(t.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=o.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:i(t.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:i(t.onFocusOutside,(e=>e.preventDefault()))}))})),Sv=(0,e.forwardRef)(((t,n)=>{const o=lv(yv,t.__scopeDialog),i=(0,e.useRef)(!1),a=(0,e.useRef)(!1);return(0,e.createElement)(Ev,r({},t,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var n,r;(null===(n=t.onCloseAutoFocus)||void 0===n||n.call(t,e),e.defaultPrevented)||(i.current||null===(r=o.triggerRef.current)||void 0===r||r.focus(),e.preventDefault());i.current=!1,a.current=!1},onInteractOutside:e=>{var n,r;null===(n=t.onInteractOutside)||void 0===n||n.call(t,e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const s=e.target;(null===(r=o.triggerRef.current)||void 0===r?void 0:r.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}}))})),Ev=(0,e.forwardRef)(((t,n)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,...l}=t,u=lv(yv,o),f=c(n,(0,e.useRef)(null));return Yn(),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Fc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:s},(0,e.createElement)(Oc,r({role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":jv(u.open)},l,{ref:f,onDismiss:()=>u.onOpenChange(!1)}))),!1)})),Cv="DialogTitle",_v=(0,e.forwardRef)(((t,n)=>{const{__scopeDialog:o,...i}=t,a=lv(Cv,o);return(0,e.createElement)(w.h2,r({id:a.titleId},i,{ref:n}))})),Tv="DialogDescription",Ov=(0,e.forwardRef)(((t,n)=>{const{__scopeDialog:o,...i}=t,a=lv(Tv,o);return(0,e.createElement)(w.p,r({id:a.descriptionId},i,{ref:n}))})),kv="DialogClose",Pv=(0,e.forwardRef)(((t,n)=>{const{__scopeDialog:o,...a}=t,s=lv(kv,o);return(0,e.createElement)(w.button,r({type:"button"},a,{ref:n,onClick:i(t.onClick,(()=>s.onOpenChange(!1)))}))}));function jv(e){return e?"open":"closed"}const Av="DialogTitleWarning",[Mv,Dv]=function(t,n){const r=(0,e.createContext)(n);function o(t){const{children:n,...o}=t,i=(0,e.useMemo)((()=>o),Object.values(o));return(0,e.createElement)(r.Provider,{value:i},n)}return o.displayName=t+"Provider",[o,function(o){const i=(0,e.useContext)(r);if(i)return i;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(Av,{contentName:yv,titleName:Cv,docsSlug:"dialog"}),Rv=cv,Iv=fv,Fv=gv,Lv=vv,Nv=wv,zv=_v,Bv=Ov,Wv=Pv,Hv="AlertDialog",[Uv,Xv]=a(Hv,[av]),Vv=av(),Yv=t=>{const{__scopeAlertDialog:n,...o}=t,i=Vv(n);return(0,e.createElement)(Rv,r({},i,o,{modal:!0}))},Gv=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,...i}=t,a=Vv(o);return(0,e.createElement)(Iv,r({},a,i,{ref:n}))})),qv=t=>{const{__scopeAlertDialog:n,...o}=t,i=Vv(n);return(0,e.createElement)(Fv,r({},i,o))},Kv=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,...i}=t,a=Vv(o);return(0,e.createElement)(Lv,r({},a,i,{ref:n}))})),$v="AlertDialogContent",[Qv,Zv]=Uv($v),Jv=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,children:a,...s}=t,l=Vv(o),u=c(n,(0,e.useRef)(null)),f=(0,e.useRef)(null);return(0,e.createElement)(Mv,{contentName:$v,titleName:eb,docsSlug:"alert-dialog"},(0,e.createElement)(Qv,{scope:o,cancelRef:f},(0,e.createElement)(Nv,r({role:"alertdialog"},l,s,{ref:u,onOpenAutoFocus:i(s.onOpenAutoFocus,(e=>{var t;e.preventDefault(),null===(t=f.current)||void 0===t||t.focus({preventScroll:!0})})),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault()}),(0,e.createElement)(d,null,a),!1)))})),eb="AlertDialogTitle",tb=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,...i}=t,a=Vv(o);return(0,e.createElement)(zv,r({},a,i,{ref:n}))})),nb=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,...i}=t,a=Vv(o);return(0,e.createElement)(Bv,r({},a,i,{ref:n}))})),rb=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,...i}=t,a=Vv(o);return(0,e.createElement)(Wv,r({},a,i,{ref:n}))})),ob="AlertDialogCancel",ib=(0,e.forwardRef)(((t,n)=>{const{__scopeAlertDialog:o,...i}=t,{cancelRef:a}=Zv(ob,o),s=Vv(o),l=c(n,a);return(0,e.createElement)(Wv,r({},s,i,{ref:l}))})),ab=Yv,sb=Gv,lb=qv,cb=Kv,ub=Jv,fb=rb,db=ib,hb=tb,pb=nb;function gb(e){return gb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gb(e)}function mb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vb(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,f=arguments.length>9&&void 0!==arguments[9]&&arguments[9],h=arguments.length>10&&void 0!==arguments[10]&&arguments[10],p=arguments.length>11&&void 0!==arguments[11]?arguments[11]:function(){};a(e),c(t),d(n),g(r),C(!0),b((function(){return o})),x((function(){return i})),O(s),j(l),D((function(){return u})),F(f),z(h),H((function(){return p}))}));return(0,e.useEffect)((function(){return r((function(e){return vb(vb({},e),{},{openModal:U})})),function(){r((function(e){return vb(vb({},e),{},{openModal:null})}))}}),[]),e.createElement(ab,{open:E,onOpenChange:function(e){C(e)}},e.createElement(sb,{asChild:!0}),e.createElement(lb,{container:t.shadowRef.current.shadowRoot.querySelector(".container")},e.createElement(cb,{className:"AlertDialogOverlay"}),e.createElement(ub,{className:"AlertDialogContent"},e.createElement(hb,{className:"AlertDialogTitle"},i),e.createElement(pb,{className:"AlertDialogDescription"},l,P&&" ",P&&e.createElement("a",{href:M,target:"_blank"},P)),T&&e.createElement("img",{src:T,style:{width:"100%",marginBottom:15,marginTop:5,borderRadius:"15px"}}),e.createElement("div",{style:{display:"flex",gap:12,justifyContent:"flex-end"}},N&&e.createElement("button",{className:"SideButtonModal",onClick:function(){W(),C(!1)}},N),p&&e.createElement(db,{asChild:!0},e.createElement("button",{className:"Button grey",onClick:function(){return w()}},p)),f&&e.createElement(fb,{asChild:!0},e.createElement("button",{className:I?"Button blue":"Button red",onClick:function(){return v()}},f))))))};function Sb(e){return Sb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sb(e)}function Eb(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Eb=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new j(r||[]);return o(a,"_invoke",{value:T(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var d="suspendedStart",h="suspendedYield",p="executing",g="completed",m={};function v(){}function b(){}function y(){}var w={};c(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==n&&r.call(S,a)&&(w=S);var E=y.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(o,i,a,s){var l=f(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Sb(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function T(t,n,r){var o=d;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function A(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Cb(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function _b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tb(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o},zb=(0,e.createContext)(null);function Bb(t){var n=t.children,r=Nb(t,["children"]);return"string"!=typeof n&&(n=(0,Ab.renderToString)(n)),e.createElement("template",Lb({},r,{dangerouslySetInnerHTML:{__html:n}}))}function Wb(e){var t=e.root,r=e.children;return(0,n.createPortal)(r,t)}Bb.propTypes={children:zt().oneOfType([zt().string,zt().node])},Bb.defaultProps={children:""},Wb.propTypes={root:zt().object.isRequired,children:zt().node},Wb.defaultProps={children:null};var Hb=new Map;var Ub=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"core",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e.children};return new Proxy(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{get:function(r,o){var i=Rb(o,{separator:"-"}),a="".concat(t,"-").concat(i);return Hb.has(a)||Hb.set(a,function(t){var n=(0,e.forwardRef)((function(n,r){var o,i,a=n.mode,s=n.delegatesFocus,l=n.styleSheets,c=n.ssr,u=n.children,f=Nb(n,["mode","delegatesFocus","styleSheets","ssr","children"]),d=(i=(0,e.useRef)((o=r)&&o.current),(0,e.useEffect)((function(){o&&(o.current=i.current)}),[o]),i),h=(0,e.useState)(null),p=Fb(h,2),g=p[0],m=p[1],v="node_".concat(a).concat(s);return(0,e.useLayoutEffect)((function(){if(d.current)try{if("function"==typeof r&&r(d.current),c){var e=d.current.shadowRoot;return void m(e)}var t=d.current.attachShadow({mode:a,delegatesFocus:s});l.length>0&&(t.adoptedStyleSheets=l),m(t)}catch(e){!function(e){var t=e.error,n=e.styleSheets,r=e.root;if("NotSupportedError"!==t.name)throw t;n.length>0&&(r.adoptedStyleSheets=n)}({error:e,styleSheets:l,root:g})}}),[r,d,l]),e.createElement(e.Fragment,null,e.createElement(t.tag,Lb({key:v,ref:d},f),(g||c)&&e.createElement(zb.Provider,{value:g},c?e.createElement(Bb,{shadowroot:a,shadowrootmode:a},t.render({root:g,ssr:c,children:u})):e.createElement(Wb,{root:g},t.render({root:g,ssr:c,children:u})))))}));return n.propTypes={mode:zt().oneOf(["open","closed"]),delegatesFocus:zt().bool,styleSheets:zt().arrayOf(zt().instanceOf(globalThis.CSSStyleSheet)),ssr:zt().bool,children:zt().node},n.defaultProps={mode:"open",delegatesFocus:!1,styleSheets:[],ssr:!1,children:null},n}({tag:i,render:n})),Hb.get(a)}})}();const Xb=Ub;function Vb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(document.querySelector("#screenity-ui")&&t.disconnect())}))}));t.observe(document.body,{childList:!0,subtree:!0})}}),500),function(){setTimeout((function(){observer.disconnect();var e=document.querySelector("#screenity-zoom-wrap");if(e){for(;e.firstChild;)document.body.prepend(e.firstChild);document.body.contains(e)&&document.body.removeChild(e)}a.current=1,s.current=0,l.current=0,i(a.current)}),500)}}),[n.zoomEnabled,n.showExtension]),(0,e.useEffect)((function(){setTimeout((function(){if(!n.zoomEnabled||!n.showExtension){var e=document.querySelector("#screenity-zoom-wrap");if(e){for(;e.firstChild;)document.body.prepend(e.firstChild);document.body.contains(e)&&document.body.removeChild(e)}a.current=1,s.current=0,l.current=0,i(a.current)}}),500)}),[n.zoomEnabled,n.showExtension]),(0,e.useEffect)((function(){h.current&&w.current.zoomEnabled&&(f.current||d.current)&&T()}),[o]),null};function qb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n