@corva/ui 0.41.0-8 → 0.41.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CLI/hocs/withCorvaMagicHOC.js +1 -1
  2. package/cjs/devcenter/webpack/webpack.config.common.js +1 -1
  3. package/cjs/devcenter/webpack/webpack.config.prod.js +1 -1
  4. package/clients/clientStorage/index.js +1 -1
  5. package/clients/jsonApi/index.js +1 -1
  6. package/components/AddComment/Popover.js +1 -1
  7. package/components/Autocomplete/Autocomplete.js +1 -1
  8. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js +1 -1
  9. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js +1 -1
  10. package/components/Drillstring/BHAComponentDetail/index.js +1 -1
  11. package/components/OffsetWellPickerV2/components/Table/index.js +1 -1
  12. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/index.js +1 -1
  13. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  14. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  15. package/components/OffsetWellPickerV4/components/Filter/Filter.js +1 -1
  16. package/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AdvancedSearch.js +1 -1
  17. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  18. package/components/OffsetWellPickerV4/effects/useAssetsData.js +1 -1
  19. package/components/OffsetWellPickerV4/utils/apiCalls.js +1 -1
  20. package/components/StageDesignVActual/ElementsComparison/utils.js +1 -1
  21. package/components/Template/TemplatePopover/index.js +1 -1
  22. package/effects/useSubscriptions.js +1 -1
  23. package/package.json +4 -4
  24. package/styles/customScrollbars.global.css +8 -4
  25. package/styles/customScrollbars.global.css.js +1 -1
  26. package/styles/globalStyles.js +1 -8
  27. package/utils/convert.js +1 -1
  28. package/components/OffsetWellPickerV4/components/Filter/SubjectWellSearch.js +0 -1
  29. package/components/OffsetWellPickerV4/effects/useCompanies.js +0 -1
@@ -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{useState as i,useRef as o,useEffect as n,useCallback as s,useMemo as l}from"react";import p from"prop-types";import{debounce as a,difference as m,uniqBy as c,isEmpty as d}from"lodash";import{Replay as u,Sort as f,FilterList as j,Close as C}from"@material-ui/icons";import v 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"@material-ui/core";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 b,Fragment as A}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 D 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"../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.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 y from"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../GridLockButton/index.js";import"../Login/components/Login.js";import"../Login/components/PasswordField.js";import"../Login/components/Chip.js";import"../Login/components/StepFooter.js";import"../Login/components/StepContent.js";import"../Login/components/StepHeader.js";import"../Login/components/Step.js";import"../Login/components/OrDivider.js";import"../Login/components/HiddenEmailField.js";import"../Login/components/EmailField.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import h 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 S}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{useFetchWells as I}from"./effects/useFetchWells.js";import{useAdvancedWells as P}from"./effects/useAdvancedWells.js";import{useBicWells as W}from"./effects/useBicWells.js";import{useCompanyMetricKey as x}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as T}from"./effects/useFilterOptions.js";import{useFilteredWells as E}from"./effects/useFilteredWells.js";import{useAddedWellsByManual as O}from"./effects/useAddedWellsByManual.js";import{useSortedWells as B}from"./effects/useSortedWells.js";import{useRadiusWells as L}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useCompanies as k}from"./effects/useCompanies.js";import{useTableColumns as w}from"./effects/useTableColumns.js";import{Filter as F}from"./components/Filter/Filter.js";import{WellsMap as H}from"./components/Map/WellsMap.js";import V from"./components/OffsetWellsTable/OffsetWellsTable.js";import M from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as N,ColumnType as R,FilterType as U,ROWS_PER_PAGE as K}from"./constants.js";import{SEARCH_CATEGORIES as G}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";function _(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?_(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var z=a((function(e){e()}),200),J=function(p){var a=p.open,_=p.isWDUser,J=p.defaultSubjectWell,Q=p.currentUser,X=p.offsetSettings,Y=p.addWellsUsabilityInfo,Z=p.isViewOnly,$=p.onClose,ee=p.onSave,te=i(null==X?void 0:X.filterExpanded),re=r(te,2),ie=re[0],oe=re[1],ne=i(null==X?void 0:X.mapHidden),se=r(ne,2),le=se[0],pe=se[1],ae=i(null),me=r(ae,2),ce=me[0],de=me[1],ue=i(null),fe=r(ue,2),je=fe[0],Ce=fe[1],ve=i((null==X?void 0:X.filters)||{}),ge=r(ve,2),be=ge[0],Ae=ge[1],De=i((null==X?void 0:X.wellSection)||N),ye=r(De,2),he=ye[0],Se=ye[1],Ie=o(!0),Pe=i([]),We=r(Pe,2),xe=We[0],Te=We[1],Ee=i(null),Oe=r(Ee,2),Be=Oe[0],Le=Oe[1],ke=i((null==X?void 0:X.manualWellIds)||[]),we=r(ke,2),Fe=we[0],He=we[1],Ve=i(!0),Me=r(Ve,2),Ne=Me[0],Re=Me[1],Ue=i(!1),Ke=r(Ue,2),Ge=Ke[0],_e=Ke[1],qe=i(0),ze=r(qe,2),Je=ze[0],Qe=ze[1],Xe=o();n((function(){Ce((null==X?void 0:X.subjectWellId)||(null==J?void 0:J.asset_id)||null),de(+(null==X?void 0:X.companyId)||+(null==J?void 0:J.companyId)||+(null==Q?void 0:Q.company_id))}),[X]);var Ye=k(false),Ze=I(ce,Y),$e=W(_,je),et=r($e,2),tt=et[0],rt=et[1],it=x(ce,null==X?void 0:X.metricsKeys),ot=r(it,2),nt=ot[0],st=ot[1],lt=P(ce,Ze,tt,rt,je,nt),pt=T(lt);n((function(){if(lt&&tt){var e=lt.find((function(e){return e.id===je}));if(e){var r=tt.filter((function(e){return e.value!==N})).map((function(e){return e.label})),i=q(q({},e),r.length>0&&t({},R.wellSection,r));Le(i)}else Le(null)}}),[tt,lt]);var at=w(nt),mt=E(lt,be),ct=O(lt,mt,Fe);n((function(){if(!Ie.current&&mt){var e=mt.map((function(e){return e.id})),t=xe.map((function(e){return e.id})),r=m(t,e);He(r)}}),[xe,mt,Ie.current]),n((function(){if(ct)if(Ie.current){var e=lt.filter((function(e){return((null==X?void 0:X.selectedWellIds)||[]).includes(e.id)}));Te(e),Ie.current=!1}else Te((function(e){var t=(ct||[]).filter((function(t){return!!e.find((function(e){var r=e.id;return t.id===r}))}));return c(t,"id")}))}),[lt,ct,null==X?void 0:X.selectedWellIds]);var dt=B(Be,ct,xe,Re,Ie.current),ut=r(dt,5),ft=ut[0],jt=ut[1],Ct=ut[2],vt=ut[3],gt=ut[4];L(be[U.radius],lt,Te);var bt=s((function(e,t,r){var i;i=r===G.well.name?t:t.reduce((function(e,t){var r,i=null===(r=lt.find((function(e){return e.id===t})))||void 0===r?void 0:r.rigName,o=lt.filter((function(e){return e.rigName===i})).map((function(e){return e.id}));return e.concat(o)}),[]);var o=lt.filter((function(e){var t=e.id;return i.includes(t)}));Te(e?function(e){return c(e.concat(o),"id")}:function(e){return c(e.filter((function(e){var t=e.id;return!o.find((function(e){return e.id===t}))})))})}),[lt]),At=s((function(e){Re(!0),z((function(){Te([]),Ce(e),He([])}))}),[]),Dt=s((function(e){Re(!0),z((function(){Te([]),de(e),Ce(null),He([])}))}),[]),yt=s((function(e){st(e)}),[]),ht=s((function(t,r){Te(r?function(r){return[].concat(e(r),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),St=s((function(e){if(e){var t=Be?ct.concat(Be):ct,r=c(t,"id");Te(r)}else Te([]),He([])}),[ct,Be]),It=function(e){if(d(rt))Te([]);else{var t=lt.filter((function(t){return rt[e].includes(t.id)}));Te(t)}},Pt=s((function(e){He([]),Se(e),It(e)}),[It]),Wt=l((function(){return xe.find((function(e){return e.id===je}))?xe.length-1:xe.length}),[xe,je]),xt=l((function(){if(!rt)return!1;if((null==J?void 0:J.asset_id)!==je)return!1;var e=xe.map((function(e){return e.id})),t=rt[he]||[];return t.length===e.length&&e.every((function(e){return t.includes(e)}))}),[rt,J,je,xe,he]),Tt=l((function(){return!xt||(!(d(be)||!be[U.sideTracks])||(he!==N||ce!==+J.companyId))}),[xt,be,he,ce]);n((function(){return Je&&(Xe.current=setTimeout((function(){Tt?(It(N),Qe((function(e){return e+1}))):(clearTimeout(Xe.current),Qe(0))}),1e3)),function(){return clearTimeout(Xe.current)}}),[Je,Tt,rt]);var Et=!lt||!tt||!gt,Ot=i(!1),Bt=r(Ot,2),Lt=Bt[0],kt=Bt[1],wt=i(!1),Ft=r(wt,2),Ht=Ft[0],Vt=Ft[1],Mt=i(K),Nt=r(Mt,2),Rt=Nt[0],Ut=Nt[1],Kt=i([]),Gt=r(Kt,2),_t=Gt[0],qt=Gt[1];n((function(){if(gt){var e=gt.slice(0,Rt);qt(e)}}),[gt,Rt,Be]);return g(v,{open:a,onClose:$,title:"Select Offset Wells",contentContainerClassName:M.offsetWellDialog,contentClassName:M.contentContainer,actionsClassName:M.modalActions,actions:b("div",{className:M.actionsWrapper,children:[!Et&&Tt?g(S,{placement:"bottom-start",title:_?"To Synced Offsets in Offset App":"To Synced Offsets in Wellhub",children:g("div",{children:g(h,{onClick:function(){He([]),Ae({}),de(+(null==J?void 0:J.companyId)),Ce(null==J?void 0:J.asset_id),Se(N),Qe(1)},color:"primary",startIcon:g(u,{}),children:"Reset"})})}):g("div",{}),b("div",{className:M.buttonGap,children:[g(h,{onClick:$,color:"primary",children:"Cancel"}),b(h,{variant:"contained",color:"primary",onClick:function(){var e=q(q({},X),{},{companyId:ce,subjectWellId:je,selectedWellIds:xe.map((function(e){return e.id})),manualWellIds:Fe,filters:be,metricsKeys:nt,wellSection:he,isSynced:xt,mapHidden:le,filterExpanded:ie});ee(e,xe),$()},disabled:Z,children:["Select (",Wt,")"]})]})]}),children:Et?g(D,{fullscreen:!1}):b(A,{children:[b("div",{className:M.controlGroup,children:[b(h,{startIcon:g(ie?f:j,{}),classes:{root:M.filterButton},onClick:function(){return oe((function(e){return!e}))},children:["Filters",!d(be)&&b("div",{className:M.clearWrapper,onClick:function(e){e.stopPropagation(),Ae({})},children:[g(C,{className:M.clearIcon}),g("span",{className:M.clearLabel,children:"Clear"})]})]}),g(y,{rightLabel:"Map",color:"primary",checked:!le,onChange:function(e){return pe(!e.target.checked)}})]}),b("div",{className:M.content,onScroll:function(e){e.target&&(e.target.scrollLeft<=5&&Lt&&kt(!1),e.target.scrollLeft>5&&!Lt&&kt(!0),e.target.scrollTop<12&&Ht&&Vt(!1),e.target.scrollTop>=12&&!Ht&&Vt(!0),e.target.scrollHeight!==e.target.offsetHeight&&e.target.scrollTop+e.target.offsetHeight>=e.target.scrollHeight&&Rt<gt.length&&Ut((function(e){return e+K})))},children:[Ht&&g("div",{className:M.topGraddient}),!le&&g(H,{mapHidden:le,companyId:ce,subjectWell:Be,offsetWellIds:xe.map((function(e){return e.id})),wells:lt,radius:be[U.radius],handleChanageOffsetWell:ht}),g(F,{isHidden:!ie,isWDUser:_,canViewCompanies:false,comapnyId:ce,companies:Ye,filterOptions:pt,filters:be,wellSections:tt,selectedWellSection:he,subjectWell:Be,wells:lt,onChangeFilters:Ae,onChangeBicWells:Pt,onSetSubjectWell:At,onChangeCompany:Dt}),g(V,{isTableLoading:Ne,companyId:ce,subjectWellId:je,sortBy:ft,setSortBy:jt,sortDirection:Ct,setSortDirection:vt,columnsWithDict:at,wells:_t,metricsKeys:nt,setMetricsKeys:yt,handleChanageOffsetWell:ht,handleChangeAllOffsetWells:St,handleAddRemoveAssets:bt,isWellNameExpand:Ge,setIsWellNameExpand:_e,isHscrollMoved:Lt})]})]})})};J.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}),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},J.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1};export{J 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{useState as i,useRef as o,useEffect as n,useCallback as s,useMemo as l}from"react";import p from"prop-types";import{difference as a,uniqBy as m,isEmpty as c}from"lodash";import{Replay as d,Sort as u,FilterList as f,Close as j}from"@material-ui/icons";import C 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"@material-ui/core";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 v,jsxs as g,Fragment as b}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"../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.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 D from"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../GridLockButton/index.js";import"../Login/components/Login.js";import"../Login/components/PasswordField.js";import"../Login/components/Chip.js";import"../Login/components/StepFooter.js";import"../Login/components/StepContent.js";import"../Login/components/StepHeader.js";import"../Login/components/Step.js";import"../Login/components/OrDivider.js";import"../Login/components/HiddenEmailField.js";import"../Login/components/EmailField.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 h}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{useFetchWells as S}from"./effects/useFetchWells.js";import{useAdvancedWells as I}from"./effects/useAdvancedWells.js";import{useBicWells as P}from"./effects/useBicWells.js";import{useCompanyMetricKey as W}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as x}from"./effects/useFilterOptions.js";import{useFilteredWells as T}from"./effects/useFilteredWells.js";import{useAddedWellsByManual as E}from"./effects/useAddedWellsByManual.js";import{useSortedWells as O}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 F}from"./components/Map/WellsMap.js";import w from"./components/OffsetWellsTable/OffsetWellsTable.js";import H from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as V,ColumnType as M,FilterType as N,ROWS_PER_PAGE as R}from"./constants.js";import{SEARCH_CATEGORIES as U}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 G(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 q=function(p){var K=p.open,q=p.isWDUser,_=p.defaultSubjectWell,z=p.currentUser,J=p.offsetSettings,Q=p.addWellsUsabilityInfo,X=p.isViewOnly,Y=p.onClose,Z=p.onSave,$=i(null==J?void 0:J.filterExpanded),ee=r($,2),te=ee[0],re=ee[1],ie=i(null==J?void 0:J.mapHidden),oe=r(ie,2),ne=oe[0],se=oe[1],le=+(null==_?void 0:_.companyId)||+(null==z?void 0:z.company_id),pe=null==_?void 0:_.asset_id,ae=i((null==J?void 0:J.filters)||{}),me=r(ae,2),ce=me[0],de=me[1],ue=i((null==J?void 0:J.wellSection)||V),fe=r(ue,2),je=fe[0],Ce=fe[1],ve=o(!0),ge=i([]),be=r(ge,2),Ae=be[0],De=be[1],ye=i(null),he=r(ye,2),Se=he[0],Ie=he[1],Pe=i((null==J?void 0:J.manualWellIds)||[]),We=r(Pe,2),xe=We[0],Te=We[1],Ee=i(!0),Oe=r(Ee,2),Be=Oe[0],Le=Oe[1],ke=i(!1),Fe=r(ke,2),we=Fe[0],He=Fe[1],Ve=i(0),Me=r(Ve,2),Ne=Me[0],Re=Me[1],Ue=o(),Ke=i(!1),Ge=r(Ke,2),qe=Ge[0],_e=Ge[1],ze=S(le,Q),Je=P(q,pe),Qe=r(Je,2),Xe=Qe[0],Ye=Qe[1],Ze=W(le,null==J?void 0:J.metricsKeys),$e=r(Ze,2),et=$e[0],tt=$e[1],rt=I(le,ze,Xe,Ye,pe,et),it=x(rt);n((function(){if(rt&&Xe){var e=rt.find((function(e){return e.id===pe}));if(e){var r=Xe.filter((function(e){return e.value!==V})).map((function(e){return e.label})),i=G(G({},e),r.length>0&&t({},M.wellSection,r));Ie(i)}else Ie(null)}}),[Xe,rt]);var ot=L(et),nt=T(rt,ce),st=E(rt,nt,xe);n((function(){if(!ve.current&&nt){var e=nt.map((function(e){return e.id})),t=Ae.map((function(e){return e.id})),r=a(t,e);Te(r)}}),[Ae,nt,ve.current]),n((function(){if(st)if(ve.current){var e=rt.filter((function(e){return((null==J?void 0:J.selectedWellIds)||[]).includes(e.id)}));De(e),ve.current=!1}else De((function(e){var t=(st||[]).filter((function(t){return!!e.find((function(e){var r=e.id;return t.id===r}))}));return m(t,"id")}))}),[rt,st,null==J?void 0:J.selectedWellIds]);var lt=O(Se,st,Ae,Le,ve.current),pt=r(lt,5),at=pt[0],mt=pt[1],ct=pt[2],dt=pt[3],ut=pt[4];B(ce[N.radius],rt,De);var ft=s((function(e,t,r){var i;i=r===U.well.name?t:t.reduce((function(e,t){var r,i=null===(r=rt.find((function(e){return e.id===t})))||void 0===r?void 0:r.rigName,o=rt.filter((function(e){return e.rigName===i})).map((function(e){return e.id}));return e.concat(o)}),[]);var o=rt.filter((function(e){var t=e.id;return i.includes(t)}));De(e?function(e){return m(e.concat(o),"id")}:function(e){return m(e.filter((function(e){var t=e.id;return!o.find((function(e){return e.id===t}))})))})}),[rt]),jt=s((function(){_e(!0)}),[]),Ct=s((function(e){tt(e)}),[]),vt=s((function(t,r){De(r?function(r){return[].concat(e(r),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),gt=s((function(e){if(e){var t=Se?st.concat(Se):st,r=m(t,"id");De(r)}else De([]),Te([])}),[st,Se]),bt=function(e){if(c(Ye))De([]);else{var t=rt.filter((function(t){return Ye[e].includes(t.id)}));De(t)}},At=s((function(e){Te([]),Ce(e),bt(e)}),[bt]),Dt=l((function(){return Ae.find((function(e){return e.id===pe}))?Ae.length-1:Ae.length}),[Ae,pe]),yt=l((function(){if(!Ye)return!1;if((null==_?void 0:_.asset_id)!==pe)return!1;var e=Ae.map((function(e){return e.id})),t=Ye[je]||[];return t.length===e.length&&e.every((function(e){return t.includes(e)}))}),[Ye,_,pe,Ae,je]),ht=l((function(){return!yt||(!(c(ce)||!ce[N.sideTracks])||(je!==V||le!==+_.companyId))}),[yt,ce,je,le]);n((function(){return Ne&&(Ue.current=setTimeout((function(){ht?(bt(V),Re((function(e){return e+1}))):(clearTimeout(Ue.current),Re(0))}),1e3)),function(){return clearTimeout(Ue.current)}}),[Ne,ht,Ye]);var St=!rt||!Xe||!ut,It=i(!1),Pt=r(It,2),Wt=Pt[0],xt=Pt[1],Tt=i(!1),Et=r(Tt,2),Ot=Et[0],Bt=Et[1],Lt=i(R),kt=r(Lt,2),Ft=kt[0],wt=kt[1],Ht=i([]),Vt=r(Ht,2),Mt=Vt[0],Nt=Vt[1];n((function(){if(ut){var e=ut.slice(0,Ft);Nt(e)}}),[ut,Ft,Se]);return v(C,{open:K,onClose:Y,title:"Select Offset Wells",contentContainerClassName:H.offsetWellDialog,contentClassName:H.contentContainer,actionsClassName:H.modalActions,actions:g("div",{className:H.actionsWrapper,children:[!St&&ht?v(h,{placement:"bottom-start",title:q?"To Synced Offsets in Offset App":"To Synced Offsets in Wellhub",children:v("div",{children:v(y,{onClick:function(){Te([]),de({}),Ce(V),Re(1)},color:"primary",startIcon:v(d,{}),children:"Reset"})})}):v("div",{}),g("div",{className:H.buttonGap,children:[v(y,{onClick:Y,color:"primary",children:"Cancel"}),g(y,{variant:"contained",color:"primary",onClick:function(){var e=G(G({},J),{},{companyId:le,subjectWellId:pe,selectedWellIds:Ae.map((function(e){return e.id})),manualWellIds:xe,filters:ce,metricsKeys:et,wellSection:je,isSynced:yt,mapHidden:ne,filterExpanded:te});Z(e,Ae),Y()},disabled:X,children:["Select (",Dt,")"]})]})]}),children:St?v(A,{fullscreen:!1}):g(b,{children:[g("div",{className:H.controlGroup,children:[g(y,{startIcon:v(te?u:f,{}),classes:{root:H.filterButton},onClick:function(){return re((function(e){return!e}))},children:["Filters",!c(ce)&&g("div",{className:H.clearWrapper,onClick:function(e){e.stopPropagation(),de({})},children:[v(j,{className:H.clearIcon}),v("span",{className:H.clearLabel,children:"Clear"})]})]}),v(D,{rightLabel:"Map",color:"primary",checked:!ne,onChange:function(e){return se(!e.target.checked)}})]}),g("div",{className:H.content,onScroll:function(e){e.target&&(qe&&(e.target.scrollLeft=0,_e(!1)),e.target.scrollLeft<=5&&Wt&&xt(!1),e.target.scrollLeft>5&&!Wt&&xt(!0),e.target.scrollTop<12&&Ot&&Bt(!1),e.target.scrollTop>=12&&!Ot&&Bt(!0),e.target.scrollHeight!==e.target.offsetHeight&&e.target.scrollTop+e.target.offsetHeight>=e.target.scrollHeight&&Ft<ut.length&&wt((function(e){return e+R})))},children:[Ot&&v("div",{className:H.topGraddient}),!ne&&v(F,{mapHidden:ne,companyId:le,subjectWell:Se,offsetWellIds:Ae.map((function(e){return e.id})),wells:rt,radius:ce[N.radius],handleChanageOffsetWell:vt}),v(k,{isHidden:!te,isWDUser:q,filterOptions:it,filters:ce,wellSections:Xe,selectedWellSection:je,subjectWell:Se,onChangeFilters:de,onChangeBicWells:At}),v(w,{isTableLoading:Be,companyId:le,subjectWellId:pe,sortBy:at,setSortBy:mt,sortDirection:ct,setSortDirection:dt,columnsWithDict:ot,wells:Mt,metricsKeys:et,setMetricsKeys:Ct,handleChanageOffsetWell:vt,handleChangeAllOffsetWells:gt,handleAddRemoveAssets:ft,isWellNameExpand:we,setIsWellNameExpand:He,isHscrollMoved:Wt,onHideAdvancedSearch:jt})]})]})})};q.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}),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},q.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1};export{q as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as r}from"react";import i from"prop-types";import{startCase as o,isEmpty as n,omit as s}from"lodash";import p from"moment";import m from"classnames";import{Divider as a,Grid as l,ListItemText as c,FormControlLabel as d,Switch as u}from"@material-ui/core";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsxs as j,jsx as C,Fragment 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"../../../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"../../../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"../../../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../../../AssetEditor/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../Typography.js";import"../../../CollapsableSidebar.js";import v from"../../../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"../../../GridLockButton/index.js";import"../../../Login/components/Login.js";import"../../../Login/components/PasswordField.js";import"../../../Login/components/Chip.js";import"../../../Login/components/StepFooter.js";import"../../../Login/components/StepContent.js";import"../../../Login/components/StepHeader.js";import"../../../Login/components/Step.js";import"../../../Login/components/OrDivider.js";import"../../../Login/components/HiddenEmailField.js";import"../../../Login/components/EmailField.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{RadiusInput as f}from"./RadiusInput.js";import{SingleSelect as D}from"./SingleSelect.js";import{MultiSelect as A}from"./MultiSelect.js";import{WellSection as b}from"./WellSection.js";import{PeriodSelect as h}from"./PeriodSelect.js";import{SubjectWellSearch as S}from"./SubjectWellSearch.js";import{StatusOptions as I,FilterType as P,OBJECTIVE_PERIOD_LIST as x}from"../../constants.js";import y from"./Filter.module.css.js";function T(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 E(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?T(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):T(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var L=function(i){var T=i.isHidden,L=i.isWDUser,O=i.canViewCompanies,k=i.comapnyId,B=i.companies,F=i.filterOptions,R=i.wellSections,W=i.filters,V=i.selectedWellSection,w=i.subjectWell,H=i.wells,M=i.onChangeFilters,N=i.onChangeBicWells,q=i.onSetSubjectWell,z=i.onChangeCompany,U=r({}),Y=t(U,2),G=Y[0],K=Y[1],J=function(t,r){t===P.sideTracks?M(E(E({},W),{},e({},P.sideTracks,r))):M(r?E(E({},W),{},e({},t,r)):s(E({},W),[t]))},Q=function(t){return function(r){var i=p(r);if(i.isValid()){var o=i.unix(),n=!1;"timeRangeFrom"===t?n=o>=W[P.timeRangeTo]:"timeRangeTo"===t&&(n=o<=W[P.timeRangeFrom]),K(n?e({},t,!0):{}),M(E(E({},W),{},e({},t,o)))}}};return j("div",{className:m(y.filterContainer,e({},y.hidden,T)),children:[C(a,{className:y.divideLine}),j(l,{container:!0,spacing:3,children:[O&&C(l,{item:!0,xs:2,className:y.gridItem,children:C(D,{label:"Company",currentValue:k,options:B,className:y.companySelect,onChange:function(e){return z(e.target.value)}})}),C(l,{item:!0,xs:2,className:y.gridItem,children:C(A,{label:"Status",options:I.map((function(e){return e.value})),currentValues:W[P.status],ValueComponent:function(e){var t,r=e.value;return j("div",{className:y.statusItem,children:[C("div",{className:y.statusIcon,style:{background:null===(t=I.find((function(e){return e.value===r})))||void 0===t?void 0:t.color}}),o(r)]})},ListMenuItem:function(e){var t,r=e.value;return j("div",{className:y.statusItem,children:[C("div",{className:y.statusIcon,style:{background:null===(t=I.find((function(e){return e.value===r})))||void 0===t?void 0:t.color}}),C(c,{primary:o(r)})]})},onChange:function(e){return J(P.status,e)}})}),F.map((function(e){var t=e.value,r=e.label,i=e.options;return C(l,{item:!0,xs:2,className:y.gridItem,children:C(A,{label:r,options:i,currentValues:W[t],ListMenuItem:function(e){var t=e.value;return C(c,{primary:t})},onChange:function(e){return J(t,e)}})},t)})),O&&C(l,{item:!0,xs:2,className:y.gridItem,children:C(S,{wells:H,subjectWell:w,onChange:q})}),C(l,{item:!0,xs:2,className:y.gridItem,children:C(f,{radius:W[P.radius],editable:!!w,onChange:function(e){return J(P.radius,e)}})}),C(l,{item:!0,xs:2,className:y.gridItem,children:C(h,{label:"Last Active",currentValue:W[P.period]||"all",options:x,className:y.companySelect,onChange:function(e){return J(P.period,e)}})}),"custom"===W[P.period]&&j(g,{children:[C(l,{item:!0,xs:2,className:m(y.gridItem),children:C("div",{className:y.filterItem,children:C(v,{variant:"inline",label:"Date From",format:"MM/DD/YY HH:mm",value:1e3*W[P.timeRangeFrom]||null,onChange:Q("timeRangeFrom"),error:G.timeRangeFrom})})}),C(l,{item:!0,xs:2,className:m(y.gridItem),children:C("div",{className:y.filterItem,children:C(v,{variant:"inline",label:"Date To",format:"MM/DD/YY HH:mm",value:1e3*W[P.timeRangeTo]||null,onChange:Q("timeRangeTo"),error:G.timeRangeTo})})})]}),C(l,{item:!0,xs:2,className:y.gridItem,children:C(d,{control:C(u,{size:"small",color:"primary",checked:W[P.sideTracks]||!1,onChange:function(e){return J(P.sideTracks,e.target.checked)}}),label:"Exclude Sidetracks",classes:{label:y.sidetrack}})}),L&&!n(R)&&C(l,{item:!0,xs:3,className:y.gridItem,children:C(b,{selectedValue:V,wellSections:R,onChange:N})})]})]})};L.propTypes={isHidden:i.bool.isRequired,isWDUser:i.bool.isRequired,canViewCompanies:i.bool.isRequired,comapnyId:i.number.isRequired,companies:i.arrayOf(i.shape({})).isRequired,filterOptions:i.arrayOf(i.shape({})).isRequired,wellSections:i.arrayOf(i.shape({})).isRequired,filters:i.shape({}).isRequired,selectedWellSection:i.string.isRequired,subjectWell:i.shape({}).isRequired,wells:i.arrayOf(i.shape({})).isRequired,onChangeFilters:i.func.isRequired,onChangeBicWells:i.func.isRequired,onSetSubjectWell:i.func.isRequired,onChangeCompany:i.func.isRequired};export{L as Filter};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as r}from"react";import i from"prop-types";import{startCase as o,isEmpty as n,omit as s}from"lodash";import p from"moment";import m from"classnames";import{Divider as a,Grid as l,ListItemText as d,FormControlLabel as c,Switch as j}from"@material-ui/core";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsxs as u,jsx as C,Fragment 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"../../../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"../../../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"../../../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../../../AssetEditor/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../Typography.js";import"../../../CollapsableSidebar.js";import v from"../../../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"../../../GridLockButton/index.js";import"../../../Login/components/Login.js";import"../../../Login/components/PasswordField.js";import"../../../Login/components/Chip.js";import"../../../Login/components/StepFooter.js";import"../../../Login/components/StepContent.js";import"../../../Login/components/StepHeader.js";import"../../../Login/components/Step.js";import"../../../Login/components/OrDivider.js";import"../../../Login/components/HiddenEmailField.js";import"../../../Login/components/EmailField.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{RadiusInput as f}from"./RadiusInput.js";import{MultiSelect as D}from"./MultiSelect.js";import{WellSection as A}from"./WellSection.js";import{PeriodSelect as b}from"./PeriodSelect.js";import{StatusOptions as h,FilterType as P,OBJECTIVE_PERIOD_LIST as S}from"../../constants.js";import x from"./Filter.module.css.js";function I(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 y(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?I(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var T=function(i){var I=i.isHidden,T=i.isWDUser,E=i.filterOptions,L=i.wellSections,k=i.filters,B=i.selectedWellSection,O=i.subjectWell,F=i.onChangeFilters,W=i.onChangeBicWells,R=r({}),V=t(R,2),H=V[0],M=V[1],w=function(t,r){t===P.sideTracks?F(y(y({},k),{},e({},P.sideTracks,r))):F(r?y(y({},k),{},e({},t,r)):s(y({},k),[t]))},N=function(t){return function(r){var i=p(r);if(i.isValid()){var o=i.unix(),n=!1;"timeRangeFrom"===t?n=o>=k[P.timeRangeTo]:"timeRangeTo"===t&&(n=o<=k[P.timeRangeFrom]),M(n?e({},t,!0):{}),F(y(y({},k),{},e({},t,o)))}}};return u("div",{className:m(x.filterContainer,e({},x.hidden,I)),children:[C(a,{className:x.divideLine}),u(l,{container:!0,spacing:3,children:[C(l,{item:!0,xs:2,className:x.gridItem,children:C(D,{label:"Status",options:h.map((function(e){return e.value})),currentValues:k[P.status],ValueComponent:function(e){var t,r=e.value;return u("div",{className:x.statusItem,children:[C("div",{className:x.statusIcon,style:{background:null===(t=h.find((function(e){return e.value===r})))||void 0===t?void 0:t.color}}),o(r)]})},ListMenuItem:function(e){var t,r=e.value;return u("div",{className:x.statusItem,children:[C("div",{className:x.statusIcon,style:{background:null===(t=h.find((function(e){return e.value===r})))||void 0===t?void 0:t.color}}),C(d,{primary:o(r)})]})},onChange:function(e){return w(P.status,e)}})}),E.map((function(e){var t=e.value,r=e.label,i=e.options;return C(l,{item:!0,xs:2,className:x.gridItem,children:C(D,{label:r,options:i,currentValues:k[t],ListMenuItem:function(e){var t=e.value;return C(d,{primary:t})},onChange:function(e){return w(t,e)}})},t)})),C(l,{item:!0,xs:2,className:x.gridItem,children:C(f,{radius:k[P.radius],editable:!!O,onChange:function(e){return w(P.radius,e)}})}),C(l,{item:!0,xs:2,className:x.gridItem,children:C(b,{label:"Last Active",currentValue:k[P.period]||"all",options:S,className:x.companySelect,onChange:function(e){return w(P.period,e)}})}),"custom"===k[P.period]&&u(g,{children:[C(l,{item:!0,xs:2,className:m(x.gridItem),children:C("div",{className:x.filterItem,children:C(v,{variant:"inline",label:"Date From",format:"MM/DD/YY HH:mm",value:1e3*k[P.timeRangeFrom]||null,onChange:N("timeRangeFrom"),error:H.timeRangeFrom})})}),C(l,{item:!0,xs:2,className:m(x.gridItem),children:C("div",{className:x.filterItem,children:C(v,{variant:"inline",label:"Date To",format:"MM/DD/YY HH:mm",value:1e3*k[P.timeRangeTo]||null,onChange:N("timeRangeTo"),error:H.timeRangeTo})})})]}),C(l,{item:!0,xs:2,className:x.gridItem,children:C(c,{control:C(j,{size:"small",color:"primary",checked:k[P.sideTracks]||!1,onChange:function(e){return w(P.sideTracks,e.target.checked)}}),label:"Exclude Sidetracks",classes:{label:x.sidetrack}})}),T&&!n(L)&&C(l,{item:!0,xs:3,className:x.gridItem,children:C(A,{selectedValue:B,wellSections:L,onChange:W})})]})]})};T.propTypes={isHidden:i.bool.isRequired,isWDUser:i.bool.isRequired,filterOptions:i.arrayOf(i.shape({})).isRequired,wellSections:i.arrayOf(i.shape({})).isRequired,filters:i.shape({}).isRequired,selectedWellSection:i.string.isRequired,subjectWell:i.shape({}).isRequired,onChangeFilters:i.func.isRequired,onChangeBicWells:i.func.isRequired};export{T as Filter};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as o}from"react";import t from"prop-types";import{TextField as a,InputAdornment as n,Popover as l}from"@material-ui/core";import{Search as i}from"@material-ui/icons";import s from"./AutoCompleteAssetSearch.js";import c from"./AdvancedSearch.module.css.js";import{jsxs as m,Fragment as d,jsx as p}from"react/jsx-runtime";var u=function(t){var u=t.companyId,f=t.onChange,h=t.selectedWellIds,v=r(null),g=e(v,2),C=g[0],I=g[1],y=r(""),A=e(y,2),b=A[0],O=A[1],R=o(),j=function(){O(""),I(null)};return m(d,{children:[p(a,{"data-testid":"ows_advanced_search",id:"well-section-search-textfield",placeholder:"Add Offset ...",InputProps:{startAdornment:p(n,{position:"start",children:p(i,{className:c.searchIcon})}),className:c.searchInput},classes:{root:c.searchRoot},ref:R,value:b,onChange:function(e){O(e.target.value),e.target.value&&I(R.current)},onClick:function(e){I(e.currentTarget)}}),p(l,{open:Boolean(C),anchorEl:C,onClose:j,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:p(s,{value:b,company:u,selectedWellIds:h,onChange:f,onClose:j})})]})};u.propTypes={companyId:t.number.isRequired,onChange:t.func.isRequired,selectedWellIds:t.arrayOf(t.number).isRequired};export{u as AdvancedSearch};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as o}from"react";import t from"prop-types";import{TextField as n,InputAdornment as a,Popover as i}from"@material-ui/core";import{Search as c}from"@material-ui/icons";import l from"./AutoCompleteAssetSearch.js";import s from"./AdvancedSearch.module.css.js";import{jsxs as d,Fragment as m,jsx as u}from"react/jsx-runtime";var p=function(t){var p=t.companyId,f=t.onChange,h=t.selectedWellIds,v=t.onHideAdvancedSearch,g=r(null),A=e(g,2),C=A[0],I=A[1],y=r(""),R=e(y,2),b=R[0],q=R[1],O=o(),S=function(){q(""),I(null),v()};return d(m,{children:[u(n,{"data-testid":"ows_advanced_search",id:"well-section-search-textfield",placeholder:"Add Offset ...",InputProps:{startAdornment:u(a,{position:"start",children:u(c,{className:s.searchIcon})}),className:s.searchInput},classes:{root:s.searchRoot},ref:O,value:b,onChange:function(e){q(e.target.value),e.target.value&&I(O.current)},onClick:function(e){I(e.currentTarget)}}),u(i,{open:Boolean(C),anchorEl:C,onClose:S,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:u(l,{value:b,company:p,selectedWellIds:h,onChange:f,onClose:S})})]})};p.propTypes={companyId:t.number.isRequired,onChange:t.func.isRequired,selectedWellIds:t.arrayOf(t.number).isRequired,onHideAdvancedSearch:t.func.isRequired};export{p as AdvancedSearch};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{memo as t,useRef as r,useMemo as i,useEffect as o,useCallback as n}from"react";import s from"prop-types";import{Table as p,TableHead as m,TableBody as a,TableRow as l,TableCell as d}from"@material-ui/core";import"@babel/runtime/helpers/defineProperty";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as c,jsxs as j,Fragment as u}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 C 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"classnames";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"../../../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.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"../../../GridLockButton/index.js";import"../../../Login/components/Login.js";import"../../../Login/components/PasswordField.js";import"../../../Login/components/Chip.js";import"../../../Login/components/StepFooter.js";import"../../../Login/components/StepContent.js";import"../../../Login/components/StepHeader.js";import"../../../Login/components/Step.js";import"../../../Login/components/OrDivider.js";import"../../../Login/components/HiddenEmailField.js";import"../../../Login/components/EmailField.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{AdvancedSearch as A}from"./AdvancedSearch/AdvancedSearch.js";import f from"./OffsetWellsTableHead.js";import D from"./OffsetWellsTableRow.js";import{METRICS_LIST as g,ROWS_PER_PAGE as h}from"../../constants.js";import v from"./OffsetWellsTable.module.css.js";var b=function(t){var s=t.isTableLoading,b=t.companyId,S=t.subjectWellId,x=t.sortBy,y=t.setSortBy,P=t.sortDirection,I=t.setSortDirection,E=t.columnsWithDict,T=t.wells,W=t.metricsKeys,L=t.setMetricsKeys,B=t.handleChanageOffsetWell,w=t.handleChangeAllOffsetWells,R=t.handleAddRemoveAssets,F=t.isWellNameExpand,k=t.setIsWellNameExpand,O=t.isHscrollMoved,M=r(),V=r(),H=i((function(){var e=T.filter((function(e){return e.checked}));return[e,T.length!==e.length&&e.length,e.length===T.length]}),[T]),N=e(H,3),q=N[0],K=N[1],z=N[2],G=i((function(){return(W||[]).reduce((function(e,t){return e.concat(g.filter((function(e){return e.key===t})))}),[])}),[W]);o((function(){var e=M.current.querySelector(".".concat(v.wellNameFixed));O?e.classList.remove(v.noShadow):e.classList.add(v.noShadow);var t=V.current.querySelectorAll(".".concat(v.wellNameFixed));O?t.forEach((function(e){return e.classList.remove(v.noShadow)})):t.forEach((function(e){return e.classList.add(v.noShadow)}))}),[O,V.current,M.current,T]);var U=n((function(e,t){y(e),I(t)}),[]),J=n((function(e){L(e)}),[]),Q=n((function(e,t){L((function(r){return r.map((function(r){return r===e?t:r}))}))}),[]);return s?c(C,{fullscreen:!1}):E&&T?j(u,{children:[c("div",{className:v.stickyTable,children:j(p,{"aria-label":"ows table head",innerRef:M,children:[c(m,{children:c(f,{columnsWithDict:E,metricsKeys:W,sortBy:x,sortDirection:P,indeterminate:K,isAllWellsSelected:z,onChangeSort:U,onChangeMetricsKeys:J,onUpdateMetricsKey:Q,isWellNameExpand:F,setIsWellNameExpand:k,handleChangeAllOffsetWells:w,wellNameStyle:v.wellNameFixed})}),c(a,{children:c(l,{children:c(d,{className:v.searchCell,children:c(A,{companyId:b,wells:T,onChange:R,selectedWellIds:q.map((function(e){return e.id}))})})})})]})}),c(p,{"aria-label":"ows table body",innerRef:V,children:j(a,{children:[c(l,{children:c(d,{className:v.topShadow})}),T.map((function(e){return c(D,{columnsWithDict:E,subjectWellId:S,data:e,metricsKeys:W,metricsColumns:G,handleChanageOffsetWell:B,isWellNameExpand:F,wellNameStyle:v.wellNameFixed},e.id)})),T.length%h==0&&c(l,{children:c(d,{className:v.loadingCell,children:c("span",{children:"Loading..."})})}),c(l,{children:c(d,{className:v.bottomShadow})})]})})]}):null};b.propTypes={isTableLoading:s.bool.isRequired,companyId:s.number.isRequired,subjectWellId:s.number.isRequired,sortBy:s.string.isRequired,setSortBy:s.func.isRequired,sortDirection:s.string.isRequired,setSortDirection:s.func.isRequired,columnsWithDict:s.arrayOf(s.shape({})).isRequired,wells:s.arrayOf(s.shape({})).isRequired,metricsKeys:s.arrayOf(s.string).isRequired,setMetricsKeys:s.func.isRequired,handleChanageOffsetWell:s.func.isRequired,handleChangeAllOffsetWells:s.func.isRequired,handleAddRemoveAssets:s.func.isRequired,setIsWellNameExpand:s.func.isRequired,isWellNameExpand:s.bool.isRequired,isHscrollMoved:s.bool.isRequired};var S=t(b);export{S as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import{memo as t,useRef as r,useMemo as i,useEffect as o,useCallback as n}from"react";import s from"prop-types";import{Table as p,TableHead as a,TableBody as m,TableRow as l,TableCell as d}from"@material-ui/core";import"@babel/runtime/helpers/defineProperty";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as c,jsxs as j,Fragment as u}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 C 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"classnames";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"../../../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.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"../../../GridLockButton/index.js";import"../../../Login/components/Login.js";import"../../../Login/components/PasswordField.js";import"../../../Login/components/Chip.js";import"../../../Login/components/StepFooter.js";import"../../../Login/components/StepContent.js";import"../../../Login/components/StepHeader.js";import"../../../Login/components/Step.js";import"../../../Login/components/OrDivider.js";import"../../../Login/components/HiddenEmailField.js";import"../../../Login/components/EmailField.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{AdvancedSearch as A}from"./AdvancedSearch/AdvancedSearch.js";import f from"./OffsetWellsTableHead.js";import D from"./OffsetWellsTableRow.js";import{METRICS_LIST as g,ROWS_PER_PAGE as h}from"../../constants.js";import v from"./OffsetWellsTable.module.css.js";var b=function(t){var s=t.isTableLoading,b=t.companyId,S=t.subjectWellId,x=t.sortBy,y=t.setSortBy,P=t.sortDirection,I=t.setSortDirection,E=t.columnsWithDict,T=t.wells,W=t.metricsKeys,L=t.setMetricsKeys,B=t.handleChanageOffsetWell,w=t.handleChangeAllOffsetWells,R=t.handleAddRemoveAssets,F=t.isWellNameExpand,k=t.setIsWellNameExpand,O=t.isHscrollMoved,H=t.onHideAdvancedSearch,M=r(),V=r(),N=i((function(){var e=T.filter((function(e){return e.checked}));return[e,T.length!==e.length&&e.length,e.length===T.length]}),[T]),q=e(N,3),K=q[0],z=q[1],G=q[2],U=i((function(){return(W||[]).reduce((function(e,t){return e.concat(g.filter((function(e){return e.key===t})))}),[])}),[W]);o((function(){var e=M.current.querySelector(".".concat(v.wellNameFixed));O?e.classList.remove(v.noShadow):e.classList.add(v.noShadow);var t=V.current.querySelectorAll(".".concat(v.wellNameFixed));O?t.forEach((function(e){return e.classList.remove(v.noShadow)})):t.forEach((function(e){return e.classList.add(v.noShadow)}))}),[O,V.current,M.current,T]);var J=n((function(e,t){y(e),I(t)}),[]),Q=n((function(e){L(e)}),[]),X=n((function(e,t){L((function(r){return r.map((function(r){return r===e?t:r}))}))}),[]);return s?c(C,{fullscreen:!1}):E&&T?j(u,{children:[c("div",{className:v.stickyTable,children:j(p,{"aria-label":"ows table head",innerRef:M,children:[c(a,{children:c(f,{columnsWithDict:E,metricsKeys:W,sortBy:x,sortDirection:P,indeterminate:z,isAllWellsSelected:G,onChangeSort:J,onChangeMetricsKeys:Q,onUpdateMetricsKey:X,isWellNameExpand:F,setIsWellNameExpand:k,handleChangeAllOffsetWells:w,wellNameStyle:v.wellNameFixed})}),c(m,{children:c(l,{children:c(d,{className:v.searchCell,children:c(A,{companyId:b,wells:T,onChange:R,selectedWellIds:K.map((function(e){return e.id})),onHideAdvancedSearch:H})})})})]})}),c(p,{"aria-label":"ows table body",innerRef:V,children:j(m,{children:[c(l,{children:c(d,{className:v.topShadow})}),T.map((function(e){return c(D,{columnsWithDict:E,subjectWellId:S,data:e,metricsKeys:W,metricsColumns:U,handleChanageOffsetWell:B,isWellNameExpand:F,wellNameStyle:v.wellNameFixed},e.id)})),T.length%h==0&&c(l,{children:c(d,{className:v.loadingCell,children:c("span",{children:"Loading..."})})}),c(l,{children:c(d,{className:v.bottomShadow})})]})})]}):null};b.propTypes={isTableLoading:s.bool.isRequired,companyId:s.number.isRequired,subjectWellId:s.number.isRequired,sortBy:s.string.isRequired,setSortBy:s.func.isRequired,sortDirection:s.string.isRequired,setSortDirection:s.func.isRequired,columnsWithDict:s.arrayOf(s.shape({})).isRequired,wells:s.arrayOf(s.shape({})).isRequired,metricsKeys:s.arrayOf(s.string).isRequired,setMetricsKeys:s.func.isRequired,handleChanageOffsetWell:s.func.isRequired,handleChangeAllOffsetWells:s.func.isRequired,handleAddRemoveAssets:s.func.isRequired,setIsWellNameExpand:s.func.isRequired,isWellNameExpand:s.bool.isRequired,isHscrollMoved:s.bool.isRequired,onHideAdvancedSearch:s.func.isRequired};var S=t(b);export{S as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useEffect as c,useMemo as i}from"react";import{debounce as u,every as a,groupBy as p,flatten as s,toPairs as f}from"lodash";import{fetchAllAssets as l}from"../utils/apiCalls.js";function m(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function b(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 y=u((function(r){r()}),500);function O(u,m,O,h,j){var v=o([]),d=t(v,2),w=d[0],P=d[1],g=o(!1),k=t(g,2),x=k[0],D=k[1],C=o({}),T=t(C,2),A=T[0],E=T[1];return c((function(){function t(){return(t=e(n.mark((function e(){var t,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l(u,m,O,h);case 3:t=e.sent,o=s(f(A).filter((function(r){return+r[0]<+O})).map((function(r){return r[1]}))).concat(t),P(o),E((function(e){return b(b({},e),{},r({searchKey:u,assetType:m},O,t))})),D(!1),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),D(!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}D(!0),y((function(){return t.apply(this,arguments)}))}),[u,m,O,h]),[x,i((function(){var r=w.map((function(r){return b(b({},r),{},{checked:j.includes(r.redirectAssetId)})})).filter((function(r){return(!m||r.type===m)&&function(r,e){var t=(e||"").split(" ");return a(t,(function(e){return r.toLowerCase().includes(e||"")}))}(r.name,(u||"").toLowerCase())}));return Object.entries(p(r,"type"))}),[u,w,m,j])]}export{O as useAssetsData};
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useEffect as c,useMemo as i}from"react";import{debounce as u,groupBy as a,every as p,flatten as s,toPairs as f}from"lodash";import{fetchAllAssets as l}from"../utils/apiCalls.js";function m(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function b(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 y=u((function(r){r()}),500);function O(u,m,O,h,j){var v=o([]),d=t(v,2),w=d[0],P=d[1],g=o(!1),k=t(g,2),x=k[0],D=k[1],C=o({}),T=t(C,2),A=T[0],E=T[1];return c((function(){function t(){return(t=e(n.mark((function e(){var t,o;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l(u,m,O,h);case 3:t=e.sent,o=s(f(A).filter((function(r){return+r[0]<+O})).map((function(r){return r[1]}))).concat(t),P(o),E((function(e){return b(b({},e),{},r({searchKey:u,assetType:m},O,t))})),D(!1),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),D(!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}D(!0),y((function(){return t.apply(this,arguments)}))}),[u,m,O,h]),[x,i((function(){var r=w.map((function(r){return b(b({},r),{},{checked:j.includes(r.redirectAssetId)})})).filter((function(r){return(!m||r.type===m)&&function(r,e){var t=(e||"").split(" ");return p(t,(function(e){return r.toLowerCase().includes(e||"")}))}(r.name,(u||"").toLowerCase())}));return Object.entries(a(r,"type"))}),[u,w,m,j])]}export{O as useAssetsData};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import a from"jsona";import{range as s,sortBy as i,get as u,concat as c}from"lodash";import{getAppStorage as o,getCompanies as p,getAssets as l,getCompanyGoals as f,getWells as b,getRigs as m}from"../../../clients/jsonApi/index.js";import{METRICS_KEYS as v,ROWS_PER_PAGE as d}from"../constants.js";function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?h(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=new a;function _(){return w.apply(this,arguments)}function w(){return(w=r(n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,p();case 3:e=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0);case 9:return t.abrupt("return",e?i(e,["name"]):[]);case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}function x(t,e){return k.apply(this,arguments)}function k(){return(k=r(n.mark((function t(e,r){var a,s,i;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=null,t.prev=1,t.next=4,l({types:["well"],company_id:e?+e:void 0,fields:["asset.name","asset.parent_asset_id","asset.parent_asset_name","asset.status","asset.stats","asset.target_formation","asset.string_design","asset.root_asset_name","asset.basin","asset.county","asset.area","asset.visibility","asset.top_hole","asset.settings","well.settings","asset.last_active_at"],per_page:1e4,sort:"name"});case 4:a=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0);case 10:if(s=a?a.data.map((function(t){return{id:Number(t.id),name:u(t,"attributes.name"),status:u(t,"attributes.status"),rigId:u(t,"attributes.parent_asset_id")||"Null",rigName:u(t,"attributes.parent_asset_name")||"Null",formation:u(t,"attributes.target_formation")||"Null",stringDesign:u(t,"attributes.string_design")||"Null",programName:u(t,"attributes.root_asset_name")||"Null",basin:u(t,"attributes.basin")||"Null",county:u(t,"attributes.county")||"Null",area:u(t,"attributes.area")||"Null",visibility:u(t,"attributes.visibility"),topHole:u(t,"attributes.top_hole"),rigReleaseDate:u(t,"attributes.stats.well_end"),totalDepth:u(t,"attributes.stats.total_depth"),is_usable:!0,apiNumber:u(t,"attributes.settings.api_number","-"),lastActive:new Date(u(t,"attributes.last_active_at")).getTime()/1e3}})).filter((function(t){return"visible"===t.visibility})):[],"function"!=typeof r){t.next=16;break}return t.next=14,r(s);case 14:return i=t.sent,t.abrupt("return",i);case 16:return t.abrupt("return",s);case 17:case"end":return t.stop()}}),t,null,[[1,7]])})))).apply(this,arguments)}function O(t){return N.apply(this,arguments)}function N(){return(N=r(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o("corva","data.offset-wells.bic",e,{limit:1,sort:"{timestamp: -1}"}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t){return P.apply(this,arguments)}function P(){return(P=r(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,t.next=4,o("corva","data.offset_wells",e,{limit:1});case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0);case 10:return t.abrupt("return",r||[]);case 11:case"end":return t.stop()}}),t,null,[[1,7]])})))).apply(this,arguments)}function D(t){return A.apply(this,arguments)}function A(){return(A=r(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,f(e);case 3:r=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0);case 9:return t.abrupt("return",r&&u(r,"company_goals")||{});case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}function $(t,e){return E.apply(this,arguments)}function E(){return E=r(n.mark((function t(a,i){var u,c,p;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==i.length){t.next=2;break}return t.abrupt("return",[]);case 2:return u=Math.floor(i.length/200)+1,t.next=5,Promise.all(s(u).map(function(){var t=r(n.mark((function t(e,r){var s,u,c,p;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s={company_id:a,"data.asset_id":{$in:i.slice(200*r,200*(r+1))},"data.key":{$in:v},"data.type":"asset"},u={_id:0,"data.key":1,"data.value":1,asset_id:"$data.asset_id"},c={aggregate:JSON.stringify([{$match:s},{$project:u}])},p=null,t.prev=4,t.next=7,o("corva","metrics",null,c);case 7:p=t.sent,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(4),console.error(t.t0);case 13:return t.abrupt("return",p||[]);case 14:case"end":return t.stop()}}),t,null,[[4,10]])})));return function(e,r){return t.apply(this,arguments)}}()));case 5:return c=t.sent,p=[],c.forEach((function(t){return p.push.apply(p,e(t))})),t.abrupt("return",p);case 9:case"end":return t.stop()}}),t)}))),E.apply(this,arguments)}function I(t,e,r){return S.apply(this,arguments)}function S(){return(S=r(n.mark((function t(e,r,a){var s,i,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s={company:a,search:e,per_page:d,page:r,fields:["well.name","well.asset_id","well.settings","well.status","well.rigName","well.visibility"],sort:"name"},t.prev=2,t.next=5,b(s);case 5:i=t.sent,t.next=12;break;case 8:t.prev=8,t.t0=t.catch(2),console.error(t.t0),i=[];case 12:return u=g.deserialize(i),t.abrupt("return",u.map((function(t){return{redirectAssetId:t.asset_id,apiNumber:t.settings.api_number,name:t.name,asset_id:t.asset_id,status:t.status,rigName:t.rigName,visibility:t.visibility,type:"well"}})));case 14:case"end":return t.stop()}}),t,null,[[2,8]])})))).apply(this,arguments)}function z(t,e,r){return T.apply(this,arguments)}function T(){return(T=r(n.mark((function t(e,r,a){var s,i,c;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s={company:a,search:e,per_page:d,page:r,fields:["rig.name","rig.active_well","rig.asset_id"],sort:"name"},t.prev=2,t.next=5,m(s);case 5:i=t.sent,t.next=12;break;case 8:t.prev=8,t.t0=t.catch(2),console.error(t.t0),i=[];case 12:return c=g.deserialize(i),t.abrupt("return",c.map((function(t){return y({redirectAssetId:u(t,["active_well","asset_id"])||null},t)})));case 14:case"end":return t.stop()}}),t,null,[[2,8]])})))).apply(this,arguments)}function C(t,e){return G.apply(this,arguments)}function G(){return G=r(n.mark((function t(r,a){var s,i,u,o,p,l=arguments;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=l.length>2&&void 0!==l[2]?l[2]:1,i=l.length>3?l[3]:void 0,"well"!==a){t.next=7;break}return t.next=5,I(r,s,i);case 5:return u=t.sent,t.abrupt("return",u);case 7:if("rig"!==a){t.next=12;break}return t.next=10,z(r,s,i);case 10:return o=t.sent,t.abrupt("return",o);case 12:return t.next=14,Promise.all([I(r,s,i),z(r,s,i)]);case 14:return p=t.sent,t.abrupt("return",c.apply(void 0,e(p)));case 16:case"end":return t.stop()}}),t)}))),G.apply(this,arguments)}export{C as fetchAllAssets,_ as fetchCompanies,D as fetchCompanyGoals,$ as fetchMetricsData,O as fetchOffsetWellSelections,j as fetchWellhubWells,x as fetchWells};
1
+ import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import a from"jsona";import{range as s,get as i,concat as u}from"lodash";import{getAppStorage as o,getAssets as c,getCompanyGoals as p,getWells as l,getRigs as f}from"../../../clients/jsonApi/index.js";import{METRICS_KEYS as b,ROWS_PER_PAGE as m}from"../constants.js";function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?d(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=new a;function h(t,e){return g.apply(this,arguments)}function g(){return(g=r(n.mark((function t(e,r){var a,s,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=null,t.prev=1,t.next=4,c({types:["well"],company_id:e?+e:void 0,fields:["asset.name","asset.parent_asset_id","asset.parent_asset_name","asset.status","asset.stats","asset.target_formation","asset.string_design","asset.root_asset_name","asset.basin","asset.county","asset.area","asset.visibility","asset.top_hole","asset.settings","well.settings","asset.last_active_at"],per_page:1e4,sort:"name"});case 4:a=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0);case 10:if(s=a?a.data.map((function(t){return{id:Number(t.id),name:i(t,"attributes.name"),status:i(t,"attributes.status"),rigId:i(t,"attributes.parent_asset_id")||"Null",rigName:i(t,"attributes.parent_asset_name")||"Null",formation:i(t,"attributes.target_formation")||"Null",stringDesign:i(t,"attributes.string_design")||"Null",programName:i(t,"attributes.root_asset_name")||"Null",basin:i(t,"attributes.basin")||"Null",county:i(t,"attributes.county")||"Null",area:i(t,"attributes.area")||"Null",visibility:i(t,"attributes.visibility"),topHole:i(t,"attributes.top_hole"),rigReleaseDate:i(t,"attributes.stats.well_end"),totalDepth:i(t,"attributes.stats.total_depth"),is_usable:!0,apiNumber:i(t,"attributes.settings.api_number","-"),lastActive:new Date(i(t,"attributes.last_active_at")).getTime()/1e3}})).filter((function(t){return"visible"===t.visibility})):[],"function"!=typeof r){t.next=16;break}return t.next=14,r(s);case 14:return u=t.sent,t.abrupt("return",u);case 16:return t.abrupt("return",s);case 17:case"end":return t.stop()}}),t,null,[[1,7]])})))).apply(this,arguments)}function _(t){return w.apply(this,arguments)}function w(){return(w=r(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o("corva","data.offset-wells.bic",e,{limit:1,sort:"{timestamp: -1}"}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t){return k.apply(this,arguments)}function k(){return(k=r(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,t.next=4,o("corva","data.offset_wells",e,{limit:1});case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0);case 10:return t.abrupt("return",r||[]);case 11:case"end":return t.stop()}}),t,null,[[1,7]])})))).apply(this,arguments)}function O(t){return N.apply(this,arguments)}function N(){return(N=r(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,p(e);case 3:r=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0);case 9:return t.abrupt("return",r&&i(r,"company_goals")||{});case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}function j(t,e){return P.apply(this,arguments)}function P(){return P=r(n.mark((function t(a,i){var u,c,p;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==i.length){t.next=2;break}return t.abrupt("return",[]);case 2:return u=Math.floor(i.length/200)+1,t.next=5,Promise.all(s(u).map(function(){var t=r(n.mark((function t(e,r){var s,u,c,p;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s={company_id:a,"data.asset_id":{$in:i.slice(200*r,200*(r+1))},"data.key":{$in:b},"data.type":"asset"},u={_id:0,"data.key":1,"data.value":1,asset_id:"$data.asset_id"},c={aggregate:JSON.stringify([{$match:s},{$project:u}])},p=null,t.prev=4,t.next=7,o("corva","metrics",null,c);case 7:p=t.sent,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(4),console.error(t.t0);case 13:return t.abrupt("return",p||[]);case 14:case"end":return t.stop()}}),t,null,[[4,10]])})));return function(e,r){return t.apply(this,arguments)}}()));case 5:return c=t.sent,p=[],c.forEach((function(t){return p.push.apply(p,e(t))})),t.abrupt("return",p);case 9:case"end":return t.stop()}}),t)}))),P.apply(this,arguments)}function D(t,e,r){return A.apply(this,arguments)}function A(){return(A=r(n.mark((function t(e,r,a){var s,i,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s={company:a,search:e,per_page:m,page:r,fields:["well.name","well.asset_id","well.settings","well.status","well.rigName","well.visibility"],sort:"name"},t.prev=2,t.next=5,l(s);case 5:i=t.sent,t.next=12;break;case 8:t.prev=8,t.t0=t.catch(2),console.error(t.t0),i=[];case 12:return u=y.deserialize(i),t.abrupt("return",u.map((function(t){return{redirectAssetId:t.asset_id,apiNumber:t.settings.api_number,name:t.name,asset_id:t.asset_id,status:t.status,rigName:t.rigName,visibility:t.visibility,type:"well"}})));case 14:case"end":return t.stop()}}),t,null,[[2,8]])})))).apply(this,arguments)}function $(t,e,r){return E.apply(this,arguments)}function E(){return(E=r(n.mark((function t(e,r,a){var s,u,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s={company:a,search:e,per_page:m,page:r,fields:["rig.name","rig.active_well","rig.asset_id"],sort:"name"},t.prev=2,t.next=5,f(s);case 5:u=t.sent,t.next=12;break;case 8:t.prev=8,t.t0=t.catch(2),console.error(t.t0),u=[];case 12:return o=y.deserialize(u),t.abrupt("return",o.map((function(t){return v({redirectAssetId:i(t,["active_well","asset_id"])||null},t)})));case 14:case"end":return t.stop()}}),t,null,[[2,8]])})))).apply(this,arguments)}function I(t,e){return S.apply(this,arguments)}function S(){return S=r(n.mark((function t(r,a){var s,i,o,c,p,l=arguments;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=l.length>2&&void 0!==l[2]?l[2]:1,i=l.length>3?l[3]:void 0,"well"!==a){t.next=7;break}return t.next=5,D(r,s,i);case 5:return o=t.sent,t.abrupt("return",o);case 7:if("rig"!==a){t.next=12;break}return t.next=10,$(r,s,i);case 10:return c=t.sent,t.abrupt("return",c);case 12:return t.next=14,Promise.all([D(r,s,i),$(r,s,i)]);case 14:return p=t.sent,t.abrupt("return",u.apply(void 0,e(p)));case 16:case"end":return t.stop()}}),t)}))),S.apply(this,arguments)}export{I as fetchAllAssets,O as fetchCompanyGoals,j as fetchMetricsData,_ as fetchOffsetWellSelections,x as fetchWellhubWells,h as fetchWells};
@@ -1 +1 @@
1
- import{CHEMICALS_TYPES as e,FLUIDS_TYPES as a,PROPPANTS_TYPES as n,CHEMICALS_MASS_TYPES as m,CHEMICALS_VOL_TYPES as t}from"../../../constants/completion.js";var r=function(r){var u,o,i=r.designElements,c=r.actualElements,s=r.rowKey,l=r.predictionSummary;switch(s){case"volumeChemicals":u=t.map((function(e){return e.name})),o="volume";break;case"massChemicals":u=m.map((function(e){return e.name})),o="mass";break;case"proppants":u=n.map((function(e){return e.name})),o="mass";break;default:u=a.map((function(e){return e.name})),o="oil"}return u.reduce((function(a,n){var m=i[n]&&i[n].amount,t=c[n]&&c[n].amount,r=0;if("volumeChemicals"===s||"massChemicals"===s){var u=e.find((function(e){return e.name===n}))||{};r=l[u.key]}if(!m&&!t&&!r)return a;var p=Math.max(m||0,t||0);return{elemMax:Math.max(p,a.elemMax),elemAmount:a.elemAmount.concat({key:n,design:m||0,actual:t||0,predictionVal:r,unitType:o})}}),{elemMax:0,elemAmount:[]})};export{r as getElementInfo};
1
+ import{FLUIDS_TYPES as e,PROPPANTS_TYPES as a,CHEMICALS_MASS_TYPES as n,CHEMICALS_VOL_TYPES as m,CHEMICALS_TYPES as t}from"../../../constants/completion.js";var r=function(r){var u,o,i=r.designElements,c=r.actualElements,s=r.rowKey,l=r.predictionSummary;switch(s){case"volumeChemicals":u=m.map((function(e){return e.name})),o="volume";break;case"massChemicals":u=n.map((function(e){return e.name})),o="mass";break;case"proppants":u=a.map((function(e){return e.name})),o="mass";break;default:u=e.map((function(e){return e.name})),o="oil"}return u.reduce((function(e,a){var n=i[a]&&i[a].amount,m=c[a]&&c[a].amount,r=0;if("volumeChemicals"===s||"massChemicals"===s){var u=t.find((function(e){return e.name===a}))||{};r=l[u.key]}if(!n&&!m&&!r)return e;var p=Math.max(n||0,m||0);return{elemMax:Math.max(p,e.elemMax),elemAmount:e.elemAmount.concat({key:a,design:n||0,actual:m||0,predictionVal:r,unitType:o})}}),{elemMax:0,elemAmount:[]})};export{r as getElementInfo};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{useState as n,useEffect as i,useMemo as a,Fragment as r}from"react";import o from"prop-types";import{Popover as l,Typography as c,CircularProgress as s,Tooltip as m,List as p,ListItem as d,TextField as u,IconButton as f}from"@material-ui/core";import{Check as h,LayersClear as g,AddCircle as N,Layers as y,Close as S,Delete as T,Edit as v,FileCopy as b,Share as O}from"@material-ui/icons";import C from"classnames";import{omit as E,get as I}from"lodash";import R from"../TemplateSharingDialog/index.js";import{useTemplatePopoverStyles as P}from"./Styles.js";import{jsxs as q,jsx as D,Fragment as j}from"react/jsx-runtime";var k,L;function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?z(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var U="USER",A="DEFAULT",B="SHARED",W=(t(k={},U,"No templates yet..."),t(k,A,"No templates yet..."),t(k,B,"No shared templates yet..."),k),x=(t(L={},U,"My Template"),t(L,A,"Default Templates"),t(L,B,"Shared With Me"),L);function F(o){var k,L=o.currentUser,z=o.open,F=o.anchorEl,G=o.anchorOrigin,M=o.transformOrigin,H=o.onClose,K=o.templates,J=o.activeTemplateId,Q=o.getDefaultTemplates,V=o.getUserTemplates,X=o.getSharedTemplates,Y=o.onAddNewTemplate,Z=o.onTemplateDelete,$=o.onTemplateCopy,_=o.onTemplateEdit,ee=o.onTemplateShare,te=o.onActiveTemplateChange,ne=o.loading,ie=o.classes,ae=o.hasNameSlot,re=o.renderSlot,oe=P(),le=n(K),ce=e(le,2),se=ce[0],me=ce[1],pe=n(null),de=e(pe,2),ue=de[0],fe=de[1],he=n({}),ge=e(he,2),Ne=ge[0],ye=ge[1];i((function(){me(K)}),[K]);var Se=a((function(){return[{type:U,templatesList:V(se)},{type:A,templatesList:Q(se)},{type:B,templatesList:X(se)}]}),[se]),Te=function(e){return function(){te(e)}},ve=function(e,t){return function(n){n.stopPropagation(),t(e)}},be=function(e){return function(t){t.stopPropagation(),me(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!0,prevName:t.name}):t})))}},Oe=function(e){return function(t){t.stopPropagation(),me(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!1}):t})));var n=se.find((function(t){return t.id===e}));_(E(n,["prevName","isEditing"]))}},Ce=function(e){return function(t){t.stopPropagation(),me(se.map((function(t){return t.id===e?w(w({},t),{},{name:t.prevName,isEditing:!1}):t})))}},Ee=function(e){return function(t){if("Enter"===t.key){me(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!1}):t})));var n=se.find((function(t){return t.id===e}));_(E(n,["prevName","isEditing"]))}}},Ie=function(e){return function(t){t.stopPropagation();var n=se.find((function(t){return t.id===e}));fe(n)}},Re=function(){fe(null)};return q(l,{id:"app-settings-template-popper",classes:{paper:C(oe.paper,ie.paper)},open:z,anchorEl:F,onClose:H,anchorOrigin:G,transformOrigin:M,children:[q("div",{className:oe.paperWrapper,children:[q("div",{className:oe.titleWrapper,children:[D(c,{className:oe.title,children:"Templates"}),ne&&D(s,{size:16})]}),D("div",{className:C(oe.selectedGroup,(k={},t(k,oe.selectedGroupSelected,-100===J),t(k,oe.selectedGroupUnSelected,-100!==J),k)),onClick:Te(-100),children:q("div",{className:oe.noTemplateItem,children:[D(-100===J?h:g,{fontSize:"small",className:oe.selectedIcon}),D("div",{className:oe.selectedLabel,children:"No Template Selected"})]})}),Se.map((function(e){var n=e.type,i=e.templatesList;return q(r,{children:[q("div",{className:oe.templateHeader,children:[D(c,{className:oe.subtitle,children:x[n]}),n===U&&D(m,{title:"Create Template",placement:"right",children:D(N,{fontSize:"small",color:"primary",className:oe.addNewTemplateIcon,onClick:Y})})]}),0===i.length?D(c,{className:oe.noTemplateLabel,children:W[n]}):D(p,{className:oe.templateList,children:i.map((function(e){var i,a;return q(d,{className:C(oe.templateListItem,(i={},t(i,oe.templateListItemSelected,e.id===J),t(i,oe.templateListItemUnSelected,e.id!==J),i)),onClick:Te(e.id),children:[e.id===J?D(h,w({fontSize:"small"},e.isEditing&&{color:"primary"})):D(y,w({fontSize:"small"},e.isEditing&&{color:"primary"})),e.isEditing?D(u,{autoFocus:!0,className:oe.templateListItemInput,value:e.name,onClick:function(e){return e.stopPropagation()},onChange:(a=e.id,function(e){e.stopPropagation(),se.filter((function(e){return e.id!==a})).map((function(e){return e.name})).includes(e.target.value)?ye(w(w({},Ne),{},t({},a,"Duplicated name"))):ye(w(w({},Ne),{},t({},a,null))),me(se.map((function(t){return t.id===a?w(w({},t),{},{name:e.target.value}):t})))}),onKeyDown:Ee(e.id),error:!!Ne[e.id],helperText:Ne[e.id]}):D(c,{className:oe.templateListItemName,children:e.name}),e.isEditing?null:ae&&re(I(e,["settings","data"],[])),e.isEditing?q("div",{className:C(oe.actionWrapper,oe.actionWrapperEditing),children:[D(m,{title:"Save",children:D(f,{className:oe.actionIconButton,onClick:Oe(e.id),children:D(h,{fontSize:"small",color:"primary"})})}),D(m,{title:"Cancel",children:D(f,{className:oe.actionIconButton,onClick:Ce(e.id),children:D(S,{className:oe.actionIcon,fontSize:"small"})})})]}):D("div",{className:oe.actionWrapper,children:n===U?q(j,{children:[D(m,{title:"Delete",children:D(f,{className:oe.actionIconButton,onClick:ve(e.id,Z),children:D(T,{className:oe.actionIcon,fontSize:"small"})})}),D(m,{title:"Rename",children:D(f,{className:oe.actionIconButton,onClick:be(e.id),children:D(v,{className:oe.actionIcon,fontSize:"small"})})}),D(m,{title:"Copy",children:D(f,{className:oe.actionIconButton,onClick:ve(e.id,$),children:D(b,{className:oe.actionIcon,fontSize:"small"})})}),D(m,{title:"Share",children:D(f,{className:oe.actionIconButton,onClick:Ie(e.id),children:D(O,{className:oe.actionIcon,fontSize:"small"})})})]}):D(m,{title:"Copy To My Templates",children:D(f,{className:oe.actionIconButton,onClick:ve(e.id,$),children:D(b,{className:oe.actionIcon,fontSize:"small"})})})})]},"template-list-item-".concat(e.id))}))})]},"template-list-".concat(n))}))]}),D(R,{title:'Share "'.concat(I(ue,"name"),'"'),open:!!ue,onSave:function(e){ue&&ee(ue.id,e),Re()},onCancel:Re,currentUser:L})]})}F.propTypes={open:o.bool.isRequired,anchorEl:o.node,anchorOrigin:o.shape({}),transformOrigin:o.shape({}),onClose:o.func.isRequired,templates:o.arrayOf(o.shape({id:o.number,name:o.string,settings:o.shape({}),shared:o.bool})).isRequired,activeTemplateId:o.number.isRequired,getDefaultTemplates:o.func.isRequired,getUserTemplates:o.func.isRequired,getSharedTemplates:o.func.isRequired,onAddNewTemplate:o.func.isRequired,onTemplateDelete:o.func.isRequired,onTemplateCopy:o.func.isRequired,onTemplateEdit:o.func.isRequired,onTemplateShare:o.func.isRequired,onActiveTemplateChange:o.func.isRequired,loading:o.bool,classes:o.shape({paper:o.string}),hasNameSlot:o.bool,renderSlot:o.func.isRequired,currentUser:o.shape({}).isRequired},F.defaultProps={loading:!1,classes:{},hasNameSlot:!1,anchorEl:null,anchorOrigin:{},transformOrigin:{}};export{F as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{useState as n,useEffect as i,useMemo as a,Fragment as r}from"react";import o from"prop-types";import{Popover as l,Typography as c,CircularProgress as s,Tooltip as m,List as p,ListItem as d,TextField as u,IconButton as f}from"@material-ui/core";import{Check as h,LayersClear as g,AddCircle as N,Layers as y,Close as S,Delete as T,Edit as v,FileCopy as b,Share as O}from"@material-ui/icons";import C from"classnames";import{get as E,omit as I}from"lodash";import R from"../TemplateSharingDialog/index.js";import{useTemplatePopoverStyles as P}from"./Styles.js";import{jsxs as q,jsx as D,Fragment as j}from"react/jsx-runtime";var k,L;function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?z(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var U="USER",A="DEFAULT",B="SHARED",W=(t(k={},U,"No templates yet..."),t(k,A,"No templates yet..."),t(k,B,"No shared templates yet..."),k),x=(t(L={},U,"My Template"),t(L,A,"Default Templates"),t(L,B,"Shared With Me"),L);function F(o){var k,L=o.currentUser,z=o.open,F=o.anchorEl,G=o.anchorOrigin,M=o.transformOrigin,H=o.onClose,K=o.templates,J=o.activeTemplateId,Q=o.getDefaultTemplates,V=o.getUserTemplates,X=o.getSharedTemplates,Y=o.onAddNewTemplate,Z=o.onTemplateDelete,$=o.onTemplateCopy,_=o.onTemplateEdit,ee=o.onTemplateShare,te=o.onActiveTemplateChange,ne=o.loading,ie=o.classes,ae=o.hasNameSlot,re=o.renderSlot,oe=P(),le=n(K),ce=e(le,2),se=ce[0],me=ce[1],pe=n(null),de=e(pe,2),ue=de[0],fe=de[1],he=n({}),ge=e(he,2),Ne=ge[0],ye=ge[1];i((function(){me(K)}),[K]);var Se=a((function(){return[{type:U,templatesList:V(se)},{type:A,templatesList:Q(se)},{type:B,templatesList:X(se)}]}),[se]),Te=function(e){return function(){te(e)}},ve=function(e,t){return function(n){n.stopPropagation(),t(e)}},be=function(e){return function(t){t.stopPropagation(),me(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!0,prevName:t.name}):t})))}},Oe=function(e){return function(t){t.stopPropagation(),me(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!1}):t})));var n=se.find((function(t){return t.id===e}));_(I(n,["prevName","isEditing"]))}},Ce=function(e){return function(t){t.stopPropagation(),me(se.map((function(t){return t.id===e?w(w({},t),{},{name:t.prevName,isEditing:!1}):t})))}},Ee=function(e){return function(t){if("Enter"===t.key){me(se.map((function(t){return t.id===e?w(w({},t),{},{isEditing:!1}):t})));var n=se.find((function(t){return t.id===e}));_(I(n,["prevName","isEditing"]))}}},Ie=function(e){return function(t){t.stopPropagation();var n=se.find((function(t){return t.id===e}));fe(n)}},Re=function(){fe(null)};return q(l,{id:"app-settings-template-popper",classes:{paper:C(oe.paper,ie.paper)},open:z,anchorEl:F,onClose:H,anchorOrigin:G,transformOrigin:M,children:[q("div",{className:oe.paperWrapper,children:[q("div",{className:oe.titleWrapper,children:[D(c,{className:oe.title,children:"Templates"}),ne&&D(s,{size:16})]}),D("div",{className:C(oe.selectedGroup,(k={},t(k,oe.selectedGroupSelected,-100===J),t(k,oe.selectedGroupUnSelected,-100!==J),k)),onClick:Te(-100),children:q("div",{className:oe.noTemplateItem,children:[D(-100===J?h:g,{fontSize:"small",className:oe.selectedIcon}),D("div",{className:oe.selectedLabel,children:"No Template Selected"})]})}),Se.map((function(e){var n=e.type,i=e.templatesList;return q(r,{children:[q("div",{className:oe.templateHeader,children:[D(c,{className:oe.subtitle,children:x[n]}),n===U&&D(m,{title:"Create Template",placement:"right",children:D(N,{fontSize:"small",color:"primary",className:oe.addNewTemplateIcon,onClick:Y})})]}),0===i.length?D(c,{className:oe.noTemplateLabel,children:W[n]}):D(p,{className:oe.templateList,children:i.map((function(e){var i,a;return q(d,{className:C(oe.templateListItem,(i={},t(i,oe.templateListItemSelected,e.id===J),t(i,oe.templateListItemUnSelected,e.id!==J),i)),onClick:Te(e.id),children:[e.id===J?D(h,w({fontSize:"small"},e.isEditing&&{color:"primary"})):D(y,w({fontSize:"small"},e.isEditing&&{color:"primary"})),e.isEditing?D(u,{autoFocus:!0,className:oe.templateListItemInput,value:e.name,onClick:function(e){return e.stopPropagation()},onChange:(a=e.id,function(e){e.stopPropagation(),se.filter((function(e){return e.id!==a})).map((function(e){return e.name})).includes(e.target.value)?ye(w(w({},Ne),{},t({},a,"Duplicated name"))):ye(w(w({},Ne),{},t({},a,null))),me(se.map((function(t){return t.id===a?w(w({},t),{},{name:e.target.value}):t})))}),onKeyDown:Ee(e.id),error:!!Ne[e.id],helperText:Ne[e.id]}):D(c,{className:oe.templateListItemName,children:e.name}),e.isEditing?null:ae&&re(E(e,["settings","data"],[])),e.isEditing?q("div",{className:C(oe.actionWrapper,oe.actionWrapperEditing),children:[D(m,{title:"Save",children:D(f,{className:oe.actionIconButton,onClick:Oe(e.id),children:D(h,{fontSize:"small",color:"primary"})})}),D(m,{title:"Cancel",children:D(f,{className:oe.actionIconButton,onClick:Ce(e.id),children:D(S,{className:oe.actionIcon,fontSize:"small"})})})]}):D("div",{className:oe.actionWrapper,children:n===U?q(j,{children:[D(m,{title:"Delete",children:D(f,{className:oe.actionIconButton,onClick:ve(e.id,Z),children:D(T,{className:oe.actionIcon,fontSize:"small"})})}),D(m,{title:"Rename",children:D(f,{className:oe.actionIconButton,onClick:be(e.id),children:D(v,{className:oe.actionIcon,fontSize:"small"})})}),D(m,{title:"Copy",children:D(f,{className:oe.actionIconButton,onClick:ve(e.id,$),children:D(b,{className:oe.actionIcon,fontSize:"small"})})}),D(m,{title:"Share",children:D(f,{className:oe.actionIconButton,onClick:Ie(e.id),children:D(O,{className:oe.actionIcon,fontSize:"small"})})})]}):D(m,{title:"Copy To My Templates",children:D(f,{className:oe.actionIconButton,onClick:ve(e.id,$),children:D(b,{className:oe.actionIcon,fontSize:"small"})})})})]},"template-list-item-".concat(e.id))}))})]},"template-list-".concat(n))}))]}),D(R,{title:'Share "'.concat(E(ue,"name"),'"'),open:!!ue,onSave:function(e){ue&&ee(ue.id,e),Re()},onCancel:Re,currentUser:L})]})}F.propTypes={open:o.bool.isRequired,anchorEl:o.node,anchorOrigin:o.shape({}),transformOrigin:o.shape({}),onClose:o.func.isRequired,templates:o.arrayOf(o.shape({id:o.number,name:o.string,settings:o.shape({}),shared:o.bool})).isRequired,activeTemplateId:o.number.isRequired,getDefaultTemplates:o.func.isRequired,getUserTemplates:o.func.isRequired,getSharedTemplates:o.func.isRequired,onAddNewTemplate:o.func.isRequired,onTemplateDelete:o.func.isRequired,onTemplateCopy:o.func.isRequired,onTemplateEdit:o.func.isRequired,onTemplateShare:o.func.isRequired,onActiveTemplateChange:o.func.isRequired,loading:o.bool,classes:o.shape({paper:o.string}),hasNameSlot:o.bool,renderSlot:o.func.isRequired,currentUser:o.shape({}).isRequired},F.defaultProps={loading:!1,classes:{},hasNameSlot:!1,anchorEl:null,anchorOrigin:{},transformOrigin:{}};export{F as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/regenerator";import{useState as u,useRef as a,useMemo as i,useEffect as o}from"react";import{parse as c}from"querystring";import s from"uuid/v1";import{castArray as p,differenceBy as f,omit as l,merge as m,concat as b,mapValues as d}from"lodash";import{getAppKeyFromStackTrace as y}from"../clients/utils.js";import{getAppStorage as v,getDataAppStorage as h,getDataAppStorageAggregate as O}from"../clients/jsonApi/index.js";import{getSubscriptionId as w}from"../clients/subscriptions.js";function g(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function j(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}function I(r,t,e){var n=w(r,t);return j(j({},r),{},{hookId:t,subId:n,appInstanceId:n,app_key:e})}function k(r,t){return x.apply(this,arguments)}function x(){return x=t(n.mark((function r(e,u){var a,i,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=u.timeQuery,i=u.appKey,o=e.map(function(){var r=t(n.mark((function r(t){var e,u,o,c,s,p,f,l,m;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=t.provider,u=t.collection,o=t.assetId,c=t.subscribeOnly,s=t.params,!c){r.next=3;break}return r.abrupt("return",null);case 3:return p=s.query,f=a?"{timestamp#lte#".concat(a.timestamp.$lte):"",l=p&&f?"AND":"",m="".concat(p).concat(l).concat(f),r.prev=7,r.next=10,v(e,u,o,j(j(j({},s),m?{query:m}:{}),{},{appKey:i}));case 10:return r.abrupt("return",r.sent);case 13:return r.prev=13,r.t0=r.catch(7),r.abrupt("return",[]);case 16:case"end":return r.stop()}}),r,null,[[7,13]])})));return function(t){return r.apply(this,arguments)}}()),r.abrupt("return",Promise.all(o));case 3:case"end":return r.stop()}}),r)}))),x.apply(this,arguments)}function P(r,t){return E.apply(this,arguments)}function E(){return E=t(n.mark((function r(e,u){var a,i,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=u.timeQuery,i=u.appKey,o=e.map(function(){var r=t(n.mark((function r(t){var e,u,o,c,s,p,f,l,b,y,v,w;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=t.provider,u=t.collection,o=t.assetId,c=t.subscribeOnly,s=t.params,p=void 0===s?{}:s,!c){r.next=3;break}return r.abrupt("return",null);case 3:if(!p.aggregate){r.next=5;break}return r.abrupt("return",O(e,u,j({},d(p.aggregate,JSON.stringify))));case 5:return f=JSON.stringify(m({asset_id:o},p.query,a)),l=p.limit,b=void 0===l?1:l,y=p.sort,v=void 0===y?'{"timestamp": 1}':y,r.prev=7,w=j(j({},p),{},{limit:b,sort:v,query:f,appKey:i}),r.next=11,h(e,u,w);case 11:return r.abrupt("return",r.sent);case 14:return r.prev=14,r.t0=r.catch(7),r.abrupt("return",[]);case 17:case"end":return r.stop()}}),r,null,[[7,14]])})));return function(t){return r.apply(this,arguments)}}()),r.abrupt("return",Promise.all(o));case 3:case"end":return r.stop()}}),r)}))),E.apply(this,arguments)}function D(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},m=n.timestamp,d=n.isOldApiUsed,v=u({}),h=r(v,2),O=h[0],w=h[1],g=a();g.current||(g.current=s());var x=window[Symbol.for("socket")],E=x.subscribe,D=x.unsubscribe,S=x.socket,q=i((function(){return y()}),[]),A=a([]),K=p(t).map((function(r){return I(r,g.current,q)})),N=K.map((function(r){return r.subId})).join(),Q=i((function(){if(m)return{timestamp:{$lte:m}};var r=c(window.location.search).time;return r?{timestamp:{$lte:new Date(r)/1e3}}:null}),[window.location.search,m]);return o((function(){var r=function(r){r.hookId===g.current&&w((function(t){var n=r.data;return r.subId in t&&!r.subscribeOnly&&(n=b(t[r.subId],r.data)),r.params&&r.params.limit&&(n=n.slice(-r.params.limit)),j(j({},t),{},e({},r.subId,n))}))};return S&&S.on("data",r),function(){return S&&S.off("data",r)}}),[]),o((function(){A.current.forEach(D),A.current=[]}),[Q]),o((function(){var r=A.current,t=f(K,r,"subId"),e=f(r,K,"subId");t.forEach((function(r){Q&&!r.alwaysSubscribe||E(r)})),e.forEach(D),A.current=K,(d?k:P)(t,{timeQuery:Q,appKey:q,isOldApiUsed:d}).then((function(r){return w((function(n){var u=l(n,e.map((function(r){return r.subId})));return t.forEach((function(t,e){null!==r[e]&&(u[t.subId]=r[e])})),u}))}))}),[N,Q]),o((function(){return function(){return A.current.forEach(D)}}),[]),i((function(){return K.map((function(r){var t=r.subId;return{loading:!(t in O),data:O[t]}}))}),[O,N])}export{D as default};
1
+ import r from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/regenerator";import{useState as u,useRef as a,useMemo as i,useEffect as o}from"react";import{parse as c}from"querystring";import s from"uuid/v1";import{castArray as p,differenceBy as f,omit as l,concat as m,merge as b,mapValues as d}from"lodash";import{getAppKeyFromStackTrace as y}from"../clients/utils.js";import{getAppStorage as v,getDataAppStorage as h,getDataAppStorageAggregate as O}from"../clients/jsonApi/index.js";import{getSubscriptionId as w}from"../clients/subscriptions.js";function g(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function j(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}function I(r,t,e){var n=w(r,t);return j(j({},r),{},{hookId:t,subId:n,appInstanceId:n,app_key:e})}function k(r,t){return x.apply(this,arguments)}function x(){return x=t(n.mark((function r(e,u){var a,i,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=u.timeQuery,i=u.appKey,o=e.map(function(){var r=t(n.mark((function r(t){var e,u,o,c,s,p,f,l,m;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=t.provider,u=t.collection,o=t.assetId,c=t.subscribeOnly,s=t.params,!c){r.next=3;break}return r.abrupt("return",null);case 3:return p=s.query,f=a?"{timestamp#lte#".concat(a.timestamp.$lte):"",l=p&&f?"AND":"",m="".concat(p).concat(l).concat(f),r.prev=7,r.next=10,v(e,u,o,j(j(j({},s),m?{query:m}:{}),{},{appKey:i}));case 10:return r.abrupt("return",r.sent);case 13:return r.prev=13,r.t0=r.catch(7),r.abrupt("return",[]);case 16:case"end":return r.stop()}}),r,null,[[7,13]])})));return function(t){return r.apply(this,arguments)}}()),r.abrupt("return",Promise.all(o));case 3:case"end":return r.stop()}}),r)}))),x.apply(this,arguments)}function P(r,t){return E.apply(this,arguments)}function E(){return E=t(n.mark((function r(e,u){var a,i,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=u.timeQuery,i=u.appKey,o=e.map(function(){var r=t(n.mark((function r(t){var e,u,o,c,s,p,f,l,m,y,v,w;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=t.provider,u=t.collection,o=t.assetId,c=t.subscribeOnly,s=t.params,p=void 0===s?{}:s,!c){r.next=3;break}return r.abrupt("return",null);case 3:if(!p.aggregate){r.next=5;break}return r.abrupt("return",O(e,u,j({},d(p.aggregate,JSON.stringify))));case 5:return f=JSON.stringify(b({asset_id:o},p.query,a)),l=p.limit,m=void 0===l?1:l,y=p.sort,v=void 0===y?'{"timestamp": 1}':y,r.prev=7,w=j(j({},p),{},{limit:m,sort:v,query:f,appKey:i}),r.next=11,h(e,u,w);case 11:return r.abrupt("return",r.sent);case 14:return r.prev=14,r.t0=r.catch(7),r.abrupt("return",[]);case 17:case"end":return r.stop()}}),r,null,[[7,14]])})));return function(t){return r.apply(this,arguments)}}()),r.abrupt("return",Promise.all(o));case 3:case"end":return r.stop()}}),r)}))),E.apply(this,arguments)}function D(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},b=n.timestamp,d=n.isOldApiUsed,v=u({}),h=r(v,2),O=h[0],w=h[1],g=a();g.current||(g.current=s());var x=window[Symbol.for("socket")],E=x.subscribe,D=x.unsubscribe,S=x.socket,q=i((function(){return y()}),[]),A=a([]),K=p(t).map((function(r){return I(r,g.current,q)})),N=K.map((function(r){return r.subId})).join(),Q=i((function(){if(b)return{timestamp:{$lte:b}};var r=c(window.location.search).time;return r?{timestamp:{$lte:new Date(r)/1e3}}:null}),[window.location.search,b]);return o((function(){var r=function(r){r.hookId===g.current&&w((function(t){var n=r.data;return r.subId in t&&!r.subscribeOnly&&(n=m(t[r.subId],r.data)),r.params&&r.params.limit&&(n=n.slice(-r.params.limit)),j(j({},t),{},e({},r.subId,n))}))};return S&&S.on("data",r),function(){return S&&S.off("data",r)}}),[]),o((function(){A.current.forEach(D),A.current=[]}),[Q]),o((function(){var r=A.current,t=f(K,r,"subId"),e=f(r,K,"subId");t.forEach((function(r){Q&&!r.alwaysSubscribe||E(r)})),e.forEach(D),A.current=K,(d?k:P)(t,{timeQuery:Q,appKey:q,isOldApiUsed:d}).then((function(r){return w((function(n){var u=l(n,e.map((function(r){return r.subId})));return t.forEach((function(t,e){null!==r[e]&&(u[t.subId]=r[e])})),u}))}))}),[N,Q]),o((function(){return function(){return A.current.forEach(D)}}),[]),i((function(){return K.map((function(r){var t=r.subId;return{loading:!(t in O),data:O[t]}}))}),[O,N])}export{D as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.41.0-8",
3
+ "version": "0.41.0-rc.1",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"
@@ -90,7 +90,7 @@
90
90
  "auth0-js": "^9.14.0",
91
91
  "babel-eslint": "10.0.3",
92
92
  "babel-jest": "^26.3.0",
93
- "babel-loader": "8.0.6",
93
+ "babel-loader": "8.1.0",
94
94
  "babel-plugin-file-loader": "^2.0.0",
95
95
  "babel-plugin-root-import": "^6.5.0",
96
96
  "chalk": "4.1.1",
@@ -167,10 +167,10 @@
167
167
  "use-tiny-state-machine": "^0.0.2",
168
168
  "uuid": "3.4.0",
169
169
  "video-extensions": "1.1.0",
170
- "webpack": "4.41.5",
170
+ "webpack": "4.44.2",
171
171
  "webpack-bundle-analyzer": "3.9.0",
172
172
  "webpack-cli": "3.3.6",
173
- "webpack-dev-server": "3.10.2",
173
+ "webpack-dev-server": "3.11.1",
174
174
  "webpack-manifest-plugin": "2.2.0",
175
175
  "webpack-merge": "5.7.2",
176
176
  "zoid": "^9.0.86"
@@ -8,12 +8,11 @@ body {
8
8
  }
9
9
 
10
10
  body {
11
- scrollbar-color: rgba(0, 0, 0, 0.6) transparent !important;
11
+ scrollbar-color: #a4a4a7b8 transparent;
12
12
  }
13
13
 
14
14
  ::-webkit-scrollbar {
15
15
  width: 16px;
16
- height: 16px;
17
16
  }
18
17
 
19
18
  ::-webkit-scrollbar-track {
@@ -21,12 +20,17 @@ body {
21
20
  }
22
21
 
23
22
  ::-webkit-scrollbar-track:hover {
24
- background-color: transparent;
23
+ background-color: #a4a4a752;
25
24
  }
26
25
 
27
26
  ::-webkit-scrollbar-thumb {
28
- background-color: rgba(0, 0, 0, 0.6) !important;
27
+ background-color: #a4a4a7b8;
29
28
  border-radius: 10px;
30
29
  border: 5px solid rgba(0, 0, 0, 0.01);
31
30
  background-clip: padding-box;
32
31
  }
32
+ ::-webkit-scrollbar-thumb:hover,
33
+ ::-webkit-scrollbar-thumb:active {
34
+ background-color: #a0a0a5;
35
+ border: 4px solid rgba(0, 0, 0, 0.01);
36
+ }
@@ -1 +1 @@
1
- import r from'./../ext-esm/style-inject/dist/style-inject.es.js';r("body{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;overflow:auto;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:rgba(0,0,0,.6) transparent!important;scrollbar-width:thin}::-webkit-scrollbar{height:16px;width:16px}::-webkit-scrollbar-track,::-webkit-scrollbar-track:hover{background-color:transparent}::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:rgba(0,0,0,.6)!important;border:5px solid rgba(0,0,0,.01);border-radius:10px}");
1
+ import r from'./../ext-esm/style-inject/dist/style-inject.es.js';var o={},a="body{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;overflow:auto;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#a4a4a7b8 transparent;scrollbar-width:thin}::-webkit-scrollbar{width:16px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-track:hover{background-color:#a4a4a752}::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#a4a4a7b8;border:5px solid rgba(0,0,0,.01);border-radius:10px}::-webkit-scrollbar-thumb:active,::-webkit-scrollbar-thumb:hover{background-color:#a0a0a5;border:4px solid rgba(0,0,0,.01)}";r("body{-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;overflow:auto;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#a4a4a7b8 transparent;scrollbar-width:thin}::-webkit-scrollbar{width:16px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-track:hover{background-color:#a4a4a752}::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#a4a4a7b8;border:5px solid rgba(0,0,0,.01);border-radius:10px}::-webkit-scrollbar-thumb:active,::-webkit-scrollbar-thumb:hover{background-color:#a0a0a5;border:4px solid rgba(0,0,0,.01)}");export{o as default,a as stylesheet};
@@ -1,8 +1 @@
1
- import '~/styles/index.global.css';
2
- import '~/styles/reactVirtualized.global.css';
3
- import '~/styles/emojiMart.global.css';
4
- // TODO: Config loader to properly load url(path) converting them to base64 images
5
- import '~/styles/mapbox.global.css';
6
- import '~/styles/lightbox.global.css';
7
- import '~/styles/generatedThemesVariables.global.css';
8
- import '~/styles/customScrollbars.global.css';
1
+ import"./index.global.css.js";import"./reactVirtualized.global.css.js";import"./emojiMart.global.css.js";import"./mapbox.global.css.js";import"./lightbox.global.css.js";import"./generatedThemesVariables.global.css.js";navigator.platform.indexOf("Mac")>-1||import("./customScrollbars.global.css.js");
package/utils/convert.js CHANGED
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import t from"corva-convert-units";import{sortBy as n,uniqBy as e}from"lodash";import{IMPERIAL_UNITS as o,METRIC_UNITS as i,UNIT_DEFINITIONS as u}from"./constants/units.js";function c(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.push.apply(n,e)}return n}function f(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?c(Object(e),!0).forEach((function(n){r(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var l="custom",a="imperial",s={imperial:o,metric:i,custom:{}},p=a,v=[],m=function(){return u},b=function(){return s[p]};var g=function(r){var t,n=r.userUnits,e=r.companyUnits;n||e?(s.custom=f(f(f({},o),e),n),p=l):(s.custom={},p=a),t=s.custom,v.forEach((function(r){return r(t)}))};function d(){return s.custom}function h(r){return v.push(r),function(){v=v.filter((function(t){return t!==r}))}}var y=function(r){return s[p][r]},O=function(r){var e=u.find((function(t){return t.type===r}));return e?n(t().list(e.origin),"abbr"):[]},j=function(r){var t=O(r);return e(t,"abbr")},P=function(){return p},w=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=t(),o=e.getUnit,i=e.describe;return null===n&&(n=s.custom[r]),o(n)?i(n).display:n},D=function(r){return s.imperial[r]},E=function(r,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2;if(!r||!e||e===o)return r;if(null===o&&(!(o=y(n))||e===o))return r;var u=t(r).from(e).to(o);return Number.isFinite(u)?Math.round(u*Math.pow(10,i))/Math.pow(10,i):u},M=function(r,t,n,e){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;return r.map((function(r){var u=E(r.get(t),n,e,o,i);return r.set(t,u)}))},U=function(r,t){return r.map((function(r){return t.reduce((function(r,t){var n=t.key,e=t.unitType,o=t.from,i=t.to,u=t.precision,c=r.get(n),f=E(c,e,o,i,u);return r.set(n,f)}),r)}))},k=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,e=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2,u=0;u<r.length;u+=1)r[u][t]=E(r[u][t],n,e,o,i);return r},S=function(r){return t().describe(y(r)).singular},x=function(r){return t().describe(y(r)).plural},F=function(r){return t().describe(r)};export{k as convertArray,M as convertImmutables,U as convertImmutablesByBatch,E as convertValue,m as getAllUnitTypes,D as getDefaultImperialUnit,b as getDefaultUnits,j as getUniqueUnitsByType,F as getUnitDescription,w as getUnitDisplay,x as getUnitPlural,y as getUnitPreference,S as getUnitSingular,P as getUnitSystem,O as getUnitsByType,d as getUserUnits,h as subscribeForUserUnitsUpdates,g as updateUserUnits};
1
+ import r from"@babel/runtime/helpers/defineProperty";import t from"corva-convert-units";import{sortBy as n,uniqBy as e}from"lodash";import{UNIT_DEFINITIONS as o,IMPERIAL_UNITS as i,METRIC_UNITS as u}from"./constants/units.js";function c(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.push.apply(n,e)}return n}function f(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?c(Object(e),!0).forEach((function(n){r(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var l="custom",a="imperial",s={imperial:i,metric:u,custom:{}},p=a,v=[],m=function(){return o},b=function(){return s[p]};var g=function(r){var t,n=r.userUnits,e=r.companyUnits;n||e?(s.custom=f(f(f({},i),e),n),p=l):(s.custom={},p=a),t=s.custom,v.forEach((function(r){return r(t)}))};function d(){return s.custom}function h(r){return v.push(r),function(){v=v.filter((function(t){return t!==r}))}}var y=function(r){return s[p][r]},O=function(r){var e=o.find((function(t){return t.type===r}));return e?n(t().list(e.origin),"abbr"):[]},j=function(r){var t=O(r);return e(t,"abbr")},P=function(){return p},w=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=t(),o=e.getUnit,i=e.describe;return null===n&&(n=s.custom[r]),o(n)?i(n).display:n},D=function(r){return s.imperial[r]},E=function(r,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2;if(!r||!e||e===o)return r;if(null===o&&(!(o=y(n))||e===o))return r;var u=t(r).from(e).to(o);return Number.isFinite(u)?Math.round(u*Math.pow(10,i))/Math.pow(10,i):u},M=function(r,t,n,e){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;return r.map((function(r){var u=E(r.get(t),n,e,o,i);return r.set(t,u)}))},U=function(r,t){return r.map((function(r){return t.reduce((function(r,t){var n=t.key,e=t.unitType,o=t.from,i=t.to,u=t.precision,c=r.get(n),f=E(c,e,o,i,u);return r.set(n,f)}),r)}))},k=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,e=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2,u=0;u<r.length;u+=1)r[u][t]=E(r[u][t],n,e,o,i);return r},S=function(r){return t().describe(y(r)).singular},x=function(r){return t().describe(y(r)).plural},F=function(r){return t().describe(r)};export{k as convertArray,M as convertImmutables,U as convertImmutablesByBatch,E as convertValue,m as getAllUnitTypes,D as getDefaultImperialUnit,b as getDefaultUnits,j as getUniqueUnitsByType,F as getUnitDescription,w as getUnitDisplay,x as getUnitPlural,y as getUnitPreference,S as getUnitSingular,P as getUnitSystem,O as getUnitsByType,d as getUserUnits,h as subscribeForUserUnitsUpdates,g as updateUserUnits};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"prop-types";import{makeStyles as t,TextField as o}from"@material-ui/core";import n from"@material-ui/lab/Autocomplete";import{jsx as p}from"react/jsx-runtime";function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function l(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var a=t({root:{marginTop:-3,width:"100%"},paper:{maxHeight:450,width:320,boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%)"},listbox:{overflow:"hidden auto"}}),c=function(e){var r=e.wells,t=e.subjectWell,i=e.onChange,c=a();return p(n,{"data-testid":"".concat("SubjectWellSearch","_autocomplete"),openOnFocus:!0,options:r,disableClearable:!0,blurOnSelect:!0,classes:{root:c.root,paper:c.paper,listbox:c.listbox},value:t,getOptionLabel:function(e){return e.name},renderInput:function(e){return p(o,l(l({},e),{},{label:"Subject Well"}))},onChange:function(e,r){i(r.id)}})};c.propTypes={wells:r.arrayOf(r.shape({})).isRequired,subjectWell:r.shape({}),onChange:r.func.isRequired},c.defaultProps={subjectWell:null};export{c as SubjectWellSearch};
@@ -1 +0,0 @@
1
- import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/regenerator";import{useState as n,useEffect as a}from"react";import{fetchCompanies as o}from"../utils/apiCalls.js";function i(i){var u=n([]),p=e(u,2),s=p[0],c=p[1];return a((function(){function e(){return(e=r(t.mark((function r(){var e;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i){r.next=3;break}return c([]),r.abrupt("return");case 3:return r.next=5,o();case 5:e=r.sent,c(e.map((function(r){return{value:r.id,label:r.name}})));case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[i]),s}export{i as useCompanies};