@lichens-innovation/react-native-common 3.10.0 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/index.d.ts +1860 -9
- package/dist/index.js +4666 -9
- package/dist/index.js.map +1 -1
- package/dist/rjsf.d.ts +125 -0
- package/dist/rjsf.js +1484 -0
- package/dist/rjsf.js.map +1 -0
- package/package.json +45 -8
- package/dist/components/battery/battery-level.d.ts +0 -9
- package/dist/components/battery/battery-level.js +0 -9
- package/dist/components/battery/battery-level.js.map +0 -1
- package/dist/components/battery/battery.utils.d.ts +0 -2
- package/dist/components/battery/battery.utils.js +0 -24
- package/dist/components/battery/battery.utils.js.map +0 -1
- package/dist/components/battery/index.d.ts +0 -2
- package/dist/components/battery/index.js +0 -3
- package/dist/components/battery/index.js.map +0 -1
- package/dist/components/bottom-sheet/bottom-sheet.constants.d.ts +0 -1
- package/dist/components/bottom-sheet/bottom-sheet.constants.js +0 -2
- package/dist/components/bottom-sheet/bottom-sheet.constants.js.map +0 -1
- package/dist/components/bottom-sheet/default-backdrop.d.ts +0 -3
- package/dist/components/bottom-sheet/default-backdrop.js +0 -4
- package/dist/components/bottom-sheet/default-backdrop.js.map +0 -1
- package/dist/components/bottom-sheet/default-backdrop.windows.d.ts +0 -2
- package/dist/components/bottom-sheet/default-backdrop.windows.js +0 -3
- package/dist/components/bottom-sheet/default-backdrop.windows.js.map +0 -1
- package/dist/components/bottom-sheet/default-sheet-background.d.ts +0 -3
- package/dist/components/bottom-sheet/default-sheet-background.js +0 -8
- package/dist/components/bottom-sheet/default-sheet-background.js.map +0 -1
- package/dist/components/bottom-sheet/index.d.ts +0 -4
- package/dist/components/bottom-sheet/index.js +0 -5
- package/dist/components/bottom-sheet/index.js.map +0 -1
- package/dist/components/bottom-sheet/use-bottom-sheet-toggler.d.ts +0 -7
- package/dist/components/bottom-sheet/use-bottom-sheet-toggler.js +0 -39
- package/dist/components/bottom-sheet/use-bottom-sheet-toggler.js.map +0 -1
- package/dist/components/code-scanner/barcode-scanner-dialog.d.ts +0 -11
- package/dist/components/code-scanner/barcode-scanner-dialog.js +0 -32
- package/dist/components/code-scanner/barcode-scanner-dialog.js.map +0 -1
- package/dist/components/code-scanner/barcode-scanner.d.ts +0 -7
- package/dist/components/code-scanner/barcode-scanner.js +0 -34
- package/dist/components/code-scanner/barcode-scanner.js.map +0 -1
- package/dist/components/code-scanner/barcode-scanner.utils.d.ts +0 -4
- package/dist/components/code-scanner/barcode-scanner.utils.js +0 -38
- package/dist/components/code-scanner/barcode-scanner.utils.js.map +0 -1
- package/dist/components/code-scanner/index.d.ts +0 -3
- package/dist/components/code-scanner/index.js +0 -4
- package/dist/components/code-scanner/index.js.map +0 -1
- package/dist/components/dialogs/dialog-close-only.d.ts +0 -12
- package/dist/components/dialogs/dialog-close-only.js +0 -39
- package/dist/components/dialogs/dialog-close-only.js.map +0 -1
- package/dist/components/dialogs/dialog-ok-cancel.d.ts +0 -13
- package/dist/components/dialogs/dialog-ok-cancel.js +0 -44
- package/dist/components/dialogs/dialog-ok-cancel.js.map +0 -1
- package/dist/components/dialogs/dialog-single-textinput.d.ts +0 -16
- package/dist/components/dialogs/dialog-single-textinput.js +0 -59
- package/dist/components/dialogs/dialog-single-textinput.js.map +0 -1
- package/dist/components/dialogs/dialog-syntax-color-result.d.ts +0 -14
- package/dist/components/dialogs/dialog-syntax-color-result.js +0 -47
- package/dist/components/dialogs/dialog-syntax-color-result.js.map +0 -1
- package/dist/components/dialogs/index.d.ts +0 -5
- package/dist/components/dialogs/index.js +0 -6
- package/dist/components/dialogs/index.js.map +0 -1
- package/dist/components/dialogs/use-dialog-styles.d.ts +0 -4
- package/dist/components/dialogs/use-dialog-styles.js +0 -13
- package/dist/components/dialogs/use-dialog-styles.js.map +0 -1
- package/dist/components/drop-down-selector/drop-down-selector-item.d.ts +0 -8
- package/dist/components/drop-down-selector/drop-down-selector-item.js +0 -24
- package/dist/components/drop-down-selector/drop-down-selector-item.js.map +0 -1
- package/dist/components/drop-down-selector/drop-down-selector-left-icon.d.ts +0 -7
- package/dist/components/drop-down-selector/drop-down-selector-left-icon.js +0 -9
- package/dist/components/drop-down-selector/drop-down-selector-left-icon.js.map +0 -1
- package/dist/components/drop-down-selector/drop-down-selector.d.ts +0 -17
- package/dist/components/drop-down-selector/drop-down-selector.js +0 -60
- package/dist/components/drop-down-selector/drop-down-selector.js.map +0 -1
- package/dist/components/drop-down-selector/drop-down-selector.utils.d.ts +0 -22
- package/dist/components/drop-down-selector/drop-down-selector.utils.js +0 -37
- package/dist/components/drop-down-selector/drop-down-selector.utils.js.map +0 -1
- package/dist/components/drop-down-selector/drop-down-selector.windows.d.ts +0 -2
- package/dist/components/drop-down-selector/drop-down-selector.windows.js +0 -3
- package/dist/components/drop-down-selector/drop-down-selector.windows.js.map +0 -1
- package/dist/components/drop-down-selector/index.d.ts +0 -1
- package/dist/components/drop-down-selector/index.js +0 -2
- package/dist/components/drop-down-selector/index.js.map +0 -1
- package/dist/components/error/error-boundary-screen.d.ts +0 -2
- package/dist/components/error/error-boundary-screen.js +0 -35
- package/dist/components/error/error-boundary-screen.js.map +0 -1
- package/dist/components/error/error-boundary-screen.windows.d.ts +0 -2
- package/dist/components/error/error-boundary-screen.windows.js +0 -3
- package/dist/components/error/error-boundary-screen.windows.js.map +0 -1
- package/dist/components/error/error-boundary.d.ts +0 -3
- package/dist/components/error/error-boundary.js +0 -27
- package/dist/components/error/error-boundary.js.map +0 -1
- package/dist/components/error/error-boundary.windows.d.ts +0 -2
- package/dist/components/error/error-boundary.windows.js +0 -3
- package/dist/components/error/error-boundary.windows.js.map +0 -1
- package/dist/components/error/error-details.d.ts +0 -7
- package/dist/components/error/error-details.js +0 -32
- package/dist/components/error/error-details.js.map +0 -1
- package/dist/components/error/index.d.ts +0 -4
- package/dist/components/error/index.js +0 -5
- package/dist/components/error/index.js.map +0 -1
- package/dist/components/error/use-error-details.d.ts +0 -7
- package/dist/components/error/use-error-details.js +0 -19
- package/dist/components/error/use-error-details.js.map +0 -1
- package/dist/components/event-logs/event-logs-screen.d.ts +0 -2
- package/dist/components/event-logs/event-logs-screen.js +0 -63
- package/dist/components/event-logs/event-logs-screen.js.map +0 -1
- package/dist/components/event-logs/index.d.ts +0 -2
- package/dist/components/event-logs/index.js +0 -3
- package/dist/components/event-logs/index.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/index.d.ts +0 -6
- package/dist/components/event-logs/live-logs-viewer/index.js +0 -7
- package/dist/components/event-logs/live-logs-viewer/index.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/log-entry-item-suffix.d.ts +0 -7
- package/dist/components/event-logs/live-logs-viewer/log-entry-item-suffix.js +0 -6
- package/dist/components/event-logs/live-logs-viewer/log-entry-item-suffix.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/log-entry-item.d.ts +0 -7
- package/dist/components/event-logs/live-logs-viewer/log-entry-item.js +0 -35
- package/dist/components/event-logs/live-logs-viewer/log-entry-item.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/logs-viewer.d.ts +0 -7
- package/dist/components/event-logs/live-logs-viewer/logs-viewer.js +0 -44
- package/dist/components/event-logs/live-logs-viewer/logs-viewer.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/logs-viewer.utils.d.ts +0 -1
- package/dist/components/event-logs/live-logs-viewer/logs-viewer.utils.js +0 -6
- package/dist/components/event-logs/live-logs-viewer/logs-viewer.utils.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/use-auto-scroll.d.ts +0 -7
- package/dist/components/event-logs/live-logs-viewer/use-auto-scroll.js +0 -20
- package/dist/components/event-logs/live-logs-viewer/use-auto-scroll.js.map +0 -1
- package/dist/components/event-logs/live-logs-viewer/use-logs-actions.d.ts +0 -6
- package/dist/components/event-logs/live-logs-viewer/use-logs-actions.js +0 -24
- package/dist/components/event-logs/live-logs-viewer/use-logs-actions.js.map +0 -1
- package/dist/components/header-actions/header-back-button.d.ts +0 -2
- package/dist/components/header-actions/header-back-button.js +0 -5
- package/dist/components/header-actions/header-back-button.js.map +0 -1
- package/dist/components/header-actions/header-back-button.windows.d.ts +0 -2
- package/dist/components/header-actions/header-back-button.windows.js +0 -3
- package/dist/components/header-actions/header-back-button.windows.js.map +0 -1
- package/dist/components/header-actions/header-button.d.ts +0 -7
- package/dist/components/header-actions/header-button.js +0 -18
- package/dist/components/header-actions/header-button.js.map +0 -1
- package/dist/components/header-actions/index.d.ts +0 -2
- package/dist/components/header-actions/index.js +0 -3
- package/dist/components/header-actions/index.js.map +0 -1
- package/dist/components/index.d.ts +0 -19
- package/dist/components/index.js +0 -20
- package/dist/components/index.js.map +0 -1
- package/dist/components/language-selector/index.d.ts +0 -4
- package/dist/components/language-selector/index.js +0 -5
- package/dist/components/language-selector/index.js.map +0 -1
- package/dist/components/language-selector/language-selector-menu.d.ts +0 -3
- package/dist/components/language-selector/language-selector-menu.js +0 -13
- package/dist/components/language-selector/language-selector-menu.js.map +0 -1
- package/dist/components/language-selector/language-selector-segmented.d.ts +0 -3
- package/dist/components/language-selector/language-selector-segmented.js +0 -9
- package/dist/components/language-selector/language-selector-segmented.js.map +0 -1
- package/dist/components/language-selector/language-selector.d.ts +0 -3
- package/dist/components/language-selector/language-selector.js +0 -10
- package/dist/components/language-selector/language-selector.js.map +0 -1
- package/dist/components/language-selector/language-selector.types.d.ts +0 -9
- package/dist/components/language-selector/language-selector.types.js +0 -1
- package/dist/components/language-selector/language-selector.types.js.map +0 -1
- package/dist/components/layout/full-centered.d.ts +0 -7
- package/dist/components/layout/full-centered.js +0 -4
- package/dist/components/layout/full-centered.js.map +0 -1
- package/dist/components/layout/index.d.ts +0 -4
- package/dist/components/layout/index.js +0 -5
- package/dist/components/layout/index.js.map +0 -1
- package/dist/components/layout/orientation-aware-tabs/index.d.ts +0 -2
- package/dist/components/layout/orientation-aware-tabs/index.js +0 -3
- package/dist/components/layout/orientation-aware-tabs/index.js.map +0 -1
- package/dist/components/layout/orientation-aware-tabs/orientation-aware-tab-button.d.ts +0 -9
- package/dist/components/layout/orientation-aware-tabs/orientation-aware-tab-button.js +0 -40
- package/dist/components/layout/orientation-aware-tabs/orientation-aware-tab-button.js.map +0 -1
- package/dist/components/layout/orientation-aware-tabs/orientation-aware-tabs-layout.d.ts +0 -15
- package/dist/components/layout/orientation-aware-tabs/orientation-aware-tabs-layout.js +0 -40
- package/dist/components/layout/orientation-aware-tabs/orientation-aware-tabs-layout.js.map +0 -1
- package/dist/components/layout/resizable/horizontal-resizable-split-view.d.ts +0 -3
- package/dist/components/layout/resizable/horizontal-resizable-split-view.js +0 -80
- package/dist/components/layout/resizable/horizontal-resizable-split-view.js.map +0 -1
- package/dist/components/layout/resizable/horizontal-resizable-split-view.types.d.ts +0 -20
- package/dist/components/layout/resizable/horizontal-resizable-split-view.types.js +0 -1
- package/dist/components/layout/resizable/horizontal-resizable-split-view.types.js.map +0 -1
- package/dist/components/layout/resizable/horizontal-resizable-split-view.utils.d.ts +0 -2
- package/dist/components/layout/resizable/horizontal-resizable-split-view.utils.js +0 -23
- package/dist/components/layout/resizable/horizontal-resizable-split-view.utils.js.map +0 -1
- package/dist/components/layout/resizable/index.d.ts +0 -6
- package/dist/components/layout/resizable/index.js +0 -7
- package/dist/components/layout/resizable/index.js.map +0 -1
- package/dist/components/layout/resizable/resizable-overlay-view.d.ts +0 -3
- package/dist/components/layout/resizable/resizable-overlay-view.js +0 -132
- package/dist/components/layout/resizable/resizable-overlay-view.js.map +0 -1
- package/dist/components/layout/resizable/resizable-overlay-view.utils.d.ts +0 -16
- package/dist/components/layout/resizable/resizable-overlay-view.utils.js +0 -19
- package/dist/components/layout/resizable/resizable-overlay-view.utils.js.map +0 -1
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.types.d.ts +0 -28
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.types.js +0 -1
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.types.js.map +0 -1
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.utils.d.ts +0 -2
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.utils.js +0 -31
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.utils.js.map +0 -1
- package/dist/components/layout/resizable/vertical-resizable-split-view.d.ts +0 -3
- package/dist/components/layout/resizable/vertical-resizable-split-view.js +0 -79
- package/dist/components/layout/resizable/vertical-resizable-split-view.js.map +0 -1
- package/dist/components/layout/resizable/vertical-resizable-split-view.types.d.ts +0 -20
- package/dist/components/layout/resizable/vertical-resizable-split-view.types.js +0 -1
- package/dist/components/layout/resizable/vertical-resizable-split-view.types.js.map +0 -1
- package/dist/components/layout/resizable/vertical-resizable-split-view.utils.d.ts +0 -2
- package/dist/components/layout/resizable/vertical-resizable-split-view.utils.js +0 -23
- package/dist/components/layout/resizable/vertical-resizable-split-view.utils.js.map +0 -1
- package/dist/components/layout/safe-container.d.ts +0 -8
- package/dist/components/layout/safe-container.js +0 -18
- package/dist/components/layout/safe-container.js.map +0 -1
- package/dist/components/layout/safe-container.windows.d.ts +0 -8
- package/dist/components/layout/safe-container.windows.js +0 -16
- package/dist/components/layout/safe-container.windows.js.map +0 -1
- package/dist/components/lists/index.d.ts +0 -2
- package/dist/components/lists/index.js +0 -3
- package/dist/components/lists/index.js.map +0 -1
- package/dist/components/lists/list-header.d.ts +0 -5
- package/dist/components/lists/list-header.js +0 -17
- package/dist/components/lists/list-header.js.map +0 -1
- package/dist/components/lists/list-items-separator.d.ts +0 -2
- package/dist/components/lists/list-items-separator.js +0 -17
- package/dist/components/lists/list-items-separator.js.map +0 -1
- package/dist/components/on-off-toggle/index.d.ts +0 -1
- package/dist/components/on-off-toggle/index.js +0 -2
- package/dist/components/on-off-toggle/index.js.map +0 -1
- package/dist/components/on-off-toggle/on-off-toggle.d.ts +0 -9
- package/dist/components/on-off-toggle/on-off-toggle.js +0 -27
- package/dist/components/on-off-toggle/on-off-toggle.js.map +0 -1
- package/dist/components/password-input/index.d.ts +0 -1
- package/dist/components/password-input/index.js +0 -2
- package/dist/components/password-input/index.js.map +0 -1
- package/dist/components/password-input/password-input.d.ts +0 -4
- package/dist/components/password-input/password-input.js +0 -27
- package/dist/components/password-input/password-input.js.map +0 -1
- package/dist/components/score-indicator/index.d.ts +0 -1
- package/dist/components/score-indicator/index.js +0 -2
- package/dist/components/score-indicator/index.js.map +0 -1
- package/dist/components/score-indicator/score-indicator.d.ts +0 -6
- package/dist/components/score-indicator/score-indicator.js +0 -31
- package/dist/components/score-indicator/score-indicator.js.map +0 -1
- package/dist/components/snack-bar/index.d.ts +0 -2
- package/dist/components/snack-bar/index.js +0 -3
- package/dist/components/snack-bar/index.js.map +0 -1
- package/dist/components/snack-bar/snackbar-provider.d.ts +0 -8
- package/dist/components/snack-bar/snackbar-provider.js +0 -31
- package/dist/components/snack-bar/snackbar-provider.js.map +0 -1
- package/dist/components/snack-bar/snackbar.constants.d.ts +0 -5
- package/dist/components/snack-bar/snackbar.constants.js +0 -6
- package/dist/components/snack-bar/snackbar.constants.js.map +0 -1
- package/dist/components/spinner/activity-progress-bar-stats.d.ts +0 -8
- package/dist/components/spinner/activity-progress-bar-stats.js +0 -27
- package/dist/components/spinner/activity-progress-bar-stats.js.map +0 -1
- package/dist/components/spinner/activity-progress-bar.d.ts +0 -10
- package/dist/components/spinner/activity-progress-bar.js +0 -21
- package/dist/components/spinner/activity-progress-bar.js.map +0 -1
- package/dist/components/spinner/activity-progress.utils.d.ts +0 -10
- package/dist/components/spinner/activity-progress.utils.js +0 -20
- package/dist/components/spinner/activity-progress.utils.js.map +0 -1
- package/dist/components/spinner/full-centered-spinner.d.ts +0 -2
- package/dist/components/spinner/full-centered-spinner.js +0 -5
- package/dist/components/spinner/full-centered-spinner.js.map +0 -1
- package/dist/components/spinner/index.d.ts +0 -5
- package/dist/components/spinner/index.js +0 -6
- package/dist/components/spinner/index.js.map +0 -1
- package/dist/components/spinner/modal-spinner.d.ts +0 -9
- package/dist/components/spinner/modal-spinner.js +0 -34
- package/dist/components/spinner/modal-spinner.js.map +0 -1
- package/dist/components/syntax/index.d.ts +0 -4
- package/dist/components/syntax/index.js +0 -5
- package/dist/components/syntax/index.js.map +0 -1
- package/dist/components/syntax/styles/dark.d.ts +0 -92
- package/dist/components/syntax/styles/dark.js +0 -92
- package/dist/components/syntax/styles/dark.js.map +0 -1
- package/dist/components/syntax/styles/index.d.ts +0 -2
- package/dist/components/syntax/styles/index.js +0 -3
- package/dist/components/syntax/styles/index.js.map +0 -1
- package/dist/components/syntax/styles/light.d.ts +0 -110
- package/dist/components/syntax/styles/light.js +0 -110
- package/dist/components/syntax/styles/light.js.map +0 -1
- package/dist/components/syntax/syntax-coloring-tag-code.d.ts +0 -9
- package/dist/components/syntax/syntax-coloring-tag-code.js +0 -27
- package/dist/components/syntax/syntax-coloring-tag-code.js.map +0 -1
- package/dist/components/syntax/syntax-coloring-tag-pre.d.ts +0 -9
- package/dist/components/syntax/syntax-coloring-tag-pre.js +0 -18
- package/dist/components/syntax/syntax-coloring-tag-pre.js.map +0 -1
- package/dist/components/syntax/syntax-coloring.d.ts +0 -8
- package/dist/components/syntax/syntax-coloring.js +0 -25
- package/dist/components/syntax/syntax-coloring.js.map +0 -1
- package/dist/components/tab-bar-icon.d.ts +0 -14
- package/dist/components/tab-bar-icon.js +0 -12
- package/dist/components/tab-bar-icon.js.map +0 -1
- package/dist/components/voice-recognition/index.d.ts +0 -2
- package/dist/components/voice-recognition/index.js +0 -3
- package/dist/components/voice-recognition/index.js.map +0 -1
- package/dist/components/voice-recognition/voice-recognition-text-input.d.ts +0 -10
- package/dist/components/voice-recognition/voice-recognition-text-input.js +0 -104
- package/dist/components/voice-recognition/voice-recognition-text-input.js.map +0 -1
- package/dist/components/voice-recognition/voice-recognition.utils.d.ts +0 -7
- package/dist/components/voice-recognition/voice-recognition.utils.js +0 -24
- package/dist/components/voice-recognition/voice-recognition.utils.js.map +0 -1
- package/dist/config/env.config.d.ts +0 -2
- package/dist/config/env.config.js +0 -4
- package/dist/config/env.config.js.map +0 -1
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -2
- package/dist/config/index.js.map +0 -1
- package/dist/hooks/camera-image-picker/camera-image-picker.utils.d.ts +0 -4
- package/dist/hooks/camera-image-picker/camera-image-picker.utils.js +0 -16
- package/dist/hooks/camera-image-picker/camera-image-picker.utils.js.map +0 -1
- package/dist/hooks/camera-image-picker/index.d.ts +0 -2
- package/dist/hooks/camera-image-picker/index.js +0 -3
- package/dist/hooks/camera-image-picker/index.js.map +0 -1
- package/dist/hooks/camera-image-picker/use-camera-image-picker.d.ts +0 -5
- package/dist/hooks/camera-image-picker/use-camera-image-picker.js +0 -53
- package/dist/hooks/camera-image-picker/use-camera-image-picker.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/use-animate-on-focus.windows.d.ts +0 -1
- package/dist/hooks/use-animate-on-focus.windows.js +0 -5
- package/dist/hooks/use-animate-on-focus.windows.js.map +0 -1
- package/dist/hooks/use-image-picker.d.ts +0 -11
- package/dist/hooks/use-image-picker.js +0 -35
- package/dist/hooks/use-image-picker.js.map +0 -1
- package/dist/hooks/use-image-picker.windows.d.ts +0 -1
- package/dist/hooks/use-image-picker.windows.js +0 -5
- package/dist/hooks/use-image-picker.windows.js.map +0 -1
- package/dist/hooks/use-invalidate-queries-on-focus.d.ts +0 -2
- package/dist/hooks/use-invalidate-queries-on-focus.js +0 -11
- package/dist/hooks/use-invalidate-queries-on-focus.js.map +0 -1
- package/dist/hooks/use-on-html-message.d.ts +0 -5
- package/dist/hooks/use-on-html-message.js +0 -30
- package/dist/hooks/use-on-html-message.js.map +0 -1
- package/dist/hooks/use-single-file-selector.d.ts +0 -17
- package/dist/hooks/use-single-file-selector.js +0 -32
- package/dist/hooks/use-single-file-selector.js.map +0 -1
- package/dist/hooks/use-single-file-selector.windows.d.ts +0 -1
- package/dist/hooks/use-single-file-selector.windows.js +0 -5
- package/dist/hooks/use-single-file-selector.windows.js.map +0 -1
- package/dist/hooks/use-timeout-state.d.ts +0 -1
- package/dist/hooks/use-timeout-state.js +0 -11
- package/dist/hooks/use-timeout-state.js.map +0 -1
- package/dist/hooks/use-timeout-toggle.d.ts +0 -1
- package/dist/hooks/use-timeout-toggle.js +0 -20
- package/dist/hooks/use-timeout-toggle.js.map +0 -1
- package/dist/hooks/use-updates.d.ts +0 -8
- package/dist/hooks/use-updates.js +0 -68
- package/dist/hooks/use-updates.js.map +0 -1
- package/dist/hooks/use-updates.windows.d.ts +0 -1
- package/dist/hooks/use-updates.windows.js +0 -5
- package/dist/hooks/use-updates.windows.js.map +0 -1
- package/dist/hooks/use-window-orientation.d.ts +0 -3
- package/dist/hooks/use-window-orientation.js +0 -10
- package/dist/hooks/use-window-orientation.js.map +0 -1
- package/dist/i18n/en/common.json +0 -188
- package/dist/i18n/fr/common.json +0 -188
- package/dist/i18n/i18n.d.ts +0 -17
- package/dist/i18n/i18n.js +0 -47
- package/dist/i18n/i18n.js.map +0 -1
- package/dist/i18n/i18n.utils.d.ts +0 -1
- package/dist/i18n/i18n.utils.js +0 -7
- package/dist/i18n/i18n.utils.js.map +0 -1
- package/dist/i18n/i18n.utils.windows.d.ts +0 -1
- package/dist/i18n/i18n.utils.windows.js +0 -6
- package/dist/i18n/i18n.utils.windows.js.map +0 -1
- package/dist/i18n/index.d.ts +0 -2
- package/dist/i18n/index.js +0 -3
- package/dist/i18n/index.js.map +0 -1
- package/dist/logger/index.d.ts +0 -4
- package/dist/logger/index.js +0 -5
- package/dist/logger/index.js.map +0 -1
- package/dist/logger/logger.d.ts +0 -17
- package/dist/logger/logger.js +0 -163
- package/dist/logger/logger.js.map +0 -1
- package/dist/logger/logger.types.d.ts +0 -25
- package/dist/logger/logger.types.js +0 -8
- package/dist/logger/logger.types.js.map +0 -1
- package/dist/logger/logger.utils.d.ts +0 -6
- package/dist/logger/logger.utils.js +0 -40
- package/dist/logger/logger.utils.js.map +0 -1
- package/dist/logger/logger.windows.d.ts +0 -18
- package/dist/logger/logger.windows.js +0 -65
- package/dist/logger/logger.windows.js.map +0 -1
- package/dist/logger/use-log-entry-color.d.ts +0 -1
- package/dist/logger/use-log-entry-color.js +0 -23
- package/dist/logger/use-log-entry-color.js.map +0 -1
- package/dist/services/device-finder/device-finder.d.ts +0 -31
- package/dist/services/device-finder/device-finder.js +0 -105
- package/dist/services/device-finder/device-finder.js.map +0 -1
- package/dist/services/device-finder/device-finder.types.d.ts +0 -8
- package/dist/services/device-finder/device-finder.types.js +0 -1
- package/dist/services/device-finder/device-finder.types.js.map +0 -1
- package/dist/services/device-finder/device-finder.windows.d.ts +0 -18
- package/dist/services/device-finder/device-finder.windows.js +0 -48
- package/dist/services/device-finder/device-finder.windows.js.map +0 -1
- package/dist/services/device-finder/index.d.ts +0 -2
- package/dist/services/device-finder/index.js +0 -3
- package/dist/services/device-finder/index.js.map +0 -1
- package/dist/services/files/index.d.ts +0 -2
- package/dist/services/files/index.js +0 -3
- package/dist/services/files/index.js.map +0 -1
- package/dist/services/files/native-file-system.d.ts +0 -15
- package/dist/services/files/native-file-system.js +0 -101
- package/dist/services/files/native-file-system.js.map +0 -1
- package/dist/services/files/native-file-system.types.d.ts +0 -38
- package/dist/services/files/native-file-system.types.js +0 -6
- package/dist/services/files/native-file-system.types.js.map +0 -1
- package/dist/services/files/native-file-system.windows.d.ts +0 -14
- package/dist/services/files/native-file-system.windows.js +0 -31
- package/dist/services/files/native-file-system.windows.js.map +0 -1
- package/dist/services/index.d.ts +0 -3
- package/dist/services/index.js +0 -4
- package/dist/services/index.js.map +0 -1
- package/dist/services/wifi/index.d.ts +0 -6
- package/dist/services/wifi/index.js +0 -7
- package/dist/services/wifi/index.js.map +0 -1
- package/dist/services/wifi/query-keys.d.ts +0 -10
- package/dist/services/wifi/query-keys.js +0 -11
- package/dist/services/wifi/query-keys.js.map +0 -1
- package/dist/services/wifi/use-wifi-info.d.ts +0 -472
- package/dist/services/wifi/use-wifi-info.js +0 -95
- package/dist/services/wifi/use-wifi-info.js.map +0 -1
- package/dist/services/wifi/wifi-info.types.d.ts +0 -22
- package/dist/services/wifi/wifi-info.types.js +0 -21
- package/dist/services/wifi/wifi-info.types.js.map +0 -1
- package/dist/services/wifi/wifi-info.utils.d.ts +0 -15
- package/dist/services/wifi/wifi-info.utils.js +0 -114
- package/dist/services/wifi/wifi-info.utils.js.map +0 -1
- package/dist/services/wifi/wifi-info.utils.simulator.d.ts +0 -3
- package/dist/services/wifi/wifi-info.utils.simulator.js +0 -23
- package/dist/services/wifi/wifi-info.utils.simulator.js.map +0 -1
- package/dist/services/wifi/wifi-info.utils.windows.d.ts +0 -2
- package/dist/services/wifi/wifi-info.utils.windows.js +0 -6
- package/dist/services/wifi/wifi-info.utils.windows.js.map +0 -1
- package/dist/services/wifi/wifi-infos-context.d.ts +0 -170
- package/dist/services/wifi/wifi-infos-context.js +0 -34
- package/dist/services/wifi/wifi-infos-context.js.map +0 -1
- package/dist/store/common-logs.store.d.ts +0 -13
- package/dist/store/common-logs.store.js +0 -32
- package/dist/store/common-logs.store.js.map +0 -1
- package/dist/store/common.store.d.ts +0 -12
- package/dist/store/common.store.js +0 -40
- package/dist/store/common.store.js.map +0 -1
- package/dist/store/index.d.ts +0 -3
- package/dist/store/index.js +0 -4
- package/dist/store/index.js.map +0 -1
- package/dist/store/react-query-provider.d.ts +0 -4
- package/dist/store/react-query-provider.js +0 -7
- package/dist/store/react-query-provider.js.map +0 -1
- package/dist/theme/dark-colors-scheme.d.ts +0 -42
- package/dist/theme/dark-colors-scheme.js +0 -44
- package/dist/theme/dark-colors-scheme.js.map +0 -1
- package/dist/theme/index.d.ts +0 -3
- package/dist/theme/index.js +0 -4
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/light-colors-scheme.d.ts +0 -42
- package/dist/theme/light-colors-scheme.js +0 -44
- package/dist/theme/light-colors-scheme.js.map +0 -1
- package/dist/theme/theme.d.ts +0 -171
- package/dist/theme/theme.js +0 -27
- package/dist/theme/theme.js.map +0 -1
- package/dist/utils/alert.utils.d.ts +0 -1
- package/dist/utils/alert.utils.js +0 -12
- package/dist/utils/alert.utils.js.map +0 -1
- package/dist/utils/axios.config.d.ts +0 -2
- package/dist/utils/axios.config.js +0 -15
- package/dist/utils/axios.config.js.map +0 -1
- package/dist/utils/base64.utils.d.ts +0 -2
- package/dist/utils/base64.utils.js +0 -8
- package/dist/utils/base64.utils.js.map +0 -1
- package/dist/utils/clipboard.utils.d.ts +0 -1
- package/dist/utils/clipboard.utils.js +0 -12
- package/dist/utils/clipboard.utils.js.map +0 -1
- package/dist/utils/date.utils.d.ts +0 -3
- package/dist/utils/date.utils.js +0 -15
- package/dist/utils/date.utils.js.map +0 -1
- package/dist/utils/device.utils.d.ts +0 -4
- package/dist/utils/device.utils.js +0 -28
- package/dist/utils/device.utils.js.map +0 -1
- package/dist/utils/device.utils.windows.d.ts +0 -3
- package/dist/utils/device.utils.windows.js +0 -11
- package/dist/utils/device.utils.windows.js.map +0 -1
- package/dist/utils/digest-auth.d.ts +0 -32
- package/dist/utils/digest-auth.js +0 -157
- package/dist/utils/digest-auth.js.map +0 -1
- package/dist/utils/env.utils.d.ts +0 -5
- package/dist/utils/env.utils.js +0 -32
- package/dist/utils/env.utils.js.map +0 -1
- package/dist/utils/env.utils.windows.d.ts +0 -3
- package/dist/utils/env.utils.windows.js +0 -11
- package/dist/utils/env.utils.windows.js.map +0 -1
- package/dist/utils/errors.utils.d.ts +0 -6
- package/dist/utils/errors.utils.js +0 -9
- package/dist/utils/errors.utils.js.map +0 -1
- package/dist/utils/file-picker.utils.d.ts +0 -30
- package/dist/utils/file-picker.utils.js +0 -18
- package/dist/utils/file-picker.utils.js.map +0 -1
- package/dist/utils/file-picker.utils.windows.d.ts +0 -9
- package/dist/utils/file-picker.utils.windows.js +0 -6
- package/dist/utils/file-picker.utils.windows.js.map +0 -1
- package/dist/utils/file.utils.d.ts +0 -28
- package/dist/utils/file.utils.js +0 -105
- package/dist/utils/file.utils.js.map +0 -1
- package/dist/utils/filename.utils.d.ts +0 -40
- package/dist/utils/filename.utils.js +0 -129
- package/dist/utils/filename.utils.js.map +0 -1
- package/dist/utils/font.utils.d.ts +0 -1
- package/dist/utils/font.utils.js +0 -8
- package/dist/utils/font.utils.js.map +0 -1
- package/dist/utils/image.utils.d.ts +0 -1
- package/dist/utils/image.utils.js +0 -16
- package/dist/utils/image.utils.js.map +0 -1
- package/dist/utils/index.d.ts +0 -22
- package/dist/utils/index.js +0 -23
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/licences.utils.d.ts +0 -16
- package/dist/utils/licences.utils.js +0 -19
- package/dist/utils/licences.utils.js.map +0 -1
- package/dist/utils/linking.utils.d.ts +0 -3
- package/dist/utils/linking.utils.js +0 -33
- package/dist/utils/linking.utils.js.map +0 -1
- package/dist/utils/network.utils.d.ts +0 -4
- package/dist/utils/network.utils.js +0 -41
- package/dist/utils/network.utils.js.map +0 -1
- package/dist/utils/platform.utils.d.ts +0 -1
- package/dist/utils/platform.utils.js +0 -6
- package/dist/utils/platform.utils.js.map +0 -1
- package/dist/utils/sharing.utils.d.ts +0 -9
- package/dist/utils/sharing.utils.js +0 -58
- package/dist/utils/sharing.utils.js.map +0 -1
- package/dist/utils/sharing.utils.windows.d.ts +0 -3
- package/dist/utils/sharing.utils.windows.js +0 -11
- package/dist/utils/sharing.utils.windows.js.map +0 -1
- package/dist/utils/sqlite.utils.d.ts +0 -10
- package/dist/utils/sqlite.utils.js +0 -36
- package/dist/utils/sqlite.utils.js.map +0 -1
- package/dist/utils/storage.d.ts +0 -10
- package/dist/utils/storage.js +0 -60
- package/dist/utils/storage.js.map +0 -1
- package/dist/utils/storage.windows.d.ts +0 -10
- package/dist/utils/storage.windows.js +0 -34
- package/dist/utils/storage.windows.js.map +0 -1
- package/dist/utils/webview.utils.d.ts +0 -9
- package/dist/utils/webview.utils.js +0 -18
- package/dist/utils/webview.utils.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,4667 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactNativePaper = require('react-native-paper');
|
|
4
|
+
var tsCommon = require('@lichens-innovation/ts-common');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var bottomSheet = require('@gorhom/bottom-sheet');
|
|
7
|
+
var reactNative = require('react-native');
|
|
8
|
+
var native = require('@react-navigation/native');
|
|
9
|
+
var react = require('react');
|
|
10
|
+
var Sentry = require('@sentry/react-native');
|
|
11
|
+
var reactNativeLogs = require('react-native-logs');
|
|
12
|
+
var expoFileSystem = require('expo-file-system');
|
|
13
|
+
var FileSystemLegacy = require('expo-file-system/legacy');
|
|
14
|
+
var reactNativeMmkv = require('react-native-mmkv');
|
|
15
|
+
var mobx = require('mobx');
|
|
16
|
+
var Constants = require('expo-constants');
|
|
17
|
+
var Device = require('expo-device');
|
|
18
|
+
var Updates2 = require('expo-updates');
|
|
19
|
+
var reactI18next = require('react-i18next');
|
|
20
|
+
var expoCamera = require('expo-camera');
|
|
21
|
+
var i18next = require('i18next');
|
|
22
|
+
var Clipboard = require('@react-native-clipboard/clipboard');
|
|
23
|
+
var mobxReactLite = require('mobx-react-lite');
|
|
24
|
+
var SyntaxHighlighter = require('react-native-syntax-highlighter');
|
|
25
|
+
var mobxPersistStore = require('mobx-persist-store');
|
|
26
|
+
var reactNativeElementDropdown = require('react-native-element-dropdown');
|
|
27
|
+
var expoRouter = require('expo-router');
|
|
28
|
+
var Sharing = require('expo-sharing');
|
|
29
|
+
var buffer = require('buffer');
|
|
30
|
+
var uuid = require('react-native-uuid');
|
|
31
|
+
var reactNativeGestureHandler = require('react-native-gesture-handler');
|
|
32
|
+
var list = require('@legendapp/list');
|
|
33
|
+
var usehooks = require('@uidotdev/usehooks');
|
|
34
|
+
var dateFns = require('date-fns');
|
|
35
|
+
var filesize = require('filesize');
|
|
36
|
+
var ui = require('expo-router/ui');
|
|
37
|
+
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
38
|
+
var Animated = require('react-native-reanimated');
|
|
39
|
+
var axios = require('axios');
|
|
40
|
+
var legacy_js = require('@noble/hashes/legacy.js');
|
|
41
|
+
var utils_js = require('@noble/hashes/utils.js');
|
|
42
|
+
var immer = require('immer');
|
|
43
|
+
var DocumentPicker = require('expo-document-picker');
|
|
44
|
+
var dateFnsTz = require('date-fns-tz');
|
|
45
|
+
var Handlebars = require('handlebars');
|
|
46
|
+
var netinfo = require('@react-native-community/netinfo');
|
|
47
|
+
var SQLite = require('expo-sqlite');
|
|
48
|
+
var expoSpeechRecognition = require('expo-speech-recognition');
|
|
49
|
+
var ImagePicker = require('expo-image-picker');
|
|
50
|
+
var reactQuery = require('@tanstack/react-query');
|
|
51
|
+
var expoApplication = require('expo-application');
|
|
52
|
+
var Localization = require('expo-localization');
|
|
53
|
+
var Zeroconf = require('react-native-zeroconf');
|
|
54
|
+
var Location = require('expo-location');
|
|
55
|
+
var WifiManager = require('react-native-wifi-reborn');
|
|
56
|
+
|
|
57
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
58
|
+
|
|
59
|
+
function _interopNamespace(e) {
|
|
60
|
+
if (e && e.__esModule) return e;
|
|
61
|
+
var n = Object.create(null);
|
|
62
|
+
if (e) {
|
|
63
|
+
Object.keys(e).forEach(function (k) {
|
|
64
|
+
if (k !== 'default') {
|
|
65
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
66
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () { return e[k]; }
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
n.default = e;
|
|
74
|
+
return Object.freeze(n);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
78
|
+
var FileSystemLegacy__namespace = /*#__PURE__*/_interopNamespace(FileSystemLegacy);
|
|
79
|
+
var Constants__default = /*#__PURE__*/_interopDefault(Constants);
|
|
80
|
+
var Device__namespace = /*#__PURE__*/_interopNamespace(Device);
|
|
81
|
+
var Updates2__namespace = /*#__PURE__*/_interopNamespace(Updates2);
|
|
82
|
+
var i18next__default = /*#__PURE__*/_interopDefault(i18next);
|
|
83
|
+
var Clipboard__default = /*#__PURE__*/_interopDefault(Clipboard);
|
|
84
|
+
var SyntaxHighlighter__default = /*#__PURE__*/_interopDefault(SyntaxHighlighter);
|
|
85
|
+
var Sharing__namespace = /*#__PURE__*/_interopNamespace(Sharing);
|
|
86
|
+
var uuid__default = /*#__PURE__*/_interopDefault(uuid);
|
|
87
|
+
var Animated__default = /*#__PURE__*/_interopDefault(Animated);
|
|
88
|
+
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
89
|
+
var DocumentPicker__namespace = /*#__PURE__*/_interopNamespace(DocumentPicker);
|
|
90
|
+
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
91
|
+
var SQLite__namespace = /*#__PURE__*/_interopNamespace(SQLite);
|
|
92
|
+
var ImagePicker__namespace = /*#__PURE__*/_interopNamespace(ImagePicker);
|
|
93
|
+
var Localization__namespace = /*#__PURE__*/_interopNamespace(Localization);
|
|
94
|
+
var Zeroconf__default = /*#__PURE__*/_interopDefault(Zeroconf);
|
|
95
|
+
var Location__namespace = /*#__PURE__*/_interopNamespace(Location);
|
|
96
|
+
var WifiManager__default = /*#__PURE__*/_interopDefault(WifiManager);
|
|
97
|
+
|
|
98
|
+
var __create = Object.create;
|
|
99
|
+
var __defProp = Object.defineProperty;
|
|
100
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
101
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
102
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
103
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
104
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
105
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
106
|
+
};
|
|
107
|
+
var __copyProps = (to, from, except, desc) => {
|
|
108
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
109
|
+
for (let key of __getOwnPropNames(from))
|
|
110
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
111
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
112
|
+
}
|
|
113
|
+
return to;
|
|
114
|
+
};
|
|
115
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
116
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
117
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
118
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
119
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
120
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
121
|
+
mod
|
|
122
|
+
));
|
|
123
|
+
|
|
124
|
+
// node_modules/pretty-bytes/index.js
|
|
125
|
+
var require_pretty_bytes = __commonJS({
|
|
126
|
+
"node_modules/pretty-bytes/index.js"(exports$1, module) {
|
|
127
|
+
var BYTE_UNITS = [
|
|
128
|
+
"B",
|
|
129
|
+
"kB",
|
|
130
|
+
"MB",
|
|
131
|
+
"GB",
|
|
132
|
+
"TB",
|
|
133
|
+
"PB",
|
|
134
|
+
"EB",
|
|
135
|
+
"ZB",
|
|
136
|
+
"YB"
|
|
137
|
+
];
|
|
138
|
+
var BIBYTE_UNITS = [
|
|
139
|
+
"B",
|
|
140
|
+
"kiB",
|
|
141
|
+
"MiB",
|
|
142
|
+
"GiB",
|
|
143
|
+
"TiB",
|
|
144
|
+
"PiB",
|
|
145
|
+
"EiB",
|
|
146
|
+
"ZiB",
|
|
147
|
+
"YiB"
|
|
148
|
+
];
|
|
149
|
+
var BIT_UNITS = [
|
|
150
|
+
"b",
|
|
151
|
+
"kbit",
|
|
152
|
+
"Mbit",
|
|
153
|
+
"Gbit",
|
|
154
|
+
"Tbit",
|
|
155
|
+
"Pbit",
|
|
156
|
+
"Ebit",
|
|
157
|
+
"Zbit",
|
|
158
|
+
"Ybit"
|
|
159
|
+
];
|
|
160
|
+
var BIBIT_UNITS = [
|
|
161
|
+
"b",
|
|
162
|
+
"kibit",
|
|
163
|
+
"Mibit",
|
|
164
|
+
"Gibit",
|
|
165
|
+
"Tibit",
|
|
166
|
+
"Pibit",
|
|
167
|
+
"Eibit",
|
|
168
|
+
"Zibit",
|
|
169
|
+
"Yibit"
|
|
170
|
+
];
|
|
171
|
+
var toLocaleString = (number, locale, options2) => {
|
|
172
|
+
let result = number;
|
|
173
|
+
if (typeof locale === "string" || Array.isArray(locale)) {
|
|
174
|
+
result = number.toLocaleString(locale, options2);
|
|
175
|
+
} else if (locale === true || options2 !== void 0) {
|
|
176
|
+
result = number.toLocaleString(void 0, options2);
|
|
177
|
+
}
|
|
178
|
+
return result;
|
|
179
|
+
};
|
|
180
|
+
module.exports = (number, options2) => {
|
|
181
|
+
if (!Number.isFinite(number)) {
|
|
182
|
+
throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
|
|
183
|
+
}
|
|
184
|
+
options2 = Object.assign({ bits: false, binary: false }, options2);
|
|
185
|
+
const UNITS = options2.bits ? options2.binary ? BIBIT_UNITS : BIT_UNITS : options2.binary ? BIBYTE_UNITS : BYTE_UNITS;
|
|
186
|
+
if (options2.signed && number === 0) {
|
|
187
|
+
return ` 0 ${UNITS[0]}`;
|
|
188
|
+
}
|
|
189
|
+
const isNegative = number < 0;
|
|
190
|
+
const prefix = isNegative ? "-" : options2.signed ? "+" : "";
|
|
191
|
+
if (isNegative) {
|
|
192
|
+
number = -number;
|
|
193
|
+
}
|
|
194
|
+
let localeOptions;
|
|
195
|
+
if (options2.minimumFractionDigits !== void 0) {
|
|
196
|
+
localeOptions = { minimumFractionDigits: options2.minimumFractionDigits };
|
|
197
|
+
}
|
|
198
|
+
if (options2.maximumFractionDigits !== void 0) {
|
|
199
|
+
localeOptions = Object.assign({ maximumFractionDigits: options2.maximumFractionDigits }, localeOptions);
|
|
200
|
+
}
|
|
201
|
+
if (number < 1) {
|
|
202
|
+
const numberString2 = toLocaleString(number, options2.locale, localeOptions);
|
|
203
|
+
return prefix + numberString2 + " " + UNITS[0];
|
|
204
|
+
}
|
|
205
|
+
const exponent = Math.min(Math.floor(options2.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
|
|
206
|
+
number /= Math.pow(options2.binary ? 1024 : 1e3, exponent);
|
|
207
|
+
if (!localeOptions) {
|
|
208
|
+
number = number.toPrecision(3);
|
|
209
|
+
}
|
|
210
|
+
const numberString = toLocaleString(Number(number), options2.locale, localeOptions);
|
|
211
|
+
const unit = UNITS[exponent];
|
|
212
|
+
return prefix + numberString + " " + unit;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
var getBatteryIcon = (level) => {
|
|
217
|
+
if (tsCommon.isNullish(level)) return "battery-alert-variant-outline";
|
|
218
|
+
if (level >= 90) return "battery";
|
|
219
|
+
if (level >= 75) return "battery-60";
|
|
220
|
+
if (level >= 60) return "battery-50";
|
|
221
|
+
if (level >= 45) return "battery-40";
|
|
222
|
+
if (level >= 30) return "battery-30";
|
|
223
|
+
if (level >= 15) return "battery-20";
|
|
224
|
+
if (level > 0) return "battery-10";
|
|
225
|
+
return "battery-arrow-down-outline";
|
|
226
|
+
};
|
|
227
|
+
var getBatteryColor = (batteryLevel) => {
|
|
228
|
+
return tsCommon.isNullish(batteryLevel) ? "gray" : tsCommon.getColorForPercentage(batteryLevel / 100);
|
|
229
|
+
};
|
|
230
|
+
var BatteryLevel = ({ batteryLevel, size = 32 }) => {
|
|
231
|
+
const batteryColor = getBatteryColor(batteryLevel);
|
|
232
|
+
const batteryIcon = getBatteryIcon(batteryLevel);
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Icon, { source: batteryIcon, size, color: batteryColor });
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/components/bottom-sheet/bottom-sheet.constants.ts
|
|
237
|
+
var DEFAULT_SHEET_SNAP_POINTS = ["55%", "65%", "75%"];
|
|
238
|
+
var DefaultBackdrop = (props) => /* @__PURE__ */ jsxRuntime.jsx(bottomSheet.BottomSheetBackdrop, { disappearsOnIndex: -1, appearsOnIndex: 0, ...props });
|
|
239
|
+
|
|
240
|
+
// src/theme/dark-colors-scheme.ts
|
|
241
|
+
var DARK_COLORS_SCHEME = {
|
|
242
|
+
primary: "rgb(170, 212, 114)",
|
|
243
|
+
onPrimary: "rgb(32, 54, 0)",
|
|
244
|
+
primaryContainer: "rgb(49, 79, 0)",
|
|
245
|
+
onPrimaryContainer: "rgb(197, 240, 139)",
|
|
246
|
+
secondary: "rgb(185, 209, 101)",
|
|
247
|
+
onSecondary: "rgb(42, 53, 0)",
|
|
248
|
+
secondaryContainer: "rgb(62, 76, 0)",
|
|
249
|
+
onSecondaryContainer: "rgb(212, 237, 126)",
|
|
250
|
+
tertiary: "rgb(167, 212, 116)",
|
|
251
|
+
onTertiary: "rgb(30, 55, 0)",
|
|
252
|
+
tertiaryContainer: "rgb(45, 80, 0)",
|
|
253
|
+
onTertiaryContainer: "rgb(194, 241, 141)",
|
|
254
|
+
error: "rgb(255, 180, 171)",
|
|
255
|
+
onError: "rgb(105, 0, 5)",
|
|
256
|
+
errorContainer: "rgb(147, 0, 10)",
|
|
257
|
+
onErrorContainer: "rgb(255, 180, 171)",
|
|
258
|
+
background: "rgb(27, 28, 24)",
|
|
259
|
+
onBackground: "rgb(227, 227, 219)",
|
|
260
|
+
surface: "rgb(27, 28, 24)",
|
|
261
|
+
onSurface: "rgb(227, 227, 219)",
|
|
262
|
+
surfaceVariant: "rgb(68, 72, 61)",
|
|
263
|
+
onSurfaceVariant: "rgb(197, 200, 185)",
|
|
264
|
+
outline: "rgb(143, 146, 133)",
|
|
265
|
+
outlineVariant: "rgb(68, 72, 61)",
|
|
266
|
+
shadow: "rgb(0, 0, 0)",
|
|
267
|
+
scrim: "rgb(0, 0, 0)",
|
|
268
|
+
inverseSurface: "rgb(227, 227, 219)",
|
|
269
|
+
inverseOnSurface: "rgb(48, 49, 44)",
|
|
270
|
+
inversePrimary: "rgb(69, 104, 18)",
|
|
271
|
+
elevation: {
|
|
272
|
+
level0: "transparent",
|
|
273
|
+
level1: "rgb(34, 37, 29)",
|
|
274
|
+
level2: "rgb(38, 43, 31)",
|
|
275
|
+
level3: "rgb(43, 48, 34)",
|
|
276
|
+
level4: "rgb(44, 50, 35)",
|
|
277
|
+
level5: "rgb(47, 54, 37)"
|
|
278
|
+
},
|
|
279
|
+
surfaceDisabled: "rgba(227, 227, 219, 0.12)",
|
|
280
|
+
onSurfaceDisabled: "rgba(227, 227, 219, 0.38)",
|
|
281
|
+
backdrop: "rgba(46, 50, 40, 0.4)"
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// src/theme/light-colors-scheme.ts
|
|
285
|
+
var LIGHT_COLORS_SCHEME = {
|
|
286
|
+
primary: "rgb(69, 104, 18)",
|
|
287
|
+
onPrimary: "rgb(255, 255, 255)",
|
|
288
|
+
primaryContainer: "rgb(197, 240, 139)",
|
|
289
|
+
onPrimaryContainer: "rgb(17, 32, 0)",
|
|
290
|
+
secondary: "rgb(83, 102, 0)",
|
|
291
|
+
onSecondary: "rgb(255, 255, 255)",
|
|
292
|
+
secondaryContainer: "rgb(212, 237, 126)",
|
|
293
|
+
onSecondaryContainer: "rgb(23, 30, 0)",
|
|
294
|
+
tertiary: "rgb(67, 105, 21)",
|
|
295
|
+
onTertiary: "rgb(255, 255, 255)",
|
|
296
|
+
tertiaryContainer: "rgb(194, 241, 141)",
|
|
297
|
+
onTertiaryContainer: "rgb(15, 32, 0)",
|
|
298
|
+
error: "rgb(186, 26, 26)",
|
|
299
|
+
onError: "rgb(255, 255, 255)",
|
|
300
|
+
errorContainer: "rgb(255, 218, 214)",
|
|
301
|
+
onErrorContainer: "rgb(65, 0, 2)",
|
|
302
|
+
background: "rgb(253, 252, 245)",
|
|
303
|
+
onBackground: "rgb(27, 28, 24)",
|
|
304
|
+
surface: "rgb(253, 252, 245)",
|
|
305
|
+
onSurface: "rgb(27, 28, 24)",
|
|
306
|
+
surfaceVariant: "rgb(225, 228, 213)",
|
|
307
|
+
onSurfaceVariant: "rgb(68, 72, 61)",
|
|
308
|
+
outline: "rgb(117, 121, 108)",
|
|
309
|
+
outlineVariant: "rgb(197, 200, 185)",
|
|
310
|
+
shadow: "rgb(0, 0, 0)",
|
|
311
|
+
scrim: "rgb(0, 0, 0)",
|
|
312
|
+
inverseSurface: "rgb(48, 49, 44)",
|
|
313
|
+
inverseOnSurface: "rgb(242, 241, 233)",
|
|
314
|
+
inversePrimary: "rgb(170, 212, 114)",
|
|
315
|
+
elevation: {
|
|
316
|
+
level0: "transparent",
|
|
317
|
+
level1: "rgb(244, 245, 234)",
|
|
318
|
+
level2: "rgb(238, 240, 227)",
|
|
319
|
+
level3: "rgb(233, 236, 220)",
|
|
320
|
+
level4: "rgb(231, 234, 218)",
|
|
321
|
+
level5: "rgb(227, 231, 213)"
|
|
322
|
+
},
|
|
323
|
+
surfaceDisabled: "rgba(27, 28, 24, 0.12)",
|
|
324
|
+
onSurfaceDisabled: "rgba(27, 28, 24, 0.38)",
|
|
325
|
+
backdrop: "rgba(46, 50, 40, 0.4)"
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// src/theme/theme.ts
|
|
329
|
+
var DEFAULT_SPACING = 8;
|
|
330
|
+
var spacing = (units = 1) => units * DEFAULT_SPACING;
|
|
331
|
+
var roundness = 2;
|
|
332
|
+
var DARK_THEME = {
|
|
333
|
+
...reactNativePaper.MD3DarkTheme,
|
|
334
|
+
colors: {
|
|
335
|
+
...reactNativePaper.MD3DarkTheme.colors,
|
|
336
|
+
...DARK_COLORS_SCHEME
|
|
337
|
+
},
|
|
338
|
+
spacing,
|
|
339
|
+
roundness
|
|
340
|
+
};
|
|
341
|
+
var LIGHT_THEME = {
|
|
342
|
+
...reactNativePaper.MD3LightTheme,
|
|
343
|
+
colors: {
|
|
344
|
+
...reactNativePaper.MD3LightTheme.colors,
|
|
345
|
+
...LIGHT_COLORS_SCHEME
|
|
346
|
+
},
|
|
347
|
+
spacing,
|
|
348
|
+
roundness
|
|
349
|
+
};
|
|
350
|
+
var navigationAdaptedThemes = reactNativePaper.adaptNavigationTheme({
|
|
351
|
+
reactNavigationLight: native.DefaultTheme,
|
|
352
|
+
reactNavigationDark: native.DarkTheme,
|
|
353
|
+
materialLight: LIGHT_THEME,
|
|
354
|
+
materialDark: DARK_THEME
|
|
355
|
+
});
|
|
356
|
+
var { DarkTheme, LightTheme } = navigationAdaptedThemes;
|
|
357
|
+
var NAVIGATION_DARK = { ...DarkTheme, fonts: { ...native.DarkTheme.fonts } };
|
|
358
|
+
var NAVIGATION_LIGHT = { ...LightTheme, fonts: { ...native.DefaultTheme.fonts } };
|
|
359
|
+
var useAppTheme = () => reactNativePaper.useTheme();
|
|
360
|
+
var useIsDarkMode = () => {
|
|
361
|
+
const theme = useAppTheme();
|
|
362
|
+
return theme.dark;
|
|
363
|
+
};
|
|
364
|
+
var DefaultSheetBackground = ({ style }) => {
|
|
365
|
+
const { colors } = useAppTheme();
|
|
366
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [style, { backgroundColor: colors.background }] });
|
|
367
|
+
};
|
|
368
|
+
var mmkvStorage = new reactNativeMmkv.MMKV();
|
|
369
|
+
var setItem = (key, data) => {
|
|
370
|
+
if (data instanceof ArrayBuffer) {
|
|
371
|
+
mmkvStorage.set(key, data);
|
|
372
|
+
} else if (typeof data === "boolean" || typeof data === "number" || typeof data === "string") {
|
|
373
|
+
mmkvStorage.set(key, data);
|
|
374
|
+
} else {
|
|
375
|
+
mmkvStorage.set(key, JSON.stringify(data));
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
var getItem = (key, defaultValue) => {
|
|
379
|
+
if (defaultValue instanceof Uint8Array) {
|
|
380
|
+
return mmkvStorage.getBuffer(key) ?? defaultValue;
|
|
381
|
+
}
|
|
382
|
+
if (typeof defaultValue === "boolean") {
|
|
383
|
+
return mmkvStorage.getBoolean(key) ?? defaultValue;
|
|
384
|
+
}
|
|
385
|
+
if (typeof defaultValue === "number") {
|
|
386
|
+
return mmkvStorage.getNumber(key) ?? defaultValue;
|
|
387
|
+
}
|
|
388
|
+
const stringValue = mmkvStorage.getString(key);
|
|
389
|
+
if (stringValue === void 0 || stringValue === null) return defaultValue;
|
|
390
|
+
if (typeof defaultValue === "string") {
|
|
391
|
+
return stringValue;
|
|
392
|
+
}
|
|
393
|
+
try {
|
|
394
|
+
return JSON.parse(stringValue);
|
|
395
|
+
} catch {
|
|
396
|
+
return stringValue;
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
var removeItem = (key) => {
|
|
400
|
+
mmkvStorage.delete(key);
|
|
401
|
+
};
|
|
402
|
+
var storage = {
|
|
403
|
+
setItem,
|
|
404
|
+
getItem,
|
|
405
|
+
removeItem
|
|
406
|
+
};
|
|
407
|
+
var mmkvStorageForMobxPersist = {
|
|
408
|
+
setItem: (key, value) => {
|
|
409
|
+
mmkvStorage.set(key, value);
|
|
410
|
+
return Promise.resolve();
|
|
411
|
+
},
|
|
412
|
+
getItem: (key) => {
|
|
413
|
+
const value = mmkvStorage.getString(key);
|
|
414
|
+
return Promise.resolve(value ?? null);
|
|
415
|
+
},
|
|
416
|
+
removeItem: (key) => {
|
|
417
|
+
mmkvStorage.delete(key);
|
|
418
|
+
return Promise.resolve();
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// src/config/env.config.ts
|
|
423
|
+
var isSentryActivated = () => storage.getItem("SENTRY_ACTIVATED", "") === "true";
|
|
424
|
+
var getSentryDns = () => storage.getItem("SENTRY_DNS", "") ?? "";
|
|
425
|
+
var MAX_LOG_ENTRIES = 10 * 1e3;
|
|
426
|
+
var CommonLogsStore = class {
|
|
427
|
+
constructor() {
|
|
428
|
+
this.logEntries = [];
|
|
429
|
+
mobx.makeAutoObservable(this);
|
|
430
|
+
}
|
|
431
|
+
get allLogsAsText() {
|
|
432
|
+
return this.logEntries.map((log) => log.msg).filter((log) => !!log).join("\n");
|
|
433
|
+
}
|
|
434
|
+
addLog(logEntry) {
|
|
435
|
+
this.logEntries.push(logEntry);
|
|
436
|
+
if (this.logEntries.length > MAX_LOG_ENTRIES) {
|
|
437
|
+
this.logEntries.shift();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
clearLogs() {
|
|
441
|
+
this.logEntries = [];
|
|
442
|
+
}
|
|
443
|
+
filterLogs(filterText) {
|
|
444
|
+
const lowerCaseFilterText = filterText.toLowerCase();
|
|
445
|
+
return this.logEntries.filter((log) => log.msg.toLowerCase().includes(lowerCaseFilterText));
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
var commonLogsStore = new CommonLogsStore();
|
|
449
|
+
var commonLogsStoreTransport = (props) => {
|
|
450
|
+
commonLogsStore.addLog(props);
|
|
451
|
+
};
|
|
452
|
+
var isRealDevice = () => {
|
|
453
|
+
return Device__namespace.isDevice;
|
|
454
|
+
};
|
|
455
|
+
var isEmulator = () => {
|
|
456
|
+
return !Device__namespace.isDevice;
|
|
457
|
+
};
|
|
458
|
+
var getDeviceType = () => {
|
|
459
|
+
const isReal = isRealDevice();
|
|
460
|
+
return reactNative.Platform.select({
|
|
461
|
+
ios: isReal ? "iOS Device" : "iOS Simulator",
|
|
462
|
+
android: isReal ? "Android Device" : "Android Emulator",
|
|
463
|
+
default: isReal ? `${reactNative.Platform.OS} Real Device` : `${reactNative.Platform.OS} Emulator`
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
var getAppIdentifier = () => {
|
|
467
|
+
const bundleId = reactNative.Platform.select({
|
|
468
|
+
ios: Constants__default.default.expoConfig?.ios?.bundleIdentifier,
|
|
469
|
+
android: Constants__default.default.expoConfig?.android?.package,
|
|
470
|
+
default: "Unknown"
|
|
471
|
+
});
|
|
472
|
+
const id = bundleId?.split(".").pop();
|
|
473
|
+
return id ?? "";
|
|
474
|
+
};
|
|
475
|
+
var isProduction = () => {
|
|
476
|
+
return Updates2__namespace.channel === "production";
|
|
477
|
+
};
|
|
478
|
+
var isPreview = () => {
|
|
479
|
+
return Updates2__namespace.channel === "preview";
|
|
480
|
+
};
|
|
481
|
+
var isDevelopment = () => {
|
|
482
|
+
return __DEV__ || !Updates2__namespace.channel;
|
|
483
|
+
};
|
|
484
|
+
var getEnvVarsSource = () => {
|
|
485
|
+
if (Constants__default.default.executionEnvironment === "storeClient") {
|
|
486
|
+
return "EAS (Production)";
|
|
487
|
+
}
|
|
488
|
+
return "Local Development";
|
|
489
|
+
};
|
|
490
|
+
var validateGetRandomValues = () => {
|
|
491
|
+
if (!crypto?.getRandomValues) {
|
|
492
|
+
logger.error("[validateGetRandomValues] crypto.getRandomValues is not available as a global environment function");
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
const typeOfGetRandomValues = typeof crypto.getRandomValues;
|
|
496
|
+
if (typeOfGetRandomValues !== "function") {
|
|
497
|
+
logger.error(`[validateGetRandomValues] crypto.getRandomValues is not a function: ${typeOfGetRandomValues}`);
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
logger.debug("[validateGetRandomValues] global crypto getRandomValues is available as a global environment function");
|
|
501
|
+
return true;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
// src/logger/logger.types.ts
|
|
505
|
+
var LOG_LEVELS = {
|
|
506
|
+
debug: 0,
|
|
507
|
+
log: 1,
|
|
508
|
+
info: 2,
|
|
509
|
+
warn: 3,
|
|
510
|
+
error: 4
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
// src/logger/logger.ts
|
|
514
|
+
reactNative.LogBox.ignoreLogs([/^ErrorBoundary /, /Support for defaultProps will be removed from function components/]);
|
|
515
|
+
var appName = getAppIdentifier();
|
|
516
|
+
var logFilenamePrefix = `app-logs-${appName}`;
|
|
517
|
+
var logFilenamePattern = `${logFilenamePrefix}-{date-today}.txt`;
|
|
518
|
+
var filePath = expoFileSystem.Paths.document.uri;
|
|
519
|
+
if (!filePath) {
|
|
520
|
+
throw new Error("Failed to initialize logger: document directory path is unavailable");
|
|
521
|
+
}
|
|
522
|
+
var LoggerWrapper = class {
|
|
523
|
+
constructor(config) {
|
|
524
|
+
this._logger = reactNativeLogs.logger.createLogger(config);
|
|
525
|
+
}
|
|
526
|
+
debug(message, ...args) {
|
|
527
|
+
this._logger.debug(message, ...args);
|
|
528
|
+
}
|
|
529
|
+
log(message, ...args) {
|
|
530
|
+
this._logger.log(message, ...args);
|
|
531
|
+
}
|
|
532
|
+
info(message, ...args) {
|
|
533
|
+
this._logger.info(message, ...args);
|
|
534
|
+
}
|
|
535
|
+
warn(message, ...args) {
|
|
536
|
+
this._logger.warn(message, ...args);
|
|
537
|
+
}
|
|
538
|
+
error(message, ...args) {
|
|
539
|
+
this._logger.error(message, ...args);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
var getTransports = () => {
|
|
543
|
+
const transports = [reactNativeLogs.fileAsyncTransport, commonLogsStoreTransport];
|
|
544
|
+
if (!isDevelopment() && isSentryActivated()) {
|
|
545
|
+
Sentry__namespace.init({
|
|
546
|
+
dsn: getSentryDns(),
|
|
547
|
+
// We can add more context data to events (IP address, cookies, user, etc.)
|
|
548
|
+
// @see https://docs.sentry.io/platforms/react-native/data-management/data-collected/
|
|
549
|
+
sendDefaultPii: true
|
|
550
|
+
});
|
|
551
|
+
transports.push(reactNativeLogs.sentryTransport);
|
|
552
|
+
}
|
|
553
|
+
if (isDevelopment()) {
|
|
554
|
+
transports.push(reactNativeLogs.mapConsoleTransport);
|
|
555
|
+
}
|
|
556
|
+
return transports;
|
|
557
|
+
};
|
|
558
|
+
var logger = new LoggerWrapper({
|
|
559
|
+
severity: "debug",
|
|
560
|
+
transport: getTransports(),
|
|
561
|
+
levels: {
|
|
562
|
+
debug: LOG_LEVELS.debug,
|
|
563
|
+
log: LOG_LEVELS.log,
|
|
564
|
+
info: LOG_LEVELS.info,
|
|
565
|
+
warn: LOG_LEVELS.warn,
|
|
566
|
+
error: LOG_LEVELS.error
|
|
567
|
+
},
|
|
568
|
+
async: true,
|
|
569
|
+
asyncFunc: reactNative.InteractionManager.runAfterInteractions,
|
|
570
|
+
dateFormat: (date) => `${date.toISOString()} `,
|
|
571
|
+
printLevel: true,
|
|
572
|
+
fixedExtLvlLength: true,
|
|
573
|
+
printDate: true,
|
|
574
|
+
enabled: true,
|
|
575
|
+
transportOptions: {
|
|
576
|
+
// @see https://github.com/mowispace/react-native-logs?tab=readme-ov-file#sentrytransport
|
|
577
|
+
SENTRY: Sentry__namespace,
|
|
578
|
+
errorLevels: "error",
|
|
579
|
+
// @see https://github.com/mowispace/react-native-logs?tab=readme-ov-file#mapconsoletransport
|
|
580
|
+
mapLevels: {
|
|
581
|
+
debug: "debug",
|
|
582
|
+
log: "log",
|
|
583
|
+
info: "info",
|
|
584
|
+
warn: "warn",
|
|
585
|
+
error: "error"
|
|
586
|
+
},
|
|
587
|
+
// @see https://github.com/mowispace/react-native-logs?tab=readme-ov-file#fileasynctransport
|
|
588
|
+
FS: FileSystemLegacy__namespace,
|
|
589
|
+
fileNameDateType: "iso",
|
|
590
|
+
fileName: logFilenamePattern,
|
|
591
|
+
filePath
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
var isLogFile = (fileName) => {
|
|
595
|
+
return fileName.startsWith(logFilenamePrefix);
|
|
596
|
+
};
|
|
597
|
+
var isLogFileItem = (item) => {
|
|
598
|
+
return item instanceof expoFileSystem.File && isLogFile(item.name);
|
|
599
|
+
};
|
|
600
|
+
var byMostRecentFirstComparator = (a, b) => {
|
|
601
|
+
return (b.modificationTime ?? 0) - (a.modificationTime ?? 0);
|
|
602
|
+
};
|
|
603
|
+
var loadAllLogFilesInfo = async () => {
|
|
604
|
+
try {
|
|
605
|
+
const pathInfo = expoFileSystem.Paths.info(filePath);
|
|
606
|
+
if (!pathInfo.exists) {
|
|
607
|
+
return [];
|
|
608
|
+
}
|
|
609
|
+
const directory = new expoFileSystem.Directory(filePath);
|
|
610
|
+
const items = directory.list();
|
|
611
|
+
const logFiles = items.filter(isLogFileItem);
|
|
612
|
+
const fileInfos = logFiles.map((file) => {
|
|
613
|
+
const info = file.info();
|
|
614
|
+
return {
|
|
615
|
+
exists: info.exists,
|
|
616
|
+
isDirectory: false,
|
|
617
|
+
size: info.size ?? 0,
|
|
618
|
+
modificationTime: info.modificationTime ?? 0,
|
|
619
|
+
uri: file.uri
|
|
620
|
+
};
|
|
621
|
+
}).filter((info) => info.exists);
|
|
622
|
+
return fileInfos.sort(byMostRecentFirstComparator);
|
|
623
|
+
} catch (e) {
|
|
624
|
+
logger.error("Error loading files:", e);
|
|
625
|
+
return [];
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
var loadCurrentLogsFileUri = async () => {
|
|
629
|
+
const fileInfos = await loadAllLogFilesInfo();
|
|
630
|
+
return fileInfos[0]?.uri ?? "";
|
|
631
|
+
};
|
|
632
|
+
var deleteAllLogFiles = async () => {
|
|
633
|
+
try {
|
|
634
|
+
const pathInfo = expoFileSystem.Paths.info(filePath);
|
|
635
|
+
if (!pathInfo.exists) {
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
const directory = new expoFileSystem.Directory(filePath);
|
|
639
|
+
const items = directory.list();
|
|
640
|
+
const logFiles = items.filter(isLogFileItem);
|
|
641
|
+
const errors = [];
|
|
642
|
+
for (const file of logFiles) {
|
|
643
|
+
try {
|
|
644
|
+
file.delete();
|
|
645
|
+
} catch (e) {
|
|
646
|
+
errors.push(e instanceof Error ? e : new Error(String(e)));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (errors.length > 0) {
|
|
650
|
+
throw new Error(`Failed to delete ${errors.length} log file(s): ${errors.map((e) => e.message).join("; ")}`);
|
|
651
|
+
}
|
|
652
|
+
} catch (e) {
|
|
653
|
+
logger.error("Error deleting files:", e);
|
|
654
|
+
throw e;
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
// src/components/bottom-sheet/use-bottom-sheet-toggler.ts
|
|
659
|
+
var useBottomSheetToggler = () => {
|
|
660
|
+
const bottomSheetModalRef = react.useRef(null);
|
|
661
|
+
const [isBottomSheetOpen, setIsBottomSheetOpen] = react.useState(false);
|
|
662
|
+
const showBottomSheet = () => {
|
|
663
|
+
setIsBottomSheetOpen(true);
|
|
664
|
+
bottomSheetModalRef.current?.present();
|
|
665
|
+
};
|
|
666
|
+
const hideBottomSheet = () => {
|
|
667
|
+
logger.debug("[useBottomSheetToggler] hideBottomSheet");
|
|
668
|
+
setIsBottomSheetOpen(false);
|
|
669
|
+
bottomSheetModalRef.current?.dismiss();
|
|
670
|
+
};
|
|
671
|
+
const onBackButtonPress = () => {
|
|
672
|
+
if (!isBottomSheetOpen || !bottomSheetModalRef.current) {
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
675
|
+
logger.debug("[useBottomSheetToggler] onBackButtonPress: closing bottom sheet");
|
|
676
|
+
hideBottomSheet();
|
|
677
|
+
return true;
|
|
678
|
+
};
|
|
679
|
+
react.useEffect(() => {
|
|
680
|
+
if (!isBottomSheetOpen) return;
|
|
681
|
+
const backHandler = reactNative.BackHandler.addEventListener("hardwareBackPress", onBackButtonPress);
|
|
682
|
+
return () => backHandler.remove();
|
|
683
|
+
}, [isBottomSheetOpen]);
|
|
684
|
+
return {
|
|
685
|
+
bottomSheetModalRef,
|
|
686
|
+
showBottomSheet,
|
|
687
|
+
hideBottomSheet,
|
|
688
|
+
isBottomSheetOpen
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
var LARGE_SCREEN_WIDTH = 600;
|
|
692
|
+
var MAX_DIALOG_WIDTH = 500;
|
|
693
|
+
var useDialogStyles = () => {
|
|
694
|
+
const { width: deviceWidth } = reactNative.useWindowDimensions();
|
|
695
|
+
const width = deviceWidth > LARGE_SCREEN_WIDTH ? MAX_DIALOG_WIDTH : void 0;
|
|
696
|
+
const alignSelf = width ? "center" : void 0;
|
|
697
|
+
return {
|
|
698
|
+
width,
|
|
699
|
+
alignSelf
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
var DialogCloseOnly = ({
|
|
703
|
+
icon,
|
|
704
|
+
title,
|
|
705
|
+
content,
|
|
706
|
+
onClose,
|
|
707
|
+
isVisible,
|
|
708
|
+
...rest
|
|
709
|
+
}) => {
|
|
710
|
+
const { style: dialogStyleProp, ...dialogProps } = rest;
|
|
711
|
+
const styles7 = useStyles();
|
|
712
|
+
const { t } = reactI18next.useTranslation();
|
|
713
|
+
const hasIcon = !!icon;
|
|
714
|
+
const hasTitle = !!title;
|
|
715
|
+
const hasContent = !!content;
|
|
716
|
+
if (!isVisible) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog, { style: [styles7.dialog, dialogStyleProp], visible: true, onDismiss: onClose, ...dialogProps, children: [
|
|
720
|
+
hasIcon && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Icon, { icon }),
|
|
721
|
+
hasTitle && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Title, { children: title }),
|
|
722
|
+
hasContent && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Content, { children: content }),
|
|
723
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Actions, { children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "contained", onPress: onClose, children: t("common:close") }) })
|
|
724
|
+
] }) });
|
|
725
|
+
};
|
|
726
|
+
var useStyles = () => {
|
|
727
|
+
const { width, alignSelf } = useDialogStyles();
|
|
728
|
+
return reactNative.StyleSheet.create({
|
|
729
|
+
dialog: {
|
|
730
|
+
width,
|
|
731
|
+
alignSelf
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
};
|
|
735
|
+
var BARCODE_TYPES = [
|
|
736
|
+
"aztec",
|
|
737
|
+
"ean13",
|
|
738
|
+
"ean8",
|
|
739
|
+
"qr",
|
|
740
|
+
"pdf417",
|
|
741
|
+
"upc_e",
|
|
742
|
+
"datamatrix",
|
|
743
|
+
"code39",
|
|
744
|
+
"code93",
|
|
745
|
+
"itf14",
|
|
746
|
+
"codabar",
|
|
747
|
+
"code128",
|
|
748
|
+
"upc_a"
|
|
749
|
+
];
|
|
750
|
+
var getPermissionMessage = (hasPermission) => {
|
|
751
|
+
if (tsCommon.isNullish(hasPermission)) {
|
|
752
|
+
return i18next__default.default.t("common:barcodeScanner.requestingCameraPermission");
|
|
753
|
+
}
|
|
754
|
+
return hasPermission ? i18next__default.default.t("common:barcodeScanner.cameraAccessGranted") : i18next__default.default.t("common:barcodeScanner.noCameraAccess");
|
|
755
|
+
};
|
|
756
|
+
var requestCameraPermissions = async () => {
|
|
757
|
+
try {
|
|
758
|
+
const { status } = await expoCamera.Camera.requestCameraPermissionsAsync();
|
|
759
|
+
return status === "granted";
|
|
760
|
+
} catch (e) {
|
|
761
|
+
logger.error("[BarcodeScanner] Failed to request camera permissions", e);
|
|
762
|
+
return false;
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
var BarcodeScanner = ({ onBarcodeScanned }) => {
|
|
766
|
+
const styles7 = useStyles2();
|
|
767
|
+
const { t } = reactI18next.useTranslation();
|
|
768
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
769
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.cameraContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
770
|
+
expoCamera.CameraView,
|
|
771
|
+
{
|
|
772
|
+
style: [reactNative.StyleSheet.absoluteFillObject, styles7.camera],
|
|
773
|
+
onBarcodeScanned,
|
|
774
|
+
barcodeScannerSettings: { barcodeTypes: BARCODE_TYPES },
|
|
775
|
+
facing: "back"
|
|
776
|
+
}
|
|
777
|
+
) }),
|
|
778
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", style: styles7.instruction, children: t("common:barcodeScanner.scanBarcodeInstruction") })
|
|
779
|
+
] });
|
|
780
|
+
};
|
|
781
|
+
var DIALOG_HEADER_AND_FOOTER_HEIGHT = 200;
|
|
782
|
+
var MAX_CAMERA_HEIGHT = 560;
|
|
783
|
+
var useStyles2 = () => {
|
|
784
|
+
const theme = useAppTheme();
|
|
785
|
+
const { height } = reactNative.useWindowDimensions();
|
|
786
|
+
return reactNative.StyleSheet.create({
|
|
787
|
+
cameraContainer: {
|
|
788
|
+
alignSelf: "center",
|
|
789
|
+
width: "100%",
|
|
790
|
+
height: Math.min(height - DIALOG_HEADER_AND_FOOTER_HEIGHT, MAX_CAMERA_HEIGHT)
|
|
791
|
+
},
|
|
792
|
+
camera: {
|
|
793
|
+
borderWidth: 2,
|
|
794
|
+
borderColor: theme.colors.primary,
|
|
795
|
+
borderStyle: "dashed"
|
|
796
|
+
},
|
|
797
|
+
instruction: {
|
|
798
|
+
textAlign: "center"
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
};
|
|
802
|
+
var BarcodeScannerDialog = ({
|
|
803
|
+
isVisible,
|
|
804
|
+
title,
|
|
805
|
+
onClose,
|
|
806
|
+
onBarcodeScanned,
|
|
807
|
+
...rest
|
|
808
|
+
}) => {
|
|
809
|
+
const [hasPermission, setHasPermission] = react.useState();
|
|
810
|
+
react.useEffect(() => {
|
|
811
|
+
requestCameraPermissions().then(setHasPermission);
|
|
812
|
+
}, []);
|
|
813
|
+
if (!isVisible) {
|
|
814
|
+
return null;
|
|
815
|
+
}
|
|
816
|
+
if (!hasPermission) {
|
|
817
|
+
const message = getPermissionMessage(hasPermission);
|
|
818
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogCloseOnly, { isVisible: true, title, onClose, content: message, ...rest });
|
|
819
|
+
}
|
|
820
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
821
|
+
DialogCloseOnly,
|
|
822
|
+
{
|
|
823
|
+
isVisible: true,
|
|
824
|
+
title,
|
|
825
|
+
onClose,
|
|
826
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(BarcodeScanner, { onBarcodeScanned }),
|
|
827
|
+
...rest
|
|
828
|
+
}
|
|
829
|
+
);
|
|
830
|
+
};
|
|
831
|
+
var DialogOkCancel = ({
|
|
832
|
+
icon,
|
|
833
|
+
title,
|
|
834
|
+
description,
|
|
835
|
+
onOk,
|
|
836
|
+
onCancel,
|
|
837
|
+
isVisible,
|
|
838
|
+
...rest
|
|
839
|
+
}) => {
|
|
840
|
+
const { style: dialogStyleProp, ...dialogProps } = rest;
|
|
841
|
+
const styles7 = useStyles3();
|
|
842
|
+
const { t } = reactI18next.useTranslation();
|
|
843
|
+
const hasIcon = !!icon;
|
|
844
|
+
const hasTitle = !!title;
|
|
845
|
+
const hasTitleString = typeof title === "string";
|
|
846
|
+
const hasDescription = !!description;
|
|
847
|
+
const hasDescriptionString = typeof description === "string";
|
|
848
|
+
if (!isVisible) {
|
|
849
|
+
return null;
|
|
850
|
+
}
|
|
851
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog, { style: [styles7.dialog, dialogStyleProp], visible: true, onDismiss: onCancel, ...dialogProps, children: [
|
|
852
|
+
hasIcon && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Icon, { icon }),
|
|
853
|
+
hasTitle && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Title, { children: hasTitleString ? /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { children: title }) : title }),
|
|
854
|
+
hasDescription && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Content, { children: hasDescriptionString ? /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { children: description }) : description }),
|
|
855
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog.Actions, { children: [
|
|
856
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { onPress: onCancel, children: t("common:cancel") }),
|
|
857
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { style: styles7.button, mode: "contained", onPress: onOk, children: t("common:ok") })
|
|
858
|
+
] })
|
|
859
|
+
] }) });
|
|
860
|
+
};
|
|
861
|
+
var useStyles3 = () => {
|
|
862
|
+
const { width, alignSelf } = useDialogStyles();
|
|
863
|
+
return reactNative.StyleSheet.create({
|
|
864
|
+
button: {
|
|
865
|
+
width: 60
|
|
866
|
+
},
|
|
867
|
+
dialog: {
|
|
868
|
+
width,
|
|
869
|
+
alignSelf
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
};
|
|
873
|
+
var DialogSingleTextInput = ({
|
|
874
|
+
title,
|
|
875
|
+
description,
|
|
876
|
+
value,
|
|
877
|
+
onChange,
|
|
878
|
+
errorMessage,
|
|
879
|
+
placeholder,
|
|
880
|
+
onOk,
|
|
881
|
+
onCancel,
|
|
882
|
+
isVisible,
|
|
883
|
+
...rest
|
|
884
|
+
}) => {
|
|
885
|
+
const { style: dialogStyleProp, ...dialogProps } = rest;
|
|
886
|
+
const styles7 = useStyles4();
|
|
887
|
+
const { t } = reactI18next.useTranslation();
|
|
888
|
+
const [selection, setSelection] = react.useState();
|
|
889
|
+
const [inputValue, setInputValue] = react.useState(value);
|
|
890
|
+
const hasTitle = !!title;
|
|
891
|
+
const hasTitleString = typeof title === "string";
|
|
892
|
+
const hasDescription = !!description;
|
|
893
|
+
const hasDescriptionString = typeof description === "string";
|
|
894
|
+
const hasError = !!errorMessage;
|
|
895
|
+
const isInputPopulated = inputValue.trim().length > 0;
|
|
896
|
+
const isOkEnabled = !hasError && isInputPopulated;
|
|
897
|
+
const onChangeText = (text) => {
|
|
898
|
+
setInputValue(text);
|
|
899
|
+
onChange(text);
|
|
900
|
+
};
|
|
901
|
+
if (!isVisible) {
|
|
902
|
+
return null;
|
|
903
|
+
}
|
|
904
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog, { ...dialogProps, style: [styles7.dialog, dialogStyleProp], visible: true, onDismiss: onCancel, children: [
|
|
905
|
+
hasTitle && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Title, { children: hasTitleString ? /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { children: title }) : title }),
|
|
906
|
+
hasDescription && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Content, { children: hasDescriptionString ? /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { children: description }) : description }),
|
|
907
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog.Content, { children: [
|
|
908
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
909
|
+
reactNativePaper.TextInput,
|
|
910
|
+
{
|
|
911
|
+
mode: "outlined",
|
|
912
|
+
value: inputValue,
|
|
913
|
+
onChangeText,
|
|
914
|
+
selection,
|
|
915
|
+
onSelectionChange: (e) => setSelection(e.nativeEvent.selection),
|
|
916
|
+
placeholder,
|
|
917
|
+
error: hasError
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
hasError && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodyMedium", style: styles7.errorText, children: errorMessage })
|
|
921
|
+
] }),
|
|
922
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog.Actions, { children: [
|
|
923
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { onPress: onCancel, children: t("common:cancel") }),
|
|
924
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { style: styles7.button, mode: "contained", onPress: () => onOk(inputValue), disabled: !isOkEnabled, children: t("common:ok") })
|
|
925
|
+
] })
|
|
926
|
+
] }) });
|
|
927
|
+
};
|
|
928
|
+
var useStyles4 = () => {
|
|
929
|
+
const theme = useAppTheme();
|
|
930
|
+
const { width, alignSelf } = useDialogStyles();
|
|
931
|
+
return reactNative.StyleSheet.create({
|
|
932
|
+
button: {
|
|
933
|
+
width: 60
|
|
934
|
+
},
|
|
935
|
+
dialog: {
|
|
936
|
+
width,
|
|
937
|
+
alignSelf
|
|
938
|
+
},
|
|
939
|
+
errorText: {
|
|
940
|
+
marginTop: theme.spacing(1),
|
|
941
|
+
color: theme.colors.error
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
};
|
|
945
|
+
var setClipboardTextContent = async (value = "") => {
|
|
946
|
+
try {
|
|
947
|
+
logger.info("[setClipboardTextContent] setting value", `${value.substring(0, 20)}...`);
|
|
948
|
+
Clipboard__default.default.setString(value);
|
|
949
|
+
} catch (e) {
|
|
950
|
+
logger.error("[setClipboardTextContent] error", e);
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
// src/components/snack-bar/snackbar.constants.ts
|
|
955
|
+
var SnackbarDurationsMs = {
|
|
956
|
+
SHORT: 2.5 * 1e3,
|
|
957
|
+
MEDIUM: 5 * 1e3,
|
|
958
|
+
LONG: 10 * 1e3
|
|
959
|
+
};
|
|
960
|
+
var DEFAULT_DURATION = SnackbarDurationsMs.SHORT;
|
|
961
|
+
var SnackbarContext = react.createContext({
|
|
962
|
+
showSnackbarMessage: (_msg, _duration = DEFAULT_DURATION) => {
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
var useSnackbar = () => react.useContext(SnackbarContext);
|
|
966
|
+
var SnackbarProvider = ({ children }) => {
|
|
967
|
+
const [message, setMessage] = react.useState("");
|
|
968
|
+
const [duration, setDuration] = react.useState(DEFAULT_DURATION);
|
|
969
|
+
const [isVisible, setVisibility] = react.useState(false);
|
|
970
|
+
const showSnackbarMessage = react.useCallback(
|
|
971
|
+
(msg, duration2 = DEFAULT_DURATION) => {
|
|
972
|
+
setVisibility(false);
|
|
973
|
+
reactNative.InteractionManager.runAfterInteractions(() => {
|
|
974
|
+
setMessage(msg);
|
|
975
|
+
setDuration(duration2);
|
|
976
|
+
setVisibility(true);
|
|
977
|
+
});
|
|
978
|
+
},
|
|
979
|
+
[setVisibility]
|
|
980
|
+
);
|
|
981
|
+
react.useEffect(() => {
|
|
982
|
+
if (!isVisible) return;
|
|
983
|
+
const timeoutId = setTimeout(() => setVisibility(false), duration);
|
|
984
|
+
return () => clearTimeout(timeoutId);
|
|
985
|
+
}, [isVisible, duration, setVisibility]);
|
|
986
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(SnackbarContext.Provider, { value: { showSnackbarMessage }, children: [
|
|
987
|
+
children,
|
|
988
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Snackbar, { visible: isVisible, onDismiss: () => setVisibility(false), duration: reactNativePaper.Snackbar.DURATION_LONG, children: message })
|
|
989
|
+
] });
|
|
990
|
+
};
|
|
991
|
+
var DEFAULT_DARK_MODE = true;
|
|
992
|
+
var CommonStore = class {
|
|
993
|
+
constructor() {
|
|
994
|
+
this.isDarkMode = DEFAULT_DARK_MODE;
|
|
995
|
+
this.appStatus = "active";
|
|
996
|
+
mobx.makeAutoObservable(this);
|
|
997
|
+
mobxPersistStore.makePersistable(this, {
|
|
998
|
+
name: "CommonStore",
|
|
999
|
+
properties: ["isDarkMode"],
|
|
1000
|
+
storage: mmkvStorageForMobxPersist
|
|
1001
|
+
}).then(() => {
|
|
1002
|
+
logger.info("[CommonStore] Hydration complete");
|
|
1003
|
+
});
|
|
1004
|
+
this.appStateSubscription = reactNative.AppState.addEventListener("change", (nextAppState) => {
|
|
1005
|
+
if (nextAppState === this.appStatus) return;
|
|
1006
|
+
mobx.runInAction(() => {
|
|
1007
|
+
logger.info(`[CommonStore] App state changed to ${nextAppState}`);
|
|
1008
|
+
this.appStatus = nextAppState;
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
toggleDarkMode() {
|
|
1013
|
+
this.isDarkMode = !this.isDarkMode;
|
|
1014
|
+
}
|
|
1015
|
+
setIsDarkMode(isDarkMode) {
|
|
1016
|
+
this.isDarkMode = isDarkMode;
|
|
1017
|
+
}
|
|
1018
|
+
dispose() {
|
|
1019
|
+
this.appStateSubscription?.remove();
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
var commonStore = new CommonStore();
|
|
1023
|
+
var getMonospaceFontName = () => {
|
|
1024
|
+
return reactNative.Platform.select({
|
|
1025
|
+
ios: "Menlo",
|
|
1026
|
+
default: "monospace"
|
|
1027
|
+
});
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
// src/components/syntax/styles/dark.ts
|
|
1031
|
+
var dark_default = {
|
|
1032
|
+
hljs: {
|
|
1033
|
+
display: "block",
|
|
1034
|
+
overflowX: "auto",
|
|
1035
|
+
padding: "0.5em",
|
|
1036
|
+
background: "black",
|
|
1037
|
+
color: "#ddd"
|
|
1038
|
+
},
|
|
1039
|
+
"hljs-keyword": {
|
|
1040
|
+
color: "white",
|
|
1041
|
+
fontWeight: "bold"
|
|
1042
|
+
},
|
|
1043
|
+
"hljs-selector-tag": {
|
|
1044
|
+
color: "white",
|
|
1045
|
+
fontWeight: "bold"
|
|
1046
|
+
},
|
|
1047
|
+
"hljs-literal": {
|
|
1048
|
+
color: "white",
|
|
1049
|
+
fontWeight: "bold"
|
|
1050
|
+
},
|
|
1051
|
+
"hljs-section": {
|
|
1052
|
+
color: "white",
|
|
1053
|
+
fontWeight: "bold"
|
|
1054
|
+
},
|
|
1055
|
+
"hljs-link": {
|
|
1056
|
+
color: "white"
|
|
1057
|
+
},
|
|
1058
|
+
"hljs-subst": {
|
|
1059
|
+
color: "#ddd"
|
|
1060
|
+
},
|
|
1061
|
+
"hljs-string": {
|
|
1062
|
+
color: "#d88"
|
|
1063
|
+
},
|
|
1064
|
+
"hljs-title": {
|
|
1065
|
+
color: "#d88",
|
|
1066
|
+
fontWeight: "bold"
|
|
1067
|
+
},
|
|
1068
|
+
"hljs-name": {
|
|
1069
|
+
color: "#d88",
|
|
1070
|
+
fontWeight: "bold"
|
|
1071
|
+
},
|
|
1072
|
+
"hljs-type": {
|
|
1073
|
+
color: "#d88",
|
|
1074
|
+
fontWeight: "bold"
|
|
1075
|
+
},
|
|
1076
|
+
"hljs-attribute": {
|
|
1077
|
+
color: "#d88"
|
|
1078
|
+
},
|
|
1079
|
+
"hljs-symbol": {
|
|
1080
|
+
color: "#d88"
|
|
1081
|
+
},
|
|
1082
|
+
"hljs-bullet": {
|
|
1083
|
+
color: "#d88"
|
|
1084
|
+
},
|
|
1085
|
+
"hljs-built_in": {
|
|
1086
|
+
color: "#d88"
|
|
1087
|
+
},
|
|
1088
|
+
"hljs-addition": {
|
|
1089
|
+
color: "#d88"
|
|
1090
|
+
},
|
|
1091
|
+
"hljs-variable": {
|
|
1092
|
+
color: "#d88"
|
|
1093
|
+
},
|
|
1094
|
+
"hljs-template-tag": {
|
|
1095
|
+
color: "#d88"
|
|
1096
|
+
},
|
|
1097
|
+
"hljs-template-variable": {
|
|
1098
|
+
color: "#d88"
|
|
1099
|
+
},
|
|
1100
|
+
"hljs-comment": {
|
|
1101
|
+
color: "#777"
|
|
1102
|
+
},
|
|
1103
|
+
"hljs-quote": {
|
|
1104
|
+
color: "#777"
|
|
1105
|
+
},
|
|
1106
|
+
"hljs-deletion": {
|
|
1107
|
+
color: "#777"
|
|
1108
|
+
},
|
|
1109
|
+
"hljs-meta": {
|
|
1110
|
+
color: "#777"
|
|
1111
|
+
},
|
|
1112
|
+
"hljs-doctag": {
|
|
1113
|
+
fontWeight: "bold"
|
|
1114
|
+
},
|
|
1115
|
+
"hljs-strong": {
|
|
1116
|
+
fontWeight: "bold"
|
|
1117
|
+
},
|
|
1118
|
+
"hljs-emphasis": {
|
|
1119
|
+
fontStyle: "italic"
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
// src/components/syntax/styles/light.ts
|
|
1124
|
+
var light_default = {
|
|
1125
|
+
hljs: {
|
|
1126
|
+
display: "block",
|
|
1127
|
+
overflowX: "auto",
|
|
1128
|
+
padding: "0.5em",
|
|
1129
|
+
color: "#000",
|
|
1130
|
+
background: "#f8f8ff"
|
|
1131
|
+
},
|
|
1132
|
+
"hljs-comment": {
|
|
1133
|
+
color: "#408080",
|
|
1134
|
+
fontStyle: "italic"
|
|
1135
|
+
},
|
|
1136
|
+
"hljs-quote": {
|
|
1137
|
+
color: "#408080",
|
|
1138
|
+
fontStyle: "italic"
|
|
1139
|
+
},
|
|
1140
|
+
"hljs-keyword": {
|
|
1141
|
+
color: "#954121"
|
|
1142
|
+
},
|
|
1143
|
+
"hljs-selector-tag": {
|
|
1144
|
+
color: "#954121"
|
|
1145
|
+
},
|
|
1146
|
+
"hljs-literal": {
|
|
1147
|
+
color: "#954121"
|
|
1148
|
+
},
|
|
1149
|
+
"hljs-subst": {
|
|
1150
|
+
color: "#954121"
|
|
1151
|
+
},
|
|
1152
|
+
"hljs-number": {
|
|
1153
|
+
color: "#40a070"
|
|
1154
|
+
},
|
|
1155
|
+
"hljs-string": {
|
|
1156
|
+
color: "#219161"
|
|
1157
|
+
},
|
|
1158
|
+
"hljs-doctag": {
|
|
1159
|
+
color: "#219161"
|
|
1160
|
+
},
|
|
1161
|
+
"hljs-selector-id": {
|
|
1162
|
+
color: "#19469d"
|
|
1163
|
+
},
|
|
1164
|
+
"hljs-selector-class": {
|
|
1165
|
+
color: "#19469d"
|
|
1166
|
+
},
|
|
1167
|
+
"hljs-section": {
|
|
1168
|
+
color: "#19469d"
|
|
1169
|
+
},
|
|
1170
|
+
"hljs-type": {
|
|
1171
|
+
color: "#19469d"
|
|
1172
|
+
},
|
|
1173
|
+
"hljs-params": {
|
|
1174
|
+
color: "#00f"
|
|
1175
|
+
},
|
|
1176
|
+
"hljs-title": {
|
|
1177
|
+
color: "#458",
|
|
1178
|
+
fontWeight: "bold"
|
|
1179
|
+
},
|
|
1180
|
+
"hljs-tag": {
|
|
1181
|
+
color: "#000080",
|
|
1182
|
+
fontWeight: "normal"
|
|
1183
|
+
},
|
|
1184
|
+
"hljs-name": {
|
|
1185
|
+
color: "#000080",
|
|
1186
|
+
fontWeight: "normal"
|
|
1187
|
+
},
|
|
1188
|
+
"hljs-attribute": {
|
|
1189
|
+
color: "#000080",
|
|
1190
|
+
fontWeight: "normal"
|
|
1191
|
+
},
|
|
1192
|
+
"hljs-variable": {
|
|
1193
|
+
color: "#008080"
|
|
1194
|
+
},
|
|
1195
|
+
"hljs-template-variable": {
|
|
1196
|
+
color: "#008080"
|
|
1197
|
+
},
|
|
1198
|
+
"hljs-regexp": {
|
|
1199
|
+
color: "#b68"
|
|
1200
|
+
},
|
|
1201
|
+
"hljs-link": {
|
|
1202
|
+
color: "#b68"
|
|
1203
|
+
},
|
|
1204
|
+
"hljs-symbol": {
|
|
1205
|
+
color: "#990073"
|
|
1206
|
+
},
|
|
1207
|
+
"hljs-bullet": {
|
|
1208
|
+
color: "#990073"
|
|
1209
|
+
},
|
|
1210
|
+
"hljs-built_in": {
|
|
1211
|
+
color: "#0086b3"
|
|
1212
|
+
},
|
|
1213
|
+
"hljs-builtin-name": {
|
|
1214
|
+
color: "#0086b3"
|
|
1215
|
+
},
|
|
1216
|
+
"hljs-meta": {
|
|
1217
|
+
color: "#999",
|
|
1218
|
+
fontWeight: "bold"
|
|
1219
|
+
},
|
|
1220
|
+
"hljs-deletion": {
|
|
1221
|
+
background: "#fdd"
|
|
1222
|
+
},
|
|
1223
|
+
"hljs-addition": {
|
|
1224
|
+
background: "#dfd"
|
|
1225
|
+
},
|
|
1226
|
+
"hljs-emphasis": {
|
|
1227
|
+
fontStyle: "italic"
|
|
1228
|
+
},
|
|
1229
|
+
"hljs-strong": {
|
|
1230
|
+
fontWeight: "bold"
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
var CodeTag = ({ children, style, ...props }) => {
|
|
1234
|
+
const styles7 = useStyles5();
|
|
1235
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.codeText, style], ...props, children }) });
|
|
1236
|
+
};
|
|
1237
|
+
var useStyles5 = () => {
|
|
1238
|
+
return reactNative.StyleSheet.create({
|
|
1239
|
+
codeText: {
|
|
1240
|
+
fontFamily: getMonospaceFontName()
|
|
1241
|
+
}
|
|
1242
|
+
});
|
|
1243
|
+
};
|
|
1244
|
+
var PreTag = ({ children, style, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, style, ...props, children });
|
|
1245
|
+
var SyntaxColoring = mobxReactLite.observer(({ code, language, maxCodeLength }) => {
|
|
1246
|
+
const style = commonStore.isDarkMode ? dark_default : light_default;
|
|
1247
|
+
const isSyntaxHighlightingEnabled = !maxCodeLength || code.length < maxCodeLength;
|
|
1248
|
+
if (isSyntaxHighlightingEnabled) {
|
|
1249
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SyntaxHighlighter__default.default, { language, style, PreTag, CodeTag, children: code });
|
|
1250
|
+
}
|
|
1251
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { style: styles.codeText, numberOfLines: 0, children: code }) });
|
|
1252
|
+
});
|
|
1253
|
+
var styles = reactNative.StyleSheet.create({
|
|
1254
|
+
codeText: {
|
|
1255
|
+
fontFamily: getMonospaceFontName()
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
var DialogSyntaxColorResult = ({
|
|
1259
|
+
icon,
|
|
1260
|
+
title,
|
|
1261
|
+
code,
|
|
1262
|
+
language,
|
|
1263
|
+
maxCodeLength,
|
|
1264
|
+
onClose,
|
|
1265
|
+
isVisible,
|
|
1266
|
+
...dialogProps
|
|
1267
|
+
}) => {
|
|
1268
|
+
const styles7 = useStyles6();
|
|
1269
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
1270
|
+
const { t } = reactI18next.useTranslation();
|
|
1271
|
+
const hasIcon = !!icon;
|
|
1272
|
+
const hasTitle = !!title;
|
|
1273
|
+
const onCopy = () => {
|
|
1274
|
+
setClipboardTextContent(code);
|
|
1275
|
+
showSnackbarMessage(t("common:copiedToClipboard"));
|
|
1276
|
+
};
|
|
1277
|
+
if (!isVisible) {
|
|
1278
|
+
return null;
|
|
1279
|
+
}
|
|
1280
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog, { visible: true, onDismiss: onClose, style: styles7.dialog, ...dialogProps, children: [
|
|
1281
|
+
hasIcon && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Icon, { icon }),
|
|
1282
|
+
hasTitle && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Title, { children: title }),
|
|
1283
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.ScrollArea, { children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { children: /* @__PURE__ */ jsxRuntime.jsx(SyntaxColoring, { code, language, maxCodeLength }) }) }),
|
|
1284
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog.Actions, { children: [
|
|
1285
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "outlined", onPress: onCopy, icon: "content-copy", children: t("common:copy") }),
|
|
1286
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "contained", onPress: onClose, children: t("common:close") })
|
|
1287
|
+
] })
|
|
1288
|
+
] }) });
|
|
1289
|
+
};
|
|
1290
|
+
var useStyles6 = () => {
|
|
1291
|
+
const { width, alignSelf } = useDialogStyles();
|
|
1292
|
+
const { height } = reactNative.useWindowDimensions();
|
|
1293
|
+
return reactNative.StyleSheet.create({
|
|
1294
|
+
dialog: {
|
|
1295
|
+
maxHeight: height * 0.8,
|
|
1296
|
+
width,
|
|
1297
|
+
alignSelf
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
// src/components/drop-down-selector/drop-down-selector.utils.ts
|
|
1303
|
+
var getTextColor = ({ theme, isFocused, isDisabled }) => {
|
|
1304
|
+
const { onSurfaceDisabled, primary, secondary } = theme.colors;
|
|
1305
|
+
if (isDisabled) {
|
|
1306
|
+
return onSurfaceDisabled;
|
|
1307
|
+
}
|
|
1308
|
+
if (isFocused) {
|
|
1309
|
+
return primary;
|
|
1310
|
+
}
|
|
1311
|
+
return secondary;
|
|
1312
|
+
};
|
|
1313
|
+
var getLabelColor = ({ theme, isError, isDisabled, isFocusedAndEnabled }) => {
|
|
1314
|
+
const { error, onSurfaceDisabled, primary, onSurface } = theme.colors;
|
|
1315
|
+
if (isError) {
|
|
1316
|
+
return error;
|
|
1317
|
+
}
|
|
1318
|
+
if (isDisabled) {
|
|
1319
|
+
return onSurfaceDisabled;
|
|
1320
|
+
}
|
|
1321
|
+
if (isFocusedAndEnabled) {
|
|
1322
|
+
return primary;
|
|
1323
|
+
}
|
|
1324
|
+
return onSurface;
|
|
1325
|
+
};
|
|
1326
|
+
var getBorderColor = ({ theme, isError, isDisabled, isFocused }) => {
|
|
1327
|
+
const { error, surfaceDisabled, primary, outline } = theme.colors;
|
|
1328
|
+
if (isError) {
|
|
1329
|
+
return error;
|
|
1330
|
+
}
|
|
1331
|
+
if (isDisabled) {
|
|
1332
|
+
return surfaceDisabled;
|
|
1333
|
+
}
|
|
1334
|
+
if (isFocused) {
|
|
1335
|
+
return primary;
|
|
1336
|
+
}
|
|
1337
|
+
return outline;
|
|
1338
|
+
};
|
|
1339
|
+
var DropDownSelectorLeftIcon = ({
|
|
1340
|
+
icon,
|
|
1341
|
+
color,
|
|
1342
|
+
size = 20
|
|
1343
|
+
}) => {
|
|
1344
|
+
if (!icon) {
|
|
1345
|
+
return null;
|
|
1346
|
+
}
|
|
1347
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Icon, { source: icon, size, color });
|
|
1348
|
+
};
|
|
1349
|
+
var DropDownSelectorItem = ({ item, selected, textColor }) => {
|
|
1350
|
+
const isSelected = selected === true;
|
|
1351
|
+
const styles7 = useStyles7({ isSelected });
|
|
1352
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.itemContainer, children: [
|
|
1353
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx(DropDownSelectorLeftIcon, { icon: item.icon, color: textColor }),
|
|
1354
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { style: { color: textColor }, children: item.label })
|
|
1355
|
+
] });
|
|
1356
|
+
};
|
|
1357
|
+
var useStyles7 = ({ isSelected }) => {
|
|
1358
|
+
const theme = useAppTheme();
|
|
1359
|
+
return reactNative.StyleSheet.create({
|
|
1360
|
+
itemContainer: {
|
|
1361
|
+
flexDirection: "row",
|
|
1362
|
+
alignItems: "center",
|
|
1363
|
+
paddingVertical: theme.spacing(1),
|
|
1364
|
+
paddingHorizontal: theme.spacing(1),
|
|
1365
|
+
gap: theme.spacing(1),
|
|
1366
|
+
backgroundColor: isSelected ? theme.colors.surfaceVariant : theme.colors.surface
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
};
|
|
1370
|
+
var DropDownSelector = ({
|
|
1371
|
+
label,
|
|
1372
|
+
value,
|
|
1373
|
+
onChange,
|
|
1374
|
+
isError,
|
|
1375
|
+
options: options2,
|
|
1376
|
+
placeholder,
|
|
1377
|
+
searchPlaceholder,
|
|
1378
|
+
disabled
|
|
1379
|
+
}) => {
|
|
1380
|
+
const [isFocused, setIsFocused] = react.useState(false);
|
|
1381
|
+
const hasLabel = !!label;
|
|
1382
|
+
const theme = useAppTheme();
|
|
1383
|
+
const isDisabled = disabled === true;
|
|
1384
|
+
const textColor = getTextColor({ theme, isFocused, isDisabled });
|
|
1385
|
+
const styles7 = useStyles8({ isFocused, disabled, isError, textColor });
|
|
1386
|
+
const selectedItem = options2.find((option) => option.value === value);
|
|
1387
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
1388
|
+
hasLabel && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", style: styles7.dropdownTitle, children: label }),
|
|
1389
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1390
|
+
reactNativeElementDropdown.Dropdown,
|
|
1391
|
+
{
|
|
1392
|
+
style: styles7.dropdown,
|
|
1393
|
+
autoScroll: false,
|
|
1394
|
+
placeholderStyle: styles7.placeholderStyle,
|
|
1395
|
+
selectedTextStyle: styles7.selectedTextStyle,
|
|
1396
|
+
data: options2,
|
|
1397
|
+
search: false,
|
|
1398
|
+
searchPlaceholder,
|
|
1399
|
+
maxHeight: 300,
|
|
1400
|
+
labelField: "label",
|
|
1401
|
+
valueField: "value",
|
|
1402
|
+
placeholder: isFocused ? "" : placeholder,
|
|
1403
|
+
value,
|
|
1404
|
+
disable: disabled,
|
|
1405
|
+
onFocus: () => setIsFocused(true),
|
|
1406
|
+
onBlur: () => setIsFocused(false),
|
|
1407
|
+
onChange: ({ value: value2 }) => {
|
|
1408
|
+
onChange(value2);
|
|
1409
|
+
setIsFocused(false);
|
|
1410
|
+
},
|
|
1411
|
+
renderItem: (item, selected) => /* @__PURE__ */ jsxRuntime.jsx(DropDownSelectorItem, { item, selected, textColor }),
|
|
1412
|
+
renderLeftIcon: () => /* @__PURE__ */ jsxRuntime.jsx(DropDownSelectorLeftIcon, { icon: selectedItem?.icon, color: textColor })
|
|
1413
|
+
}
|
|
1414
|
+
)
|
|
1415
|
+
] });
|
|
1416
|
+
};
|
|
1417
|
+
var useStyles8 = ({ isFocused, disabled, isError, textColor }) => {
|
|
1418
|
+
const theme = useAppTheme();
|
|
1419
|
+
const { surface, surfaceDisabled } = theme.colors;
|
|
1420
|
+
const isDisabled = disabled === true;
|
|
1421
|
+
const isFocusedAndEnabled = isFocused && !isDisabled;
|
|
1422
|
+
const labelColor = getLabelColor({ theme, isError: !!isError, isDisabled, isFocusedAndEnabled });
|
|
1423
|
+
const borderColor = getBorderColor({ theme, isError: !!isError, isDisabled, isFocused });
|
|
1424
|
+
const borderWidth = isFocusedAndEnabled ? 2 : 1;
|
|
1425
|
+
const backgroundColor = isDisabled ? surfaceDisabled : "transparent";
|
|
1426
|
+
return reactNative.StyleSheet.create({
|
|
1427
|
+
dropdownTitle: {
|
|
1428
|
+
position: "absolute",
|
|
1429
|
+
top: -theme.spacing(1),
|
|
1430
|
+
left: theme.spacing(1),
|
|
1431
|
+
backgroundColor: surface,
|
|
1432
|
+
paddingHorizontal: theme.spacing(0.75),
|
|
1433
|
+
color: labelColor,
|
|
1434
|
+
zIndex: 1
|
|
1435
|
+
},
|
|
1436
|
+
dropdown: {
|
|
1437
|
+
height: 50,
|
|
1438
|
+
borderColor,
|
|
1439
|
+
borderWidth,
|
|
1440
|
+
borderRadius: theme.roundness,
|
|
1441
|
+
paddingHorizontal: theme.spacing(1),
|
|
1442
|
+
backgroundColor
|
|
1443
|
+
},
|
|
1444
|
+
placeholderStyle: {
|
|
1445
|
+
color: textColor
|
|
1446
|
+
},
|
|
1447
|
+
selectedTextStyle: {
|
|
1448
|
+
color: textColor,
|
|
1449
|
+
paddingLeft: theme.spacing(1)
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
// src/services/files/native-file-system.types.ts
|
|
1455
|
+
var EncodingType = /* @__PURE__ */ ((EncodingType2) => {
|
|
1456
|
+
EncodingType2["UTF8"] = "utf8";
|
|
1457
|
+
EncodingType2["Base64"] = "base64";
|
|
1458
|
+
return EncodingType2;
|
|
1459
|
+
})(EncodingType || {});
|
|
1460
|
+
|
|
1461
|
+
// src/services/files/native-file-system.ts
|
|
1462
|
+
var NativeFileSystem = class {
|
|
1463
|
+
constructor() {
|
|
1464
|
+
this.documentDirectory = expoFileSystem.Paths.document.uri;
|
|
1465
|
+
this.cacheDirectory = expoFileSystem.Paths.cache.uri;
|
|
1466
|
+
this.EncodingType = EncodingType;
|
|
1467
|
+
}
|
|
1468
|
+
async writeAsStringAsync(fileUri, contents, options2) {
|
|
1469
|
+
const file = new expoFileSystem.File(fileUri);
|
|
1470
|
+
if (options2?.encoding === "base64" /* Base64 */) {
|
|
1471
|
+
file.write(contents, { encoding: "base64" });
|
|
1472
|
+
return;
|
|
1473
|
+
}
|
|
1474
|
+
file.write(contents, { encoding: "utf8" });
|
|
1475
|
+
}
|
|
1476
|
+
async readAsStringAsync(fileUri, options2) {
|
|
1477
|
+
const file = new expoFileSystem.File(fileUri);
|
|
1478
|
+
if (options2?.encoding === "base64" /* Base64 */) {
|
|
1479
|
+
const bytes = await file.bytes();
|
|
1480
|
+
return buffer.Buffer.from(bytes).toString("base64");
|
|
1481
|
+
}
|
|
1482
|
+
return file.textSync();
|
|
1483
|
+
}
|
|
1484
|
+
async readAsBase64Async(fileUri) {
|
|
1485
|
+
return this.readAsStringAsync(fileUri, { encoding: "base64" /* Base64 */ });
|
|
1486
|
+
}
|
|
1487
|
+
async getInfoAsync(fileUri) {
|
|
1488
|
+
const pathInfo = expoFileSystem.Paths.info(fileUri);
|
|
1489
|
+
if (pathInfo.isDirectory) {
|
|
1490
|
+
const directory = new expoFileSystem.Directory(fileUri);
|
|
1491
|
+
const info2 = directory.info();
|
|
1492
|
+
return {
|
|
1493
|
+
exists: info2.exists,
|
|
1494
|
+
isDirectory: true,
|
|
1495
|
+
size: info2.size,
|
|
1496
|
+
modificationTime: info2.modificationTime,
|
|
1497
|
+
uri: fileUri
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
const file = new expoFileSystem.File(fileUri);
|
|
1501
|
+
const info = file.info();
|
|
1502
|
+
return {
|
|
1503
|
+
exists: info.exists,
|
|
1504
|
+
isDirectory: false,
|
|
1505
|
+
size: info.size,
|
|
1506
|
+
modificationTime: info.modificationTime,
|
|
1507
|
+
uri: fileUri
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
async copyContentUriToLocal(contentUri, fileName) {
|
|
1511
|
+
logger.info(`[copyContentUriToLocal] Copying content uri to local file: ${fileName}`);
|
|
1512
|
+
try {
|
|
1513
|
+
const localUri = `${expoFileSystem.Paths.document.uri}${fileName}`;
|
|
1514
|
+
await FileSystemLegacy__namespace.copyAsync({ from: contentUri, to: localUri });
|
|
1515
|
+
logger.info(`[copyContentUriToLocal] Copy successful: ${localUri}`);
|
|
1516
|
+
return localUri;
|
|
1517
|
+
} catch (e) {
|
|
1518
|
+
logger.error(`[copyContentUriToLocal] Copy failed: ${tsCommon.getErrorMessage(e)}`, e);
|
|
1519
|
+
throw e;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
async readDirectoryAsync(fileUri) {
|
|
1523
|
+
const directory = new expoFileSystem.Directory(fileUri);
|
|
1524
|
+
const contents = directory.list();
|
|
1525
|
+
return contents.map((item) => item.name);
|
|
1526
|
+
}
|
|
1527
|
+
async makeDirectoryAsync(fileUri, options2) {
|
|
1528
|
+
const directory = new expoFileSystem.Directory(fileUri);
|
|
1529
|
+
const intermediates = options2?.intermediates ?? false;
|
|
1530
|
+
directory.create({ intermediates });
|
|
1531
|
+
}
|
|
1532
|
+
async deleteAsync(fileUri) {
|
|
1533
|
+
const pathInfo = expoFileSystem.Paths.info(fileUri);
|
|
1534
|
+
if (!pathInfo.exists) {
|
|
1535
|
+
logger.warn(`[deleteAsync] Path does not exist: ${fileUri}`);
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
if (pathInfo.isDirectory) {
|
|
1539
|
+
const directory = new expoFileSystem.Directory(fileUri);
|
|
1540
|
+
directory.delete();
|
|
1541
|
+
} else {
|
|
1542
|
+
const file = new expoFileSystem.File(fileUri);
|
|
1543
|
+
file.delete();
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
var nativeFileSystem = new NativeFileSystem();
|
|
1548
|
+
|
|
1549
|
+
// src/utils/file.utils.ts
|
|
1550
|
+
var DEFAULT_ENCODING = "utf8" /* UTF8 */;
|
|
1551
|
+
var DEFAULT_OPTIONS = { encoding: DEFAULT_ENCODING };
|
|
1552
|
+
var isFileExists = async (fileUri = "") => {
|
|
1553
|
+
const { exists } = await nativeFileSystem.getInfoAsync(fileUri);
|
|
1554
|
+
return exists;
|
|
1555
|
+
};
|
|
1556
|
+
var getDocumentFolderRelativePath = (fileUri = "/") => fileUri.substring(nativeFileSystem.documentDirectory?.length ?? 0);
|
|
1557
|
+
var getDocumentFullFilename = (filename = "") => nativeFileSystem.documentDirectory + filename;
|
|
1558
|
+
var createDirectoryStructure = async (folderUri = "") => {
|
|
1559
|
+
const exists = await isFileExists(folderUri);
|
|
1560
|
+
if (exists) {
|
|
1561
|
+
return { exists: true };
|
|
1562
|
+
}
|
|
1563
|
+
try {
|
|
1564
|
+
await nativeFileSystem.makeDirectoryAsync(folderUri, { intermediates: true });
|
|
1565
|
+
return { exists: true };
|
|
1566
|
+
} catch (error) {
|
|
1567
|
+
logger.error("createDirectoryStructure", error);
|
|
1568
|
+
return {
|
|
1569
|
+
exists: false,
|
|
1570
|
+
error
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
};
|
|
1574
|
+
var saveTextContent = async ({ fileUri = "", text = "" }) => {
|
|
1575
|
+
try {
|
|
1576
|
+
await nativeFileSystem.writeAsStringAsync(fileUri, text, DEFAULT_OPTIONS);
|
|
1577
|
+
const exists = await isFileExists(fileUri);
|
|
1578
|
+
return { exists };
|
|
1579
|
+
} catch (error) {
|
|
1580
|
+
logger.error("saveTextContent", error);
|
|
1581
|
+
return {
|
|
1582
|
+
exists: false,
|
|
1583
|
+
error
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
};
|
|
1587
|
+
var loadTextContent = async (fileUri = "") => {
|
|
1588
|
+
const exists = await isFileExists(fileUri);
|
|
1589
|
+
if (!exists) {
|
|
1590
|
+
return { exists };
|
|
1591
|
+
}
|
|
1592
|
+
try {
|
|
1593
|
+
const content = await nativeFileSystem.readAsStringAsync(fileUri, DEFAULT_OPTIONS);
|
|
1594
|
+
return {
|
|
1595
|
+
exists,
|
|
1596
|
+
content
|
|
1597
|
+
};
|
|
1598
|
+
} catch (error) {
|
|
1599
|
+
logger.error("loadTextContent", error);
|
|
1600
|
+
return { exists, error };
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
var deleteFile = async (fileUri = "") => {
|
|
1604
|
+
const exists = await isFileExists(fileUri);
|
|
1605
|
+
if (!exists) {
|
|
1606
|
+
return { exists };
|
|
1607
|
+
}
|
|
1608
|
+
try {
|
|
1609
|
+
await nativeFileSystem.deleteAsync(fileUri);
|
|
1610
|
+
return { exists };
|
|
1611
|
+
} catch (error) {
|
|
1612
|
+
logger.error("deleteFile", error);
|
|
1613
|
+
return { exists, error };
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
var nowAsIsoFilename = () => {
|
|
1617
|
+
const isoString = (/* @__PURE__ */ new Date()).toISOString();
|
|
1618
|
+
return isoString.replace(new RegExp(":", "g"), "_");
|
|
1619
|
+
};
|
|
1620
|
+
var isFileUri = (uri) => {
|
|
1621
|
+
if (!tsCommon.hasScheme(uri)) {
|
|
1622
|
+
return false;
|
|
1623
|
+
}
|
|
1624
|
+
try {
|
|
1625
|
+
return new URL(uri).protocol === `${tsCommon.SCHEME_PREFIXES.file}:`;
|
|
1626
|
+
} catch (e) {
|
|
1627
|
+
logger.debug(`[isFileUri] Invalid URI: [${uri}]`, e);
|
|
1628
|
+
return false;
|
|
1629
|
+
}
|
|
1630
|
+
};
|
|
1631
|
+
var normalizeFileUri = (uri) => {
|
|
1632
|
+
if (!uri) {
|
|
1633
|
+
return "";
|
|
1634
|
+
}
|
|
1635
|
+
if (isFileUri(uri)) {
|
|
1636
|
+
return uri;
|
|
1637
|
+
}
|
|
1638
|
+
if (tsCommon.hasScheme(uri)) {
|
|
1639
|
+
logger.debug(`[normalizeFileUri] Non-file URI scheme provided: [${uri}]`);
|
|
1640
|
+
return "";
|
|
1641
|
+
}
|
|
1642
|
+
return `${tsCommon.SCHEME_PREFIXES.file}://${uri}`;
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
// src/utils/sharing.utils.ts
|
|
1646
|
+
var buildShareOptionsFromMimeType = (mimeType) => {
|
|
1647
|
+
if (!mimeType) {
|
|
1648
|
+
return {};
|
|
1649
|
+
}
|
|
1650
|
+
const dialogTitle = i18next__default.default.t("common:share");
|
|
1651
|
+
if (mimeType === "text/plain") {
|
|
1652
|
+
return reactNative.Platform.select({
|
|
1653
|
+
ios: { mimeType: "public.plain-text", UTI: "public.plain-text" },
|
|
1654
|
+
default: { dialogTitle, mimeType }
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
if (["application/xml", "text/xml"].includes(mimeType)) {
|
|
1658
|
+
return reactNative.Platform.select({
|
|
1659
|
+
ios: { mimeType: "application/xml", UTI: "public.xml" },
|
|
1660
|
+
default: { dialogTitle, mimeType }
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
return {};
|
|
1664
|
+
};
|
|
1665
|
+
var shareTextFile = async (fileUri) => {
|
|
1666
|
+
return shareFile({ fileUri, mimeType: "text/plain" });
|
|
1667
|
+
};
|
|
1668
|
+
var shareXmlFile = async (fileUri) => {
|
|
1669
|
+
return shareFile({ fileUri, mimeType: "application/xml" });
|
|
1670
|
+
};
|
|
1671
|
+
var shareFile = async ({ fileUri, mimeType }) => {
|
|
1672
|
+
if (!fileUri) {
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1675
|
+
const isAvailable = await Sharing__namespace.isAvailableAsync();
|
|
1676
|
+
if (!isAvailable) {
|
|
1677
|
+
logger.warn("Sharing is not available on this device");
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
const options2 = buildShareOptionsFromMimeType(mimeType);
|
|
1681
|
+
const normalizedFileUri = normalizeFileUri(fileUri);
|
|
1682
|
+
if (!normalizedFileUri) {
|
|
1683
|
+
logger.warn(`[shareFile] Invalid file URI: [${fileUri}]`);
|
|
1684
|
+
return;
|
|
1685
|
+
}
|
|
1686
|
+
try {
|
|
1687
|
+
logger.info(`Sharing file [${normalizedFileUri}] of type ${mimeType}.`);
|
|
1688
|
+
await Sharing__namespace.shareAsync(normalizedFileUri, options2);
|
|
1689
|
+
} catch (e) {
|
|
1690
|
+
logger.error(`Error while sharing file [${normalizedFileUri}] of type ${mimeType}`, e);
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
var shareCurrentLogsFile = async () => {
|
|
1694
|
+
const logsFileUri = await loadCurrentLogsFileUri();
|
|
1695
|
+
return shareTextFile(logsFileUri);
|
|
1696
|
+
};
|
|
1697
|
+
var ErrorBoundaryScreen = () => {
|
|
1698
|
+
const styles7 = useStyles9();
|
|
1699
|
+
const { t } = reactI18next.useTranslation();
|
|
1700
|
+
const { title, description, id } = expoRouter.useLocalSearchParams();
|
|
1701
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.container, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Card, { style: styles7.card, children: [
|
|
1702
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Card.Title, { title, titleStyle: styles7.errorText }),
|
|
1703
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Card.Content, { children: [
|
|
1704
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "titleMedium", style: styles7.label, children: "ID:" }),
|
|
1705
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", children: id }),
|
|
1706
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "titleMedium", style: styles7.label, children: "Description:" }),
|
|
1707
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", children: description })
|
|
1708
|
+
] }),
|
|
1709
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Card.Actions, { children: [
|
|
1710
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "outlined", onPress: shareCurrentLogsFile, children: t("common:errorBoundary.details") }),
|
|
1711
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "contained", onPress: () => expoRouter.router.replace("/"), children: t("common:close") })
|
|
1712
|
+
] })
|
|
1713
|
+
] }) });
|
|
1714
|
+
};
|
|
1715
|
+
var useStyles9 = () => {
|
|
1716
|
+
const theme = useAppTheme();
|
|
1717
|
+
return reactNative.StyleSheet.create({
|
|
1718
|
+
container: {
|
|
1719
|
+
flex: 1,
|
|
1720
|
+
marginTop: theme.spacing(2),
|
|
1721
|
+
padding: theme.spacing(2)
|
|
1722
|
+
},
|
|
1723
|
+
card: {
|
|
1724
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth,
|
|
1725
|
+
borderColor: theme.colors.error
|
|
1726
|
+
},
|
|
1727
|
+
errorText: {
|
|
1728
|
+
color: theme.colors.error
|
|
1729
|
+
},
|
|
1730
|
+
label: {
|
|
1731
|
+
marginTop: theme.spacing(1),
|
|
1732
|
+
color: theme.colors.onSurfaceVariant
|
|
1733
|
+
}
|
|
1734
|
+
});
|
|
1735
|
+
};
|
|
1736
|
+
var useErrorDetails = (error) => {
|
|
1737
|
+
const { t } = reactI18next.useTranslation();
|
|
1738
|
+
const id = uuid__default.default.v4();
|
|
1739
|
+
const title = t("common:error");
|
|
1740
|
+
const errorMsg = tsCommon.getErrorMessage(error) || "Unknown";
|
|
1741
|
+
const description = t("common:errorBoundary.error", { id, errorMsg });
|
|
1742
|
+
const stack = error instanceof Error ? error.stack : "";
|
|
1743
|
+
return {
|
|
1744
|
+
id,
|
|
1745
|
+
title,
|
|
1746
|
+
errorMsg,
|
|
1747
|
+
description,
|
|
1748
|
+
stack
|
|
1749
|
+
};
|
|
1750
|
+
};
|
|
1751
|
+
|
|
1752
|
+
// src/components/error/error-boundary.tsx
|
|
1753
|
+
var ErrorBoundary = ({ error }) => {
|
|
1754
|
+
const router3 = expoRouter.useRouter();
|
|
1755
|
+
const { title, description, errorMsg, id, stack } = useErrorDetails(error);
|
|
1756
|
+
react.useEffect(() => {
|
|
1757
|
+
logger.error(`ErrorBoundary Unexpected error: ${errorMsg} (ID: ${id}). Stack: ${stack}`, error);
|
|
1758
|
+
Sentry__namespace.captureException(error, {
|
|
1759
|
+
extra: {
|
|
1760
|
+
title,
|
|
1761
|
+
description,
|
|
1762
|
+
errorMsg,
|
|
1763
|
+
id,
|
|
1764
|
+
stack
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
router3.replace({
|
|
1768
|
+
pathname: "/error",
|
|
1769
|
+
params: { title, description, errorMsg, id }
|
|
1770
|
+
});
|
|
1771
|
+
}, [router3, error]);
|
|
1772
|
+
return null;
|
|
1773
|
+
};
|
|
1774
|
+
var ErrorDetails = ({ error, title = "Error" }) => {
|
|
1775
|
+
const styles7 = useStyles10();
|
|
1776
|
+
const errorToStringify = {
|
|
1777
|
+
...error,
|
|
1778
|
+
stack: void 0
|
|
1779
|
+
};
|
|
1780
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNativeGestureHandler.ScrollView, { style: styles7.container, children: [
|
|
1781
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", style: styles7.errorText, children: title }),
|
|
1782
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { style: styles7.jsonText, children: JSON.stringify(errorToStringify, null, 2) })
|
|
1783
|
+
] });
|
|
1784
|
+
};
|
|
1785
|
+
var useStyles10 = () => {
|
|
1786
|
+
const theme = useAppTheme();
|
|
1787
|
+
return reactNative.StyleSheet.create({
|
|
1788
|
+
container: {
|
|
1789
|
+
flex: 1,
|
|
1790
|
+
padding: theme.spacing(2),
|
|
1791
|
+
borderWidth: reactNative.StyleSheet.hairlineWidth,
|
|
1792
|
+
borderColor: theme.colors.error
|
|
1793
|
+
},
|
|
1794
|
+
errorText: {
|
|
1795
|
+
color: theme.colors.error
|
|
1796
|
+
},
|
|
1797
|
+
jsonText: {
|
|
1798
|
+
fontSize: 12,
|
|
1799
|
+
fontFamily: reactNative.Platform.select({
|
|
1800
|
+
ios: "Menlo",
|
|
1801
|
+
default: "monospace"
|
|
1802
|
+
})
|
|
1803
|
+
}
|
|
1804
|
+
});
|
|
1805
|
+
};
|
|
1806
|
+
var EventLogsScreen = () => {
|
|
1807
|
+
const styles7 = useStyles11();
|
|
1808
|
+
const theme = useAppTheme();
|
|
1809
|
+
const { t } = reactI18next.useTranslation();
|
|
1810
|
+
const [files, setFiles] = react.useState([]);
|
|
1811
|
+
react.useEffect(() => {
|
|
1812
|
+
loadAllLogFilesInfo().then(setFiles);
|
|
1813
|
+
}, []);
|
|
1814
|
+
const [isDeleteDialogVisible, toggleDeleteConfirmVisibility] = usehooks.useToggle(false);
|
|
1815
|
+
const onDeleteConfirmed = () => {
|
|
1816
|
+
deleteAllLogFiles().then(() => setFiles([])).finally(() => toggleDeleteConfirmVisibility());
|
|
1817
|
+
};
|
|
1818
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.container, children: [
|
|
1819
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "titleMedium", style: styles7.title, children: t("common:eventLogs") }),
|
|
1820
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1821
|
+
list.LegendList,
|
|
1822
|
+
{
|
|
1823
|
+
data: files,
|
|
1824
|
+
renderItem: ({ item }) => {
|
|
1825
|
+
const title = item.uri.split("/").pop();
|
|
1826
|
+
const updatedAt = "modificationTime" in item ? new Date(item.modificationTime ?? 0) : /* @__PURE__ */ new Date();
|
|
1827
|
+
const formattedUpdatedAt = dateFns.format(updatedAt, "yyyy-MM-dd HH:mm:ss");
|
|
1828
|
+
const size = "size" in item ? filesize.filesize(item.size ?? 0) : "";
|
|
1829
|
+
const description = `${formattedUpdatedAt} [ ${size} ]`;
|
|
1830
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1831
|
+
reactNativePaper.List.Item,
|
|
1832
|
+
{
|
|
1833
|
+
title,
|
|
1834
|
+
description,
|
|
1835
|
+
left: (props) => /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.List.Icon, { ...props, icon: (props2) => /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Icon, { source: "file-document", ...props2 }) }),
|
|
1836
|
+
right: () => /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.IconButton, { iconColor: theme.colors.primary, icon: "share", onPress: () => shareTextFile(item.uri) })
|
|
1837
|
+
}
|
|
1838
|
+
);
|
|
1839
|
+
},
|
|
1840
|
+
estimatedItemSize: 30
|
|
1841
|
+
}
|
|
1842
|
+
),
|
|
1843
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.actions, children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "outlined", icon: "delete", onPress: () => toggleDeleteConfirmVisibility(), children: t("common:delete") }) }),
|
|
1844
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1845
|
+
DialogOkCancel,
|
|
1846
|
+
{
|
|
1847
|
+
icon: "alert",
|
|
1848
|
+
title: t("common:confirm"),
|
|
1849
|
+
description: t("common:deleteAllLogsFilesConfirmation"),
|
|
1850
|
+
isVisible: isDeleteDialogVisible,
|
|
1851
|
+
onOk: onDeleteConfirmed,
|
|
1852
|
+
onCancel: toggleDeleteConfirmVisibility
|
|
1853
|
+
}
|
|
1854
|
+
)
|
|
1855
|
+
] });
|
|
1856
|
+
};
|
|
1857
|
+
var useStyles11 = () => {
|
|
1858
|
+
const theme = useAppTheme();
|
|
1859
|
+
return reactNative.StyleSheet.create({
|
|
1860
|
+
container: {
|
|
1861
|
+
flex: 1,
|
|
1862
|
+
padding: theme.spacing(2)
|
|
1863
|
+
},
|
|
1864
|
+
title: {
|
|
1865
|
+
marginBottom: theme.spacing(2)
|
|
1866
|
+
},
|
|
1867
|
+
fileItem: {
|
|
1868
|
+
padding: theme.spacing(2),
|
|
1869
|
+
borderBottomWidth: 1,
|
|
1870
|
+
borderBottomColor: theme.colors.outline
|
|
1871
|
+
},
|
|
1872
|
+
actions: {
|
|
1873
|
+
flexDirection: "row",
|
|
1874
|
+
justifyContent: "center",
|
|
1875
|
+
gap: theme.spacing(2)
|
|
1876
|
+
},
|
|
1877
|
+
sharePressed: {
|
|
1878
|
+
opacity: 0.5
|
|
1879
|
+
}
|
|
1880
|
+
});
|
|
1881
|
+
};
|
|
1882
|
+
var LogEntryItemSuffix = ({ filterText, onPress }) => {
|
|
1883
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.TextInput.Icon, { icon: filterText ? "close" : "magnify", onPress });
|
|
1884
|
+
};
|
|
1885
|
+
|
|
1886
|
+
// src/logger/use-log-entry-color.ts
|
|
1887
|
+
var LOG_COLORS_DARK_MODE = /* @__PURE__ */ new Map([
|
|
1888
|
+
[LOG_LEVELS.debug, "#9e9e9e"],
|
|
1889
|
+
[LOG_LEVELS.log, "#e0e0e0"],
|
|
1890
|
+
[LOG_LEVELS.info, "#64b5f6"],
|
|
1891
|
+
[LOG_LEVELS.warn, "#ffb74d"],
|
|
1892
|
+
[LOG_LEVELS.error, "#ef5350"]
|
|
1893
|
+
]);
|
|
1894
|
+
var LOG_COLORS_LIGHT_MODE = /* @__PURE__ */ new Map([
|
|
1895
|
+
[LOG_LEVELS.debug, "#757575"],
|
|
1896
|
+
[LOG_LEVELS.log, "#424242"],
|
|
1897
|
+
[LOG_LEVELS.info, "#1976d2"],
|
|
1898
|
+
[LOG_LEVELS.warn, "#f57c00"],
|
|
1899
|
+
[LOG_LEVELS.error, "#d32f2f"]
|
|
1900
|
+
]);
|
|
1901
|
+
var useLogEntryColor = (severity) => {
|
|
1902
|
+
const isDarkMode = useIsDarkMode();
|
|
1903
|
+
const colors = isDarkMode ? LOG_COLORS_DARK_MODE : LOG_COLORS_LIGHT_MODE;
|
|
1904
|
+
return colors.get(severity) ?? "orange";
|
|
1905
|
+
};
|
|
1906
|
+
|
|
1907
|
+
// src/components/event-logs/live-logs-viewer/logs-viewer.utils.ts
|
|
1908
|
+
var formatLogMessage = (msg) => {
|
|
1909
|
+
return msg.substring(11);
|
|
1910
|
+
};
|
|
1911
|
+
var LogEntryItem = ({ logEntry }) => {
|
|
1912
|
+
const styles7 = useStyles12();
|
|
1913
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
1914
|
+
const { t } = reactI18next.useTranslation();
|
|
1915
|
+
const color = useLogEntryColor(logEntry.level.severity);
|
|
1916
|
+
const handleLongPress = async (text) => {
|
|
1917
|
+
await setClipboardTextContent(text);
|
|
1918
|
+
showSnackbarMessage(t("common:copiedToClipboard"));
|
|
1919
|
+
};
|
|
1920
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles7.logEntry, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onLongPress: () => handleLongPress(logEntry.msg), children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { style: [styles7.logText, { color }], children: formatLogMessage(logEntry.msg) }) }) });
|
|
1921
|
+
};
|
|
1922
|
+
var useStyles12 = () => {
|
|
1923
|
+
const theme = useAppTheme();
|
|
1924
|
+
return reactNative.StyleSheet.create({
|
|
1925
|
+
logEntry: {
|
|
1926
|
+
paddingHorizontal: theme.spacing(0.5)
|
|
1927
|
+
},
|
|
1928
|
+
logText: {
|
|
1929
|
+
fontFamily: reactNative.Platform.select({
|
|
1930
|
+
ios: "Menlo",
|
|
1931
|
+
default: "monospace"
|
|
1932
|
+
})
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
};
|
|
1936
|
+
var useAutoScroll = (shouldAutoScroll = false) => {
|
|
1937
|
+
const listRef = react.useRef(null);
|
|
1938
|
+
const [isAutoScrollEnabled, toggleAutoScroll] = usehooks.useToggle(shouldAutoScroll);
|
|
1939
|
+
const scrollToBottom = (items) => {
|
|
1940
|
+
if (!isAutoScrollEnabled || !listRef.current || !items.length) {
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
const lastItemIndex = items.length - 1;
|
|
1944
|
+
listRef.current.scrollToIndex({ index: lastItemIndex, animated: false, viewPosition: 1 });
|
|
1945
|
+
};
|
|
1946
|
+
return {
|
|
1947
|
+
listRef,
|
|
1948
|
+
scrollToBottom,
|
|
1949
|
+
isAutoScrollEnabled,
|
|
1950
|
+
toggleAutoScroll
|
|
1951
|
+
};
|
|
1952
|
+
};
|
|
1953
|
+
var useLogsActions = () => {
|
|
1954
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
1955
|
+
const { t } = reactI18next.useTranslation();
|
|
1956
|
+
const [filterText, setFilterText] = react.useState("");
|
|
1957
|
+
const debouncedFilterText = usehooks.useDebounce(filterText, 300);
|
|
1958
|
+
const filteredLogs = commonLogsStore.filterLogs(debouncedFilterText);
|
|
1959
|
+
const handleCopyAllLogs = async () => {
|
|
1960
|
+
await setClipboardTextContent(commonLogsStore.allLogsAsText);
|
|
1961
|
+
showSnackbarMessage(t("common:copiedToClipboard"));
|
|
1962
|
+
};
|
|
1963
|
+
return {
|
|
1964
|
+
filterText,
|
|
1965
|
+
setFilterText,
|
|
1966
|
+
filteredLogs,
|
|
1967
|
+
handleCopyAllLogs
|
|
1968
|
+
};
|
|
1969
|
+
};
|
|
1970
|
+
var LogsViewer = mobxReactLite.observer(
|
|
1971
|
+
({ shouldDisplayToolbar = true, shouldAutoScroll = false }) => {
|
|
1972
|
+
const styles7 = useStyles13();
|
|
1973
|
+
const { t } = reactI18next.useTranslation();
|
|
1974
|
+
const { filterText, setFilterText, filteredLogs, handleCopyAllLogs } = useLogsActions();
|
|
1975
|
+
const { listRef, scrollToBottom, toggleAutoScroll, isAutoScrollEnabled } = useAutoScroll(shouldAutoScroll);
|
|
1976
|
+
react.useEffect(() => scrollToBottom(filteredLogs), [filteredLogs, scrollToBottom]);
|
|
1977
|
+
react.useEffect(() => reactNative.LogBox.ignoreAllLogs(), []);
|
|
1978
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.container, children: [
|
|
1979
|
+
shouldDisplayToolbar && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.actionsBar, children: [
|
|
1980
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1981
|
+
reactNativePaper.TextInput,
|
|
1982
|
+
{
|
|
1983
|
+
mode: reactNative.Platform.OS === "windows" ? "flat" : "outlined",
|
|
1984
|
+
autoCapitalize: "none",
|
|
1985
|
+
value: filterText,
|
|
1986
|
+
onChangeText: setFilterText,
|
|
1987
|
+
placeholder: t("common:logs.filter"),
|
|
1988
|
+
style: styles7.filterInput,
|
|
1989
|
+
right: reactNative.Platform.OS === "windows" ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(LogEntryItemSuffix, { filterText, onPress: () => setFilterText("") })
|
|
1990
|
+
}
|
|
1991
|
+
),
|
|
1992
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1993
|
+
reactNativePaper.IconButton,
|
|
1994
|
+
{
|
|
1995
|
+
icon: isAutoScrollEnabled ? "arrow-down-bold" : "arrow-down-bold-outline",
|
|
1996
|
+
mode: "contained",
|
|
1997
|
+
onPress: () => toggleAutoScroll(),
|
|
1998
|
+
style: styles7.button,
|
|
1999
|
+
accessibilityLabel: t("common:toggleAutoScroll")
|
|
2000
|
+
}
|
|
2001
|
+
),
|
|
2002
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2003
|
+
reactNativePaper.IconButton,
|
|
2004
|
+
{
|
|
2005
|
+
icon: "delete",
|
|
2006
|
+
mode: "contained",
|
|
2007
|
+
onPress: () => commonLogsStore.clearLogs(),
|
|
2008
|
+
style: styles7.button,
|
|
2009
|
+
accessibilityLabel: t("common:logs.clear")
|
|
2010
|
+
}
|
|
2011
|
+
),
|
|
2012
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2013
|
+
reactNativePaper.IconButton,
|
|
2014
|
+
{
|
|
2015
|
+
icon: "content-copy",
|
|
2016
|
+
mode: "contained",
|
|
2017
|
+
onPress: handleCopyAllLogs,
|
|
2018
|
+
style: styles7.button,
|
|
2019
|
+
accessibilityLabel: t("common:logs.copyAll")
|
|
2020
|
+
}
|
|
2021
|
+
)
|
|
2022
|
+
] }),
|
|
2023
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2024
|
+
list.LegendList,
|
|
2025
|
+
{
|
|
2026
|
+
ref: listRef,
|
|
2027
|
+
data: filteredLogs,
|
|
2028
|
+
renderItem: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(LogEntryItem, { logEntry: item }),
|
|
2029
|
+
estimatedItemSize: 30,
|
|
2030
|
+
keyExtractor: (logEntry, index) => `${logEntry.msg.substring(0, 20)}_${index}`
|
|
2031
|
+
}
|
|
2032
|
+
)
|
|
2033
|
+
] });
|
|
2034
|
+
}
|
|
2035
|
+
);
|
|
2036
|
+
var useStyles13 = () => {
|
|
2037
|
+
const theme = useAppTheme();
|
|
2038
|
+
return reactNative.StyleSheet.create({
|
|
2039
|
+
container: {
|
|
2040
|
+
flex: 1
|
|
2041
|
+
},
|
|
2042
|
+
actionsBar: {
|
|
2043
|
+
flexDirection: "row",
|
|
2044
|
+
padding: theme.spacing(0.5),
|
|
2045
|
+
marginBottom: theme.spacing(0.5),
|
|
2046
|
+
alignItems: "center"
|
|
2047
|
+
},
|
|
2048
|
+
filterInput: {
|
|
2049
|
+
flex: 1,
|
|
2050
|
+
height: 40
|
|
2051
|
+
},
|
|
2052
|
+
button: {
|
|
2053
|
+
marginVertical: 0
|
|
2054
|
+
}
|
|
2055
|
+
});
|
|
2056
|
+
};
|
|
2057
|
+
var HeaderButton = ({ iconName, onPress }) => {
|
|
2058
|
+
const styles7 = useStyles14();
|
|
2059
|
+
const theme = useAppTheme();
|
|
2060
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.IconButton, { icon: iconName, size: 25, iconColor: theme.colors.primary, style: styles7.iconStyle, onPress });
|
|
2061
|
+
};
|
|
2062
|
+
var useStyles14 = () => {
|
|
2063
|
+
const theme = useAppTheme();
|
|
2064
|
+
return reactNative.StyleSheet.create({
|
|
2065
|
+
iconStyle: {
|
|
2066
|
+
marginHorizontal: theme.spacing(2)
|
|
2067
|
+
}
|
|
2068
|
+
});
|
|
2069
|
+
};
|
|
2070
|
+
var HeaderBackButton = () => /* @__PURE__ */ jsxRuntime.jsx(HeaderButton, { iconName: "arrow-left", onPress: () => expoRouter.router.back() });
|
|
2071
|
+
var LanguageSelectorMenu = ({
|
|
2072
|
+
onLanguageChange,
|
|
2073
|
+
label,
|
|
2074
|
+
currentLanguage,
|
|
2075
|
+
supportedLanguages
|
|
2076
|
+
}) => {
|
|
2077
|
+
const [isMenuVisible, toggleMenu] = usehooks.useToggle(false);
|
|
2078
|
+
const actionLabel = `${label} (${currentLanguage})`;
|
|
2079
|
+
const onLanguageSelected = (newCode) => {
|
|
2080
|
+
onLanguageChange(newCode);
|
|
2081
|
+
toggleMenu(false);
|
|
2082
|
+
};
|
|
2083
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2084
|
+
reactNativePaper.Menu,
|
|
2085
|
+
{
|
|
2086
|
+
visible: isMenuVisible,
|
|
2087
|
+
onDismiss: () => toggleMenu(false),
|
|
2088
|
+
anchorPosition: "bottom",
|
|
2089
|
+
anchor: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { mode: "outlined", onPress: () => toggleMenu(true), icon: "translate", children: actionLabel }),
|
|
2090
|
+
children: supportedLanguages.map(({ code, selectionLabel }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2091
|
+
reactNativePaper.Menu.Item,
|
|
2092
|
+
{
|
|
2093
|
+
title: `${selectionLabel} (${code})`,
|
|
2094
|
+
trailingIcon: code === currentLanguage ? "check" : void 0,
|
|
2095
|
+
onPress: () => onLanguageSelected(code)
|
|
2096
|
+
},
|
|
2097
|
+
code
|
|
2098
|
+
))
|
|
2099
|
+
},
|
|
2100
|
+
String(isMenuVisible)
|
|
2101
|
+
);
|
|
2102
|
+
};
|
|
2103
|
+
var LanguageSelectorSegmented = ({
|
|
2104
|
+
onLanguageChange,
|
|
2105
|
+
currentLanguage,
|
|
2106
|
+
supportedLanguages
|
|
2107
|
+
}) => {
|
|
2108
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2109
|
+
reactNativePaper.SegmentedButtons,
|
|
2110
|
+
{
|
|
2111
|
+
value: currentLanguage,
|
|
2112
|
+
onValueChange: onLanguageChange,
|
|
2113
|
+
style: { minWidth: supportedLanguages.length * 100 },
|
|
2114
|
+
buttons: supportedLanguages.map(({ code, selectionLabel }) => ({
|
|
2115
|
+
value: code,
|
|
2116
|
+
label: selectionLabel
|
|
2117
|
+
}))
|
|
2118
|
+
}
|
|
2119
|
+
);
|
|
2120
|
+
};
|
|
2121
|
+
var LanguageSelector = ({
|
|
2122
|
+
onLanguageChange,
|
|
2123
|
+
label,
|
|
2124
|
+
currentLanguage,
|
|
2125
|
+
supportedLanguages,
|
|
2126
|
+
placeholder,
|
|
2127
|
+
searchPlaceholder
|
|
2128
|
+
}) => {
|
|
2129
|
+
const options2 = supportedLanguages.map((lang) => ({
|
|
2130
|
+
label: lang.selectionLabel,
|
|
2131
|
+
value: lang.code
|
|
2132
|
+
}));
|
|
2133
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2134
|
+
DropDownSelector,
|
|
2135
|
+
{
|
|
2136
|
+
label,
|
|
2137
|
+
value: currentLanguage,
|
|
2138
|
+
onChange: onLanguageChange,
|
|
2139
|
+
options: options2,
|
|
2140
|
+
placeholder,
|
|
2141
|
+
searchPlaceholder
|
|
2142
|
+
}
|
|
2143
|
+
);
|
|
2144
|
+
};
|
|
2145
|
+
var FullCentered = ({ children, style }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [style, { flex: 1, justifyContent: "center", alignItems: "center" }], children });
|
|
2146
|
+
var useWindowOrientation = () => {
|
|
2147
|
+
const { width, height } = reactNative.useWindowDimensions();
|
|
2148
|
+
return width > height ? "landscape" : "portrait";
|
|
2149
|
+
};
|
|
2150
|
+
var useIsLandscape = () => {
|
|
2151
|
+
const orientation = useWindowOrientation();
|
|
2152
|
+
return orientation === "landscape";
|
|
2153
|
+
};
|
|
2154
|
+
var TabBarIcon = ({ name, color, size = 28 }) => {
|
|
2155
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Icon, { source: name, size, color });
|
|
2156
|
+
};
|
|
2157
|
+
var styles2 = reactNative.StyleSheet.create({
|
|
2158
|
+
tabBarIcon: {
|
|
2159
|
+
marginBottom: 0
|
|
2160
|
+
}
|
|
2161
|
+
});
|
|
2162
|
+
var OrientationAwareTabButton = ({
|
|
2163
|
+
icon,
|
|
2164
|
+
title,
|
|
2165
|
+
activeColor,
|
|
2166
|
+
isFocused,
|
|
2167
|
+
isLabelHidden = false,
|
|
2168
|
+
...props
|
|
2169
|
+
}) => {
|
|
2170
|
+
const theme = useAppTheme();
|
|
2171
|
+
const styles7 = useStyles15();
|
|
2172
|
+
const isLabelVisible = !isLabelHidden;
|
|
2173
|
+
const color = isFocused ? activeColor : theme.colors.onSurfaceDisabled;
|
|
2174
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { ...props, style: [styles7.tabButton], children: [
|
|
2175
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabBarIcon, { name: icon, color }),
|
|
2176
|
+
isLabelVisible && /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", style: { color }, children: title })
|
|
2177
|
+
] });
|
|
2178
|
+
};
|
|
2179
|
+
var useStyles15 = () => {
|
|
2180
|
+
const theme = useAppTheme();
|
|
2181
|
+
const isLandscape = useIsLandscape();
|
|
2182
|
+
const padding = theme.spacing(0.5);
|
|
2183
|
+
return reactNative.StyleSheet.create({
|
|
2184
|
+
tabButton: {
|
|
2185
|
+
flex: 1,
|
|
2186
|
+
alignItems: "center",
|
|
2187
|
+
justifyContent: "center",
|
|
2188
|
+
paddingLeft: isLandscape ? padding : 0,
|
|
2189
|
+
paddingTop: isLandscape ? 0 : padding
|
|
2190
|
+
}
|
|
2191
|
+
});
|
|
2192
|
+
};
|
|
2193
|
+
var OrientationAwareTabsLayout = ({
|
|
2194
|
+
tabs,
|
|
2195
|
+
activeColor,
|
|
2196
|
+
containerStyle,
|
|
2197
|
+
tabListStyle
|
|
2198
|
+
}) => {
|
|
2199
|
+
const theme = useAppTheme();
|
|
2200
|
+
const styles7 = useStyles16();
|
|
2201
|
+
const isLandscape = useIsLandscape();
|
|
2202
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { style: [styles7.tabsContainer, containerStyle], children: [
|
|
2203
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TabSlot, { style: styles7.tabSlot }),
|
|
2204
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TabList, { style: [styles7.tabList, tabListStyle], children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(ui.TabTrigger, { name: tab.name, href: tab.href, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2205
|
+
OrientationAwareTabButton,
|
|
2206
|
+
{
|
|
2207
|
+
isLabelHidden: isLandscape,
|
|
2208
|
+
icon: tab.icon,
|
|
2209
|
+
title: tab.title,
|
|
2210
|
+
activeColor: activeColor ?? theme.colors.primary
|
|
2211
|
+
}
|
|
2212
|
+
) }, tab.name)) })
|
|
2213
|
+
] });
|
|
2214
|
+
};
|
|
2215
|
+
var useStyles16 = () => {
|
|
2216
|
+
const theme = useAppTheme();
|
|
2217
|
+
const { bottom, right } = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
2218
|
+
const minPadding = theme.spacing(0.5);
|
|
2219
|
+
const isLandscape = useIsLandscape();
|
|
2220
|
+
return reactNative.StyleSheet.create({
|
|
2221
|
+
tabsContainer: {
|
|
2222
|
+
flex: 1,
|
|
2223
|
+
flexDirection: isLandscape ? "row" : "column"
|
|
2224
|
+
},
|
|
2225
|
+
tabSlot: {
|
|
2226
|
+
flex: 1
|
|
2227
|
+
},
|
|
2228
|
+
tabList: {
|
|
2229
|
+
backgroundColor: theme.colors.elevation.level1,
|
|
2230
|
+
justifyContent: "space-around",
|
|
2231
|
+
flexDirection: isLandscape ? "column" : "row",
|
|
2232
|
+
paddingBottom: isLandscape ? minPadding : bottom,
|
|
2233
|
+
paddingRight: isLandscape ? right : minPadding,
|
|
2234
|
+
borderTopWidth: isLandscape ? void 0 : reactNative.StyleSheet.hairlineWidth,
|
|
2235
|
+
borderTopColor: isLandscape ? void 0 : theme.colors.outline,
|
|
2236
|
+
borderLeftWidth: isLandscape ? reactNative.StyleSheet.hairlineWidth : void 0,
|
|
2237
|
+
borderLeftColor: isLandscape ? theme.colors.outline : void 0
|
|
2238
|
+
}
|
|
2239
|
+
});
|
|
2240
|
+
};
|
|
2241
|
+
var askConfirmation = async (question) => new Promise((resolve) => {
|
|
2242
|
+
reactNative.Alert.alert("Confirmation", question, [
|
|
2243
|
+
{
|
|
2244
|
+
text: "Cancel",
|
|
2245
|
+
onPress: () => resolve(false),
|
|
2246
|
+
style: "cancel"
|
|
2247
|
+
},
|
|
2248
|
+
{ text: "OK", onPress: () => resolve(true) }
|
|
2249
|
+
]);
|
|
2250
|
+
});
|
|
2251
|
+
|
|
2252
|
+
// src/logger/logger.utils.ts
|
|
2253
|
+
var X_REQUEST_START_TIME = "x-request-start-time";
|
|
2254
|
+
var toLogLevel = (type) => {
|
|
2255
|
+
const logLevelKey = type.toLowerCase();
|
|
2256
|
+
return {
|
|
2257
|
+
text: type.toUpperCase(),
|
|
2258
|
+
severity: LOG_LEVELS[logLevelKey]
|
|
2259
|
+
};
|
|
2260
|
+
};
|
|
2261
|
+
var logRequestStart = (request) => {
|
|
2262
|
+
request.headers.set(X_REQUEST_START_TIME, Date.now().toString());
|
|
2263
|
+
return request;
|
|
2264
|
+
};
|
|
2265
|
+
var sanitizeUrl = (url) => {
|
|
2266
|
+
if (!url) return url;
|
|
2267
|
+
const regExp = /http:\/\/(.*):(.*)@(.*)/;
|
|
2268
|
+
const isMatching = url.match(regExp);
|
|
2269
|
+
return isMatching ? `http://${isMatching[3]}` : url;
|
|
2270
|
+
};
|
|
2271
|
+
var logRequestEnd = (response) => {
|
|
2272
|
+
const { status, config } = response;
|
|
2273
|
+
const { method, baseURL, url } = config;
|
|
2274
|
+
const startTime = Number(config.headers.get(X_REQUEST_START_TIME) ?? 0);
|
|
2275
|
+
const duration = startTime ? `(${Date.now() - startTime}ms)` : "";
|
|
2276
|
+
const { verb, fullUrl } = buildRequestLogInfos({ baseURL, url, method });
|
|
2277
|
+
const sanitizedUrl = sanitizeUrl(fullUrl);
|
|
2278
|
+
logger.info(`\u27A1\uFE0F Axios ${verb} ${sanitizedUrl} http ${status} ${duration}.`);
|
|
2279
|
+
return response;
|
|
2280
|
+
};
|
|
2281
|
+
var buildRequestLogInfos = ({ baseURL, url, method }) => {
|
|
2282
|
+
const fullUrl = `${baseURL ?? ""}${url ?? ""}`;
|
|
2283
|
+
const verb = method?.toUpperCase() ?? "";
|
|
2284
|
+
return { verb, fullUrl };
|
|
2285
|
+
};
|
|
2286
|
+
|
|
2287
|
+
// src/utils/axios.config.ts
|
|
2288
|
+
var axiosInstance = axios__default.default.create({
|
|
2289
|
+
timeout: 10 * tsCommon.PeriodsInMS.oneSecond,
|
|
2290
|
+
headers: {
|
|
2291
|
+
"Content-Type": "application/json",
|
|
2292
|
+
"User-Agent": `native module ${getAppIdentifier()} - ${getDeviceType()}`
|
|
2293
|
+
}
|
|
2294
|
+
});
|
|
2295
|
+
axiosInstance.interceptors.request.use(logRequestStart);
|
|
2296
|
+
axiosInstance.interceptors.response.use(logRequestEnd);
|
|
2297
|
+
var axios_config_default = axiosInstance;
|
|
2298
|
+
var base64Encode = (text) => {
|
|
2299
|
+
return buffer.Buffer.from(text).toString("base64");
|
|
2300
|
+
};
|
|
2301
|
+
var base64Decode = (base64) => {
|
|
2302
|
+
return buffer.Buffer.from(base64, "base64").toString("utf-8");
|
|
2303
|
+
};
|
|
2304
|
+
|
|
2305
|
+
// src/utils/date.utils.ts
|
|
2306
|
+
var dateToISOLikeButLocal = (date) => {
|
|
2307
|
+
const offsetMs = date.getTimezoneOffset() * 60 * 1e3;
|
|
2308
|
+
const msLocal = date.getTime() - offsetMs;
|
|
2309
|
+
const dateLocal = new Date(msLocal);
|
|
2310
|
+
const iso = dateLocal.toISOString();
|
|
2311
|
+
const isoLocal = iso.slice(0, 19);
|
|
2312
|
+
return isoLocal;
|
|
2313
|
+
};
|
|
2314
|
+
var nowToISOLikeButLocal = () => dateToISOLikeButLocal(/* @__PURE__ */ new Date());
|
|
2315
|
+
var nowToISOLikeButLocalForFilename = () => {
|
|
2316
|
+
const isoLocal = nowToISOLikeButLocal();
|
|
2317
|
+
const isoLocalForFilename = isoLocal.replace(/:/g, "-");
|
|
2318
|
+
return isoLocalForFilename;
|
|
2319
|
+
};
|
|
2320
|
+
var DigestAuth = class {
|
|
2321
|
+
constructor({ username, password, shouldEmit2ndRequest = true }) {
|
|
2322
|
+
this.nonce = null;
|
|
2323
|
+
this.realm = null;
|
|
2324
|
+
this.qop = null;
|
|
2325
|
+
this.opaque = null;
|
|
2326
|
+
this.algorithm = null;
|
|
2327
|
+
this.nc = 0;
|
|
2328
|
+
this.shouldEmit2ndRequest = true;
|
|
2329
|
+
this.username = username;
|
|
2330
|
+
this.password = password;
|
|
2331
|
+
this.shouldEmit2ndRequest = shouldEmit2ndRequest;
|
|
2332
|
+
}
|
|
2333
|
+
md5(str) {
|
|
2334
|
+
return utils_js.bytesToHex(legacy_js.md5(utils_js.utf8ToBytes(str)));
|
|
2335
|
+
}
|
|
2336
|
+
getRandomBytes(length) {
|
|
2337
|
+
const isOK = validateGetRandomValues();
|
|
2338
|
+
if (isOK) {
|
|
2339
|
+
return crypto.getRandomValues(new Uint8Array(length));
|
|
2340
|
+
} else {
|
|
2341
|
+
throw new Error("[DigestAuth] crypto.getRandomValues is not available");
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
generateCNonce() {
|
|
2345
|
+
const randomBytes = this.getRandomBytes(8);
|
|
2346
|
+
return utils_js.bytesToHex(randomBytes);
|
|
2347
|
+
}
|
|
2348
|
+
parseAuthHeader(header) {
|
|
2349
|
+
const parts = header.match(/(\w+)=("[^"]+"|[^,]+)/g);
|
|
2350
|
+
if (!parts) return;
|
|
2351
|
+
parts.forEach((part) => {
|
|
2352
|
+
const [key, value] = part.split("=");
|
|
2353
|
+
const cleanValue = value.replace(/^"|"$/g, "");
|
|
2354
|
+
switch (key.trim()) {
|
|
2355
|
+
case "nonce":
|
|
2356
|
+
if (this.nonce !== cleanValue) {
|
|
2357
|
+
this.nonce = cleanValue;
|
|
2358
|
+
this.nc = 0;
|
|
2359
|
+
}
|
|
2360
|
+
break;
|
|
2361
|
+
case "realm":
|
|
2362
|
+
this.realm = cleanValue;
|
|
2363
|
+
break;
|
|
2364
|
+
case "qop":
|
|
2365
|
+
this.qop = cleanValue;
|
|
2366
|
+
break;
|
|
2367
|
+
case "opaque":
|
|
2368
|
+
this.opaque = cleanValue;
|
|
2369
|
+
break;
|
|
2370
|
+
case "algorithm":
|
|
2371
|
+
this.algorithm = cleanValue;
|
|
2372
|
+
break;
|
|
2373
|
+
case "stale":
|
|
2374
|
+
if (cleanValue === "true") {
|
|
2375
|
+
this.nonce = null;
|
|
2376
|
+
this.nc = 0;
|
|
2377
|
+
}
|
|
2378
|
+
break;
|
|
2379
|
+
}
|
|
2380
|
+
});
|
|
2381
|
+
if (!this.nonce || !this.realm) {
|
|
2382
|
+
throw new Error("Failed to parse authentication headers");
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
extractPathAndQuery(url) {
|
|
2386
|
+
try {
|
|
2387
|
+
const parsed = new URL(url);
|
|
2388
|
+
return parsed.pathname + parsed.search;
|
|
2389
|
+
} catch {
|
|
2390
|
+
return url;
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
generateAuthHeader(config) {
|
|
2394
|
+
if (!this.nonce || !this.realm) {
|
|
2395
|
+
throw new Error("Missing nonce or realm");
|
|
2396
|
+
}
|
|
2397
|
+
const method = config.method?.toUpperCase() || "GET";
|
|
2398
|
+
const uri = this.extractPathAndQuery(config.url || "");
|
|
2399
|
+
const cnonce = this.generateCNonce();
|
|
2400
|
+
const ncHex = (++this.nc).toString(16).padStart(8, "0");
|
|
2401
|
+
const qop = this.qop || "auth";
|
|
2402
|
+
const ha1 = this.md5(`${this.username}:${this.realm}:${this.password}`);
|
|
2403
|
+
const ha2 = this.md5(`${method}:${uri}`);
|
|
2404
|
+
const response = this.md5(`${ha1}:${this.nonce}:${ncHex}:${cnonce}:${qop}:${ha2}`);
|
|
2405
|
+
return `Digest username="${this.username}", realm="${this.realm}", nonce="${this.nonce}", uri="${uri}", algorithm=${this.algorithm || "MD5"}, response="${response}", qop=${qop}, nc=${ncHex}, cnonce="${cnonce}"${this.opaque ? `, opaque="${this.opaque}"` : ""}`;
|
|
2406
|
+
}
|
|
2407
|
+
async request(config) {
|
|
2408
|
+
try {
|
|
2409
|
+
const method = config.method?.toUpperCase() ?? "GET";
|
|
2410
|
+
logger.debug(`[DigestAuth] ${method}: ${sanitizeUrl(config.url)}`);
|
|
2411
|
+
const response = await axios_config_default(config);
|
|
2412
|
+
logger.debug(`[DigestAuth] response status: ${response.status}`);
|
|
2413
|
+
return response;
|
|
2414
|
+
} catch (e) {
|
|
2415
|
+
this.handleNoResponseError(e);
|
|
2416
|
+
const { authHeader, isDigestChallenge } = this.parseHttpErrorHeaders(e);
|
|
2417
|
+
if (!isDigestChallenge) {
|
|
2418
|
+
const err = e;
|
|
2419
|
+
logger.info(`[DigestAuth] error received. Axios error code: "${err.code}" status: "${err.response?.status}"`);
|
|
2420
|
+
throw e;
|
|
2421
|
+
}
|
|
2422
|
+
logger.debug("[DigestAuth] Received Unauthorized with Digest header challenge.");
|
|
2423
|
+
this.parseAuthHeader(authHeader);
|
|
2424
|
+
const authHeaderValue = this.generateAuthHeader(config);
|
|
2425
|
+
if (this.shouldEmit2ndRequest) {
|
|
2426
|
+
return this.replyToDigestChallenge({ config, authHeaderValue });
|
|
2427
|
+
} else {
|
|
2428
|
+
return authHeaderValue;
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
handleNoResponseError(e) {
|
|
2433
|
+
if (typeof e !== "object" || e === null) return;
|
|
2434
|
+
if (!("code" in e) || !("response" in e)) return;
|
|
2435
|
+
const hasReceivedResponse = e.response !== void 0;
|
|
2436
|
+
if (!hasReceivedResponse) {
|
|
2437
|
+
logger.info(`[DigestAuth] no response. Axios error code: "${e.code}"`);
|
|
2438
|
+
throw e;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- error object shape from axios is not typed
|
|
2442
|
+
parseHttpErrorHeaders(e) {
|
|
2443
|
+
const isUnauthorized = e.response?.status === 401;
|
|
2444
|
+
const authHeader = e.response?.headers?.["www-authenticate"];
|
|
2445
|
+
const hasDigestHeader = authHeader?.startsWith("Digest");
|
|
2446
|
+
const isDigestChallenge = isUnauthorized && hasDigestHeader;
|
|
2447
|
+
return { isUnauthorized, authHeader, hasDigestHeader, isDigestChallenge };
|
|
2448
|
+
}
|
|
2449
|
+
replyToDigestChallenge({ config, authHeaderValue }) {
|
|
2450
|
+
const newConfig = immer.produce(config, (draft) => {
|
|
2451
|
+
const originalHeaders = draft.headers ?? {};
|
|
2452
|
+
draft.headers = {
|
|
2453
|
+
...originalHeaders,
|
|
2454
|
+
Authorization: authHeaderValue
|
|
2455
|
+
};
|
|
2456
|
+
});
|
|
2457
|
+
logger.debug(`[DigestAuth] emitting 2nd request with new config for url: ${sanitizeUrl(config.url)}`);
|
|
2458
|
+
return axios_config_default(newConfig);
|
|
2459
|
+
}
|
|
2460
|
+
};
|
|
2461
|
+
var loggedError = ({ context, e }) => {
|
|
2462
|
+
const errorMessage = tsCommon.getErrorMessage(e);
|
|
2463
|
+
const errorMessageDetails = `${context}: ${errorMessage}`;
|
|
2464
|
+
logger.error(errorMessageDetails, e);
|
|
2465
|
+
return new Error(errorMessageDetails);
|
|
2466
|
+
};
|
|
2467
|
+
var DEFAULT_FILE_PICKER_OPTIONS = { type: ["*/*"], copyToCacheDirectory: true };
|
|
2468
|
+
var pickSingleFile = async (options2 = DEFAULT_FILE_PICKER_OPTIONS) => {
|
|
2469
|
+
try {
|
|
2470
|
+
const result = await DocumentPicker__namespace.getDocumentAsync(options2);
|
|
2471
|
+
if (result.canceled) {
|
|
2472
|
+
return { exists: false, error: "canceled", name: "", uri: "", size: 0, mimeType: "", lastModified: 0 };
|
|
2473
|
+
}
|
|
2474
|
+
const singleAsset = result.assets[0];
|
|
2475
|
+
return {
|
|
2476
|
+
exists: singleAsset.uri && singleAsset.name,
|
|
2477
|
+
...singleAsset
|
|
2478
|
+
};
|
|
2479
|
+
} catch (error) {
|
|
2480
|
+
logger.error("pickSingleFile", error);
|
|
2481
|
+
return { error, exists: false };
|
|
2482
|
+
}
|
|
2483
|
+
};
|
|
2484
|
+
var hasFileSeparator = (fileUri = "") => {
|
|
2485
|
+
return fileUri?.includes("/") ?? false;
|
|
2486
|
+
};
|
|
2487
|
+
var getFilenameOnly = (fileUri = "/") => {
|
|
2488
|
+
if (hasFileSeparator(fileUri)) {
|
|
2489
|
+
return fileUri.split("/").pop() ?? "";
|
|
2490
|
+
} else {
|
|
2491
|
+
return fileUri;
|
|
2492
|
+
}
|
|
2493
|
+
};
|
|
2494
|
+
var hasExtension = (fileUri = "/") => {
|
|
2495
|
+
const filename = getFilenameOnly(fileUri);
|
|
2496
|
+
return filename.includes(".");
|
|
2497
|
+
};
|
|
2498
|
+
var getFilenameWithoutExtension = (fileUri = "/") => {
|
|
2499
|
+
const filename = getFilenameOnly(fileUri);
|
|
2500
|
+
if (hasExtension(fileUri)) {
|
|
2501
|
+
return filename.split(".").slice(0, -1).join(".");
|
|
2502
|
+
} else {
|
|
2503
|
+
return filename;
|
|
2504
|
+
}
|
|
2505
|
+
};
|
|
2506
|
+
var getFileExtensionOnly = (fileUri = "/") => {
|
|
2507
|
+
const filename = getFilenameOnly(fileUri);
|
|
2508
|
+
if (hasExtension(fileUri)) {
|
|
2509
|
+
return filename.split(".").pop()?.toLowerCase() ?? "";
|
|
2510
|
+
} else {
|
|
2511
|
+
return "";
|
|
2512
|
+
}
|
|
2513
|
+
};
|
|
2514
|
+
var getDirectoryOnly = (fileUri = "/") => fileUri.substring(0, fileUri.lastIndexOf("/"));
|
|
2515
|
+
Handlebars__default.default.registerHelper("timestampFormat", (timestamp, dateTimeFormatInput) => {
|
|
2516
|
+
const dateTimeFormat = Handlebars__default.default.escapeExpression(dateTimeFormatInput);
|
|
2517
|
+
const formattedDateTime = dateFnsTz.formatInTimeZone(timestamp, "UTC", dateTimeFormat);
|
|
2518
|
+
return new Handlebars__default.default.SafeString(formattedDateTime);
|
|
2519
|
+
});
|
|
2520
|
+
var toHandlebarsTemplate = (inputPattern) => {
|
|
2521
|
+
const cleanedInput = Handlebars__default.default.escapeExpression(inputPattern);
|
|
2522
|
+
const args = {};
|
|
2523
|
+
let argCounter = 1;
|
|
2524
|
+
const handlebarTemplate = cleanedInput.replace(/{{{(.*?)}}}/g, (_match, content) => {
|
|
2525
|
+
const argName = `arg${argCounter}`;
|
|
2526
|
+
args[argName] = content;
|
|
2527
|
+
argCounter++;
|
|
2528
|
+
return `{{timestampFormat timestamp ${argName}}}`;
|
|
2529
|
+
});
|
|
2530
|
+
return { handlebarTemplate, ...args };
|
|
2531
|
+
};
|
|
2532
|
+
var normalizeIsoInfo = (input) => {
|
|
2533
|
+
return input.replace(/[:\.]/g, "_");
|
|
2534
|
+
};
|
|
2535
|
+
var buildAdditionalContextData = (timestamp = /* @__PURE__ */ new Date()) => {
|
|
2536
|
+
const infos = {};
|
|
2537
|
+
const isoString = timestamp.toISOString();
|
|
2538
|
+
const isoDateStringParts = isoString.split("T");
|
|
2539
|
+
infos.isoString = normalizeIsoInfo(isoString);
|
|
2540
|
+
infos.isoDate = isoDateStringParts[0];
|
|
2541
|
+
infos.isoTime = normalizeIsoInfo(isoDateStringParts[1].split(".")[0]);
|
|
2542
|
+
infos.localDate = dateFns.format(timestamp, "yyyy-MM-dd");
|
|
2543
|
+
infos.localTime = dateFns.format(timestamp, "HH_mm_ss");
|
|
2544
|
+
infos.timezoneOffset = timestamp.getTimezoneOffset().toString();
|
|
2545
|
+
infos.uuid = uuid__default.default.v4();
|
|
2546
|
+
infos.unixTimestamp = timestamp.getTime().toString();
|
|
2547
|
+
return infos;
|
|
2548
|
+
};
|
|
2549
|
+
var applyFilenameTemplate = ({ filename, pattern, timestamp = /* @__PURE__ */ new Date() }) => {
|
|
2550
|
+
if (!pattern) {
|
|
2551
|
+
return filename;
|
|
2552
|
+
}
|
|
2553
|
+
const { handlebarTemplate, ...args } = toHandlebarsTemplate(pattern);
|
|
2554
|
+
const template = Handlebars__default.default.compile(handlebarTemplate);
|
|
2555
|
+
return template({
|
|
2556
|
+
...args,
|
|
2557
|
+
...buildAdditionalContextData(timestamp),
|
|
2558
|
+
timestamp,
|
|
2559
|
+
filename
|
|
2560
|
+
});
|
|
2561
|
+
};
|
|
2562
|
+
|
|
2563
|
+
// src/utils/image.utils.ts
|
|
2564
|
+
var convertImageToBase64 = async (uri) => {
|
|
2565
|
+
try {
|
|
2566
|
+
const base64String = await nativeFileSystem.readAsStringAsync(uri, {
|
|
2567
|
+
encoding: "base64" /* Base64 */
|
|
2568
|
+
});
|
|
2569
|
+
return base64String;
|
|
2570
|
+
} catch (error) {
|
|
2571
|
+
logger.error("Error converting image to base64:", error);
|
|
2572
|
+
return null;
|
|
2573
|
+
}
|
|
2574
|
+
};
|
|
2575
|
+
|
|
2576
|
+
// src/utils/licences.utils.ts
|
|
2577
|
+
var numberRegex = /\d+(\.\d+)*/;
|
|
2578
|
+
var atRegex = /(?:@)/gi;
|
|
2579
|
+
var parseLicenceData = (entries) => {
|
|
2580
|
+
const licences = [];
|
|
2581
|
+
for (const [id, licence] of Object.entries(entries)) {
|
|
2582
|
+
const version = id.match(numberRegex);
|
|
2583
|
+
const nameWithoutVersion = id.replace(atRegex, "").replace(version ? version[0] : "", "");
|
|
2584
|
+
licences.push({
|
|
2585
|
+
title: nameWithoutVersion,
|
|
2586
|
+
version: version ? version[0] : "",
|
|
2587
|
+
licenceType: licence.licenses,
|
|
2588
|
+
repository: licence.repository || "",
|
|
2589
|
+
licenseUrl: licence.licenseFile || ""
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
return licences;
|
|
2593
|
+
};
|
|
2594
|
+
var openWifiSettings = async () => {
|
|
2595
|
+
if (reactNative.Platform.OS === "ios") {
|
|
2596
|
+
return openWifiSettingsIos();
|
|
2597
|
+
}
|
|
2598
|
+
if (reactNative.Platform.OS === "android") {
|
|
2599
|
+
return openWifiSettingsAndroid();
|
|
2600
|
+
}
|
|
2601
|
+
logger.warn(`[openWifiSettings] is not supported on this platform: ${reactNative.Platform.OS}`);
|
|
2602
|
+
};
|
|
2603
|
+
var openWifiSettingsIos = async () => {
|
|
2604
|
+
const url = "App-Prefs:root=WIFI";
|
|
2605
|
+
try {
|
|
2606
|
+
const canOpen = await reactNative.Linking.canOpenURL(url);
|
|
2607
|
+
if (canOpen) {
|
|
2608
|
+
return reactNative.Linking.openURL(url);
|
|
2609
|
+
}
|
|
2610
|
+
} catch (e) {
|
|
2611
|
+
logger.error("[openWifiSettings] error opening iOS Wi-Fi settings", e);
|
|
2612
|
+
}
|
|
2613
|
+
return reactNative.Linking.openSettings();
|
|
2614
|
+
};
|
|
2615
|
+
var openWifiSettingsAndroid = async () => {
|
|
2616
|
+
try {
|
|
2617
|
+
await reactNative.Linking.openURL("android.settings.WIFI_SETTINGS");
|
|
2618
|
+
} catch (e) {
|
|
2619
|
+
logger.error("[openWifiSettings] Error opening Android Wi-Fi settings:", e);
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
var extractInfoFromNetInfoState = (netInfoState) => {
|
|
2623
|
+
const { isConnected, type } = netInfoState;
|
|
2624
|
+
const details = netInfoState.details ?? {};
|
|
2625
|
+
const ipAddress = "ipAddress" in details ? details.ipAddress : "";
|
|
2626
|
+
const ipLabel = ipAddress ? `ip: ${ipAddress}` : "";
|
|
2627
|
+
return { isConnected, type, ipLabel };
|
|
2628
|
+
};
|
|
2629
|
+
var startNetworkStateLogging = () => {
|
|
2630
|
+
return netinfo.addEventListener((netInfoState) => {
|
|
2631
|
+
const { isConnected, type, ipLabel } = extractInfoFromNetInfoState(netInfoState);
|
|
2632
|
+
if (isConnected) {
|
|
2633
|
+
logger.info(`[startNetworkStateLogging] connected: ${type} ${ipLabel}`);
|
|
2634
|
+
} else {
|
|
2635
|
+
logger.warn(`[startNetworkStateLogging] disconnected`);
|
|
2636
|
+
}
|
|
2637
|
+
});
|
|
2638
|
+
};
|
|
2639
|
+
var isAxiosNetworkError = (error) => {
|
|
2640
|
+
if (!axios.isAxiosError(error)) {
|
|
2641
|
+
return false;
|
|
2642
|
+
}
|
|
2643
|
+
const code = error.code ?? "";
|
|
2644
|
+
if (!code) {
|
|
2645
|
+
return false;
|
|
2646
|
+
}
|
|
2647
|
+
return axios.AxiosError.ERR_NETWORK === code;
|
|
2648
|
+
};
|
|
2649
|
+
var isValidIpAddressV4 = (ip) => {
|
|
2650
|
+
if (tsCommon.isBlank(ip)) {
|
|
2651
|
+
return false;
|
|
2652
|
+
}
|
|
2653
|
+
return tsCommon.REGEX_IPV4.test(ip);
|
|
2654
|
+
};
|
|
2655
|
+
var notImplementedYet = (...args) => {
|
|
2656
|
+
logger.debug(`Not implemented yet on "${reactNative.Platform.OS}" platform`, args);
|
|
2657
|
+
};
|
|
2658
|
+
var getSQLiteVersion = async () => {
|
|
2659
|
+
try {
|
|
2660
|
+
const db = await SQLite__namespace.openDatabaseAsync(":memory:");
|
|
2661
|
+
const result = await db.getFirstAsync("SELECT sqlite_version() as version");
|
|
2662
|
+
await db.closeAsync();
|
|
2663
|
+
return result?.version ?? "Unknown";
|
|
2664
|
+
} catch (e) {
|
|
2665
|
+
const message = tsCommon.getErrorMessage(e);
|
|
2666
|
+
logger.error(`[getSQLiteVersion] ${message}`, e);
|
|
2667
|
+
throw new Error(`[getSQLiteVersion] ${message}`);
|
|
2668
|
+
}
|
|
2669
|
+
};
|
|
2670
|
+
var createDbFolderUri = async () => {
|
|
2671
|
+
const dbFolderUri = getDocumentFullFilename("SQLite");
|
|
2672
|
+
const exists = await isFileExists(dbFolderUri);
|
|
2673
|
+
if (!exists) {
|
|
2674
|
+
await createDirectoryStructure(dbFolderUri);
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2677
|
+
var getUniqueDbFilename = (prefix = "") => {
|
|
2678
|
+
const nowAsFilename = tsCommon.nowAsDateTimeForFilename();
|
|
2679
|
+
return `${prefix}${nowAsFilename}.db`;
|
|
2680
|
+
};
|
|
2681
|
+
var createDbInstance = async (existingFilename) => {
|
|
2682
|
+
await createDbFolderUri();
|
|
2683
|
+
const dbFilename = existingFilename ?? getUniqueDbFilename();
|
|
2684
|
+
const db = await SQLite__namespace.openDatabaseAsync(dbFilename);
|
|
2685
|
+
return { db, dbFilename };
|
|
2686
|
+
};
|
|
2687
|
+
|
|
2688
|
+
// src/utils/webview.utils.ts
|
|
2689
|
+
var htmlDocumentMessage = (message = {}) => {
|
|
2690
|
+
const jsonMessage = JSON.stringify(message ?? {});
|
|
2691
|
+
return `
|
|
2692
|
+
window.onReactNativeMessage('${jsonMessage}');
|
|
2693
|
+
true;
|
|
2694
|
+
`;
|
|
2695
|
+
};
|
|
2696
|
+
var htmlDocumentRawMessage = (message = "") => {
|
|
2697
|
+
return `
|
|
2698
|
+
window.onReactNativeMessage("${message}");
|
|
2699
|
+
true;
|
|
2700
|
+
`;
|
|
2701
|
+
};
|
|
2702
|
+
var logIncomingHtmlDocMessage = ({ type = "log", log = "" }) => {
|
|
2703
|
+
logger[type](`[incoming-html-doc-message] ${log}`);
|
|
2704
|
+
};
|
|
2705
|
+
var validateResizableSplitViewProps = (props) => {
|
|
2706
|
+
const { initialLeftRatio, minLeftRatio, maxLeftRatio } = props;
|
|
2707
|
+
if (!tsCommon.isNullish(initialLeftRatio)) {
|
|
2708
|
+
if (initialLeftRatio < 0 || initialLeftRatio > 1)
|
|
2709
|
+
throw new Error(`initialLeftRatio must be between 0 and 1. Provided: ${initialLeftRatio}`);
|
|
2710
|
+
}
|
|
2711
|
+
if (!tsCommon.isNullish(minLeftRatio)) {
|
|
2712
|
+
if (minLeftRatio < 0 || minLeftRatio > 1)
|
|
2713
|
+
throw new Error(`minLeftRatio must be between 0 and 1. Provided: ${minLeftRatio}`);
|
|
2714
|
+
}
|
|
2715
|
+
if (!tsCommon.isNullish(maxLeftRatio)) {
|
|
2716
|
+
if (maxLeftRatio < 0 || maxLeftRatio > 1)
|
|
2717
|
+
throw new Error(`maxLeftRatio must be between 0 and 1. Provided: ${maxLeftRatio}`);
|
|
2718
|
+
}
|
|
2719
|
+
if (!tsCommon.isNullish(minLeftRatio) && !tsCommon.isNullish(maxLeftRatio) && minLeftRatio >= maxLeftRatio)
|
|
2720
|
+
throw new Error(
|
|
2721
|
+
`minLeftRatio must be less than maxLeftRatio. Provided: ${JSON.stringify({ minLeftRatio, maxLeftRatio })}`
|
|
2722
|
+
);
|
|
2723
|
+
if (!tsCommon.isNullish(initialLeftRatio) && !tsCommon.isNullish(minLeftRatio) && initialLeftRatio < minLeftRatio)
|
|
2724
|
+
throw new Error(
|
|
2725
|
+
`initialLeftRatio must be >= minLeftRatio. Provided: ${JSON.stringify({ initialLeftRatio, minLeftRatio })}`
|
|
2726
|
+
);
|
|
2727
|
+
if (!tsCommon.isNullish(initialLeftRatio) && !tsCommon.isNullish(maxLeftRatio) && initialLeftRatio > maxLeftRatio)
|
|
2728
|
+
throw new Error(
|
|
2729
|
+
`initialLeftRatio must be <= maxLeftRatio. Provided: ${JSON.stringify({ initialLeftRatio, maxLeftRatio })}`
|
|
2730
|
+
);
|
|
2731
|
+
};
|
|
2732
|
+
var DRAG_HANDLE_WIDTH = 20;
|
|
2733
|
+
var DEFAULT_ANIMATION_CONFIG = { damping: 25, stiffness: 300, mass: 0.8 };
|
|
2734
|
+
var HorizontalResizableSplitView = (props) => {
|
|
2735
|
+
if (isDevelopment()) validateResizableSplitViewProps(props);
|
|
2736
|
+
const {
|
|
2737
|
+
leftContent,
|
|
2738
|
+
rightContent,
|
|
2739
|
+
initialLeftRatio = 0.5,
|
|
2740
|
+
minLeftRatio = 0.15,
|
|
2741
|
+
maxLeftRatio = 0.85,
|
|
2742
|
+
handleContainerStyle,
|
|
2743
|
+
handleStyle,
|
|
2744
|
+
hideHandle = false
|
|
2745
|
+
} = props;
|
|
2746
|
+
const [isReady, setIsReady] = react.useState(false);
|
|
2747
|
+
const leftSectionWidth = Animated.useSharedValue(0);
|
|
2748
|
+
const minWidth = Animated.useSharedValue(0);
|
|
2749
|
+
const maxWidth = Animated.useSharedValue(0);
|
|
2750
|
+
const startX = Animated.useSharedValue(0);
|
|
2751
|
+
const isDragging = Animated.useSharedValue(false);
|
|
2752
|
+
const handleLayout = react.useCallback(
|
|
2753
|
+
(event) => {
|
|
2754
|
+
const { width } = event.nativeEvent.layout;
|
|
2755
|
+
if (width > 0 && !isReady) {
|
|
2756
|
+
minWidth.value = width * minLeftRatio;
|
|
2757
|
+
maxWidth.value = width * maxLeftRatio;
|
|
2758
|
+
leftSectionWidth.value = width * initialLeftRatio;
|
|
2759
|
+
setIsReady(true);
|
|
2760
|
+
}
|
|
2761
|
+
},
|
|
2762
|
+
[minLeftRatio, maxLeftRatio, initialLeftRatio, minWidth, maxWidth, leftSectionWidth, isReady]
|
|
2763
|
+
);
|
|
2764
|
+
const panGesture = reactNativeGestureHandler.Gesture.Pan().onStart(() => {
|
|
2765
|
+
startX.value = leftSectionWidth.value;
|
|
2766
|
+
isDragging.value = true;
|
|
2767
|
+
}).onUpdate((event) => {
|
|
2768
|
+
const newWidth = startX.value + event.translationX;
|
|
2769
|
+
leftSectionWidth.value = Math.max(minWidth.value, Math.min(newWidth, maxWidth.value));
|
|
2770
|
+
}).onEnd(() => {
|
|
2771
|
+
isDragging.value = false;
|
|
2772
|
+
});
|
|
2773
|
+
const leftSectionAnimatedStyle = Animated.useAnimatedStyle(() => ({ width: leftSectionWidth.value }));
|
|
2774
|
+
const dragHandleContainerAnimatedStyle = Animated.useAnimatedStyle(() => ({
|
|
2775
|
+
left: leftSectionWidth.value - DRAG_HANDLE_WIDTH / 2
|
|
2776
|
+
}));
|
|
2777
|
+
const dragHandleAnimatedStyle = Animated.useAnimatedStyle(() => ({
|
|
2778
|
+
transform: [{ scale: Animated.withSpring(isDragging.value ? 1.2 : 1, DEFAULT_ANIMATION_CONFIG) }]
|
|
2779
|
+
}));
|
|
2780
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles3.container], onLayout: handleLayout, children: [
|
|
2781
|
+
/* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles3.leftSection, leftSectionAnimatedStyle], children: leftContent }),
|
|
2782
|
+
!hideHandle && /* @__PURE__ */ jsxRuntime.jsx(reactNativeGestureHandler.GestureDetector, { gesture: panGesture, children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles3.handleContainer, handleContainerStyle, dragHandleContainerAnimatedStyle], children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles3.handle, handleStyle, dragHandleAnimatedStyle] }) }) }),
|
|
2783
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles3.rightSection], children: rightContent })
|
|
2784
|
+
] });
|
|
2785
|
+
};
|
|
2786
|
+
var styles3 = reactNative.StyleSheet.create({
|
|
2787
|
+
container: {
|
|
2788
|
+
flex: 1,
|
|
2789
|
+
flexDirection: "row"
|
|
2790
|
+
},
|
|
2791
|
+
leftSection: {
|
|
2792
|
+
overflow: "hidden"
|
|
2793
|
+
},
|
|
2794
|
+
rightSection: {
|
|
2795
|
+
flex: 1,
|
|
2796
|
+
overflow: "hidden"
|
|
2797
|
+
},
|
|
2798
|
+
handleContainer: {
|
|
2799
|
+
position: "absolute",
|
|
2800
|
+
top: 0,
|
|
2801
|
+
bottom: 0,
|
|
2802
|
+
width: DRAG_HANDLE_WIDTH,
|
|
2803
|
+
alignItems: "center",
|
|
2804
|
+
justifyContent: "center"
|
|
2805
|
+
},
|
|
2806
|
+
handle: {
|
|
2807
|
+
width: 4,
|
|
2808
|
+
height: 40,
|
|
2809
|
+
backgroundColor: "#888888",
|
|
2810
|
+
borderRadius: 2
|
|
2811
|
+
}
|
|
2812
|
+
});
|
|
2813
|
+
|
|
2814
|
+
// src/components/layout/resizable/resizable-overlay-view.utils.ts
|
|
2815
|
+
var computeResizableOverlayLayoutValues = ({
|
|
2816
|
+
event,
|
|
2817
|
+
initialForegroundRatio,
|
|
2818
|
+
minForegroundRatio,
|
|
2819
|
+
maxForegroundRatio,
|
|
2820
|
+
foregroundContentAspectRatio
|
|
2821
|
+
}) => {
|
|
2822
|
+
const { height, width } = event.nativeEvent.layout;
|
|
2823
|
+
if (height <= 0) return { containerHeight: 0, containerWidth: 0, minHeight: 0, maxHeight: 0, overlayHeight: 0 };
|
|
2824
|
+
const computedMinHeight = height * minForegroundRatio;
|
|
2825
|
+
const computedMaxHeightFromContainer = height * maxForegroundRatio;
|
|
2826
|
+
const computedMaxHeightFromAspectRatio = foregroundContentAspectRatio !== void 0 ? width / foregroundContentAspectRatio : Number.POSITIVE_INFINITY;
|
|
2827
|
+
const computedMaxHeight = Math.max(
|
|
2828
|
+
computedMinHeight,
|
|
2829
|
+
Math.min(computedMaxHeightFromContainer, computedMaxHeightFromAspectRatio)
|
|
2830
|
+
);
|
|
2831
|
+
const computedOverlayHeight = Math.max(
|
|
2832
|
+
computedMinHeight,
|
|
2833
|
+
Math.min(height * initialForegroundRatio, computedMaxHeight)
|
|
2834
|
+
);
|
|
2835
|
+
return {
|
|
2836
|
+
containerHeight: height,
|
|
2837
|
+
containerWidth: width,
|
|
2838
|
+
minHeight: computedMinHeight,
|
|
2839
|
+
maxHeight: computedMaxHeight,
|
|
2840
|
+
overlayHeight: computedOverlayHeight
|
|
2841
|
+
};
|
|
2842
|
+
};
|
|
2843
|
+
var validateResizableOverlayProps = (props) => {
|
|
2844
|
+
const { foregroundContentAspectRatio, initialForegroundRatio, minForegroundRatio, maxForegroundRatio } = props;
|
|
2845
|
+
if (!tsCommon.isNullish(foregroundContentAspectRatio)) {
|
|
2846
|
+
if (foregroundContentAspectRatio <= 0)
|
|
2847
|
+
throw new Error("foregroundContentAspectRatio must be greater than 0. Provided: " + foregroundContentAspectRatio);
|
|
2848
|
+
}
|
|
2849
|
+
if (!tsCommon.isNullish(initialForegroundRatio)) {
|
|
2850
|
+
if (initialForegroundRatio < 0 || initialForegroundRatio > 1)
|
|
2851
|
+
throw new Error(`initialForegroundRatio must be between 0 and 1. Provided: ${initialForegroundRatio}`);
|
|
2852
|
+
}
|
|
2853
|
+
if (!tsCommon.isNullish(minForegroundRatio)) {
|
|
2854
|
+
if (minForegroundRatio < 0 || minForegroundRatio > 1)
|
|
2855
|
+
throw new Error(`minForegroundRatio must be between 0 and 1. Provided: ${minForegroundRatio}`);
|
|
2856
|
+
}
|
|
2857
|
+
if (!tsCommon.isNullish(maxForegroundRatio)) {
|
|
2858
|
+
if (maxForegroundRatio < 0 || maxForegroundRatio > 1)
|
|
2859
|
+
throw new Error(`maxForegroundRatio must be between 0 and 1. Provided: ${maxForegroundRatio}`);
|
|
2860
|
+
}
|
|
2861
|
+
if (!tsCommon.isNullish(minForegroundRatio) && !tsCommon.isNullish(maxForegroundRatio) && minForegroundRatio >= maxForegroundRatio)
|
|
2862
|
+
throw new Error(
|
|
2863
|
+
`minForegroundRatio must be less than maxForegroundRatio. Provided: ${JSON.stringify({ minForegroundRatio, maxForegroundRatio })}`
|
|
2864
|
+
);
|
|
2865
|
+
if (!tsCommon.isNullish(initialForegroundRatio) && !tsCommon.isNullish(minForegroundRatio) && initialForegroundRatio < minForegroundRatio)
|
|
2866
|
+
throw new Error(
|
|
2867
|
+
`initialForegroundRatio must be >= minForegroundRatio. Provided: ${JSON.stringify({ initialForegroundRatio, minForegroundRatio })}`
|
|
2868
|
+
);
|
|
2869
|
+
if (!tsCommon.isNullish(initialForegroundRatio) && !tsCommon.isNullish(maxForegroundRatio) && initialForegroundRatio > maxForegroundRatio)
|
|
2870
|
+
throw new Error(
|
|
2871
|
+
`initialForegroundRatio must be <= maxForegroundRatio. Provided: ${JSON.stringify({ initialForegroundRatio, maxForegroundRatio })}`
|
|
2872
|
+
);
|
|
2873
|
+
};
|
|
2874
|
+
var DRAG_HANDLE_HEIGHT = 20;
|
|
2875
|
+
var DEFAULT_ANIMATION_CONFIG2 = { damping: 25, stiffness: 300, mass: 0.8 };
|
|
2876
|
+
var OVERLAY_ANCHOR_STYLES = {
|
|
2877
|
+
topLeft: { top: 0, left: 0 },
|
|
2878
|
+
topRight: { top: 0, right: 0 },
|
|
2879
|
+
bottomLeft: { bottom: 0, left: 0 },
|
|
2880
|
+
bottomRight: { bottom: 0, right: 0 }
|
|
2881
|
+
};
|
|
2882
|
+
var ResizableOverlayView = (props) => {
|
|
2883
|
+
if (isDevelopment()) validateResizableOverlayProps(props);
|
|
2884
|
+
const {
|
|
2885
|
+
foregroundContent,
|
|
2886
|
+
backgroundContent,
|
|
2887
|
+
initialForegroundRatio = 0.5,
|
|
2888
|
+
minForegroundRatio = 0.15,
|
|
2889
|
+
maxForegroundRatio = 0.85,
|
|
2890
|
+
foregroundContentAspectRatio,
|
|
2891
|
+
handleContainerStyle,
|
|
2892
|
+
handleStyle,
|
|
2893
|
+
hideHandle = false,
|
|
2894
|
+
anchorType = "topRight"
|
|
2895
|
+
} = props;
|
|
2896
|
+
const overlayAnchorStyle = OVERLAY_ANCHOR_STYLES[anchorType];
|
|
2897
|
+
const isBottomAnchored = ["bottomLeft", "bottomRight"].includes(anchorType);
|
|
2898
|
+
const isLeftAnchored = ["topLeft", "bottomLeft"].includes(anchorType);
|
|
2899
|
+
const overlayHeight = Animated.useSharedValue(0);
|
|
2900
|
+
const containerHeight = Animated.useSharedValue(0);
|
|
2901
|
+
const containerWidth = Animated.useSharedValue(0);
|
|
2902
|
+
const minHeight = Animated.useSharedValue(0);
|
|
2903
|
+
const maxHeight = Animated.useSharedValue(0);
|
|
2904
|
+
const startY = Animated.useSharedValue(0);
|
|
2905
|
+
const isDragging = Animated.useSharedValue(false);
|
|
2906
|
+
const handleLayout = (event) => {
|
|
2907
|
+
const computedValues = computeResizableOverlayLayoutValues({
|
|
2908
|
+
event,
|
|
2909
|
+
initialForegroundRatio,
|
|
2910
|
+
minForegroundRatio,
|
|
2911
|
+
maxForegroundRatio,
|
|
2912
|
+
foregroundContentAspectRatio
|
|
2913
|
+
});
|
|
2914
|
+
containerHeight.value = computedValues.containerHeight;
|
|
2915
|
+
containerWidth.value = computedValues.containerWidth;
|
|
2916
|
+
minHeight.value = computedValues.minHeight;
|
|
2917
|
+
maxHeight.value = computedValues.maxHeight;
|
|
2918
|
+
overlayHeight.value = computedValues.overlayHeight;
|
|
2919
|
+
};
|
|
2920
|
+
const panGesture = reactNativeGestureHandler.Gesture.Pan().onStart(() => {
|
|
2921
|
+
startY.value = overlayHeight.value;
|
|
2922
|
+
isDragging.value = true;
|
|
2923
|
+
}).onUpdate((event) => {
|
|
2924
|
+
const direction = isBottomAnchored ? -1 : 1;
|
|
2925
|
+
const newHeight = startY.value + direction * event.translationY;
|
|
2926
|
+
overlayHeight.value = Math.max(minHeight.value, Math.min(newHeight, maxHeight.value));
|
|
2927
|
+
}).onEnd(() => {
|
|
2928
|
+
isDragging.value = false;
|
|
2929
|
+
});
|
|
2930
|
+
const overlayAnimatedStyle = Animated.useAnimatedStyle(() => {
|
|
2931
|
+
let height = overlayHeight.value;
|
|
2932
|
+
let width;
|
|
2933
|
+
if (foregroundContentAspectRatio !== void 0) {
|
|
2934
|
+
const calculatedWidth = height * foregroundContentAspectRatio;
|
|
2935
|
+
if (calculatedWidth > containerWidth.value) {
|
|
2936
|
+
width = containerWidth.value;
|
|
2937
|
+
height = Math.max(containerWidth.value / foregroundContentAspectRatio, minHeight.value);
|
|
2938
|
+
} else {
|
|
2939
|
+
width = calculatedWidth;
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
return width !== void 0 ? { height, width } : { height };
|
|
2943
|
+
});
|
|
2944
|
+
const dragHandleContainerAnimatedStyle = Animated.useAnimatedStyle(() => {
|
|
2945
|
+
let effectiveHeight = overlayHeight.value;
|
|
2946
|
+
let effectiveWidth = containerWidth.value;
|
|
2947
|
+
if (foregroundContentAspectRatio !== void 0) {
|
|
2948
|
+
const calculatedWidth = effectiveHeight * foregroundContentAspectRatio;
|
|
2949
|
+
if (calculatedWidth > containerWidth.value) {
|
|
2950
|
+
effectiveHeight = Math.max(containerWidth.value / foregroundContentAspectRatio, minHeight.value);
|
|
2951
|
+
effectiveWidth = containerWidth.value;
|
|
2952
|
+
} else {
|
|
2953
|
+
effectiveWidth = calculatedWidth;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
const left = isLeftAnchored ? 0 : Math.max(0, containerWidth.value - effectiveWidth);
|
|
2957
|
+
const top = isBottomAnchored ? containerHeight.value - effectiveHeight - DRAG_HANDLE_HEIGHT / 2 : effectiveHeight - DRAG_HANDLE_HEIGHT / 2;
|
|
2958
|
+
return {
|
|
2959
|
+
top,
|
|
2960
|
+
width: effectiveWidth,
|
|
2961
|
+
left
|
|
2962
|
+
};
|
|
2963
|
+
}, [foregroundContentAspectRatio, isBottomAnchored, isLeftAnchored]);
|
|
2964
|
+
const dragHandleAnimatedStyle = Animated.useAnimatedStyle(() => ({
|
|
2965
|
+
transform: [{ scale: Animated.withSpring(isDragging.value ? 1.2 : 1, DEFAULT_ANIMATION_CONFIG2) }]
|
|
2966
|
+
}));
|
|
2967
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles4.container], onLayout: handleLayout, children: [
|
|
2968
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.backgroundSection, children: backgroundContent }),
|
|
2969
|
+
/* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles4.overlaySection, overlayAnchorStyle, overlayAnimatedStyle], children: foregroundContent }),
|
|
2970
|
+
!hideHandle && /* @__PURE__ */ jsxRuntime.jsx(reactNativeGestureHandler.GestureDetector, { gesture: panGesture, children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles4.handleContainer, handleContainerStyle, dragHandleContainerAnimatedStyle], children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles4.handle, handleStyle, dragHandleAnimatedStyle] }) }) })
|
|
2971
|
+
] });
|
|
2972
|
+
};
|
|
2973
|
+
var styles4 = reactNative.StyleSheet.create({
|
|
2974
|
+
container: {
|
|
2975
|
+
flex: 1
|
|
2976
|
+
},
|
|
2977
|
+
backgroundSection: {
|
|
2978
|
+
flex: 1
|
|
2979
|
+
},
|
|
2980
|
+
overlaySection: {
|
|
2981
|
+
position: "absolute",
|
|
2982
|
+
overflow: "hidden"
|
|
2983
|
+
},
|
|
2984
|
+
handleContainer: {
|
|
2985
|
+
position: "absolute",
|
|
2986
|
+
height: DRAG_HANDLE_HEIGHT,
|
|
2987
|
+
alignItems: "center",
|
|
2988
|
+
justifyContent: "center"
|
|
2989
|
+
},
|
|
2990
|
+
handle: {
|
|
2991
|
+
width: 40,
|
|
2992
|
+
height: 4,
|
|
2993
|
+
backgroundColor: "#888888",
|
|
2994
|
+
borderRadius: 4
|
|
2995
|
+
}
|
|
2996
|
+
});
|
|
2997
|
+
var validateResizableSplitViewProps2 = (props) => {
|
|
2998
|
+
const { initialTopRatio, minTopRatio, maxTopRatio } = props;
|
|
2999
|
+
if (!tsCommon.isNullish(initialTopRatio)) {
|
|
3000
|
+
if (initialTopRatio < 0 || initialTopRatio > 1)
|
|
3001
|
+
throw new Error(`initialTopRatio must be between 0 and 1. Provided: ${initialTopRatio}`);
|
|
3002
|
+
}
|
|
3003
|
+
if (!tsCommon.isNullish(minTopRatio)) {
|
|
3004
|
+
if (minTopRatio < 0 || minTopRatio > 1)
|
|
3005
|
+
throw new Error(`minTopRatio must be between 0 and 1. Provided: ${minTopRatio}`);
|
|
3006
|
+
}
|
|
3007
|
+
if (!tsCommon.isNullish(maxTopRatio)) {
|
|
3008
|
+
if (maxTopRatio < 0 || maxTopRatio > 1)
|
|
3009
|
+
throw new Error(`maxTopRatio must be between 0 and 1. Provided: ${maxTopRatio}`);
|
|
3010
|
+
}
|
|
3011
|
+
if (!tsCommon.isNullish(minTopRatio) && !tsCommon.isNullish(maxTopRatio) && minTopRatio >= maxTopRatio)
|
|
3012
|
+
throw new Error(
|
|
3013
|
+
`minTopRatio must be less than maxTopRatio. Provided: ${JSON.stringify({ minTopRatio, maxTopRatio })}`
|
|
3014
|
+
);
|
|
3015
|
+
if (!tsCommon.isNullish(initialTopRatio) && !tsCommon.isNullish(minTopRatio) && initialTopRatio < minTopRatio)
|
|
3016
|
+
throw new Error(
|
|
3017
|
+
`initialTopRatio must be >= minTopRatio. Provided: ${JSON.stringify({ initialTopRatio, minTopRatio })}`
|
|
3018
|
+
);
|
|
3019
|
+
if (!tsCommon.isNullish(initialTopRatio) && !tsCommon.isNullish(maxTopRatio) && initialTopRatio > maxTopRatio)
|
|
3020
|
+
throw new Error(
|
|
3021
|
+
`initialTopRatio must be <= maxTopRatio. Provided: ${JSON.stringify({ initialTopRatio, maxTopRatio })}`
|
|
3022
|
+
);
|
|
3023
|
+
};
|
|
3024
|
+
var DRAG_HANDLE_HEIGHT2 = 20;
|
|
3025
|
+
var DEFAULT_ANIMATION_CONFIG3 = { damping: 25, stiffness: 300, mass: 0.8 };
|
|
3026
|
+
var VerticalResizableSplitView = (props) => {
|
|
3027
|
+
if (isDevelopment()) validateResizableSplitViewProps2(props);
|
|
3028
|
+
const {
|
|
3029
|
+
topContent,
|
|
3030
|
+
bottomContent,
|
|
3031
|
+
initialTopRatio = 0.5,
|
|
3032
|
+
minTopRatio = 0.15,
|
|
3033
|
+
maxTopRatio = 0.85,
|
|
3034
|
+
handleContainerStyle,
|
|
3035
|
+
handleStyle,
|
|
3036
|
+
hideHandle = false
|
|
3037
|
+
} = props;
|
|
3038
|
+
const [isReady, setIsReady] = react.useState(false);
|
|
3039
|
+
const topSectionHeight = Animated.useSharedValue(0);
|
|
3040
|
+
const minHeight = Animated.useSharedValue(0);
|
|
3041
|
+
const maxHeight = Animated.useSharedValue(0);
|
|
3042
|
+
const startY = Animated.useSharedValue(0);
|
|
3043
|
+
const isDragging = Animated.useSharedValue(false);
|
|
3044
|
+
const handleLayout = react.useCallback(
|
|
3045
|
+
(event) => {
|
|
3046
|
+
const { height } = event.nativeEvent.layout;
|
|
3047
|
+
if (height > 0 && !isReady) {
|
|
3048
|
+
minHeight.value = height * minTopRatio;
|
|
3049
|
+
maxHeight.value = height * maxTopRatio;
|
|
3050
|
+
topSectionHeight.value = height * initialTopRatio;
|
|
3051
|
+
setIsReady(true);
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
[minTopRatio, maxTopRatio, initialTopRatio, minHeight, maxHeight, topSectionHeight, isReady]
|
|
3055
|
+
);
|
|
3056
|
+
const panGesture = reactNativeGestureHandler.Gesture.Pan().onStart(() => {
|
|
3057
|
+
startY.value = topSectionHeight.value;
|
|
3058
|
+
isDragging.value = true;
|
|
3059
|
+
}).onUpdate((event) => {
|
|
3060
|
+
const newHeight = startY.value + event.translationY;
|
|
3061
|
+
topSectionHeight.value = Math.max(minHeight.value, Math.min(newHeight, maxHeight.value));
|
|
3062
|
+
}).onEnd(() => {
|
|
3063
|
+
isDragging.value = false;
|
|
3064
|
+
});
|
|
3065
|
+
const topSectionAnimatedStyle = Animated.useAnimatedStyle(() => ({ height: topSectionHeight.value }));
|
|
3066
|
+
const dragHandleContainerAnimatedStyle = Animated.useAnimatedStyle(() => ({
|
|
3067
|
+
top: topSectionHeight.value - DRAG_HANDLE_HEIGHT2 / 2
|
|
3068
|
+
}));
|
|
3069
|
+
const dragHandleAnimatedStyle = Animated.useAnimatedStyle(() => ({
|
|
3070
|
+
transform: [{ scale: Animated.withSpring(isDragging.value ? 1.2 : 1, DEFAULT_ANIMATION_CONFIG3) }]
|
|
3071
|
+
}));
|
|
3072
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles5.container], onLayout: handleLayout, children: [
|
|
3073
|
+
/* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles5.topSection, topSectionAnimatedStyle], children: topContent }),
|
|
3074
|
+
!hideHandle && /* @__PURE__ */ jsxRuntime.jsx(reactNativeGestureHandler.GestureDetector, { gesture: panGesture, children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles5.handleContainer, handleContainerStyle, dragHandleContainerAnimatedStyle], children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: [styles5.handle, handleStyle, dragHandleAnimatedStyle] }) }) }),
|
|
3075
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.bottomSection], children: bottomContent })
|
|
3076
|
+
] });
|
|
3077
|
+
};
|
|
3078
|
+
var styles5 = reactNative.StyleSheet.create({
|
|
3079
|
+
container: {
|
|
3080
|
+
flex: 1
|
|
3081
|
+
},
|
|
3082
|
+
topSection: {
|
|
3083
|
+
overflow: "hidden"
|
|
3084
|
+
},
|
|
3085
|
+
bottomSection: {
|
|
3086
|
+
flex: 1,
|
|
3087
|
+
overflow: "hidden"
|
|
3088
|
+
},
|
|
3089
|
+
handleContainer: {
|
|
3090
|
+
position: "absolute",
|
|
3091
|
+
left: 0,
|
|
3092
|
+
right: 0,
|
|
3093
|
+
height: DRAG_HANDLE_HEIGHT2,
|
|
3094
|
+
alignItems: "center",
|
|
3095
|
+
justifyContent: "center"
|
|
3096
|
+
},
|
|
3097
|
+
handle: {
|
|
3098
|
+
width: 40,
|
|
3099
|
+
height: 4,
|
|
3100
|
+
backgroundColor: "#888888",
|
|
3101
|
+
borderRadius: 2
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
var SafeContainer = ({ children, style, shouldAnimate = false }) => {
|
|
3105
|
+
const isScreenFocused = native.useIsFocused();
|
|
3106
|
+
if (!isScreenFocused) {
|
|
3107
|
+
return null;
|
|
3108
|
+
}
|
|
3109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativeSafeAreaContext.SafeAreaView, { style: [styles6.container, style], children: /* @__PURE__ */ jsxRuntime.jsx(Animated__default.default.View, { style: styles6.container, entering: shouldAnimate ? Animated.FadeInUp.duration(500) : void 0, children }) });
|
|
3110
|
+
};
|
|
3111
|
+
var styles6 = reactNative.StyleSheet.create({
|
|
3112
|
+
container: {
|
|
3113
|
+
flex: 1
|
|
3114
|
+
}
|
|
3115
|
+
});
|
|
3116
|
+
var ListHeader = ({ title }) => {
|
|
3117
|
+
const styles7 = useStyles17();
|
|
3118
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.container, children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "titleMedium", children: title }) });
|
|
3119
|
+
};
|
|
3120
|
+
var useStyles17 = () => {
|
|
3121
|
+
const theme = useAppTheme();
|
|
3122
|
+
return reactNative.StyleSheet.create({
|
|
3123
|
+
container: {
|
|
3124
|
+
paddingHorizontal: theme.spacing(1)
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
};
|
|
3128
|
+
var ListItemsSeparator = () => {
|
|
3129
|
+
const styles7 = useStyles18();
|
|
3130
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.separator });
|
|
3131
|
+
};
|
|
3132
|
+
var useStyles18 = () => {
|
|
3133
|
+
const theme = useAppTheme();
|
|
3134
|
+
return reactNative.StyleSheet.create({
|
|
3135
|
+
separator: {
|
|
3136
|
+
height: reactNative.StyleSheet.hairlineWidth,
|
|
3137
|
+
backgroundColor: theme.colors.outline
|
|
3138
|
+
}
|
|
3139
|
+
});
|
|
3140
|
+
};
|
|
3141
|
+
var OnOffState = {
|
|
3142
|
+
on: "on",
|
|
3143
|
+
off: "off"
|
|
3144
|
+
};
|
|
3145
|
+
var OnOffToggle = ({ isOn, onValueChange, style }) => {
|
|
3146
|
+
const theme = useAppTheme();
|
|
3147
|
+
const checkedColor = theme.colors.primary;
|
|
3148
|
+
const uncheckedColor = theme.colors.tertiary;
|
|
3149
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3150
|
+
reactNativePaper.SegmentedButtons,
|
|
3151
|
+
{
|
|
3152
|
+
value: isOn ? OnOffState.on : OnOffState.off,
|
|
3153
|
+
onValueChange: (value) => onValueChange(value === OnOffState.on),
|
|
3154
|
+
buttons: [
|
|
3155
|
+
{
|
|
3156
|
+
value: OnOffState.on,
|
|
3157
|
+
icon: "play",
|
|
3158
|
+
checkedColor,
|
|
3159
|
+
uncheckedColor
|
|
3160
|
+
},
|
|
3161
|
+
{
|
|
3162
|
+
value: OnOffState.off,
|
|
3163
|
+
icon: "stop",
|
|
3164
|
+
checkedColor,
|
|
3165
|
+
uncheckedColor
|
|
3166
|
+
}
|
|
3167
|
+
],
|
|
3168
|
+
style
|
|
3169
|
+
}
|
|
3170
|
+
);
|
|
3171
|
+
};
|
|
3172
|
+
var PasswordInput = ({ label, ...rest }) => {
|
|
3173
|
+
const { t } = reactI18next.useTranslation();
|
|
3174
|
+
const [isPasswordVisible, toggleShowPassword] = usehooks.useToggle();
|
|
3175
|
+
const displayLabel = label ?? t("common:password");
|
|
3176
|
+
const icon = isPasswordVisible ? "eye-off" : "eye";
|
|
3177
|
+
const showA11yLabel = isPasswordVisible ? t("common:passwordInput.hidePassword") : t("common:passwordInput.showPassword");
|
|
3178
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3179
|
+
reactNativePaper.TextInput,
|
|
3180
|
+
{
|
|
3181
|
+
label: displayLabel,
|
|
3182
|
+
secureTextEntry: !isPasswordVisible,
|
|
3183
|
+
right: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.TextInput.Icon, { icon, onPress: () => toggleShowPassword(), accessibilityLabel: showA11yLabel }),
|
|
3184
|
+
...rest
|
|
3185
|
+
}
|
|
3186
|
+
);
|
|
3187
|
+
};
|
|
3188
|
+
|
|
3189
|
+
// src/components/spinner/activity-progress.utils.ts
|
|
3190
|
+
var import_pretty_bytes = __toESM(require_pretty_bytes());
|
|
3191
|
+
var computeActivityProgress = (progress) => {
|
|
3192
|
+
if (!progress) {
|
|
3193
|
+
return { percentage: 0, stats: "" };
|
|
3194
|
+
}
|
|
3195
|
+
const { loaded, total, isBytes = true, decimals = 2 } = progress;
|
|
3196
|
+
const hasTotal = !!total;
|
|
3197
|
+
if (isBytes) {
|
|
3198
|
+
const loadedLabel = (0, import_pretty_bytes.default)(loaded);
|
|
3199
|
+
const totalLabel = hasTotal ? (0, import_pretty_bytes.default)(total) : "";
|
|
3200
|
+
const stats2 = `${loadedLabel} / ${totalLabel}`;
|
|
3201
|
+
const percentage2 = hasTotal ? tsCommon.toFixed(loaded / total * 100, decimals) : 0;
|
|
3202
|
+
return { percentage: percentage2, stats: stats2 };
|
|
3203
|
+
}
|
|
3204
|
+
const stats = hasTotal ? `${loaded} / ${total}` : `${loaded}`;
|
|
3205
|
+
const percentage = hasTotal ? tsCommon.toFixed(loaded / total * 100, decimals) : 0;
|
|
3206
|
+
return { percentage, stats };
|
|
3207
|
+
};
|
|
3208
|
+
var ActivityProgressBarStats = ({
|
|
3209
|
+
progress,
|
|
3210
|
+
shouldShowSpinner = false
|
|
3211
|
+
}) => {
|
|
3212
|
+
const styles7 = useStyles19();
|
|
3213
|
+
const { percentage, stats } = computeActivityProgress(progress);
|
|
3214
|
+
if (shouldShowSpinner) {
|
|
3215
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.ActivityIndicator, {});
|
|
3216
|
+
}
|
|
3217
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3218
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.ProgressBar, { progress: percentage / 100, style: styles7.progressBar }),
|
|
3219
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.statsContainer, children: [
|
|
3220
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", children: stats }),
|
|
3221
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Text, { variant: "bodySmall", children: [
|
|
3222
|
+
percentage.toFixed(0),
|
|
3223
|
+
"%"
|
|
3224
|
+
] })
|
|
3225
|
+
] })
|
|
3226
|
+
] });
|
|
3227
|
+
};
|
|
3228
|
+
var useStyles19 = () => {
|
|
3229
|
+
const theme = useAppTheme();
|
|
3230
|
+
return reactNative.StyleSheet.create({
|
|
3231
|
+
progressBar: {
|
|
3232
|
+
height: 8,
|
|
3233
|
+
borderRadius: theme.roundness
|
|
3234
|
+
},
|
|
3235
|
+
statsContainer: {
|
|
3236
|
+
flexDirection: "row",
|
|
3237
|
+
justifyContent: "space-between"
|
|
3238
|
+
}
|
|
3239
|
+
});
|
|
3240
|
+
};
|
|
3241
|
+
var ActivityProgressBar = ({
|
|
3242
|
+
title,
|
|
3243
|
+
progress,
|
|
3244
|
+
description = "",
|
|
3245
|
+
shouldShowSpinner
|
|
3246
|
+
}) => {
|
|
3247
|
+
const styles7 = useStyles20();
|
|
3248
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.container, children: [
|
|
3249
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", style: styles7.label, children: title }),
|
|
3250
|
+
/* @__PURE__ */ jsxRuntime.jsx(ActivityProgressBarStats, { progress, shouldShowSpinner }),
|
|
3251
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { variant: "bodySmall", style: styles7.label, children: description })
|
|
3252
|
+
] });
|
|
3253
|
+
};
|
|
3254
|
+
var useStyles20 = () => {
|
|
3255
|
+
const theme = useAppTheme();
|
|
3256
|
+
return reactNative.StyleSheet.create({
|
|
3257
|
+
container: {
|
|
3258
|
+
gap: theme.spacing(1)
|
|
3259
|
+
},
|
|
3260
|
+
label: {
|
|
3261
|
+
alignSelf: "center"
|
|
3262
|
+
}
|
|
3263
|
+
});
|
|
3264
|
+
};
|
|
3265
|
+
var FullCenteredSpinner = () => /* @__PURE__ */ jsxRuntime.jsx(FullCentered, { children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.ActivityIndicator, {}) });
|
|
3266
|
+
var ModalSpinner = ({
|
|
3267
|
+
isVisible,
|
|
3268
|
+
title = "Loading",
|
|
3269
|
+
description = "Please wait...",
|
|
3270
|
+
modelLoadingLogs,
|
|
3271
|
+
onDismiss
|
|
3272
|
+
}) => {
|
|
3273
|
+
const styles7 = useStyles21();
|
|
3274
|
+
if (!isVisible) {
|
|
3275
|
+
return null;
|
|
3276
|
+
}
|
|
3277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog, { visible: isVisible, onDismiss, children: [
|
|
3278
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Title, { style: styles7.title, children: title }),
|
|
3279
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNativePaper.Dialog.Content, { children: [
|
|
3280
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.ActivityIndicator, { style: styles7.spinner }),
|
|
3281
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { children: description }),
|
|
3282
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.progressLogs, children: modelLoadingLogs.map((log) => /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Text, { numberOfLines: 1, ellipsizeMode: "tail", style: styles7.progressLog, children: log }, log)) })
|
|
3283
|
+
] }),
|
|
3284
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Dialog.Actions, { children: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.Button, { onPress: onDismiss, children: "Cancel" }) })
|
|
3285
|
+
] }) });
|
|
3286
|
+
};
|
|
3287
|
+
var useStyles21 = () => {
|
|
3288
|
+
const theme = useAppTheme();
|
|
3289
|
+
return reactNative.StyleSheet.create({
|
|
3290
|
+
title: {
|
|
3291
|
+
textAlign: "center"
|
|
3292
|
+
},
|
|
3293
|
+
spinner: {
|
|
3294
|
+
marginVertical: theme.spacing(3)
|
|
3295
|
+
},
|
|
3296
|
+
progressLogs: {
|
|
3297
|
+
height: 80,
|
|
3298
|
+
maxHeight: 80,
|
|
3299
|
+
overflow: "scroll",
|
|
3300
|
+
marginVertical: 10,
|
|
3301
|
+
width: "100%"
|
|
3302
|
+
},
|
|
3303
|
+
progressLog: {
|
|
3304
|
+
color: theme.colors.secondary,
|
|
3305
|
+
width: "100%"
|
|
3306
|
+
}
|
|
3307
|
+
});
|
|
3308
|
+
};
|
|
3309
|
+
var buildFinalValue = ({ query, recordingValue }) => {
|
|
3310
|
+
return [query, recordingValue].filter(tsCommon.isNotBlank).join(" ");
|
|
3311
|
+
};
|
|
3312
|
+
var ensureVoiceRecognitionPermissions = async () => {
|
|
3313
|
+
try {
|
|
3314
|
+
const permissions = await expoSpeechRecognition.ExpoSpeechRecognitionModule.getPermissionsAsync();
|
|
3315
|
+
if (!permissions.granted) {
|
|
3316
|
+
const result = await expoSpeechRecognition.ExpoSpeechRecognitionModule.requestPermissionsAsync();
|
|
3317
|
+
if (!result.granted) {
|
|
3318
|
+
logger.info("[ensureVoiceRecognitionPermissions] Permissions not granted", result);
|
|
3319
|
+
return false;
|
|
3320
|
+
}
|
|
3321
|
+
}
|
|
3322
|
+
return true;
|
|
3323
|
+
} catch (e) {
|
|
3324
|
+
logger.error("[ensureVoiceRecognitionPermissions] Error getting permissions", e);
|
|
3325
|
+
return false;
|
|
3326
|
+
}
|
|
3327
|
+
};
|
|
3328
|
+
var VoiceRecognitionTextInput = ({
|
|
3329
|
+
label,
|
|
3330
|
+
value,
|
|
3331
|
+
onValueChange,
|
|
3332
|
+
onValueSubmit,
|
|
3333
|
+
...rest
|
|
3334
|
+
}) => {
|
|
3335
|
+
const styles7 = useStyles22();
|
|
3336
|
+
const [isRecording, setIsRecording] = react.useState(false);
|
|
3337
|
+
const [recordingValue, setRecordingValue] = react.useState("");
|
|
3338
|
+
const { t } = reactI18next.useTranslation();
|
|
3339
|
+
const speechToTextLanguageCode = t("common:speechToTextLanguageCode");
|
|
3340
|
+
const finalValue = buildFinalValue({ query: value, recordingValue });
|
|
3341
|
+
const triggerOnSearch = () => {
|
|
3342
|
+
reactNative.Keyboard.dismiss();
|
|
3343
|
+
onValueSubmit(finalValue.trim());
|
|
3344
|
+
setIsRecording(false);
|
|
3345
|
+
setRecordingValue("");
|
|
3346
|
+
};
|
|
3347
|
+
expoSpeechRecognition.useSpeechRecognitionEvent("result", (event) => {
|
|
3348
|
+
if (!isRecording) return;
|
|
3349
|
+
const transcript = event.results[0].transcript;
|
|
3350
|
+
if (tsCommon.isNotBlank(transcript)) {
|
|
3351
|
+
setRecordingValue(transcript);
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
expoSpeechRecognition.useSpeechRecognitionEvent("error", (event) => {
|
|
3355
|
+
const { error, message } = event;
|
|
3356
|
+
logger.error(`[useSpeechRecognitionEvent] error: ${error} - ${message}`);
|
|
3357
|
+
setIsRecording(false);
|
|
3358
|
+
setRecordingValue("");
|
|
3359
|
+
});
|
|
3360
|
+
const handleStartRecording = async () => {
|
|
3361
|
+
const hasPermissions = await ensureVoiceRecognitionPermissions();
|
|
3362
|
+
if (!hasPermissions) return;
|
|
3363
|
+
setIsRecording(true);
|
|
3364
|
+
setRecordingValue("");
|
|
3365
|
+
reactNative.Keyboard.dismiss();
|
|
3366
|
+
expoSpeechRecognition.ExpoSpeechRecognitionModule.start({
|
|
3367
|
+
lang: speechToTextLanguageCode,
|
|
3368
|
+
interimResults: true,
|
|
3369
|
+
continuous: true
|
|
3370
|
+
});
|
|
3371
|
+
};
|
|
3372
|
+
const handleStopRecording = async () => {
|
|
3373
|
+
if (!isRecording) return;
|
|
3374
|
+
setIsRecording(false);
|
|
3375
|
+
expoSpeechRecognition.ExpoSpeechRecognitionModule.stop();
|
|
3376
|
+
if (tsCommon.isNotBlank(recordingValue)) {
|
|
3377
|
+
onValueChange(buildFinalValue({ query: value, recordingValue }));
|
|
3378
|
+
}
|
|
3379
|
+
setRecordingValue("");
|
|
3380
|
+
};
|
|
3381
|
+
const toggleRecording = () => {
|
|
3382
|
+
if (isRecording) {
|
|
3383
|
+
handleStopRecording();
|
|
3384
|
+
} else {
|
|
3385
|
+
handleStartRecording();
|
|
3386
|
+
}
|
|
3387
|
+
};
|
|
3388
|
+
const clearValue = () => {
|
|
3389
|
+
onValueChange("");
|
|
3390
|
+
setRecordingValue("");
|
|
3391
|
+
};
|
|
3392
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.container, children: [
|
|
3393
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3394
|
+
reactNativePaper.TextInput,
|
|
3395
|
+
{
|
|
3396
|
+
...rest,
|
|
3397
|
+
style: styles7.textInput,
|
|
3398
|
+
label,
|
|
3399
|
+
value: finalValue,
|
|
3400
|
+
readOnly: isRecording,
|
|
3401
|
+
onChangeText: onValueChange,
|
|
3402
|
+
multiline: true,
|
|
3403
|
+
numberOfLines: 4,
|
|
3404
|
+
left: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.TextInput.Icon, { icon: isRecording ? "stop" : "microphone-outline", onPress: toggleRecording }),
|
|
3405
|
+
right: /* @__PURE__ */ jsxRuntime.jsx(reactNativePaper.TextInput.Icon, { icon: "close", onPress: clearValue, disabled: tsCommon.isBlank(finalValue) })
|
|
3406
|
+
}
|
|
3407
|
+
),
|
|
3408
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.actionsContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3409
|
+
reactNativePaper.IconButton,
|
|
3410
|
+
{
|
|
3411
|
+
icon: "send",
|
|
3412
|
+
onPress: triggerOnSearch,
|
|
3413
|
+
disabled: tsCommon.isBlank(finalValue),
|
|
3414
|
+
iconColor: styles7.sendIcon.color
|
|
3415
|
+
}
|
|
3416
|
+
) })
|
|
3417
|
+
] });
|
|
3418
|
+
};
|
|
3419
|
+
var useStyles22 = () => {
|
|
3420
|
+
const theme = useAppTheme();
|
|
3421
|
+
return reactNative.StyleSheet.create({
|
|
3422
|
+
container: {
|
|
3423
|
+
flexDirection: "row"
|
|
3424
|
+
},
|
|
3425
|
+
textInput: {
|
|
3426
|
+
flex: 1
|
|
3427
|
+
},
|
|
3428
|
+
actionsContainer: {
|
|
3429
|
+
flexDirection: "row"
|
|
3430
|
+
},
|
|
3431
|
+
sendIcon: {
|
|
3432
|
+
color: theme.colors.primary
|
|
3433
|
+
}
|
|
3434
|
+
});
|
|
3435
|
+
};
|
|
3436
|
+
var toSinglePictureUri = (result) => {
|
|
3437
|
+
if (!result.canceled && result.assets.length > 0) {
|
|
3438
|
+
return result.assets[0].uri;
|
|
3439
|
+
}
|
|
3440
|
+
return null;
|
|
3441
|
+
};
|
|
3442
|
+
var requestTakePhotoPermissions = async () => {
|
|
3443
|
+
const { status } = await ImagePicker__namespace.requestCameraPermissionsAsync();
|
|
3444
|
+
return status === "granted";
|
|
3445
|
+
};
|
|
3446
|
+
var requestMediaLibPermissions = async () => {
|
|
3447
|
+
const { status } = await ImagePicker__namespace.requestMediaLibraryPermissionsAsync();
|
|
3448
|
+
return status === "granted";
|
|
3449
|
+
};
|
|
3450
|
+
var DEFAULT_OPTIONS2 = {
|
|
3451
|
+
allowsEditing: true,
|
|
3452
|
+
aspect: [4, 3],
|
|
3453
|
+
quality: 0.7
|
|
3454
|
+
};
|
|
3455
|
+
var useCameraImagePicker = (options2 = DEFAULT_OPTIONS2) => {
|
|
3456
|
+
const { t } = reactI18next.useTranslation();
|
|
3457
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
3458
|
+
const handlePermissionDenied = () => {
|
|
3459
|
+
showSnackbarMessage(t("common:imagePicker.permissionDenied"));
|
|
3460
|
+
return null;
|
|
3461
|
+
};
|
|
3462
|
+
const handleError = (e) => {
|
|
3463
|
+
logger.error("[useCameraImagePicker] Error picking image", e);
|
|
3464
|
+
showSnackbarMessage(t("common:imagePicker.error"));
|
|
3465
|
+
};
|
|
3466
|
+
const pickImage = async () => {
|
|
3467
|
+
const hasPermission = await requestMediaLibPermissions();
|
|
3468
|
+
if (!hasPermission) return handlePermissionDenied();
|
|
3469
|
+
try {
|
|
3470
|
+
const result = await ImagePicker__namespace.launchImageLibraryAsync(options2);
|
|
3471
|
+
return toSinglePictureUri(result);
|
|
3472
|
+
} catch (e) {
|
|
3473
|
+
handleError(e);
|
|
3474
|
+
}
|
|
3475
|
+
return null;
|
|
3476
|
+
};
|
|
3477
|
+
const takePhoto = async () => {
|
|
3478
|
+
const hasPermission = await requestTakePhotoPermissions();
|
|
3479
|
+
if (!hasPermission) return handlePermissionDenied();
|
|
3480
|
+
try {
|
|
3481
|
+
const result = await ImagePicker__namespace.launchCameraAsync(options2);
|
|
3482
|
+
return toSinglePictureUri(result);
|
|
3483
|
+
} catch (e) {
|
|
3484
|
+
handleError(e);
|
|
3485
|
+
}
|
|
3486
|
+
return null;
|
|
3487
|
+
};
|
|
3488
|
+
return {
|
|
3489
|
+
pickImage,
|
|
3490
|
+
takePhoto
|
|
3491
|
+
};
|
|
3492
|
+
};
|
|
3493
|
+
var options = {
|
|
3494
|
+
mediaTypes: ["images", "livePhotos"],
|
|
3495
|
+
allowsEditing: true,
|
|
3496
|
+
quality: 1
|
|
3497
|
+
};
|
|
3498
|
+
var DEFAULT_DIMENSIONS = {
|
|
3499
|
+
width: 0,
|
|
3500
|
+
height: 0,
|
|
3501
|
+
aspectRatio: 1
|
|
3502
|
+
};
|
|
3503
|
+
var useImagePicker = () => {
|
|
3504
|
+
const [selectedImage, setSelectedImage] = react.useState();
|
|
3505
|
+
const [dimensions, setDimensions] = react.useState(DEFAULT_DIMENSIONS);
|
|
3506
|
+
const hasSelectedImage = !!selectedImage;
|
|
3507
|
+
const pickImage = async () => {
|
|
3508
|
+
const result = await ImagePicker__namespace.launchImageLibraryAsync(options);
|
|
3509
|
+
if (result.canceled) {
|
|
3510
|
+
return;
|
|
3511
|
+
}
|
|
3512
|
+
const { uri } = result.assets[0];
|
|
3513
|
+
setSelectedImage(uri);
|
|
3514
|
+
reactNative.Image.getSize(uri, (width, height) => setDimensions({ width, height, aspectRatio: width / height }), logger.error);
|
|
3515
|
+
};
|
|
3516
|
+
return {
|
|
3517
|
+
pickImage,
|
|
3518
|
+
hasSelectedImage,
|
|
3519
|
+
selectedImage,
|
|
3520
|
+
dimensions
|
|
3521
|
+
};
|
|
3522
|
+
};
|
|
3523
|
+
var useInvalidateQueriesOnFocus = (queryKeys) => {
|
|
3524
|
+
const queryClient2 = reactQuery.useQueryClient();
|
|
3525
|
+
native.useFocusEffect(
|
|
3526
|
+
react.useCallback(() => {
|
|
3527
|
+
const invalidationPromises = queryKeys.map((queryKey) => queryClient2.invalidateQueries({ queryKey }));
|
|
3528
|
+
Promise.all(invalidationPromises);
|
|
3529
|
+
}, [queryClient2])
|
|
3530
|
+
);
|
|
3531
|
+
};
|
|
3532
|
+
var useOnHtmlDocMessage = () => {
|
|
3533
|
+
const [isDocumentReady, setIsDocumentReady] = react.useState(false);
|
|
3534
|
+
const onMessage = (payload) => {
|
|
3535
|
+
const payloadData = payload?.nativeEvent?.data ?? "";
|
|
3536
|
+
try {
|
|
3537
|
+
const { type, data } = JSON.parse(payloadData);
|
|
3538
|
+
if (type === "documentReady") {
|
|
3539
|
+
setIsDocumentReady(true);
|
|
3540
|
+
} else if (type === "console") {
|
|
3541
|
+
logIncomingHtmlDocMessage(data);
|
|
3542
|
+
} else {
|
|
3543
|
+
logger.warn(`useWebviewDocument onMessage: <${type}> not handled`);
|
|
3544
|
+
}
|
|
3545
|
+
} catch (e) {
|
|
3546
|
+
logger.error("Error in useWebviewDocument onMessage", e, payloadData);
|
|
3547
|
+
}
|
|
3548
|
+
};
|
|
3549
|
+
return {
|
|
3550
|
+
isDocumentReady,
|
|
3551
|
+
onMessage
|
|
3552
|
+
};
|
|
3553
|
+
};
|
|
3554
|
+
var useSingleFileSelector = ({ mimeTypes, copyToCacheDirectory = false }) => {
|
|
3555
|
+
const { t } = reactI18next.useTranslation();
|
|
3556
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
3557
|
+
const [selectedFile, setSelectedFile] = react.useState();
|
|
3558
|
+
const handleFileSelection = async () => {
|
|
3559
|
+
try {
|
|
3560
|
+
const type = mimeTypes ?? ["*/*"];
|
|
3561
|
+
const result = await pickSingleFile({ type, copyToCacheDirectory });
|
|
3562
|
+
if (!result.exists) return;
|
|
3563
|
+
const { name, size, uri, mimeType, lastModified } = result;
|
|
3564
|
+
if (uri && name) {
|
|
3565
|
+
setSelectedFile({ name, size, uri, lastModified, mimeType });
|
|
3566
|
+
}
|
|
3567
|
+
} catch (e) {
|
|
3568
|
+
logger.error("[handleFileSelection] error selecting file", e);
|
|
3569
|
+
showSnackbarMessage(t("common:errorUnexpected"));
|
|
3570
|
+
}
|
|
3571
|
+
};
|
|
3572
|
+
return {
|
|
3573
|
+
selectedFile,
|
|
3574
|
+
handleFileSelection,
|
|
3575
|
+
hasSelectedFile: !!selectedFile
|
|
3576
|
+
};
|
|
3577
|
+
};
|
|
3578
|
+
var useTimeoutState = (timeoutMs) => {
|
|
3579
|
+
const [isLoading, toggleLoading] = usehooks.useToggle(true);
|
|
3580
|
+
react.useEffect(() => {
|
|
3581
|
+
const timer = setTimeout(toggleLoading, timeoutMs);
|
|
3582
|
+
return () => clearTimeout(timer);
|
|
3583
|
+
}, []);
|
|
3584
|
+
return isLoading;
|
|
3585
|
+
};
|
|
3586
|
+
var useTimeoutToggle = (timeoutMs) => {
|
|
3587
|
+
const [isLoading, toggleLoading] = usehooks.useToggle(false);
|
|
3588
|
+
const timeoutRef = react.useRef(null);
|
|
3589
|
+
const onStartLoading = react.useCallback(() => {
|
|
3590
|
+
clearTimeout(timeoutRef.current ?? void 0);
|
|
3591
|
+
toggleLoading();
|
|
3592
|
+
timeoutRef.current = setTimeout(() => {
|
|
3593
|
+
toggleLoading();
|
|
3594
|
+
timeoutRef.current = null;
|
|
3595
|
+
}, timeoutMs);
|
|
3596
|
+
}, [timeoutMs, toggleLoading]);
|
|
3597
|
+
react.useEffect(() => {
|
|
3598
|
+
return () => clearTimeout(timeoutRef.current ?? void 0);
|
|
3599
|
+
}, []);
|
|
3600
|
+
return [isLoading, onStartLoading];
|
|
3601
|
+
};
|
|
3602
|
+
|
|
3603
|
+
// src/utils/env.utils.windows.ts
|
|
3604
|
+
var isProduction2 = () => {
|
|
3605
|
+
if (__DEV__) {
|
|
3606
|
+
return false;
|
|
3607
|
+
}
|
|
3608
|
+
return true;
|
|
3609
|
+
};
|
|
3610
|
+
|
|
3611
|
+
// src/hooks/use-updates.ts
|
|
3612
|
+
var checkForUpdateAsync2 = async () => {
|
|
3613
|
+
const deviceType = getDeviceType();
|
|
3614
|
+
if (isRealDevice() && isProduction2()) {
|
|
3615
|
+
logger.info(`[checkForUpdateAsync] Checking for update on ${deviceType}`);
|
|
3616
|
+
await Updates2__namespace.checkForUpdateAsync();
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
logger.info(`[checkForUpdateAsync] Faking update check on ${deviceType}`);
|
|
3620
|
+
await tsCommon.sleep(1e3);
|
|
3621
|
+
};
|
|
3622
|
+
var useUpdates2 = () => {
|
|
3623
|
+
const [isLoading, setIsLoading] = react.useState(false);
|
|
3624
|
+
const { currentlyRunning, isUpdateAvailable, isUpdatePending } = Updates2__namespace.useUpdates();
|
|
3625
|
+
const fetchAndApplyUpdate = async () => {
|
|
3626
|
+
setIsLoading(true);
|
|
3627
|
+
try {
|
|
3628
|
+
logger.info("[useUpdates.fetchAndApplyUpdate] Fetching update...");
|
|
3629
|
+
await Updates2__namespace.fetchUpdateAsync();
|
|
3630
|
+
logger.info("[useUpdates.fetchAndApplyUpdate] Update fetched successfully");
|
|
3631
|
+
} catch (error) {
|
|
3632
|
+
logger.error("[useUpdates.fetchAndApplyUpdate] Failed to fetch update:", error);
|
|
3633
|
+
} finally {
|
|
3634
|
+
setIsLoading(false);
|
|
3635
|
+
}
|
|
3636
|
+
};
|
|
3637
|
+
const checkForUpdates = async () => {
|
|
3638
|
+
setIsLoading(true);
|
|
3639
|
+
try {
|
|
3640
|
+
logger.info("[useUpdates.checkForUpdates] Checking for updates...");
|
|
3641
|
+
await checkForUpdateAsync2();
|
|
3642
|
+
logger.info("[useUpdates.checkForUpdates] Updates checked successfully");
|
|
3643
|
+
} catch (error) {
|
|
3644
|
+
logger.error("[useUpdates.checkForUpdates] Failed to check for updates:", error);
|
|
3645
|
+
} finally {
|
|
3646
|
+
setIsLoading(false);
|
|
3647
|
+
}
|
|
3648
|
+
};
|
|
3649
|
+
react.useEffect(() => {
|
|
3650
|
+
if (isUpdatePending) {
|
|
3651
|
+
logger.info("[useUpdates.useEffect] Reloading app...");
|
|
3652
|
+
Updates2__namespace.reloadAsync();
|
|
3653
|
+
}
|
|
3654
|
+
}, [isUpdatePending]);
|
|
3655
|
+
const storeVersion = `Store version: ${expoApplication.nativeApplicationVersion} (${expoApplication.nativeBuildVersion})`;
|
|
3656
|
+
const runTypeMessage = currentlyRunning.isEmbeddedLaunch ? `${storeVersion}: from built-in code (no OTA update yet).` : `${storeVersion}: including OTA update.`;
|
|
3657
|
+
return {
|
|
3658
|
+
runTypeMessage,
|
|
3659
|
+
isUpdateAvailable,
|
|
3660
|
+
isUpdatePending,
|
|
3661
|
+
checkForUpdates,
|
|
3662
|
+
isLoading,
|
|
3663
|
+
fetchAndApplyUpdate
|
|
3664
|
+
};
|
|
3665
|
+
};
|
|
3666
|
+
|
|
3667
|
+
// src/i18n/en/common.json
|
|
3668
|
+
var common_default = {
|
|
3669
|
+
common: {
|
|
3670
|
+
about: "About",
|
|
3671
|
+
accept: "Accept",
|
|
3672
|
+
account: "Account",
|
|
3673
|
+
actions: "Actions",
|
|
3674
|
+
add: "Add",
|
|
3675
|
+
addLink: "Add a link",
|
|
3676
|
+
addMember: "Add a member",
|
|
3677
|
+
advanced: "Advanced",
|
|
3678
|
+
all: "All",
|
|
3679
|
+
apiCallResult: "API Call Result",
|
|
3680
|
+
appLoading: "Loading Application\u2026",
|
|
3681
|
+
appLoadingVersion: "Loading version {{version}}\u2026",
|
|
3682
|
+
apply: "Apply",
|
|
3683
|
+
archive: "Archive",
|
|
3684
|
+
associate: "Associate",
|
|
3685
|
+
asyncStatus: {
|
|
3686
|
+
converting: "Converting\u2026",
|
|
3687
|
+
deleteFileError: "Could not delete file",
|
|
3688
|
+
deletingFile: "Deleting file...",
|
|
3689
|
+
downloadError: "Error while downloading",
|
|
3690
|
+
downloading: "Downloading\u2026",
|
|
3691
|
+
loading: "Loading\u2026",
|
|
3692
|
+
waiting: "Waiting\u2026"
|
|
3693
|
+
},
|
|
3694
|
+
back: "Back",
|
|
3695
|
+
backup: "Backup",
|
|
3696
|
+
barcodeScanner: {
|
|
3697
|
+
scanBarcodeInstruction: "Position the barcode or QR code within the frame",
|
|
3698
|
+
requestingCameraPermission: "Requesting camera permission...",
|
|
3699
|
+
noCameraAccess: "No access to camera"
|
|
3700
|
+
},
|
|
3701
|
+
battery: {
|
|
3702
|
+
level: "Battery level: {{batteryLevel}}%"
|
|
3703
|
+
},
|
|
3704
|
+
browse: "Browse",
|
|
3705
|
+
cancel: "Cancel",
|
|
3706
|
+
check: "Check",
|
|
3707
|
+
clear: "Clear",
|
|
3708
|
+
close: "Close",
|
|
3709
|
+
complete: "Complete",
|
|
3710
|
+
configure: "Configure",
|
|
3711
|
+
confirm: "Confirm",
|
|
3712
|
+
connect: "Connect",
|
|
3713
|
+
continue: "Continue",
|
|
3714
|
+
copiedToClipboard: "Text copied to clipboard",
|
|
3715
|
+
copy: "Copy",
|
|
3716
|
+
copyToClipboard: "Copy to clipboard",
|
|
3717
|
+
create: "Create",
|
|
3718
|
+
customize: "Customize",
|
|
3719
|
+
data: "Data",
|
|
3720
|
+
date: "Date",
|
|
3721
|
+
default: "Default",
|
|
3722
|
+
delete: "Delete",
|
|
3723
|
+
deleteAllLogsFilesConfirmation: "Are you sure you want to delete all logs files?",
|
|
3724
|
+
description: "Description",
|
|
3725
|
+
details: "Details",
|
|
3726
|
+
disable: "Disable",
|
|
3727
|
+
done: "Done",
|
|
3728
|
+
download: "Download",
|
|
3729
|
+
edit: "Edit",
|
|
3730
|
+
editItem: "Edit {{name}}",
|
|
3731
|
+
enable: "Enable",
|
|
3732
|
+
endDate: "End Date",
|
|
3733
|
+
error: "Error",
|
|
3734
|
+
errorBoundary: {
|
|
3735
|
+
error: "An unexpected error occurred: {{errorMsg}} (ID: {{id}})",
|
|
3736
|
+
details: "Details"
|
|
3737
|
+
},
|
|
3738
|
+
errorUnexpected: "An unexpected error occurred. Consult the logs for more details.",
|
|
3739
|
+
errorLoadingFiles: "Error loading file tree",
|
|
3740
|
+
eventLogs: "Event Logs",
|
|
3741
|
+
export: "Export",
|
|
3742
|
+
externalLinks: "External Links",
|
|
3743
|
+
failed: "Failed",
|
|
3744
|
+
file: "File",
|
|
3745
|
+
filter: "Filter",
|
|
3746
|
+
finish: "Finish",
|
|
3747
|
+
folder: "Folder",
|
|
3748
|
+
formValidations: {
|
|
3749
|
+
filePathMustNotContainsRelativePath: "The file path must not contain a relative path",
|
|
3750
|
+
filePathShouldNotContainsSpecialChars: "Invalid characters detected in the file path",
|
|
3751
|
+
invalidPattern: "Verifiy that the opening '{' and closing '}' curly braces are correctly placed. Also ensure that the internal curly braces content is not blank.",
|
|
3752
|
+
required: "This field is required",
|
|
3753
|
+
email: "This field must be a valid email address",
|
|
3754
|
+
minLength: "This field must be at least {{minLength}} characters long"
|
|
3755
|
+
},
|
|
3756
|
+
fullscreen: "Fullscreen",
|
|
3757
|
+
help: "Help",
|
|
3758
|
+
hide: "Hide",
|
|
3759
|
+
i18nInitialized: "i18n 'en' \u2705",
|
|
3760
|
+
imagePicker: {
|
|
3761
|
+
takePhoto: "Take a photo",
|
|
3762
|
+
chooseFromGallery: "Choose from gallery",
|
|
3763
|
+
permissionDenied: "Permission denied to access gallery",
|
|
3764
|
+
cameraPermissionDenied: "Permission denied to access camera",
|
|
3765
|
+
error: "Error accessing image picker"
|
|
3766
|
+
},
|
|
3767
|
+
import: "Import",
|
|
3768
|
+
information: "Information",
|
|
3769
|
+
install: "Install",
|
|
3770
|
+
item: "Item",
|
|
3771
|
+
language: "Language",
|
|
3772
|
+
link: "Link",
|
|
3773
|
+
list: "List",
|
|
3774
|
+
lock: "Lock",
|
|
3775
|
+
logout: "Logout",
|
|
3776
|
+
logs: {
|
|
3777
|
+
filter: "Filter logs",
|
|
3778
|
+
clear: "Clear logs",
|
|
3779
|
+
copyAll: "Copy all logs"
|
|
3780
|
+
},
|
|
3781
|
+
manage: "Manage",
|
|
3782
|
+
menu: "Menu",
|
|
3783
|
+
more: "More",
|
|
3784
|
+
move: "Move",
|
|
3785
|
+
name: "Name",
|
|
3786
|
+
na: "N/A",
|
|
3787
|
+
new: "New",
|
|
3788
|
+
next: "Next",
|
|
3789
|
+
no: "No",
|
|
3790
|
+
noCameraAvailable: "No camera available",
|
|
3791
|
+
noDataFound: "No data available",
|
|
3792
|
+
notification: "Notification",
|
|
3793
|
+
nowDateTime: "Today's date and time",
|
|
3794
|
+
off: "Off",
|
|
3795
|
+
ok: "Ok",
|
|
3796
|
+
on: "On",
|
|
3797
|
+
open: "Open",
|
|
3798
|
+
options: "Options",
|
|
3799
|
+
password: "Password",
|
|
3800
|
+
passwordInput: {
|
|
3801
|
+
showPassword: "Show password",
|
|
3802
|
+
hidePassword: "Hide password"
|
|
3803
|
+
},
|
|
3804
|
+
paste: "Paste",
|
|
3805
|
+
preview: "Preview",
|
|
3806
|
+
previous: "Previous",
|
|
3807
|
+
print: "Print",
|
|
3808
|
+
profile: "Profile",
|
|
3809
|
+
public: "Public",
|
|
3810
|
+
recent: "Recent",
|
|
3811
|
+
refresh: "Refresh",
|
|
3812
|
+
remove: "Remove",
|
|
3813
|
+
rename: "Rename",
|
|
3814
|
+
replace: "Replace",
|
|
3815
|
+
reset: "Reset",
|
|
3816
|
+
restore: "Restore",
|
|
3817
|
+
retry: "Retry",
|
|
3818
|
+
save: "Save",
|
|
3819
|
+
saved: "Data has been saved.",
|
|
3820
|
+
savedChanges: "Changes saved successfully",
|
|
3821
|
+
saving: "Data is being modified.",
|
|
3822
|
+
scan: "Scan",
|
|
3823
|
+
search: "Search",
|
|
3824
|
+
select: "Select",
|
|
3825
|
+
selectItem: "Select item",
|
|
3826
|
+
send: "Send",
|
|
3827
|
+
set: "Set",
|
|
3828
|
+
settings: "Settings",
|
|
3829
|
+
share: "Share",
|
|
3830
|
+
showMore: "Show more",
|
|
3831
|
+
sort: "Sort",
|
|
3832
|
+
speechToTextLanguageCode: "en-CA",
|
|
3833
|
+
start: "Start",
|
|
3834
|
+
startDate: "Start Date",
|
|
3835
|
+
status: "Status",
|
|
3836
|
+
stop: "Stop",
|
|
3837
|
+
submit: "Submit",
|
|
3838
|
+
success: "Success",
|
|
3839
|
+
time: "Time",
|
|
3840
|
+
title: "Title",
|
|
3841
|
+
unlock: "Unlock",
|
|
3842
|
+
update: "Update",
|
|
3843
|
+
upload: "Upload",
|
|
3844
|
+
user: "User",
|
|
3845
|
+
view: "View",
|
|
3846
|
+
warning: "Warning",
|
|
3847
|
+
wifi: {
|
|
3848
|
+
connectError: "Error connecting to WiFi: {{error}}",
|
|
3849
|
+
currentNetworkRetrievalError: "Error retrieving current WiFi network information",
|
|
3850
|
+
availableNetworksRetrievalError: "Error retrieving available WiFi networks"
|
|
3851
|
+
},
|
|
3852
|
+
yes: "Yes",
|
|
3853
|
+
zoom: "Zoom"
|
|
3854
|
+
}
|
|
3855
|
+
};
|
|
3856
|
+
|
|
3857
|
+
// src/i18n/fr/common.json
|
|
3858
|
+
var common_default2 = {
|
|
3859
|
+
common: {
|
|
3860
|
+
about: "\xC0 propos",
|
|
3861
|
+
accept: "Accepter",
|
|
3862
|
+
account: "Compte",
|
|
3863
|
+
actions: "Actions",
|
|
3864
|
+
add: "Ajouter",
|
|
3865
|
+
addLink: "Ajouter un lien",
|
|
3866
|
+
addMember: "Ajouter un utilisateur",
|
|
3867
|
+
advanced: "Avanc\xE9",
|
|
3868
|
+
all: "Tous",
|
|
3869
|
+
apiCallResult: "R\xE9sultat de l'appel API",
|
|
3870
|
+
appLoading: "Chargement de l'application\u2026",
|
|
3871
|
+
appLoadingVersion: "Chargement de la version de l'application {{version}}\u2026",
|
|
3872
|
+
apply: "Appliquer",
|
|
3873
|
+
archive: "Archiver",
|
|
3874
|
+
associate: "Associer",
|
|
3875
|
+
asyncStatus: {
|
|
3876
|
+
converting: "Conversion\u2026",
|
|
3877
|
+
deleteFileError: "Impossible de supprimer le fichier",
|
|
3878
|
+
deletingFile: "Suppression du fichier\u2026",
|
|
3879
|
+
downloadError: "Erreur lors du t\xE9l\xE9chargement",
|
|
3880
|
+
downloading: "T\xE9l\xE9chargement\u2026",
|
|
3881
|
+
loading: "Chargement\u2026",
|
|
3882
|
+
waiting: "En attente\u2026"
|
|
3883
|
+
},
|
|
3884
|
+
back: "Retour",
|
|
3885
|
+
backup: "Sauvegarde",
|
|
3886
|
+
barcodeScanner: {
|
|
3887
|
+
scanBarcodeInstruction: "Positionnez le code barre ou le code QR dans le cadre",
|
|
3888
|
+
requestingCameraPermission: "Demande de permission de la cam\xE9ra\u2026",
|
|
3889
|
+
noCameraAccess: "Aucun acc\xE8s \xE0 la cam\xE9ra"
|
|
3890
|
+
},
|
|
3891
|
+
battery: {
|
|
3892
|
+
level: "Niveau de la pile: {{batteryLevel}}%"
|
|
3893
|
+
},
|
|
3894
|
+
browse: "Parcourir",
|
|
3895
|
+
cancel: "Annuler",
|
|
3896
|
+
check: "V\xE9rifier",
|
|
3897
|
+
clear: "Effacer",
|
|
3898
|
+
close: "Fermer",
|
|
3899
|
+
complete: "Terminer",
|
|
3900
|
+
configure: "Configurer",
|
|
3901
|
+
confirm: "Confirmer",
|
|
3902
|
+
connect: "Connecter",
|
|
3903
|
+
continue: "Continuer",
|
|
3904
|
+
copiedToClipboard: "Texte copi\xE9 dans le presse-papiers",
|
|
3905
|
+
copy: "Copier",
|
|
3906
|
+
copyToClipboard: "Copier dans le presse-papiers",
|
|
3907
|
+
create: "Cr\xE9er",
|
|
3908
|
+
customize: "Personnaliser",
|
|
3909
|
+
data: "Donn\xE9es",
|
|
3910
|
+
date: "Date",
|
|
3911
|
+
default: "Par d\xE9faut",
|
|
3912
|
+
delete: "Supprimer",
|
|
3913
|
+
deleteAllLogsFilesConfirmation: "Voulez-vous vraiment supprimer tous les fichiers de logs ?",
|
|
3914
|
+
description: "Description",
|
|
3915
|
+
details: "D\xE9tails",
|
|
3916
|
+
disable: "D\xE9sactiver",
|
|
3917
|
+
done: "Termin\xE9",
|
|
3918
|
+
download: "T\xE9l\xE9charger",
|
|
3919
|
+
edit: "Modifier",
|
|
3920
|
+
editItem: "Modifier {{name}}",
|
|
3921
|
+
enable: "Activer",
|
|
3922
|
+
endDate: "Date de fin",
|
|
3923
|
+
error: "Erreur",
|
|
3924
|
+
errorBoundary: {
|
|
3925
|
+
error: "Une erreur inattendue est survenue: {{errorMsg}} (ID: {{id}})",
|
|
3926
|
+
details: "D\xE9tails"
|
|
3927
|
+
},
|
|
3928
|
+
errorUnexpected: "Une erreur inattendue est survenue. Consultez les logs pour plus de d\xE9tails.",
|
|
3929
|
+
errorLoadingFiles: "Erreur lors du chargement de l'arborescence des fichiers",
|
|
3930
|
+
eventLogs: "Logs d'\xE9v\xE9nements",
|
|
3931
|
+
export: "Exporter",
|
|
3932
|
+
externalLinks: "Liens externes",
|
|
3933
|
+
failed: "\xC9chec",
|
|
3934
|
+
file: "Fichier",
|
|
3935
|
+
filter: "Filtrer",
|
|
3936
|
+
finish: "Terminer",
|
|
3937
|
+
folder: "Dossier",
|
|
3938
|
+
formValidations: {
|
|
3939
|
+
filePathMustNotContainsRelativePath: "Le chemin du fichier ne doit pas contenir de chemin relatif",
|
|
3940
|
+
filePathShouldNotContainsSpecialChars: "Caract\xE8res invalides d\xE9tect\xE9s dans le chemin du fichier",
|
|
3941
|
+
invalidPattern: "V\xE9rifiez que les accolades ouvrantes '{' et fermantes '}' sont correctement plac\xE9es. Assurez-vous \xE9galement que le contenu entre les accolades n'est pas vide.",
|
|
3942
|
+
required: "Ce champ est obligatoire",
|
|
3943
|
+
email: "Veuillez saisir une adresse de courriel valide",
|
|
3944
|
+
minLength: "Ce champ doit contenir au moins {{minLength}} caract\xE8res"
|
|
3945
|
+
},
|
|
3946
|
+
fullscreen: "Plein \xE9cran",
|
|
3947
|
+
help: "Aide",
|
|
3948
|
+
hide: "Masquer",
|
|
3949
|
+
i18nInitialized: "i18n 'fr' \u2705",
|
|
3950
|
+
imagePicker: {
|
|
3951
|
+
takePhoto: "Prenndre une photo",
|
|
3952
|
+
chooseFromGallery: "Choisir depuis la galerie",
|
|
3953
|
+
permissionDenied: "Permission refus\xE9e pour acc\xE9der \xE0 la galerie",
|
|
3954
|
+
cameraPermissionDenied: "Permission refus\xE9e pour acc\xE9der \xE0 la cam\xE9ra",
|
|
3955
|
+
error: "Erreur lors de l'acc\xE8s \xE0 la s\xE9lection d'image"
|
|
3956
|
+
},
|
|
3957
|
+
import: "Importer",
|
|
3958
|
+
information: "Informations",
|
|
3959
|
+
install: "Installer",
|
|
3960
|
+
item: "\xC9l\xE9ment",
|
|
3961
|
+
language: "Langue",
|
|
3962
|
+
link: "Lien",
|
|
3963
|
+
list: "Liste",
|
|
3964
|
+
lock: "Verrouiller",
|
|
3965
|
+
logout: "D\xE9connexion",
|
|
3966
|
+
logs: {
|
|
3967
|
+
filter: "Filtrer les logs",
|
|
3968
|
+
clear: "Effacer les logs",
|
|
3969
|
+
copyAll: "Copier tous les logs"
|
|
3970
|
+
},
|
|
3971
|
+
manage: "Gestion",
|
|
3972
|
+
menu: "Menu",
|
|
3973
|
+
more: "Plus",
|
|
3974
|
+
move: "D\xE9placer",
|
|
3975
|
+
name: "Nom",
|
|
3976
|
+
na: "N.D.",
|
|
3977
|
+
new: "Nouveau",
|
|
3978
|
+
next: "Suivant",
|
|
3979
|
+
no: "Non",
|
|
3980
|
+
noCameraAvailable: "Aucune cam\xE9ra disponible",
|
|
3981
|
+
noDataFound: "Aucune donn\xE9e disponible",
|
|
3982
|
+
notification: "Notification",
|
|
3983
|
+
nowDateTime: "Date et heure d'aujourd'hui",
|
|
3984
|
+
off: "D\xE9sactiv\xE9",
|
|
3985
|
+
ok: "Ok",
|
|
3986
|
+
on: "Activ\xE9",
|
|
3987
|
+
open: "Ouvrir",
|
|
3988
|
+
options: "Options",
|
|
3989
|
+
password: "Mot de passe",
|
|
3990
|
+
passwordInput: {
|
|
3991
|
+
showPassword: "Afficher le mot de passe",
|
|
3992
|
+
hidePassword: "Masquer le mot de passe"
|
|
3993
|
+
},
|
|
3994
|
+
paste: "Coller",
|
|
3995
|
+
preview: "Aper\xE7u",
|
|
3996
|
+
previous: "Pr\xE9c\xE9dent",
|
|
3997
|
+
print: "Imprimer",
|
|
3998
|
+
profile: "Profil",
|
|
3999
|
+
public: "Public",
|
|
4000
|
+
recent: "R\xE9cent",
|
|
4001
|
+
refresh: "Actualiser",
|
|
4002
|
+
remove: "Retirer",
|
|
4003
|
+
rename: "Renommer",
|
|
4004
|
+
replace: "Remplacer",
|
|
4005
|
+
reset: "R\xE9initialiser",
|
|
4006
|
+
restore: "Restaurer",
|
|
4007
|
+
retry: "R\xE9essayer",
|
|
4008
|
+
save: "Sauvegarder",
|
|
4009
|
+
saved: "Les donn\xE9es ont \xE9t\xE9 sauvegard\xE9es.",
|
|
4010
|
+
savedChanges: "Modifications sauvegard\xE9es avec succ\xE8s",
|
|
4011
|
+
saving: "Les donn\xE9es sont en cours de modifications.",
|
|
4012
|
+
scan: "Scanner",
|
|
4013
|
+
search: "Rechercher",
|
|
4014
|
+
select: "S\xE9lectionner",
|
|
4015
|
+
selectItem: "S\xE9lectionner un \xE9l\xE9ment",
|
|
4016
|
+
send: "Envoyer",
|
|
4017
|
+
set: "D\xE9finir",
|
|
4018
|
+
settings: "Param\xE8tres",
|
|
4019
|
+
share: "Partager",
|
|
4020
|
+
showMore: "Afficher plus",
|
|
4021
|
+
sort: "Trier",
|
|
4022
|
+
speechToTextLanguageCode: "fr-CA",
|
|
4023
|
+
start: "D\xE9marrer",
|
|
4024
|
+
startDate: "Date de d\xE9but",
|
|
4025
|
+
status: "Statut",
|
|
4026
|
+
stop: "Arr\xEAter",
|
|
4027
|
+
submit: "Soumettre",
|
|
4028
|
+
success: "Succ\xE8s",
|
|
4029
|
+
time: "Heure",
|
|
4030
|
+
title: "Titre",
|
|
4031
|
+
unlock: "D\xE9verrouiller",
|
|
4032
|
+
update: "Mettre \xE0 jour",
|
|
4033
|
+
upload: "T\xE9l\xE9verser",
|
|
4034
|
+
user: "Utilisateur",
|
|
4035
|
+
view: "Voir",
|
|
4036
|
+
warning: "Avertissement",
|
|
4037
|
+
wifi: {
|
|
4038
|
+
connectError: "Erreur de connexion au WiFi : {{error}}",
|
|
4039
|
+
currentNetworkRetrievalError: "Erreur lors de la r\xE9cup\xE9ration des informations du r\xE9seau WiFi actuel",
|
|
4040
|
+
availableNetworksRetrievalError: "Erreur lors de la r\xE9cup\xE9ration des r\xE9seaux WiFi disponibles"
|
|
4041
|
+
},
|
|
4042
|
+
yes: "Oui",
|
|
4043
|
+
zoom: "Zoom"
|
|
4044
|
+
}
|
|
4045
|
+
};
|
|
4046
|
+
var detectLanguage = () => {
|
|
4047
|
+
const deviceLanguage = Localization__namespace.getLocales()[0]?.languageTag;
|
|
4048
|
+
return deviceLanguage ? deviceLanguage : "en";
|
|
4049
|
+
};
|
|
4050
|
+
|
|
4051
|
+
// src/i18n/i18n.ts
|
|
4052
|
+
var STORAGE_KEY_LANGUAGE = "appLanguage";
|
|
4053
|
+
var SUPPORTED_LANGUAGES = [
|
|
4054
|
+
{ code: "fr", selectionLabel: "Fran\xE7ais" },
|
|
4055
|
+
{ code: "en", selectionLabel: "English" }
|
|
4056
|
+
];
|
|
4057
|
+
var DEFAULT_LANGUAGE = "fr";
|
|
4058
|
+
var storeSelectedLanguage = (newCode) => {
|
|
4059
|
+
storage.setItem(STORAGE_KEY_LANGUAGE, newCode);
|
|
4060
|
+
};
|
|
4061
|
+
var loadSelectedLanguage = () => {
|
|
4062
|
+
return storage.getItem(STORAGE_KEY_LANGUAGE, DEFAULT_LANGUAGE);
|
|
4063
|
+
};
|
|
4064
|
+
var languageDetector = {
|
|
4065
|
+
type: "languageDetector",
|
|
4066
|
+
async: false,
|
|
4067
|
+
detect: detectLanguage,
|
|
4068
|
+
init: () => {
|
|
4069
|
+
},
|
|
4070
|
+
cacheUserLanguage: () => {
|
|
4071
|
+
}
|
|
4072
|
+
};
|
|
4073
|
+
var initCommonI18N = (instance) => {
|
|
4074
|
+
const i18next3 = instance ?? i18next__default.default;
|
|
4075
|
+
const savedLanguage = loadSelectedLanguage();
|
|
4076
|
+
if (!savedLanguage) {
|
|
4077
|
+
storeSelectedLanguage(DEFAULT_LANGUAGE);
|
|
4078
|
+
}
|
|
4079
|
+
i18next3.use(languageDetector).use(reactI18next.initReactI18next).init({
|
|
4080
|
+
resources: { fr: common_default2, en: common_default },
|
|
4081
|
+
defaultNS: "common",
|
|
4082
|
+
fallbackLng: DEFAULT_LANGUAGE,
|
|
4083
|
+
lng: savedLanguage || DEFAULT_LANGUAGE,
|
|
4084
|
+
debug: false,
|
|
4085
|
+
interpolation: {
|
|
4086
|
+
escapeValue: false
|
|
4087
|
+
// not needed for react as it escapes by default
|
|
4088
|
+
}
|
|
4089
|
+
});
|
|
4090
|
+
};
|
|
4091
|
+
var DeviceFinder = class {
|
|
4092
|
+
constructor() {
|
|
4093
|
+
this.type = "";
|
|
4094
|
+
this.protocol = "";
|
|
4095
|
+
this.domain = void 0;
|
|
4096
|
+
this.zeroConf = null;
|
|
4097
|
+
this.isScanning = false;
|
|
4098
|
+
this.timerID = void 0;
|
|
4099
|
+
this.discoveredDevices = [];
|
|
4100
|
+
this.onErrorCallback = () => {
|
|
4101
|
+
};
|
|
4102
|
+
this.onSuccessCallback = () => {
|
|
4103
|
+
};
|
|
4104
|
+
}
|
|
4105
|
+
scan(args) {
|
|
4106
|
+
const { type, protocol, domain, onError, onSuccess, timeoutMs } = args;
|
|
4107
|
+
this.type = type;
|
|
4108
|
+
this.protocol = protocol;
|
|
4109
|
+
this.domain = domain;
|
|
4110
|
+
this.onErrorCallback = onError;
|
|
4111
|
+
this.onSuccessCallback = onSuccess;
|
|
4112
|
+
this.start(timeoutMs);
|
|
4113
|
+
}
|
|
4114
|
+
setupListeners() {
|
|
4115
|
+
this.zeroConf = new Zeroconf__default.default();
|
|
4116
|
+
this.zeroConf.on("start", () => {
|
|
4117
|
+
logger.info("[DeviceFinder] Scan started");
|
|
4118
|
+
this.isScanning = true;
|
|
4119
|
+
});
|
|
4120
|
+
this.zeroConf.on("stop", () => {
|
|
4121
|
+
logger.info("[DeviceFinder] Scan stopped");
|
|
4122
|
+
this.isScanning = false;
|
|
4123
|
+
});
|
|
4124
|
+
this.zeroConf.on("resolved", (bonjourDevice) => this.onScanSuccess(bonjourDevice));
|
|
4125
|
+
this.zeroConf.on("error", (err) => this.onScanFailure(err));
|
|
4126
|
+
}
|
|
4127
|
+
onScanSuccess(bonjourDevice) {
|
|
4128
|
+
this.stop();
|
|
4129
|
+
logger.info("[DeviceFinder] Resolved bonjour device:", JSON.stringify(bonjourDevice, null, 2));
|
|
4130
|
+
if (this.discoveredDevices.some(({ name }) => name === bonjourDevice.name)) {
|
|
4131
|
+
logger.debug("[DeviceFinder] Resolved bonjour device already in list, skipping");
|
|
4132
|
+
return;
|
|
4133
|
+
}
|
|
4134
|
+
this.discoveredDevices.push(bonjourDevice);
|
|
4135
|
+
this.onSuccessCallback();
|
|
4136
|
+
}
|
|
4137
|
+
onScanFailure(e) {
|
|
4138
|
+
this.stop();
|
|
4139
|
+
logger.info("[DeviceFinder] Failed to scan for cameras:", e);
|
|
4140
|
+
this.onErrorCallback(tsCommon.toError(e));
|
|
4141
|
+
}
|
|
4142
|
+
start(timeoutMs) {
|
|
4143
|
+
this.stop();
|
|
4144
|
+
try {
|
|
4145
|
+
this.setupListeners();
|
|
4146
|
+
logger.info("[DeviceFinder] Starting scan for ionodes-media");
|
|
4147
|
+
this.zeroConf?.scan(this.type, this.protocol, this.domain);
|
|
4148
|
+
this.timerID = setTimeout(
|
|
4149
|
+
() => this.onScanFailure(new Error(`[DeviceFinder] timed out after ${timeoutMs}ms`)),
|
|
4150
|
+
timeoutMs
|
|
4151
|
+
);
|
|
4152
|
+
} catch (e) {
|
|
4153
|
+
this.onScanFailure(e);
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
stop() {
|
|
4157
|
+
try {
|
|
4158
|
+
this.zeroConf?.stop();
|
|
4159
|
+
} catch (e) {
|
|
4160
|
+
logger.error("[DeviceFinder] Error stopping scan:", e);
|
|
4161
|
+
} finally {
|
|
4162
|
+
this.reset();
|
|
4163
|
+
}
|
|
4164
|
+
}
|
|
4165
|
+
reset() {
|
|
4166
|
+
this.resetZeroConf();
|
|
4167
|
+
this.resetTimer();
|
|
4168
|
+
this.resetState();
|
|
4169
|
+
}
|
|
4170
|
+
resetZeroConf() {
|
|
4171
|
+
try {
|
|
4172
|
+
this.zeroConf?.removeDeviceListeners();
|
|
4173
|
+
} catch {
|
|
4174
|
+
} finally {
|
|
4175
|
+
this.zeroConf = null;
|
|
4176
|
+
}
|
|
4177
|
+
}
|
|
4178
|
+
resetTimer() {
|
|
4179
|
+
clearTimeout(this.timerID);
|
|
4180
|
+
this.timerID = void 0;
|
|
4181
|
+
}
|
|
4182
|
+
resetState() {
|
|
4183
|
+
this.discoveredDevices = [];
|
|
4184
|
+
this.isScanning = false;
|
|
4185
|
+
}
|
|
4186
|
+
};
|
|
4187
|
+
|
|
4188
|
+
// src/services/wifi/query-keys.ts
|
|
4189
|
+
var WifiDiagnoseQueryKey = {
|
|
4190
|
+
all: ["wifi-diagnose"],
|
|
4191
|
+
list: () => [...WifiDiagnoseQueryKey.all, "list"],
|
|
4192
|
+
details: () => [...WifiDiagnoseQueryKey.all, "details"]
|
|
4193
|
+
};
|
|
4194
|
+
var DEFAULT_CONNECT_WIFI_TIMEOUT = 10 * tsCommon.PeriodsInMS.oneSecond;
|
|
4195
|
+
var toWifiInfoArray = (networks) => {
|
|
4196
|
+
if (!Array.isArray(networks)) {
|
|
4197
|
+
return [];
|
|
4198
|
+
}
|
|
4199
|
+
return [...networks].map(toWifiInfo);
|
|
4200
|
+
};
|
|
4201
|
+
var toWifiInfo = (network) => {
|
|
4202
|
+
const { SSID, BSSID, level, capabilities, frequency, timestamp } = network;
|
|
4203
|
+
return {
|
|
4204
|
+
ssid: SSID,
|
|
4205
|
+
bssid: BSSID,
|
|
4206
|
+
signalStrength: Math.abs(level),
|
|
4207
|
+
capabilities,
|
|
4208
|
+
frequency,
|
|
4209
|
+
timestamp,
|
|
4210
|
+
isHidden: SSID === "(hidden SSID)"
|
|
4211
|
+
};
|
|
4212
|
+
};
|
|
4213
|
+
var randomIpSegment = () => Math.floor(Math.random() * 255);
|
|
4214
|
+
var randomLanIp = () => `192.168.${randomIpSegment()}.${randomIpSegment()}`;
|
|
4215
|
+
var fetchWifiInfosSimulator = async () => {
|
|
4216
|
+
await tsCommon.sleep(Math.random() * 100);
|
|
4217
|
+
const randomNumber = Math.floor(Math.random() * 100);
|
|
4218
|
+
return {
|
|
4219
|
+
signalStrength: randomNumber,
|
|
4220
|
+
ssid: `Simulated WiFi ${randomNumber}`,
|
|
4221
|
+
ip: randomLanIp()
|
|
4222
|
+
};
|
|
4223
|
+
};
|
|
4224
|
+
var fetchAvailableWifiListSimulator = async () => {
|
|
4225
|
+
await tsCommon.sleep(Math.random() * 100);
|
|
4226
|
+
const numberOfNetworks = Math.floor(Math.random() * 30) + 2;
|
|
4227
|
+
const networks = Array.from({ length: numberOfNetworks }, (_, index) => ({
|
|
4228
|
+
ssid: `Simulated WiFi ${index + 1}`,
|
|
4229
|
+
signalStrength: Math.floor(Math.random() * 100),
|
|
4230
|
+
ip: randomLanIp()
|
|
4231
|
+
}));
|
|
4232
|
+
return networks;
|
|
4233
|
+
};
|
|
4234
|
+
|
|
4235
|
+
// src/services/wifi/wifi-info.utils.ts
|
|
4236
|
+
var fetchWifiInfo = async () => {
|
|
4237
|
+
if (!isRealDevice()) {
|
|
4238
|
+
return fetchWifiInfosSimulator();
|
|
4239
|
+
}
|
|
4240
|
+
try {
|
|
4241
|
+
await requestLocationPermission();
|
|
4242
|
+
logger.info("[fetchWifiInfo] calling WifiManager.getCurrentWifiSSID");
|
|
4243
|
+
const [ssid, signalStrength, ip] = await Promise.all([
|
|
4244
|
+
WifiManager__default.default.getCurrentWifiSSID(),
|
|
4245
|
+
// the following methods are not implemented on all platforms:
|
|
4246
|
+
WifiManager__default.default.getCurrentSignalStrength?.(),
|
|
4247
|
+
WifiManager__default.default.getIP?.()
|
|
4248
|
+
]);
|
|
4249
|
+
return {
|
|
4250
|
+
ssid,
|
|
4251
|
+
signalStrength: Math.abs(signalStrength ?? 0),
|
|
4252
|
+
ip: ip ?? ""
|
|
4253
|
+
};
|
|
4254
|
+
} catch (e) {
|
|
4255
|
+
if (isDisconnectedOrConnecting(e)) {
|
|
4256
|
+
logger.info("[fetchWifiInfo] Cannot fetch WiFi info since state is either disconnected or connecting");
|
|
4257
|
+
} else {
|
|
4258
|
+
logger.error("[fetchWifiInfo] Error fetching WiFi info", e);
|
|
4259
|
+
}
|
|
4260
|
+
throw e;
|
|
4261
|
+
}
|
|
4262
|
+
};
|
|
4263
|
+
var isDisconnectedOrConnecting = (e) => {
|
|
4264
|
+
return e instanceof Error && e.message.toLowerCase().includes("not connected or connecting");
|
|
4265
|
+
};
|
|
4266
|
+
var isUnexpectedWifiConnectionError = (e) => {
|
|
4267
|
+
return !!e && !isDisconnectedOrConnecting(e);
|
|
4268
|
+
};
|
|
4269
|
+
var connectToWiFi = async ({
|
|
4270
|
+
ssid,
|
|
4271
|
+
password,
|
|
4272
|
+
isWEP = false,
|
|
4273
|
+
isHidden = false,
|
|
4274
|
+
timeout = DEFAULT_CONNECT_WIFI_TIMEOUT
|
|
4275
|
+
}) => {
|
|
4276
|
+
try {
|
|
4277
|
+
logger.info(`[connectToWiFi] attempting to connect to WiFi ${ssid}`);
|
|
4278
|
+
await WifiManager__default.default.connectToProtectedWifiSSID({ ssid, password, isWEP, isHidden, timeout });
|
|
4279
|
+
logger.info(`[connectToWiFi] Connected to WiFi ${ssid}`);
|
|
4280
|
+
} catch (e) {
|
|
4281
|
+
logger.info(`[connectToWiFi] Unable to connect to WiFi ${ssid}`, e);
|
|
4282
|
+
throw e;
|
|
4283
|
+
}
|
|
4284
|
+
};
|
|
4285
|
+
var disconnectFromWiFi = async () => {
|
|
4286
|
+
logger.info("[disconnectFromWiFi]: disconnecting from WiFi");
|
|
4287
|
+
try {
|
|
4288
|
+
const ssid = await WifiManager__default.default.getCurrentWifiSSID();
|
|
4289
|
+
logger.info(`[disconnectFromWiFi]: Current WiFi SSID: ${ssid}`);
|
|
4290
|
+
if (reactNative.Platform.OS === "ios") {
|
|
4291
|
+
await WifiManager__default.default.disconnectFromSSID(ssid);
|
|
4292
|
+
} else if (reactNative.Platform.OS === "android") {
|
|
4293
|
+
const result = await WifiManager__default.default.disconnect();
|
|
4294
|
+
logger.info(`[disconnectFromWiFi]: Disconnected from WiFi result: ${result}`);
|
|
4295
|
+
} else {
|
|
4296
|
+
logger.info(`[disconnectFromWiFi]: Unsupported platform: ${reactNative.Platform.OS}`);
|
|
4297
|
+
}
|
|
4298
|
+
logger.info("[disconnectFromWiFi]: Disconnected from WiFi ended.");
|
|
4299
|
+
} catch (e) {
|
|
4300
|
+
logger.error("[disconnectFromWiFi]: Error disconnecting from WiFi", e);
|
|
4301
|
+
throw e;
|
|
4302
|
+
}
|
|
4303
|
+
};
|
|
4304
|
+
var fetchAvailableWifiList = async () => {
|
|
4305
|
+
if (!isRealDevice()) {
|
|
4306
|
+
return fetchAvailableWifiListSimulator();
|
|
4307
|
+
}
|
|
4308
|
+
if (reactNative.Platform.OS === "ios") {
|
|
4309
|
+
logger.info("[fetchAvailableWifiList] returning empty array for iOS");
|
|
4310
|
+
return [];
|
|
4311
|
+
}
|
|
4312
|
+
try {
|
|
4313
|
+
await requestLocationPermission();
|
|
4314
|
+
logger.info("[fetchAvailableWifiList] calling WifiManager.loadWifiList");
|
|
4315
|
+
const networks = await WifiManager__default.default.loadWifiList();
|
|
4316
|
+
if (Array.isArray(networks)) {
|
|
4317
|
+
return toWifiInfoArray(networks);
|
|
4318
|
+
}
|
|
4319
|
+
logger.info("[fetchAvailableWifiList] 2nd try: calling WifiManager.reScanAndLoadWifiList");
|
|
4320
|
+
const networks2ndTry = await WifiManager__default.default.reScanAndLoadWifiList();
|
|
4321
|
+
return toWifiInfoArray(networks2ndTry);
|
|
4322
|
+
} catch (e) {
|
|
4323
|
+
logger.error("[fetchAvailableWifiList] Error fetching available WiFi list", e);
|
|
4324
|
+
throw e;
|
|
4325
|
+
}
|
|
4326
|
+
};
|
|
4327
|
+
var requestLocationPermission = async () => {
|
|
4328
|
+
const currentStatus = await Location__namespace.getForegroundPermissionsAsync();
|
|
4329
|
+
if (currentStatus.status === "granted") {
|
|
4330
|
+
return;
|
|
4331
|
+
}
|
|
4332
|
+
logger.info("[requestLocationPermission] requesting location permission");
|
|
4333
|
+
const { status } = await Location__namespace.requestForegroundPermissionsAsync();
|
|
4334
|
+
logger.info(`[requestLocationPermission] location permission requested, result: ${status}`);
|
|
4335
|
+
if (status !== "granted") {
|
|
4336
|
+
throw new Error(`Location permission not granted: ${status}`);
|
|
4337
|
+
}
|
|
4338
|
+
};
|
|
4339
|
+
|
|
4340
|
+
// src/services/wifi/use-wifi-info.ts
|
|
4341
|
+
var REFRESH_INTERVAL = 30 * 1e3;
|
|
4342
|
+
var wifiInfoRetryStrategy = (failureCount, error) => {
|
|
4343
|
+
if (isDisconnectedOrConnecting(error) && failureCount < 3) {
|
|
4344
|
+
logger.info(`[useWifiInfo]: retrying, failureCount: ${failureCount}`);
|
|
4345
|
+
return true;
|
|
4346
|
+
}
|
|
4347
|
+
logger.info(`[useWifiInfo]: not retrying, failureCount: ${failureCount}`);
|
|
4348
|
+
return false;
|
|
4349
|
+
};
|
|
4350
|
+
var useWifiInfo = () => {
|
|
4351
|
+
const { data, isLoading, isFetching, isError, error, ...rest } = reactQuery.useQuery({
|
|
4352
|
+
queryKey: WifiDiagnoseQueryKey.details(),
|
|
4353
|
+
queryFn: fetchWifiInfo,
|
|
4354
|
+
refetchInterval: REFRESH_INTERVAL,
|
|
4355
|
+
retry: wifiInfoRetryStrategy,
|
|
4356
|
+
retryDelay: (failureCount) => failureCount * 1e3
|
|
4357
|
+
});
|
|
4358
|
+
return {
|
|
4359
|
+
wifiInfo: data,
|
|
4360
|
+
isLoadingWiFiInfos: isLoading,
|
|
4361
|
+
isFetchingWiFiInfos: isFetching,
|
|
4362
|
+
isErrorWiFiInfos: isError,
|
|
4363
|
+
errorWiFiInfos: error,
|
|
4364
|
+
...rest
|
|
4365
|
+
};
|
|
4366
|
+
};
|
|
4367
|
+
var useLoadAvailableWifiList = () => {
|
|
4368
|
+
const { data, isLoading, isFetching, isError, error, ...rest } = reactQuery.useQuery({
|
|
4369
|
+
queryKey: WifiDiagnoseQueryKey.list(),
|
|
4370
|
+
queryFn: fetchAvailableWifiList,
|
|
4371
|
+
refetchInterval: REFRESH_INTERVAL,
|
|
4372
|
+
retry: false
|
|
4373
|
+
});
|
|
4374
|
+
return {
|
|
4375
|
+
availableNetworks: data ?? [],
|
|
4376
|
+
hasAvailableNetworks: !!data?.length,
|
|
4377
|
+
isLoadingNetworks: isLoading,
|
|
4378
|
+
isFetchingNetworks: isFetching,
|
|
4379
|
+
isErrorNetworks: isError,
|
|
4380
|
+
errorNetworks: error,
|
|
4381
|
+
...rest
|
|
4382
|
+
};
|
|
4383
|
+
};
|
|
4384
|
+
var useConnectToWifiMutation = () => {
|
|
4385
|
+
const queryClient2 = reactQuery.useQueryClient();
|
|
4386
|
+
const { t } = reactI18next.useTranslation();
|
|
4387
|
+
const { mutateAsync, isPending, isError, error, isSuccess, ...rest } = reactQuery.useMutation({
|
|
4388
|
+
mutationFn: connectToWiFi,
|
|
4389
|
+
onSuccess: () => queryClient2.clear(),
|
|
4390
|
+
onError: (e) => {
|
|
4391
|
+
const title = t("common:error");
|
|
4392
|
+
const message = t("common:wifi.connectError", { error: e?.message });
|
|
4393
|
+
reactNative.Alert.alert(title, message);
|
|
4394
|
+
}
|
|
4395
|
+
});
|
|
4396
|
+
return {
|
|
4397
|
+
connectToWiFi: mutateAsync,
|
|
4398
|
+
isConnectingToWiFi: isPending,
|
|
4399
|
+
isErrorConnectingToWiFi: isError,
|
|
4400
|
+
errorConnectingToWiFi: error,
|
|
4401
|
+
isSuccessConnectingToWiFi: isSuccess,
|
|
4402
|
+
...rest
|
|
4403
|
+
};
|
|
4404
|
+
};
|
|
4405
|
+
var useDisconnectFromWifiMutation = () => {
|
|
4406
|
+
const queryClient2 = reactQuery.useQueryClient();
|
|
4407
|
+
const { mutateAsync, isPending, isError, error, isSuccess, ...rest } = reactQuery.useMutation({
|
|
4408
|
+
mutationFn: disconnectFromWiFi,
|
|
4409
|
+
onSuccess: () => queryClient2.clear()
|
|
4410
|
+
});
|
|
4411
|
+
return {
|
|
4412
|
+
disconnectFromWiFi: mutateAsync,
|
|
4413
|
+
isDisconnectingFromWiFi: isPending,
|
|
4414
|
+
isErrorDisconnectingFromWiFi: isError,
|
|
4415
|
+
errorDisconnectingFromWiFi: error,
|
|
4416
|
+
isSuccessDisconnectingFromWiFi: isSuccess,
|
|
4417
|
+
...rest
|
|
4418
|
+
};
|
|
4419
|
+
};
|
|
4420
|
+
var useWifiInfosErrorSnackbar = () => {
|
|
4421
|
+
const { t } = reactI18next.useTranslation();
|
|
4422
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
4423
|
+
const { errorWiFiInfos } = useWifiInfo();
|
|
4424
|
+
react.useEffect(() => {
|
|
4425
|
+
if (isUnexpectedWifiConnectionError(errorWiFiInfos)) {
|
|
4426
|
+
const message = t("common:wifi.currentNetworkRetrievalError", { error: tsCommon.getErrorMessage(errorWiFiInfos) });
|
|
4427
|
+
showSnackbarMessage(message);
|
|
4428
|
+
}
|
|
4429
|
+
}, [errorWiFiInfos, t, showSnackbarMessage]);
|
|
4430
|
+
};
|
|
4431
|
+
var useLoadAvailableWifiListErrorSnackbar = () => {
|
|
4432
|
+
const { t } = reactI18next.useTranslation();
|
|
4433
|
+
const { showSnackbarMessage } = useSnackbar();
|
|
4434
|
+
const { isErrorNetworks, errorNetworks } = useLoadAvailableWifiList();
|
|
4435
|
+
react.useEffect(() => {
|
|
4436
|
+
if (isErrorNetworks) {
|
|
4437
|
+
const message = t("common:wifi.availableNetworksRetrievalError", { error: errorNetworks?.message });
|
|
4438
|
+
showSnackbarMessage(message);
|
|
4439
|
+
}
|
|
4440
|
+
}, [isErrorNetworks, errorNetworks, t, showSnackbarMessage]);
|
|
4441
|
+
};
|
|
4442
|
+
var queryClient = new reactQuery.QueryClient();
|
|
4443
|
+
var TanstackQueryProvider = ({ children }) => {
|
|
4444
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children });
|
|
4445
|
+
};
|
|
4446
|
+
var WifiInfosContext = react.createContext(void 0);
|
|
4447
|
+
var WifiInfosProvider = mobxReactLite.observer(({ children }) => {
|
|
4448
|
+
const queryClient2 = reactQuery.useQueryClient();
|
|
4449
|
+
const value = useWifiInfo();
|
|
4450
|
+
useWifiInfosErrorSnackbar();
|
|
4451
|
+
const prevAppStatusRef = react.useRef(commonStore.appStatus);
|
|
4452
|
+
react.useEffect(() => {
|
|
4453
|
+
const newAppStatus = commonStore.appStatus;
|
|
4454
|
+
const prevAppStatus = prevAppStatusRef.current;
|
|
4455
|
+
const hasChangedToActive = newAppStatus === "active" && prevAppStatus !== "active";
|
|
4456
|
+
if (hasChangedToActive) {
|
|
4457
|
+
logger.info("[WifiInfosProvider] App status changed to active, invalidating wifi infos queries");
|
|
4458
|
+
queryClient2.invalidateQueries({ queryKey: WifiDiagnoseQueryKey.details() });
|
|
4459
|
+
}
|
|
4460
|
+
prevAppStatusRef.current = newAppStatus;
|
|
4461
|
+
}, [queryClient2, commonStore.appStatus]);
|
|
4462
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WifiInfosContext.Provider, { value, children });
|
|
4463
|
+
});
|
|
4464
|
+
var useWifiInfosContext = () => {
|
|
4465
|
+
const context = react.useContext(WifiInfosContext);
|
|
4466
|
+
if (context === void 0) {
|
|
4467
|
+
throw new Error("useWifiInfosContext must be used within a WifiInfosProvider");
|
|
4468
|
+
}
|
|
4469
|
+
return context;
|
|
4470
|
+
};
|
|
4471
|
+
|
|
4472
|
+
exports.ActivityProgressBar = ActivityProgressBar;
|
|
4473
|
+
exports.ActivityProgressBarStats = ActivityProgressBarStats;
|
|
4474
|
+
exports.BARCODE_TYPES = BARCODE_TYPES;
|
|
4475
|
+
exports.BarcodeScanner = BarcodeScanner;
|
|
4476
|
+
exports.BarcodeScannerDialog = BarcodeScannerDialog;
|
|
4477
|
+
exports.BatteryLevel = BatteryLevel;
|
|
4478
|
+
exports.CodeTag = CodeTag;
|
|
4479
|
+
exports.DARK_COLORS_SCHEME = DARK_COLORS_SCHEME;
|
|
4480
|
+
exports.DARK_THEME = DARK_THEME;
|
|
4481
|
+
exports.DEFAULT_CONNECT_WIFI_TIMEOUT = DEFAULT_CONNECT_WIFI_TIMEOUT;
|
|
4482
|
+
exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
|
|
4483
|
+
exports.DEFAULT_SHEET_SNAP_POINTS = DEFAULT_SHEET_SNAP_POINTS;
|
|
4484
|
+
exports.DefaultBackdrop = DefaultBackdrop;
|
|
4485
|
+
exports.DefaultSheetBackground = DefaultSheetBackground;
|
|
4486
|
+
exports.DeviceFinder = DeviceFinder;
|
|
4487
|
+
exports.DialogCloseOnly = DialogCloseOnly;
|
|
4488
|
+
exports.DialogOkCancel = DialogOkCancel;
|
|
4489
|
+
exports.DialogSingleTextInput = DialogSingleTextInput;
|
|
4490
|
+
exports.DialogSyntaxColorResult = DialogSyntaxColorResult;
|
|
4491
|
+
exports.DigestAuth = DigestAuth;
|
|
4492
|
+
exports.DropDownSelector = DropDownSelector;
|
|
4493
|
+
exports.EncodingType = EncodingType;
|
|
4494
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
4495
|
+
exports.ErrorBoundaryScreen = ErrorBoundaryScreen;
|
|
4496
|
+
exports.ErrorDetails = ErrorDetails;
|
|
4497
|
+
exports.EventLogsScreen = EventLogsScreen;
|
|
4498
|
+
exports.FullCentered = FullCentered;
|
|
4499
|
+
exports.FullCenteredSpinner = FullCenteredSpinner;
|
|
4500
|
+
exports.HeaderBackButton = HeaderBackButton;
|
|
4501
|
+
exports.HeaderButton = HeaderButton;
|
|
4502
|
+
exports.HorizontalResizableSplitView = HorizontalResizableSplitView;
|
|
4503
|
+
exports.LIGHT_COLORS_SCHEME = LIGHT_COLORS_SCHEME;
|
|
4504
|
+
exports.LIGHT_THEME = LIGHT_THEME;
|
|
4505
|
+
exports.LOG_LEVELS = LOG_LEVELS;
|
|
4506
|
+
exports.LanguageSelector = LanguageSelector;
|
|
4507
|
+
exports.LanguageSelectorMenu = LanguageSelectorMenu;
|
|
4508
|
+
exports.LanguageSelectorSegmented = LanguageSelectorSegmented;
|
|
4509
|
+
exports.ListHeader = ListHeader;
|
|
4510
|
+
exports.ListItemsSeparator = ListItemsSeparator;
|
|
4511
|
+
exports.LogEntryItem = LogEntryItem;
|
|
4512
|
+
exports.LogEntryItemSuffix = LogEntryItemSuffix;
|
|
4513
|
+
exports.LogsViewer = LogsViewer;
|
|
4514
|
+
exports.ModalSpinner = ModalSpinner;
|
|
4515
|
+
exports.NAVIGATION_DARK = NAVIGATION_DARK;
|
|
4516
|
+
exports.NAVIGATION_LIGHT = NAVIGATION_LIGHT;
|
|
4517
|
+
exports.NativeFileSystem = NativeFileSystem;
|
|
4518
|
+
exports.OnOffToggle = OnOffToggle;
|
|
4519
|
+
exports.OrientationAwareTabButton = OrientationAwareTabButton;
|
|
4520
|
+
exports.OrientationAwareTabsLayout = OrientationAwareTabsLayout;
|
|
4521
|
+
exports.PasswordInput = PasswordInput;
|
|
4522
|
+
exports.PreTag = PreTag;
|
|
4523
|
+
exports.ResizableOverlayView = ResizableOverlayView;
|
|
4524
|
+
exports.SUPPORTED_LANGUAGES = SUPPORTED_LANGUAGES;
|
|
4525
|
+
exports.SafeContainer = SafeContainer;
|
|
4526
|
+
exports.SnackbarContext = SnackbarContext;
|
|
4527
|
+
exports.SnackbarDurationsMs = SnackbarDurationsMs;
|
|
4528
|
+
exports.SnackbarProvider = SnackbarProvider;
|
|
4529
|
+
exports.SyntaxColoring = SyntaxColoring;
|
|
4530
|
+
exports.TabBarIcon = TabBarIcon;
|
|
4531
|
+
exports.TanstackQueryProvider = TanstackQueryProvider;
|
|
4532
|
+
exports.VerticalResizableSplitView = VerticalResizableSplitView;
|
|
4533
|
+
exports.VoiceRecognitionTextInput = VoiceRecognitionTextInput;
|
|
4534
|
+
exports.WifiDiagnoseQueryKey = WifiDiagnoseQueryKey;
|
|
4535
|
+
exports.WifiInfosContext = WifiInfosContext;
|
|
4536
|
+
exports.WifiInfosProvider = WifiInfosProvider;
|
|
4537
|
+
exports.applyFilenameTemplate = applyFilenameTemplate;
|
|
4538
|
+
exports.askConfirmation = askConfirmation;
|
|
4539
|
+
exports.axiosInstance = axiosInstance;
|
|
4540
|
+
exports.base64Decode = base64Decode;
|
|
4541
|
+
exports.base64Encode = base64Encode;
|
|
4542
|
+
exports.buildAdditionalContextData = buildAdditionalContextData;
|
|
4543
|
+
exports.buildFinalValue = buildFinalValue;
|
|
4544
|
+
exports.commonLogsStore = commonLogsStore;
|
|
4545
|
+
exports.commonLogsStoreTransport = commonLogsStoreTransport;
|
|
4546
|
+
exports.commonStore = commonStore;
|
|
4547
|
+
exports.computeActivityProgress = computeActivityProgress;
|
|
4548
|
+
exports.connectToWiFi = connectToWiFi;
|
|
4549
|
+
exports.convertImageToBase64 = convertImageToBase64;
|
|
4550
|
+
exports.createDbFolderUri = createDbFolderUri;
|
|
4551
|
+
exports.createDbInstance = createDbInstance;
|
|
4552
|
+
exports.createDirectoryStructure = createDirectoryStructure;
|
|
4553
|
+
exports.dateToISOLikeButLocal = dateToISOLikeButLocal;
|
|
4554
|
+
exports.deleteAllLogFiles = deleteAllLogFiles;
|
|
4555
|
+
exports.deleteFile = deleteFile;
|
|
4556
|
+
exports.detectLanguage = detectLanguage;
|
|
4557
|
+
exports.disconnectFromWiFi = disconnectFromWiFi;
|
|
4558
|
+
exports.ensureVoiceRecognitionPermissions = ensureVoiceRecognitionPermissions;
|
|
4559
|
+
exports.fetchAvailableWifiList = fetchAvailableWifiList;
|
|
4560
|
+
exports.fetchAvailableWifiListSimulator = fetchAvailableWifiListSimulator;
|
|
4561
|
+
exports.fetchWifiInfo = fetchWifiInfo;
|
|
4562
|
+
exports.fetchWifiInfosSimulator = fetchWifiInfosSimulator;
|
|
4563
|
+
exports.formatLogMessage = formatLogMessage;
|
|
4564
|
+
exports.getAppIdentifier = getAppIdentifier;
|
|
4565
|
+
exports.getBatteryColor = getBatteryColor;
|
|
4566
|
+
exports.getBatteryIcon = getBatteryIcon;
|
|
4567
|
+
exports.getDeviceType = getDeviceType;
|
|
4568
|
+
exports.getDirectoryOnly = getDirectoryOnly;
|
|
4569
|
+
exports.getDocumentFolderRelativePath = getDocumentFolderRelativePath;
|
|
4570
|
+
exports.getDocumentFullFilename = getDocumentFullFilename;
|
|
4571
|
+
exports.getEnvVarsSource = getEnvVarsSource;
|
|
4572
|
+
exports.getFileExtensionOnly = getFileExtensionOnly;
|
|
4573
|
+
exports.getFilenameOnly = getFilenameOnly;
|
|
4574
|
+
exports.getFilenameWithoutExtension = getFilenameWithoutExtension;
|
|
4575
|
+
exports.getMonospaceFontName = getMonospaceFontName;
|
|
4576
|
+
exports.getPermissionMessage = getPermissionMessage;
|
|
4577
|
+
exports.getSQLiteVersion = getSQLiteVersion;
|
|
4578
|
+
exports.getSentryDns = getSentryDns;
|
|
4579
|
+
exports.getUniqueDbFilename = getUniqueDbFilename;
|
|
4580
|
+
exports.hasExtension = hasExtension;
|
|
4581
|
+
exports.hasFileSeparator = hasFileSeparator;
|
|
4582
|
+
exports.htmlDocumentMessage = htmlDocumentMessage;
|
|
4583
|
+
exports.htmlDocumentRawMessage = htmlDocumentRawMessage;
|
|
4584
|
+
exports.initCommonI18N = initCommonI18N;
|
|
4585
|
+
exports.isAxiosNetworkError = isAxiosNetworkError;
|
|
4586
|
+
exports.isDevelopment = isDevelopment;
|
|
4587
|
+
exports.isDisconnectedOrConnecting = isDisconnectedOrConnecting;
|
|
4588
|
+
exports.isEmulator = isEmulator;
|
|
4589
|
+
exports.isFileExists = isFileExists;
|
|
4590
|
+
exports.isFileUri = isFileUri;
|
|
4591
|
+
exports.isPreview = isPreview;
|
|
4592
|
+
exports.isProduction = isProduction;
|
|
4593
|
+
exports.isRealDevice = isRealDevice;
|
|
4594
|
+
exports.isSentryActivated = isSentryActivated;
|
|
4595
|
+
exports.isUnexpectedWifiConnectionError = isUnexpectedWifiConnectionError;
|
|
4596
|
+
exports.isValidIpAddressV4 = isValidIpAddressV4;
|
|
4597
|
+
exports.languageDetector = languageDetector;
|
|
4598
|
+
exports.loadAllLogFilesInfo = loadAllLogFilesInfo;
|
|
4599
|
+
exports.loadCurrentLogsFileUri = loadCurrentLogsFileUri;
|
|
4600
|
+
exports.loadSelectedLanguage = loadSelectedLanguage;
|
|
4601
|
+
exports.loadTextContent = loadTextContent;
|
|
4602
|
+
exports.logIncomingHtmlDocMessage = logIncomingHtmlDocMessage;
|
|
4603
|
+
exports.logRequestEnd = logRequestEnd;
|
|
4604
|
+
exports.logRequestStart = logRequestStart;
|
|
4605
|
+
exports.loggedError = loggedError;
|
|
4606
|
+
exports.logger = logger;
|
|
4607
|
+
exports.mmkvStorageForMobxPersist = mmkvStorageForMobxPersist;
|
|
4608
|
+
exports.nativeFileSystem = nativeFileSystem;
|
|
4609
|
+
exports.normalizeFileUri = normalizeFileUri;
|
|
4610
|
+
exports.notImplementedYet = notImplementedYet;
|
|
4611
|
+
exports.nowAsIsoFilename = nowAsIsoFilename;
|
|
4612
|
+
exports.nowToISOLikeButLocal = nowToISOLikeButLocal;
|
|
4613
|
+
exports.nowToISOLikeButLocalForFilename = nowToISOLikeButLocalForFilename;
|
|
4614
|
+
exports.openWifiSettings = openWifiSettings;
|
|
4615
|
+
exports.openWifiSettingsAndroid = openWifiSettingsAndroid;
|
|
4616
|
+
exports.openWifiSettingsIos = openWifiSettingsIos;
|
|
4617
|
+
exports.parseLicenceData = parseLicenceData;
|
|
4618
|
+
exports.pickSingleFile = pickSingleFile;
|
|
4619
|
+
exports.queryClient = queryClient;
|
|
4620
|
+
exports.requestCameraPermissions = requestCameraPermissions;
|
|
4621
|
+
exports.requestLocationPermission = requestLocationPermission;
|
|
4622
|
+
exports.requestMediaLibPermissions = requestMediaLibPermissions;
|
|
4623
|
+
exports.requestTakePhotoPermissions = requestTakePhotoPermissions;
|
|
4624
|
+
exports.sanitizeUrl = sanitizeUrl;
|
|
4625
|
+
exports.saveTextContent = saveTextContent;
|
|
4626
|
+
exports.setClipboardTextContent = setClipboardTextContent;
|
|
4627
|
+
exports.shareCurrentLogsFile = shareCurrentLogsFile;
|
|
4628
|
+
exports.shareFile = shareFile;
|
|
4629
|
+
exports.shareTextFile = shareTextFile;
|
|
4630
|
+
exports.shareXmlFile = shareXmlFile;
|
|
4631
|
+
exports.startNetworkStateLogging = startNetworkStateLogging;
|
|
4632
|
+
exports.storage = storage;
|
|
4633
|
+
exports.storeSelectedLanguage = storeSelectedLanguage;
|
|
4634
|
+
exports.styles = styles2;
|
|
4635
|
+
exports.toLogLevel = toLogLevel;
|
|
4636
|
+
exports.toSinglePictureUri = toSinglePictureUri;
|
|
4637
|
+
exports.toWifiInfo = toWifiInfo;
|
|
4638
|
+
exports.toWifiInfoArray = toWifiInfoArray;
|
|
4639
|
+
exports.useAppTheme = useAppTheme;
|
|
4640
|
+
exports.useAutoScroll = useAutoScroll;
|
|
4641
|
+
exports.useBottomSheetToggler = useBottomSheetToggler;
|
|
4642
|
+
exports.useCameraImagePicker = useCameraImagePicker;
|
|
4643
|
+
exports.useConnectToWifiMutation = useConnectToWifiMutation;
|
|
4644
|
+
exports.useDialogStyles = useDialogStyles;
|
|
4645
|
+
exports.useDisconnectFromWifiMutation = useDisconnectFromWifiMutation;
|
|
4646
|
+
exports.useErrorDetails = useErrorDetails;
|
|
4647
|
+
exports.useImagePicker = useImagePicker;
|
|
4648
|
+
exports.useInvalidateQueriesOnFocus = useInvalidateQueriesOnFocus;
|
|
4649
|
+
exports.useIsDarkMode = useIsDarkMode;
|
|
4650
|
+
exports.useIsLandscape = useIsLandscape;
|
|
4651
|
+
exports.useLoadAvailableWifiList = useLoadAvailableWifiList;
|
|
4652
|
+
exports.useLoadAvailableWifiListErrorSnackbar = useLoadAvailableWifiListErrorSnackbar;
|
|
4653
|
+
exports.useLogEntryColor = useLogEntryColor;
|
|
4654
|
+
exports.useLogsActions = useLogsActions;
|
|
4655
|
+
exports.useOnHtmlDocMessage = useOnHtmlDocMessage;
|
|
4656
|
+
exports.useSingleFileSelector = useSingleFileSelector;
|
|
4657
|
+
exports.useSnackbar = useSnackbar;
|
|
4658
|
+
exports.useTimeoutState = useTimeoutState;
|
|
4659
|
+
exports.useTimeoutToggle = useTimeoutToggle;
|
|
4660
|
+
exports.useUpdates = useUpdates2;
|
|
4661
|
+
exports.useWifiInfo = useWifiInfo;
|
|
4662
|
+
exports.useWifiInfosContext = useWifiInfosContext;
|
|
4663
|
+
exports.useWifiInfosErrorSnackbar = useWifiInfosErrorSnackbar;
|
|
4664
|
+
exports.useWindowOrientation = useWindowOrientation;
|
|
4665
|
+
exports.validateGetRandomValues = validateGetRandomValues;
|
|
4666
|
+
//# sourceMappingURL=index.js.map
|
|
10
4667
|
//# sourceMappingURL=index.js.map
|