@corva/ui 3.78.0-1 → 3.78.0-11
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/cjs-bundle/clients/index.js +1 -1
- package/cjs-bundle/clients/index.js.map +1 -1
- package/cjs-bundle/clients/subscriptions/constants.js +1 -1
- package/cjs-bundle/clients/subscriptions/constants.js.map +1 -1
- package/cjs-bundle/clients/subscriptions.js +1 -1
- package/cjs-bundle/clients/subscriptions.js.map +1 -1
- package/cjs-bundle/components/AddComment/Popover.js +1 -1
- package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
- package/cjs-bundle/components/AssetEditor/effects/index.js +1 -1
- package/cjs-bundle/components/AssetEditor/effects/index.js.map +1 -1
- package/cjs-bundle/components/AssetEditorV2/effects/index.js +1 -1
- package/cjs-bundle/components/AssetEditorV2/effects/index.js.map +1 -1
- package/cjs-bundle/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js +1 -1
- package/cjs-bundle/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js.map +1 -1
- package/cjs-bundle/components/Attachment/index.js +1 -1
- package/cjs-bundle/components/Attachment/index.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/CollapsableSidebar.js +1 -1
- package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js.map +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js.map +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
- package/cjs-bundle/components/GradientManager/GradientManager.js +1 -1
- package/cjs-bundle/components/GradientManager/GradientManager.js.map +1 -1
- package/cjs-bundle/components/GradientManager/GradientSelect.js +1 -1
- package/cjs-bundle/components/GradientManager/GradientSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/OffsetWellPickerDialog.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsData.utils.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsData.utils.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsFetch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsFetch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyProvider.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyProvider.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useFetchSubjectWell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useFetchSubjectWell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useSearchedWells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useSearchedWells.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useAllWells/useLoadAllWellsCallback.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useAllWells/useLoadAllWellsCallback.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useCompanies.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useCompanies.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useExternalOffsets.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useExternalOffsets.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useIsAdmin.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useIsAdmin.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/usePinnedWells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/usePinnedWells.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map +1 -1
- package/cjs-bundle/components/PadModeSelect/effects/useWellStreamActivityTypeSubscription.js +1 -1
- package/cjs-bundle/components/PadModeSelect/effects/useWellStreamActivityTypeSubscription.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/cjs-bundle/components/PinnableFilters/effects/index.js +1 -1
- package/cjs-bundle/components/PinnableFilters/effects/index.js.map +1 -1
- package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
- package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAlertsTooltip.js.map +1 -1
- package/cjs-bundle/components/index.js +1 -1
- package/cjs-bundle/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js +1 -1
- package/cjs-bundle/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js.map +1 -1
- package/cjs-bundle/componentsV2/AppFooter/DqPopover/DqPopover.js +1 -1
- package/cjs-bundle/componentsV2/AppFooter/DqPopover/DqPopover.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/AppAssets/utils.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/AppAssets/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js.map +1 -1
- package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
- package/cjs-bundle/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/AutocompleteInput/AutocompleteInput.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/AutocompleteInput/AutocompleteInput.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/cjs-bundle/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js +1 -1
- package/cjs-bundle/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js.map +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/PublishModal/PublishModal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/PublishModal/PublishModal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/utils.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Store/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.js.map +1 -1
- package/cjs-bundle/componentsV2/TextInputBase/TextInputBase.js +1 -1
- package/cjs-bundle/componentsV2/TextInputBase/TextInputBase.js.map +1 -1
- package/cjs-bundle/componentsV2/TextInputNext/TextInputNext.js +1 -1
- package/cjs-bundle/componentsV2/TextInputNext/TextInputNext.js.map +1 -1
- package/cjs-bundle/config/theme/palette.mjs.js +1 -1
- package/cjs-bundle/config/theme/palette.mjs.js.map +1 -1
- package/cjs-bundle/effects/index.js +1 -1
- package/cjs-bundle/effects/subscriptions/fetchInitialSubscriptionsData.js +2 -0
- package/cjs-bundle/effects/subscriptions/fetchInitialSubscriptionsData.js.map +1 -0
- package/cjs-bundle/effects/subscriptions/useSubscriptions.v2.js +1 -1
- package/cjs-bundle/effects/subscriptions/useSubscriptions.v2.js.map +1 -1
- package/cjs-bundle/effects/useGlobalOffsetWellsSync.js +1 -1
- package/cjs-bundle/effects/useGlobalOffsetWellsSync.js.map +1 -1
- package/cjs-bundle/effects/useSubscriptions.js +1 -1
- package/cjs-bundle/effects/useSubscriptions.js.map +1 -1
- package/cjs-bundle/effects/useWellnessAlerts.js +1 -1
- package/cjs-bundle/effects/useWellnessAlerts.js.map +1 -1
- package/cjs-bundle/icons/customIcons/icons/Search.js.map +1 -1
- package/cjs-bundle/permissions/constants/index.js +1 -1
- package/cjs-bundle/permissions/constants/index.js.map +1 -1
- package/cjs-bundle/styles/generatedThemesVariables.global.css.js +1 -1
- package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js +1 -1
- package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
- package/cjs-bundle/utils/index.js +1 -1
- package/cjs-bundle/utils/index.js.map +1 -1
- package/cjs-bundle/utils/safeTemplate.js +2 -0
- package/cjs-bundle/utils/safeTemplate.js.map +1 -0
- package/clients/index.d.ts +1 -9
- package/clients/index.d.ts.map +1 -1
- package/clients/index.js +1 -1
- package/clients/index.js.map +1 -1
- package/clients/subscriptions/constants.d.ts +0 -1
- package/clients/subscriptions/constants.d.ts.map +1 -1
- package/clients/subscriptions/constants.js +1 -1
- package/clients/subscriptions/constants.js.map +1 -1
- package/clients/subscriptions.d.ts.map +1 -1
- package/clients/subscriptions.js +1 -1
- package/clients/subscriptions.js.map +1 -1
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/AssetEditor/effects/index.js +1 -1
- package/components/AssetEditor/effects/index.js.map +1 -1
- package/components/AssetEditorV2/effects/index.js +1 -1
- package/components/AssetEditorV2/effects/index.js.map +1 -1
- package/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js +1 -1
- package/components/AssetEditorV2/effects/usePrimaryAssetSelectData.js.map +1 -1
- package/components/Attachment/index.js +1 -1
- package/components/Attachment/index.js.map +1 -1
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/CollapsableSidebar.js +1 -1
- package/components/CollapsableSidebar.js.map +1 -1
- package/components/CommentComposer/CommentComposer.js +1 -1
- package/components/CommentComposer/CommentComposer.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus.js.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js.map +1 -1
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.d.ts +2 -2
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/components/FeedItem/FeedItem.js +1 -1
- package/components/FeedItem/FeedItem.js.map +1 -1
- package/components/GradientManager/GradientManager.js +1 -1
- package/components/GradientManager/GradientManager.js.map +1 -1
- package/components/GradientManager/GradientSelect.js +1 -1
- package/components/GradientManager/GradientSelect.js.map +1 -1
- package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
- package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
- package/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
- package/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/UserSettingsWrapper/UserSettingsWrapper.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsData.utils.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsData.utils.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsFetch.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/hooks/useAssetsFetch.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricCell/MetricCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useAdvancedSearchHandler.js.map +1 -1
- package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
- package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useAdvancedWells.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyMetricKey.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyProvider.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useCompanyProvider.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useFetchSubjectWell.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useFetchSubjectWell.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useSearchedWells.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useSearchedWells.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useAllWells/useLoadAllWellsCallback.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useAllWells/useLoadAllWellsCallback.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useCompanies.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useCompanies.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useExternalOffsets.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useExternalOffsets.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useIsAdmin.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useIsAdmin.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/usePinnedWells.js +1 -1
- package/components/OffsetWellPickerV5/hooks/usePinnedWells.js.map +1 -1
- package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js +1 -1
- package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map +1 -1
- package/components/PadModeSelect/effects/useWellStreamActivityTypeSubscription.js +1 -1
- package/components/PadModeSelect/effects/useWellStreamActivityTypeSubscription.js.map +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/components/PinnableFilters/effects/index.js +1 -1
- package/components/PinnableFilters/effects/index.js.map +1 -1
- package/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
- package/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.d.ts.map +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js +1 -1
- package/components/StatusBadge/components/DQAlertsTooltip.js.map +1 -1
- package/components/index.js +1 -1
- package/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.d.ts.map +1 -1
- package/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js +1 -1
- package/componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.js.map +1 -1
- package/componentsV2/AppFooter/DqPopover/DqPopover.js +1 -1
- package/componentsV2/AppFooter/DqPopover/DqPopover.js.map +1 -1
- package/componentsV2/AppHeader/AppAssets/utils.js +1 -1
- package/componentsV2/AppHeader/AppAssets/utils.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
- package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js.map +1 -1
- package/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js +1 -1
- package/componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js.map +1 -1
- package/componentsV2/AppPanel/AppPanelDisplay.js +1 -1
- package/componentsV2/AppPanel/AppPanelDisplay.js.map +1 -1
- package/componentsV2/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/componentsV2/Autocomplete/Autocomplete.js +1 -1
- package/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteInput/AutocompleteInput.d.ts.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteInput/AutocompleteInput.js +1 -1
- package/componentsV2/Autocomplete/AutocompleteInput/AutocompleteInput.js.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteNext.stories.d.ts +1 -0
- package/componentsV2/Autocomplete/AutocompleteNext.stories.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js +1 -1
- package/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js.map +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
- package/componentsV2/TemplatesControl/PublishModal/PublishModal.js +1 -1
- package/componentsV2/TemplatesControl/PublishModal/PublishModal.js.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js +1 -1
- package/componentsV2/TemplatesControl/Store/hooks/usePublishTemplate.js.map +1 -1
- package/componentsV2/TemplatesControl/Store/utils.d.ts +7 -0
- package/componentsV2/TemplatesControl/Store/utils.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/Store/utils.js +1 -1
- package/componentsV2/TemplatesControl/Store/utils.js.map +1 -1
- package/componentsV2/TemplatesControl/Toggle/Toggle.js +1 -1
- package/componentsV2/TemplatesControl/Toggle/Toggle.js.map +1 -1
- package/componentsV2/TextInputBase/TextInputBase.js +1 -1
- package/componentsV2/TextInputBase/TextInputBase.js.map +1 -1
- package/componentsV2/TextInputNext/TextInputNext.js +1 -1
- package/componentsV2/TextInputNext/TextInputNext.js.map +1 -1
- package/config/theme/lightThemePalette.d.mts +4 -0
- package/config/theme/lightThemePalette.d.mts.map +1 -1
- package/config/theme/palette.d.mts +4 -0
- package/config/theme/palette.d.mts.map +1 -1
- package/config/theme/palette.mjs.js +1 -1
- package/config/theme/palette.mjs.js.map +1 -1
- package/config/theme/themeVariables.d.mts +12 -0
- package/config/theme/themeVariables.d.mts.map +1 -1
- package/effects/index.js +1 -1
- package/effects/subscriptions/fetchInitialSubscriptionsData.d.ts +23 -0
- package/effects/subscriptions/fetchInitialSubscriptionsData.d.ts.map +1 -0
- package/effects/subscriptions/fetchInitialSubscriptionsData.js +2 -0
- package/effects/subscriptions/fetchInitialSubscriptionsData.js.map +1 -0
- package/effects/subscriptions/useSubscriptions.v2.d.ts.map +1 -1
- package/effects/subscriptions/useSubscriptions.v2.js +1 -1
- package/effects/subscriptions/useSubscriptions.v2.js.map +1 -1
- package/effects/useGlobalOffsetWellsSync.js +1 -1
- package/effects/useGlobalOffsetWellsSync.js.map +1 -1
- package/effects/useSubscriptions.d.ts +1 -2
- package/effects/useSubscriptions.d.ts.map +1 -1
- package/effects/useSubscriptions.js +1 -1
- package/effects/useSubscriptions.js.map +1 -1
- package/effects/useWellnessAlerts.js +1 -1
- package/effects/useWellnessAlerts.js.map +1 -1
- package/icons/customIcons/icons/Search.d.ts +1 -1
- package/icons/customIcons/icons/Search.js.map +1 -1
- package/mcp-server/server.mjs +14079 -29649
- package/package.json +1 -1
- package/permissions/constants/index.d.ts +1 -0
- package/permissions/constants/index.d.ts.map +1 -1
- package/permissions/constants/index.js +1 -1
- package/permissions/constants/index.js.map +1 -1
- package/styles/common.scss +2 -0
- package/styles/generatedThemesVariables.global.css +1 -1
- package/styles/generatedThemesVariables.global.css.js +1 -1
- package/testing/AppTestWrapper/AppTestWrapper.js +1 -1
- package/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/__tests__/safeTemplate.test.d.ts +2 -0
- package/utils/__tests__/safeTemplate.test.d.ts.map +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +1 -1
- package/utils/index.js.map +1 -1
- package/utils/safeTemplate.d.ts +24 -0
- package/utils/safeTemplate.d.ts.map +1 -0
- package/utils/safeTemplate.js +2 -0
- package/utils/safeTemplate.js.map +1 -0
- package/cjs-bundle/clients/subscriptions.v1.js +0 -2
- package/cjs-bundle/clients/subscriptions.v1.js.map +0 -1
- package/cjs-bundle/effects/subscriptions/useSubscriptions.v1.js +0 -2
- package/cjs-bundle/effects/subscriptions/useSubscriptions.v1.js.map +0 -1
- package/clients/subscriptions.v1.d.ts +0 -9
- package/clients/subscriptions.v1.d.ts.map +0 -1
- package/clients/subscriptions.v1.js +0 -2
- package/clients/subscriptions.v1.js.map +0 -1
- package/effects/subscriptions/useSubscriptions.v1.d.ts +0 -24
- package/effects/subscriptions/useSubscriptions.v1.d.ts.map +0 -1
- package/effects/subscriptions/useSubscriptions.v1.js +0 -2
- package/effects/subscriptions/useSubscriptions.v1.js.map +0 -1
package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWellDataPipeline.js","sources":["../../../../../src/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.ts"],"sourcesContent":["import { useEffect, useMemo, type Dispatch, type SetStateAction } from 'react';\n\nimport { useViewportStore } from '../../stores/viewport-store';\nimport { areWellMapsEqual } from '../../stores/viewport-store/utils/areWellMapsEqual';\nimport { useCompanySafeguard } from '../../stores/company-safeguard';\nimport type { Company } from '../../stores/company-safeguard/CompanySafeguardContext';\nimport { useFilterStore } from '../../stores/filter-store/useFilterStore';\nimport { usePickerPropsStore } from '../../stores/picker-props-store';\nimport { ALL_SECTION_KEY } from '../../constants';\nimport { isDrillingOnlyWell } from '../../utils/isDrillingOnlyWell';\nimport { isInterventionOnlyWell } from '../../utils/isInterventionOnlyWell';\nimport type { FilterableWell } from '../../utils/doesWellPassFilters';\nimport type {\n OffsetWell,\n OffsetSettingsInput,\n OffsetSettingsOutput,\n} from '../../OffsetWellPickerV5.types';\nimport type { FetchedOffsetWell } from '../../api/shared/types';\nimport { useViewportWells } from '../useViewportWells';\nimport { useTileLoading } from '../useTileLoading';\nimport { usePinnedWells } from '../usePinnedWells';\nimport {\n useExternalOffsets,\n type WellSection,\n type OffsetWellsBySection,\n type TaScore,\n} from '../useExternalOffsets';\nimport { useIdasResyncSync } from '../../stores/idas-resync-store';\nimport { getSegmentConfig } from '../../segment-config';\n\nimport { useSearchedWells } from './useSearchedWells';\nimport { useCompanyProvider } from './useCompanyProvider';\nimport { useFetchSubjectWell } from './useFetchSubjectWell';\nimport { useCompanyMetricKey } from './useCompanyMetricKey';\nimport { useAdvancedWells, type TransformedWell } from './useAdvancedWells';\nimport { computeIsAllWellsLoaded } from './utils/computeIsAllWellsLoaded';\nimport {\n useInterventionEnrichment,\n enrichWellsWithInterventionData,\n} from './useInterventionEnrichment';\nimport { usePadEnrichment, enrichWellsWithPadData } from './usePadEnrichment';\n\nimport { useGlobalOffsetWellsSync } from '~/effects';\n\ntype UseWellDataPipelineParams = {\n subjectWellId: number | null;\n assetCompanyId: number | undefined;\n offsetSettings: OffsetSettingsInput | undefined;\n maxOffsetWellNumber: number;\n isLoadAllWells: boolean;\n open: boolean | undefined;\n onSave:\n | ((offsetSettings: OffsetSettingsOutput, selectedWells?: OffsetWell[]) => void)\n | undefined;\n};\n\ntype UseWellDataPipelineReturn = {\n wells: TransformedWell[] | null;\n subjectWell: TransformedWell | FetchedOffsetWell | null;\n subjectWellCoords: { latitude: number; longitude: number } | null;\n rawWellsWithSubject: FetchedOffsetWell[] | null;\n wellSections: WellSection[] | null;\n externalOffsets: OffsetWellsBySection | null;\n taScores: TaScore[];\n idasWellIds: number[];\n owsWellIds: number[];\n wellhubWellIds: number[];\n loadedAssetId: number | null;\n isWellSectionColumnVisible: boolean;\n metricsKeys: string[];\n setMetricsKeys: Dispatch<SetStateAction<string[]>>;\n loadingWellIds: Set<number>;\n isAllWellsLoaded: boolean;\n areRawWellsLoading: boolean;\n companies: Company[];\n canViewCompanies: boolean;\n companyProvider: string | null;\n pinnedWells: OffsetWell[] | null;\n fetchSearchedWells: (wellIds: number[]) => Promise<OffsetWell[]>;\n resetSafeguard: () => void;\n activeInterventionWellIds: Set<number>;\n};\n\nexport const useWellDataPipeline = ({\n subjectWellId,\n assetCompanyId,\n offsetSettings,\n maxOffsetWellNumber,\n isLoadAllWells,\n open,\n onSave,\n}: UseWellDataPipelineParams): UseWellDataPipelineReturn => {\n const segment = usePickerPropsStore(state => state.segment);\n const isIntervention = segment === 'intervention';\n const viewportWells = useViewportStore(state => state.wells, areWellMapsEqual);\n const viewportBounds = useViewportStore(state => state.bounds);\n const drillingWells = useFilterStore(state => state.filters.drillingWells ?? true);\n const interventionWells = useFilterStore(state => state.filters.interventionWells ?? true);\n\n const [fetchedSubjectWell] = useFetchSubjectWell(subjectWellId);\n\n const subjectWellCoords = useMemo(() => {\n const coords = fetchedSubjectWell?.topHole?.coordinates;\n if (!coords) return null;\n const [latitude, longitude] = coords;\n return { latitude, longitude };\n }, [fetchedSubjectWell]);\n\n useGlobalOffsetWellsSync(offsetSettings, onSave, maxOffsetWellNumber);\n\n const { companies, canViewCompanies, resetSafeguard } = useCompanySafeguard();\n\n useViewportWells(!isLoadAllWells);\n const isTileLoading = useTileLoading();\n\n const rawWells = useMemo(\n () => Array.from(viewportWells.values()) as FetchedOffsetWell[],\n [viewportWells]\n );\n const areRawWellsLoading = isTileLoading || (rawWells.length === 0 && viewportBounds === null);\n\n const [pinnedWells, arePinnedWellsLoading] = usePinnedWells(offsetSettings?.selectedWellIds);\n const [searchedWells, areSearchedWellsLoading, fetchSearchedWells] = useSearchedWells();\n\n const rawWellsWithSubject = useMemo((): FetchedOffsetWell[] | null => {\n if (!rawWells) return null;\n\n const mergeUniqueById = (\n target: FetchedOffsetWell[],\n extras: OffsetWell[] | null\n ): FetchedOffsetWell[] => {\n if (!extras?.length) {\n return target;\n }\n\n const existingIds = new Set(target.map(w => w.id));\n const missing = (extras as unknown as FetchedOffsetWell[]).filter(\n w => !existingIds.has(w.id)\n );\n\n return missing.length > 0 ? target.concat(missing) : target;\n };\n\n let result: FetchedOffsetWell[] = rawWells;\n result = mergeUniqueById(result, pinnedWells);\n result = mergeUniqueById(result, searchedWells);\n\n if (segment === 'drilling' && drillingWells) {\n result = result.filter(w => isDrillingOnlyWell(w as unknown as FilterableWell));\n }\n\n if (segment === 'intervention' && interventionWells) {\n result = result.filter(w => isInterventionOnlyWell(w as unknown as FilterableWell));\n }\n\n // Subject well is prepended AFTER filtering so its full data (BIC, advanced\n // metrics, distance) always loads even when it is not a drilling well.\n if (fetchedSubjectWell && !result.some(w => w.id === fetchedSubjectWell.id)) {\n result = [fetchedSubjectWell].concat(result);\n }\n\n return result;\n }, [\n rawWells,\n fetchedSubjectWell,\n pinnedWells,\n searchedWells,\n drillingWells,\n interventionWells,\n segment,\n ]);\n\n const [companyProvider] = useCompanyProvider(assetCompanyId);\n\n const { offsets, setOffsets, loadExternalOffsets } = useExternalOffsets(\n subjectWellId,\n rawWellsWithSubject\n );\n useIdasResyncSync({ assetId: subjectWellId, loadExternalOffsets });\n const {\n wellSections,\n offsetWellsBySection: externalOffsets,\n taScores,\n idasWellIds,\n owsWellIds,\n wellhubWellIds,\n loadedAssetId,\n } = offsets;\n\n const isWellSectionColumnVisible = useMemo(() => {\n if (!wellSections) return false;\n return wellSections.some(section => section.value !== ALL_SECTION_KEY);\n }, [wellSections]);\n\n useEffect(() => {\n setOffsets(prev => ({ ...prev, wellSections: null, offsetWellsBySection: null }));\n }, [setOffsets, subjectWellId]);\n\n // Pre-fetch synced offset wells that aren't in the local pool yet, so the Reset\n // button visibility (`useSaveResetDerivedState`) can synchronously distinguish\n // \"real well outside map radius\" from \"stale/unresolvable IDAS ID\". Results land\n // in `searchedWells` via `useSearchedWells.wellsCacheRef` and flow into\n // `rawWellsWithSubject` through `mergeUniqueById` above.\n useEffect(() => {\n if (!externalOffsets) return;\n const loaded = new Set(rawWellsWithSubject?.map(w => w.id) ?? []);\n const missing = new Set<number>();\n Object.values(externalOffsets).forEach(sectionIds => {\n (sectionIds ?? []).forEach(id => {\n if (id != null && id !== subjectWellId && !loaded.has(id)) missing.add(id);\n });\n });\n if (missing.size > 0) {\n fetchSearchedWells(Array.from(missing));\n }\n }, [externalOffsets, rawWellsWithSubject, subjectWellId, fetchSearchedWells]);\n\n const { defaultMetricKey } = getSegmentConfig(segment);\n\n const [metricsKeys, setMetricsKeys] = useCompanyMetricKey(\n assetCompanyId as number,\n offsetSettings?.metricsKeys,\n defaultMetricKey\n ) as [string[], Dispatch<SetStateAction<string[]>>];\n\n const [wellsWithMetrics, areAdvancedWellsLoading, transformedWells, loadingWellIds] =\n useAdvancedWells(\n rawWellsWithSubject,\n wellSections,\n externalOffsets,\n subjectWellId,\n metricsKeys,\n open\n );\n\n const {\n wellIdToInterventionNames,\n activeInterventionWellIds,\n isLoading: isInterventionLoading,\n } = useInterventionEnrichment(isIntervention);\n\n const { assetIdToPadName, isLoading: isPadLoading } = usePadEnrichment(isIntervention);\n\n const wellsWithoutCompanyName = wellsWithMetrics || transformedWells;\n\n const wells = useMemo(() => {\n if (!wellsWithoutCompanyName || !companies?.length) return wellsWithoutCompanyName;\n\n const companyMap: Record<number, string> = {};\n companies.forEach(company => {\n companyMap[company.id] = company.name;\n });\n\n let result = wellsWithoutCompanyName.map(well => ({\n ...well,\n companyName: companyMap[Number(well.companyId)] || 'Null',\n }));\n\n if (isIntervention) {\n result = enrichWellsWithInterventionData(result, wellIdToInterventionNames);\n result = enrichWellsWithPadData(result, assetIdToPadName);\n }\n\n return result;\n }, [\n wellsWithoutCompanyName,\n companies,\n isIntervention,\n wellIdToInterventionNames,\n assetIdToPadName,\n ]);\n\n const subjectWell = useMemo(() => {\n if (!fetchedSubjectWell) return null;\n if (!wells) return fetchedSubjectWell;\n return wells.find(w => w.id === fetchedSubjectWell.id) || fetchedSubjectWell;\n }, [fetchedSubjectWell, wells]);\n\n const allWellsLoadProgress = usePickerPropsStore(state => state.allWellsLoadProgress);\n\n const isAllWellsLoaded = computeIsAllWellsLoaded({\n isLoadAllWells,\n allWellsLoadProgress,\n wellsLength: wells?.length ?? 0,\n rawWellsCount: rawWellsWithSubject?.length ?? 0,\n areRawWellsLoading,\n areAdvancedWellsLoading: areAdvancedWellsLoading || isInterventionLoading || isPadLoading,\n arePinnedWellsLoading,\n areSearchedWellsLoading,\n });\n\n return {\n wells,\n subjectWell,\n subjectWellCoords,\n rawWellsWithSubject,\n wellSections,\n externalOffsets,\n taScores,\n idasWellIds,\n owsWellIds,\n wellhubWellIds,\n loadedAssetId,\n isWellSectionColumnVisible,\n metricsKeys,\n setMetricsKeys,\n loadingWellIds,\n isAllWellsLoaded,\n areRawWellsLoading,\n companies,\n canViewCompanies,\n companyProvider,\n pinnedWells,\n fetchSearchedWells,\n resetSafeguard,\n activeInterventionWellIds,\n };\n};\n"],"names":["useWellDataPipeline","_ref","_wells$length","_rawWellsWithSubject$2","subjectWellId","assetCompanyId","offsetSettings","maxOffsetWellNumber","isLoadAllWells","open","onSave","segment","usePickerPropsStore","state","isIntervention","viewportWells","useViewportStore","wells","areWellMapsEqual","viewportBounds","bounds","drillingWells","useFilterStore","_state$filters$drilli","filters","interventionWells","_state$filters$interv","useFetchSubjectWell","fetchedSubjectWell","_slicedToArray","_useFetchSubjectWell","subjectWellCoords","useMemo","_fetchedSubjectWell$t","coords","topHole","coordinates","_coords","latitude","longitude","useGlobalOffsetWellsSync","_useCompanySafeguard","useCompanySafeguard","companies","canViewCompanies","resetSafeguard","useViewportWells","isTileLoading","useTileLoading","rawWells","Array","from","values","areRawWellsLoading","length","usePinnedWells","selectedWellIds","_usePinnedWells2","_usePinnedWells","pinnedWells","arePinnedWellsLoading","_useSearchedWells","useSearchedWells","_useSearchedWells2","searchedWells","areSearchedWellsLoading","fetchSearchedWells","rawWellsWithSubject","mergeUniqueById","target","extras","existingIds","Set","map","w","id","missing","filter","has","concat","result","isDrillingOnlyWell","isInterventionOnlyWell","some","useCompanyProvider","companyProvider","_useCompanyProvider","_useExternalOffsets","useExternalOffsets","offsets","setOffsets","loadExternalOffsets","useIdasResyncSync","assetId","wellSections","externalOffsets","offsetWellsBySection","taScores","idasWellIds","owsWellIds","wellhubWellIds","loadedAssetId","isWellSectionColumnVisible","section","value","ALL_SECTION_KEY","useEffect","prev","_objectSpread","_rawWellsWithSubject$","loaded","Object","forEach","sectionIds","add","size","defaultMetricKey","getSegmentConfig","_ref2","useCompanyMetricKey","metricsKeys","_ref3","setMetricsKeys","_useAdvancedWells","useAdvancedWells","_useAdvancedWells2","wellsWithMetrics","areAdvancedWellsLoading","transformedWells","loadingWellIds","useInterventionEnrichment","wellIdToInterventionNames","activeInterventionWellIds","isInterventionLoading","isLoading","usePadEnrichment","assetIdToPadName","isPadLoading","wellsWithoutCompanyName","companyMap","company","name","well","companyName","Number","companyId","enrichWellsWithInterventionData","enrichWellsWithPadData","subjectWell","find","allWellsLoadProgress","isAllWellsLoaded","computeIsAllWellsLoaded","wellsLength","rawWellsCount"],"mappings":"8mLAmFaA,IAAAA,EAAsB,SAQyBC,GAAA,IAAAC,EAAAC,EAP1DC,IAAAA,cACAC,IAAAA,eACAC,IAAAA,eACAC,IAAAA,oBACAC,IAAAA,eACAC,IAAAA,KACAC,IAAAA,OAEMC,EAAUC,GAAoB,SAAAC,GAAK,OAAIA,EAAMF,WAC7CG,EAA6B,iBAAZH,EACjBI,EAAgBC,GAAiB,SAAAH,GAAK,OAAIA,EAAMI,KAAK,GAAEC,GACvDC,EAAiBH,GAAiB,SAAAH,GAAK,OAAIA,EAAMO,UACjDC,EAAgBC,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AASkE,EAAgClE,EAAQmD,IACjDnD,EAASmE,EAAuBnE,EAAQwD,KAGnCxD,CACT,GAAG,CACD0D,GACA/F,EACA7B,EACAqH,GACAK,KAGIY,GAAcpH,GAAQ,WAC1B,OAAKJ,EACAX,IACEA,GAAMoI,MAAK,SAAA3E,GAAC,OAAIA,EAAEC,KAAO/C,EAAmB+C,EAAE,KADlC/C,EADa,IAGlC,GAAG,CAACA,EAAoBX,KAElBqI,GAAuB1I,GAAoB,SAAAC,GAAK,OAAIA,EAAMyI,wBAE1DC,GAAmBC,EAAwB,CAC/ChJ,eAAAA,EACA8I,qBAAAA,GACAG,YAA0B,QAAfvJ,EAAEe,gBAAAA,GAAOqC,cAAM,IAAApD,EAAAA,EAAI,EAC9BwJ,cAA0C,QAA7BvJ,EAAEgE,gBAAAA,GAAqBb,cAAM,IAAAnD,EAAAA,EAAI,EAC9CkD,mBAAAA,GACA0E,wBAAyBA,IAA2BM,IAAyBI,GAC7E7E,sBAAAA,GACAK,wBAAAA,KAGF,MAAO,CACLhD,MAAAA,GACAmI,YAAAA,GACArH,kBAAAA,EACAoC,oBAAAA,GACA2B,aAAAA,GACAC,gBAAAA,GACAE,SAAAA,GACAC,YAAAA,GACAC,WAAAA,GACAC,eAAAA,GACAC,cAAAA,GACAC,2BAAAA,GACAkB,YAAAA,GACAE,eAAAA,GACAO,eAAAA,GACAsB,iBAAAA,GACAlG,mBAAAA,GACAV,UAAAA,EACAC,iBAAAA,EACAyC,gBAAAA,GACA1B,YAAAA,GACAO,mBAAAA,GACArB,eAAAA,EACAuF,0BAAAA,GAEJ"}
|
|
1
|
+
{"version":3,"file":"useWellDataPipeline.js","sources":["../../../../../src/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.ts"],"sourcesContent":["import { useEffect, useMemo, type Dispatch, type SetStateAction } from 'react';\n\nimport { useViewportStore } from '../../stores/viewport-store';\nimport { areWellMapsEqual } from '../../stores/viewport-store/utils/areWellMapsEqual';\nimport { useCompanySafeguard } from '../../stores/company-safeguard';\nimport type { Company } from '../../stores/company-safeguard/CompanySafeguardContext';\nimport { useFilterStore } from '../../stores/filter-store/useFilterStore';\nimport { usePickerPropsStore } from '../../stores/picker-props-store';\nimport { ALL_SECTION_KEY } from '../../constants';\nimport { isDrillingOnlyWell } from '../../utils/isDrillingOnlyWell';\nimport { isInterventionOnlyWell } from '../../utils/isInterventionOnlyWell';\nimport type { FilterableWell } from '../../utils/doesWellPassFilters';\nimport type {\n OffsetWell,\n OffsetSettingsInput,\n OffsetSettingsOutput,\n} from '../../OffsetWellPickerV5.types';\nimport type { FetchedOffsetWell } from '../../api/shared/types';\nimport { useViewportWells } from '../useViewportWells';\nimport { useTileLoading } from '../useTileLoading';\nimport { usePinnedWells } from '../usePinnedWells';\nimport {\n useExternalOffsets,\n type WellSection,\n type OffsetWellsBySection,\n type TaScore,\n} from '../useExternalOffsets';\nimport { useIdasResyncSync } from '../../stores/idas-resync-store';\nimport { getSegmentConfig } from '../../segment-config';\n\nimport { useSearchedWells } from './useSearchedWells';\nimport { useCompanyProvider } from './useCompanyProvider';\nimport { useFetchSubjectWell } from './useFetchSubjectWell';\nimport { useCompanyMetricKey } from './useCompanyMetricKey';\nimport { useAdvancedWells, type TransformedWell } from './useAdvancedWells';\nimport { computeIsAllWellsLoaded } from './utils/computeIsAllWellsLoaded';\nimport {\n useInterventionEnrichment,\n enrichWellsWithInterventionData,\n} from './useInterventionEnrichment';\nimport { usePadEnrichment, enrichWellsWithPadData } from './usePadEnrichment';\n\nimport { useGlobalOffsetWellsSync } from '~/effects';\n\ntype UseWellDataPipelineParams = {\n subjectWellId: number | null;\n assetCompanyId: number | undefined;\n offsetSettings: OffsetSettingsInput | undefined;\n maxOffsetWellNumber: number;\n isLoadAllWells: boolean;\n open: boolean | undefined;\n onSave:\n | ((offsetSettings: OffsetSettingsOutput, selectedWells?: OffsetWell[]) => void)\n | undefined;\n};\n\ntype UseWellDataPipelineReturn = {\n wells: TransformedWell[] | null;\n subjectWell: TransformedWell | FetchedOffsetWell | null;\n subjectWellCoords: { latitude: number; longitude: number } | null;\n rawWellsWithSubject: FetchedOffsetWell[] | null;\n wellSections: WellSection[] | null;\n externalOffsets: OffsetWellsBySection | null;\n taScores: TaScore[];\n idasWellIds: number[];\n owsWellIds: number[];\n wellhubWellIds: number[];\n loadedAssetId: number | null;\n isWellSectionColumnVisible: boolean;\n metricsKeys: string[];\n setMetricsKeys: Dispatch<SetStateAction<string[]>>;\n loadingWellIds: Set<number>;\n isAllWellsLoaded: boolean;\n areRawWellsLoading: boolean;\n companies: Company[];\n canViewCompanies: boolean;\n companyProvider: string | null;\n pinnedWells: OffsetWell[] | null;\n fetchSearchedWells: (wellIds: number[]) => Promise<OffsetWell[]>;\n resetSafeguard: () => void;\n activeInterventionWellIds: Set<number>;\n};\n\nexport const useWellDataPipeline = ({\n subjectWellId,\n assetCompanyId,\n offsetSettings,\n maxOffsetWellNumber,\n isLoadAllWells,\n open,\n onSave,\n}: UseWellDataPipelineParams): UseWellDataPipelineReturn => {\n const segment = usePickerPropsStore(state => state.segment);\n const isIntervention = segment === 'intervention';\n const viewportWells = useViewportStore(state => state.wells, areWellMapsEqual);\n const viewportBounds = useViewportStore(state => state.bounds);\n const drillingWells = useFilterStore(state => state.filters.drillingWells ?? true);\n const interventionWells = useFilterStore(state => state.filters.interventionWells ?? true);\n\n const [fetchedSubjectWell] = useFetchSubjectWell(subjectWellId);\n\n const subjectWellCoords = useMemo(() => {\n const coords = fetchedSubjectWell?.topHole?.coordinates;\n if (!coords) return null;\n const [latitude, longitude] = coords;\n return { latitude, longitude };\n }, [fetchedSubjectWell]);\n\n useGlobalOffsetWellsSync(offsetSettings, onSave, maxOffsetWellNumber);\n\n const { companies, canViewCompanies, resetSafeguard } = useCompanySafeguard();\n\n useViewportWells(!isLoadAllWells);\n const isTileLoading = useTileLoading();\n\n const rawWells = useMemo(\n () => Array.from(viewportWells.values()) as FetchedOffsetWell[],\n [viewportWells]\n );\n const areRawWellsLoading = isTileLoading || (rawWells.length === 0 && viewportBounds === null);\n\n const [pinnedWells, arePinnedWellsLoading] = usePinnedWells(offsetSettings?.selectedWellIds);\n const [searchedWells, areSearchedWellsLoading, fetchSearchedWells] = useSearchedWells();\n\n const rawWellsWithSubject = useMemo((): FetchedOffsetWell[] | null => {\n if (!rawWells) return null;\n\n const mergeUniqueById = (\n target: FetchedOffsetWell[],\n extras: OffsetWell[] | null\n ): FetchedOffsetWell[] => {\n if (!extras?.length) {\n return target;\n }\n\n const existingIds = new Set(target.map(w => w.id));\n const missing = (extras as unknown as FetchedOffsetWell[]).filter(\n w => !existingIds.has(w.id)\n );\n\n return missing.length > 0 ? target.concat(missing) : target;\n };\n\n let result: FetchedOffsetWell[] = rawWells;\n result = mergeUniqueById(result, pinnedWells);\n result = mergeUniqueById(result, searchedWells);\n\n if (segment === 'drilling' && drillingWells) {\n result = result.filter(w => isDrillingOnlyWell(w as unknown as FilterableWell));\n }\n\n if (segment === 'intervention' && interventionWells) {\n result = result.filter(w => isInterventionOnlyWell(w as unknown as FilterableWell));\n }\n\n // Subject well is prepended AFTER filtering so its full data (BIC, advanced\n // metrics, distance) always loads even when it is not a drilling well.\n if (fetchedSubjectWell && !result.some(w => w.id === fetchedSubjectWell.id)) {\n result = [fetchedSubjectWell].concat(result);\n }\n\n return result;\n }, [\n rawWells,\n fetchedSubjectWell,\n pinnedWells,\n searchedWells,\n drillingWells,\n interventionWells,\n segment,\n ]);\n\n const [companyProvider] = useCompanyProvider(assetCompanyId);\n\n const { offsets, setOffsets, loadExternalOffsets } = useExternalOffsets(\n subjectWellId,\n rawWellsWithSubject\n );\n useIdasResyncSync({ assetId: subjectWellId, loadExternalOffsets });\n const {\n wellSections,\n offsetWellsBySection: externalOffsets,\n taScores,\n idasWellIds,\n owsWellIds,\n wellhubWellIds,\n loadedAssetId,\n } = offsets;\n\n const isWellSectionColumnVisible = useMemo(() => {\n if (!wellSections) return false;\n return wellSections.some(section => section.value !== ALL_SECTION_KEY);\n }, [wellSections]);\n\n useEffect(() => {\n setOffsets(prev => ({ ...prev, wellSections: null, offsetWellsBySection: null }));\n }, [setOffsets, subjectWellId]);\n\n // Pre-fetch synced offset wells that aren't in the local pool yet, so the Reset\n // button visibility (`useSaveResetDerivedState`) can synchronously distinguish\n // \"real well outside map radius\" from \"stale/unresolvable IDAS ID\". Results land\n // in `searchedWells` via `useSearchedWells.wellsCacheRef` and flow into\n // `rawWellsWithSubject` through `mergeUniqueById` above.\n useEffect(() => {\n if (!externalOffsets) return;\n const loaded = new Set(rawWellsWithSubject?.map(w => w.id) ?? []);\n const missing = new Set<number>();\n Object.values(externalOffsets).forEach(sectionIds => {\n (sectionIds ?? []).forEach(id => {\n if (id != null && id !== subjectWellId && !loaded.has(id)) missing.add(id);\n });\n });\n if (missing.size > 0) {\n fetchSearchedWells(Array.from(missing));\n }\n }, [externalOffsets, rawWellsWithSubject, subjectWellId, fetchSearchedWells]);\n\n const { defaultMetricKey } = getSegmentConfig(segment);\n\n const [metricsKeys, setMetricsKeys] = useCompanyMetricKey(\n assetCompanyId as number,\n offsetSettings?.metricsKeys,\n defaultMetricKey\n ) as [string[], Dispatch<SetStateAction<string[]>>];\n\n const [wellsWithMetrics, areAdvancedWellsLoading, transformedWells, loadingWellIds] =\n useAdvancedWells(\n rawWellsWithSubject,\n wellSections,\n externalOffsets,\n subjectWellId,\n metricsKeys,\n open\n );\n\n const {\n wellIdToInterventionNames,\n activeInterventionWellIds,\n isLoading: isInterventionLoading,\n } = useInterventionEnrichment(isIntervention);\n\n const { assetIdToPadName, isLoading: isPadLoading } = usePadEnrichment(isIntervention);\n\n const wellsWithoutCompanyName = wellsWithMetrics || transformedWells;\n\n const wells = useMemo(() => {\n if (!wellsWithoutCompanyName || !companies?.length) return wellsWithoutCompanyName;\n\n const companyMap: Record<number, string> = {};\n companies.forEach(company => {\n companyMap[company.id] = company.name;\n });\n\n let result = wellsWithoutCompanyName.map(well => ({\n ...well,\n companyName: companyMap[Number(well.companyId)] || 'Null',\n }));\n\n if (isIntervention) {\n result = enrichWellsWithInterventionData(result, wellIdToInterventionNames);\n result = enrichWellsWithPadData(result, assetIdToPadName);\n }\n\n return result;\n }, [\n wellsWithoutCompanyName,\n companies,\n isIntervention,\n wellIdToInterventionNames,\n assetIdToPadName,\n ]);\n\n const subjectWell = useMemo(() => {\n if (!fetchedSubjectWell) return null;\n if (!wells) return fetchedSubjectWell;\n return wells.find(w => w.id === fetchedSubjectWell.id) || fetchedSubjectWell;\n }, [fetchedSubjectWell, wells]);\n\n const allWellsLoadProgress = usePickerPropsStore(state => state.allWellsLoadProgress);\n\n const isAllWellsLoaded = computeIsAllWellsLoaded({\n isLoadAllWells,\n allWellsLoadProgress,\n wellsLength: wells?.length ?? 0,\n rawWellsCount: rawWellsWithSubject?.length ?? 0,\n areRawWellsLoading,\n areAdvancedWellsLoading: areAdvancedWellsLoading || isInterventionLoading || isPadLoading,\n arePinnedWellsLoading,\n areSearchedWellsLoading,\n });\n\n return {\n wells,\n subjectWell,\n subjectWellCoords,\n rawWellsWithSubject,\n wellSections,\n externalOffsets,\n taScores,\n idasWellIds,\n owsWellIds,\n wellhubWellIds,\n loadedAssetId,\n isWellSectionColumnVisible,\n metricsKeys,\n setMetricsKeys,\n loadingWellIds,\n isAllWellsLoaded,\n areRawWellsLoading,\n companies,\n canViewCompanies,\n companyProvider,\n pinnedWells,\n fetchSearchedWells,\n resetSafeguard,\n activeInterventionWellIds,\n };\n};\n"],"names":["useWellDataPipeline","_ref","_wells$length","_rawWellsWithSubject$2","subjectWellId","assetCompanyId","offsetSettings","maxOffsetWellNumber","isLoadAllWells","open","onSave","segment","usePickerPropsStore","state","isIntervention","viewportWells","useViewportStore","wells","areWellMapsEqual","viewportBounds","bounds","drillingWells","useFilterStore","_state$filters$drilli","filters","interventionWells","_state$filters$interv","useFetchSubjectWell","fetchedSubjectWell","_slicedToArray","_useFetchSubjectWell","subjectWellCoords","useMemo","_fetchedSubjectWell$t","coords","topHole","coordinates","_coords","latitude","longitude","useGlobalOffsetWellsSync","_useCompanySafeguard","useCompanySafeguard","companies","canViewCompanies","resetSafeguard","useViewportWells","isTileLoading","useTileLoading","rawWells","Array","from","values","areRawWellsLoading","length","usePinnedWells","selectedWellIds","_usePinnedWells2","_usePinnedWells","pinnedWells","arePinnedWellsLoading","_useSearchedWells","useSearchedWells","_useSearchedWells2","searchedWells","areSearchedWellsLoading","fetchSearchedWells","rawWellsWithSubject","mergeUniqueById","target","extras","existingIds","Set","map","w","id","missing","filter","has","concat","result","isDrillingOnlyWell","isInterventionOnlyWell","some","useCompanyProvider","companyProvider","_useCompanyProvider","_useExternalOffsets","useExternalOffsets","offsets","setOffsets","loadExternalOffsets","useIdasResyncSync","assetId","wellSections","externalOffsets","offsetWellsBySection","taScores","idasWellIds","owsWellIds","wellhubWellIds","loadedAssetId","isWellSectionColumnVisible","section","value","ALL_SECTION_KEY","useEffect","prev","_objectSpread","_rawWellsWithSubject$","loaded","Object","forEach","sectionIds","add","size","defaultMetricKey","getSegmentConfig","_ref2","useCompanyMetricKey","metricsKeys","_ref3","setMetricsKeys","_useAdvancedWells","useAdvancedWells","_useAdvancedWells2","wellsWithMetrics","areAdvancedWellsLoading","transformedWells","loadingWellIds","useInterventionEnrichment","wellIdToInterventionNames","activeInterventionWellIds","isInterventionLoading","isLoading","usePadEnrichment","assetIdToPadName","isPadLoading","wellsWithoutCompanyName","companyMap","company","name","well","companyName","Number","companyId","enrichWellsWithInterventionData","enrichWellsWithPadData","subjectWell","find","allWellsLoadProgress","isAllWellsLoaded","computeIsAllWellsLoaded","wellsLength","rawWellsCount"],"mappings":"u/KAmFaA,IAAAA,EAAsB,SAQyBC,GAAA,IAAAC,EAAAC,EAP1DC,IAAAA,cACAC,IAAAA,eACAC,IAAAA,eACAC,IAAAA,oBACAC,IAAAA,eACAC,IAAAA,KACAC,IAAAA,OAEMC,EAAUC,GAAoB,SAAAC,GAAK,OAAIA,EAAMF,WAC7CG,EAA6B,iBAAZH,EACjBI,E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AlC,EAAAA,EAAA,CAAA,EACxCkC,GAAI,CAAA,EAAA,CACPC,YAAaJ,EAAWK,OAAOF,EAAKG,aAAe,QAAM,IAQ3D,OALInI,IACFkE,EAASkE,EAAgClE,EAAQmD,IACjDnD,EAASmE,EAAuBnE,EAAQwD,KAGnCxD,CACT,GAAG,CACD0D,GACA/F,EACA7B,EACAqH,GACAK,KAGIY,GAAcpH,GAAQ,WAC1B,OAAKJ,EACAX,IACEA,GAAMoI,MAAK,SAAA3E,GAAC,OAAIA,EAAEC,KAAO/C,EAAmB+C,EAAE,KADlC/C,EADa,IAGlC,GAAG,CAACA,EAAoBX,KAElBqI,GAAuB1I,GAAoB,SAAAC,GAAK,OAAIA,EAAMyI,wBAE1DC,GAAmBC,EAAwB,CAC/ChJ,eAAAA,EACA8I,qBAAAA,GACAG,YAA0B,QAAfvJ,EAAEe,gBAAAA,GAAOqC,cAAM,IAAApD,EAAAA,EAAI,EAC9BwJ,cAA0C,QAA7BvJ,EAAEgE,gBAAAA,GAAqBb,cAAM,IAAAnD,EAAAA,EAAI,EAC9CkD,mBAAAA,GACA0E,wBAAyBA,IAA2BM,IAAyBI,GAC7E7E,sBAAAA,GACAK,wBAAAA,KAGF,MAAO,CACLhD,MAAAA,GACAmI,YAAAA,GACArH,kBAAAA,EACAoC,oBAAAA,GACA2B,aAAAA,GACAC,gBAAAA,GACAE,SAAAA,GACAC,YAAAA,GACAC,WAAAA,GACAC,eAAAA,GACAC,cAAAA,GACAC,2BAAAA,GACAkB,YAAAA,GACAE,eAAAA,GACAO,eAAAA,GACAsB,iBAAAA,GACAlG,mBAAAA,GACAV,UAAAA,EACAC,iBAAAA,EACAyC,gBAAAA,GACA1B,YAAAA,GACAO,mBAAAA,GACArB,eAAAA,EACAuF,0BAAAA,GAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/regenerator";import{useCallback as t}from"react";import{useStore as o}from"zustand";import{ViewportStoreContext as s}from"../../stores/viewport-store/ViewportStoreContext.js";import"lodash";import"../../stores/picker-props-store/PickerPropsStoreContext.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"../../viewport/ViewportProvider.js";import{useContextOrThrow as
|
|
1
|
+
import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/regenerator";import{useCallback as t}from"react";import{useStore as o}from"zustand";import{ViewportStoreContext as s}from"../../stores/viewport-store/ViewportStoreContext.js";import"lodash";import"../../stores/picker-props-store/PickerPropsStoreContext.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"../../viewport/ViewportProvider.js";import{useContextOrThrow as n}from"../../stores/utils/useContextOrThrow.js";import"../../viewport/ViewportContext.js";import"react/jsx-runtime";import{usePickerPropsStore as i}from"../../stores/picker-props-store/usePickerPropsStore.js";import{useFilterStore as l}from"../../stores/filter-store/useFilterStore.js";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../../clients/jsonApi/index.js";import"../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"../../../../clients/api/rateLimiter.js";import{getAllAssets as a}from"../../api/shared/fetchers/getAllAssets.js";import"../../constants.js";import"../../api/shared/dataFormatter.js";import"@babel/runtime/helpers/slicedToArray";import{useAllWellsCache as p}from"../useAllWellsCache/useAllWellsCache.js";var u=function(u,c){var m=n(s),d=o(m,(function(r){return r.addWellsToTile})),f=i((function(r){return r.addWellsUsabilityInfo})),b=i((function(r){return r.setAllWellsLoadProgress})),h=i((function(r){return r.segment})),j=l((function(r){var e;return null!==(e=r.filters.companyId)&&void 0!==e?e:null})),g=l((function(r){var e;return null===(e=r.filters.drillingWells)||void 0===e||e})),v="drilling"===h&&g,x=p(),C=x.getCachedWellIds,w=x.setCachedWellIds,k=x.clearCache;return{loadAllWells:t(r(e.mark((function r(){var t,o,s,n,i,l,p;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null===(t=u.current)||void 0===t||t.abort(),u.current=new AbortController,o=u.current.signal,r.prev=3,null===(s=C())){r.next=12;break}if(n=m.getState(),(i=s.map((function(r){return n.wells.get(r)})).filter((function(r){return void 0!==r}))).length!==s.length){r.next=12;break}return b({loaded:i.length,isComplete:!0}),c.current=!0,r.abrupt("return");case 12:return b({loaded:0,isComplete:!1}),r.next=15,a(j,{signal:o,onProgress:b,drillingWells:v});case 15:if(l=r.sent,!o.aborted){r.next=18;break}return r.abrupt("return");case 18:return r.next=20,f(l);case 20:if(p=r.sent,!o.aborted){r.next=23;break}return r.abrupt("return");case 23:d("all-wells",p),w(p.map((function(r){return r.id}))),b({loaded:p.length,isComplete:!0}),c.current=!0,r.next=35;break;case 29:if(r.prev=29,r.t0=r.catch(3),"AbortError"!==(null===r.t0||void 0===r.t0?void 0:r.t0.name)){r.next=33;break}return r.abrupt("return");case 33:console.error("Failed to load all wells:",r.t0),b(null);case 35:case"end":return r.stop()}}),r,null,[[3,29]])}))),[m,u,c,d,f,j,v,C,w,b]),store:m,clearCache:k}};export{u as useLoadAllWellsCallback};
|
|
2
2
|
//# sourceMappingURL=useLoadAllWellsCallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadAllWellsCallback.js","sources":["../../../../../src/components/OffsetWellPickerV5/hooks/useAllWells/useLoadAllWellsCallback.ts"],"sourcesContent":["import { useCallback, type MutableRefObject } from 'react';\nimport { useStore, type StoreApi } from 'zustand';\n\nimport { ViewportStoreContext } from '../../stores/viewport-store/ViewportStoreContext';\nimport { usePickerPropsStore } from '../../stores/picker-props-store';\nimport { useFilterStore } from '../../stores/filter-store/useFilterStore';\nimport { useContextOrThrow } from '../../stores/utils/useContextOrThrow';\nimport { getAllAssets } from '../../api';\nimport { useAllWellsCache } from '../useAllWellsCache';\nimport type { OffsetWell } from '../../OffsetWellPickerV5.types';\nimport type { ViewportStore } from '../../stores/viewport-store/createViewportStore';\n\nconst ALL_WELLS_TILE_KEY = 'all-wells' as `${number}/${number}/${number}`;\n\ntype UseLoadAllWellsCallbackResult = {\n loadAllWells: () => Promise<void>;\n store: StoreApi<ViewportStore>;\n clearCache: () => void;\n};\n\nexport const useLoadAllWellsCallback = (\n abortControllerRef: MutableRefObject<AbortController | null>,\n hasLoadedRef: MutableRefObject<boolean>\n): UseLoadAllWellsCallbackResult => {\n const store = useContextOrThrow(ViewportStoreContext);\n\n const addWellsToTile = useStore(store, state => state.addWellsToTile);\n const addWellsUsabilityInfo = usePickerPropsStore(state => state.addWellsUsabilityInfo);\n const setAllWellsLoadProgress = usePickerPropsStore(state => state.setAllWellsLoadProgress);\n const segment = usePickerPropsStore(state => state.segment);\n const companyIds = useFilterStore(state => state.filters.companyId ?? null);\n const rawDrillingWells = useFilterStore(state => state.filters.drillingWells ?? true);\n const drillingWells = segment === 'drilling' ? rawDrillingWells : false;\n\n const { getCachedWellIds, setCachedWellIds, clearCache } = useAllWellsCache();\n\n const loadAllWells = useCallback(async () => {\n abortControllerRef.current?.abort();\n // eslint-disable-next-line no-param-reassign\n abortControllerRef.current = new AbortController();\n\n const { signal } = abortControllerRef.current;\n\n try {\n const cachedWellIds = getCachedWellIds();\n\n if (cachedWellIds !== null) {\n const storeState = store.getState();\n const cachedWells = cachedWellIds\n .map(id => storeState.wells.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n\n if (cachedWells.length === cachedWellIds.length) {\n setAllWellsLoadProgress({ loaded: cachedWells.length, isComplete: true });\n // eslint-disable-next-line no-param-reassign\n hasLoadedRef.current = true;\n return;\n }\n }\n\n setAllWellsLoadProgress({ loaded: 0, isComplete: false });\n\n const rawWells = await getAllAssets(companyIds, {\n signal,\n onProgress: setAllWellsLoadProgress,\n drillingWells,\n });\n\n if (signal.aborted) {\n return;\n }\n\n const processedWells = (await addWellsUsabilityInfo(\n rawWells as OffsetWell[]\n )) as OffsetWell[];\n\n if (signal.aborted) {\n return;\n }\n\n addWellsToTile(ALL_WELLS_TILE_KEY, processedWells);\n setCachedWellIds(processedWells.map(w => w.id));\n setAllWellsLoadProgress({ loaded: processedWells.length, isComplete: true });\n // eslint-disable-next-line no-param-reassign\n hasLoadedRef.current = true;\n } catch (error) {\n if ((error as Error)?.name === 'AbortError') {\n return;\n }\n\n console.error('Failed to load all wells:', error);\n setAllWellsLoadProgress(null);\n }\n }, [\n store,\n abortControllerRef,\n hasLoadedRef,\n addWellsToTile,\n addWellsUsabilityInfo,\n companyIds,\n drillingWells,\n getCachedWellIds,\n setCachedWellIds,\n setAllWellsLoadProgress,\n ]);\n\n return { loadAllWells, store, clearCache };\n};\n"],"names":["useLoadAllWellsCallback","abortControllerRef","hasLoadedRef","store","useContextOrThrow","ViewportStoreContext","addWellsToTile","useStore","state","addWellsUsabilityInfo","usePickerPropsStore","setAllWellsLoadProgress","segment","companyIds","useFilterStore","_state$filters$compan","filters","companyId","rawDrillingWells","_state$filters$drilli","drillingWells","_useAllWellsCache","useAllWellsCache","getCachedWellIds","setCachedWellIds","clearCache","loadAllWells","useCallback","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_abortControllerRef$c","signal","cachedWellIds","storeState","cachedWells","rawWells","processedWells","wrap","_context","prev","next","current","abort","AbortController","getState","map","id","wells","get","filter","w","undefined","length","loaded","isComplete","abrupt","getAllAssets","onProgress","sent","aborted","t0","name","console","error","stop"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLoadAllWellsCallback.js","sources":["../../../../../src/components/OffsetWellPickerV5/hooks/useAllWells/useLoadAllWellsCallback.ts"],"sourcesContent":["import { useCallback, type MutableRefObject } from 'react';\nimport { useStore, type StoreApi } from 'zustand';\n\nimport { ViewportStoreContext } from '../../stores/viewport-store/ViewportStoreContext';\nimport { usePickerPropsStore } from '../../stores/picker-props-store';\nimport { useFilterStore } from '../../stores/filter-store/useFilterStore';\nimport { useContextOrThrow } from '../../stores/utils/useContextOrThrow';\nimport { getAllAssets } from '../../api';\nimport { useAllWellsCache } from '../useAllWellsCache';\nimport type { OffsetWell } from '../../OffsetWellPickerV5.types';\nimport type { ViewportStore } from '../../stores/viewport-store/createViewportStore';\n\nconst ALL_WELLS_TILE_KEY = 'all-wells' as `${number}/${number}/${number}`;\n\ntype UseLoadAllWellsCallbackResult = {\n loadAllWells: () => Promise<void>;\n store: StoreApi<ViewportStore>;\n clearCache: () => void;\n};\n\nexport const useLoadAllWellsCallback = (\n abortControllerRef: MutableRefObject<AbortController | null>,\n hasLoadedRef: MutableRefObject<boolean>\n): UseLoadAllWellsCallbackResult => {\n const store = useContextOrThrow(ViewportStoreContext);\n\n const addWellsToTile = useStore(store, state => state.addWellsToTile);\n const addWellsUsabilityInfo = usePickerPropsStore(state => state.addWellsUsabilityInfo);\n const setAllWellsLoadProgress = usePickerPropsStore(state => state.setAllWellsLoadProgress);\n const segment = usePickerPropsStore(state => state.segment);\n const companyIds = useFilterStore(state => state.filters.companyId ?? null);\n const rawDrillingWells = useFilterStore(state => state.filters.drillingWells ?? true);\n const drillingWells = segment === 'drilling' ? rawDrillingWells : false;\n\n const { getCachedWellIds, setCachedWellIds, clearCache } = useAllWellsCache();\n\n const loadAllWells = useCallback(async () => {\n abortControllerRef.current?.abort();\n // eslint-disable-next-line no-param-reassign\n abortControllerRef.current = new AbortController();\n\n const { signal } = abortControllerRef.current;\n\n try {\n const cachedWellIds = getCachedWellIds();\n\n if (cachedWellIds !== null) {\n const storeState = store.getState();\n const cachedWells = cachedWellIds\n .map(id => storeState.wells.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n\n if (cachedWells.length === cachedWellIds.length) {\n setAllWellsLoadProgress({ loaded: cachedWells.length, isComplete: true });\n // eslint-disable-next-line no-param-reassign\n hasLoadedRef.current = true;\n return;\n }\n }\n\n setAllWellsLoadProgress({ loaded: 0, isComplete: false });\n\n const rawWells = await getAllAssets(companyIds, {\n signal,\n onProgress: setAllWellsLoadProgress,\n drillingWells,\n });\n\n if (signal.aborted) {\n return;\n }\n\n const processedWells = (await addWellsUsabilityInfo(\n rawWells as OffsetWell[]\n )) as OffsetWell[];\n\n if (signal.aborted) {\n return;\n }\n\n addWellsToTile(ALL_WELLS_TILE_KEY, processedWells);\n setCachedWellIds(processedWells.map(w => w.id));\n setAllWellsLoadProgress({ loaded: processedWells.length, isComplete: true });\n // eslint-disable-next-line no-param-reassign\n hasLoadedRef.current = true;\n } catch (error) {\n if ((error as Error)?.name === 'AbortError') {\n return;\n }\n\n console.error('Failed to load all wells:', error);\n setAllWellsLoadProgress(null);\n }\n }, [\n store,\n abortControllerRef,\n hasLoadedRef,\n addWellsToTile,\n addWellsUsabilityInfo,\n companyIds,\n drillingWells,\n getCachedWellIds,\n setCachedWellIds,\n setAllWellsLoadProgress,\n ]);\n\n return { loadAllWells, store, clearCache };\n};\n"],"names":["useLoadAllWellsCallback","abortControllerRef","hasLoadedRef","store","useContextOrThrow","ViewportStoreContext","addWellsToTile","useStore","state","addWellsUsabilityInfo","usePickerPropsStore","setAllWellsLoadProgress","segment","companyIds","useFilterStore","_state$filters$compan","filters","companyId","rawDrillingWells","_state$filters$drilli","drillingWells","_useAllWellsCache","useAllWellsCache","getCachedWellIds","setCachedWellIds","clearCache","loadAllWells","useCallback","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_abortControllerRef$c","signal","cachedWellIds","storeState","cachedWells","rawWells","processedWells","wrap","_context","prev","next","current","abort","AbortController","getState","map","id","wells","get","filter","w","undefined","length","loaded","isComplete","abrupt","getAllAssets","onProgress","sent","aborted","t0","name","console","error","stop"],"mappings":"6+CAYA,IAQaA,EAA0B,SACrCC,EACAC,GAEA,IAAMC,EAAQC,EAAkBC,GAE1BC,EAAiBC,EAASJ,GAAO,SAAAK,GAAK,OAAIA,EAAMF,kBAChDG,EAAwBC,GAAoB,SAAAF,GAAK,OAAIA,EAAMC,yBAC3DE,EAA0BD,GAAoB,SAAAF,GAAK,OAAIA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,GAJY,GAARiB,EAAQG,EAAAoB,MAMV3B,EAAO4B,QAAO,CAAArB,EAAAE,KAAA,GAAA,KAAA,CAAA,OAAAF,EAAAiB,OAAA,UAAA,KAAA,GAAA,OAAAjB,EAAAE,KAAA,GAIYjC,EAC5B4B,GACD,KAAA,GAFmB,GAAdC,EAAcE,EAAAoB,MAIhB3B,EAAO4B,QAAO,CAAArB,EAAAE,KAAA,GAAA,KAAA,CAAA,OAAAF,EAAAiB,OAAA,UAAA,KAAA,GAIlBnD,EApEqB,YAoEcgC,GACnCd,EAAiBc,EAAeS,KAAI,SAAAK,GAAC,OAAIA,EAAEJ,EAAE,KAC7CrC,EAAwB,CAAE4C,OAAQjB,EAAegB,OAAQE,YAAY,IAErEtD,EAAayC,SAAU,EAAKH,EAAAE,KAAA,GAAA,MAAA,KAAA,GAAA,GAAAF,EAAAC,KAAA,GAAAD,EAAAsB,GAAAtB,EAAA,MAAA,GAEG,gBAA3B,OAAAA,EAAAsB,SAAA,IAAAtB,EAAAsB,QAAA,EAAAtB,EAAAsB,GAAkBC,MAAqB,CAAAvB,EAAAE,KAAA,GAAA,KAAA,CAAA,OAAAF,EAAAiB,OAAA,UAAA,KAAA,GAI3CO,QAAQC,MAAM,4BAAmCzB,EAAAsB,IACjDnD,EAAwB,MAAM,KAAA,GAAA,IAAA,MAAA,OAAA6B,EAAA0B,OAAA,GAAAnC,EAAA,KAAA,CAAA,CAAA,EAAA,KAEjC,KAAE,CACD5B,EACAF,EACAC,EACAI,EACAG,EACAI,EACAO,EACAG,EACAC,EACAb,IAGqBR,MAAAA,EAAOsB,WAAAA,EAChC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{useState as i,useEffect as o}from"react";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import"../../../clients/sso/auth0.js";import"../../../clients/sso/oauth2.js";import"../../../clients/api/rateLimiter.js";import{fetchCompanies as n}from"../api/companies/fetchCompanies.js";import"../constants.js";import"../api/shared/dataFormatter.js";import{useCompanySelectorPermission as s}from"./useCompanySelectorPermission.js";var a=function(a){var p=a.open,m=i([]),c=t(m,2),l=c[0],u=c[1],h=s(),f=h.canViewCompanies,b=h.canViewCompaniesLoading;return o((function(){function t(){return(t=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n();case 2:t=e.sent,u(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}f&&p&&0===l.length&&function(){t.apply(this,arguments)}()}),[f,l.length,p]),{canViewCompanies:f,canViewCompaniesLoading:b,companies:l}};export{a as useCompanies};
|
|
2
2
|
//# sourceMappingURL=useCompanies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompanies.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/useCompanies.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\n\nimport type { Company } from '../stores/company-safeguard/CompanySafeguardContext';\nimport { fetchCompanies } from '../api';\n\nimport { useCompanySelectorPermission } from './useCompanySelectorPermission';\n\ntype UseCompaniesParams = {\n open: boolean | undefined;\n};\n\ntype UseCompaniesResult = {\n canViewCompanies: boolean;\n canViewCompaniesLoading: boolean;\n companies: Company[];\n};\n\nexport const useCompanies = ({ open }: UseCompaniesParams): UseCompaniesResult => {\n const [companies, setCompanies] = useState<Company[]>([]);\n const { canViewCompanies, canViewCompaniesLoading } = useCompanySelectorPermission();\n\n useEffect(() => {\n async function handleFetchCompanies() {\n const data = await fetchCompanies();\n setCompanies(data);\n }\n\n if (canViewCompanies && open && companies.length === 0) {\n handleFetchCompanies();\n }\n // TODO: Check reference stability\n }, [canViewCompanies, companies.length, open]);\n\n return { canViewCompanies, canViewCompaniesLoading, companies };\n};\n"],"names":["useCompanies","_ref","open","useState","_useState2","_slicedToArray","_useState","companies","setCompanies","_useCompanySelectorPe","useCompanySelectorPermission","canViewCompanies","canViewCompaniesLoading","useEffect","_handleFetchCompanies","_asyncToGenerator","_regeneratorRuntime","mark","_callee","data","wrap","_context","prev","next","fetchCompanies","sent","stop","apply","this","arguments","length","handleFetchCompanies"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompanies.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/useCompanies.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\n\nimport type { Company } from '../stores/company-safeguard/CompanySafeguardContext';\nimport { fetchCompanies } from '../api';\n\nimport { useCompanySelectorPermission } from './useCompanySelectorPermission';\n\ntype UseCompaniesParams = {\n open: boolean | undefined;\n};\n\ntype UseCompaniesResult = {\n canViewCompanies: boolean;\n canViewCompaniesLoading: boolean;\n companies: Company[];\n};\n\nexport const useCompanies = ({ open }: UseCompaniesParams): UseCompaniesResult => {\n const [companies, setCompanies] = useState<Company[]>([]);\n const { canViewCompanies, canViewCompaniesLoading } = useCompanySelectorPermission();\n\n useEffect(() => {\n async function handleFetchCompanies() {\n const data = await fetchCompanies();\n setCompanies(data);\n }\n\n if (canViewCompanies && open && companies.length === 0) {\n handleFetchCompanies();\n }\n // TODO: Check reference stability\n }, [canViewCompanies, companies.length, open]);\n\n return { canViewCompanies, canViewCompaniesLoading, companies };\n};\n"],"names":["useCompanies","_ref","open","useState","_useState2","_slicedToArray","_useState","companies","setCompanies","_useCompanySelectorPe","useCompanySelectorPermission","canViewCompanies","canViewCompaniesLoading","useEffect","_handleFetchCompanies","_asyncToGenerator","_regeneratorRuntime","mark","_callee","data","wrap","_context","prev","next","fetchCompanies","sent","stop","apply","this","arguments","length","handleFetchCompanies"],"mappings":"y4BAiBaA,IAAAA,EAAe,SAAsDC,GAAA,IAAnDC,IAAAA,KACKC,EAAAA,EAAoB,IAAGC,EAAAC,EAAAC,EAAA,GAAlDC,EAASH,EAAA,GAAEI,EAAYJ,EAAA,GAC9BK,EAAsDC,IAA9CC,IAAAA,iBAAkBC,IAAAA,wBAc1B,OAZAC,GAAU,WAC2B,SAAAC,IAGlC,OAHkCA,EAAnCC,EAAAC,EAAAC,MAAA,SAAAC,IAAA,IAAAC,EAAA,OAAAH,EAAAI,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAE,KAAA,EACqBC,IAAgB,KAAA,EAA7BL,EAAIE,EAAAI,KACVjB,EAAaW,GAAM,KAAA,EAAA,IAAA,MAAA,OAAAE,EAAAK,OAAA,GAAAR,EACpB,MAAAS,MAAAC,KAAAC,UAAA,CAEGlB,GAAoBT,GAA6B,IAArBK,EAAUuB,QAN5B,WACqBhB,EAAAa,MAAAC,KAAAC,UAAA,CAMjCE,EAGH,GAAE,CAACpB,EAAkBJ,EAAUuB,OAAQ5B,IAEjC,CAAES,iBAAAA,EAAkBC,wBAAAA,EAAyBL,UAAAA,EACtD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/regenerator";import{useState as o,useCallback as n,useEffect as i}from"react";import{uniq as a,get as c}from"lodash";import"
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/helpers/slicedToArray";import l from"@babel/runtime/regenerator";import{useState as o,useCallback as n,useEffect as i}from"react";import{uniq as a,get as c}from"lodash";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import"../../../clients/sso/auth0.js";import"../../../clients/sso/oauth2.js";import"../../../clients/api/rateLimiter.js";import{WellSectionColors as u,ALL_SECTION_KEY as p,ALL_SECTION_LABEL as f}from"../constants.js";import"../api/shared/dataFormatter.js";import{fetchOffsetWellSelectionAppOffsets as d}from"../api/external-offsets/fetchOffsetWellSelectionAppOffsets.js";import{fetchWellhubSettingsOffsets as m}from"../api/external-offsets/fetchWellhubSettingsOffsets.js";import"zustand";import"../stores/picker-props-store/PickerPropsStoreContext.js";import"@babel/runtime/helpers/objectWithoutProperties";import"../viewport/ViewportProvider.js";import"../viewport/ViewportContext.js";import"react/jsx-runtime";import{usePickerPropsStore as b}from"../stores/picker-props-store/usePickerPropsStore.js";import{classifyBicSourceBuckets as w}from"../utils/classifyBicSourceBuckets.js";function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function h(e){for(var r=1;r<arguments.length;r++){var s=null!=arguments[r]?arguments[r]:{};r%2?v(Object(s),!0).forEach((function(r){t(e,r,s[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):v(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var S={wellSections:null,offsetWellsBySection:null,taScores:[],idasWellIds:[],owsWellIds:[],wellhubWellIds:[],loadedAssetId:null},j=function(v,j){var W=b((function(e){return e.isWDUser})),O=b((function(e){return e.isManualWellsEnabled})),I=o(S),y=s(I,2),x=y[0],k=y[1],P=n(r(l.mark((function r(){var s,o,n,i,c,m,b,W,I,y,x,P,g,B,A,D,_,C,E,J,N;return l.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(v&&j){r.next=2;break}return r.abrupt("return");case 2:return r.prev=2,r.next=5,d(v);case 5:if(i=r.sent,c=null!==(s=null===(o=i[0])||void 0===o?void 0:o.data)&&void 0!==s?s:null,m=null!=c&&c.filters?JSON.parse(c.filters):null,b=null!=c&&c.result?JSON.parse(c.result):null,W=O&&null!=c&&c.manual_wells?JSON.parse(c.manual_wells):[],I=O&&null!=c&&c.ta_scores?JSON.parse(c.ta_scores):null,m&&b){r.next=20;break}if(W.length){r.next=15;break}return k(h(h({},S),{},{wellSections:[],offsetWellsBySection:{}})),r.abrupt("return");case 15:return y=a([v].concat(e(W))),x=W.map((function(e,t){var r;return{wellId:e,taScore:null!==(r=null==I?void 0:I[t])&&void 0!==r?r:""}})),P=w({resultSectionIds:[],manualWellIds:W,assetId:v}),g=P.idasWellIds,B=P.owsWellIds,k({wellSections:[],offsetWellsBySection:t({},p,y),taScores:x,idasWellIds:g,owsWellIds:B,wellhubWellIds:[],loadedAssetId:v}),r.abrupt("return");case 20:A=(null===(n=m.filterTabs)||void 0===n?void 0:n.map((function(e,t){return{value:e.value,label:e.name,color:u[t]}})))||[],D=[v],_=A.reduce((function(e,r){var s=r.value,l=b[s]||[],o=a(l.concat(v));return D=D.concat(o),h(h({},e),{},t({},s,o))}),{}),C=[],W.length&&(D=D.concat(W),C=W.map((function(e,t){var r;return{wellId:e,taScore:null!==(r=null==I?void 0:I[t])&&void 0!==r?r:""}}))),_[p]=a(D),E=w({resultSectionIds:A.map((function(e){var t=e.value;return b[t]||[]})),manualWellIds:W,assetId:v}),J=E.idasWellIds,N=E.owsWellIds,k({wellSections:[{value:p,label:f}].concat(e(A)),offsetWellsBySection:_,taScores:C,idasWellIds:J,owsWellIds:N,wellhubWellIds:[],loadedAssetId:v}),r.next=34;break;case 30:r.prev=30,r.t0=r.catch(2),console.error("Offset well selection fetch error: ",r.t0),k(h(h({},S),{},{wellSections:[],offsetWellsBySection:{}}));case 34:case"end":return r.stop()}}),r,null,[[2,30]])}))),[v,j,O]),g=n(r(l.mark((function e(){var r,s,o,n;return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v&&j){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,m(v);case 5:r=e.sent,s=c(r[0],"data.offset_wells")||[],o=t({},p,a(s.map((function(e){return e.id})).concat(v))),n=a(s.map((function(e){return e.id}))).filter((function(e){return e!==v})),k(h(h({},S),{},{wellSections:[{value:p,label:f}],offsetWellsBySection:o,wellhubWellIds:n,loadedAssetId:v})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(2),console.error("Wellhub fetch error: ",e.t0),k(h(h({},S),{},{wellSections:[],offsetWellsBySection:{}}));case 16:case"end":return e.stop()}}),e,null,[[2,12]])}))),[v,j]),B=n(r(l.mark((function e(){return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!W){e.next=5;break}return e.next=3,P();case 3:e.next=7;break;case 5:return e.next=7,g();case 7:case"end":return e.stop()}}),e)}))),[W,P,g]);return i((function(){v&&j?B():!v&&j&&k(h(h({},S),{},{wellSections:[{value:p,label:f}],offsetWellsBySection:t({},p,[])}))}),[v,j,B]),{offsets:x,setOffsets:k,loadExternalOffsets:B}};export{j as useExternalOffsets};
|
|
2
2
|
//# sourceMappingURL=useExternalOffsets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExternalOffsets.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/useExternalOffsets.ts"],"sourcesContent":["import { useCallback, useEffect, useState, type Dispatch, type SetStateAction } from 'react';\nimport { get, uniq } from 'lodash';\n\nimport { fetchOffsetWellSelectionAppOffsets, fetchWellhubSettingsOffsets } from '../api';\nimport { ALL_SECTION_KEY, ALL_SECTION_LABEL, WellSectionColors } from '../constants';\nimport { usePickerPropsStore } from '../stores/picker-props-store';\nimport { classifyBicSourceBuckets } from '../utils/classifyBicSourceBuckets';\n\nexport type WellSection = {\n value: string;\n label: string;\n color?: string;\n};\n\nexport type OffsetWellsBySection = Record<string, number[]>;\n\nexport type TaScore = {\n wellId: number;\n taScore: string | number;\n};\n\nexport type OffsetsState = {\n wellSections: WellSection[] | null;\n offsetWellsBySection: OffsetWellsBySection | null;\n taScores: TaScore[];\n /** Raw IDAS-classified wells from BIC. Subject excluded. Not viewport-filtered. */\n idasWellIds: number[];\n /** Raw Offset Well Selection app wells from BIC. Subject excluded. Not viewport-filtered. */\n owsWellIds: number[];\n /** Raw Wellhub auto wells. Subject excluded. Not viewport-filtered. */\n wellhubWellIds: number[];\n loadedAssetId: number | null;\n};\n\nconst INITIAL_OFFSETS_STATE: OffsetsState = {\n wellSections: null,\n offsetWellsBySection: null,\n taScores: [],\n idasWellIds: [],\n owsWellIds: [],\n wellhubWellIds: [],\n loadedAssetId: null,\n};\n\ntype UseExternalOffsetsReturn = {\n offsets: OffsetsState;\n setOffsets: Dispatch<SetStateAction<OffsetsState>>;\n loadExternalOffsets: () => Promise<void>;\n};\n\nexport const useExternalOffsets = (\n assetId: number | null,\n wells: Array<{ id: number }> | null\n): UseExternalOffsetsReturn => {\n const isWDUser = usePickerPropsStore(state => state.isWDUser);\n const isManualWellsEnabled = usePickerPropsStore(state => state.isManualWellsEnabled);\n\n const [offsets, setOffsets] = useState<OffsetsState>(INITIAL_OFFSETS_STATE);\n\n const loadOffsetWellSelectionAppOffsets = useCallback(async () => {\n if (!assetId || !wells) return;\n\n try {\n const data = await fetchOffsetWellSelectionAppOffsets(assetId);\n const record = data[0]?.data ?? null;\n const filters = record?.filters ? JSON.parse(record.filters) : null;\n const result = record?.result ? JSON.parse(record.result) : null;\n const manualWellIdsFromBIC: number[] =\n isManualWellsEnabled && record?.manual_wells ? JSON.parse(record.manual_wells) : [];\n const parsedTaScores =\n isManualWellsEnabled && record?.ta_scores ? JSON.parse(record.ta_scores) : null;\n\n if (!filters || !result) {\n if (!manualWellIdsFromBIC.length) {\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [],\n offsetWellsBySection: {},\n });\n return;\n }\n\n // BIC has manual_wells but no filter-driven sections — typical after an\n // IDAS resync on an asset where the picker was never opened. Build a\n // minimal state so the IDAS wells still flow through.\n const allWellIds = uniq([assetId, ...manualWellIdsFromBIC]);\n const taScoresOnly: TaScore[] = manualWellIdsFromBIC.map((wellId, index) => ({\n wellId,\n taScore: parsedTaScores?.[index] ?? '',\n }));\n const { idasWellIds, owsWellIds } = classifyBicSourceBuckets({\n resultSectionIds: [],\n manualWellIds: manualWellIdsFromBIC,\n assetId,\n });\n\n setOffsets({\n wellSections: [],\n offsetWellsBySection: { [ALL_SECTION_KEY]: allWellIds },\n taScores: taScoresOnly,\n idasWellIds,\n owsWellIds,\n wellhubWellIds: [],\n loadedAssetId: assetId,\n });\n return;\n }\n\n const sections: WellSection[] =\n filters.filterTabs?.map((tab: { value: string; name: string }, index: number) => ({\n value: tab.value,\n label: tab.name,\n color: WellSectionColors[index],\n })) || [];\n\n let allWellIds: number[] = [assetId];\n const wellsData: OffsetWellsBySection = sections.reduce<OffsetWellsBySection>(\n (acc, { value }) => {\n const sectionWellIds: number[] = result[value] || [];\n const addedWellIds = uniq(sectionWellIds.concat(assetId));\n allWellIds = allWellIds.concat(addedWellIds);\n return { ...acc, [value]: addedWellIds };\n },\n {}\n );\n\n let nextTaScores: TaScore[] = [];\n if (manualWellIdsFromBIC.length) {\n allWellIds = allWellIds.concat(manualWellIdsFromBIC);\n nextTaScores = manualWellIdsFromBIC.map((wellId: number, index: number) => ({\n wellId,\n taScore: parsedTaScores?.[index] ?? '',\n }));\n }\n\n wellsData[ALL_SECTION_KEY] = uniq(allWellIds);\n\n const { idasWellIds, owsWellIds } = classifyBicSourceBuckets({\n resultSectionIds: sections.map(({ value }) => (result[value] || []) as number[]),\n manualWellIds: manualWellIdsFromBIC,\n assetId,\n });\n\n setOffsets({\n wellSections: [{ value: ALL_SECTION_KEY, label: ALL_SECTION_LABEL }, ...sections],\n offsetWellsBySection: wellsData,\n taScores: nextTaScores,\n idasWellIds,\n owsWellIds,\n wellhubWellIds: [],\n loadedAssetId: assetId,\n });\n } catch (err) {\n console.error('Offset well selection fetch error: ', err);\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [],\n offsetWellsBySection: {},\n });\n }\n }, [assetId, wells, isManualWellsEnabled]);\n\n const loadWellhubSettingsOffsets = useCallback(async () => {\n if (!assetId || !wells) return;\n\n try {\n const record = await fetchWellhubSettingsOffsets(assetId);\n const offsetWells: Array<{ id: number }> = get(record[0], 'data.offset_wells') || [];\n const wellsData: OffsetWellsBySection = {\n [ALL_SECTION_KEY]: uniq(offsetWells.map(({ id }) => id).concat(assetId)),\n };\n\n const wellhubWellIds = uniq(offsetWells.map(({ id }) => id)).filter(id => id !== assetId);\n\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [{ value: ALL_SECTION_KEY, label: ALL_SECTION_LABEL }],\n offsetWellsBySection: wellsData,\n wellhubWellIds,\n loadedAssetId: assetId,\n });\n } catch (err) {\n console.error('Wellhub fetch error: ', err);\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [],\n offsetWellsBySection: {},\n });\n }\n }, [assetId, wells]);\n\n const loadExternalOffsets = useCallback(async () => {\n if (isWDUser) {\n await loadOffsetWellSelectionAppOffsets();\n } else {\n await loadWellhubSettingsOffsets();\n }\n }, [isWDUser, loadOffsetWellSelectionAppOffsets, loadWellhubSettingsOffsets]);\n\n useEffect(() => {\n if (assetId && wells) {\n loadExternalOffsets();\n } else if (!assetId && wells) {\n // No subject well - initialize with defaults to clear loading state\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [{ value: ALL_SECTION_KEY, label: ALL_SECTION_LABEL }],\n offsetWellsBySection: { [ALL_SECTION_KEY]: [] },\n });\n }\n }, [assetId, wells, loadExternalOffsets]);\n\n return {\n offsets,\n setOffsets,\n loadExternalOffsets,\n };\n};\n"],"names":["INITIAL_OFFSETS_STATE","wellSections","offsetWellsBySection","taScores","idasWellIds","owsWellIds","wellhubWellIds","loadedAssetId","useExternalOffsets","assetId","wells","isWDUser","usePickerPropsStore","state","isManualWellsEnabled","useState","_useState2","_slicedToArray","_useState","offsets","setOffsets","loadOffsetWellSelectionAppOffsets","useCallback","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_data$0$data","_data$","_filters$filterTabs","data","record","filters","result","manualWellIdsFromBIC","parsedTaScores","_allWellIds","taScoresOnly","_classifyBicSourceBuc","_idasWellIds","_owsWellIds","sections","allWellIds","wellsData","nextTaScores","_classifyBicSourceBuc2","wrap","_context","prev","next","abrupt","fetchOffsetWellSelectionAppOffsets","sent","JSON","parse","manual_wells","ta_scores","length","uniq","concat","_toConsumableArray","map","wellId","index","_parsedTaScores$index","taScore","classifyBicSourceBuckets","resultSectionIds","manualWellIds","ALL_SECTION_KEY","filterTabs","tab","value","label","name","color","WellSectionColors","reduce","acc","_ref2","sectionWellIds","addedWellIds","_objectSpread","_defineProperty","_parsedTaScores$index2","_ref3","ALL_SECTION_LABEL","t0","console","error","stop","loadWellhubSettingsOffsets","_callee2","offsetWells","_context2","fetchWellhubSettingsOffsets","get","_ref5","id","_ref6","filter","loadExternalOffsets","_callee3","_context3","useEffect"],"mappings":"kpEAkCA,IAAMA,EAAsC,CAC1CC,aAAc,KACdC,qBAAsB,KACtBC,SAAU,GACVC,YAAa,GACbC,WAAY,GACZC,eAAgB,GAChBC,cAAe,MASJC,EAAqB,SAChCC,EACAC,GAEA,IAAMC,EAAWC,GAAoB,SAAAC,GAAK,OAAIA,EAAMF,YAC9CG,EAAuBF,GAAoB,SAAAC,GAAK,OAAIA,EAAMC,wBAElCC,EAAAA,EAAuBf,GAAsBgB,EAAAC,EAAAC,EAAA,GAApEC,EAAOH,EAAA,GAAEI,EAAUJ,EAAA,GAEpBK,EAAoCC,EAAYC,EAAAC,EAAAC,MAAA,SAAAC,IAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAzC,EAAAC,EAAA,OAAAmB,EAAAsB,MAAA,S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KAAA,GAAA8C,EAAAP,GAAAO,EAAA,MAAA,GAEHN,QAAQC,MAAM,wBAA6BK,EAAAP,IAC3CnE,SACKpB,GAAqB,CAAA,EAAA,CACxBC,aAAc,GACdC,qBAAsB,CAAC,KACtB,KAAA,GAAA,IAAA,MAAA,OAAA4F,EAAAJ,OAAA,GAAAE,EAAA,KAAA,CAAA,CAAA,EAAA,KAEN,KAAE,CAACnF,EAASC,IAEP2F,EAAsB/E,EAAYC,EAAAC,EAAAC,MAAA,SAAA6E,IAAA,OAAA9E,EAAAsB,MAAA,SAAAyD,GAAA,OAAA,OAAAA,EAAAvD,KAAAuD,EAAAtD,MAAA,KAAA,EAAA,IAClCtC,EAAQ,CAAA4F,EAAAtD,KAAA,EAAA,KAAA,CAAA,OAAAsD,EAAAtD,KAAA,EACJ5B,IAAmC,KAAA,EAAAkF,EAAAtD,KAAA,EAAA,MAAA,KAAA,EAAA,OAAAsD,EAAAtD,KAAA,EAEnC0C,IAA4B,KAAA,EAAA,IAAA,MAAA,OAAAY,EAAAb,OAAA,GAAAY,EAErC,KAAE,CAAC3F,EAAUU,EAAmCsE,IAejD,OAbAa,GAAU,WACJ/F,GAAWC,EACb2F,KACU5F,GAAWC,GAErBU,SACKpB,GAAqB,CAAA,EAAA,CACxBC,aAAc,CAAC,CAAEuE,MAAOH,EAAiBI,MAAOa,IAChDpF,qBAAoBiF,EAAA,GAAKd,EAAkB,MAGhD,GAAE,CAAC5D,EAASC,EAAO2F,IAEb,CACLlF,QAAAA,EACAC,WAAAA,EACAiF,oBAAAA,EAEJ"}
|
|
1
|
+
{"version":3,"file":"useExternalOffsets.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/useExternalOffsets.ts"],"sourcesContent":["import { useCallback, useEffect, useState, type Dispatch, type SetStateAction } from 'react';\nimport { get, uniq } from 'lodash';\n\nimport { fetchOffsetWellSelectionAppOffsets, fetchWellhubSettingsOffsets } from '../api';\nimport { ALL_SECTION_KEY, ALL_SECTION_LABEL, WellSectionColors } from '../constants';\nimport { usePickerPropsStore } from '../stores/picker-props-store';\nimport { classifyBicSourceBuckets } from '../utils/classifyBicSourceBuckets';\n\nexport type WellSection = {\n value: string;\n label: string;\n color?: string;\n};\n\nexport type OffsetWellsBySection = Record<string, number[]>;\n\nexport type TaScore = {\n wellId: number;\n taScore: string | number;\n};\n\nexport type OffsetsState = {\n wellSections: WellSection[] | null;\n offsetWellsBySection: OffsetWellsBySection | null;\n taScores: TaScore[];\n /** Raw IDAS-classified wells from BIC. Subject excluded. Not viewport-filtered. */\n idasWellIds: number[];\n /** Raw Offset Well Selection app wells from BIC. Subject excluded. Not viewport-filtered. */\n owsWellIds: number[];\n /** Raw Wellhub auto wells. Subject excluded. Not viewport-filtered. */\n wellhubWellIds: number[];\n loadedAssetId: number | null;\n};\n\nconst INITIAL_OFFSETS_STATE: OffsetsState = {\n wellSections: null,\n offsetWellsBySection: null,\n taScores: [],\n idasWellIds: [],\n owsWellIds: [],\n wellhubWellIds: [],\n loadedAssetId: null,\n};\n\ntype UseExternalOffsetsReturn = {\n offsets: OffsetsState;\n setOffsets: Dispatch<SetStateAction<OffsetsState>>;\n loadExternalOffsets: () => Promise<void>;\n};\n\nexport const useExternalOffsets = (\n assetId: number | null,\n wells: Array<{ id: number }> | null\n): UseExternalOffsetsReturn => {\n const isWDUser = usePickerPropsStore(state => state.isWDUser);\n const isManualWellsEnabled = usePickerPropsStore(state => state.isManualWellsEnabled);\n\n const [offsets, setOffsets] = useState<OffsetsState>(INITIAL_OFFSETS_STATE);\n\n const loadOffsetWellSelectionAppOffsets = useCallback(async () => {\n if (!assetId || !wells) return;\n\n try {\n const data = await fetchOffsetWellSelectionAppOffsets(assetId);\n const record = data[0]?.data ?? null;\n const filters = record?.filters ? JSON.parse(record.filters) : null;\n const result = record?.result ? JSON.parse(record.result) : null;\n const manualWellIdsFromBIC: number[] =\n isManualWellsEnabled && record?.manual_wells ? JSON.parse(record.manual_wells) : [];\n const parsedTaScores =\n isManualWellsEnabled && record?.ta_scores ? JSON.parse(record.ta_scores) : null;\n\n if (!filters || !result) {\n if (!manualWellIdsFromBIC.length) {\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [],\n offsetWellsBySection: {},\n });\n return;\n }\n\n // BIC has manual_wells but no filter-driven sections — typical after an\n // IDAS resync on an asset where the picker was never opened. Build a\n // minimal state so the IDAS wells still flow through.\n const allWellIds = uniq([assetId, ...manualWellIdsFromBIC]);\n const taScoresOnly: TaScore[] = manualWellIdsFromBIC.map((wellId, index) => ({\n wellId,\n taScore: parsedTaScores?.[index] ?? '',\n }));\n const { idasWellIds, owsWellIds } = classifyBicSourceBuckets({\n resultSectionIds: [],\n manualWellIds: manualWellIdsFromBIC,\n assetId,\n });\n\n setOffsets({\n wellSections: [],\n offsetWellsBySection: { [ALL_SECTION_KEY]: allWellIds },\n taScores: taScoresOnly,\n idasWellIds,\n owsWellIds,\n wellhubWellIds: [],\n loadedAssetId: assetId,\n });\n return;\n }\n\n const sections: WellSection[] =\n filters.filterTabs?.map((tab: { value: string; name: string }, index: number) => ({\n value: tab.value,\n label: tab.name,\n color: WellSectionColors[index],\n })) || [];\n\n let allWellIds: number[] = [assetId];\n const wellsData: OffsetWellsBySection = sections.reduce<OffsetWellsBySection>(\n (acc, { value }) => {\n const sectionWellIds: number[] = result[value] || [];\n const addedWellIds = uniq(sectionWellIds.concat(assetId));\n allWellIds = allWellIds.concat(addedWellIds);\n return { ...acc, [value]: addedWellIds };\n },\n {}\n );\n\n let nextTaScores: TaScore[] = [];\n if (manualWellIdsFromBIC.length) {\n allWellIds = allWellIds.concat(manualWellIdsFromBIC);\n nextTaScores = manualWellIdsFromBIC.map((wellId: number, index: number) => ({\n wellId,\n taScore: parsedTaScores?.[index] ?? '',\n }));\n }\n\n wellsData[ALL_SECTION_KEY] = uniq(allWellIds);\n\n const { idasWellIds, owsWellIds } = classifyBicSourceBuckets({\n resultSectionIds: sections.map(({ value }) => (result[value] || []) as number[]),\n manualWellIds: manualWellIdsFromBIC,\n assetId,\n });\n\n setOffsets({\n wellSections: [{ value: ALL_SECTION_KEY, label: ALL_SECTION_LABEL }, ...sections],\n offsetWellsBySection: wellsData,\n taScores: nextTaScores,\n idasWellIds,\n owsWellIds,\n wellhubWellIds: [],\n loadedAssetId: assetId,\n });\n } catch (err) {\n console.error('Offset well selection fetch error: ', err);\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [],\n offsetWellsBySection: {},\n });\n }\n }, [assetId, wells, isManualWellsEnabled]);\n\n const loadWellhubSettingsOffsets = useCallback(async () => {\n if (!assetId || !wells) return;\n\n try {\n const record = await fetchWellhubSettingsOffsets(assetId);\n const offsetWells: Array<{ id: number }> = get(record[0], 'data.offset_wells') || [];\n const wellsData: OffsetWellsBySection = {\n [ALL_SECTION_KEY]: uniq(offsetWells.map(({ id }) => id).concat(assetId)),\n };\n\n const wellhubWellIds = uniq(offsetWells.map(({ id }) => id)).filter(id => id !== assetId);\n\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [{ value: ALL_SECTION_KEY, label: ALL_SECTION_LABEL }],\n offsetWellsBySection: wellsData,\n wellhubWellIds,\n loadedAssetId: assetId,\n });\n } catch (err) {\n console.error('Wellhub fetch error: ', err);\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [],\n offsetWellsBySection: {},\n });\n }\n }, [assetId, wells]);\n\n const loadExternalOffsets = useCallback(async () => {\n if (isWDUser) {\n await loadOffsetWellSelectionAppOffsets();\n } else {\n await loadWellhubSettingsOffsets();\n }\n }, [isWDUser, loadOffsetWellSelectionAppOffsets, loadWellhubSettingsOffsets]);\n\n useEffect(() => {\n if (assetId && wells) {\n loadExternalOffsets();\n } else if (!assetId && wells) {\n // No subject well - initialize with defaults to clear loading state\n setOffsets({\n ...INITIAL_OFFSETS_STATE,\n wellSections: [{ value: ALL_SECTION_KEY, label: ALL_SECTION_LABEL }],\n offsetWellsBySection: { [ALL_SECTION_KEY]: [] },\n });\n }\n }, [assetId, wells, loadExternalOffsets]);\n\n return {\n offsets,\n setOffsets,\n loadExternalOffsets,\n };\n};\n"],"names":["INITIAL_OFFSETS_STATE","wellSections","offsetWellsBySection","taScores","idasWellIds","owsWellIds","wellhubWellIds","loadedAssetId","useExternalOffsets","assetId","wells","isWDUser","usePickerPropsStore","state","isManualWellsEnabled","useState","_useState2","_slicedToArray","_useState","offsets","setOffsets","loadOffsetWellSelectionAppOffsets","useCallback","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_data$0$data","_data$","_filters$filterTabs","data","record","filters","result","manualWellIdsFromBIC","parsedTaScores","_allWellIds","taScoresOnly","_classifyBicSourceBuc","_idasWellIds","_owsWellIds","sections","allWellIds","wellsData","nextTaScores","_classifyBicSourceBuc2","wrap","_context","prev","next","abrupt","fetchOffsetWellSelectionAppOffsets","sent","JSON","parse","manual_wells","ta_scores","length","uniq","concat","_toConsumableArray","map","wellId","index","_parsedTaScores$index","taScore","classifyBicSourceBuckets","resultSectionIds","manualWellIds","ALL_SECTION_KEY","filterTabs","tab","value","label","name","color","WellSectionColors","reduce","acc","_ref2","sectionWellIds","addedWellIds","_objectSpread","_defineProperty","_parsedTaScores$index2","_ref3","ALL_SECTION_LABEL","t0","console","error","stop","loadWellhubSettingsOffsets","_callee2","offsetWells","_context2","fetchWellhubSettingsOffsets","get","_ref5","id","_ref6","filter","loadExternalOffsets","_callee3","_context3","useEffect"],"mappings":"oiEAkCA,IAAMA,EAAsC,CAC1CC,aAAc,KACdC,qBAAsB,KACtBC,SAAU,GACVC,YAAa,GACbC,WAAY,GACZC,eAAgB,GAChBC,cAAe,MASJC,EAAqB,SAChCC,EACAC,GAEA,IAAMC,EAAWC,GAAoB,SAAAC,GAAK,OAAIA,EAAMF,YAC9CG,EAAuBF,GAAoB,SAAAC,GAAK,OAAIA,EAAMC,wBAElCC,EAAAA,EAAuBf,GAAsBgB,EAAAC,EAAAC,EAAA,GAApEC,EAAOH,EAAA,GAAEI,EAAUJ,EAAA,GAE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
|
|
1
|
-
import{checkIsUserAdmin as t}from"../utils/checkIsUserAdmin.js";import{usePickerPropsStore as s}from"../stores/picker-props-store/usePickerPropsStore.js";import"
|
|
1
|
+
import{checkIsUserAdmin as t}from"../utils/checkIsUserAdmin.js";import{usePickerPropsStore as s}from"../stores/picker-props-store/usePickerPropsStore.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/slicedToArray";import"querystring";import"react";import"lodash";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../clients/jsonApi/index.js";import"query-string";import"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/appPackages.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import"../../../constants/corvaCompanyId.js";import"../../GradientManager/configuration/constants.js";import"../../UserMention/utils/index.js";import"../../../utils/convert.js";import"moment";import"../../../utils/casing/validation.js";import"lodash/mean";import"../../../constants/streamSourceType.js";import"lodash/get";import"file-saver";import"../../../utils/drillstring/conversion.js";import"lodash/set";import"lodash/cloneDeep";import"@babel/runtime/helpers/toConsumableArray";import"lodash/isNumber";import"lodash/has";import"../../../utils/ga.js";import"../../../utils/goalsConfig/goalsConfig.js";import"../../../utils/lasParser.js";import"../../../utils/main.js";import"../../../utils/metrics/metricsConfig.js";import"../../../utils/mobileDetect.js";import"../../../utils/feed.js";import"../../../utils/reports.js";import"moment-timezone";import"@babel/runtime/helpers/typeof";import"../../../utils/dashboardReports.js";import"../../../utils/env.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../../utils/jsonaDataFormatter.js";import"../../../utils/bha.js";import"jsona";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../../../utils/charts/Styles.scss.js";import"../../../utils/getSingleAsset.js";import"uuid";import"../../StatusBadge/constants.js";import"lodash/unset";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import"../../../clients/sso/auth0.js";import"../../../clients/sso/oauth2.js";import"../../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import{useAppCommons as o}from"../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../componentsV2/AppPanel/AppPanelsContext.js";var i=function(){var i,r=null===(i=o())||void 0===i?void 0:i.currentUser,e=s((function(t){return t.currentUser}));return t(null!=r?r:e)};export{i as useIsAdmin};
|
|
2
2
|
//# sourceMappingURL=useIsAdmin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsAdmin.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/useIsAdmin.ts"],"sourcesContent":["import { checkIsUserAdmin } from '../utils/checkIsUserAdmin';\nimport { usePickerPropsStore } from '../stores/picker-props-store/usePickerPropsStore';\n\nimport { useAppCommons } from '~/effects';\n\nexport const useIsAdmin = (): boolean => {\n const appCommonsUser = useAppCommons()?.currentUser;\n const pickerPropsUser = usePickerPropsStore(state => state.currentUser);\n\n return checkIsUserAdmin(appCommonsUser ?? pickerPropsUser);\n};\n"],"names":["useIsAdmin","_useAppCommons","appCommonsUser","useAppCommons","currentUser","pickerPropsUser","usePickerPropsStore","state","checkIsUserAdmin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIsAdmin.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/useIsAdmin.ts"],"sourcesContent":["import { checkIsUserAdmin } from '../utils/checkIsUserAdmin';\nimport { usePickerPropsStore } from '../stores/picker-props-store/usePickerPropsStore';\n\nimport { useAppCommons } from '~/effects';\n\nexport const useIsAdmin = (): boolean => {\n const appCommonsUser = useAppCommons()?.currentUser;\n const pickerPropsUser = usePickerPropsStore(state => state.currentUser);\n\n return checkIsUserAdmin(appCommonsUser ?? pickerPropsUser);\n};\n"],"names":["useIsAdmin","_useAppCommons","appCommonsUser","useAppCommons","currentUser","pickerPropsUser","usePickerPropsStore","state","checkIsUserAdmin"],"mappings":"8vFAKaA,IAAAA,EAAa,WAAe,IAAAC,EACjCC,EAAgC,QAAfC,EAAAA,WAAe,IAAAF,OAAA,EAAfA,EAAiBG,YAClCC,EAAkBC,GAAoB,SAAAC,GAAK,OAAIA,EAAMH,eAE3D,OAAOI,EAAiBN,QAAAA,EAAkBG,EAC5C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/regenerator";import{useState as n,useRef as i,useCallback as o,useEffect as s}from"react";import{fetchWellsByIds as a}from"../api/wells/fetchWellsByIds.js";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"
|
|
1
|
+
import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/regenerator";import{useState as n,useRef as i,useCallback as o,useEffect as s}from"react";import{fetchWellsByIds as a}from"../api/wells/fetchWellsByIds.js";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import"../../../clients/sso/auth0.js";import"../../../clients/sso/oauth2.js";import"../../../clients/api/rateLimiter.js";import"../constants.js";import"../api/shared/dataFormatter.js";import{usePickerPropsStore as u}from"../stores/picker-props-store/usePickerPropsStore.js";var c=function(c){var p=u((function(r){return r.addWellsUsabilityInfo})),l=n(null),m=t(l,2),f=m[0],h=m[1],b=n(!1),d=t(b,2),j=d[0],v=d[1],x=i(new Map),g=o(function(){var t=r(e.mark((function r(t){var n,i,o,s,u;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==t.length){r.next=3;break}return h([]),r.abrupt("return");case 3:if(0!==(n=t.filter((function(r){return!x.current.has(r)}))).length){r.next=8;break}return i=t.map((function(r){return x.current.get(r)})).filter((function(r){return void 0!==r})),h(i),r.abrupt("return");case 8:return v(!0),r.prev=9,r.next=12,a(n);case 12:if(o=r.sent,"function"!=typeof p){r.next=19;break}return r.next=16,p(o);case 16:r.t0=r.sent,r.next=20;break;case 19:r.t0=o;case 20:r.t0.forEach((function(r){x.current.set(r.id,r)})),s=t.map((function(r){return x.current.get(r)})).filter((function(r){return void 0!==r})),h(s),r.next=31;break;case 26:r.prev=26,r.t1=r.catch(9),console.error("Error fetching pinned wells:",r.t1),u=t.map((function(r){return x.current.get(r)})).filter((function(r){return void 0!==r})),h(u.length>0?u:null);case 31:return r.prev=31,v(!1),r.finish(31);case 34:case"end":return r.stop()}}),r,null,[[9,26,31,34]])})));return function(r){return t.apply(this,arguments)}}(),[p]);return s((function(){g(c||[])}),[c,g]),[f,j]};export{c as usePinnedWells};
|
|
2
2
|
//# sourceMappingURL=usePinnedWells.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePinnedWells.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/usePinnedWells.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\n\nimport { fetchWellsByIds } from '../api';\nimport type { OffsetWell } from '../OffsetWellPickerV5.types';\nimport { usePickerPropsStore } from '../stores/picker-props-store/usePickerPropsStore';\n\n/**\n * Hook to fetch and maintain \"pinned\" wells that should always be displayed\n * regardless of radius/shape selection. These wells are fetched by ID independently\n * of the main radius-based fetch.\n *\n * @param selectedWellIds - Array of well IDs that should always be available\n * @returns Tuple of [pinnedWells, isLoading]\n */\nexport const usePinnedWells = (\n selectedWellIds: number[] | undefined\n): [OffsetWell[] | null, boolean] => {\n const addWellsUsabilityInfo = usePickerPropsStore(state => state.addWellsUsabilityInfo);\n\n const [pinnedWells, setPinnedWells] = useState<OffsetWell[] | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n // Cache of already fetched wells to avoid re-fetching\n const wellsCacheRef = useRef<Map<number, OffsetWell>>(new Map());\n\n const fetchAndCacheWells = useCallback(\n async (ids: number[]): Promise<void> => {\n if (ids.length === 0) {\n setPinnedWells([]);\n return;\n }\n\n const missingIds = ids.filter(id => !wellsCacheRef.current.has(id));\n\n if (missingIds.length === 0) {\n const cached = ids\n .map(id => wellsCacheRef.current.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n setPinnedWells(cached);\n return;\n }\n\n setIsLoading(true);\n\n try {\n const fetched = await fetchWellsByIds(missingIds);\n\n const processed =\n typeof addWellsUsabilityInfo === 'function'\n ? await addWellsUsabilityInfo(fetched as unknown as OffsetWell[])\n : (fetched as unknown as OffsetWell[]);\n\n processed.forEach(well => {\n wellsCacheRef.current.set(well.id, well);\n });\n\n const result = ids\n .map(id => wellsCacheRef.current.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n\n setPinnedWells(result);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error fetching pinned wells:', error);\n\n const cached = ids\n .map(id => wellsCacheRef.current.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n setPinnedWells(cached.length > 0 ? cached : null);\n } finally {\n setIsLoading(false);\n }\n },\n [addWellsUsabilityInfo]\n );\n\n useEffect(() => {\n const ids = selectedWellIds || [];\n\n fetchAndCacheWells(ids);\n }, [selectedWellIds, fetchAndCacheWells]);\n\n return [pinnedWells, isLoading];\n};\n"],"names":["usePinnedWells","selectedWellIds","addWellsUsabilityInfo","usePickerPropsStore","state","useState","_useState2","_slicedToArray","_useState","pinnedWells","setPinnedWells","_useState4","_useState3","isLoading","setIsLoading","wellsCacheRef","useRef","Map","fetchAndCacheWells","useCallback","_ref","_asyncToGenerator","_regeneratorRuntime","mark","ids","missingIds","cached","fetched","result","_cached","wrap","_context","prev","next","length","abrupt","filter","id","current","has","map","get","w","undefined","fetchWellsByIds","sent","t0","forEach","well","set","t1","console","error","finish","stop","_callee","_x","apply","this","arguments","useEffect"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePinnedWells.js","sources":["../../../../src/components/OffsetWellPickerV5/hooks/usePinnedWells.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\n\nimport { fetchWellsByIds } from '../api';\nimport type { OffsetWell } from '../OffsetWellPickerV5.types';\nimport { usePickerPropsStore } from '../stores/picker-props-store/usePickerPropsStore';\n\n/**\n * Hook to fetch and maintain \"pinned\" wells that should always be displayed\n * regardless of radius/shape selection. These wells are fetched by ID independently\n * of the main radius-based fetch.\n *\n * @param selectedWellIds - Array of well IDs that should always be available\n * @returns Tuple of [pinnedWells, isLoading]\n */\nexport const usePinnedWells = (\n selectedWellIds: number[] | undefined\n): [OffsetWell[] | null, boolean] => {\n const addWellsUsabilityInfo = usePickerPropsStore(state => state.addWellsUsabilityInfo);\n\n const [pinnedWells, setPinnedWells] = useState<OffsetWell[] | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n // Cache of already fetched wells to avoid re-fetching\n const wellsCacheRef = useRef<Map<number, OffsetWell>>(new Map());\n\n const fetchAndCacheWells = useCallback(\n async (ids: number[]): Promise<void> => {\n if (ids.length === 0) {\n setPinnedWells([]);\n return;\n }\n\n const missingIds = ids.filter(id => !wellsCacheRef.current.has(id));\n\n if (missingIds.length === 0) {\n const cached = ids\n .map(id => wellsCacheRef.current.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n setPinnedWells(cached);\n return;\n }\n\n setIsLoading(true);\n\n try {\n const fetched = await fetchWellsByIds(missingIds);\n\n const processed =\n typeof addWellsUsabilityInfo === 'function'\n ? await addWellsUsabilityInfo(fetched as unknown as OffsetWell[])\n : (fetched as unknown as OffsetWell[]);\n\n processed.forEach(well => {\n wellsCacheRef.current.set(well.id, well);\n });\n\n const result = ids\n .map(id => wellsCacheRef.current.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n\n setPinnedWells(result);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error fetching pinned wells:', error);\n\n const cached = ids\n .map(id => wellsCacheRef.current.get(id))\n .filter((w): w is OffsetWell => w !== undefined);\n setPinnedWells(cached.length > 0 ? cached : null);\n } finally {\n setIsLoading(false);\n }\n },\n [addWellsUsabilityInfo]\n );\n\n useEffect(() => {\n const ids = selectedWellIds || [];\n\n fetchAndCacheWells(ids);\n }, [selectedWellIds, fetchAndCacheWells]);\n\n return [pinnedWells, isLoading];\n};\n"],"names":["usePinnedWells","selectedWellIds","addWellsUsabilityInfo","usePickerPropsStore","state","useState","_useState2","_slicedToArray","_useState","pinnedWells","setPinnedWells","_useState4","_useState3","isLoading","setIsLoading","wellsCacheRef","useRef","Map","fetchAndCacheWells","useCallback","_ref","_asyncToGenerator","_regeneratorRuntime","mark","ids","missingIds","cached","fetched","result","_cached","wrap","_context","prev","next","length","abrupt","filter","id","current","has","map","get","w","undefined","fetchWellsByIds","sent","t0","forEach","well","set","t1","console","error","finish","stop","_callee","_x","apply","this","arguments","useEffect"],"mappings":"i7BAcaA,EAAiB,SAC5BC,GAEA,IAAMC,EAAwBC,GAAoB,SAAAC,GAAK,OAAIA,EAAMF,yBAE3BG,EAAAA,EAA8B,MAAKC,EAAAC,EAAAC,EAAA,GAAlEC,EAAWH,EAAA,GAAEI,EAAcJ,EAAA,GACAD,EAAAA,GAAS,GAAMM,EAAAJ,EAAAK,EAAA,GAA1CC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAGxBI,EAAgBC,EAAgC,IAAIC,KAEpDC,EAAqBC,EAAW,WAAA,IAAAC,EAAAC,EAAAC,EAAAC,MACpC,WAAOC,GAAa,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAP,EAAAQ,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,GACC,IAAfT,EAAIU,OAAY,CAAAH,EAAAE,KAAA,EAAA,KAAA,CACC,OAAnB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K,EAAAC,KAAA,GAElDlB,GAAa,GAAOiB,EAAAsB,OAAA,IAAA,KAAA,GAAA,IAAA,MAAA,OAAAtB,EAAAuB,OAAA,GAAAC,EAAA,KAAA,CAAA,CAAA,EAAA,GAAA,GAAA,KAEvB,KAAA,OAAA,SAAAC,GAAA,OAAApC,EAAAqC,MAAAC,KAAAC,UAAA,EA/CmC,GAgDpC,CAACzD,IASH,OANA0D,GAAU,WAGR1C,EAFYjB,GAAmB,GAGjC,GAAG,CAACA,EAAiBiB,IAEd,CAACT,EAAaI,EACvB"}
|
package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"
|
|
1
|
+
import t from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../../clients/jsonApi/index.js";import"../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"../../../../clients/api/rateLimiter.js";import"../../constants.js";import"../../api/shared/dataFormatter.js";import"@babel/runtime/helpers/slicedToArray";import{resyncIdasWells as r}from"../../api/external-offsets/resyncIdasWells.js";import{IdasResyncStatus as e}from"./idas-resync.types.js";import{getIdasResyncChannel as i}from"./idasResyncChannel.js";import{subscribeToIdasResync as n}from"./subscribeToIdasResync.js";import"../../../UserMention/utils/index.js";import"../../../../utils/convert.js";import"../../../../constants/completion.js";import"../../../../constants/alerts.js";import"../../../../utils/casing/validation.js";import"lodash/mean";import"../../../../constants/streamSourceType.js";import"file-saver";import"query-string";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../constants/corvaCompanyId.js";import"../../../GradientManager/configuration/constants.js";import"../../../../utils/drillstring/conversion.js";import"lodash/cloneDeep";import"lodash/isNumber";import"lodash/has";import"../../../../utils/ga.js";import"../../../../utils/goalsConfig/goalsConfig.js";import"../../../../utils/lasParser.js";import"../../../../utils/main.js";import"../../../../utils/metrics/metricsConfig.js";import"../../../../utils/mobileDetect.js";import"../../../../utils/feed.js";import"../../../../utils/reports.js";import"moment-timezone";import{showErrorNotification as o,showSuccessNotification as a}from"../../../../utils/notificationToasts.js";import"@babel/runtime/helpers/typeof";import"../../../../utils/dashboardReports.js";import"../../../../utils/env.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../../../utils/jsonaDataFormatter.js";import"../../../../utils/bha.js";import"jsona";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../../../../utils/charts/Styles.scss.js";import"../../../../utils/getSingleAsset.js";var l={multiline:!0,autoHideDuration:1e4},p=function(){},m=function(m){var u,c=null,f=null,d=!1,j={assetId:null,currentUser:void 0,loadExternalOffsets:(u=t(s.mark((function t(){return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",void 0);case 1:case"end":return t.stop()}}),t)}))),function(){return u.apply(this,arguments)})},h=function(t){var s;m.setState({status:t,isResyncInFlight:(s=t,s===e.TRIGGERED||s===e.RUNNING)})},v=function(){var t;null===(t=f)||void 0===t||t(),f=null},g=function(){c=null},b=function(){v(),g()},y=function(t){d&&(o(t,l),h(e.FAILED))},I=function(t,s){d&&t===c&&(g(),a(s,l),h(e.SUCCEEDED))},x=function(){var r=t(s.mark((function t(r,e){return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,j.loadExternalOffsets();case 3:return t.prev=3,I(r,e),t.finish(3);case 6:case"end":return t.stop()}}),t,null,[[0,,3,6]])})));return function(t,s){return r.apply(this,arguments)}}(),R=function(t,s){t===c&&(b(),y(s||"Re-sync wells from IDAS failed"))},D=function(){var e=t(s.mark((function t(e){var i,n;return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(i=j.currentUser)&&i.id){t.next=4;break}return R(e,void 0),t.abrupt("return");case 4:return t.prev=4,t.next=7,r(i,e);case 7:"failed"===(null==(n=t.sent)?void 0:n.state)&&R(e,n.fail_reason),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(4),R(e,t.t0 instanceof Error?t.t0.message:void 0);case 14:case"end":return t.stop()}}),t,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}(),S=function(){var t=j,s=t.assetId,r=t.currentUser;if(s&&null!=r&&r.id&&null===c){var o=s;c=o;var a=i(o);f=n(a,(function(t){return function(t,s){d&&t===c&&(v(),"success"===(null==s?void 0:s.status)?x(t,s.message):(g(),y((null==s?void 0:s.message)||"Re-sync wells from IDAS failed")))}(o,t)})),h(e.RUNNING),D(o)}};return{activate:function(){d=!0,m.setState({triggerResync:S})},deactivate:function(){d=!1,b(),m.setState({triggerResync:p})},update:function(t){null!==c&&t.assetId!==c&&m.getState().isResyncInFlight&&(b(),h(e.INITIAL)),j=t}}};export{m as createIdasResyncController};
|
|
2
2
|
//# sourceMappingURL=createIdasResyncController.js.map
|
package/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIdasResyncController.js","sources":["../../../../../src/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.ts"],"sourcesContent":["import { resyncIdasWells } from '../../api';\nimport type { PickerPropsStore } from '../picker-props-store';\n\nimport type { IdasResyncStoreApi } from './createIdasResyncStore';\nimport {\n IdasResyncStatus,\n type IdasResyncStatusValue,\n type IdasSubscriptionPayload,\n} from './idas-resync.types';\nimport { getIdasResyncChannel } from './idasResyncChannel';\nimport { subscribeToIdasResync } from './subscribeToIdasResync';\n\nimport { showErrorNotification, showSuccessNotification } from '~/utils';\n\ntype ControllerUser = PickerPropsStore['currentUser'];\n\nexport type IdasResyncControllerInputs = {\n assetId: number | null;\n currentUser: ControllerUser;\n loadExternalOffsets: () => Promise<void>;\n};\n\nexport type IdasResyncController = {\n activate: () => void;\n deactivate: () => void;\n update: (inputs: IdasResyncControllerInputs) => void;\n};\n\nconst RESYNC_FAILED_FALLBACK = 'Re-sync wells from IDAS failed';\n\nconst TOAST_OPTIONS = { multiline: true, autoHideDuration: 10_000 };\n\nconst noop = (): void => undefined;\n\nconst isInFlightStatus = (status: IdasResyncStatusValue): boolean =>\n status === IdasResyncStatus.TRIGGERED || status === IdasResyncStatus.RUNNING;\n\n/**\n * Drives the IDAS re-sync state machine for a subject asset and writes its\n * state into `IdasResyncStore`. Consumers (e.g. `HeaderActions`,\n * `PickerModalActions`, `OffsetWellPickerV5`) subscribe via\n * `useIdasResyncStore` instead of having props drilled through the tree.\n *\n * Flow: subscribe → POST task → resolve via subscription event\n * ({ status, message }). The task-app response is used only for dual-track\n * failure detection (state === 'failed'); the underlying app's outcome is\n * carried by the subscription message.\n *\n * The socket is wired manually via `subscribeToIdasResync` rather than\n * `useSubscriptionsV2` because we want no historical fetch and explicit\n * single-shot teardown. See `subscribeToIdasResync.ts` for the rationale.\n *\n * We do NOT gate the POST on a socket ack: the upstream `_emit`\n * mis-routes the ack callback so it would never fire. The theoretical\n * race window (local listener attached but channel not yet registered\n * server-side) is dwarfed by worker latency.\n *\n * KNOWN LIMITATION: the subscription payload has no correlation/request id,\n * so a delayed event from a previous same-asset run — or another user's\n * same-asset run — could resolve the current run with the wrong outcome.\n * Tracked separately; backend needs to attach a request_id to the payload.\n *\n * Construction is side-effect-free. `activate()` installs `triggerResync`\n * into the store and arms the controller; `deactivate()` aborts any in-flight\n * resync and resets the store's `triggerResync` back to a noop. The pair is\n * idempotent so it survives React 18 StrictMode setup→cleanup→setup replay.\n */\nexport const createIdasResyncController = (storeApi: IdasResyncStoreApi): IdasResyncController => {\n let triggeredAssetId: number | null = null;\n let unsubscribe: (() => void) | null = null;\n let mounted = false;\n let inputs: IdasResyncControllerInputs = {\n assetId: null,\n currentUser: undefined,\n loadExternalOffsets: async () => undefined,\n };\n\n const setStatus = (next: IdasResyncStatusValue): void => {\n storeApi.setState({ status: next, isResyncInFlight: isInFlightStatus(next) });\n };\n\n const stopSubscription = (): void => {\n unsubscribe?.();\n unsubscribe = null;\n };\n\n const clearActive = (): void => {\n triggeredAssetId = null;\n };\n\n const abort = (): void => {\n stopSubscription();\n clearActive();\n };\n\n const showError = (message: string): void => {\n if (!mounted) {\n return;\n }\n\n showErrorNotification(message, TOAST_OPTIONS);\n setStatus(IdasResyncStatus.FAILED);\n };\n\n const finalizeSuccessIfCurrent = (capturedAssetId: number, message: string): void => {\n if (!mounted) {\n return;\n }\n\n if (capturedAssetId !== triggeredAssetId) {\n return;\n }\n\n clearActive();\n showSuccessNotification(message, TOAST_OPTIONS);\n setStatus(IdasResyncStatus.SUCCEEDED);\n };\n\n const finishSuccess = async (capturedAssetId: number, message: string): Promise<void> => {\n try {\n await inputs.loadExternalOffsets();\n } finally {\n finalizeSuccessIfCurrent(capturedAssetId, message);\n }\n };\n\n const handleSubscriptionMessage = (\n capturedAssetId: number,\n payload: IdasSubscriptionPayload\n ): void => {\n if (!mounted) {\n return;\n }\n\n if (capturedAssetId !== triggeredAssetId) {\n return;\n }\n\n stopSubscription();\n\n if (payload?.status === 'success') {\n finishSuccess(capturedAssetId, payload.message);\n } else {\n clearActive();\n showError(payload?.message || RESYNC_FAILED_FALLBACK);\n }\n };\n\n const handleTaskAppFailure = (capturedAssetId: number, reason: string | undefined): void => {\n if (capturedAssetId !== triggeredAssetId) {\n return;\n }\n\n abort();\n showError(reason || RESYNC_FAILED_FALLBACK);\n };\n\n const postResyncTask = async (capturedAssetId: number): Promise<void> => {\n const user = inputs.currentUser;\n\n if (!user?.id) {\n handleTaskAppFailure(capturedAssetId, undefined);\n return;\n }\n\n try {\n const response = await resyncIdasWells(user, capturedAssetId);\n\n if (response?.state === 'failed') {\n handleTaskAppFailure(capturedAssetId, response.fail_reason);\n }\n } catch (err) {\n handleTaskAppFailure(capturedAssetId, err instanceof Error ? err.message : undefined);\n }\n };\n\n const triggerResync = (): void => {\n const { assetId, currentUser } = inputs;\n\n if (!assetId || !currentUser?.id) {\n return;\n }\n\n // Ref-based in-flight guard so two synchronous calls (e.g. double-click\n // before React commits state) collapse to one subscribe.\n if (triggeredAssetId !== null) {\n return;\n }\n\n const capturedAssetId = assetId;\n triggeredAssetId = capturedAssetId;\n\n const channel = getIdasResyncChannel(capturedAssetId);\n\n unsubscribe = subscribeToIdasResync(channel, payload =>\n handleSubscriptionMessage(capturedAssetId, payload)\n );\n\n // We deliberately skip socket-ack gating and fire the POST immediately:\n // the upstream `SubscriptionsClientV2._emit` mis-uses `emitWithAck`, so\n // any ack we register never fires. Worker latency dwarfs the\n // listener-vs-channel-registration window, so the race is harmless in\n // practice.\n setStatus(IdasResyncStatus.RUNNING);\n postResyncTask(capturedAssetId);\n };\n\n return {\n activate: () => {\n mounted = true;\n storeApi.setState({ triggerResync });\n },\n deactivate: () => {\n mounted = false;\n abort();\n storeApi.setState({ triggerResync: noop });\n },\n update: next => {\n if (\n triggeredAssetId !== null &&\n next.assetId !== triggeredAssetId &&\n storeApi.getState().isResyncInFlight\n ) {\n abort();\n setStatus(IdasResyncStatus.INITIAL);\n }\n inputs = next;\n },\n };\n};\n"],"names":["TOAST_OPTIONS","multiline","autoHideDuration","noop","createIdasResyncController","storeApi","_loadExternalOffsets","triggeredAssetId","unsubscribe","mounted","inputs","assetId","currentUser","undefined","loadExternalOffsets","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","stop","apply","this","arguments","setStatus","status","setState","isResyncInFlight","IdasResyncStatus","TRIGGERED","RUNNING","stopSubscription","_unsubscribe","clearActive","abort","showError","message","showErrorNotification","FAILED","finalizeSuccessIfCurrent","capturedAssetId","showSuccessNotification","SUCCEEDED","finishSuccess","_ref","_callee2","_context2","finish","_x","_x2","handleTaskAppFailure","reason","postResyncTask","_ref2","user","response","_context3","id","resyncIdasWells","sent","state","fail_reason","t0","Error","_callee3","_x3","triggerResync","_inputs","channel","getIdasResyncChannel","subscribeToIdasResync","payload","handleSubscriptionMessage","activate","deactivate","update","getState","INITIAL"],"mappings":"i1FA4BA,IAEMA,EAAgB,CAAEC,WAAW,EAAMC,iBAAkB,KAErDC,EAAO,WAAqB,EAmCrBC,EAA6B,SAACC,GACzC,IAMuBC,EANnBC,EAAkC,KAClCC,EAAmC,KACnCC,GAAU,EACVC,EAAqC,CACvCC,QAAS,KACTC,iBAAaC,EACbC,qBAAqBR,EAAAS,EAAAC,EAAAC,MAAA,SAAAC,IAAA,OAAAF,EAAAG,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAG,OAAA,cAAYV,GAAS,KAAA,EAAA,IAAA,MAAA,OAAAO,EAAAI,OAAA,GAAAN,EAAA,KAAA,WAAA,OAAAZ,EAAAmB,MAAAC,KAAAC,UAAA,IAGtCC,EAAY,SAACN,GA3CI,IAACO,EA4CtBxB,EAASyB,SAAS,CAAED,OAAQP,EAAMS,kBA5CZF,EA4C+CP,EA3CvEO,IAAWG,EAAiBC,WAAaJ,IAAWG,EAAiBE,YA8C/DC,EAAmB,WAAY,IAAAC,UACnC5B,EAAAA,gBAAA4B,IACA5B,EAAc,MAGV6B,EAAc,WAClB9B,EAAmB,MAGf+B,EAAQ,WACZH,IACAE,KAGIE,EAAY,SAACC,GACZ/B,IAILgC,EAAsBD,EAASxC,GAC/B4B,EAAUI,EAAiBU,UAGvBC,EAA2B,SAACC,EAAyBJ,GACpD/B,GAIDmC,IAAoBrC,IAIxB8B,IACAQ,EAAwBL,EAASxC,GACjC4B,EAAUI,EAAiBc,aAGvBC,EAAa,WAA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AAAA,MAAQP,EAAIpB,GAAAA,aAAU3B,GAAW,KAAA,GAAA,IAAA,MAAA,OAAA+C,EAAApC,OAAA,GAAA4C,EAAA,KAAA,CAAA,CAAA,EAAA,KAEzF,KAAA,OAAA,SAjBmBC,GAAA,OAAAZ,EAAAhC,MAAAC,KAAAC,UAAA,EAAA,GAmBd2C,EAAgB,WACpB,IAAAC,EAAiC7D,EAAzBC,IAAAA,QAASC,IAAAA,YAEjB,GAAKD,GAAYC,SAAAA,EAAaiD,IAML,OAArBtD,EAAJ,CAIA,IAAMqC,EAAkBjC,EACxBJ,EAAmBqC,EAEnB,IAAM4B,EAAUC,EAAqB7B,GAErCpC,EAAckE,EAAsBF,GAAS,SAAAG,GAAO,OApEpB,SAChC/B,EACA+B,GAEKlE,GAIDmC,IAAoBrC,IAIxB4B,IAEwB,aAApBwC,aAAO,EAAPA,EAAS9C,QACXkB,EAAcH,EAAiB+B,EAAQnC,UAEvCH,IACAE,GAAUoC,aAAAA,EAAAA,EAASnC,UApHM,oCAuKzBoC,CAA0BhC,EAAiB+B,MAQ7C/C,EAAUI,EAAiBE,SAC3BsB,EAAeZ,EAjBf,GAoBF,MAAO,CACLiC,SAAU,WACRpE,GAAU,EACVJ,EAASyB,SAAS,CAAEwC,cAAAA,GACrB,EACDQ,WAAY,WACVrE,GAAU,EACV6B,IACAjC,EAASyB,SAAS,CAAEwC,cAAenE,GACpC,EACD4E,OAAQ,SAAAzD,GAEiB,OAArBf,GACAe,EAAKX,UAAYJ,GACjBF,EAAS2E,WAAWjD,mBAEpBO,IACAV,EAAUI,EAAiBiD,UAE7BvE,EAASY,CACX,EAEJ"}
|
|
1
|
+
{"version":3,"file":"createIdasResyncController.js","sources":["../../../../../src/components/OffsetWellPickerV5/stores/idas-resync-store/createIdasResyncController.ts"],"sourcesContent":["import { resyncIdasWells } from '../../api';\nimport type { PickerPropsStore } from '../picker-props-store';\n\nimport type { IdasResyncStoreApi } from './createIdasResyncStore';\nimport {\n IdasResyncStatus,\n type IdasResyncStatusValue,\n type IdasSubscriptionPayload,\n} from './idas-resync.types';\nimport { getIdasResyncChannel } from './idasResyncChannel';\nimport { subscribeToIdasResync } from './subscribeToIdasResync';\n\nimport { showErrorNotification, showSuccessNotification } from '~/utils';\n\ntype ControllerUser = PickerPropsStore['currentUser'];\n\nexport type IdasResyncControllerInputs = {\n assetId: number | null;\n currentUser: ControllerUser;\n loadExternalOffsets: () => Promise<void>;\n};\n\nexport type IdasResyncController = {\n activate: () => void;\n deactivate: () => void;\n update: (inputs: IdasResyncControllerInputs) => void;\n};\n\nconst RESYNC_FAILED_FALLBACK = 'Re-sync wells from IDAS failed';\n\nconst TOAST_OPTIONS = { multiline: true, autoHideDuration: 10_000 };\n\nconst noop = (): void => undefined;\n\nconst isInFlightStatus = (status: IdasResyncStatusValue): boolean =>\n status === IdasResyncStatus.TRIGGERED || status === IdasResyncStatus.RUNNING;\n\n/**\n * Drives the IDAS re-sync state machine for a subject asset and writes its\n * state into `IdasResyncStore`. Consumers (e.g. `HeaderActions`,\n * `PickerModalActions`, `OffsetWellPickerV5`) subscribe via\n * `useIdasResyncStore` instead of having props drilled through the tree.\n *\n * Flow: subscribe → POST task → resolve via subscription event\n * ({ status, message }). The task-app response is used only for dual-track\n * failure detection (state === 'failed'); the underlying app's outcome is\n * carried by the subscription message.\n *\n * The socket is wired manually via `subscribeToIdasResync` rather than\n * `useSubscriptionsV2` because we want no historical fetch and explicit\n * single-shot teardown. See `subscribeToIdasResync.ts` for the rationale.\n *\n * We do NOT gate the POST on a socket ack: the upstream `_emit`\n * mis-routes the ack callback so it would never fire. The theoretical\n * race window (local listener attached but channel not yet registered\n * server-side) is dwarfed by worker latency.\n *\n * KNOWN LIMITATION: the subscription payload has no correlation/request id,\n * so a delayed event from a previous same-asset run — or another user's\n * same-asset run — could resolve the current run with the wrong outcome.\n * Tracked separately; backend needs to attach a request_id to the payload.\n *\n * Construction is side-effect-free. `activate()` installs `triggerResync`\n * into the store and arms the controller; `deactivate()` aborts any in-flight\n * resync and resets the store's `triggerResync` back to a noop. The pair is\n * idempotent so it survives React 18 StrictMode setup→cleanup→setup replay.\n */\nexport const createIdasResyncController = (storeApi: IdasResyncStoreApi): IdasResyncController => {\n let triggeredAssetId: number | null = null;\n let unsubscribe: (() => void) | null = null;\n let mounted = false;\n let inputs: IdasResyncControllerInputs = {\n assetId: null,\n currentUser: undefined,\n loadExternalOffsets: async () => undefined,\n };\n\n const setStatus = (next: IdasResyncStatusValue): void => {\n storeApi.setState({ status: next, isResyncInFlight: isInFlightStatus(next) });\n };\n\n const stopSubscription = (): void => {\n unsubscribe?.();\n unsubscribe = null;\n };\n\n const clearActive = (): void => {\n triggeredAssetId = null;\n };\n\n const abort = (): void => {\n stopSubscription();\n clearActive();\n };\n\n const showError = (message: string): void => {\n if (!mounted) {\n return;\n }\n\n showErrorNotification(message, TOAST_OPTIONS);\n setStatus(IdasResyncStatus.FAILED);\n };\n\n const finalizeSuccessIfCurrent = (capturedAssetId: number, message: string): void => {\n if (!mounted) {\n return;\n }\n\n if (capturedAssetId !== triggeredAssetId) {\n return;\n }\n\n clearActive();\n showSuccessNotification(message, TOAST_OPTIONS);\n setStatus(IdasResyncStatus.SUCCEEDED);\n };\n\n const finishSuccess = async (capturedAssetId: number, message: string): Promise<void> => {\n try {\n await inputs.loadExternalOffsets();\n } finally {\n finalizeSuccessIfCurrent(capturedAssetId, message);\n }\n };\n\n const handleSubscriptionMessage = (\n capturedAssetId: number,\n payload: IdasSubscriptionPayload\n ): void => {\n if (!mounted) {\n return;\n }\n\n if (capturedAssetId !== triggeredAssetId) {\n return;\n }\n\n stopSubscription();\n\n if (payload?.status === 'success') {\n finishSuccess(capturedAssetId, payload.message);\n } else {\n clearActive();\n showError(payload?.message || RESYNC_FAILED_FALLBACK);\n }\n };\n\n const handleTaskAppFailure = (capturedAssetId: number, reason: string | undefined): void => {\n if (capturedAssetId !== triggeredAssetId) {\n return;\n }\n\n abort();\n showError(reason || RESYNC_FAILED_FALLBACK);\n };\n\n const postResyncTask = async (capturedAssetId: number): Promise<void> => {\n const user = inputs.currentUser;\n\n if (!user?.id) {\n handleTaskAppFailure(capturedAssetId, undefined);\n return;\n }\n\n try {\n const response = await resyncIdasWells(user, capturedAssetId);\n\n if (response?.state === 'failed') {\n handleTaskAppFailure(capturedAssetId, response.fail_reason);\n }\n } catch (err) {\n handleTaskAppFailure(capturedAssetId, err instanceof Error ? err.message : undefined);\n }\n };\n\n const triggerResync = (): void => {\n const { assetId, currentUser } = inputs;\n\n if (!assetId || !currentUser?.id) {\n return;\n }\n\n // Ref-based in-flight guard so two synchronous calls (e.g. double-click\n // before React commits state) collapse to one subscribe.\n if (triggeredAssetId !== null) {\n return;\n }\n\n const capturedAssetId = assetId;\n triggeredAssetId = capturedAssetId;\n\n const channel = getIdasResyncChannel(capturedAssetId);\n\n unsubscribe = subscribeToIdasResync(channel, payload =>\n handleSubscriptionMessage(capturedAssetId, payload)\n );\n\n // We deliberately skip socket-ack gating and fire the POST immediately:\n // the upstream `SubscriptionsClientV2._emit` mis-uses `emitWithAck`, so\n // any ack we register never fires. Worker latency dwarfs the\n // listener-vs-channel-registration window, so the race is harmless in\n // practice.\n setStatus(IdasResyncStatus.RUNNING);\n postResyncTask(capturedAssetId);\n };\n\n return {\n activate: () => {\n mounted = true;\n storeApi.setState({ triggerResync });\n },\n deactivate: () => {\n mounted = false;\n abort();\n storeApi.setState({ triggerResync: noop });\n },\n update: next => {\n if (\n triggeredAssetId !== null &&\n next.assetId !== triggeredAssetId &&\n storeApi.getState().isResyncInFlight\n ) {\n abort();\n setStatus(IdasResyncStatus.INITIAL);\n }\n inputs = next;\n },\n };\n};\n"],"names":["TOAST_OPTIONS","multiline","autoHideDuration","noop","createIdasResyncController","storeApi","_loadExternalOffsets","triggeredAssetId","unsubscribe","mounted","inputs","assetId","currentUser","undefined","loadExternalOffsets","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","stop","apply","this","arguments","setStatus","status","setState","isResyncInFlight","IdasResyncStatus","TRIGGERED","RUNNING","stopSubscription","_unsubscribe","clearActive","abort","showError","message","showErrorNotification","FAILED","finalizeSuccessIfCurrent","capturedAssetId","showSuccessNotification","SUCCEEDED","finishSuccess","_ref","_callee2","_context2","finish","_x","_x2","handleTaskAppFailure","reason","postResyncTask","_ref2","user","response","_context3","id","resyncIdasWells","sent","state","fail_reason","t0","Error","_callee3","_x3","triggerResync","_inputs","channel","getIdasResyncChannel","subscribeToIdasResync","payload","handleSubscriptionMessage","activate","deactivate","update","getState","INITIAL"],"mappings":"6tFA4BA,IAEMA,EAAgB,CAAEC,WAAW,EAAMC,iBAAkB,KAErDC,EAAO,WAAqB,EAmCrBC,EAA6B,SAACC,GACzC,IAMuBC,EANnBC,EAAkC,KAClCC,EAAmC,KACnCC,GAAU,EACVC,EAAqC,CACvCC,QAAS,KACTC,iBAAaC,EACbC,qBAAqBR,EAAAS,EAAAC,EAAAC,MAAA,SAAAC,IAAA,OAAAF,EAAAG,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAG,OAAA,cAAYV,GAAS,KAAA,EAAA,IAAA,MAAA,OAAAO,EAAAI,OAAA,GAAAN,EAAA,KAAA,WAAA,OAAAZ,EAAAmB,MAAAC,KAAAC,UAAA,IAGtCC,EAAY,SAACN,GA3CI,IAACO,EA4CtBxB,EAASyB,SAAS,CAAED,OAAQP,EAAMS,kBA5CZF,EA4C+CP,EA3CvEO,IAAWG,EAAiBC,WAAaJ,IAAWG,EAAiBE,YA8C/DC,EAAmB,WAAY,IAAAC,UACnC5B,EAAAA,gBAAA4B,IACA5B,EAAc,MAGV6B,EAAc,WAClB9B,EAAmB,MAGf+B,EAAQ,WACZH,IACAE,KAGIE,EAAY,SAACC,GACZ/B,IAILgC,EAAsBD,EAASxC,GAC/B4B,EAAUI,EAAiBU,UAGvBC,EAA2B,SAACC,EAAyBJ,GACpD/B,GAIDmC,I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EAAAvC,KAAA,GAAAuC,EAAAM,GAAAN,EAAA,MAAA,GAEDN,EAAqBV,EAAiBgB,EAAeO,cAAAA,MAAQP,EAAIpB,GAAAA,aAAU3B,GAAW,KAAA,GAAA,IAAA,MAAA,OAAA+C,EAAApC,OAAA,GAAA4C,EAAA,KAAA,CAAA,CAAA,EAAA,KAEzF,KAAA,OAAA,SAjBmBC,GAAA,OAAAZ,EAAAhC,MAAAC,KAAAC,UAAA,EAAA,GAmBd2C,EAAgB,WACpB,IAAAC,EAAiC7D,EAAzBC,IAAAA,QAASC,IAAAA,YAEjB,GAAKD,GAAYC,SAAAA,EAAaiD,IAML,OAArBtD,EAAJ,CAIA,IAAMqC,EAAkBjC,EACxBJ,EAAmBqC,EAEnB,IAAM4B,EAAUC,EAAqB7B,GAErCpC,EAAckE,EAAsBF,GAAS,SAAAG,GAAO,OApEpB,SAChC/B,EACA+B,GAEKlE,GAIDmC,IAAoBrC,IAIxB4B,IAEwB,aAApBwC,aAAO,EAAPA,EAAS9C,QACXkB,EAAcH,EAAiB+B,EAAQnC,UAEvCH,IACAE,GAAUoC,aAAAA,EAAAA,EAASnC,UApHM,oCAuKzBoC,CAA0BhC,EAAiB+B,MAQ7C/C,EAAUI,EAAiBE,SAC3BsB,EAAeZ,EAjBf,GAoBF,MAAO,CACLiC,SAAU,WACRpE,GAAU,EACVJ,EAASyB,SAAS,CAAEwC,cAAAA,GACrB,EACDQ,WAAY,WACVrE,GAAU,EACV6B,IACAjC,EAASyB,SAAS,CAAEwC,cAAenE,GACpC,EACD4E,OAAQ,SAAAzD,GAEiB,OAArBf,GACAe,EAAKX,UAAYJ,GACjBF,EAAS2E,WAAWjD,mBAEpBO,IACAV,EAAUI,EAAiBiD,UAE7BvE,EAASY,CACX,EAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as i,useLayoutEffect as
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as i,useLayoutEffect as o}from"react";import{initialDataFetcher as n}from"../utils/initialDataFetcher.js";import s from"./useWellStreamsData.js";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import"../../../clients/sso/auth0.js";import"../../../clients/sso/oauth2.js";import{socketClientV2 as a}from"../../../clients/subscriptions/socket-client.v2.js";import"../../../clients/api/rateLimiter.js";function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function m(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?c(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var p={provider:"corva",collection:"completion.wits",event:"",params:{fields:"timestamp,collection,asset_id",limit:1,sort:"{ timestamp: -1 }"}},l={provider:"corva",collection:"wireline.wits",event:"",params:{fields:"timestamp,collection,asset_id,data.state",limit:1,sort:"{ timestamp: -1 }"}};function u(t){var c=t.currentWellId,u=t.isStatusShown,f=t.withSubscription,b=r({timestamp:0}),d=e(b,2),j=d[0],v=d[1],h=r({timestamp:0}),O=e(h,2),y=O[0],w=O[1],g=i([]),P=s({isStatusShown:u,currentWellId:c,wirelineData:j,fracData:y}),D=function(t){var e=t.data[0]||{},r=e.collection,i=e.timestamp,o=e.data,n=e.stage_number;if(!i)return v({timestamp:0}),void w({timestamp:0});r===l.collection?v((function(t){return m(m({},t),{},{timestamp:i,stageNumber:n,data:o})})):r===p.collection&&w((function(t){return m(m({},t),{},{timestamp:i})}))},S=function(t,e){var r={provider:e.provider,collection:e.collection,event:e.event,params:e.params,assetId:t},i=a.subscribe(r,{onDataReceive:D});g.current.push(i)};return o((function(){if(c){var t=n(p),e=n(l),r=[t(c),e(c)];return f&&(S(c,p),S(c,l)),Promise.all(r).then((function(t){t.forEach((function(t){t&&D({data:t})}))})),function(){g.current.forEach((function(t){return t()})),g.current=[],v({timestamp:0}),w({timestamp:0})}}}),[c]),P}export{u as useWellStreamActivityTypeSubscription};
|
|
2
2
|
//# sourceMappingURL=useWellStreamActivityTypeSubscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWellStreamActivityTypeSubscription.js","sources":["../../../../src/components/PadModeSelect/effects/useWellStreamActivityTypeSubscription.ts"],"sourcesContent":["import { useState, useRef, useLayoutEffect } from 'react';\n\nimport {\n AssetStreamStatus,\n StreamDataItem,\n CompletionWitsRecord,\n WirelineWitsRecord,\n} from '../types';\nimport { initialDataFetcher } from '../utils/initialDataFetcher';\n\nimport useWellStreamsData from './useWellStreamsData';\n\nimport { socketClient } from '~/clients';\n\ntype WitsRecord = CompletionWitsRecord | WirelineWitsRecord;\n\nconst FRAC_SUBSCRIPTION = {\n provider: 'corva',\n collection: 'completion.wits',\n event: '' as const,\n params: {\n fields: 'timestamp,collection,asset_id',\n limit: 1,\n sort: '{ timestamp: -1 }',\n },\n};\n\nconst WIRELINE_SUBSCRIPTION = {\n provider: 'corva',\n collection: 'wireline.wits',\n event: '' as const,\n params: {\n fields: 'timestamp,collection,asset_id,data.state',\n limit: 1,\n sort: '{ timestamp: -1 }',\n },\n};\n\ntype StreamSubscriptionProps = {\n isStatusShown: boolean;\n currentWellId?: number;\n withSubscription?: boolean;\n};\n\n// subscribe for completion.wits and wireline.wits live data\nexport function useWellStreamActivityTypeSubscription({\n currentWellId,\n isStatusShown,\n withSubscription,\n}: StreamSubscriptionProps): AssetStreamStatus {\n const [wirelineData, setWirelineData] = useState<StreamDataItem>({ timestamp: 0 });\n const [fracData, setFracData] = useState<StreamDataItem>({ timestamp: 0 });\n\n const unsubscribeFunctions = useRef<(() => void)[]>([]);\n\n const wellStreams = useWellStreamsData({\n isStatusShown,\n currentWellId,\n wirelineData,\n fracData,\n });\n\n const onDataReceive = ({ data: response }: { data: WitsRecord[] }) => {\n const { collection, timestamp, data, stage_number: stageNumber } = response[0] || {};\n if (!timestamp) {\n setWirelineData({ timestamp: 0 });\n setFracData({ timestamp: 0 });\n return;\n }\n\n if (collection === WIRELINE_SUBSCRIPTION.collection) {\n setWirelineData(previousData => ({\n ...previousData,\n timestamp,\n stageNumber,\n data,\n }));\n } else if (collection === FRAC_SUBSCRIPTION.collection) {\n setFracData(previousData => ({ ...previousData, timestamp }));\n }\n };\n\n const subscribe = (assetId: number, subscriptionInfo: typeof FRAC_SUBSCRIPTION) => {\n const { provider, collection, event, params } = subscriptionInfo;\n const subscription = { provider, collection, event, params, assetId };\n const unsubscribe = socketClient.subscribe(subscription, { onDataReceive });\n unsubscribeFunctions.current.push(unsubscribe);\n };\n\n useLayoutEffect(() => {\n if (!currentWellId) {\n return undefined;\n }\n\n const fetchInitialFrac = initialDataFetcher(FRAC_SUBSCRIPTION);\n const fetchInitialWireline = initialDataFetcher(WIRELINE_SUBSCRIPTION);\n\n const wellRequests = [fetchInitialFrac(currentWellId), fetchInitialWireline(currentWellId)];\n\n if (withSubscription) {\n subscribe(currentWellId, FRAC_SUBSCRIPTION);\n subscribe(currentWellId, WIRELINE_SUBSCRIPTION);\n }\n\n Promise.all(wellRequests).then(response => {\n response.forEach(data => {\n if (data) {\n onDataReceive({ data });\n }\n });\n });\n\n // cleanup subscriptions for pad mode open/close\n return () => {\n unsubscribeFunctions.current.forEach(unsubscribe => unsubscribe());\n unsubscribeFunctions.current = [];\n setWirelineData({ timestamp: 0 });\n setFracData({ timestamp: 0 });\n };\n }, [currentWellId]);\n return wellStreams;\n}\n"],"names":["FRAC_SUBSCRIPTION","provider","collection","event","params","fields","limit","sort","WIRELINE_SUBSCRIPTION","useWellStreamActivityTypeSubscription","_ref","currentWellId","isStatusShown","withSubscription","_useState","useState","timestamp","_useState2","_slicedToArray","wirelineData","setWirelineData","_useState3","_useState4","fracData","setFracData","unsubscribeFunctions","useRef","wellStreams","useWellStreamsData","onDataReceive","_ref2","_ref3","data","stageNumber","stage_number","previousData","_objectSpread","subscribe","assetId","subscriptionInfo","subscription","unsubscribe","socketClient","current","push","useLayoutEffect","fetchInitialFrac","initialDataFetcher","fetchInitialWireline","wellRequests","Promise","all","then","response","forEach"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useWellStreamActivityTypeSubscription.js","sources":["../../../../src/components/PadModeSelect/effects/useWellStreamActivityTypeSubscription.ts"],"sourcesContent":["import { useState, useRef, useLayoutEffect } from 'react';\n\nimport {\n AssetStreamStatus,\n StreamDataItem,\n CompletionWitsRecord,\n WirelineWitsRecord,\n} from '../types';\nimport { initialDataFetcher } from '../utils/initialDataFetcher';\n\nimport useWellStreamsData from './useWellStreamsData';\n\nimport { socketClient } from '~/clients';\n\ntype WitsRecord = CompletionWitsRecord | WirelineWitsRecord;\n\nconst FRAC_SUBSCRIPTION = {\n provider: 'corva',\n collection: 'completion.wits',\n event: '' as const,\n params: {\n fields: 'timestamp,collection,asset_id',\n limit: 1,\n sort: '{ timestamp: -1 }',\n },\n};\n\nconst WIRELINE_SUBSCRIPTION = {\n provider: 'corva',\n collection: 'wireline.wits',\n event: '' as const,\n params: {\n fields: 'timestamp,collection,asset_id,data.state',\n limit: 1,\n sort: '{ timestamp: -1 }',\n },\n};\n\ntype StreamSubscriptionProps = {\n isStatusShown: boolean;\n currentWellId?: number;\n withSubscription?: boolean;\n};\n\n// subscribe for completion.wits and wireline.wits live data\nexport function useWellStreamActivityTypeSubscription({\n currentWellId,\n isStatusShown,\n withSubscription,\n}: StreamSubscriptionProps): AssetStreamStatus {\n const [wirelineData, setWirelineData] = useState<StreamDataItem>({ timestamp: 0 });\n const [fracData, setFracData] = useState<StreamDataItem>({ timestamp: 0 });\n\n const unsubscribeFunctions = useRef<(() => void)[]>([]);\n\n const wellStreams = useWellStreamsData({\n isStatusShown,\n currentWellId,\n wirelineData,\n fracData,\n });\n\n const onDataReceive = ({ data: response }: { data: WitsRecord[] }) => {\n const { collection, timestamp, data, stage_number: stageNumber } = response[0] || {};\n if (!timestamp) {\n setWirelineData({ timestamp: 0 });\n setFracData({ timestamp: 0 });\n return;\n }\n\n if (collection === WIRELINE_SUBSCRIPTION.collection) {\n setWirelineData(previousData => ({\n ...previousData,\n timestamp,\n stageNumber,\n data,\n }));\n } else if (collection === FRAC_SUBSCRIPTION.collection) {\n setFracData(previousData => ({ ...previousData, timestamp }));\n }\n };\n\n const subscribe = (assetId: number, subscriptionInfo: typeof FRAC_SUBSCRIPTION) => {\n const { provider, collection, event, params } = subscriptionInfo;\n const subscription = { provider, collection, event, params, assetId };\n const unsubscribe = socketClient.subscribe(subscription, { onDataReceive });\n unsubscribeFunctions.current.push(unsubscribe);\n };\n\n useLayoutEffect(() => {\n if (!currentWellId) {\n return undefined;\n }\n\n const fetchInitialFrac = initialDataFetcher(FRAC_SUBSCRIPTION);\n const fetchInitialWireline = initialDataFetcher(WIRELINE_SUBSCRIPTION);\n\n const wellRequests = [fetchInitialFrac(currentWellId), fetchInitialWireline(currentWellId)];\n\n if (withSubscription) {\n subscribe(currentWellId, FRAC_SUBSCRIPTION);\n subscribe(currentWellId, WIRELINE_SUBSCRIPTION);\n }\n\n Promise.all(wellRequests).then(response => {\n response.forEach(data => {\n if (data) {\n onDataReceive({ data });\n }\n });\n });\n\n // cleanup subscriptions for pad mode open/close\n return () => {\n unsubscribeFunctions.current.forEach(unsubscribe => unsubscribe());\n unsubscribeFunctions.current = [];\n setWirelineData({ timestamp: 0 });\n setFracData({ timestamp: 0 });\n };\n }, [currentWellId]);\n return wellStreams;\n}\n"],"names":["FRAC_SUBSCRIPTION","provider","collection","event","params","fields","limit","sort","WIRELINE_SUBSCRIPTION","useWellStreamActivityTypeSubscription","_ref","currentWellId","isStatusShown","withSubscription","_useState","useState","timestamp","_useState2","_slicedToArray","wirelineData","setWirelineData","_useState3","_useState4","fracData","setFracData","unsubscribeFunctions","useRef","wellStreams","useWellStreamsData","onDataReceive","_ref2","_ref3","data","stageNumber","stage_number","previousData","_objectSpread","subscribe","assetId","subscriptionInfo","subscription","unsubscribe","socketClient","current","push","useLayoutEffect","fetchInitialFrac","initialDataFetcher","fetchInitialWireline","wellRequests","Promise","all","then","response","forEach"],"mappings":"41CAgBA,IAAMA,EAAoB,CACxBC,SAAU,QACVC,WAAY,kBACZC,MAAO,GACPC,OAAQ,CACNC,OAAQ,gCACRC,MAAO,EACPC,KAAM,sBAIJC,EAAwB,CAC5BP,SAAU,QACVC,WAAY,gBACZC,MAAO,GACPC,OAAQ,CACNC,OAAQ,2CACRC,MAAO,EACPC,KAAM,sBAWH,SAASE,EAI+BC,GAAA,IAH7CC,IAAAA,cACAC,IAAAA,cACAC,IAAAA,iBAEAC,EAAwCC,EAAyB,CAAEC,UAAW,IAAIC,EAAAC,EAAAJ,EAAA,GAA3EK,EAAYF,EAAA,GAAEG,EAAeH,EAAA,GACpCI,EAAgCN,EAAyB,CAAEC,UAAW,IAAIM,EAAAJ,EAAAG,EAAA,GAAnEE,EAAQD,EAAA,GAAEE,EAAWF,EAAA,GAEtBG,EAAuBC,EAAuB,IAE9CC,EAAcC,EAAmB,CACrChB,cAAAA,EACAD,cAAAA,EACAQ,aAAAA,EACAI,SAAAA,IAGIM,EAAgB,SAAgDC,GAAA,IACpEC,IADuBC,KACqD,IAAM,CAAE,EAA5E9B,IAAAA,WAAYc,IAAAA,UAAWgB,IAAAA,KAAoBC,IAAdC,aACrC,IAAKlB,EAGH,OAFAI,EAAgB,CAAEJ,UAAW,SAC7BQ,EAAY,CAAER,UAAW,IAIvBd,IAAeM,EAAsBN,WACvCkB,GAAgB,SAAAe,GAAY,OAAAC,EAAAA,EAAA,CAAA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