@corva/ui 0.45.0-3 → 0.45.0-4

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.
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useMemo as i,useState as n,useRef as o,useEffect as s,useCallback as l}from"react";import a from"prop-types";import{uniqBy as p,isEmpty as m,sortBy as c,isEqual as d}from"lodash";import{Typography as u}from"@material-ui/core";import{Replay as f,Sort as j,FilterList as C,Close as v}from"@material-ui/icons";import b from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"classnames";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";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/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../utils/index.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as g,jsxs as h}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import A from"../LoadingIndicator/LoadingIndicator.js";import"../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import{Regular12 as D}from"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import S from"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import y from"../Button/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../Notifications/Notifications.js";import"uuid";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../MenuItem/index.js";import"../PadModeSelect/PadModeSelect.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import{Tooltip as I}from"../Tooltip/Tooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../FilesLoader/Icons/FileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/InputAdornmentLeft.js";import"../Search/components/Groups.js";import{useFetchWells as P}from"./effects/useFetchWells.js";import{useAdvancedWells as W}from"./effects/useAdvancedWells.js";import{useBicWells as x}from"./effects/useBicWells.js";import{useCompanyMetricKey as T}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as O}from"./effects/useFilterOptions.js";import{useFilteredWells as E}from"./effects/useFilteredWells.js";import{useSortedWells as w}from"./effects/useSortedWells.js";import{useRadiusWells as B}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useTableColumns as L}from"./effects/useTableColumns.js";import{Filter as k}from"./components/Filter/Filter.js";import{WellsMap as H}from"./components/Map/WellsMap.js";import V from"./components/OffsetWellsTable/OffsetWellsTable.js";import F from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as N,ColumnType as M,FilterType as R,ROWS_PER_PAGE as U}from"./constants.js";import{SEARCH_CATEGORIES as z}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function q(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?K(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var G=function(a){var K=a.open,G=a.isWDUser,_=a.defaultSubjectWell,J=a.currentUser,Q=a.offsetSettings,X=a.addWellsUsabilityInfo,Y=a.isViewOnly,Z=a.onClose,$=a.onSave,ee=a.maxOffsetSize,te=i((function(){return ee+1}),[ee]),re=n(null==Q?void 0:Q.filterExpanded),ie=r(re,2),ne=ie[0],oe=ie[1],se=n(null==Q?void 0:Q.mapHidden),le=r(se,2),ae=le[0],pe=le[1],me=+(null==_?void 0:_.companyId)||+(null==J?void 0:J.company_id),ce=null==_?void 0:_.asset_id,de=n((null==Q?void 0:Q.filters)||{}),ue=r(de,2),fe=ue[0],je=ue[1],Ce=n((null==Q?void 0:Q.wellSection)||N),ve=r(Ce,2),be=ve[0],ge=ve[1],he=o(!0),Ae=n([]),De=r(Ae,2),Se=De[0],ye=De[1],Ie=n(null),Pe=r(Ie,2),We=Pe[0],xe=Pe[1],Te=n(!0),Oe=r(Te,2),Ee=Oe[0],we=Oe[1],Be=n(!1),Le=r(Be,2),ke=Le[0],He=Le[1],Ve=n(!1),Fe=r(Ve,2),Ne=Fe[0],Me=Fe[1],Re=n(!1),Ue=r(Re,2),ze=Ue[0],Ke=Ue[1],qe=o(),Ge=n(!0),_e=r(Ge,2),Je=_e[0],Qe=_e[1],Xe=i((function(){return!ae&&ne?448:ae?ne?232:0:216}),[ae,ne]);s((function(){he.current=!0}),[ce,null==Q?void 0:Q.selectedWellIds]),s((function(){oe(!Y&&(null==Q?void 0:Q.filterExpanded)),pe(!Y&&(null==Q?void 0:Q.mapHidden)),je((null==Q?void 0:Q.filters)||{}),ge((null==Q?void 0:Q.wellSection)||N)}),[Q,Y]);var Ye=P(me,X),Ze=x(G,ce),$e=r(Ze,2),et=$e[0],tt=$e[1],rt=T(me,null==Q?void 0:Q.metricsKeys),it=r(rt,2),nt=it[0],ot=it[1],st=W(me,Ye,et,tt,ce,nt),lt=O(st);s((function(){if(st&&et){var e=st.find((function(e){return e.id===ce}));if(e){var r=et.filter((function(e){return e.value!==N})).map((function(e){return e.label})),i=q(q({},e),r.length>0&&t({},M.wellSection,r));xe(i)}else xe(null)}}),[et,st]);var at=L(nt),pt=E(st,fe);s((function(){if(pt)if(he.current){var e=p(st.filter((function(e){return((null==Q?void 0:Q.selectedWellIds)||[]).includes(e.id)})).concat(We),"id");ye(e),he.current=!1}else ye((function(e){var t=(pt||[]).filter((function(t){return!!e.find((function(e){var r=e.id;return t.id===r}))})).concat(We);return p(t,"id")}))}),[st,pt,null==Q?void 0:Q.selectedWellIds]);var mt=w(We,pt,Se,we,he.current),ct=r(mt,5),dt=ct[0],ut=ct[1],ft=ct[2],jt=ct[3],Ct=ct[4];B(fe[R.radius],pt,ye,te);var vt=l((function(e,t,r){var i;i=r===z.well.name?t:t.reduce((function(e,t){var r,i=null===(r=st.find((function(e){return e.id===t})))||void 0===r?void 0:r.rigName,n=st.filter((function(e){return e.rigName===i})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=st.filter((function(e){var t=e.id;return i.includes(t)}));ye(e?function(e){return p(e.concat(n),"id")}:function(e){return p(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))})}),[st]),bt=l((function(){Me(!0)}),[]),gt=l((function(e){ot(e)}),[]),ht=l((function(t,r){ye(r?function(r){return[].concat(e(r),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),At=l((function(e){if(e){var t=We?pt.concat(We):pt,r=p(t,"id");ye(r)}else ye(We?[We]:[])}),[pt,We]),Dt=function(e){if(m(tt))ye(We?[We]:[]);else{var t=st.filter((function(t){return tt[e].includes(t.id)}));ye(t)}},St=l((function(e){ge(e),Dt(e)}),[Dt]),yt=i((function(){return Se.find((function(e){return e.id===ce}))?Se.length-1:Se.length}),[Se,ce]),It=i((function(){if(!tt)return!1;var e=Se.map((function(e){return e.id})),t=tt[be]||[];return(te&&t.length>te?te:t.length)===e.length&&e.every((function(e){return t.includes(e)}))}),[tt,_,Se,be]),Pt=function(){var e=(st||[]).filter((function(e){return((null==Q?void 0:Q.selectedWellIds)||[]).includes(e.id)})).concat(We);ye(p(e,"id")),d(fe,Q.filters)||(he.current=!0);var t=q(q({},Q),{},{mapHidden:ae,filterExpanded:ne});$(t),je((null==Q?void 0:Q.filters)||{}),ge((null==Q?void 0:Q.wellSection)||N),Z()},Wt=i((function(){return!It||(!(m(fe)||!fe[R.sideTracks])||be!==N)}),[It,fe,be]);s((function(){if(!te||te>Se.length)Ke(!1);else if(te<Se.length){var e=c(Se,"distance");ye(e.slice(0,te))}else te===Se.length&&Ke(!0)}),[Se,te]);var xt=!st||!et||!Ct,Tt=n(!1),Ot=r(Tt,2),Et=Ot[0],wt=Ot[1],Bt=n(!1),Lt=r(Bt,2),kt=Lt[0],Ht=Lt[1],Vt=n(U),Ft=r(Vt,2),Nt=Ft[0],Mt=Ft[1],Rt=n([]),Ut=r(Rt,2),zt=Ut[0],Kt=Ut[1];s((function(){if(Ct){var e=Ct.slice(0,Nt);Kt(e)}}),[Ct,Nt,We]);return g(b,{open:K,onClose:Pt,title:"Select Offset Wells",contentContainerClassName:F.offsetWellDialog,contentClassName:F.contentContainer,actionsClassName:F.modalActions,actions:!Y&&h("div",{className:F.actionsWrapper,children:[!xt&&Wt?g(I,{placement:"bottom-start",title:G?"To Synced Offsets in Offset App":"To Synced Offsets in Wellhub",children:g("div",{children:g(y,{onClick:function(){je({}),ge(N),Dt(N)},color:"primary",startIcon:g(f,{}),children:"Reset"})})}):g("div",{}),h("div",{className:F.buttonGap,children:[g(y,{onClick:Pt,color:"primary",children:"Cancel"}),h(y,{variant:"contained",color:"primary",onClick:function(){Z();var e=q(q({},Q),{},{companyId:me,subjectWellId:ce,selectedWellIds:Se.map((function(e){return e.id})),filters:fe,metricsKeys:nt,wellSection:be,isSynced:It,mapHidden:ae,filterExpanded:ne});$(e,Se)},children:["Select (",yt,")"]})]})]}),children:xt?g(A,{fullscreen:!1}):h("div",{className:F.contentWrapper,ref:qe,children:[h("div",{className:F.countContainer,children:[g(D,{className:F.totalLabel,children:"Total:"}),g(D,{className:F.countValue,children:st.length}),g(D,{className:F.selectedLabel,children:"Selected:"}),g(D,{className:F.countValue,children:yt})]}),te&&te<=Se.length&&g(u,{className:F.viewOnlyTitleLabel,children:"This application can work with no more than (".concat(ee,") offset wells at a time.")}),Y&&g(u,{className:F.viewOnlyTitleLabel,children:"This is the view only mode. To edit offset wells, use the Offset Well Selection app."}),h("div",{className:F.controlGroup,children:[h(y,{startIcon:g(ne?j:C,{}),classes:{root:F.filterButton},onClick:function(){return oe((function(e){return!e}))},disabled:Y,children:["Filters",!m(fe)&&h("div",{className:F.clearWrapper,onClick:function(e){e.stopPropagation(),je({})},children:[g(v,{className:F.clearIcon}),g("span",{className:F.clearLabel,children:"Clear"})]})]}),g(S,{rightLabel:"Map",color:"primary",checked:!ae,onChange:function(e){return pe(!e.target.checked)}})]}),h("div",{className:F.content,onScroll:function(e){e.target&&(Ne&&(e.target.scrollLeft=0,Me(!1)),e.target.scrollLeft<=5&&Et&&wt(!1),e.target.scrollLeft>5&&!Et&&wt(!0),e.target.scrollTop<12&&kt&&Ht(!1),e.target.scrollTop>=12&&!kt&&Ht(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight)>=e.target.scrollHeight&&Nt<Ct.length&&Mt((function(e){return e+U})))},children:[kt&&g("div",{className:F.topGradient}),!ae&&K&&g(H,{isViewOnly:Y,mapHidden:ae,companyId:me,subjectWell:We,offsetWellIds:Se.map((function(e){return e.id})),wells:st,radius:fe[R.radius],handleChanageOffsetWell:ht}),g(k,{isHidden:!ne,isWDUser:G,filterOptions:lt,filters:fe,wellSections:et,selectedWellSection:be,subjectWell:We,onChangeFilters:je,onChangeBicWells:St}),g(V,{open:K,isTableLoading:Ee,companyId:me,subjectWellId:ce,sortBy:dt,setSortBy:ut,sortDirection:ft,setSortDirection:jt,columnsWithDict:at,wells:zt,metricsKeys:nt,setMetricsKeys:gt,handleChanageOffsetWell:ht,handleChangeAllOffsetWells:At,handleAddRemoveAssets:vt,isWellNameExpand:ke,setIsWellNameExpand:He,isHscrollMoved:Et,onHideAdvancedSearch:bt,isViewOnly:Y,isLastWell:Ct.length<=Nt,contentRef:qe,isHintPopperOpen:Je,setIsHintPopperOpen:Qe,isLimitedOffsetwells:ze,tableTop:Xe})]})]})})};G.propTypes={isWDUser:a.bool,defaultSubjectWell:a.shape({asset_id:a.number,companyId:a.number}),offsetSettings:a.shape({selectedWellIds:a.arrayOf(a.number),manualWellIds:a.arrayOf(a.number),filters:a.shape({}),metricsKeys:a.arrayOf(a.string),wellSection:a.string,companyId:a.number,subjectWellId:a.number,mapHidden:a.bool,filterExpanded:a.bool}),currentUser:a.shape({company_id:a.number}).isRequired,open:a.bool.isRequired,addWellsUsabilityInfo:a.func,isViewOnly:a.bool,onSave:a.func.isRequired,onClose:a.func.isRequired,maxOffsetSize:a.number},G.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1,maxOffsetSize:50};export{G as default};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useMemo as i,useState as o,useRef as n,useEffect as s,useCallback as l}from"react";import p from"prop-types";import{uniqBy as a,isEmpty as m,sortBy as c,isEqual as d}from"lodash";import{Typography as u}from"@material-ui/core";import{Replay as f,Sort as j,FilterList as C,Close as v}from"@material-ui/icons";import b from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"classnames";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";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/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../utils/index.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import A from"../LoadingIndicator/LoadingIndicator.js";import"../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import{Regular12 as D}from"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import S from"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import y from"../Button/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../Notifications/Notifications.js";import"uuid";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../MenuItem/index.js";import"../PadModeSelect/PadModeSelect.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import{Tooltip as P}from"../Tooltip/Tooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../FilesLoader/Icons/FileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/InputAdornmentLeft.js";import"../Search/components/Groups.js";import{useFetchWells as I}from"./effects/useFetchWells.js";import{useAdvancedWells as W}from"./effects/useAdvancedWells.js";import{useBicWells as x}from"./effects/useBicWells.js";import{useCompanyMetricKey as T}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as O}from"./effects/useFilterOptions.js";import{useFilteredWells as E}from"./effects/useFilteredWells.js";import{useSortedWells as w}from"./effects/useSortedWells.js";import{useRadiusWells as B}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useTableColumns as L}from"./effects/useTableColumns.js";import{Filter as k}from"./components/Filter/Filter.js";import{WellsMap as H}from"./components/Map/WellsMap.js";import V from"./components/OffsetWellsTable/OffsetWellsTable.js";import F from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as N,ColumnType as M,FilterType as R,ROWS_PER_PAGE as U}from"./constants.js";import{SEARCH_CATEGORIES as z}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function q(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?K(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var G=function(p){var K=p.open,G=p.isWDUser,_=p.defaultSubjectWell,J=p.currentUser,Q=p.offsetSettings,X=p.addWellsUsabilityInfo,Y=p.isViewOnly,Z=p.onClose,$=p.onSave,ee=p.maxOffsetSize,te=i((function(){return ee+1}),[ee]),re=o(null==Q?void 0:Q.filterExpanded),ie=r(re,2),oe=ie[0],ne=ie[1],se=o(null==Q?void 0:Q.mapHidden),le=r(se,2),pe=le[0],ae=le[1],me=+(null==_?void 0:_.companyId)||+(null==J?void 0:J.company_id),ce=null==_?void 0:_.asset_id,de=o((null==Q?void 0:Q.filters)||{}),ue=r(de,2),fe=ue[0],je=ue[1],Ce=o((null==Q?void 0:Q.wellSection)||N),ve=r(Ce,2),be=ve[0],he=ve[1],ge=n(!0),Ae=o([]),De=r(Ae,2),Se=De[0],ye=De[1],Pe=o(null),Ie=r(Pe,2),We=Ie[0],xe=Ie[1],Te=o(!0),Oe=r(Te,2),Ee=Oe[0],we=Oe[1],Be=o(!1),Le=r(Be,2),ke=Le[0],He=Le[1],Ve=o(!1),Fe=r(Ve,2),Ne=Fe[0],Me=Fe[1],Re=o(!1),Ue=r(Re,2),ze=Ue[0],Ke=Ue[1],qe=n(),Ge=o(!Q.hintPopupClosed),_e=r(Ge,2),Je=_e[0],Qe=_e[1],Xe=i((function(){return!pe&&oe?448:pe?oe?232:0:216}),[pe,oe]);s((function(){ge.current=!0}),[ce,null==Q?void 0:Q.selectedWellIds]),s((function(){ne(!Y&&(null==Q?void 0:Q.filterExpanded)),ae(!Y&&(null==Q?void 0:Q.mapHidden)),je((null==Q?void 0:Q.filters)||{}),he((null==Q?void 0:Q.wellSection)||N)}),[Q,Y]);var Ye=I(me,X),Ze=x(G,ce),$e=r(Ze,2),et=$e[0],tt=$e[1],rt=T(me,null==Q?void 0:Q.metricsKeys),it=r(rt,2),ot=it[0],nt=it[1],st=W(me,Ye,et,tt,ce,ot),lt=O(st);s((function(){if(st&&et){var e=st.find((function(e){return e.id===ce}));if(e){var r=et.filter((function(e){return e.value!==N})).map((function(e){return e.label})),i=q(q({},e),r.length>0&&t({},M.wellSection,r));xe(i)}else xe(null)}}),[et,st]);var pt=L(ot),at=E(st,fe);s((function(){if(at)if(ge.current){var e=a(st.filter((function(e){return((null==Q?void 0:Q.selectedWellIds)||[]).includes(e.id)})).concat(We),"id");ye(e),ge.current=!1}else ye((function(e){var t=(at||[]).filter((function(t){return!!e.find((function(e){var r=e.id;return t.id===r}))})).concat(We);return a(t,"id")}))}),[st,at,null==Q?void 0:Q.selectedWellIds]);var mt=w(We,at,Se,we,ge.current),ct=r(mt,5),dt=ct[0],ut=ct[1],ft=ct[2],jt=ct[3],Ct=ct[4];B(fe[R.radius],at,ye,te);var vt=l((function(e,t,r){var i;i=r===z.well.name?t:t.reduce((function(e,t){var r,i=null===(r=st.find((function(e){return e.id===t})))||void 0===r?void 0:r.rigName,o=st.filter((function(e){return e.rigName===i})).map((function(e){return e.id}));return e.concat(o)}),[]);var o=st.filter((function(e){var t=e.id;return i.includes(t)}));ye(e?function(e){return a(e.concat(o),"id")}:function(e){return a(e.filter((function(e){var t=e.id;return!o.find((function(e){return e.id===t}))})))})}),[st]),bt=l((function(){Me(!0)}),[]),ht=l((function(e){nt(e)}),[]),gt=l((function(t,r){ye(r?function(r){return[].concat(e(r),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),At=l((function(e){if(e){var t=We?at.concat(We):at,r=a(t,"id");ye(r)}else ye(We?[We]:[])}),[at,We]),Dt=function(e){if(m(tt))ye(We?[We]:[]);else{var t=st.filter((function(t){return tt[e].includes(t.id)}));ye(t)}},St=l((function(e){he(e),Dt(e)}),[Dt]),yt=i((function(){return Se.find((function(e){return e.id===ce}))?Se.length-1:Se.length}),[Se,ce]),Pt=i((function(){if(!tt)return!1;var e=Se.map((function(e){return e.id})),t=tt[be]||[];return(te&&t.length>te?te:t.length)===e.length&&e.every((function(e){return t.includes(e)}))}),[tt,_,Se,be]),It=function(){var e=(st||[]).filter((function(e){return((null==Q?void 0:Q.selectedWellIds)||[]).includes(e.id)})).concat(We);ye(a(e,"id")),d(fe,Q.filters)||(ge.current=!0);var t=q(q({},Q),{},{mapHidden:pe,filterExpanded:oe,hintPopupClosed:!Je});$(t),je((null==Q?void 0:Q.filters)||{}),he((null==Q?void 0:Q.wellSection)||N),Z()},Wt=i((function(){return!Pt||(!(m(fe)||!fe[R.sideTracks])||be!==N)}),[Pt,fe,be]);s((function(){if(!te||te>Se.length)Ke(!1);else if(te<Se.length){var e=c(Se,"distance");ye(e.slice(0,te))}else te===Se.length&&Ke(!0)}),[Se,te]);var xt=!st||!et||!Ct,Tt=o(!1),Ot=r(Tt,2),Et=Ot[0],wt=Ot[1],Bt=o(!1),Lt=r(Bt,2),kt=Lt[0],Ht=Lt[1],Vt=o(U),Ft=r(Vt,2),Nt=Ft[0],Mt=Ft[1],Rt=o([]),Ut=r(Rt,2),zt=Ut[0],Kt=Ut[1];s((function(){if(Ct){var e=Ct.slice(0,Nt);Kt(e)}}),[Ct,Nt,We]);return h(b,{open:K,onClose:It,title:"Select Offset Wells",contentContainerClassName:F.offsetWellDialog,contentClassName:F.contentContainer,actionsClassName:F.modalActions,actions:!Y&&g("div",{className:F.actionsWrapper,children:[!xt&&Wt?h(P,{placement:"bottom-start",title:G?"To Synced Offsets in Offset App":"To Synced Offsets in Wellhub",children:h("div",{children:h(y,{onClick:function(){je({}),he(N),Dt(N)},color:"primary",startIcon:h(f,{}),children:"Reset"})})}):h("div",{}),g("div",{className:F.buttonGap,children:[h(y,{onClick:It,color:"primary",children:"Cancel"}),g(y,{variant:"contained",color:"primary",onClick:function(){Z();var e=q(q({},Q),{},{companyId:me,subjectWellId:ce,selectedWellIds:Se.map((function(e){return e.id})),filters:fe,metricsKeys:ot,wellSection:be,isSynced:Pt,mapHidden:pe,filterExpanded:oe,hintPopupClosed:!Je});$(e,Se)},children:["Select (",yt,")"]})]})]}),children:xt?h(A,{fullscreen:!1}):g("div",{className:F.contentWrapper,ref:qe,children:[g("div",{className:F.countContainer,children:[h(D,{className:F.totalLabel,children:"Total:"}),h(D,{className:F.countValue,children:st.length}),h(D,{className:F.selectedLabel,children:"Selected:"}),h(D,{className:F.countValue,children:yt})]}),te&&te<=Se.length&&h(u,{className:F.viewOnlyTitleLabel,children:"This app supports no more than (".concat(ee,") offset wells at a time.")}),Y&&h(u,{className:F.viewOnlyTitleLabel,children:"This is the view only mode. To edit offset wells, use the Offset Well Selection app."}),g("div",{className:F.controlGroup,children:[g(y,{startIcon:h(oe?j:C,{}),classes:{root:F.filterButton},onClick:function(){return ne((function(e){return!e}))},disabled:Y,children:["Filters",!m(fe)&&g("div",{className:F.clearWrapper,onClick:function(e){e.stopPropagation(),je({})},children:[h(v,{className:F.clearIcon}),h("span",{className:F.clearLabel,children:"Clear"})]})]}),h(S,{rightLabel:"Map",color:"primary",checked:!pe,onChange:function(e){return ae(!e.target.checked)}})]}),g("div",{className:F.content,onScroll:function(e){e.target&&(Ne&&(e.target.scrollLeft=0,Me(!1)),e.target.scrollLeft<=5&&Et&&wt(!1),e.target.scrollLeft>5&&!Et&&wt(!0),e.target.scrollTop<12&&kt&&Ht(!1),e.target.scrollTop>=12&&!kt&&Ht(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight)>=e.target.scrollHeight&&Nt<Ct.length&&Mt((function(e){return e+U})))},children:[kt&&h("div",{className:F.topGradient}),!pe&&K&&h(H,{isViewOnly:Y,mapHidden:pe,companyId:me,subjectWell:We,offsetWellIds:Se.map((function(e){return e.id})),wells:st,radius:fe[R.radius],handleChanageOffsetWell:gt}),h(k,{isHidden:!oe,isWDUser:G,filterOptions:lt,filters:fe,wellSections:et,selectedWellSection:be,subjectWell:We,onChangeFilters:je,onChangeBicWells:St}),h(V,{open:K,isTableLoading:Ee,companyId:me,subjectWellId:ce,sortBy:dt,setSortBy:ut,sortDirection:ft,setSortDirection:jt,columnsWithDict:pt,wells:zt,metricsKeys:ot,setMetricsKeys:ht,handleChanageOffsetWell:gt,handleChangeAllOffsetWells:At,handleAddRemoveAssets:vt,isWellNameExpand:ke,setIsWellNameExpand:He,isHscrollMoved:Et,onHideAdvancedSearch:bt,isViewOnly:Y,isLastWell:Ct.length<=Nt,contentRef:qe,isHintPopperOpen:Je,setIsHintPopperOpen:Qe,isLimitedOffsetwells:ze,tableTop:Xe,wellSections:et})]})]})})};G.propTypes={isWDUser:p.bool,defaultSubjectWell:p.shape({asset_id:p.number,companyId:p.number}),offsetSettings:p.shape({selectedWellIds:p.arrayOf(p.number),manualWellIds:p.arrayOf(p.number),filters:p.shape({}),metricsKeys:p.arrayOf(p.string),wellSection:p.string,companyId:p.number,subjectWellId:p.number,mapHidden:p.bool,filterExpanded:p.bool,hintPopupClosed:p.bool}),currentUser:p.shape({company_id:p.number}).isRequired,open:p.bool.isRequired,addWellsUsabilityInfo:p.func,isViewOnly:p.bool,onSave:p.func.isRequired,onClose:p.func.isRequired,maxOffsetSize:p.number},G.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1,maxOffsetSize:50};export{G as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{memo as r,useRef as i,useMemo as o,useEffect as s,useCallback as n}from"react";import p from"classnames";import a from"prop-types";import{Table as l,TableHead as m,TableBody as d,TableRow as c,TableCell as u}from"@material-ui/core";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as j,jsxs as C,Fragment as f}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import A from"../../../LoadingIndicator/LoadingIndicator.js";import"../../../../constants/segment.js";import"../../../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../../../Modal/CorvaModal.js";import"@babel/runtime/helpers/objectWithoutProperties";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"lodash";import"../../../Icons/AnnotationIcon.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../../../clients/jsonApi/index.js";import"../../../../clients/subscriptions.js";import"../../../../constants/goals.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../utils/index.js";import"../../../HelpCenter/HelpCenterIcon.js";import"../../../DevCenter/AppContext.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../../../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../AssetEditor/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../Typography.js";import"../../../CollapsableSidebar.js";import"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../../../ParameterCharts/ParameterCharts.js";import"../../../ParameterCharts/AddEditTrack.js";import"../../../ChartActionsList/ChartActionsList.js";import"../../../CopyToClipboard/CopyToClipboard.js";import"../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../AssetEditor/SingleAssetEditor.js";import"../../../SettingEditors/ColorEditor/index.js";import"../../../SettingEditors/DropdownEditor/index.js";import"../../../SettingEditors/RadioEditor/index.js";import"../../../SwitchControl/index.js";import"../../../ColorPicker/ColorPicker.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../RangeSlider/RangeSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../Button/index.js";import"../../../ContextMenuItem/index.js";import"../../../FolderMenuItem/index.js";import"../../../EditableItem/EditableItem/index.js";import"../../../EditableItem/EditableItemWithBadge/index.js";import"../../../Checkbox/index.js";import"../../../FolderMenuItemWithLinks/index.js";import"../../../IconButton/index.js";import"../../../TextField/index.js";import"../../../Chip/index.js";import"../../../Counter/index.js";import"../../../AnchorsList/AnchorsList.js";import"../../../Select/index.js";import"../../../CustomSelect/index.js";import"../../../Tabs/Tabs.js";import"../../../Tabs/Tab.js";import"../../../ResizableTable/ResizableTable.js";import"../../../Drillstring/BHASchematic.js";import"../../../Drillstring/BHATable/index.js";import"../../../Drillstring/BHAComponentIcon.js";import"../../../Drillstring/BHAComponentDetail/index.js";import"../../../Drillstring/BHATileIcon.js";import"../../../Drillstring/BHATile/BHATile.js";import"../../../Drillstring/BHAList/BHAList.js";import"../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../Casing/CasingTable/index.js";import"../../../Casing/CasingComponentIcon.js";import"../../../Casing/CasingTileIcon.js";import"../../../Casing/CasingTableV2/CasingTableV2.js";import"../../../Casing/CasingTile/CasingTile.js";import"../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../WellSummary/WellSummaryItemLabel.js";import"../../../WellSummary/WellSummaryItemTitle.js";import"../../../WellSummary/WellSummaryItemValue.js";import"../../../WellSummary/ActivitySummaryChart.js";import"../../../WellSummary/FracWirelineTimeChart.js";import"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../OffsetWellPickerV4.js";import"../../../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"uuid";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../MenuItem/index.js";import"../../../PadModeSelect/PadModeSelect.js";import"../../../PinnableFilters/PinnableFilters.js";import"../../../HeaderLayout/HeaderLayout.js";import"../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../PadOffsetsPicker/StagesSelector.js";import"../../../Table/TableToolbar/TableToolbar.js";import"../../../Tooltip/MuiTooltipDcWrapper.js";import"../../../PriceInput/PriceInput.js";import"../../../LabelsCounter/LabelsCounter.js";import"../../../Stepper/Step.js";import"../../../Stepper/StepsWrapper.js";import"../../../Stepper/Stepper.js";import"../../../Comment/CommentIcon/index.js";import"../../../FilesLoader/FilesLoader.js";import"../../../FilesLoader/Icons/FileIcon.js";import"../../../SearchInput/index.js";import"../../../FeedItem/FeedItem.js";import"../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../PostInput/PostInput.js";import"../../../KeyboardDateTimePicker.js";import"../../../AddComment/Popover.js";import"../../../AddComment/Popup.js";import"../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../StageDesignVActual/ComparisonHeader.js";import"../../../StageDesignVActual/ComparisonRow.js";import"../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../EmbeddedApp/EmbeddedApp.js";import"../../../Autocomplete/Autocomplete.js";import"../../../DocumentViewer/DocumentViewer.js";import"../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../Search/Search.js";import"../../../Search/components/Listbox.js";import"../../../Search/components/Paper.js";import"../../../Search/components/RecentSearches.js";import"../../../Search/components/InputAdornmentLeft.js";import"../../../Search/components/Groups.js";import{AdvancedSearch as h}from"./AdvancedSearch/AdvancedSearch.js";import b from"./OffsetWellsTableHead.js";import D from"./OffsetWellsTableRow.js";import{METRICS_LIST as v,EXPANED_WELLNAME_WIDTH as g,TableColumns as S,ROW_HEIGHT as y}from"../../constants.js";import x from"./OffsetWellsTable.module.css.js";import{getIsImperial as P}from"../../utils/unitSystem.js";var I=function(r){var a=r.open,I=r.isTableLoading,T=r.companyId,E=r.subjectWellId,W=r.sortBy,R=r.setSortBy,w=r.sortDirection,O=r.setSortDirection,B=r.columnsWithDict,L=r.wells,k=r.metricsKeys,H=r.setMetricsKeys,q=r.handleChanageOffsetWell,V=r.handleChangeAllOffsetWells,F=r.handleAddRemoveAssets,N=r.isWellNameExpand,M=r.setIsWellNameExpand,K=r.isHscrollMoved,z=r.onHideAdvancedSearch,U=r.isViewOnly,G=r.isLastWell,J=r.contentRef,Q=r.isHintPopperOpen,X=r.setIsHintPopperOpen,Y=r.isLimitedOffsetwells,Z=r.tableTop,$=i(),_=i(),ee=o((function(){var e=L.filter((function(e){return e.checked}));return[e,L.length!==e.length&&e.length&&!Y,e.length===L.length||Y]}),[L,Y]),te=t(ee,3),re=te[0],ie=te[1],oe=te[2],se=o((function(){return P()}),[]),ne=o((function(){return(k||[]).reduce((function(e,t){return e.concat(v.filter((function(e){return e.key===t})))}),[])}),[k]),pe=o((function(){return N?g-58:S[0].width[k.length]-58}),[N,null==k?void 0:k.length]),ae=o((function(){return re.length*y}),[re]);s((function(){var e=$.current.querySelector(".".concat(x.wellNameFixed));K?e.classList.remove(x.noShadow):e.classList.add(x.noShadow);var t=_.current.querySelectorAll(".".concat(x.wellNameFixed));K?t.forEach((function(e){return e.classList.remove(x.noShadow)})):t.forEach((function(e){return e.classList.add(x.noShadow)}))}),[K,_.current,$.current,L]);var le=n((function(e,t){R(e),O(t)}),[]),me=n((function(e){H(e)}),[]),de=n((function(e,t){H((function(r){return r.map((function(r){return r===e?t:r}))}))}),[]);return I?j(A,{fullscreen:!1}):B&&L?C(f,{children:[j("div",{className:x.stickyTable,children:C(l,{"aria-label":"ows table head",innerRef:$,children:[j(m,{children:j(b,{open:a,columnsWithDict:B,metricsKeys:k,sortBy:W,sortDirection:w,indeterminate:ie,isAllWellsSelected:oe,onChangeSort:le,onChangeMetricsKeys:me,onUpdateMetricsKey:de,isWellNameExpand:N,setIsWellNameExpand:M,handleChangeAllOffsetWells:V,wellNameStyle:x.wellNameFixed,isViewOnly:U,isImperial:se,contentRef:J,isHintPopperOpen:Q,setIsHintPopperOpen:X})}),!U&&j(d,{children:j(c,{children:j(u,{className:x.searchCell,children:j(h,{companyId:T,wells:L,onChange:F,selectedWellIds:re.map((function(e){return e.id})),onHideAdvancedSearch:z})})})})]})}),j(l,{"aria-label":"ows table body",innerRef:_,className:x.bodyTable,children:C(d,{children:[j(c,{children:j(u,{className:p(x.topShadow,e({},x.viewOnlyShadow,U))})}),L.map((function(e){return j(D,{columnsWithDict:B,subjectWellId:E,data:e,metricsKeys:k,metricsColumns:ne,handleChanageOffsetWell:q,isWellNameExpand:N,wellNameStyle:x.wellNameFixed,wellNameWidth:pe,isViewOnly:U,isImperial:se,isLimitedOffsetwells:Y,flyTo:ae,tableTop:Z},e.id)})),!G&&j(c,{children:j(u,{className:x.loadingCell,children:j("span",{children:"Loading..."})})}),j(c,{children:j(u,{className:x.bottomShadow})})]})})]}):null};I.propTypes={open:a.bool.isRequired,isTableLoading:a.bool.isRequired,companyId:a.number.isRequired,subjectWellId:a.number.isRequired,sortBy:a.string.isRequired,setSortBy:a.func.isRequired,sortDirection:a.string.isRequired,setSortDirection:a.func.isRequired,columnsWithDict:a.arrayOf(a.shape({})).isRequired,wells:a.arrayOf(a.shape({})).isRequired,metricsKeys:a.arrayOf(a.string).isRequired,setMetricsKeys:a.func.isRequired,handleChanageOffsetWell:a.func.isRequired,handleChangeAllOffsetWells:a.func.isRequired,handleAddRemoveAssets:a.func.isRequired,setIsWellNameExpand:a.func.isRequired,isWellNameExpand:a.bool.isRequired,isHscrollMoved:a.bool.isRequired,onHideAdvancedSearch:a.func.isRequired,isViewOnly:a.bool.isRequired,isLastWell:a.bool.isRequired,isHintPopperOpen:a.bool.isRequired,setIsHintPopperOpen:a.func.isRequired,isLimitedOffsetwells:a.bool.isRequired,contentRef:a.shape().isRequired,tableTop:a.number.isRequired};var T=r(I);export{T as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{memo as r,useRef as i,useMemo as o,useEffect as s,useCallback as n}from"react";import p from"classnames";import a from"prop-types";import{Table as l,TableHead as m,TableBody as d,TableRow as c,TableCell as u}from"@material-ui/core";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as j,jsxs as C,Fragment as f}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import A from"../../../LoadingIndicator/LoadingIndicator.js";import"../../../../constants/segment.js";import"../../../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../../../Modal/CorvaModal.js";import"@babel/runtime/helpers/objectWithoutProperties";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"lodash";import"../../../Icons/AnnotationIcon.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../../../clients/jsonApi/index.js";import"../../../../clients/subscriptions.js";import"../../../../constants/goals.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import"../../../../utils/index.js";import"../../../HelpCenter/HelpCenterIcon.js";import"../../../DevCenter/AppContext.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../../../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../AssetEditor/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../Typography.js";import"../../../CollapsableSidebar.js";import"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../../../ParameterCharts/ParameterCharts.js";import"../../../ParameterCharts/AddEditTrack.js";import"../../../ChartActionsList/ChartActionsList.js";import"../../../CopyToClipboard/CopyToClipboard.js";import"../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../AssetEditor/SingleAssetEditor.js";import"../../../SettingEditors/ColorEditor/index.js";import"../../../SettingEditors/DropdownEditor/index.js";import"../../../SettingEditors/RadioEditor/index.js";import"../../../SwitchControl/index.js";import"../../../ColorPicker/ColorPicker.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../RangeSlider/RangeSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../Button/index.js";import"../../../ContextMenuItem/index.js";import"../../../FolderMenuItem/index.js";import"../../../EditableItem/EditableItem/index.js";import"../../../EditableItem/EditableItemWithBadge/index.js";import"../../../Checkbox/index.js";import"../../../FolderMenuItemWithLinks/index.js";import"../../../IconButton/index.js";import"../../../TextField/index.js";import"../../../Chip/index.js";import"../../../Counter/index.js";import"../../../AnchorsList/AnchorsList.js";import"../../../Select/index.js";import"../../../CustomSelect/index.js";import"../../../Tabs/Tabs.js";import"../../../Tabs/Tab.js";import"../../../ResizableTable/ResizableTable.js";import"../../../Drillstring/BHASchematic.js";import"../../../Drillstring/BHATable/index.js";import"../../../Drillstring/BHAComponentIcon.js";import"../../../Drillstring/BHAComponentDetail/index.js";import"../../../Drillstring/BHATileIcon.js";import"../../../Drillstring/BHATile/BHATile.js";import"../../../Drillstring/BHAList/BHAList.js";import"../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../Casing/CasingTable/index.js";import"../../../Casing/CasingComponentIcon.js";import"../../../Casing/CasingTileIcon.js";import"../../../Casing/CasingTableV2/CasingTableV2.js";import"../../../Casing/CasingTile/CasingTile.js";import"../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../WellSummary/WellSummaryItemLabel.js";import"../../../WellSummary/WellSummaryItemTitle.js";import"../../../WellSummary/WellSummaryItemValue.js";import"../../../WellSummary/ActivitySummaryChart.js";import"../../../WellSummary/FracWirelineTimeChart.js";import"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../OffsetWellPickerV4.js";import"../../../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"uuid";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../MenuItem/index.js";import"../../../PadModeSelect/PadModeSelect.js";import"../../../PinnableFilters/PinnableFilters.js";import"../../../HeaderLayout/HeaderLayout.js";import"../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../PadOffsetsPicker/StagesSelector.js";import"../../../Table/TableToolbar/TableToolbar.js";import"../../../Tooltip/MuiTooltipDcWrapper.js";import"../../../PriceInput/PriceInput.js";import"../../../LabelsCounter/LabelsCounter.js";import"../../../Stepper/Step.js";import"../../../Stepper/StepsWrapper.js";import"../../../Stepper/Stepper.js";import"../../../Comment/CommentIcon/index.js";import"../../../FilesLoader/FilesLoader.js";import"../../../FilesLoader/Icons/FileIcon.js";import"../../../SearchInput/index.js";import"../../../FeedItem/FeedItem.js";import"../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../PostInput/PostInput.js";import"../../../KeyboardDateTimePicker.js";import"../../../AddComment/Popover.js";import"../../../AddComment/Popup.js";import"../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../StageDesignVActual/ComparisonHeader.js";import"../../../StageDesignVActual/ComparisonRow.js";import"../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../EmbeddedApp/EmbeddedApp.js";import"../../../Autocomplete/Autocomplete.js";import"../../../DocumentViewer/DocumentViewer.js";import"../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../Search/Search.js";import"../../../Search/components/Listbox.js";import"../../../Search/components/Paper.js";import"../../../Search/components/RecentSearches.js";import"../../../Search/components/InputAdornmentLeft.js";import"../../../Search/components/Groups.js";import{AdvancedSearch as h}from"./AdvancedSearch/AdvancedSearch.js";import b from"./OffsetWellsTableHead.js";import D from"./OffsetWellsTableRow.js";import{METRICS_LIST as v,EXPANED_WELLNAME_WIDTH as S,TableColumns as g,ROW_HEIGHT as y}from"../../constants.js";import x from"./OffsetWellsTable.module.css.js";import{getIsImperial as P}from"../../utils/unitSystem.js";var I=function(r){var a=r.open,I=r.isTableLoading,T=r.companyId,E=r.subjectWellId,W=r.sortBy,w=r.setSortBy,R=r.sortDirection,O=r.setSortDirection,B=r.columnsWithDict,L=r.wells,k=r.metricsKeys,q=r.setMetricsKeys,H=r.handleChanageOffsetWell,V=r.handleChangeAllOffsetWells,F=r.handleAddRemoveAssets,N=r.isWellNameExpand,M=r.setIsWellNameExpand,K=r.isHscrollMoved,z=r.onHideAdvancedSearch,U=r.isViewOnly,G=r.isLastWell,J=r.contentRef,Q=r.isHintPopperOpen,X=r.setIsHintPopperOpen,Y=r.isLimitedOffsetwells,Z=r.tableTop,$=r.wellSections,_=i(),ee=i(),te=o((function(){var e=L.filter((function(e){return e.checked}));return[e,L.length!==e.length&&e.length&&!Y,e.length===L.length||Y]}),[L,Y]),re=t(te,3),ie=re[0],oe=re[1],se=re[2],ne=o((function(){return P()}),[]),pe=o((function(){return(k||[]).reduce((function(e,t){return e.concat(v.filter((function(e){return e.key===t})))}),[])}),[k]),ae=o((function(){return N?S-58:g[0].width[k.length]-58}),[N,null==k?void 0:k.length]),le=o((function(){return ie.length*y}),[ie]);s((function(){var e=_.current.querySelector(".".concat(x.wellNameFixed));K?e.classList.remove(x.noShadow):e.classList.add(x.noShadow);var t=ee.current.querySelectorAll(".".concat(x.wellNameFixed));K?t.forEach((function(e){return e.classList.remove(x.noShadow)})):t.forEach((function(e){return e.classList.add(x.noShadow)}))}),[K,ee.current,_.current,L]);var me=n((function(e,t){w(e),O(t)}),[]),de=n((function(e){q(e)}),[]),ce=n((function(e,t){q((function(r){return r.map((function(r){return r===e?t:r}))}))}),[]);return I?j(A,{fullscreen:!1}):B&&L?C(f,{children:[j("div",{className:x.stickyTable,children:C(l,{"aria-label":"ows table head",innerRef:_,children:[j(m,{children:j(b,{open:a,columnsWithDict:B,metricsKeys:k,sortBy:W,sortDirection:R,indeterminate:oe,isAllWellsSelected:se,onChangeSort:me,onChangeMetricsKeys:de,onUpdateMetricsKey:ce,isWellNameExpand:N,setIsWellNameExpand:M,handleChangeAllOffsetWells:V,wellNameStyle:x.wellNameFixed,isViewOnly:U,isImperial:ne,contentRef:J,isHintPopperOpen:Q,setIsHintPopperOpen:X})}),!U&&j(d,{children:j(c,{children:j(u,{className:x.searchCell,children:j(h,{companyId:T,wells:L,onChange:F,selectedWellIds:ie.map((function(e){return e.id})),onHideAdvancedSearch:z})})})})]})}),j(l,{"aria-label":"ows table body",innerRef:ee,className:x.bodyTable,children:C(d,{children:[j(c,{children:j(u,{className:p(x.topShadow,e({},x.viewOnlyShadow,U))})}),L.map((function(e){return j(D,{columnsWithDict:B,subjectWellId:E,data:e,metricsKeys:k,metricsColumns:pe,handleChanageOffsetWell:H,isWellNameExpand:N,wellNameStyle:x.wellNameFixed,wellNameWidth:ae,isViewOnly:U,isImperial:ne,isLimitedOffsetwells:Y,flyTo:le,tableTop:Z,wellSections:$},e.id)})),!G&&j(c,{children:j(u,{className:x.loadingCell,children:j("span",{children:"Loading..."})})}),j(c,{children:j(u,{className:x.bottomShadow})})]})})]}):null};I.propTypes={open:a.bool.isRequired,isTableLoading:a.bool.isRequired,companyId:a.number.isRequired,subjectWellId:a.number.isRequired,sortBy:a.string.isRequired,setSortBy:a.func.isRequired,sortDirection:a.string.isRequired,setSortDirection:a.func.isRequired,columnsWithDict:a.arrayOf(a.shape({})).isRequired,wells:a.arrayOf(a.shape({})).isRequired,metricsKeys:a.arrayOf(a.string).isRequired,setMetricsKeys:a.func.isRequired,handleChanageOffsetWell:a.func.isRequired,handleChangeAllOffsetWells:a.func.isRequired,handleAddRemoveAssets:a.func.isRequired,setIsWellNameExpand:a.func.isRequired,isWellNameExpand:a.bool.isRequired,isHscrollMoved:a.bool.isRequired,onHideAdvancedSearch:a.func.isRequired,isViewOnly:a.bool.isRequired,isLastWell:a.bool.isRequired,isHintPopperOpen:a.bool.isRequired,setIsHintPopperOpen:a.func.isRequired,isLimitedOffsetwells:a.bool.isRequired,contentRef:a.shape().isRequired,tableTop:a.number.isRequired,wellSections:a.arrayOf(a.shape({})).isRequired};var T=r(I);export{T as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{memo as i,useState as n}from"react";import l from"classnames";import s from"prop-types";import{SortDirection as a}from"react-virtualized";import{withStyles as o,Tooltip as c,TableRow as d,TableCell as p,ClickAwayListener as u,Button as m,Checkbox as h,TableSortLabel as f}from"@material-ui/core";import{ArrowForwardIos as y}from"@material-ui/icons";import{MetricsSettingMenu as b}from"./MetricsSettingMenu.js";import{MetricsSelect as C}from"./MetricsSelect.js";import{EXPANED_WELLNAME_WIDTH as g,ColumnType as v}from"../../constants.js";import O from"./OffsetWellsTableHead.module.css.js";import{jsxs as w,jsx as N}from"react/jsx-runtime";var R=["title"];function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function q(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?S(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):S(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var W=function(e){var t=e.title,i=r(e,R);return N(c,{placement:"top-end",title:t,children:N(f,q({},i))})},j=o((function(e){return{tooltip:{width:"332px",maxWidth:"332px",height:"125px",padding:"16px",backgroundColor:e.palette.info.dark,borderRadius:"10px"},arrow:{color:e.palette.info.dark}}}))(c);function k(e,t){var r=e.find((function(e){return e.key===t}));return(null==r?void 0:r.width)||0}var D=function(r){var i=r.open,s=r.columnsWithDict,o=r.metricsKeys,f=r.sortBy,R=r.sortDirection,S=r.indeterminate,q=r.isAllWellsSelected,D=r.onChangeSort,E=r.onChangeMetricsKeys,x=r.onUpdateMetricsKey,P=r.isWellNameExpand,A=r.setIsWellNameExpand,I=r.handleChangeAllOffsetWells,M=r.wellNameStyle,K=r.isViewOnly,L=r.isImperial,H=r.contentRef,T=r.isHintPopperOpen,V=r.setIsHintPopperOpen,B=n(!1),z=e(B,2),U=z[0],G=z[1],F=function(e){D(e,e===f&&R===a.ASC?a.DESC:a.ASC)};return w(d,{className:O.tableRow,children:[w(p,{className:l(O.headCell,O.wellNameCell,M),style:{width:P?g:k(s,v.name)},children:[w("div",{className:O.nameWrapper,children:[!K&&i&&N(u,{onClickAway:function(){return V(!1)},children:N(j,{open:T,interactive:!0,placement:"top-start",title:w("div",{className:O.popperContent,children:["Selected Offsets are automatically moved to the top of the list!",N("div",{className:O.popperButtonWrapper,children:N(m,{classes:{root:O.popperButton},onClick:function(){return V(!1)},children:"Got It"})})]}),arrow:"top",children:N(h,{size:"medium",onChange:function(e){return I(e.target.checked)},checked:q,indeterminate:S})})}),N(W,{title:"Sort",active:f===v.name,direction:f===v.name&&R===a.DESC?"desc":"asc",classes:{root:l(O.headerLabel,t({},O.cellDataViewOnly,K))},onClick:function(){return F(v.name)},children:"Well Name"})]}),N(c,{title:P?"Collapse":"Expand",children:N(y,{className:l(O.wellNameExpandIcon,t({},O.wellNameCollapsed,!P)),onClick:function(){return A(!P)}})})]}),N(p,{className:O.headCell,style:{width:k(s,v.status)}}),N(p,{className:O.headCell,style:{width:k(s,v.rig)},children:N("div",{className:O.nameWrapper,children:N(W,{title:"Sort",active:f===v.rig,direction:f===v.rig&&R===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(v.rig)},children:"Rig"})})}),N(p,{className:O.headCell,style:{width:k(s,v.distance)},children:N("div",{className:O.nameWrapper,children:N(W,{title:"Sort",active:f===v.distance,direction:f===v.distance&&R===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(v.distance)},children:"Distance (".concat(L?"miles":"km",")")})})}),N(p,{className:O.headCell,style:{width:k(s,v.lastActive)},children:N("div",{className:O.nameWrapper,children:N(W,{title:"Sort",active:f===v.lastActive,direction:f===v.lastActive&&R===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(v.lastActive)},children:"Last Active"})})}),o.map((function(e){return N(p,{className:O.headCell,style:{width:k(s,e)},children:N(W,{title:U?"":"Sort",active:f===e,direction:f===e&&R===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(e)},children:N(C,{isTooltipVisible:o.length>1,currentValue:e,onChange:function(t){return x(e,t)},setIsMenuOpen:G})})},e)})),N(p,{className:O.headCell,style:{width:k(s,v.wellSection)},children:N("div",{className:O.settingsHeader,children:N(b,{metricsKeys:o,onChange:E,contentRef:H})})})]})};D.propTypes={open:s.bool.isRequired,columnsWithDict:s.arrayOf(s.shape({key:s.string,label:s.string,type:s.string,width:s.number})).isRequired,metricsKeys:s.arrayOf(s.string).isRequired,sortBy:s.string.isRequired,sortDirection:s.string.isRequired,indeterminate:s.bool.isRequired,isAllWellsSelected:s.bool.isRequired,style:s.shape({}).isRequired,onChangeSort:s.func.isRequired,onChangeMetricsKeys:s.func.isRequired,onUpdateMetricsKey:s.func.isRequired,isWellNameExpand:s.bool.isRequired,setIsWellNameExpand:s.func.isRequired,handleChangeAllOffsetWells:s.func.isRequired,wellNameStyle:s.string.isRequired,isViewOnly:s.bool.isRequired,isImperial:s.bool.isRequired,isHintPopperOpen:s.bool.isRequired,setIsHintPopperOpen:s.func.isRequired,contentRef:s.shape({current:s.instanceOf(Element)}).isRequired};var E=i(D);export{E as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{memo as i,useState as n}from"react";import l from"classnames";import s from"prop-types";import{SortDirection as a}from"react-virtualized";import{withStyles as o,Tooltip as c,TableRow as d,TableCell as p,ClickAwayListener as m,Button as u,Checkbox as h,TableSortLabel as f}from"@material-ui/core";import{ArrowForwardIos as y}from"@material-ui/icons";import{MetricsSettingMenu as b}from"./MetricsSettingMenu.js";import{MetricsSelect as C}from"./MetricsSelect.js";import{EXPANED_WELLNAME_WIDTH as g,ColumnType as v}from"../../constants.js";import O from"./OffsetWellsTableHead.module.css.js";import{jsxs as w,jsx as N}from"react/jsx-runtime";var S=["title"];function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function q(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?R(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var W=function(e){var t=e.title,i=r(e,S);return N(c,{placement:"top-end",title:t,children:N(f,q({},i))})},j=o((function(e){return{tooltip:{width:"332px",maxWidth:"332px",height:"125px",padding:"16px",backgroundColor:e.palette.info.dark,borderRadius:"10px"},arrow:{color:e.palette.info.dark}}}))(c);function k(e,t){var r=e.find((function(e){return e.key===t}));return(null==r?void 0:r.width)||0}var D=function(r){var i=r.open,s=r.columnsWithDict,o=r.metricsKeys,f=r.sortBy,S=r.sortDirection,R=r.indeterminate,q=r.isAllWellsSelected,D=r.onChangeSort,E=r.onChangeMetricsKeys,x=r.onUpdateMetricsKey,P=r.isWellNameExpand,A=r.setIsWellNameExpand,I=r.handleChangeAllOffsetWells,L=r.wellNameStyle,M=r.isViewOnly,K=r.isImperial,H=r.contentRef,T=r.isHintPopperOpen,V=r.setIsHintPopperOpen,B=n(!1),z=e(B,2),U=z[0],G=z[1],F=function(e){D(e,e===f&&S===a.ASC?a.DESC:a.ASC)};return w(d,{className:O.tableRow,children:[N(p,{className:l(O.headCell,O.wellNameCell,L),style:{width:P?g:k(s,v.name)},children:w("div",{className:O.nameWrapper,children:[!M&&i&&N(m,{onClickAway:function(){return V(!1)},children:N(j,{open:T,interactive:!0,placement:"top-start",title:w("div",{className:O.popperContent,children:["Selected Offsets are automatically moved to the top of the list!",N("div",{className:O.popperButtonWrapper,children:N(u,{classes:{root:O.popperButton},onClick:function(){return V(!1)},children:"Got It"})})]}),arrow:"top",children:N(h,{size:"medium",onChange:function(e){return I(e.target.checked)},checked:q,indeterminate:R})})}),N(W,{title:"Sort",active:f===v.name,direction:f===v.name&&S===a.DESC?"desc":"asc",classes:{root:l(O.headerLabel,t({},O.cellDataViewOnly,M))},onClick:function(){return F(v.name)},children:"Well Name"})]})}),N(p,{className:O.headCell,style:{width:k(s,v.status)},children:N(c,{title:P?"Collapse":"Expand",children:N(y,{className:l(O.wellNameExpandIcon,t({},O.wellNameCollapsed,!P)),onClick:function(){return A(!P)}})})}),N(p,{className:O.headCell,style:{width:k(s,v.rig)},children:N("div",{className:O.nameWrapper,children:N(W,{title:"Sort",active:f===v.rig,direction:f===v.rig&&S===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(v.rig)},children:"Rig"})})}),N(p,{className:O.headCell,style:{width:k(s,v.distance)},children:N("div",{className:O.nameWrapper,children:N(W,{title:"Sort",active:f===v.distance,direction:f===v.distance&&S===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(v.distance)},children:"Distance (".concat(K?"miles":"km",")")})})}),N(p,{className:O.headCell,style:{width:k(s,v.lastActive)},children:N("div",{className:O.nameWrapper,children:N(W,{title:"Sort",active:f===v.lastActive,direction:f===v.lastActive&&S===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(v.lastActive)},children:"Last Active"})})}),o.map((function(e){return N(p,{className:O.headCell,style:{width:k(s,e)},children:N(W,{title:U?"":"Sort",active:f===e,direction:f===e&&S===a.DESC?"desc":"asc",classes:{root:O.headerLabel},onClick:function(){return F(e)},children:N(C,{isTooltipVisible:o.length>1,currentValue:e,onChange:function(t){return x(e,t)},setIsMenuOpen:G})})},e)})),N(p,{className:O.headCell,style:{width:k(s,v.wellSection)},children:w("div",{className:O.settingsHeader,children:[N("span",{className:O.headerLabel,children:"Well Section"}),N(b,{metricsKeys:o,onChange:E,contentRef:H})]})})]})};D.propTypes={open:s.bool.isRequired,columnsWithDict:s.arrayOf(s.shape({key:s.string,label:s.string,type:s.string,width:s.number})).isRequired,metricsKeys:s.arrayOf(s.string).isRequired,sortBy:s.string.isRequired,sortDirection:s.string.isRequired,indeterminate:s.bool.isRequired,isAllWellsSelected:s.bool.isRequired,style:s.shape({}).isRequired,onChangeSort:s.func.isRequired,onChangeMetricsKeys:s.func.isRequired,onUpdateMetricsKey:s.func.isRequired,isWellNameExpand:s.bool.isRequired,setIsWellNameExpand:s.func.isRequired,handleChangeAllOffsetWells:s.func.isRequired,wellNameStyle:s.string.isRequired,isViewOnly:s.bool.isRequired,isImperial:s.bool.isRequired,isHintPopperOpen:s.bool.isRequired,setIsHintPopperOpen:s.func.isRequired,contentRef:s.shape({current:s.instanceOf(Element)}).isRequired};var E=i(D);export{E as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as r,useRef as i,useState as l,useCallback as n,useEffect as s}from"react";import a from"prop-types";import{startCase as o,get as c}from"lodash";import u from"classnames";import d from"moment";import{TableRow as m,TableCell as f,Checkbox as y,Tooltip as h,Typography as b}from"@material-ui/core";import{convertValue as p}from"../../../../utils/index.js";import{ColumnType as v,EXPANED_WELLNAME_WIDTH as N,StatusOptions as w,ROW_HEIGHT as g}from"../../constants.js";import{SubjectWellMark as R}from"./SubjectWellMark.js";import C from"./OffsetWellsTableRow.module.css.js";import{jsxs as W,jsx as q}from"react/jsx-runtime";function k(e,t,r){var i=t.find((function(e){return e.key===r})),l=c(e,i.key);return"undefined"===l?"loading...":Number.isFinite(l)||l?i.unitType?p(l,i.unitType,i.from,i.to):l:"—"}function T(e,t){var r=c(e,v.distance);return Number.isFinite(r)?t?r:p(r,"length","mi","km"):"—"}function x(e,t){var r=e.find((function(e){return e.key===t}));return(null==r?void 0:r.width)||0}var O=function(r){var a,c,p=r.columnsWithDict,O=r.data,j=r.subjectWellId,D=r.metricsKeys,M=r.metricsColumns,I=r.handleChanageOffsetWell,S=r.isWellNameExpand,A=r.wellNameStyle,Y=r.wellNameWidth,z=r.isViewOnly,E=r.isImperial,F=r.isLimitedOffsetwells,L=r.flyTo,V=r.tableTop,K=j===O.id,P=t({},C.subjectWellRow,K),H=i(),B=i(),G=l(!1),J=e(G,2),Q=J[0],U=J[1],X=i(),Z=!1,$=O[v.name]||"—",_=$;if(!S&&2*Y<8*$.length){var ee=function(e){var t=document.createElement("span");document.body.appendChild(t),t.style.font="Roboto",t.style.fontSize="14px",t.style.letterSpacing="0.01071em",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.innerHTML=e;var r=Math.ceil(t.clientWidth);return document.body.removeChild(t),r}($);if(ee>2*Y){var te=2*Y/(ee/$.length);_="".concat($.substring(0,te/2-2),"\n... ").concat($.substring($.length-te/2+6)),Z=!0}}var re=n((function(e,t){var r=t-e+16;H.current.style.position="absolute",H.current.style.top="".concat(e,"px"),H.current.style.zIndex=3,H.current.style.transition="transform ".concat(800,"ms ease"),H.current.style.transform="translateY(".concat(r,"px)")}),[]),ie=n((function(){H.current.style.position="unset",H.current.style.zIndex=1,H.current.style.transition="none",H.current.style.transform="none"}),[]);s((function(){ie(),U(!1),B.current&&(clearTimeout(B.current),B.current=null),X.current=L}),[L]);var le=n((function(e){if(!B.current){var t=H.current.offsetTop,r=L;e?Math.abs(r-t)>=7*g&&(r=t-7*g):r=t+7*g,U(!0),re(t,r),B.current=setTimeout((function(){return I(O,e)}),800)}}),[O,L,V]);return W(m,{className:C.bodyRow,innerRef:H,children:[W(f,{className:u(C.bodyCell,C.wellNameCell,A,P),style:{width:S?N:x(p,v.name)},children:[K&&q(R,{className:C.subjectWellMark}),!K&&q(y,{size:"medium",checked:Q&&X.current===L?!O.checked:O.checked,disabled:z||F&&!O.checked,onChange:function(e){return le(e.target.checked)}}),q(h,{title:Z?$:"",children:q(b,{variant:"body2",className:u(C.wellNameCursor,(a={},t(a,C.cellDataViewOnly,K),t(a,C.wellNamePreWrap,Z),a)),children:Z?_:$})})]}),q(f,{className:u(C.bodyCell,P),style:{width:x(p,v.status)},children:!K&&q(h,{title:o(O[v.status]),children:q("div",{className:C.status,style:{background:null===(c=w.find((function(e){return e.value===O[v.status]})))||void 0===c?void 0:c.color}})})}),q(f,{className:u(C.bodyCell,P),style:{width:x(p,v.rig)},children:q(b,{variant:"body2",className:C.cellData,children:O[v.rig]&&"Null"!==O[v.rig]?O[v.rig]:"—"})}),q(f,{className:u(C.bodyCell,P),style:{width:x(p,v.distance)},children:q(b,{variant:"body2",className:C.cellData,children:T(O,E)})}),q(f,{className:u(C.bodyCell,P),style:{width:x(p,v.lastActive)},children:q(b,{variant:"body2",className:C.cellData,children:O[v.lastActive]&&Number.isFinite(O[v.lastActive])?d.unix(O[v.lastActive]).format("MM/DD/YYYY"):"—"})}),D.map((function(e){return q(f,{className:u(C.bodyCell,P),style:{width:x(p,e)},children:q(b,{variant:"body2",className:C.cellData,children:k(O,M,e)})},e)})),q(f,{className:u(C.bodyCell,C.lastCell,P),style:{width:x(p,v.wellSection)}})]})};O.propTypes={columnsWithDict:a.arrayOf(a.shape({})).isRequired,data:a.shape({id:a.number,checked:a.bool,name:a.string,status:a.string}).isRequired,subjectWellId:a.number.isRequired,metricsKeys:a.arrayOf(a.string).isRequired,metricsColumns:a.arrayOf(a.shape({})).isRequired,handleChanageOffsetWell:a.func.isRequired,isWellNameExpand:a.bool.isRequired,wellNameStyle:a.string.isRequired,wellNameWidth:a.number.isRequired,isViewOnly:a.bool.isRequired,isImperial:a.bool.isRequired,isLimitedOffsetwells:a.bool.isRequired,flyTo:a.number.isRequired,tableTop:a.number.isRequired};var j=r(O);export{j as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as l,useRef as r,useState as i,useCallback as n,useEffect as s,useMemo as a}from"react";import o from"prop-types";import{startCase as c,get as u}from"lodash";import d from"classnames";import m from"moment";import{TableRow as f,TableCell as h,Checkbox as y,Tooltip as p,Typography as b}from"@material-ui/core";import{convertValue as N}from"../../../../utils/index.js";import{ColumnType as v,EXPANED_WELLNAME_WIDTH as w,StatusOptions as g,ROW_HEIGHT as R}from"../../constants.js";import{SubjectWellMark as C}from"./SubjectWellMark.js";import W from"./OffsetWellsTableRow.module.css.js";import q from"./ViewWellSectionsName.js";import{jsxs as T,jsx as k}from"react/jsx-runtime";function O(e,t,l){var r=t.find((function(e){return e.key===l})),i=u(e,r.key);return"undefined"===i?"loading...":Number.isFinite(i)||i?r.unitType?N(i,r.unitType,r.from,r.to):i:"—"}function j(e,t){var l=u(e,v.distance);return Number.isFinite(l)?t?l:N(l,"length","mi","km"):"—"}function x(e,t){var l=e.find((function(e){return e.key===t}));return(null==l?void 0:l.width)||0}var S=function(l){var o,u,N=l.columnsWithDict,S=l.data,D=l.subjectWellId,M=l.metricsKeys,I=l.metricsColumns,A=l.handleChanageOffsetWell,Y=l.isWellNameExpand,z=l.wellNameStyle,L=l.wellNameWidth,V=l.isViewOnly,E=l.isImperial,F=l.isLimitedOffsetwells,K=l.flyTo,P=l.tableTop,H=l.wellSections,B=D===S.id,G=t({},W.subjectWellRow,B),J=r(),Q=r(),U=i(!1),X=e(U,2),Z=X[0],$=X[1],_=r(),ee=!1,te=S[v.name]||"—",le=te;if(!Y&&2*L<8*te.length){var re=function(e){var t=document.createElement("span");document.body.appendChild(t),t.style.font="Roboto",t.style.fontSize="14px",t.style.letterSpacing="0.01071em",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.innerHTML=e;var l=Math.ceil(t.clientWidth);return document.body.removeChild(t),l}(te);if(re>2*L){var ie=2*L/(re/te.length);le="".concat(te.substring(0,ie/2-2),"\n... ").concat(te.substring(te.length-ie/2+6)),ee=!0}}var ne=n((function(e,t){var l=t-e+16;J.current.style.position="absolute",J.current.style.top="".concat(e,"px"),J.current.style.zIndex=3,J.current.style.transition="transform ".concat(800,"ms ease"),J.current.style.transform="translateY(".concat(l,"px)")}),[]),se=n((function(){J.current.style.position="unset",J.current.style.zIndex=1,J.current.style.transition="none",J.current.style.transform="none"}),[]);s((function(){se(),$(!1),Q.current&&(clearTimeout(Q.current),Q.current=null),_.current=K}),[K]);var ae,oe,ce=n((function(e){if(!Q.current){var t=J.current.offsetTop,l=K;e?Math.abs(l-t)>=7*R&&(l=t-7*R):l=t+7*R,$(!0),ne(t,l),Q.current=setTimeout((function(){return A(S,e)}),800)}}),[S,K,P]),ue=a((function(){return S[v.wellSection]}),[S]);return T(f,{className:W.bodyRow,innerRef:J,children:[T(h,{className:d(W.bodyCell,W.wellNameCell,z,G),style:{width:Y?w:x(N,v.name)},children:[B&&k(C,{className:W.subjectWellMark}),!B&&k(y,{size:"medium",checked:Z&&_.current===K?!S.checked:S.checked,disabled:V||F&&!S.checked,onChange:function(e){return ce(e.target.checked)}}),k(p,{title:ee?te:"",children:k(b,{variant:"body2",className:d(W.wellNameCursor,(o={},t(o,W.cellDataViewOnly,B),t(o,W.wellNamePreWrap,ee),o)),children:ee?le:te})})]}),k(h,{className:d(W.bodyCell,G),style:{width:x(N,v.status)},children:!B&&k(p,{title:c(S[v.status]),children:k("div",{className:W.status,style:{background:null===(u=g.find((function(e){return e.value===S[v.status]})))||void 0===u?void 0:u.color}})})}),k(h,{className:d(W.bodyCell,G),style:{width:x(N,v.rig)},children:k(b,{variant:"body2",className:W.cellData,children:S[v.rig]&&"Null"!==S[v.rig]?S[v.rig]:"—"})}),k(h,{className:d(W.bodyCell,G),style:{width:x(N,v.distance)},children:k(b,{variant:"body2",className:W.cellData,children:j(S,E)})}),k(h,{className:d(W.bodyCell,G),style:{width:x(N,v.lastActive)},children:k(b,{variant:"body2",className:W.cellData,children:S[v.lastActive]&&Number.isFinite(S[v.lastActive])?m.unix(S[v.lastActive]).format("MM/DD/YYYY"):"—"})}),M.map((function(e){return k(h,{className:d(W.bodyCell,G),style:{width:x(N,e)},children:k(b,{variant:"body2",className:W.cellData,children:O(S,I,e)})},e)})),k(h,{className:d(W.bodyCell,W.lastCell,G),style:{width:x(N,v.wellSection)},children:ue&&ue.length>1?k(p,{classes:{tooltip:W.customTooltip},title:k(q,{wellSectionNames:ue}),children:k("div",{className:W.sectionLength,children:ue.length})}):k(p,{title:ue||"",children:k(b,{variant:"body2",className:W.cellData,style:{color:ue&&1===ue.length&&(ae=ue,oe=e(ae,1)[0],H.find((function(e){return e.label===oe})).color)},children:ue})})})]})};S.propTypes={columnsWithDict:o.arrayOf(o.shape({})).isRequired,data:o.shape({id:o.number,checked:o.bool,name:o.string,status:o.string}).isRequired,subjectWellId:o.number.isRequired,metricsKeys:o.arrayOf(o.string).isRequired,metricsColumns:o.arrayOf(o.shape({})).isRequired,handleChanageOffsetWell:o.func.isRequired,isWellNameExpand:o.bool.isRequired,wellNameStyle:o.string.isRequired,wellNameWidth:o.number.isRequired,isViewOnly:o.bool.isRequired,isImperial:o.bool.isRequired,isLimitedOffsetwells:o.bool.isRequired,flyTo:o.number.isRequired,tableTop:o.number.isRequired,wellSections:o.arrayOf(o.shape({})).isRequired};var D=l(S);export{D as default};
@@ -1 +1 @@
1
- import e from'./../../../../ext-esm/style-inject/dist/style-inject.es.js';var l={bodyRow:"OffsetWellsTableRow-module_bodyRow__UqDEw",subjectWellRow:"OffsetWellsTableRow-module_subjectWellRow__x60wK",subjectWellMark:"OffsetWellsTableRow-module_subjectWellMark__S-nvA",bodyCell:"OffsetWellsTableRow-module_bodyCell__B-yWv",cellData:"OffsetWellsTableRow-module_cellData__SNLYB",cellDataViewOnly:"OffsetWellsTableRow-module_cellDataViewOnly__2Fd-1",hoverCell:"OffsetWellsTableRow-module_hoverCell__4wFuk",wellNameCell:"OffsetWellsTableRow-module_wellNameCell__BBEf-",lastCell:"OffsetWellsTableRow-module_lastCell__VEQCi",subjectWellImage:"OffsetWellsTableRow-module_subjectWellImage__IkmRP",status:"OffsetWellsTableRow-module_status__qWj9c",customTooltip:"OffsetWellsTableRow-module_customTooltip__aeWUJ",wellNameCursor:"OffsetWellsTableRow-module_wellNameCursor__BlXVa",wellNamePreWrap:"OffsetWellsTableRow-module_wellNamePreWrap__oXXEB"};e(".OffsetWellsTableRow-module_bodyRow__UqDEw{display:flex!important;flex-direction:row!important;margin-bottom:4px!important}.OffsetWellsTableRow-module_subjectWellRow__x60wK{border-color:var(--palette-primary-main)!important}.OffsetWellsTableRow-module_subjectWellMark__S-nvA{left:-1px;position:absolute;top:-1px;z-index:98}.OffsetWellsTableRow-module_bodyCell__B-yWv{align-items:center!important;background:var(--palette-background-b-8)!important;border-bottom:1px solid var(--palette-primary-text-9);border-top:1px solid var(--palette-primary-text-9);display:flex!important;height:56px!important;padding:0 12px 0 0!important}.OffsetWellsTableRow-module_cellData__SNLYB{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--palette-primary-text-1);display:-webkit-box;font-size:14px;font-weight:400;line-height:20px;overflow:hidden;overflow-wrap:break-word}.OffsetWellsTableRow-module_cellDataViewOnly__2Fd-1{padding-left:12px}.OffsetWellsTableRow-module_hoverCell__4wFuk{background:var(--palette-background-b-7)!important}.OffsetWellsTableRow-module_wellNameCell__BBEf-{border-bottom-left-radius:4px;border-left:1px solid var(--palette-primary-text-9);border-top-left-radius:4px;left:0;position:sticky;z-index:2}.OffsetWellsTableRow-module_lastCell__VEQCi{border-bottom-right-radius:4px;border-right:1px solid var(--palette-primary-text-9);border-top-right-radius:4px}.OffsetWellsTableRow-module_subjectWellImage__IkmRP{height:16px;width:16px}.OffsetWellsTableRow-module_status__qWj9c{border-radius:50%;cursor:default;height:8px;width:8px}.OffsetWellsTableRow-module_customTooltip__aeWUJ{background-color:rgba(65,65,65,.8)}.OffsetWellsTableRow-module_wellNameCursor__BlXVa{color:var(--palette-primary-text-1);cursor:default;word-break:break-all}.OffsetWellsTableRow-module_wellNamePreWrap__oXXEB{white-space:pre}");export{l as default};
1
+ import e from'./../../../../ext-esm/style-inject/dist/style-inject.es.js';var l={bodyRow:"OffsetWellsTableRow-module_bodyRow__UqDEw",subjectWellRow:"OffsetWellsTableRow-module_subjectWellRow__x60wK",subjectWellMark:"OffsetWellsTableRow-module_subjectWellMark__S-nvA",bodyCell:"OffsetWellsTableRow-module_bodyCell__B-yWv",cellData:"OffsetWellsTableRow-module_cellData__SNLYB",cellDataViewOnly:"OffsetWellsTableRow-module_cellDataViewOnly__2Fd-1",hoverCell:"OffsetWellsTableRow-module_hoverCell__4wFuk",wellNameCell:"OffsetWellsTableRow-module_wellNameCell__BBEf-",lastCell:"OffsetWellsTableRow-module_lastCell__VEQCi",subjectWellImage:"OffsetWellsTableRow-module_subjectWellImage__IkmRP",status:"OffsetWellsTableRow-module_status__qWj9c",customTooltip:"OffsetWellsTableRow-module_customTooltip__aeWUJ",wellNameCursor:"OffsetWellsTableRow-module_wellNameCursor__BlXVa",wellNamePreWrap:"OffsetWellsTableRow-module_wellNamePreWrap__oXXEB",sectionLength:"OffsetWellsTableRow-module_sectionLength__vxefy"};e(".OffsetWellsTableRow-module_bodyRow__UqDEw{display:flex!important;flex-direction:row!important;margin-bottom:4px!important}.OffsetWellsTableRow-module_subjectWellRow__x60wK{border-color:var(--palette-primary-main)!important}.OffsetWellsTableRow-module_subjectWellMark__S-nvA{left:-1px;position:absolute;top:-1px;z-index:98}.OffsetWellsTableRow-module_bodyCell__B-yWv{align-items:center!important;background:var(--palette-background-b-8)!important;border-bottom:1px solid var(--palette-primary-text-9);border-top:1px solid var(--palette-primary-text-9);display:flex!important;height:56px!important;padding:0 12px 0 0!important}.OffsetWellsTableRow-module_cellData__SNLYB{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--palette-primary-text-1);display:-webkit-box;font-size:14px;font-weight:400;line-height:20px;overflow:hidden;overflow-wrap:break-word}.OffsetWellsTableRow-module_cellDataViewOnly__2Fd-1{padding-left:12px}.OffsetWellsTableRow-module_hoverCell__4wFuk{background:var(--palette-background-b-7)!important}.OffsetWellsTableRow-module_wellNameCell__BBEf-{border-bottom-left-radius:4px;border-left:1px solid var(--palette-primary-text-9);border-top-left-radius:4px;left:0;position:sticky;z-index:2}.OffsetWellsTableRow-module_lastCell__VEQCi{border-bottom-right-radius:4px;border-right:1px solid var(--palette-primary-text-9);border-top-right-radius:4px}.OffsetWellsTableRow-module_subjectWellImage__IkmRP{height:16px;width:16px}.OffsetWellsTableRow-module_status__qWj9c{border-radius:50%;cursor:default;height:8px;width:8px}.OffsetWellsTableRow-module_customTooltip__aeWUJ{opacity:.9!important}.OffsetWellsTableRow-module_wellNameCursor__BlXVa{color:var(--palette-primary-text-1);cursor:default;word-break:break-all}.OffsetWellsTableRow-module_wellNamePreWrap__oXXEB{white-space:pre}.OffsetWellsTableRow-module_sectionLength__vxefy{background:var(--palette-primary-text-9);border-radius:20px;cursor:default;padding:2px 8px}");export{l as default};
@@ -0,0 +1 @@
1
+ import e from"prop-types";import{isEmpty as i}from"lodash";import{makeStyles as n,Typography as a}from"@material-ui/core";import{jsxs as t,jsx as r}from"react/jsx-runtime";var o=n({mainContainer:{padding:"8px"},title:{fontSize:"12px",lineHeight:"16px",marginBottom:"8px"},sectionNameContainer:{display:"flex",flexDirection:"column",gap:"4px"},sectionName:{display:"flex",gap:"8px",alignItems:"center"}}),l=function(e){var n=e.wellSectionNames,l=o();return i(n)?null:t("div",{className:l.mainContainer,children:[r("div",{className:l.title,children:"Best in Well Sections: "}),r("div",{className:l.sectionNameContainer,children:n.map((function(e){return r("div",{className:l.sectionName,children:r(a,{variant:"body2",children:e})})}))})]})};l.propTypes={wellSectionNames:e.arrayOf(e.string).isRequired};export{l as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{sortBy as t}from"lodash";import"../../utils/index.js";import*as a from"../../utils/metrics/metricsConfig.js";var l="all",i="All",r=450,o=50,s=60,n=a,p={status:"status",rig:"rigName",program:"programName",basin:"basin",county:"county",area:"area",formation:"formation",stringDesign:"stringDesign",radius:"radius",period:"period",sideTracks:"sideTracks",timeRangeFrom:"timeRangeFrom",timeRangeTo:"timeRangeTo"},_=[{value:p.rig,label:"Rig"},{value:p.program,label:"Program"},{value:p.basin,label:"Basin"},{value:p.county,label:"County"},{value:p.area,label:"Area"},{value:p.formation,label:"Target Formation"},{value:p.stringDesign,label:"String Design"}],c={unknown:"unknown",idle:"idle",active:"active",paused:"paused",complete:"complete"},d=[{value:c.unknown,color:"#9E9E9E"},{value:c.idle,color:"#BDBDBD"},{value:c.active,color:"#95F126"},{value:c.paused,color:"#FFF350"},{value:c.complete,color:"#2196F3"}],u={name:"name",status:"status",rig:"rigName",distance:"distance",lastActive:"lastActive",metrics:"metrics",wellSection:"wellSection"},m=[{type:u.name,label:"Well Name",key:u.name,width:[340,310,285,203]},{type:u.status,label:"",key:u.status,width:[66,40,40,40]},{type:u.rig,label:"Rig",key:u.rig,width:[220,164,162,103]},{type:u.distance,label:"Distance",key:u.distance,width:[174,140,103,103]},{type:u.lastActive,label:"Last Active",key:u.lastActive,width:[180,126,108,108]},{type:u.metrics,label:"",key:"",width:[0,200,141,141]},{type:u.wellSection,label:"Well Section",key:u.wellSection,width:[40,40,40,40]}],g=[{value:"all",label:"All"},{value:"last12h",label:"Last 12 hrs"},{value:"last24h",label:"Last 24 hrs"},{value:"last7d",label:"Last 7 days"},{value:"lastMonth",label:"Last Month"},{value:"custom",label:"Сustom"}],v=3,b=t([n.weight_to_weight_average,n.bottom_to_slips_average,n.drilling_connection_average,n.slips_to_bottom_average,n.hole_depth,n.hole_depth_change,n.drilled_feet_rotary,n.drilled_feet_slide,n.rop_gross,n.rop,n.rop_rotary,n.rop_slide,n.drilled_feet_rotary_percentage,n.drilled_feet_slide_percentage,n.on_bottom_percentage,n.on_bottom_time,n.cost_per_ft,n.cost_per_lat_ft,n.feet_per_day,n.tripping_in_speed_cased,n.tripping_in_speed_open,n.tripping_in_speed,n.tripping_out_speed_cased,n.tripping_out_speed_open,n.tripping_out_speed].concat(e("production"!==process.env.REACT_APP_ENVIRONMENT?[n.npt,n.circulating_time,n.spud_to_rig_release_time,n.spud_to_total_depth_time]:[])),"label"),y=b.map((function(e){return e.key}));export{l as ALL_SECTION_KEY,i as ALL_SECTION_LABEL,u as ColumnType,r as EXPANED_WELLNAME_WIDTH,_ as FilterOptions,p as FilterType,v as MAX_METRICS_COUNT,y as METRICS_KEYS,b as METRICS_LIST,g as OBJECTIVE_PERIOD_LIST,o as ROWS_PER_PAGE,s as ROW_HEIGHT,d as StatusOptions,m as TableColumns,c as WellStatus};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{sortBy as t}from"lodash";import"../../utils/index.js";import*as a from"../../utils/metrics/metricsConfig.js";var l="all",i="All",r=450,o=50,s=60,n=a,p={status:"status",rig:"rigName",program:"programName",basin:"basin",county:"county",area:"area",formation:"formation",stringDesign:"stringDesign",radius:"radius",period:"period",sideTracks:"sideTracks",timeRangeFrom:"timeRangeFrom",timeRangeTo:"timeRangeTo"},_=[{value:p.rig,label:"Rig"},{value:p.program,label:"Program"},{value:p.basin,label:"Basin"},{value:p.county,label:"County"},{value:p.area,label:"Area"},{value:p.formation,label:"Target Formation"},{value:p.stringDesign,label:"String Design"}],c={unknown:"unknown",idle:"idle",active:"active",paused:"paused",complete:"complete"},d=[{value:c.unknown,color:"#9E9E9E"},{value:c.idle,color:"#BDBDBD"},{value:c.active,color:"#95F126"},{value:c.paused,color:"#FFF350"},{value:c.complete,color:"#2196F3"}],u={name:"name",status:"status",rig:"rigName",distance:"distance",lastActive:"lastActive",metrics:"metrics",wellSection:"wellSection"},m=[{type:u.name,label:"Well Name",key:u.name,width:[280,197,197,186]},{type:u.status,label:"",key:u.status,width:[40,40,40,30]},{type:u.rig,label:"Rig",key:u.rig,width:[220,140,140,93]},{type:u.distance,label:"Distance",key:u.distance,width:[160,160,122,93]},{type:u.lastActive,label:"Last Active",key:u.lastActive,width:[140,140,108,98]},{type:u.metrics,label:"",key:"",width:[0,212,141,141]},{type:u.wellSection,label:"Well Section",key:u.wellSection,width:[180,131,131,97]}],g=[{value:"all",label:"All"},{value:"last12h",label:"Last 12 hrs"},{value:"last24h",label:"Last 24 hrs"},{value:"last7d",label:"Last 7 days"},{value:"lastMonth",label:"Last Month"},{value:"custom",label:"Сustom"}],v=3,b=t([n.weight_to_weight_average,n.bottom_to_slips_average,n.drilling_connection_average,n.slips_to_bottom_average,n.hole_depth,n.hole_depth_change,n.drilled_feet_rotary,n.drilled_feet_slide,n.rop_gross,n.rop,n.rop_rotary,n.rop_slide,n.drilled_feet_rotary_percentage,n.drilled_feet_slide_percentage,n.on_bottom_percentage,n.on_bottom_time,n.cost_per_ft,n.cost_per_lat_ft,n.feet_per_day,n.tripping_in_speed_cased,n.tripping_in_speed_open,n.tripping_in_speed,n.tripping_out_speed_cased,n.tripping_out_speed_open,n.tripping_out_speed].concat(e("production"!==process.env.REACT_APP_ENVIRONMENT?[n.npt,n.circulating_time,n.spud_to_rig_release_time,n.spud_to_total_depth_time]:[])),"label"),y=b.map((function(e){return e.key})),h=["#6EACFF","#69B919","#E95DAF","#A77DFF","#77FFC1","#018EFE","#FF5D7E","#B9E310","#FFD111","#24BB8E","#C426F3"];export{l as ALL_SECTION_KEY,i as ALL_SECTION_LABEL,u as ColumnType,r as EXPANED_WELLNAME_WIDTH,_ as FilterOptions,p as FilterType,v as MAX_METRICS_COUNT,y as METRICS_KEYS,b as METRICS_LIST,g as OBJECTIVE_PERIOD_LIST,o as ROWS_PER_PAGE,s as ROW_HEIGHT,d as StatusOptions,m as TableColumns,h as WellSectionColors,c as WellStatus};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/slicedToArray";import a from"@babel/runtime/regenerator";import{useState as o,useEffect as c}from"react";import{isEmpty as l,uniq as s,get as u}from"lodash";import{fetchOffsetWellSelections as i,fetchWellhubWells as p}from"../utils/apiCalls.js";import{ALL_SECTION_KEY as f,ALL_SECTION_LABEL as b}from"../constants.js";function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var O=function(m,O){var h=o(null),y=n(h,2),d=y[0],j=y[1],w=o(null),x=n(w,2),P=x[0],g=x[1];return c((function(){var n,o,c=(n=t(a.mark((function t(){var n,o,c,u,p,m;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!O){t.next=7;break}return t.next=4,i(O);case 4:t.t0=t.sent,t.next=8;break;case 7:t.t0=[];case 8:n=t.t0,o=!l(n)&&JSON.parse(n[0].data.filters),c=!l(n)&&n[0].data.result&&JSON.parse(n[0].data.result),o&&c?(u=o.filterTabs.map((function(e){return{value:e.value,label:e.name}})),p=[],m=u.reduce((function(e,t){var n=t.value,a=s(c[n].concat(O));return p=p.concat(a),v(v({},e),{},r({},n,a))}),{}),m=v(v({},m),{},r({},f,s(p))),j([{value:f,label:b}].concat(e(u))),g(m)):(j([{value:f,label:b}]),g(r({},f,[O]))),t.next=19;break;case 14:t.prev=14,t.t1=t.catch(0),console.error("offetwell selection fetch error: ",t.t1),j([]),g([]);case 19:case"end":return t.stop()}}),t,null,[[0,14]])}))),function(){return n.apply(this,arguments)}),h=(o=t(a.mark((function e(){var t,n,o;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(O);case 3:t=e.sent,n=u(t[0],"data.offset_wells")||[],o=r({},f,s(n.map((function(e){return e.id})).concat(O))),j([{value:f,label:b}]),g(o),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("wellhub fetch error: ",e.t0),j([]),g([]);case 15:case"end":return e.stop()}}),e,null,[[0,10]])}))),function(){return o.apply(this,arguments)});O?m?c():h():(j([]),g([]))}),[m,O]),[d,P]};export{O as useBicWells};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/slicedToArray";import a from"@babel/runtime/regenerator";import{useState as o,useEffect as c}from"react";import{isEmpty as l,uniq as s,get as u}from"lodash";import{fetchOffsetWellSelections as i,fetchWellhubWells as p}from"../utils/apiCalls.js";import{WellSectionColors as f,ALL_SECTION_KEY as b,ALL_SECTION_LABEL as m}from"../constants.js";function v(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var h=function(v,h){var y=o(null),d=n(y,2),j=d[0],w=d[1],x=o(null),P=n(x,2),g=P[0],k=P[1];return c((function(){var n,o,c=(n=t(a.mark((function t(){var n,o,c,u,p,v;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!h){t.next=7;break}return t.next=4,i(h);case 4:t.t0=t.sent,t.next=8;break;case 7:t.t0=[];case 8:n=t.t0,o=!l(n)&&JSON.parse(n[0].data.filters),c=!l(n)&&n[0].data.result&&JSON.parse(n[0].data.result),o&&c?(u=o.filterTabs.map((function(e,r){return{value:e.value,label:e.name,color:f[r]}})),p=[],v=u.reduce((function(e,t){var n=t.value,a=s(c[n].concat(h));return p=p.concat(a),O(O({},e),{},r({},n,a))}),{}),v=O(O({},v),{},r({},b,s(p))),w([{value:b,label:m}].concat(e(u))),k(v)):(w([{value:b,label:m}]),k(r({},b,[h]))),t.next=19;break;case 14:t.prev=14,t.t1=t.catch(0),console.error("offetwell selection fetch error: ",t.t1),w([]),k([]);case 19:case"end":return t.stop()}}),t,null,[[0,14]])}))),function(){return n.apply(this,arguments)}),y=(o=t(a.mark((function e(){var t,n,o;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(h);case 3:t=e.sent,n=u(t[0],"data.offset_wells")||[],o=r({},b,s(n.map((function(e){return e.id})).concat(h))),w([{value:b,label:m}]),k(o),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("wellhub fetch error: ",e.t0),w([]),k([]);case 15:case"end":return e.stop()}}),e,null,[[0,10]])}))),function(){return o.apply(this,arguments)});h?v?c():y():(w([]),k([]))}),[v,h]),[j,g]};export{h as useBicWells};
@@ -1 +1 @@
1
- import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={rangeSliderInput:"Input_rangeSliderInput__uoNkK",rotated:"Input_rotated__GBHlR"};t(".Input_rangeSliderInput__uoNkK{background:var(--palette-background-b-6);border:none;border:1px solid var(--palette-primary-text-6);border-radius:4px;color:var(--palette-primary-text-6);cursor:default;display:block;font-size:14px;font-weight:500;height:24px;line-height:24px;margin:0 0 0 auto;min-width:40px;outline:none;padding:2px 4px;text-align:center}.Input_rangeSliderInput__uoNkK:focus{background-color:var(--palette-background-b-7)}.Input_rangeSliderInput__uoNkK:focus,.Input_rangeSliderInput__uoNkK:hover{border:1px solid var(--palette-primary-main);color:var(--palette-primary-contrast-text)}.Input_rotated__GBHlR{transform:rotate(180deg)}");export{e as default};
1
+ import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={rangeSliderInput:"Input_rangeSliderInput__uoNkK",rotated:"Input_rotated__GBHlR"};t(".Input_rangeSliderInput__uoNkK{background:var(--palette-background-b-6);border:none;border:1px solid var(--palette-primary-text-6);border-radius:4px;color:var(--palette-primary-text-6);cursor:default;display:block;font-size:14px;font-weight:500;height:24px;line-height:24px;margin:0 0 0 auto;max-width:fit-content;min-width:40px;outline:none;padding:2px 4px;text-align:center}.Input_rangeSliderInput__uoNkK:focus{background-color:var(--palette-background-b-7)}.Input_rangeSliderInput__uoNkK:focus,.Input_rangeSliderInput__uoNkK:hover{border:1px solid var(--palette-primary-main);color:var(--palette-primary-contrast-text)}.Input_rotated__GBHlR{transform:rotate(180deg)}");export{e as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var r={rangeSliderHorizontal:"RangeSlider_rangeSliderHorizontal__SAdDE",rangeSliderVertical:"RangeSlider_rangeSliderVertical__k8ac-",rangeSliderRail:"RangeSlider_rangeSliderRail__ufDMI",rangeSliderRailHorizontal:"RangeSlider_rangeSliderRailHorizontal__rLPtT",rotatedVerticalRange:"RangeSlider_rotatedVerticalRange__-oEIw",rangeSliderRailVertical:"RangeSlider_rangeSliderRailVertical__4zKzk",rangeSliderBar:"RangeSlider_rangeSliderBar__Kj3LC",rangeSliderBarHorizontal:"RangeSlider_rangeSliderBarHorizontal__is0F7",rangeSliderBarVertical:"RangeSlider_rangeSliderBarVertical__2DexQ",rangeSliderBarView:"RangeSlider_rangeSliderBarView__6dNQB",rangeSliderBarViewHorizontal:"RangeSlider_rangeSliderBarViewHorizontal__6pRPw",rangeSliderBarViewVertical:"RangeSlider_rangeSliderBarViewVertical__W2QnY",rangeSliderThumb:"RangeSlider_rangeSliderThumb__KMaq0",rangeSliderLabel:"RangeSlider_rangeSliderLabel__3-qO8",rangeSliderInputDivider:"RangeSlider_rangeSliderInputDivider__PcwIK",rangeSliderCompactInputs:"RangeSlider_rangeSliderCompactInputs__ukFLL",disabled:"RangeSlider_disabled__8eBEv"};e('.RangeSlider_rangeSliderHorizontal__SAdDE{align-items:center;display:flex;padding:30px 0 12px;position:relative}.RangeSlider_rangeSliderVertical__k8ac-{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;padding:0 30px}.RangeSlider_rangeSliderRail__ufDMI{background-color:rgba(99,239,255,.24);border-radius:1px;height:3px;position:relative}.RangeSlider_rangeSliderRail__ufDMI:after,.RangeSlider_rangeSliderRail__ufDMI:before{background:#63efff;border-radius:1px;content:"";height:3px;position:absolute;width:2px}.RangeSlider_rangeSliderRail__ufDMI:before{left:0;top:0}.RangeSlider_rangeSliderRail__ufDMI:after{right:0;top:0}.RangeSlider_rangeSliderRailHorizontal__rLPtT{margin:0 6px;width:100%}.RangeSlider_rotatedVerticalRange__-oEIw{transform:rotate(180deg)}.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI{width:3px}.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI:after,.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI:before{height:2px;width:3px}.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI:after{bottom:0!important;top:unset}.RangeSlider_rangeSliderRailVertical__4zKzk{height:100%;margin:6px 0;width:2px}.RangeSlider_rangeSliderBar__Kj3LC{position:absolute;z-index:1}.RangeSlider_rangeSliderBarHorizontal__is0F7{height:12px;margin:1px 0 0;transform:translateY(-50%)}.RangeSlider_rangeSliderBarVertical__2DexQ{height:100%;margin:1px 0 0;width:12px}.RangeSlider_rangeSliderBarView__6dNQB{background:var(--palette-primary-main);border-radius:1px}.RangeSlider_rangeSliderBarViewHorizontal__6pRPw{height:3px;margin:5px 0 0}.RangeSlider_rangeSliderBarViewVertical__W2QnY{height:100%;width:3px}.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarView__6dNQB{box-shadow:0 0 0 2px rgba(3,188,212,.2)}.RangeSlider_rangeSliderThumb__KMaq0{align-items:center;display:flex;height:25px;justify-content:center;position:absolute;transform:translate(-50%,-50%);width:25px;z-index:1}.RangeSlider_rangeSliderLabel__3-qO8{background:var(--palette-primary-main);border-radius:9px;height:9px;position:relative;transition:box-shadow .3s;width:9px}.RangeSlider_rangeSliderThumb__KMaq0:hover>.RangeSlider_rangeSliderLabel__3-qO8{box-shadow:0 0 0 8px rgba(3,188,212,.2)}.RangeSlider_rangeSliderInputDivider__PcwIK{background:var(--palette-background-b-9);color:#fff;font-size:10px;font-weight:500}.RangeSlider_rangeSliderCompactInputs__ukFLL{align-items:center;background:var(--palette-background-b-9);border-radius:4px;display:flex;justify-content:center;position:absolute;transform:translate(-50%,-50%)}.RangeSlider_disabled__8eBEv{opacity:.4}');export{r as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var r={rangeSliderHorizontal:"RangeSlider_rangeSliderHorizontal__SAdDE",rangeSliderVertical:"RangeSlider_rangeSliderVertical__k8ac-",rangeSliderRail:"RangeSlider_rangeSliderRail__ufDMI",rangeSliderRailHorizontal:"RangeSlider_rangeSliderRailHorizontal__rLPtT",rotatedVerticalRange:"RangeSlider_rotatedVerticalRange__-oEIw",rangeSliderRailVertical:"RangeSlider_rangeSliderRailVertical__4zKzk",rangeSliderBar:"RangeSlider_rangeSliderBar__Kj3LC",rangeSliderBarHorizontal:"RangeSlider_rangeSliderBarHorizontal__is0F7",rangeSliderBarVertical:"RangeSlider_rangeSliderBarVertical__2DexQ",rangeSliderBarView:"RangeSlider_rangeSliderBarView__6dNQB",rangeSliderBarViewHorizontal:"RangeSlider_rangeSliderBarViewHorizontal__6pRPw",rangeSliderBarViewVertical:"RangeSlider_rangeSliderBarViewVertical__W2QnY",rangeSliderThumb:"RangeSlider_rangeSliderThumb__KMaq0",mobileRangeSliderThumb:"RangeSlider_mobileRangeSliderThumb__TEj2q",rangeSliderLabel:"RangeSlider_rangeSliderLabel__3-qO8",rangeSliderInputDivider:"RangeSlider_rangeSliderInputDivider__PcwIK",rangeSliderCompactInputs:"RangeSlider_rangeSliderCompactInputs__ukFLL",disabled:"RangeSlider_disabled__8eBEv"};e('.RangeSlider_rangeSliderHorizontal__SAdDE{align-items:center;display:flex;padding:30px 0 12px;position:relative}.RangeSlider_rangeSliderVertical__k8ac-{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;padding:0 30px}.RangeSlider_rangeSliderRail__ufDMI{background-color:rgba(99,239,255,.24);border-radius:1px;height:3px;position:relative}.RangeSlider_rangeSliderRail__ufDMI:after,.RangeSlider_rangeSliderRail__ufDMI:before{background:#63efff;border-radius:1px;content:"";height:3px;opacity:.24;position:absolute;width:2px}.RangeSlider_rangeSliderRail__ufDMI:before{left:0;top:0}.RangeSlider_rangeSliderRail__ufDMI:after{right:0;top:0}.RangeSlider_rangeSliderRailHorizontal__rLPtT{margin:0 6px;width:100%}.RangeSlider_rotatedVerticalRange__-oEIw{transform:rotate(180deg)}.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI{width:3px}.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI:after,.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI:before{height:2px;width:3px}.RangeSlider_rangeSliderVertical__k8ac- .RangeSlider_rangeSliderRail__ufDMI:after{bottom:0!important;top:unset}.RangeSlider_rangeSliderRailVertical__4zKzk{height:100%;margin:6px 0;width:2px}.RangeSlider_rangeSliderBar__Kj3LC{position:absolute;z-index:1}.RangeSlider_rangeSliderBarHorizontal__is0F7{height:12px;margin:1px 0 0;transform:translateY(-50%)}.RangeSlider_rangeSliderBarVertical__2DexQ{height:100%;margin:1px 0 0;width:12px}.RangeSlider_rangeSliderBarView__6dNQB{background:var(--palette-primary-main);border-radius:1px}.RangeSlider_rangeSliderBarViewHorizontal__6pRPw{height:3px;margin:5px 0 0;position:relative}.RangeSlider_rangeSliderBarViewVertical__W2QnY{height:100%;width:3px}.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarViewHorizontal__6pRPw:before,.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarViewVertical__W2QnY:before{background:#03bcd4;border-radius:1px;content:"";opacity:.4;position:absolute}.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarViewHorizontal__6pRPw:before{bottom:-2px;height:7px;width:100%}.RangeSlider_rangeSliderBar__Kj3LC:hover>.RangeSlider_rangeSliderBarViewVertical__W2QnY:before{height:100%;left:-2px;width:7px}.RangeSlider_rangeSliderThumb__KMaq0{align-items:center;display:flex;height:25px;justify-content:center;position:absolute;transform:translate(-50%,-50%);width:25px;z-index:1}.RangeSlider_mobileRangeSliderThumb__TEj2q.RangeSlider_rangeSliderThumb__KMaq0:hover>.RangeSlider_rangeSliderLabel__3-qO8{box-shadow:none!important}.RangeSlider_mobileRangeSliderThumb__TEj2q:hover.RangeSlider_rangeSliderThumb__KMaq0:before{background:#d9d9d9;border-radius:20px;content:"";height:39px;left:50%;opacity:.1;position:absolute;top:50%;transform:translate(-50%,-50%);width:39px}.RangeSlider_rangeSliderLabel__3-qO8{background:var(--palette-primary-main);border-radius:9px;height:9px;position:relative;transition:box-shadow .3s;width:9px}.RangeSlider_rangeSliderThumb__KMaq0:hover>.RangeSlider_rangeSliderLabel__3-qO8{box-shadow:0 0 0 8px rgba(3,188,212,.2)}.RangeSlider_rangeSliderInputDivider__PcwIK{background:var(--palette-background-b-9);color:#fff;font-size:10px;font-weight:500}.RangeSlider_rangeSliderCompactInputs__ukFLL{align-items:center;background:var(--palette-background-b-9);border-radius:4px;display:flex;justify-content:center;position:absolute;transform:translate(-50%,-50%)}.RangeSlider_disabled__8eBEv{opacity:.4}');export{r as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as t,useRef as r,useEffect as o}from"react";import i from"classnames";import{round as a,throttle as u}from"lodash";import l from"prop-types";import s from"./RangeSlider.css.js";import{horizontalStrategy as c}from"./strategies/horizontal.js";import{verticalStrategy as m}from"./strategies/vertical.js";import{calculatePercentForValue as f,updateFromValue as d,updateToValue as p,calculateValueFromPercent as g}from"./utils.js";import O from"./inputs/FromInput.js";import R from"./inputs/ToInput.js";import{RangeSliderControl as v,RangeSliderOrientation as b}from"./constants.js";import{jsxs as S,jsx as h}from"react/jsx-runtime";function y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function T(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var B=function(l){var y,B,I,M,j=l.min,C=l.max,N=l.from,w=l.to,A=l.minRange,P=l.disabled,F=l.onChange,V=l.orientation,L=l.precision,x=l.isSingleRange,E=l.isWithoutInput,z=t(null),D=n(z,2),H=D[0],U=D[1],_=t(null),W=n(_,2),q=W[0],X=W[1],Y=t(null),Z=n(Y,2),k=Z[0],G=Z[1],J=t(v.FROM),K=n(J,2),Q=K[0],$=K[1],ee=t(null),ne=n(ee,2),te=ne[0],re=ne[1],oe=t({}),ie=n(oe,2),ae=ie[0],ue=ie[1],le=t({from:!1,bar:!1,to:!1}),se=n(le,2),ce=se[0],me=se[1],fe=r(null),de=r(null),pe=r(null),ge=r(null),Oe=r(null),Re=V===b.HORIZONTAL,ve=V===b.VERTICAL,be=x&&E;o((function(){V===b.HORIZONTAL&&G(c),V===b.VERTICAL&&G(m)}),[V]),o((function(){x&&F({from:0,to:w})}),[x]),o((function(){if(k){var n,t=a(N,L),r=a(w,L),o=a(j,L),i=a(C,L),u=f(t,o,i),l=f(r,o,i);ue((e(n={},v.FROM,k.getThumbStyles(u,Q===v.FROM)),e(n,v.TO,k.getThumbStyles(l,Q===v.TO)),e(n,v.BAR,k.getBarStyles(u,l)),e(n,v.FROM_INPUT,k.getInputStyles(te===v.FROM||te===v.BAR||ce.from)),e(n,v.TO_INPUT,k.getInputStyles(te===v.TO||te===v.BAR||ce.to)),n)),U(t.toString()),X(r.toString())}}),[k,j,C,N,w,te,ce]);var Se=function(e){var n=k.getCoordinates(e,fe.current.getBoundingClientRect()),t=f(n.new,n.min,n.max),r=a(g(t,j,C),L);if(r!==N){var o=d(r,N,w,j,A);F(o)}},he=function(e){var n=ve&&x?k.getRotatedCoordinates(e,fe.current.getBoundingClientRect()):k.getCoordinates(e,fe.current.getBoundingClientRect()),t=f(n.new,n.min,n.max),r=a(g(t,j,C),L);if(r!==w){var o=p(r,N,w,C,A);F(o)}},ye=function(e,n){var t=k.getBarCoordinates(e,n,fe.current.getBoundingClientRect()),r=f(t.new,t.min,t.max),o=a(g(r,j,C),L),i=a(w+(o-N),L);if(o<j){var u=j-o;o=j,i=a(i+u,L)}if(i>C){var l=i-C;i=C,o=a(o-l,L)}o!==N&&i!==w&&o>=j&&i<=C&&F({from:o,to:i})},Te=function(n){n!==v.BAR?me(T(T({},ce),{},e({},n,!0))):me({from:!0,bar:!0,to:!0})},Be=function(n){n!==v.BAR?me(T(T({},ce),{},e({},n,!1))):me({from:!1,bar:!1,to:!1})},Ie=function(e,n){if(!(x&&e===v.BAR||P)){n.stopPropagation(),$(e),re(e);var t=n.clientX,r=n.clientY,o=n.target.getBoundingClientRect(),i=o.x,a=o.y,l=u((function(n){!function(e){return e===v.FROM?Se:e===v.TO?he:ye}(e)(n,{clientX:t,clientY:r,x:i,y:a})}),4);document.addEventListener("mousemove",l),document.addEventListener("mouseup",(function e(){re(null),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",e)}))}},Me=function(e,n){var t=n.target.value;Number.isNaN(t)||function(e){return e===v.FROM?U:X}(e)(t)},je=function(e,n){var t=n.target.value,r=a(t,L);if(e===v.FROM){var o=d(r,N,w,j,A);F(o)}if(e===v.TO){var i=p(r,N,w,C,A);F(i)}};return S("div",{className:i((y={},e(y,s.disabled,P),e(y,s.rangeSliderHorizontal,Re),e(y,s.rangeSliderVertical,ve),e(y,s.rotatedVerticalRange,ve&&x),y)),children:[!x&&h(O,{compStyles:ae[v.FROM_INPUT],isVerticalOrientation:ve,max:C,disabled:P,precision:L,fromInputRef:ge,from:N,fromInputValue:H,onInputChange:Me,validateInputChange:je}),S("div",{className:i(s.rangeSliderRail,(B={},e(B,s.rangeSliderRailHorizontal,Re),e(B,s.rangeSliderRailVertical,ve),B)),ref:fe,children:[!x&&h("div",{ref:de,className:s.rangeSliderThumb,style:ae[v.FROM],onMouseDown:function(e){return Ie(v.FROM,e)},onMouseEnter:function(){Te(v.FROM)},onMouseLeave:function(){Be(v.FROM)},children:h("div",{className:s.rangeSliderLabel})}),h("div",{className:i(s.rangeSliderBar,(I={},e(I,s.rangeSliderBarHorizontal,Re),e(I,s.rangeSliderBarVertical,ve),I)),style:ae[v.BAR],onMouseDown:function(e){return Ie(v.BAR,e)},onMouseEnter:function(){Te(v.BAR)},onMouseLeave:function(){Be(v.BAR)},children:h("div",{className:i(s.rangeSliderBarView,(M={},e(M,s.rangeSliderBarViewHorizontal,Re),e(M,s.rangeSliderBarViewVertical,ve),M))})}),h("div",{ref:pe,className:s.rangeSliderThumb,style:ae[v.TO],onMouseDown:function(e){return Ie(v.TO,e)},onMouseEnter:function(){Te(v.TO)},onMouseLeave:function(){Be(v.TO)},children:h("div",{className:s.rangeSliderLabel})})]}),!be&&h(R,{compStyles:ae[v.TO_INPUT],disabled:P,isVerticalOrientation:ve,rotated:ve&&x,max:C,precision:L,toInputRef:Oe,to:w,toInputValue:q,onInputChange:Me,validateInputChange:je})]})};B.propTypes={min:l.number,max:l.number,from:l.number.isRequired,to:l.number.isRequired,orientation:l.oneOf(["horizontal","vertical"]),precision:l.number,minRange:l.number,onChange:l.func,isSingleRange:l.bool,isWithoutInput:l.bool},B.defaultProps={min:0,max:100,orientation:"horizontal",precision:0,minRange:0,onChange:function(){},isSingleRange:!1,isWithoutInput:!1};export{B as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as t,useRef as r,useEffect as i}from"react";import o from"classnames";import{round as a,throttle as l}from"lodash";import u from"prop-types";import{isMobileDetected as s}from"../../utils/mobileDetect.js";import{horizontalStrategy as m}from"./strategies/horizontal.js";import{verticalStrategy as c}from"./strategies/vertical.js";import{calculatePercentForValue as f,updateFromValue as d,updateToValue as g,calculateValueFromPercent as p}from"./utils.js";import R from"./inputs/FromInput.js";import O from"./inputs/ToInput.js";import{RangeSliderControl as b,RangeSliderOrientation as v}from"./constants.js";import S from"./RangeSlider.css.js";import{jsxs as h,jsx as T}from"react/jsx-runtime";function y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function B(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var I=function(u){var y,I,M,j,C=u.min,N=u.max,w=u.from,A=u.to,P=u.minRange,F=u.disabled,V=u.onChange,L=u.orientation,x=u.precision,E=u.isSingleRange,D=u.isWithoutInput,z=t(null),H=n(z,2),U=H[0],_=H[1],W=t(null),q=n(W,2),X=q[0],Y=q[1],Z=t(null),k=n(Z,2),G=k[0],J=k[1],K=t(b.FROM),Q=n(K,2),$=Q[0],ee=Q[1],ne=t(null),te=n(ne,2),re=te[0],ie=te[1],oe=t({}),ae=n(oe,2),le=ae[0],ue=ae[1],se=t({from:!1,bar:!1,to:!1}),me=n(se,2),ce=me[0],fe=me[1],de=r(null),ge=r(null),pe=r(null),Re=r(null),Oe=r(null),be=L===v.HORIZONTAL,ve=L===v.VERTICAL,Se=E&&D;i((function(){L===v.HORIZONTAL&&J(m),L===v.VERTICAL&&J(c)}),[L]),i((function(){E&&V({from:0,to:A})}),[E]),i((function(){if(G){var n,t=a(w,x),r=a(A,x),i=a(C,x),o=a(N,x),l=f(t,i,o),u=f(r,i,o);ue((e(n={},b.FROM,G.getThumbStyles(l,$===b.FROM)),e(n,b.TO,G.getThumbStyles(u,$===b.TO)),e(n,b.BAR,G.getBarStyles(l,u)),e(n,b.FROM_INPUT,G.getInputStyles(re===b.FROM||re===b.BAR||ce.from)),e(n,b.TO_INPUT,G.getInputStyles(re===b.TO||re===b.BAR||ce.to)),n)),_(t.toString()),Y(r.toString())}}),[G,C,N,w,A,re,ce]);var he=function(e){var n=G.getCoordinates(e,de.current.getBoundingClientRect()),t=f(n.new,n.min,n.max),r=a(p(t,C,N),x);if(r!==w){var i=d(r,w,A,C,P);V(i)}},Te=function(e){var n=ve&&E?G.getRotatedCoordinates(e,de.current.getBoundingClientRect()):G.getCoordinates(e,de.current.getBoundingClientRect()),t=f(n.new,n.min,n.max),r=a(p(t,C,N),x);if(r!==A){var i=g(r,w,A,N,P);V(i)}},ye=function(e,n){var t=G.getBarCoordinates(e,n,de.current.getBoundingClientRect()),r=f(t.new,t.min,t.max),i=a(p(r,C,N),x),o=a(A+(i-w),x);if(i<C){var l=C-i;i=C,o=a(o+l,x)}if(o>N){var u=o-N;o=N,i=a(i-u,x)}i!==w&&o!==A&&i>=C&&o<=N&&V({from:i,to:o})},Be=function(n){n!==b.BAR?fe(B(B({},ce),{},e({},n,!0))):fe({from:!0,bar:!0,to:!0})},Ie=function(n){n!==b.BAR?fe(B(B({},ce),{},e({},n,!1))):fe({from:!1,bar:!1,to:!1})},Me=function(e,n){if(!(E&&e===b.BAR||F)){n.stopPropagation(),ee(e),ie(e);var t=n.clientX,r=n.clientY,i=n.target.getBoundingClientRect(),o=i.x,a=i.y,u=l((function(n){!function(e){return e===b.FROM?he:e===b.TO?Te:ye}(e)(n,{clientX:t,clientY:r,x:o,y:a})}),4);document.addEventListener("mousemove",u),document.addEventListener("mouseup",(function e(){ie(null),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e)}))}},je=function(e,n){var t=n.target.value;Number.isNaN(t)||function(e){return e===b.FROM?_:Y}(e)(t)},Ce=function(e,n){var t=n.target.value,r=a(t,x);if(e===b.FROM){var i=d(r,w,A,C,P);V(i)}if(e===b.TO){var o=g(r,w,A,N,P);V(o)}};return h("div",{className:o((y={},e(y,S.disabled,F),e(y,S.rangeSliderHorizontal,be),e(y,S.rangeSliderVertical,ve),e(y,S.rotatedVerticalRange,ve&&E),y)),children:[!E&&T(R,{compStyles:le[b.FROM_INPUT],isVerticalOrientation:ve,max:N,disabled:F,precision:x,fromInputRef:Re,from:w,fromInputValue:U,onInputChange:je,validateInputChange:Ce}),h("div",{className:o(S.rangeSliderRail,(I={},e(I,S.rangeSliderRailHorizontal,be),e(I,S.rangeSliderRailVertical,ve),I)),ref:de,children:[!E&&T("div",{ref:ge,className:o(S.rangeSliderThumb,s&&S.mobileRangeSliderThumb),style:le[b.FROM],onMouseDown:function(e){return Me(b.FROM,e)},onMouseEnter:function(){Be(b.FROM)},onMouseLeave:function(){Ie(b.FROM)},children:T("div",{className:S.rangeSliderLabel})}),T("div",{className:o(S.rangeSliderBar,(M={},e(M,S.rangeSliderBarHorizontal,be),e(M,S.rangeSliderBarVertical,ve),M)),style:le[b.BAR],onMouseDown:function(e){return Me(b.BAR,e)},onMouseEnter:function(){Be(b.BAR)},onMouseLeave:function(){Ie(b.BAR)},children:T("div",{className:o(S.rangeSliderBarView,(j={},e(j,S.rangeSliderBarViewHorizontal,be),e(j,S.rangeSliderBarViewVertical,ve),j))})}),T("div",{ref:pe,className:o(S.rangeSliderThumb,s&&S.mobileRangeSliderThumb),style:le[b.TO],onMouseDown:function(e){return Me(b.TO,e)},onMouseEnter:function(){Be(b.TO)},onMouseLeave:function(){Ie(b.TO)},children:T("div",{className:S.rangeSliderLabel})})]}),!Se&&T(O,{compStyles:le[b.TO_INPUT],disabled:F,isVerticalOrientation:ve,rotated:ve&&E,max:N,precision:x,toInputRef:Oe,to:A,toInputValue:X,onInputChange:je,validateInputChange:Ce})]})};I.propTypes={min:u.number,max:u.number,from:u.number.isRequired,to:u.number.isRequired,orientation:u.oneOf(["horizontal","vertical"]),precision:u.number,minRange:u.number,onChange:u.func,isSingleRange:u.bool,isWithoutInput:u.bool},I.defaultProps={min:0,max:100,orientation:"horizontal",precision:0,minRange:0,onChange:function(){},isSingleRange:!1,isWithoutInput:!1};export{I as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/toConsumableArray";function l(e,a){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),l.push.apply(l,t)}return l}function t(a){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(l){e(a,l,r[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(r,e))}))}return a}var r="alerts",o="ADD_NEW_ALERTS",u="DELETE_NEW_ALERT",i="CLEAR_NEW_ALERTS",s={company:{value:"company",label:"Company"},personal:{value:"personal",label:"Personal"}},n={advanced:"advanced",simple:"simple"},d="desktop",c="banner",b={email:{label:"Email",userPreferencesKey:"emails_enabled"},mobile:{label:"Mobile App notifications",userPreferencesKey:"push_notifications_enabled"},sms:{label:"SMS/Text Message",userPreferencesKey:"sms_enabled"}},p=[{value:"INFO",label:"Info"},{value:"WARNING",label:"Warning"},{value:"CRITICAL",label:"Critical"}],v={INFO:"rgb(119, 195, 241)",WARNING:"rgb(242, 192, 70)",CRITICAL:"rgb(237, 70, 48)"},m={SUBSCRIPTIONS:[{collection:"alerts"}]},_=[{label:"Annulus Pressure Loss",value:"hydraulics.pressure-loss.data.predicted_annulus_pressure_loss"},{label:"Bit HSI",value:"hydraulics.pressure-loss.data.bit_hsi"},{label:"Bit Jet Impact Force",value:"hydraulics.pressure-loss.data.bit_jet_impact_force"},{label:"ECD at Bit",value:"hydraulics.pressure-loss.data.predicted_ecd_at_bit"},{label:"ECD at Casing",value:"hydraulics.pressure-loss.data.predicted_ecd_at_casing"},{label:"Minimum Recommended Flowrate",value:"hydraulics.overview.data.recommended_minimum_flowrate"},{label:"Predicted Standpipe Pressure",value:"hydraulics.pressure-loss.data.predicted_standpipe_pressure"},{label:"Standpipe Pressure",value:"hydraulics.pressure-loss.data.standpipe_pressure"}],y=[{label:"Bit RPM",value:"pdm.operating-condition.data.total_bit_rpm"},{label:"Bit Torque",value:"pdm.operating-condition.data.total_bit_torque"},{label:"Diff Press",value:"pdm.operating-condition.data.differential_pressure"},{label:"PDM RPM",value:"pdm.operating-condition.data.rpm"},{label:"PDM Torque",value:"pdm.operating-condition.data.torque"}],g=[{label:"Bit Aggressivity",value:"torque-and-drag.downhole-transfer.data.downhole.bit_aggressivity"},{label:"Drag Severity",value:"torque-and-drag.overview.data.drag.severity"},{label:"Predicted Surface Torque",value:"torque-and-drag.predictions.data.predicted_surface_torque"},{label:"Predicted Downhole Torque",value:"torque-and-drag.predictions.data.downhole_torque"}],h=[{label:"BH",value:"wits.data.block_height"},{label:"Bit Depth",value:"wits.data.bit_depth"},{label:"Diff Press",value:"wits.data.diff_press"},{label:"Flow In",value:"wits.data.mud_flow_in"},{label:"Flow Out",value:"wits.data.mud_flow_out"},{label:"Flow Out %",value:"wits.data.mud_flow_out_percent"},{label:"Hole Depth",value:"wits.data.hole_depth"},{label:"Hookload",value:"wits.data.hook_load"},{label:"MV",value:"wits.data.mud_volume"},{label:"ROP",value:"wits.data.rop"},{label:"Rotary Torque",value:"wits.data.rotary_torque"},{label:"RPM",value:"wits.data.rotary_rpm"},{label:"SPM",value:"wits.data.pump_spm_total"},{label:"Standpipe Pressure",value:"wits.data.standpipe_pressure"},{label:"Weight on Bit",value:"wits.data.weight_on_bit"}],f=[{label:"Directional:"}].concat(a([{label:"Distance to plan",value:"directional.accuracy.data.accuracy.distance_to_plan"},{label:"Dogleg Severity",value:"directional.trend.data.last_dls.dls"},{label:"High/Low divergence from plan",value:"directional.accuracy.data.recommendation.high"},{label:"Right/Left divergence from plan",value:"directional.accuracy.data.recommendation.right"}]),[{label:"Hydraulics:"}],a(_),[{label:"PDM:"}],a(y),[{label:"Torque and Drag:"}],a(g),[{label:"WITS:"}],a(h)),w=f.map((function(e){var a=e.label,l=e.value;return{label:"".concat(a).concat(l?" (".concat(l,")"):""),value:l}})),D=a(f),P={s:"s",min:"min",h:"h",d:"d"},O=[{value:"continuous",label:"Continuous"},{value:"once-per-asset",label:"Once Per Asset"},{value:"once",label:"Once"}],A=[{value:"AND",label:"AND"},{value:"OR",label:"OR"}],R=[{value:"=",label:"="},{value:"!=",label:"!="},{value:">",label:">"},{value:">=",label:">="},{value:"<",label:"<"},{value:"<=",label:"<="},{value:"~",label:"~"},{value:"!~",label:"!~"}],E=[{value:"average",label:"Average"},{value:"median",label:"Median"},{value:"count",label:"Count"},{value:"percentage",label:"% Change"},{value:"minimum",label:"Minimum"},{value:"maximum",label:"Maximum"},{value:"value",label:"Any Match"}],N=[{label:"All",value:"all"},{label:"Last 12 hours",value:"last12hours"},{label:"Last 24 hours",value:"last24hours"},{label:"Last 7 days",value:"last7days"},{label:"Last month",value:"lastMonth"},{label:"Custom",value:"custom"}],C=N.reduce((function(a,l){return t(t({},a),{},e({},l.value,l))}),{}),S="ADD_ALERT_BANNERS",M="REMOVE_ALERT_BANNER",T="ADD_ALERT_BANNER_SOUND",L="REMOVE_ALERT_BANNER_SOUND",I=function(e){return e&&["Corva","Corva Default Company Do Not Use","Chevron","Default Company","Sai Company"].includes(e.getIn(["company","name"]))};export{S as ADD_ALERT_BANNERS,T as ADD_ALERT_BANNER_SOUND,o as ADD_NEW_ALERTS,w as ADVANCED_MODE_VALUE_PATHS,m as ALERTS,n as ALERT_DEFINITION_MODES,s as ALERT_DEFINITION_TYPES,p as ALERT_LEVELS,v as ALERT_LEVEL_COLOR,b as ALERT_NOTIFICATION_TYPE_USER_PREFERENCES,c as BANNER_ALERT_NOTIFICATION_TYPE,i as CLEAR_NEW_ALERTS,A as COMBINE_LOGICS,N as DATE_RANGE_FILTERS,C as DATE_RANGE_FILTERS_BY_KEYS,u as DELETE_NEW_ALERT,d as DESKTOP_ALERT_NOTIFICATION_TYPE,r as NAME,R as OPERATORS,O as RECURRENCES,M as REMOVE_ALERT_BANNER,L as REMOVE_ALERT_BANNER_SOUND,E as SAMPLING_FUNCTIONS,D as SIMPLE_MODE_VALUE_PATHS,P as TIME_UNITS,I as isAlertBannerEnabled};
1
+ import e from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/toConsumableArray";function l(e,a){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),l.push.apply(l,t)}return l}function t(a){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(l){e(a,l,r[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(r,e))}))}return a}var r="alerts",o="ADD_NEW_ALERTS",u="DELETE_NEW_ALERT",i="CLEAR_NEW_ALERTS",s={company:{value:"company",label:"Company"},personal:{value:"personal",label:"Personal"}},n={advanced:"advanced",simple:"simple"},d="desktop",c="banner",b={email:{label:"Email",userPreferencesKey:"emails_enabled"},mobile:{label:"Mobile App notifications",userPreferencesKey:"push_notifications_enabled"},sms:{label:"SMS/Text Message",userPreferencesKey:"sms_enabled"}},p=[{value:"INFO",label:"Info"},{value:"WARNING",label:"Warning"},{value:"CRITICAL",label:"Critical"}],v={INFO:"rgb(119, 195, 241)",WARNING:"rgb(242, 192, 70)",CRITICAL:"rgb(237, 70, 48)"},m={SUBSCRIPTIONS:[{collection:"alerts"}]},_=[{label:"Annulus Pressure Loss",value:"hydraulics.pressure-loss.data.predicted_annulus_pressure_loss"},{label:"Bit HSI",value:"hydraulics.pressure-loss.data.bit_hsi"},{label:"Bit Jet Impact Force",value:"hydraulics.pressure-loss.data.bit_jet_impact_force"},{label:"ECD at Bit",value:"hydraulics.pressure-loss.data.predicted_ecd_at_bit"},{label:"ECD at Casing",value:"hydraulics.pressure-loss.data.predicted_ecd_at_casing"},{label:"Minimum Recommended Flowrate",value:"hydraulics.overview.data.recommended_minimum_flowrate"},{label:"Predicted Standpipe Pressure",value:"hydraulics.pressure-loss.data.predicted_standpipe_pressure"},{label:"Standpipe Pressure",value:"hydraulics.pressure-loss.data.standpipe_pressure"}],y=[{label:"Bit RPM",value:"pdm.operating-condition.data.total_bit_rpm"},{label:"Bit Torque",value:"pdm.operating-condition.data.total_bit_torque"},{label:"Diff Press",value:"pdm.operating-condition.data.differential_pressure"},{label:"PDM RPM",value:"pdm.operating-condition.data.rpm"},{label:"PDM Torque",value:"pdm.operating-condition.data.torque"}],h=[{label:"Bit Aggressivity",value:"torque-and-drag.downhole-transfer.data.downhole.bit_aggressivity"},{label:"Drag Severity",value:"torque-and-drag.overview.data.drag.severity"},{label:"Predicted Surface Torque",value:"torque-and-drag.predictions.data.predicted_surface_torque"},{label:"Predicted Downhole Torque",value:"torque-and-drag.predictions.data.downhole_torque"}],g=[{label:"BH",value:"wits.data.block_height"},{label:"Bit Depth",value:"wits.data.bit_depth"},{label:"Diff Press",value:"wits.data.diff_press"},{label:"Flow In",value:"wits.data.mud_flow_in"},{label:"Flow Out",value:"wits.data.mud_flow_out"},{label:"Flow Out %",value:"wits.data.mud_flow_out_percent"},{label:"Hole Depth",value:"wits.data.hole_depth"},{label:"Hookload",value:"wits.data.hook_load"},{label:"MV",value:"wits.data.mud_volume"},{label:"ROP",value:"wits.data.rop"},{label:"Rotary Torque",value:"wits.data.rotary_torque"},{label:"RPM",value:"wits.data.rotary_rpm"},{label:"SPM",value:"wits.data.pump_spm_total"},{label:"Standpipe Pressure",value:"wits.data.standpipe_pressure"},{label:"Weight on Bit",value:"wits.data.weight_on_bit"}],f=[{label:"Directional:"}].concat(a([{label:"Distance to plan",value:"directional.accuracy.data.accuracy.distance_to_plan"},{label:"Dogleg Severity",value:"directional.trend.data.last_dls.dls"},{label:"High/Low divergence from plan",value:"directional.accuracy.data.recommendation.high"},{label:"Right/Left divergence from plan",value:"directional.accuracy.data.recommendation.right"}]),[{label:"Hydraulics:"}],a(_),[{label:"PDM:"}],a(y),[{label:"Torque and Drag:"}],a(h),[{label:"WITS:"}],a(g)),w=f.map((function(e){var a=e.label,l=e.value;return{label:"".concat(a).concat(l?" (".concat(l,")"):""),value:l}})),D=a(f),P={s:"s",min:"min",h:"h",d:"d"},O=[{value:"continuous",label:"Continuous"},{value:"once-per-asset",label:"Once Per Asset"},{value:"once",label:"Once"}],A=[{value:"AND",label:"AND"},{value:"OR",label:"OR"}],R=[{value:"=",label:"="},{value:"!=",label:"!="},{value:">",label:">"},{value:">=",label:">="},{value:"<",label:"<"},{value:"<=",label:"<="},{value:"~",label:"~"},{value:"!~",label:"!~"}],E=[{value:"average",label:"Average"},{value:"median",label:"Median"},{value:"count",label:"Count"},{value:"percentage",label:"% Change"},{value:"minimum",label:"Minimum"},{value:"maximum",label:"Maximum"},{value:"value",label:"Any Match"}],C=[{label:"All",value:"all"},{label:"Last 12 hours",value:"last12hours"},{label:"Last 24 hours",value:"last24hours"},{label:"Last 7 days",value:"last7days"},{label:"Last month",value:"lastMonth"},{label:"Custom",value:"custom"}],N=C.reduce((function(a,l){return t(t({},a),{},e({},l.value,l))}),{}),S="ADD_ALERT_BANNERS",M="REMOVE_ALERT_BANNER",T="ADD_ALERT_BANNER_SOUND",L="REMOVE_ALERT_BANNER_SOUND",I=function(e){return e&&["Corva","Corva Default Company Do Not Use","Chevron","Default Company","Sai Company","Shell","Completion Company"].includes(e.getIn(["company","name"]))};export{S as ADD_ALERT_BANNERS,T as ADD_ALERT_BANNER_SOUND,o as ADD_NEW_ALERTS,w as ADVANCED_MODE_VALUE_PATHS,m as ALERTS,n as ALERT_DEFINITION_MODES,s as ALERT_DEFINITION_TYPES,p as ALERT_LEVELS,v as ALERT_LEVEL_COLOR,b as ALERT_NOTIFICATION_TYPE_USER_PREFERENCES,c as BANNER_ALERT_NOTIFICATION_TYPE,i as CLEAR_NEW_ALERTS,A as COMBINE_LOGICS,C as DATE_RANGE_FILTERS,N as DATE_RANGE_FILTERS_BY_KEYS,u as DELETE_NEW_ALERT,d as DESKTOP_ALERT_NOTIFICATION_TYPE,r as NAME,R as OPERATORS,O as RECURRENCES,M as REMOVE_ALERT_BANNER,L as REMOVE_ALERT_BANNER_SOUND,E as SAMPLING_FUNCTIONS,D as SIMPLE_MODE_VALUE_PATHS,P as TIME_UNITS,I as isAlertBannerEnabled};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.45.0-3",
3
+ "version": "0.45.0-4",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"