@corva/ui 3.45.1 → 3.45.3

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 (20) hide show
  1. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
  2. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
  3. package/cjs-bundle/components/OffsetWellPickerV5/effects/useLoadAllWellsCompanySafeguard.js +1 -1
  4. package/cjs-bundle/components/OffsetWellPickerV5/stores/filter-store/utils/normalizeFilters.js +1 -1
  5. package/cjs-bundle/components/WellSummary/WellSummaryItemValue.js +1 -1
  6. package/cjs-bundle/components/WellSummary/WellSummaryItemValue.js.map +1 -1
  7. package/components/OffsetWellPickerV5/OffsetWellPickerV5.d.ts.map +1 -1
  8. package/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
  9. package/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
  10. package/components/OffsetWellPickerV5/effects/useLoadAllWellsCompanySafeguard.d.ts +1 -0
  11. package/components/OffsetWellPickerV5/effects/useLoadAllWellsCompanySafeguard.d.ts.map +1 -1
  12. package/components/OffsetWellPickerV5/effects/useLoadAllWellsCompanySafeguard.js +1 -1
  13. package/components/OffsetWellPickerV5/stores/filter-store/utils/normalizeFilters.d.ts.map +1 -1
  14. package/components/OffsetWellPickerV5/stores/filter-store/utils/normalizeFilters.js +1 -1
  15. package/components/OffsetWellPickerV5/stores/filter-store/utils/normalizeFilters.js.map +1 -1
  16. package/components/WellSummary/WellSummaryItemValue.d.ts +2 -1
  17. package/components/WellSummary/WellSummaryItemValue.d.ts.map +1 -1
  18. package/components/WellSummary/WellSummaryItemValue.js +1 -1
  19. package/components/WellSummary/WellSummaryItemValue.js.map +1 -1
  20. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WellSummaryItemValue.js","sources":["../../../../src/components/WellSummary/WellSummaryItemValue.js"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport PropTypes from 'prop-types';\nimport { makeStyles, Typography } from '@material-ui/core';\nimport { upperFirst } from 'lodash';\nimport moment from 'moment';\nimport classnames from 'classnames';\n\nimport UpArrowIcon from './assets/up_arrow.svg';\nimport LeftArrowIcon from './assets/left_arrow.svg';\n\nimport { DRILLING_WELL_SUMMARY, COMPLETION_WELL_SUMMARY, DRILLOUT_WELL_SUMMARY } from '~/constants';\nimport { BHASchematic } from '~/components/Drillstring';\nimport { schematic as schematicUtils } from '~/utils/drillstring';\nimport utils from '~/utils/main';\nimport { orDash } from '~/utils/formatting';\nimport { convertValue, getUnitDisplay } from '~/utils/convert';\nimport BitIcon from '~/assets/bit.svg';\nimport HoleDepthIcon from '~/assets/hole_depth.svg';\nimport DrilloutIcon from '~/assets/drillout.svg';\n\nconst useStyles = makeStyles({\n value: {\n fontSize: '14px',\n fontWeight: 500,\n },\n valueSuffix: {\n color: '#9E9E9E',\n },\n hasLeftMargin: {\n marginLeft: 4,\n },\n bhaRoot: {\n display: 'flex',\n alignItems: 'center',\n },\n bhaIdRoot: {\n backgroundColor: '#2196F3',\n borderRadius: '50%',\n marginRight: '8px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n realBhaRoot: {\n width: '16px',\n height: '16px',\n },\n bhaIdLabel: {\n fontWeight: 500,\n fontSize: '12px',\n },\n dummyBhaIdLabel: {\n paddingLeft: '4px',\n paddingRight: '4px',\n },\n bhaActiveIndicator: {\n fontSize: '12px',\n padding: '4px',\n fontWeight: 500,\n },\n nptRoot: {\n display: 'flex',\n alignItems: 'center',\n },\n rectIndicator: {\n width: '8px',\n height: '8px',\n backgroundColor: '#D32F2F',\n borderRadius: '2px',\n marginRight: '8px',\n },\n stageActual: {\n fontSize: '16px',\n },\n stagePercent: {\n color: '#9E9E9E',\n marginLeft: '4px',\n },\n fluidProppantType: {\n color: '#9E9E9E',\n },\n valueWrapper: {\n display: 'flex',\n alignItems: 'center',\n },\n rightImg: {\n marginRight: '4px',\n },\n centerImg: {\n marginLeft: '4px',\n marginRight: '4px',\n },\n rotate: {\n transform: 'rotate(180deg)',\n },\n profileRoot: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n profile: {\n width: '20px',\n height: '20px',\n borderRadius: '50%',\n fontSize: '10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: '8px',\n backgroundSize: '20px 20px',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'center',\n },\n plugsIcon: { marginLeft: -8 },\n});\n\nfunction WellSummaryItemValue({ item, summaryData }) {\n const classes = useStyles();\n\n if (!summaryData) {\n return null;\n }\n\n // Hole depth for drilling\n if (item.key === DRILLING_WELL_SUMMARY.HOLE_DEPTH.key) {\n const { holeDepth } = item.dataGetter(summaryData);\n return Number.isFinite(holeDepth) ? (\n <div className={classes.valueWrapper}>\n <img src={HoleDepthIcon} alt=\"hole_depth\" className={classes.centerImg} />\n <span className={classnames(classes.value, classes.hasLeftMargin)}>\n {Math.floor(holeDepth)}’\n </span>\n </div>\n ) : (\n '-'\n );\n }\n\n // Bit/Hole depth for drilling\n if (item.key === DRILLING_WELL_SUMMARY.BIT_HOLE_DEPTH.key) {\n const { bitDepth, holeDepth } = item.dataGetter(summaryData);\n return [bitDepth, holeDepth].every(Number.isFinite) ? (\n <div className={classes.valueWrapper}>\n <img src={BitIcon} alt=\"bit_depth\" className={classes.rightImg} />\n <span className={classes.value}>{Math.floor(bitDepth)}’ / </span>\n <img src={HoleDepthIcon} alt=\"hole_depth\" className={classes.centerImg} />\n <span className={classes.value}>{Math.floor(holeDepth)}’</span>\n </div>\n ) : (\n '-'\n );\n }\n\n // Divergence for drilling\n if (item.key === DRILLING_WELL_SUMMARY.DIVERGENCE.key) {\n const { distance, high, right } = item.dataGetter(summaryData);\n return [distance, high, right].every(Number.isFinite) ? (\n <div className={classes.valueWrapper}>\n <span className={classes.value}>\n {`${convertValue(distance, 'length', 'ft')} ${getUnitDisplay('length')}`}\n </span>\n <img\n src={UpArrowIcon}\n alt=\"up_arrow\"\n className={classnames(classes.centerImg, { [classes.rotate]: high < 0 })}\n />\n <span className={classes.value}>\n {`${Math.abs(convertValue(high, 'length', 'ft'))} ${getUnitDisplay('length')} ${\n high >= 0 ? 'High' : 'Low'\n }`}\n </span>\n <img\n src={LeftArrowIcon}\n alt=\"left_arrow\"\n className={classnames(classes.centerImg, { [classes.rotate]: right > 0 })}\n />\n <span className={classes.value}>\n {`${Math.abs(convertValue(right, 'length', 'ft'))} ${getUnitDisplay('length')} ${\n right > 0 ? 'Right' : 'Left'\n }`}\n </span>\n </div>\n ) : (\n '-'\n );\n }\n\n // Last Active for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.LAST_ACTIVE.key ||\n item.key === COMPLETION_WELL_SUMMARY.LAST_ACTIVE.key\n ) {\n const { timestamp } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>\n {timestamp ? moment.unix(timestamp).format('MM/DD/YYYY HH:mm') : '-'}\n </Typography>\n );\n }\n\n // Last Current activity for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.CURRENT_ACTIVITY.key ||\n item.key === COMPLETION_WELL_SUMMARY.CURRENT_ACTIVITY.key\n ) {\n const { activityName } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>{orDash(upperFirst(activityName || '-'))}</Typography>\n );\n }\n\n // Current phase for drilling\n if (item.key === DRILLING_WELL_SUMMARY.PHASE.key) {\n const { phaseName } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(phaseName)}</Typography>;\n }\n\n // Hole section for drilling\n if (item.key === DRILLING_WELL_SUMMARY.HOLE_SECTION.key) {\n const { sectionName } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(sectionName)}</Typography>;\n }\n\n // Mud for drilling and drillout\n if ([DRILLING_WELL_SUMMARY.MUD.key, DRILLOUT_WELL_SUMMARY.MUD.key].includes(item.key)) {\n const { mudType, mudDensity } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>\n {mudType || mudDensity ? (\n <>\n {mudType && `${mudType}, `}\n {mudDensity &&\n `${convertValue(mudDensity, 'density', 'ppg')} ${getUnitDisplay('density')}`}\n </>\n ) : (\n '-'\n )}\n </Typography>\n );\n }\n\n // NPT for drilling & completion\n if (item.key === DRILLING_WELL_SUMMARY.NPT.key || item.key === COMPLETION_WELL_SUMMARY.NPT.key) {\n const { nptType, startTime, endTime } = item.dataGetter(summaryData);\n\n return nptType && startTime && endTime ? (\n <div className={classes.nptRoot}>\n <div className={classes.rectIndicator} />\n <Typography className={classes.value}>\n {upperFirst(nptType)}: {((endTime - startTime) / 3600).fixFloat(1)} hr\n </Typography>\n </div>\n ) : (\n '-'\n );\n }\n\n // Operation summary for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.OPERATIONS_SUMMARY.key ||\n item.key === COMPLETION_WELL_SUMMARY.OPERATIONS_SUMMARY.key\n ) {\n const { dateTime, summary } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>\n {dateTime ? moment.unix(dateTime).format('MM/DD/YYYY HH:mm') : '-'}\n <br />\n {summary}\n </Typography>\n );\n }\n\n // Stage for completion\n if (item.key === COMPLETION_WELL_SUMMARY.STAGE.key) {\n const { planned, actual } = item.dataGetter(summaryData);\n return actual && planned ? (\n <Typography className={classes.value}>\n <span className={classes.stageActual}>{actual}</span>\n <span>/</span>\n <span>{planned}</span>\n <span className={classes.stagePercent}>Stg {Math.floor((actual / planned) * 100)} %</span>\n </Typography>\n ) : (\n '-'\n );\n }\n\n // Fluids for completion\n if (item.key === COMPLETION_WELL_SUMMARY.FLUIDS.key) {\n const { fluids } = item.dataGetter(summaryData);\n return (\n <div>\n {fluids.length === 0\n ? '-'\n : fluids.map(({ type, amount, unit }) => (\n <Typography key={`${type}_${amount}`} className={classes.value}>\n <span className={classes.fluidProppantType}>{type} - </span>\n <span>{`${convertValue(amount, 'oil', unit)} ${getUnitDisplay('oil')}`}</span>\n </Typography>\n ))}\n </div>\n );\n }\n // Fluids for completion\n if (item.key === COMPLETION_WELL_SUMMARY.PROPPANTS.key) {\n const { proppants } = item.dataGetter(summaryData);\n return (\n <div>\n {proppants.length === 0\n ? '-'\n : proppants.map(({ type, amount, unit }) => (\n <Typography key={`${type}_${amount}`} className={classes.value}>\n <span className={classes.fluidProppantType}>{type} - </span>\n <span>{`${convertValue(amount, 'mass', unit)} ${getUnitDisplay('mass')}`}</span>\n </Typography>\n ))}\n </div>\n );\n }\n\n // Alert for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.ALERT.key ||\n item.key === COMPLETION_WELL_SUMMARY.ALERT.key\n ) {\n const { decisionPath } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(decisionPath)}</Typography>;\n }\n\n // App annotation for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.ANNOTATION.key ||\n item.key === COMPLETION_WELL_SUMMARY.ANNOTATION.key\n ) {\n const { firstName, lastName, profilePhoto, content } = item.dataGetter(summaryData);\n const fullName = `${firstName} ${lastName}`;\n const displayName = `${(firstName || '').charAt(0)}${(lastName || '').charAt(0)}`;\n\n return content ? (\n <div className={classes.profileRoot}>\n <div\n className={classes.profile}\n style={{\n backgroundColor: `#${utils.getColorFromString(fullName)}`,\n backgroundImage: `url(${profilePhoto})`,\n }}\n >\n {profilePhoto ? null : displayName}\n </div>\n <Typography className={classes.value}>{content}</Typography>\n </div>\n ) : (\n '-'\n );\n }\n\n // BHA for drilling and drillout\n if ([DRILLING_WELL_SUMMARY.BHA.key, DRILLOUT_WELL_SUMMARY.BHA.key].includes(item.key)) {\n const isDrilloutItem = DRILLOUT_WELL_SUMMARY.BHA.key === item.key;\n const { bhaId, components } = item.dataGetter(summaryData);\n const stringBhaId = (bhaId && String(bhaId)) || '-';\n const schematic =\n (bhaId && schematicUtils.getBHASchematic(components || [], isDrilloutItem)) || [];\n return (\n <div className={classes.bhaRoot}>\n <div\n className={classnames(classes.bhaIdRoot, {\n [classes.realBhaRoot]: !stringBhaId.includes('.'),\n })}\n >\n <Typography\n className={classnames(classes.bhaIdLabel, {\n [classes.dummyBhaIdLabel]: stringBhaId.includes('.'),\n })}\n >\n {stringBhaId}\n </Typography>\n </div>\n <BHASchematic schematic={schematic} containerHeight={20} containerWidth={120} />\n </div>\n );\n }\n\n // Casing for drilling\n if (item.key === DRILLING_WELL_SUMMARY.CASING.key) {\n const { outerDiameter } = item.dataGetter(summaryData);\n if (!outerDiameter) {\n return null;\n }\n return (\n <Typography className={classes.value}>\n {`${convertValue(outerDiameter, 'shortLength', 'in')} ${getUnitDisplay('shortLength')}`}\n </Typography>\n );\n }\n\n if (item.key === DRILLING_WELL_SUMMARY.BHA_COUNT.key) {\n const { count } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(count)}</Typography>;\n }\n\n if (item.key === COMPLETION_WELL_SUMMARY.STAGES_DESIGN.key) {\n const { totalNumberOfStages } = item.dataGetter(summaryData);\n return Number.isFinite(totalNumberOfStages) ? (\n <Typography className={classes.value}>\n -/{totalNumberOfStages} <span className={classes.valueSuffix}>Stg</span>\n </Typography>\n ) : (\n '-'\n );\n }\n\n if (item.key === COMPLETION_WELL_SUMMARY.PLUGS_DRILLED_COUNT.key) {\n const { plugsDrilledCount } = item.dataGetter(summaryData);\n\n return Number.isFinite(plugsDrilledCount) ? (\n <div className={classes.valueWrapper}>\n <img src={DrilloutIcon} alt=\"drillout\" className={classes.plugsIcon} />\n <span className={classnames(classes.value, classes.hasLeftMargin)}>\n {plugsDrilledCount}\n </span>\n </div>\n ) : (\n '-'\n );\n }\n\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`${item.key} wasn't handled in WellSummaryItemValue. Returning null`);\n }\n\n return null;\n}\n\nWellSummaryItemValue.propTypes = {\n item: PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n icon: PropTypes.node,\n dataGetter: PropTypes.func,\n }).isRequired,\n summaryData: PropTypes.shape({}).isRequired,\n};\n\nexport default WellSummaryItemValue;\n"],"names":["HoleDepthIcon","useStyles","makeStyles","value","fontSize","fontWeight","valueSuffix","color","hasLeftMargin","marginLeft","bhaRoot","display","alignItems","bhaIdRoot","backgroundColor","borderRadius","marginRight","justifyContent","realBhaRoot","width","height","bhaIdLabel","dummyBhaIdLabel","paddingLeft","paddingRight","bhaActiveIndicator","padding","nptRoot","rectIndicator","stageActual","stagePercent","fluidProppantType","valueWrapper","rightImg","centerImg","rotate","transform","profileRoot","profile","backgroundSize","backgroundRepeat","backgroundPosition","plugsIcon","WellSummaryItemValue","_ref","item","summaryData","classes","key","DRILLING_WELL_SUMMARY","HOLE_DEPTH","holeDepth","dataGetter","Number","isFinite","_jsxs","className","children","_jsx","jsx","src","alt","jsxs","classnames","Math","floor","BIT_HOLE_DEPTH","_item$dataGetter2","bitDepth","every","DIVERGENCE","_item$dataGetter3","distance","high","right","concat","convertValue","getUnitDisplay","abs","LAST_ACTIVE","COMPLETION_WELL_SUMMARY","timestamp","Typography","moment","unix","format","CURRENT_ACTIVITY","activityName","orDash","upperFirst","PHASE","phaseName","HOLE_SECTION","sectionName","MUD","DRILLOUT_WELL_SUMMARY","includes","_item$dataGetter8","mudType","mudDensity","_Fragment","NPT","_item$dataGetter9","nptType","startTime","endTime","fixFloat","OPERATIONS_SUMMARY","_item$dataGetter10","dateTime","summary","STAGE","_item$dataGetter11","planned","actual","FLUIDS","fluids","length","map","_ref2","type","amount","unit","PROPPANTS","proppants","_ref3","ALERT","decisionPath","ANNOTATION","_item$dataGetter15","firstName","lastName","profilePhoto","content","fullName","displayName","charAt","style","utils","getColorFromString","backgroundImage","BHA","isDrilloutItem","_item$dataGetter16","bhaId","components","stringBhaId","String","schematic","schematicUtils","getBHASchematic","BHASchematic","containerHeight","containerWidth","CASING","outerDiameter","BHA_COUNT","count","STAGES_DESIGN","totalNumberOfStages","PLUGS_DRILLED_COUNT","plugsDrilledCount","process","env","NODE_ENV","Error","propTypes","PropTypes","shape","string","label","icon","node","func","isRequired"],"mappings":"i7CA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UAAWT,EAAQL,YAC1DgB,EAAAC,IAAA,OAAA,CAAMH,UAAWO,EAAAA,QAAWhB,EAAQ5C,MAAO4C,EAAQvC,eAAeiD,SAC/DwG,QAIL,GAEJ,CAEA,GAA6B,gBAAzBC,QAAQC,IAAIC,SACd,MAAM,IAAIC,MAAK,GAAA1F,OAAI9B,EAAKG,IAA6D,4DAGvF,OAAO,IACT,CAEAL,EAAqB2H,UAAY,CAC/BzH,KAAM0H,EAAS,QAACC,MAAM,CACpBxH,IAAKuH,EAAS,QAACE,OACfC,MAAOH,EAAS,QAACE,OACjBE,KAAMJ,EAAS,QAACK,KAChBxH,WAAYmH,EAAS,QAACM,OACrBC,WACHhI,YAAayH,EAAS,QAACC,MAAM,CAAA,GAAIM"}
1
+ {"version":3,"file":"WellSummaryItemValue.js","sources":["../../../../src/components/WellSummary/WellSummaryItemValue.js"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport PropTypes from 'prop-types';\nimport { makeStyles, Typography } from '@material-ui/core';\nimport { upperFirst } from 'lodash';\nimport moment from 'moment-timezone';\nimport classnames from 'classnames';\n\nimport UpArrowIcon from './assets/up_arrow.svg';\nimport LeftArrowIcon from './assets/left_arrow.svg';\n\nimport { DRILLING_WELL_SUMMARY, COMPLETION_WELL_SUMMARY, DRILLOUT_WELL_SUMMARY } from '~/constants';\nimport { BHASchematic } from '~/components/Drillstring';\nimport { schematic as schematicUtils } from '~/utils/drillstring';\nimport utils from '~/utils/main';\nimport { orDash } from '~/utils/formatting';\nimport { convertValue, getUnitDisplay } from '~/utils/convert';\nimport BitIcon from '~/assets/bit.svg';\nimport HoleDepthIcon from '~/assets/hole_depth.svg';\nimport DrilloutIcon from '~/assets/drillout.svg';\n\nconst useStyles = makeStyles({\n value: {\n fontSize: '14px',\n fontWeight: 500,\n },\n valueSuffix: {\n color: '#9E9E9E',\n },\n hasLeftMargin: {\n marginLeft: 4,\n },\n bhaRoot: {\n display: 'flex',\n alignItems: 'center',\n },\n bhaIdRoot: {\n backgroundColor: '#2196F3',\n borderRadius: '50%',\n marginRight: '8px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n realBhaRoot: {\n width: '16px',\n height: '16px',\n },\n bhaIdLabel: {\n fontWeight: 500,\n fontSize: '12px',\n },\n dummyBhaIdLabel: {\n paddingLeft: '4px',\n paddingRight: '4px',\n },\n bhaActiveIndicator: {\n fontSize: '12px',\n padding: '4px',\n fontWeight: 500,\n },\n nptRoot: {\n display: 'flex',\n alignItems: 'center',\n },\n rectIndicator: {\n width: '8px',\n height: '8px',\n backgroundColor: '#D32F2F',\n borderRadius: '2px',\n marginRight: '8px',\n },\n stageActual: {\n fontSize: '16px',\n },\n stagePercent: {\n color: '#9E9E9E',\n marginLeft: '4px',\n },\n fluidProppantType: {\n color: '#9E9E9E',\n },\n valueWrapper: {\n display: 'flex',\n alignItems: 'center',\n },\n rightImg: {\n marginRight: '4px',\n },\n centerImg: {\n marginLeft: '4px',\n marginRight: '4px',\n },\n rotate: {\n transform: 'rotate(180deg)',\n },\n profileRoot: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n profile: {\n width: '20px',\n height: '20px',\n borderRadius: '50%',\n fontSize: '10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: '8px',\n backgroundSize: '20px 20px',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'center',\n },\n plugsIcon: { marginLeft: -8 },\n});\n\nfunction WellSummaryItemValue({ item, summaryData, timezone }) {\n const classes = useStyles();\n\n if (!summaryData) {\n return null;\n }\n\n // Hole depth for drilling\n if (item.key === DRILLING_WELL_SUMMARY.HOLE_DEPTH.key) {\n const { holeDepth } = item.dataGetter(summaryData);\n return Number.isFinite(holeDepth) ? (\n <div className={classes.valueWrapper}>\n <img src={HoleDepthIcon} alt=\"hole_depth\" className={classes.centerImg} />\n <span className={classnames(classes.value, classes.hasLeftMargin)}>\n {Math.floor(holeDepth)}’\n </span>\n </div>\n ) : (\n '-'\n );\n }\n\n // Bit/Hole depth for drilling\n if (item.key === DRILLING_WELL_SUMMARY.BIT_HOLE_DEPTH.key) {\n const { bitDepth, holeDepth } = item.dataGetter(summaryData);\n return [bitDepth, holeDepth].every(Number.isFinite) ? (\n <div className={classes.valueWrapper}>\n <img src={BitIcon} alt=\"bit_depth\" className={classes.rightImg} />\n <span className={classes.value}>{Math.floor(bitDepth)}’ / </span>\n <img src={HoleDepthIcon} alt=\"hole_depth\" className={classes.centerImg} />\n <span className={classes.value}>{Math.floor(holeDepth)}’</span>\n </div>\n ) : (\n '-'\n );\n }\n\n // Divergence for drilling\n if (item.key === DRILLING_WELL_SUMMARY.DIVERGENCE.key) {\n const { distance, high, right } = item.dataGetter(summaryData);\n return [distance, high, right].every(Number.isFinite) ? (\n <div className={classes.valueWrapper}>\n <span className={classes.value}>\n {`${convertValue(distance, 'length', 'ft')} ${getUnitDisplay('length')}`}\n </span>\n <img\n src={UpArrowIcon}\n alt=\"up_arrow\"\n className={classnames(classes.centerImg, { [classes.rotate]: high < 0 })}\n />\n <span className={classes.value}>\n {`${Math.abs(convertValue(high, 'length', 'ft'))} ${getUnitDisplay('length')} ${\n high >= 0 ? 'High' : 'Low'\n }`}\n </span>\n <img\n src={LeftArrowIcon}\n alt=\"left_arrow\"\n className={classnames(classes.centerImg, { [classes.rotate]: right > 0 })}\n />\n <span className={classes.value}>\n {`${Math.abs(convertValue(right, 'length', 'ft'))} ${getUnitDisplay('length')} ${\n right > 0 ? 'Right' : 'Left'\n }`}\n </span>\n </div>\n ) : (\n '-'\n );\n }\n\n // Last Active for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.LAST_ACTIVE.key ||\n item.key === COMPLETION_WELL_SUMMARY.LAST_ACTIVE.key\n ) {\n const { timestamp } = item.dataGetter(summaryData);\n let formattedDate = '-';\n if (timestamp) {\n formattedDate = timezone\n ? moment.unix(timestamp).tz(timezone).format('MM/DD/YYYY HH:mm')\n : moment.unix(timestamp).format('MM/DD/YYYY HH:mm');\n }\n return <Typography className={classes.value}>{formattedDate}</Typography>;\n }\n\n // Last Current activity for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.CURRENT_ACTIVITY.key ||\n item.key === COMPLETION_WELL_SUMMARY.CURRENT_ACTIVITY.key\n ) {\n const { activityName } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>{orDash(upperFirst(activityName || '-'))}</Typography>\n );\n }\n\n // Current phase for drilling\n if (item.key === DRILLING_WELL_SUMMARY.PHASE.key) {\n const { phaseName } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(phaseName)}</Typography>;\n }\n\n // Hole section for drilling\n if (item.key === DRILLING_WELL_SUMMARY.HOLE_SECTION.key) {\n const { sectionName } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(sectionName)}</Typography>;\n }\n\n // Mud for drilling and drillout\n if ([DRILLING_WELL_SUMMARY.MUD.key, DRILLOUT_WELL_SUMMARY.MUD.key].includes(item.key)) {\n const { mudType, mudDensity } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>\n {mudType || mudDensity ? (\n <>\n {mudType && `${mudType}, `}\n {mudDensity &&\n `${convertValue(mudDensity, 'density', 'ppg')} ${getUnitDisplay('density')}`}\n </>\n ) : (\n '-'\n )}\n </Typography>\n );\n }\n\n // NPT for drilling & completion\n if (item.key === DRILLING_WELL_SUMMARY.NPT.key || item.key === COMPLETION_WELL_SUMMARY.NPT.key) {\n const { nptType, startTime, endTime } = item.dataGetter(summaryData);\n\n return nptType && startTime && endTime ? (\n <div className={classes.nptRoot}>\n <div className={classes.rectIndicator} />\n <Typography className={classes.value}>\n {upperFirst(nptType)}: {((endTime - startTime) / 3600).fixFloat(1)} hr\n </Typography>\n </div>\n ) : (\n '-'\n );\n }\n\n // Operation summary for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.OPERATIONS_SUMMARY.key ||\n item.key === COMPLETION_WELL_SUMMARY.OPERATIONS_SUMMARY.key\n ) {\n const { dateTime, summary } = item.dataGetter(summaryData);\n return (\n <Typography className={classes.value}>\n {dateTime ? moment.unix(dateTime).format('MM/DD/YYYY HH:mm') : '-'}\n <br />\n {summary}\n </Typography>\n );\n }\n\n // Stage for completion\n if (item.key === COMPLETION_WELL_SUMMARY.STAGE.key) {\n const { planned, actual } = item.dataGetter(summaryData);\n return actual && planned ? (\n <Typography className={classes.value}>\n <span className={classes.stageActual}>{actual}</span>\n <span>/</span>\n <span>{planned}</span>\n <span className={classes.stagePercent}>Stg {Math.floor((actual / planned) * 100)} %</span>\n </Typography>\n ) : (\n '-'\n );\n }\n\n // Fluids for completion\n if (item.key === COMPLETION_WELL_SUMMARY.FLUIDS.key) {\n const { fluids } = item.dataGetter(summaryData);\n return (\n <div>\n {fluids.length === 0\n ? '-'\n : fluids.map(({ type, amount, unit }) => (\n <Typography key={`${type}_${amount}`} className={classes.value}>\n <span className={classes.fluidProppantType}>{type} - </span>\n <span>{`${convertValue(amount, 'oil', unit)} ${getUnitDisplay('oil')}`}</span>\n </Typography>\n ))}\n </div>\n );\n }\n // Fluids for completion\n if (item.key === COMPLETION_WELL_SUMMARY.PROPPANTS.key) {\n const { proppants } = item.dataGetter(summaryData);\n return (\n <div>\n {proppants.length === 0\n ? '-'\n : proppants.map(({ type, amount, unit }) => (\n <Typography key={`${type}_${amount}`} className={classes.value}>\n <span className={classes.fluidProppantType}>{type} - </span>\n <span>{`${convertValue(amount, 'mass', unit)} ${getUnitDisplay('mass')}`}</span>\n </Typography>\n ))}\n </div>\n );\n }\n\n // Alert for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.ALERT.key ||\n item.key === COMPLETION_WELL_SUMMARY.ALERT.key\n ) {\n const { decisionPath } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(decisionPath)}</Typography>;\n }\n\n // App annotation for drilling & completion\n if (\n item.key === DRILLING_WELL_SUMMARY.ANNOTATION.key ||\n item.key === COMPLETION_WELL_SUMMARY.ANNOTATION.key\n ) {\n const { firstName, lastName, profilePhoto, content } = item.dataGetter(summaryData);\n const fullName = `${firstName} ${lastName}`;\n const displayName = `${(firstName || '').charAt(0)}${(lastName || '').charAt(0)}`;\n\n return content ? (\n <div className={classes.profileRoot}>\n <div\n className={classes.profile}\n style={{\n backgroundColor: `#${utils.getColorFromString(fullName)}`,\n backgroundImage: `url(${profilePhoto})`,\n }}\n >\n {profilePhoto ? null : displayName}\n </div>\n <Typography className={classes.value}>{content}</Typography>\n </div>\n ) : (\n '-'\n );\n }\n\n // BHA for drilling and drillout\n if ([DRILLING_WELL_SUMMARY.BHA.key, DRILLOUT_WELL_SUMMARY.BHA.key].includes(item.key)) {\n const isDrilloutItem = DRILLOUT_WELL_SUMMARY.BHA.key === item.key;\n const { bhaId, components } = item.dataGetter(summaryData);\n const stringBhaId = (bhaId && String(bhaId)) || '-';\n const schematic =\n (bhaId && schematicUtils.getBHASchematic(components || [], isDrilloutItem)) || [];\n return (\n <div className={classes.bhaRoot}>\n <div\n className={classnames(classes.bhaIdRoot, {\n [classes.realBhaRoot]: !stringBhaId.includes('.'),\n })}\n >\n <Typography\n className={classnames(classes.bhaIdLabel, {\n [classes.dummyBhaIdLabel]: stringBhaId.includes('.'),\n })}\n >\n {stringBhaId}\n </Typography>\n </div>\n <BHASchematic schematic={schematic} containerHeight={20} containerWidth={120} />\n </div>\n );\n }\n\n // Casing for drilling\n if (item.key === DRILLING_WELL_SUMMARY.CASING.key) {\n const { outerDiameter } = item.dataGetter(summaryData);\n if (!outerDiameter) {\n return null;\n }\n return (\n <Typography className={classes.value}>\n {`${convertValue(outerDiameter, 'shortLength', 'in')} ${getUnitDisplay('shortLength')}`}\n </Typography>\n );\n }\n\n if (item.key === DRILLING_WELL_SUMMARY.BHA_COUNT.key) {\n const { count } = item.dataGetter(summaryData);\n return <Typography className={classes.value}>{orDash(count)}</Typography>;\n }\n\n if (item.key === COMPLETION_WELL_SUMMARY.STAGES_DESIGN.key) {\n const { totalNumberOfStages } = item.dataGetter(summaryData);\n return Number.isFinite(totalNumberOfStages) ? (\n <Typography className={classes.value}>\n -/{totalNumberOfStages} <span className={classes.valueSuffix}>Stg</span>\n </Typography>\n ) : (\n '-'\n );\n }\n\n if (item.key === COMPLETION_WELL_SUMMARY.PLUGS_DRILLED_COUNT.key) {\n const { plugsDrilledCount } = item.dataGetter(summaryData);\n\n return Number.isFinite(plugsDrilledCount) ? (\n <div className={classes.valueWrapper}>\n <img src={DrilloutIcon} alt=\"drillout\" className={classes.plugsIcon} />\n <span className={classnames(classes.value, classes.hasLeftMargin)}>\n {plugsDrilledCount}\n </span>\n </div>\n ) : (\n '-'\n );\n }\n\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`${item.key} wasn't handled in WellSummaryItemValue. Returning null`);\n }\n\n return null;\n}\n\nWellSummaryItemValue.propTypes = {\n item: PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n icon: PropTypes.node,\n dataGetter: PropTypes.func,\n }).isRequired,\n summaryData: PropTypes.shape({}).isRequired,\n};\n\nexport default WellSummaryItemValue;\n"],"names":["HoleDepthIcon","useStyles","makeStyles","value","fontSize","fontWeight","valueSuffix","color","hasLeftMargin","marginLeft","bhaRoot","display","alignItems","bhaIdRoot","backgroundColor","borderRadius","marginRight","justifyContent","realBhaRoot","width","height","bhaIdLabel","dummyBhaIdLabel","paddingLeft","paddingRight","bhaActiveIndicator","padding","nptRoot","rectIndicator","stageActual","stagePercent","fluidProppantType","valueWrapper","rightImg","centerImg","rotate","transform","profileRoot","profile","backgroundSize","backgroundRepeat","backgroundPosition","plugsIcon","WellSummaryItemValue","_ref","item","summaryData","timezone","classes","key","DRILLING_WELL_SUMMARY","HOLE_DEPTH","holeDepth","dataGetter","Number","isFinite","_jsxs","className","children","_jsx","jsx","src","alt","jsxs","classnames","Math","floor","BIT_HOLE_DEPTH","_item$dataGetter2","bitDepth","every","DIVERGENCE","_item$dataGetter3","distance","high","right","concat","convertValue","getUnitDisplay","abs","LAST_ACTIVE","COMPLETION_WELL_SUMMARY","timestamp","formattedDate","moment","unix","tz","format","Typography","CURRENT_ACTIVITY","activityName","orDash","upperFirst","PHASE","phaseName","HOLE_SECTION","sectionName","MUD","DRILLOUT_WELL_SUMMARY","includes","_item$dataGetter8","mudType","mudDensity","_Fragment","NPT","_item$dataGetter9","nptType","startTime","endTime","fixFloat","OPERATIONS_SUMMARY","_item$dataGetter10","dateTime","summary","STAGE","_item$dataGetter11","planned","actual","FLUIDS","fluids","length","map","_ref2","type","amount","unit","PROPPANTS","proppants","_ref3","ALERT","decisionPath","ANNOTATION","_item$dataGetter15","firstName","lastName","profilePhoto","content","fullName","displayName","charAt","style","utils","getColorFromString","backgroundImage","BHA","isDrilloutItem","_item$dataGetter16","bhaId","components","stringBhaId","String","schematic","schematicUtils","getBHASchematic","BHASchematic","containerHeight","containerWidth","CASING","outerDiameter","BHA_COUNT","count","STAGES_DESIGN","totalNumberOfStages","PLUGS_DRILLED_COUNT","plugsDrilledCount","process","env","NODE_ENV","Error","propTypes","PropTypes","shape","string","label","icon","node","func","isRequired"],"mappings":"g9CAe+DA,EAAA,qDAKzDC,EAAYC,EAAAA,WAAW,CAC3BC,MAAO,CACLC,SAAU,OACVC,WAAY,KAEdC,YAAa,CACXC,MAAO,WAETC,cAAe,CACbC,WAAY,GAEdC,QAAS,CACPC,QAAS,OACTC,WAAY,UAEdC,UAAW,CACTC,gBAAiB,UACjBC,aAAc,MACdC,YAAa,MACbL,QAAS,OACTC,WAAY,SACZK,eAAgB,UAElBC,YAAa,CACXC,MAAO,OACPC,OAAQ,QAEVC,WAAY,CACVhB,WAAY,IACZD,SAAU,QAEZkB,gBAAiB,CACfC,YAAa,MACbC,aAAc,OAEhBC,mBAAoB,CAClBrB,SAAU,OACVsB,QAAS,MACTrB,WAAY,KAEdsB,QAAS,CACPhB,QAAS,OACTC,WAAY,UAEdgB,cAAe,CACbT,MAAO,MACPC,OAAQ,MACRN,gBAAiB,UACjBC,aAAc,MACdC,YAAa,OAEfa,YAAa,CACXzB,SAA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4H,EAAS,QAACC,MAAM,CAAA,GAAIM"}
@@ -1 +1 @@
1
- {"version":3,"file":"OffsetWellPickerV5.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV5/OffsetWellPickerV5.js"],"names":[],"mappings":"AA+DO,kDAskCN"}
1
+ {"version":3,"file":"OffsetWellPickerV5.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV5/OffsetWellPickerV5.js"],"names":[],"mappings":"AA+DO,kDAykCN"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as s,useRef as r,useMemo as i,useEffect as c,useCallback as p,useLayoutEffect as l}from"react";import m from"classnames";import{uniqBy as a,uniq as u,sortBy as d,isEmpty as j}from"lodash";import{Replay as f}from"@material-ui/icons";import{Table as C,TableHead as v}from"@material-ui/core";import{useAdvancedWells as A}from"./effects/useAdvancedWells.js";import{useBicWells as h}from"./effects/useBicWells.js";import{useCompanyMetricKey as S}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as g}from"./effects/useFilterOptions.js";import{useFilteredWells as V}from"./effects/useFilteredWells.js";import{useSortedWells as I}from"./effects/useSortedWells.js";import"./effects/useAssetsData.js";import{useTableColumns as b}from"./effects/useTableColumns.js";import{useCompanyProvider as T}from"./effects/useCompanyProvider.js";import{useCompanies as D}from"./effects/useCompanies.js";import{usePinnedWells as x}from"./effects/usePinnedWells.js";import{useSearchedWells as P}from"./effects/useSearchedWells.js";import{useViewportWells as y}from"./effects/useViewportWells/useViewportWells.js";import{useTileLoading as F}from"./effects/useTileLoading.js";import{useInitialBounds as W}from"./effects/useInitialBounds.js";import{useLoadAllWellsCompanySafeguard as w}from"./effects/useLoadAllWellsCompanySafeguard.js";import{useAllWells as B}from"./effects/useAllWells/useAllWells.js";import"./stores/viewport-store/ViewportStoreContext.js";import"./stores/viewport-store/ViewportStoreProvider.js";import"zustand";import"lodash/isEqual";import{useViewportStore as k}from"./stores/viewport-store/useViewportStore.js";import{useFetchSubjectWell as M}from"./effects/useFetchSubjectWell.js";import{AppHeader as L}from"./components/AppHeader/AppHeader.js";import{Filter as O}from"./components/Filter/Filter.js";import"./components/Filter/components/MultiFilterSelect/MultiFilterSelect.js";import"./components/Filter/components/SingleFilterSelect/SingleFilterSelect.js";import"./components/Filter/components/StatusFilterSelect/StatusFilterSelect.js";import"./components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js";import"./components/Filter/components/WellSectionSelect/WellSectionSelect.js";import{WellsMap as E}from"./components/Map/WellsMap.js";import{OffsetWellsTable as H}from"./components/OffsetWellsTable/OffsetWellsTable.js";import{OffsetWellsTableHead as R}from"./components/OffsetWellsTable/OffsetWellsTableHead.js";import{AdvancedSearch as N}from"./components/OffsetWellsTable/AdvancedSearch/AdvancedSearch.js";import{ALL_SECTION_KEY as G,COMPANY_PROVIDERS_FOR_IDAS as q,FilterType as z,ROWS_PER_PAGE as U,RESYNC_STATUS as Z,MAX_OFFSET_SIZE as K,DEFAULT_RADIUS_MILES as _}from"./constants.js";import{SEARCH_CATEGORIES as X}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getCoordinatedWells as J}from"./utils/index.js";import{getIsImperial as Q}from"./utils/getIsImperial.js";import{usePickerPropsStore as Y}from"./stores/picker-props-store/usePickerPropsStore.js";import{useFilterStore as $}from"./stores/filter-store/useFilterStore.js";import{useViewStore as ee}from"./stores/view-store/useViewStore.js";import"./stores/selection-tool-store/SelectionToolStoreContext.js";import"./stores/selection-tool-store/SelectionToolStoreProvider.js";import{useSelectionToolStore as te}from"./stores/selection-tool-store/useSelectionToolStore.js";import{normalizeFilters as oe}from"./stores/filter-store/utils/normalizeFilters.js";import"uuid";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions/constants.js";import"../../clients/subscriptions.v1.js";import"../../clients/subscriptions/subscriptions-client.factory.js";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import{fetchWellsByRigIds as ne}from"./api/wells/fetchWellsByRigIds.js";import"./api/shared/dataFormatter.js";import se from"./OffsetWellPickerV5.module.css.js";import re from"./components/OffsetWellsTable/OffsetWellsTable.module.css.js";import"../../utils/index.js";import{jsx as ie,jsxs as ce}from"react/jsx-runtime";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import"../Notifications/Notifications.scss.js";import{NotificationsContainer as pe}from"../Notifications/NotificationsContainer.js";import le from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@icon-park/react/es/all";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../utils/mobileDetect.js";import"../IconButton/index.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/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../constants/corvaCompanyId.js";import"../GradientManager/configuration/constants.js";import"../Modal/CorvaModal.css.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Cell.js";import"../../componentsV2/Header/Header.scss.js";import{Button as me}from"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as ae}from"../../componentsV2/Tooltip/Tooltip.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/Label/Label.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import{LoaderCircular as ue}from"../../componentsV2/LoaderCircular/LoaderCircular.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/ModalWindow/ModalWindow.js";import{Modal as de}from"../../componentsV2/Modal/Modal.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/utils.js";import"../../componentsV2/Hint/Hint.scss.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/TemplatesControl/TemplatesControl.js";import"../../componentsV2/TemplatesControl/utils.js";import"../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../componentsV2/TemplatesControl/Store/utils.js";import"../../componentsV2/TemplatesControl/types.js";import"../../permissions/PermissionsContext.js";import"../../permissions/constants/index.js";import"../../permissions/withPermissionsHOC.js";import"../../permissions/ProvidePermissions.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/ButtonText/ButtonText.js";import"../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"immutable";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/AppHeader/AppAssets/utils.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../types/shared/Completions.js";import"../PadModeSelect/types.js";import"lodash/flatten";import"lodash/partition";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.js";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.constants.js";import"../../componentsV2/PadModeSelect/WellStreamActivityStatus/WellStreamActivityStatus.scss.js";import"../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../componentsV2/PadModeSelect/PadModeSelect.scss.js";import"querystring";import"uuid/v1";import"jsona";import"../../utils/env.js";import"../StatusBadge/constants.js";import"lodash/isEmpty";import"lodash/sortBy";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import{useGlobalOffsetWellsSync as je}from"../../effects/useGlobalOffsetWellsSync.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../componentsV2/AppContainer/headerCommon.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.js";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../componentsV2/AppSettings/AppSettings.js";import"../../componentsV2/AppSettings/AppSettings.constants.js";import"../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../componentsV2/Autocomplete/Autocomplete.scss.js";import"../../componentsV2/Menu/MenuItem/MenuItem.js";import"../../componentsV2/Autocomplete/AutocompleteListBox.js";import"../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../componentsV2/DatePicker/DatePicker.js";import"../../componentsV2/DragHandle/DragHandle.js";import"../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import fe from"../LoadingIndicator/LoadingIndicator.js";import"../Typography.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"slate";import"../EmptyState/EmptyState.js";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"react-color";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.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"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.js";import"../GradientManager/GradientManager.styles.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"./OffsetWellPickerV5WithStore.js";import"../OffsetWellMap/OffsetWellMap.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.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"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import{showInfoNotification as Ce}from"../../utils/notificationToasts.js";function ve(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function Ae(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?ve(Object(n),!0).forEach((function(o){t(e,o,n[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var he="OffsetWellPickerV5",Se=function(){var ve,Se=Y((function(e){return e.open})),ge=Y((function(e){return e.isWDUser})),Ve=Y((function(e){return e.defaultSubjectWell})),Ie=Y((function(e){return e.currentUser})),be=Y((function(e){return e.offsetSettings})),Te=Y((function(e){return e.isViewOnly})),De=Y((function(e){return e.onClose})),xe=Y((function(e){return e.onSave})),Pe=Y((function(e){return e.maxOffsetSize})),ye=Y((function(e){return e.localMaxOffsetSize})),Fe=Y((function(e){return e.syncAutoEnabled})),We=s(null),we=o(We,2),Be=we[0],ke=we[1],Me=r(null),Le=Math.min(Pe+1,ye+1,K+1),Oe=Math.min(Math.max(Le,ye+1),K+1),Ee=null==Ve?void 0:Ve.asset_id,He=M(Ee),Re=o(He,1)[0],Ne=i((function(){var e,t=null==Re||null===(e=Re.topHole)||void 0===e?void 0:e.coordinates;if(!t)return null;var n=o(t,2);return{latitude:n[0],longitude:n[1]}}),[Re]);je(be,xe,Oe);var Ge=ee((function(e){return e.isFilterExpanded})),qe=ee((function(e){return e.isMapHidden})),ze=ee((function(e){return e.isHScrollMoved})),Ue=ee((function(e){return e.setIsHScrollMoved})),Ze=ee((function(e){return e.isVScrollMoved})),Ke=ee((function(e){return e.setIsVScrollMoved})),_e=ee((function(e){return e.isAdvancedSearchHidden})),Xe=ee((function(e){return e.setIsAdvancedSearchHidden})),Je=Y((function(e){return e.isLoadAllWells})),Qe=Y((function(e){return e.resetIsLoadAllWells})),Ye=Y((function(e){return e.shouldRecenter})),$e=Y((function(e){return e.setShouldRecenter})),et=+(null==Ve?void 0:Ve.companyId)||+(null==Ie?void 0:Ie.company_id),tt=Ee>0,ot=$((function(e){return e.filters})),nt=$((function(e){return e.setFilters})),st=$((function(e){return e.resetFilters})),rt=te((function(e){return e.reset})),it=k((function(e){return e.wells})),ct=k((function(e){return e.bounds})),pt=D({open:Se}),lt=pt.canViewCompanies,mt=pt.canViewCompaniesLoading,at=pt.companies,ut=s([]),dt=o(ut,2),jt=dt[0],ft=dt[1],Ct=s((function(){var e;return null!==(e=null==be?void 0:be.lastSelectionZone)&&void 0!==e?e:null})),vt=o(Ct,2),At=vt[0],ht=vt[1],St=r(new Set),gt=s([]),Vt=o(gt,2),It=Vt[0],bt=Vt[1],Tt=s(!1),Dt=o(Tt,2),xt=Dt[0],Pt=Dt[1];y(!Je);var yt=w({companies:at,canViewCompanies:lt,canViewCompaniesLoading:mt}).isSafeguardReady;B(Je,yt),W({subjectWellCoords:Ne,hasSubjectWell:null!=Ee,open:Se,ghostZone:At});var Ft=F(),Wt=s((null==be?void 0:be.wellSection)||G),wt=o(Wt,2),Bt=wt[0],kt=wt[1],Mt=r(!0),Lt=s(!0),Ot=o(Lt,2),Et=Ot[0],Ht=Ot[1],Rt=Oe<=(null==jt?void 0:jt.length),Nt=r(),Gt=s(!0),qt=o(Gt,2),zt=qt[0],Ut=qt[1];c((function(){if(Se&&Rt&&Ce("App can’t process more than (".concat(Oe-1,") Offset Wells.")),!Se){var e,t,o=new Set(Nt.current||[]);(null==be||null===(e=be.selectedWellIds)||void 0===e?void 0:e.length)===(null===(t=Nt.current)||void 0===t?void 0:t.length)&&((null==be?void 0:be.selectedWellIds)||[]).every((function(e){return o.has(e)}))||(Mt.current=!0),Nt.current=null==be?void 0:be.selectedWellIds}}),[Rt,Se,be,Oe]);var Zt=i((function(){return Array.from(it.values())}),[it]),Kt=Ft||0===Zt.length&&null===ct,_t=x(null==be?void 0:be.selectedWellIds),Xt=o(_t,2),Jt=Xt[0],Qt=Xt[1],Yt=P(),$t=o(Yt,3),eo=$t[0],to=$t[1],oo=$t[2],no=i((function(){if(!Zt)return null;var e=Zt;if(null!=Jt&&Jt.length){var t=new Set(e.map((function(e){return e.id}))),o=Jt.filter((function(e){return!t.has(e.id)}));o.length>0&&(e=e.concat(o))}if(null!=eo&&eo.length){var n=new Set(e.map((function(e){return e.id}))),s=eo.filter((function(e){return!n.has(e.id)}));s.length>0&&(e=e.concat(s))}return Re&&!e.some((function(e){return e.id===Re.id}))&&(e=[Re].concat(e)),e}),[Zt,Re,Jt,eo]),so=T(et),ro=o(so,1)[0],io=h(Ee,no),co=o(io,8),po=co[0],lo=co[1],mo=co[2],ao=co[3],uo=co[4],jo=co[5],fo=co[6],Co=co[7],vo=i((function(){return!!po&&po.some((function(e){return e.value!==G}))}),[po]);c((function(){Ut(!0),lo(null),ao(null)}),[ao,lo,Ee]);var Ao=S(et,null==be?void 0:be.metricsKeys),ho=o(Ao,2),So=ho[0],go=ho[1],Vo=A(no,po,mo,Ee,So,Se),Io=o(Vo,4),bo=Io[0],To=Io[1],Do=Io[2],xo=Io[3],Po=bo||Do,yo=i((function(){if(!Po||null==at||!at.length)return Po;var e={};return at.forEach((function(t){e[t.id]=t.name})),Po.map((function(t){return Ae(Ae({},t),{},{companyName:e[t.companyId]||"Null"})}))}),[Po,at]),Fo=i((function(){return Re?yo&&yo.find((function(e){return e.id===Re.id}))||Re:null}),[Re,yo]),Wo=!(Kt||To||Qt||to);c((function(){if(Wo){var t,o=(t=e(n.mark((function e(){var t,o,s,r,i,c,p,l,m,a,u,d;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=void 0===(null==be?void 0:be.isSynced)||(null==be?void 0:be.isSynced),o=!0,!t){e.next=20;break}if(r=mo[G]||[],i=new Set(r),c=((null==be?void 0:be.selectedWellIds)||[]).every((function(e){return i.has(e)})),r.length===(null==be||null===(s=be.selectedWellIds)||void 0===s?void 0:s.length)&&c){e.next=17;break}return e.next=9,J(r,Ee);case 9:p=e.sent,l=p.slice(0,ye+1).map((function(e){return e.id})),m=Ae(Ae({},be),{},{subjectWellId:Ee,selectedWellIds:l,offsetWellsLimited:Oe<=l.length}),a=new Set(l),u=p.filter((function(e){return a.has(e.id)})),xe(m,u),e.next=18;break;case 17:o=!1;case 18:e.next=21;break;case 20:o=!1;case 21:if(o){e.next=26;break}return e.next=24,J((null==be?void 0:be.selectedWellIds)||[],Ee);case 24:d=e.sent,xe(be,d);case 26:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)});Fe&&zt&&be&&mo&&(o(),Ut(!1))}}),[be,mo,Ee,Oe,Fe,Wo,zt,Le,ye,xe]);var wo=g(yo,at,lt),Bo=b(So,lt,vo),ko=V(yo,ot),Mo=i((function(){return yo?a(yo,"id").length:0}),[yo]),Lo=i((function(){if(!ko)return ko;var e=new Map((null==yo?void 0:yo.map((function(e){return[e.id,e]})))||[]),t=jt.map((function(t){return e.get(t.id)||t})),o=((null==Co?void 0:Co[Bt])||[]).map((function(t){return e.get(t)})).filter((function(e){return void 0!==e}));return a(t.concat(o).concat(ko),"id")}),[yo,ko,jt,Co,Bt]);c((function(){if(ko&&Wo&&Mt.current){var e=new Set((null==be?void 0:be.selectedWellIds)||[]),t=yo.filter((function(t){return e.has(t.id)})),o=new Set(t.map((function(e){return e.id}))),n=jt.filter((function(t){return e.has(t.id)&&!o.has(t.id)}));t=t.concat(n),Fo&&(t=t.concat(Fo)),ft(a(t,"id")),Mt.current=!1}}),[yo,ko,null==be?void 0:be.selectedWellIds,Wo,Fo,jt]),c((function(){if(null!=yo&&yo.length&&0!==St.current.size){var e=St.current,t=yo.filter((function(t){return e.has(t.id)}));if(t.length>0){var o=t.map((function(e){return e.id}));bt((function(e){return e.filter((function(e){return!o.includes(e)}))})),ht(null),ft((function(e){var o=t.slice(0,Math.max(0,Oe-e.length));return a(e.concat(o),"id")})),t.forEach((function(t){return e.delete(t.id)}))}}}),[yo,Oe]);var Oo,Eo,Ho,Ro=I(Fo,Lo,jt,Ht,null==be?void 0:be.selectedWellIds),No=o(Ro,5),Go=No[0],qo=No[1],zo=No[2],Uo=No[3],Zo=No[4],Ko=p((Oo=e(n.mark((function e(t,o,s,r){var i,c,p,l,m,d,j;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ht(null),s!==X.well.name){e.next=5;break}i=o,e.next=22;break;case 5:if(r&&0!==r.length){e.next=7;break}return e.abrupt("return");case 7:return Ht(!0),e.prev=8,e.next=11,ne(r,null);case 11:c=e.sent,i=c.map((function(e){return e.id})),e.next=19;break;case 15:return e.prev=15,e.t0=e.catch(8),console.error("Failed to fetch wells for rigs:",e.t0),e.abrupt("return");case 19:return e.prev=19,Ht(!1),e.finish(19);case 22:if(p=new Set(i),l=yo.filter((function(e){var t=e.id;return p.has(t)})),!(t&&l.length<i.length)){e.next=32;break}if(m=new Set(l.map((function(e){return e.id}))),!((d=i.filter((function(e){return!m.has(e)}))).length>0)){e.next=32;break}return bt((function(e){return e.concat(d)})),e.next=31,oo(d);case 31:d.forEach((function(e){return St.current.add(e)}));case 32:t?(j=l.slice(0,Math.min(l.length,Oe-jt.length))).length>0&&ft((function(e){return a(e.concat(j),"id")})):ft((function(e){return u(e.filter((function(e){var t=e.id;return!l.find((function(e){return e.id===t}))})))}));case 33:case"end":return e.stop()}}),e,null,[[8,15,19,22]])}))),function(e,t,o,n){return Oo.apply(this,arguments)}),[yo,Oe,jt.length,oo,Ht]),_o=p((function(){Xe(!0)}),[Xe]),Xo=p((function(e){go(e)}),[go]),Jo=p((function(e,t){go((function(o){return o.map((function(o){return o===e?t:o}))}))}),[go]),Qo=p((function(e,t){qo(e),Uo(t)}),[qo,Uo]),Yo=p((function(e,t){ht(null),ft(t?function(t){if(t.length>=Oe)return t;var o=(null==yo?void 0:yo.find((function(t){return t.id===e.id})))||e;return t.concat(o)}:function(t){return t.filter((function(t){return t.id!==e.id}))})}),[yo,Oe]),$o=p((function(e){if(ht(null),e){var t=Fo?ko.concat(Fo):ko,o=d(a(t,"id"),"distance");ft(o.slice(0,Oe))}else ft(Fo?[Fo]:[])}),[ko,Fo,Oe]),en=p((function(e,t){ft((function(o){var n=new Set(o.map((function(e){return e.id}))),s=e.filter((function(e){return!n.has(e.id)})),r=s.length;if(0===r)return setTimeout((function(){return null==t?void 0:t({attempted:0,added:0})}),0),o;var i=Oe-o.length,c=s.slice(0,i),p=c.length,l=c.map((function(e){return(null==yo?void 0:yo.find((function(t){return t.id===e.id})))||e}));return setTimeout((function(){return null==t?void 0:t({attempted:r,added:p})}),0),a(o.concat(l),"id")}))}),[yo,Oe]),tn=p((function(e){ht(e)}),[]),on=p((Eo=e(n.mark((function e(t){var o,s,r,i,c,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Co){e.next=15;break}if(o=Co[t]||[],s=new Map((null==no?void 0:no.map((function(e){return[e.id,e]})))||[]),r=o.filter((function(e){return!s.has(e)})),i=[],!(r.length>0)){e.next=9;break}return e.next=8,oo(r);case 8:i=e.sent;case 9:i.forEach((function(e){return s.set(e.id,e)})),c=o.map((function(e){return s.get(e)})).filter((function(e){return void 0!==e})),p=d(c,"distance"),ft(p.slice(0,Le)),e.next=16;break;case 15:ft(Fo?[Fo]:[]);case 16:case"end":return e.stop()}}),e)}))),function(e){return Eo.apply(this,arguments)}),[Co,no,oo,Le,Fo]),nn=p((Ho=e(n.mark((function e(t){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return kt(t),e.next=3,on(t);case 3:case"end":return e.stop()}}),e)}))),function(e){return Ho.apply(this,arguments)}),[on]),sn=i((function(){return jt.find((function(e){return e.id===Ee}))?jt.length-1:jt.length}),[jt,Ee]),rn=i((function(){if(!mo)return!1;var e=jt.map((function(e){return e.id})),t=mo[Bt]||[];if(Math.min(t.length,Le)!==e.length)return!1;var o=new Set(t);return e.every((function(e){return o.has(e)}))}),[mo,jt,Bt,Le]),cn=i((function(){return!!ro&&q.includes(ro)}),[ro]),pn=i((function(){return cn?"IDAS generated offsets.":ge?"Offset Selection App.":"WellHub."}),[cn,ge]),ln=p((function(){De();var e=jt.map((function(e){return e.id})),t=Ae(Ae({},be),{},{companyId:et,subjectWellId:Ee,selectedWellIds:e,filters:oe(ot),metricsKeys:So,wellSection:Bt,isSynced:rn,mapHidden:qe,filterExpanded:Ge,offsetWellsLimited:Rt,lastSelectionZone:At,isLoadAllWells:Je});xe(t,jt)}),[De,jt,be,et,Ee,ot,So,Bt,rn,qe,Ge,Rt,At,Je,xe]);c((function(){xt&&0===St.current.size&&(Pt(!1),ln())}),[xt,jt,ln]);var mn=function(){var e,t,o=new Set((null==be?void 0:be.selectedWellIds)||[]),n=(yo||[]).filter((function(e){return o.has(e.id)}));if(null!=Jt&&Jt.length){var s=new Set(n.map((function(e){return e.id}))),r=Jt.filter((function(e){return o.has(e.id)&&!s.has(e.id)}));n=n.concat(r)}Fo&&(n=n.concat(Fo)),ft(a(n,"id")),ht(null!==(e=null==be?void 0:be.lastSelectionZone)&&void 0!==e?e:null);var i=Ae(Ae({},be),{},{mapHidden:qe,filterExpanded:Ge});xe(i);var c=oe(null==be?void 0:be.filters);nt(Ae(Ae({},c),{},{radius:null!==(t=null==c?void 0:c.radius)&&void 0!==t?t:_})),kt((null==be?void 0:be.wellSection)||G),Qe(),De()},an=Et||Kt,un=i((function(){return!!tt&&(!an&&(!rn||(!(j(ot)||!ot[z.sideTracks])||Bt!==G)))}),[tt,rn,ot,Bt,an]),dn=p(e(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return st(),rt(),ht(null),kt(G),e.next=6,on(G);case 6:case"end":return e.stop()}}),e)}))),[st,rt,on]),jn=!yo||!po||!Zo,fn=s(U),Cn=o(fn,2),vn=Cn[0],An=Cn[1],hn=s([]),Sn=o(hn,2),gn=Sn[0],Vn=Sn[1],In=r(),bn=r(),Tn=r(0),Dn=r(!1);c((function(){if(Zo){var e=Zo.slice(0,vn);Vn(e)}}),[Zo,vn,Fo]),l((function(){Dn.current||bn.current&&Tn.current>0&&(bn.current.scrollTop=Tn.current)}),[gn]),c((function(){if(In.current){var e=In.current.querySelector(".".concat(re.wellNameFixed));e&&(ze?e.classList.remove(re.noShadow):e.classList.add(re.noShadow))}}),[ze,gn]);var xn=i((function(){return a(gn,"id")}),[gn]),Pn=i((function(){var e=xn.filter((function(e){return e.checked}));return[e,xn.length!==e.length&&Boolean(e.length)&&!Rt,e.length===xn.length||Rt]}),[xn,Rt]),yn=o(Pn,3),Fn=yn[0],Wn=yn[1],wn=yn[2],Bn=i((function(){return Q()}),[]);c((function(){uo===Z.SUCCEEDED&&dn()}),[mo,dn,uo]);return ie(de,{open:Se,onClose:mn,size:"fullscreen",className:se.modalDialog,title:ie(L,{totalCount:Mo,filteredCount:null!==(ve=null==ko?void 0:ko.length)&&void 0!==ve?ve:0,selectedCount:sn,maxOffsetWellNumber:Oe,isXtoProvider:cn,resyncStatus:uo,setResyncStatus:jo,metricsKeys:So,onChangeMetricsKeys:Xo}),actions:!Te&&ce("div",{className:se.actionsWrapper,children:[!jn&&un?ie(ae,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(ge?"Offset App":"Wellhub"),children:ie("div",{children:ie(me,{"data-testid":"".concat(he,"_reset"),onClick:dn,color:"primary",startIcon:ie(f,{}),children:"Reset to Defaults"})})}):tt&&ce("div",{children:[ie("span",{className:m(le.regular12,le.colors.t6),children:"The offset list is being automatically populated by "}),ie("span",{className:m(le.medium12,le.colors.t6),children:pn})]}),ce("div",{className:se.buttonGap,children:[ie(me,{"data-testid":"".concat(he,"_cancel"),onClick:mn,color:"primary",children:"Cancel"}),ce(me,{"data-testid":"".concat(he,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){St.current.size>0?Pt(!0):ln()},disabled:xt,prefix:xt?ie(ue,{size:16}):void 0,children:["Select (",sn,")"]})]})]}),children:ce("div",{className:m(se.offsetWellDialog),children:[ie(pe,{}),jn?ie(fe,{}):ce("div",{className:m(se.contentWrapper,t({},se.contentBlocked,an)),children:[ce("div",{className:se.columnsContainer,children:[!qe&&Se&&ie("div",{className:se.leftColumn,children:ie(E,{ref:Me,mapHidden:qe,subjectWell:Fo,offsetWellIds:jt.map((function(e){return e.id})),wells:Lo,handleChangeOffsetWell:Yo,onBatchSelectWells:en,activeWellId:Be,selectionZone:At,onSelectionZoneConfirm:tn,shouldRecenter:Ye,onRecenterComplete:function(){return $e(!1)}})}),ce("div",{className:se.rightColumn,ref:bn,onScroll:function(e){e.target&&(Tn.current=e.target.scrollTop,_e&&(e.target.scrollLeft=0,Xe(!1)),e.target.scrollLeft<=5&&ze&&Ue(!1),e.target.scrollLeft>5&&!ze&&Ue(!0),e.target.scrollTop<=0&&Ze&&Ke(!1),e.target.scrollTop>0&&!Ze&&Ke(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&vn<Zo.length&&An((function(e){return e+U})))},children:[ie(O,{isHidden:!Ge,filterOptions:wo,wellSections:po,selectedWellSection:Bt,onChangeBicWells:nn,isSafeguardReady:yt}),ie("div",{className:re.stickyTableWrapper,children:ce(C,{"aria-label":"ows table head",innerRef:In,className:re.stickyTable,children:[ie(v,{children:ie(R,{columnsWithDict:Bo,metricsKeys:So,sortBy:Go,sortDirection:zo,indeterminate:Wn,isAllWellsSelected:wn,onChangeSort:Qo,onUpdateMetricsKey:Jo,handleChangeAllOffsetWells:$o,wellNameStyle:re.wellNameFixed,isImperial:Bn,isTaColumnVisible:!!fo.length,isWellSectionColumnVisible:vo})}),Te&&ie("div",{className:m(se.topGradient,t({},se.topGradientScrolled,Ze))})]})}),!Te&&ce("div",{className:m(re.searchCellWrapper),children:[ie("div",{className:re.searchCell,children:ie(N,{companyIds:null,subjectWellId:Ee,onChange:Ko,selectedWellIds:Fn.map((function(e){return e.id})),onHideAdvancedSearch:_o,loadingAssetIds:It})}),ie("div",{className:m(se.topGradient,t({},se.topGradientScrolled,Ze))})]}),ie(H,{isTableLoading:an,subjectWellId:Ee,columnsWithDict:Bo,wells:gn,metricsKeys:So,handleChangeOffsetWell:Yo,isLastWell:Zo.length<=vn,isLimitedOffsetWells:Rt,maxOffsetWellNumber:Oe,wellSections:po,setActiveWellId:ke,onRowClick:function(e){var t;return null===(t=Me.current)||void 0===t?void 0:t.flyToWell(e)},taScores:fo,isWellSectionColumnVisible:vo,loadingWellIds:xo,scrollContainerRef:bn,isAnimatingRef:Dn})]})]}),Te&&tt&&ce("div",{className:se.viewOnlyInfoContainer,children:[ie("span",{className:m(le.regular12,le.colors.t6),children:"The offset list is being automatically populated by "}),ie("span",{className:m(le.medium12,le.colors.t6),children:pn})]})]})]})})};export{Se as OffsetWellPickerV5};
1
+ import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as s,useRef as r,useMemo as i,useEffect as c,useCallback as p,useLayoutEffect as l}from"react";import m from"classnames";import{uniqBy as a,uniq as u,sortBy as d,isEmpty as j}from"lodash";import{Replay as f}from"@material-ui/icons";import{Table as C,TableHead as v}from"@material-ui/core";import{useAdvancedWells as A}from"./effects/useAdvancedWells.js";import{useBicWells as h}from"./effects/useBicWells.js";import{useCompanyMetricKey as S}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as g}from"./effects/useFilterOptions.js";import{useFilteredWells as V}from"./effects/useFilteredWells.js";import{useSortedWells as I}from"./effects/useSortedWells.js";import"./effects/useAssetsData.js";import{useTableColumns as b}from"./effects/useTableColumns.js";import{useCompanyProvider as T}from"./effects/useCompanyProvider.js";import{useCompanies as D}from"./effects/useCompanies.js";import{usePinnedWells as x}from"./effects/usePinnedWells.js";import{useSearchedWells as P}from"./effects/useSearchedWells.js";import{useViewportWells as y}from"./effects/useViewportWells/useViewportWells.js";import{useTileLoading as F}from"./effects/useTileLoading.js";import{useInitialBounds as W}from"./effects/useInitialBounds.js";import{useLoadAllWellsCompanySafeguard as w}from"./effects/useLoadAllWellsCompanySafeguard.js";import{useAllWells as B}from"./effects/useAllWells/useAllWells.js";import"./stores/viewport-store/ViewportStoreContext.js";import"./stores/viewport-store/ViewportStoreProvider.js";import"zustand";import"lodash/isEqual";import{useViewportStore as k}from"./stores/viewport-store/useViewportStore.js";import{useFetchSubjectWell as M}from"./effects/useFetchSubjectWell.js";import{AppHeader as L}from"./components/AppHeader/AppHeader.js";import{Filter as O}from"./components/Filter/Filter.js";import"./components/Filter/components/MultiFilterSelect/MultiFilterSelect.js";import"./components/Filter/components/SingleFilterSelect/SingleFilterSelect.js";import"./components/Filter/components/StatusFilterSelect/StatusFilterSelect.js";import"./components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js";import"./components/Filter/components/WellSectionSelect/WellSectionSelect.js";import{WellsMap as E}from"./components/Map/WellsMap.js";import{OffsetWellsTable as H}from"./components/OffsetWellsTable/OffsetWellsTable.js";import{OffsetWellsTableHead as R}from"./components/OffsetWellsTable/OffsetWellsTableHead.js";import{AdvancedSearch as N}from"./components/OffsetWellsTable/AdvancedSearch/AdvancedSearch.js";import{ALL_SECTION_KEY as G,COMPANY_PROVIDERS_FOR_IDAS as q,FilterType as z,ROWS_PER_PAGE as U,RESYNC_STATUS as Z,MAX_OFFSET_SIZE as K,DEFAULT_RADIUS_MILES as _}from"./constants.js";import{SEARCH_CATEGORIES as X}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getCoordinatedWells as J}from"./utils/index.js";import{getIsImperial as Q}from"./utils/getIsImperial.js";import{usePickerPropsStore as Y}from"./stores/picker-props-store/usePickerPropsStore.js";import{useFilterStore as $}from"./stores/filter-store/useFilterStore.js";import{useViewStore as ee}from"./stores/view-store/useViewStore.js";import"./stores/selection-tool-store/SelectionToolStoreContext.js";import"./stores/selection-tool-store/SelectionToolStoreProvider.js";import{useSelectionToolStore as te}from"./stores/selection-tool-store/useSelectionToolStore.js";import{normalizeFilters as oe}from"./stores/filter-store/utils/normalizeFilters.js";import"uuid";import"@babel/runtime/helpers/toConsumableArray";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions/constants.js";import"../../clients/subscriptions.v1.js";import"../../clients/subscriptions/subscriptions-client.factory.js";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import{fetchWellsByRigIds as ne}from"./api/wells/fetchWellsByRigIds.js";import"./api/shared/dataFormatter.js";import se from"./OffsetWellPickerV5.module.css.js";import re from"./components/OffsetWellsTable/OffsetWellsTable.module.css.js";import"../../utils/index.js";import{jsx as ie,jsxs as ce}from"react/jsx-runtime";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import"../Notifications/Notifications.scss.js";import{NotificationsContainer as pe}from"../Notifications/NotificationsContainer.js";import le from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@icon-park/react/es/all";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../utils/mobileDetect.js";import"../IconButton/index.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/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../constants/corvaCompanyId.js";import"../GradientManager/configuration/constants.js";import"../Modal/CorvaModal.css.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Cell.js";import"../../componentsV2/Header/Header.scss.js";import{Button as me}from"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as ae}from"../../componentsV2/Tooltip/Tooltip.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/Label/Label.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import{LoaderCircular as ue}from"../../componentsV2/LoaderCircular/LoaderCircular.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/ModalWindow/ModalWindow.js";import{Modal as de}from"../../componentsV2/Modal/Modal.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/utils.js";import"../../componentsV2/Hint/Hint.scss.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/TemplatesControl/TemplatesControl.js";import"../../componentsV2/TemplatesControl/utils.js";import"../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../componentsV2/TemplatesControl/Store/utils.js";import"../../componentsV2/TemplatesControl/types.js";import"../../permissions/PermissionsContext.js";import"../../permissions/constants/index.js";import"../../permissions/withPermissionsHOC.js";import"../../permissions/ProvidePermissions.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/ButtonText/ButtonText.js";import"../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"immutable";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/AppHeader/AppAssets/utils.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../types/shared/Completions.js";import"../PadModeSelect/types.js";import"lodash/flatten";import"lodash/partition";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.js";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.constants.js";import"../../componentsV2/PadModeSelect/WellStreamActivityStatus/WellStreamActivityStatus.scss.js";import"../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../componentsV2/PadModeSelect/PadModeSelect.scss.js";import"querystring";import"uuid/v1";import"jsona";import"../../utils/env.js";import"../StatusBadge/constants.js";import"lodash/isEmpty";import"lodash/sortBy";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import{useGlobalOffsetWellsSync as je}from"../../effects/useGlobalOffsetWellsSync.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../componentsV2/AppContainer/headerCommon.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.js";import"../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../componentsV2/AppSettings/AppSettings.js";import"../../componentsV2/AppSettings/AppSettings.constants.js";import"../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../componentsV2/Autocomplete/Autocomplete.scss.js";import"../../componentsV2/Menu/MenuItem/MenuItem.js";import"../../componentsV2/Autocomplete/AutocompleteListBox.js";import"../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../componentsV2/DatePicker/DatePicker.js";import"../../componentsV2/DragHandle/DragHandle.js";import"../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import fe from"../LoadingIndicator/LoadingIndicator.js";import"../Typography.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"slate";import"../EmptyState/EmptyState.js";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"react-color";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.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"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.js";import"../GradientManager/GradientManager.styles.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"./OffsetWellPickerV5WithStore.js";import"../OffsetWellMap/OffsetWellMap.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.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"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import{showInfoNotification as Ce}from"../../utils/notificationToasts.js";function ve(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function Ae(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?ve(Object(n),!0).forEach((function(o){t(e,o,n[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var he="OffsetWellPickerV5",Se=function(){var ve,Se=Y((function(e){return e.open})),ge=Y((function(e){return e.isWDUser})),Ve=Y((function(e){return e.defaultSubjectWell})),Ie=Y((function(e){return e.currentUser})),be=Y((function(e){return e.offsetSettings})),Te=Y((function(e){return e.isViewOnly})),De=Y((function(e){return e.onClose})),xe=Y((function(e){return e.onSave})),Pe=Y((function(e){return e.maxOffsetSize})),ye=Y((function(e){return e.localMaxOffsetSize})),Fe=Y((function(e){return e.syncAutoEnabled})),We=s(null),we=o(We,2),Be=we[0],ke=we[1],Me=r(null),Le=Math.min(Pe+1,ye+1,K+1),Oe=Math.min(Math.max(Le,ye+1),K+1),Ee=null==Ve?void 0:Ve.asset_id,He=M(Ee),Re=o(He,1)[0],Ne=i((function(){var e,t=null==Re||null===(e=Re.topHole)||void 0===e?void 0:e.coordinates;if(!t)return null;var n=o(t,2);return{latitude:n[0],longitude:n[1]}}),[Re]);je(be,xe,Oe);var Ge=ee((function(e){return e.isFilterExpanded})),qe=ee((function(e){return e.isMapHidden})),ze=ee((function(e){return e.isHScrollMoved})),Ue=ee((function(e){return e.setIsHScrollMoved})),Ze=ee((function(e){return e.isVScrollMoved})),Ke=ee((function(e){return e.setIsVScrollMoved})),_e=ee((function(e){return e.isAdvancedSearchHidden})),Xe=ee((function(e){return e.setIsAdvancedSearchHidden})),Je=Y((function(e){return e.isLoadAllWells})),Qe=Y((function(e){return e.resetIsLoadAllWells})),Ye=Y((function(e){return e.shouldRecenter})),$e=Y((function(e){return e.setShouldRecenter})),et=+(null==Ve?void 0:Ve.companyId)||+(null==Ie?void 0:Ie.company_id),tt=Ee>0,ot=$((function(e){return e.filters})),nt=$((function(e){return e.setFilters})),st=$((function(e){return e.resetFilters})),rt=te((function(e){return e.reset})),it=k((function(e){return e.wells})),ct=k((function(e){return e.bounds})),pt=D({open:Se}),lt=pt.canViewCompanies,mt=pt.canViewCompaniesLoading,at=pt.companies,ut=s([]),dt=o(ut,2),jt=dt[0],ft=dt[1],Ct=s((function(){var e;return null!==(e=null==be?void 0:be.lastSelectionZone)&&void 0!==e?e:null})),vt=o(Ct,2),At=vt[0],ht=vt[1],St=r(new Set),gt=s([]),Vt=o(gt,2),It=Vt[0],bt=Vt[1],Tt=s(!1),Dt=o(Tt,2),xt=Dt[0],Pt=Dt[1];y(!Je);var yt=w({companies:at,canViewCompanies:lt,canViewCompaniesLoading:mt}),Ft=yt.isSafeguardReady,Wt=yt.resetSafeguard;B(Je,Ft),W({subjectWellCoords:Ne,hasSubjectWell:null!=Ee,open:Se,ghostZone:At});var wt=F(),Bt=s((null==be?void 0:be.wellSection)||G),kt=o(Bt,2),Mt=kt[0],Lt=kt[1],Ot=r(!0),Et=s(!0),Ht=o(Et,2),Rt=Ht[0],Nt=Ht[1],Gt=Oe<=(null==jt?void 0:jt.length),qt=r(),zt=s(!0),Ut=o(zt,2),Zt=Ut[0],Kt=Ut[1];c((function(){if(Se&&Gt&&Ce("App can’t process more than (".concat(Oe-1,") Offset Wells.")),!Se){var e,t,o=new Set(qt.current||[]);(null==be||null===(e=be.selectedWellIds)||void 0===e?void 0:e.length)===(null===(t=qt.current)||void 0===t?void 0:t.length)&&((null==be?void 0:be.selectedWellIds)||[]).every((function(e){return o.has(e)}))||(Ot.current=!0),qt.current=null==be?void 0:be.selectedWellIds}}),[Gt,Se,be,Oe]);var _t=i((function(){return Array.from(it.values())}),[it]),Xt=wt||0===_t.length&&null===ct,Jt=x(null==be?void 0:be.selectedWellIds),Qt=o(Jt,2),Yt=Qt[0],$t=Qt[1],eo=P(),to=o(eo,3),oo=to[0],no=to[1],so=to[2],ro=i((function(){if(!_t)return null;var e=_t;if(null!=Yt&&Yt.length){var t=new Set(e.map((function(e){return e.id}))),o=Yt.filter((function(e){return!t.has(e.id)}));o.length>0&&(e=e.concat(o))}if(null!=oo&&oo.length){var n=new Set(e.map((function(e){return e.id}))),s=oo.filter((function(e){return!n.has(e.id)}));s.length>0&&(e=e.concat(s))}return Re&&!e.some((function(e){return e.id===Re.id}))&&(e=[Re].concat(e)),e}),[_t,Re,Yt,oo]),io=T(et),co=o(io,1)[0],po=h(Ee,ro),lo=o(po,8),mo=lo[0],ao=lo[1],uo=lo[2],jo=lo[3],fo=lo[4],Co=lo[5],vo=lo[6],Ao=lo[7],ho=i((function(){return!!mo&&mo.some((function(e){return e.value!==G}))}),[mo]);c((function(){Kt(!0),ao(null),jo(null)}),[jo,ao,Ee]);var So=S(et,null==be?void 0:be.metricsKeys),go=o(So,2),Vo=go[0],Io=go[1],bo=A(ro,mo,uo,Ee,Vo,Se),To=o(bo,4),Do=To[0],xo=To[1],Po=To[2],yo=To[3],Fo=Do||Po,Wo=i((function(){if(!Fo||null==at||!at.length)return Fo;var e={};return at.forEach((function(t){e[t.id]=t.name})),Fo.map((function(t){return Ae(Ae({},t),{},{companyName:e[t.companyId]||"Null"})}))}),[Fo,at]),wo=i((function(){return Re?Wo&&Wo.find((function(e){return e.id===Re.id}))||Re:null}),[Re,Wo]),Bo=!(Xt||xo||$t||no);c((function(){if(Bo){var t,o=(t=e(n.mark((function e(){var t,o,s,r,i,c,p,l,m,a,u,d;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=void 0===(null==be?void 0:be.isSynced)||(null==be?void 0:be.isSynced),o=!0,!t){e.next=20;break}if(r=uo[G]||[],i=new Set(r),c=((null==be?void 0:be.selectedWellIds)||[]).every((function(e){return i.has(e)})),r.length===(null==be||null===(s=be.selectedWellIds)||void 0===s?void 0:s.length)&&c){e.next=17;break}return e.next=9,J(r,Ee);case 9:p=e.sent,l=p.slice(0,ye+1).map((function(e){return e.id})),m=Ae(Ae({},be),{},{subjectWellId:Ee,selectedWellIds:l,offsetWellsLimited:Oe<=l.length}),a=new Set(l),u=p.filter((function(e){return a.has(e.id)})),xe(m,u),e.next=18;break;case 17:o=!1;case 18:e.next=21;break;case 20:o=!1;case 21:if(o){e.next=26;break}return e.next=24,J((null==be?void 0:be.selectedWellIds)||[],Ee);case 24:d=e.sent,xe(be,d);case 26:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)});Fe&&Zt&&be&&uo&&(o(),Kt(!1))}}),[be,uo,Ee,Oe,Fe,Bo,Zt,Le,ye,xe]);var ko=g(Wo,at,lt),Mo=b(Vo,lt,ho),Lo=V(Wo,ot),Oo=i((function(){return Wo?a(Wo,"id").length:0}),[Wo]),Eo=i((function(){if(!Lo)return Lo;var e=new Map((null==Wo?void 0:Wo.map((function(e){return[e.id,e]})))||[]),t=jt.map((function(t){return e.get(t.id)||t})),o=((null==Ao?void 0:Ao[Mt])||[]).map((function(t){return e.get(t)})).filter((function(e){return void 0!==e}));return a(t.concat(o).concat(Lo),"id")}),[Wo,Lo,jt,Ao,Mt]);c((function(){if(Lo&&Bo&&Ot.current){var e=new Set((null==be?void 0:be.selectedWellIds)||[]),t=Wo.filter((function(t){return e.has(t.id)})),o=new Set(t.map((function(e){return e.id}))),n=jt.filter((function(t){return e.has(t.id)&&!o.has(t.id)}));t=t.concat(n),wo&&(t=t.concat(wo)),ft(a(t,"id")),Ot.current=!1}}),[Wo,Lo,null==be?void 0:be.selectedWellIds,Bo,wo,jt]),c((function(){if(null!=Wo&&Wo.length&&0!==St.current.size){var e=St.current,t=Wo.filter((function(t){return e.has(t.id)}));if(t.length>0){var o=t.map((function(e){return e.id}));bt((function(e){return e.filter((function(e){return!o.includes(e)}))})),ht(null),ft((function(e){var o=t.slice(0,Math.max(0,Oe-e.length));return a(e.concat(o),"id")})),t.forEach((function(t){return e.delete(t.id)}))}}}),[Wo,Oe]);var Ho,Ro,No,Go=I(wo,Eo,jt,Nt,null==be?void 0:be.selectedWellIds),qo=o(Go,5),zo=qo[0],Uo=qo[1],Zo=qo[2],Ko=qo[3],_o=qo[4],Xo=p((Ho=e(n.mark((function e(t,o,s,r){var i,c,p,l,m,d,j;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ht(null),s!==X.well.name){e.next=5;break}i=o,e.next=22;break;case 5:if(r&&0!==r.length){e.next=7;break}return e.abrupt("return");case 7:return Nt(!0),e.prev=8,e.next=11,ne(r,null);case 11:c=e.sent,i=c.map((function(e){return e.id})),e.next=19;break;case 15:return e.prev=15,e.t0=e.catch(8),console.error("Failed to fetch wells for rigs:",e.t0),e.abrupt("return");case 19:return e.prev=19,Nt(!1),e.finish(19);case 22:if(p=new Set(i),l=Wo.filter((function(e){var t=e.id;return p.has(t)})),!(t&&l.length<i.length)){e.next=32;break}if(m=new Set(l.map((function(e){return e.id}))),!((d=i.filter((function(e){return!m.has(e)}))).length>0)){e.next=32;break}return bt((function(e){return e.concat(d)})),e.next=31,so(d);case 31:d.forEach((function(e){return St.current.add(e)}));case 32:t?(j=l.slice(0,Math.min(l.length,Oe-jt.length))).length>0&&ft((function(e){return a(e.concat(j),"id")})):ft((function(e){return u(e.filter((function(e){var t=e.id;return!l.find((function(e){return e.id===t}))})))}));case 33:case"end":return e.stop()}}),e,null,[[8,15,19,22]])}))),function(e,t,o,n){return Ho.apply(this,arguments)}),[Wo,Oe,jt.length,so,Nt]),Jo=p((function(){Xe(!0)}),[Xe]),Qo=p((function(e){Io(e)}),[Io]),Yo=p((function(e,t){Io((function(o){return o.map((function(o){return o===e?t:o}))}))}),[Io]),$o=p((function(e,t){Uo(e),Ko(t)}),[Uo,Ko]),en=p((function(e,t){ht(null),ft(t?function(t){if(t.length>=Oe)return t;var o=(null==Wo?void 0:Wo.find((function(t){return t.id===e.id})))||e;return t.concat(o)}:function(t){return t.filter((function(t){return t.id!==e.id}))})}),[Wo,Oe]),tn=p((function(e){if(ht(null),e){var t=wo?Lo.concat(wo):Lo,o=d(a(t,"id"),"distance");ft(o.slice(0,Oe))}else ft(wo?[wo]:[])}),[Lo,wo,Oe]),on=p((function(e,t){ft((function(o){var n=new Set(o.map((function(e){return e.id}))),s=e.filter((function(e){return!n.has(e.id)})),r=s.length;if(0===r)return setTimeout((function(){return null==t?void 0:t({attempted:0,added:0})}),0),o;var i=Oe-o.length,c=s.slice(0,i),p=c.length,l=c.map((function(e){return(null==Wo?void 0:Wo.find((function(t){return t.id===e.id})))||e}));return setTimeout((function(){return null==t?void 0:t({attempted:r,added:p})}),0),a(o.concat(l),"id")}))}),[Wo,Oe]),nn=p((function(e){ht(e)}),[]),sn=p((Ro=e(n.mark((function e(t){var o,s,r,i,c,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ao){e.next=15;break}if(o=Ao[t]||[],s=new Map((null==ro?void 0:ro.map((function(e){return[e.id,e]})))||[]),r=o.filter((function(e){return!s.has(e)})),i=[],!(r.length>0)){e.next=9;break}return e.next=8,so(r);case 8:i=e.sent;case 9:i.forEach((function(e){return s.set(e.id,e)})),c=o.map((function(e){return s.get(e)})).filter((function(e){return void 0!==e})),p=d(c,"distance"),ft(p.slice(0,Le)),e.next=16;break;case 15:ft(wo?[wo]:[]);case 16:case"end":return e.stop()}}),e)}))),function(e){return Ro.apply(this,arguments)}),[Ao,ro,so,Le,wo]),rn=p((No=e(n.mark((function e(t){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Lt(t),e.next=3,sn(t);case 3:case"end":return e.stop()}}),e)}))),function(e){return No.apply(this,arguments)}),[sn]),cn=i((function(){return jt.find((function(e){return e.id===Ee}))?jt.length-1:jt.length}),[jt,Ee]),pn=i((function(){if(!uo)return!1;var e=jt.map((function(e){return e.id})),t=uo[Mt]||[];if(Math.min(t.length,Le)!==e.length)return!1;var o=new Set(t);return e.every((function(e){return o.has(e)}))}),[uo,jt,Mt,Le]),ln=i((function(){return!!co&&q.includes(co)}),[co]),mn=i((function(){return ln?"IDAS generated offsets.":ge?"Offset Selection App.":"WellHub."}),[ln,ge]),an=p((function(){Wt(),De();var e=jt.map((function(e){return e.id})),t=Ae(Ae({},be),{},{companyId:et,subjectWellId:Ee,selectedWellIds:e,filters:oe(ot),metricsKeys:Vo,wellSection:Mt,isSynced:pn,mapHidden:qe,filterExpanded:Ge,offsetWellsLimited:Gt,lastSelectionZone:At,isLoadAllWells:Je});xe(t,jt)}),[Wt,De,jt,be,et,Ee,ot,Vo,Mt,pn,qe,Ge,Gt,At,Je,xe]);c((function(){xt&&0===St.current.size&&(Pt(!1),an())}),[xt,jt,an]);var un=function(){var e,t,o=new Set((null==be?void 0:be.selectedWellIds)||[]),n=(Wo||[]).filter((function(e){return o.has(e.id)}));if(null!=Yt&&Yt.length){var s=new Set(n.map((function(e){return e.id}))),r=Yt.filter((function(e){return o.has(e.id)&&!s.has(e.id)}));n=n.concat(r)}wo&&(n=n.concat(wo)),ft(a(n,"id")),ht(null!==(e=null==be?void 0:be.lastSelectionZone)&&void 0!==e?e:null);var i=Ae(Ae({},be),{},{mapHidden:qe,filterExpanded:Ge});xe(i);var c=oe(null==be?void 0:be.filters);nt(Ae(Ae({},c),{},{radius:null!==(t=null==c?void 0:c.radius)&&void 0!==t?t:_})),Lt((null==be?void 0:be.wellSection)||G),Qe(),Wt(),De()},dn=Rt||Xt,jn=i((function(){return!!tt&&(!dn&&(!pn||(!(j(ot)||!ot[z.sideTracks])||Mt!==G)))}),[tt,pn,ot,Mt,dn]),fn=p(e(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return st(),rt(),ht(null),Lt(G),e.next=6,sn(G);case 6:case"end":return e.stop()}}),e)}))),[st,rt,sn]),Cn=!Wo||!mo||!_o,vn=s(U),An=o(vn,2),hn=An[0],Sn=An[1],gn=s([]),Vn=o(gn,2),In=Vn[0],bn=Vn[1],Tn=r(),Dn=r(),xn=r(0),Pn=r(!1);c((function(){if(_o){var e=_o.slice(0,hn);bn(e)}}),[_o,hn,wo]),l((function(){Pn.current||Dn.current&&xn.current>0&&(Dn.current.scrollTop=xn.current)}),[In]),c((function(){if(Tn.current){var e=Tn.current.querySelector(".".concat(re.wellNameFixed));e&&(ze?e.classList.remove(re.noShadow):e.classList.add(re.noShadow))}}),[ze,In]);var yn=i((function(){return a(In,"id")}),[In]),Fn=i((function(){var e=yn.filter((function(e){return e.checked}));return[e,yn.length!==e.length&&Boolean(e.length)&&!Gt,e.length===yn.length||Gt]}),[yn,Gt]),Wn=o(Fn,3),wn=Wn[0],Bn=Wn[1],kn=Wn[2],Mn=i((function(){return Q()}),[]);c((function(){fo===Z.SUCCEEDED&&fn()}),[uo,fn,fo]);return ie(de,{open:Se,onClose:un,size:"fullscreen",className:se.modalDialog,title:ie(L,{totalCount:Oo,filteredCount:null!==(ve=null==Lo?void 0:Lo.length)&&void 0!==ve?ve:0,selectedCount:cn,maxOffsetWellNumber:Oe,isXtoProvider:ln,resyncStatus:fo,setResyncStatus:Co,metricsKeys:Vo,onChangeMetricsKeys:Qo}),actions:!Te&&ce("div",{className:se.actionsWrapper,children:[!Cn&&jn?ie(ae,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(ge?"Offset App":"Wellhub"),children:ie("div",{children:ie(me,{"data-testid":"".concat(he,"_reset"),onClick:fn,color:"primary",startIcon:ie(f,{}),children:"Reset to Defaults"})})}):tt&&ce("div",{children:[ie("span",{className:m(le.regular12,le.colors.t6),children:"The offset list is being automatically populated by "}),ie("span",{className:m(le.medium12,le.colors.t6),children:mn})]}),ce("div",{className:se.buttonGap,children:[ie(me,{"data-testid":"".concat(he,"_cancel"),onClick:un,color:"primary",children:"Cancel"}),ce(me,{"data-testid":"".concat(he,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){St.current.size>0?Pt(!0):an()},disabled:xt,prefix:xt?ie(ue,{size:16}):void 0,children:["Select (",cn,")"]})]})]}),children:ce("div",{className:m(se.offsetWellDialog),children:[ie(pe,{}),Cn?ie(fe,{}):ce("div",{className:m(se.contentWrapper,t({},se.contentBlocked,dn)),children:[ce("div",{className:se.columnsContainer,children:[!qe&&Se&&ie("div",{className:se.leftColumn,children:ie(E,{ref:Me,mapHidden:qe,subjectWell:wo,offsetWellIds:jt.map((function(e){return e.id})),wells:Eo,handleChangeOffsetWell:en,onBatchSelectWells:on,activeWellId:Be,selectionZone:At,onSelectionZoneConfirm:nn,shouldRecenter:Ye,onRecenterComplete:function(){return $e(!1)}})}),ce("div",{className:se.rightColumn,ref:Dn,onScroll:function(e){e.target&&(xn.current=e.target.scrollTop,_e&&(e.target.scrollLeft=0,Xe(!1)),e.target.scrollLeft<=5&&ze&&Ue(!1),e.target.scrollLeft>5&&!ze&&Ue(!0),e.target.scrollTop<=0&&Ze&&Ke(!1),e.target.scrollTop>0&&!Ze&&Ke(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&hn<_o.length&&Sn((function(e){return e+U})))},children:[ie(O,{isHidden:!Ge,filterOptions:ko,wellSections:mo,selectedWellSection:Mt,onChangeBicWells:rn,isSafeguardReady:Ft}),ie("div",{className:re.stickyTableWrapper,children:ce(C,{"aria-label":"ows table head",innerRef:Tn,className:re.stickyTable,children:[ie(v,{children:ie(R,{columnsWithDict:Mo,metricsKeys:Vo,sortBy:zo,sortDirection:Zo,indeterminate:Bn,isAllWellsSelected:kn,onChangeSort:$o,onUpdateMetricsKey:Yo,handleChangeAllOffsetWells:tn,wellNameStyle:re.wellNameFixed,isImperial:Mn,isTaColumnVisible:!!vo.length,isWellSectionColumnVisible:ho})}),Te&&ie("div",{className:m(se.topGradient,t({},se.topGradientScrolled,Ze))})]})}),!Te&&ce("div",{className:m(re.searchCellWrapper),children:[ie("div",{className:re.searchCell,children:ie(N,{companyIds:null,subjectWellId:Ee,onChange:Xo,selectedWellIds:wn.map((function(e){return e.id})),onHideAdvancedSearch:Jo,loadingAssetIds:It})}),ie("div",{className:m(se.topGradient,t({},se.topGradientScrolled,Ze))})]}),ie(H,{isTableLoading:dn,subjectWellId:Ee,columnsWithDict:Mo,wells:In,metricsKeys:Vo,handleChangeOffsetWell:en,isLastWell:_o.length<=hn,isLimitedOffsetWells:Gt,maxOffsetWellNumber:Oe,wellSections:mo,setActiveWellId:ke,onRowClick:function(e){var t;return null===(t=Me.current)||void 0===t?void 0:t.flyToWell(e)},taScores:vo,isWellSectionColumnVisible:ho,loadingWellIds:yo,scrollContainerRef:Dn,isAnimatingRef:Pn})]})]}),Te&&tt&&ce("div",{className:se.viewOnlyInfoContainer,children:[ie("span",{className:m(le.regular12,le.colors.t6),children:"The offset list is being automatically populated by "}),ie("span",{className:m(le.medium12,le.colors.t6),children:mn})]})]})]})})};export{Se as OffsetWellPickerV5};
2
2
  //# sourceMappingURL=OffsetWellPickerV5.js.map