@corva/ui 3.13.0-9 → 3.13.0

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 (52) hide show
  1. package/cjs-bundle/clients/subscriptions.js +1 -1
  2. package/cjs-bundle/clients/subscriptions.js.map +1 -1
  3. package/cjs-bundle/components/Notifications/Toast.js +1 -1
  4. package/cjs-bundle/components/Notifications/Toast.styles.js +1 -1
  5. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js +1 -1
  6. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js.map +1 -1
  7. package/cjs-bundle/components/OffsetWellPickerV4/constants.js +1 -1
  8. package/cjs-bundle/components/OffsetWellPickerV4/constants.js.map +1 -1
  9. package/cjs-bundle/components/OffsetWellPickerV4/effects/useAdvancedWells.js +1 -1
  10. package/cjs-bundle/components/OffsetWellPickerV4/effects/useAdvancedWells.js.map +1 -1
  11. package/cjs-bundle/components/OffsetWellPickerV4/effects/useSortedWells.js +1 -1
  12. package/cjs-bundle/components/OffsetWellPickerV4/effects/useSortedWells.js.map +1 -1
  13. package/cjs-bundle/components/OffsetWellPickerV4/utils/apiCalls.js +1 -1
  14. package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
  15. package/cjs-bundle/componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.js +1 -1
  16. package/cjs-bundle/constants/completion.js +1 -1
  17. package/cjs-bundle/constants/completion.js.map +1 -1
  18. package/cjs-bundle/utils/metrics/metricsConfig.js +1 -1
  19. package/cjs-bundle/utils/metrics/metricsConfig.js.map +1 -1
  20. package/clients/subscriptions.d.ts.map +1 -1
  21. package/clients/subscriptions.js +1 -1
  22. package/clients/subscriptions.js.map +1 -1
  23. package/components/Notifications/Notifications.stories.d.ts.map +1 -1
  24. package/components/Notifications/Toast.js +1 -1
  25. package/components/Notifications/Toast.styles.d.ts.map +1 -1
  26. package/components/Notifications/Toast.styles.js +1 -1
  27. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js +1 -1
  28. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js.map +1 -1
  29. package/components/OffsetWellPickerV4/constants.d.ts +3 -61
  30. package/components/OffsetWellPickerV4/constants.d.ts.map +1 -1
  31. package/components/OffsetWellPickerV4/constants.js +1 -1
  32. package/components/OffsetWellPickerV4/constants.js.map +1 -1
  33. package/components/OffsetWellPickerV4/effects/useAdvancedWells.d.ts.map +1 -1
  34. package/components/OffsetWellPickerV4/effects/useAdvancedWells.js +1 -1
  35. package/components/OffsetWellPickerV4/effects/useAdvancedWells.js.map +1 -1
  36. package/components/OffsetWellPickerV4/effects/useSortedWells.d.ts.map +1 -1
  37. package/components/OffsetWellPickerV4/effects/useSortedWells.js +1 -1
  38. package/components/OffsetWellPickerV4/effects/useSortedWells.js.map +1 -1
  39. package/components/OffsetWellPickerV4/utils/apiCalls.d.ts.map +1 -1
  40. package/components/OffsetWellPickerV4/utils/apiCalls.js +1 -1
  41. package/components/OffsetWellPickerV4/utils/apiCalls.js.map +1 -1
  42. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
  43. package/componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.d.ts.map +1 -1
  44. package/componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.js +1 -1
  45. package/constants/completion.d.ts.map +1 -1
  46. package/constants/completion.js +1 -1
  47. package/constants/completion.js.map +1 -1
  48. package/package.json +1 -1
  49. package/utils/metrics/metricsConfig.d.ts +12 -0
  50. package/utils/metrics/metricsConfig.d.ts.map +1 -1
  51. package/utils/metrics/metricsConfig.js +1 -1
  52. package/utils/metrics/metricsConfig.js.map +1 -1
@@ -1,2 +1,2 @@
1
- import n from"socket.io-client";import*as c from"query-string";import o from"lodash/noop";var t=new RegExp("^/reports.*$"),e=c.parse(window.location.search).subscriptions_url||process.env.REACT_APP_SUBSCRIPTIONS_URL||"https://subscriptions.qa.corva.ai";function i(n){return t.test(window.location.pathname)?o:n}function r(n,c){return"".concat(n.appInstanceId||c,":").concat(n.companyId,":").concat(n.userId,":").concat(n.collection)}function s(n,c){return"".concat(n.appInstanceId||c,":").concat(n.companyId,":").concat(n.collection)}function a(n,c){return n.event?"".concat(n.appInstanceId||c,":").concat(n.provider,":").concat(n.collection,":").concat(n.assetId,":").concat(n.event):"".concat(n.appInstanceId||c,":").concat(n.provider,":").concat(n.collection,":").concat(n.assetId)}function u(n){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"userId"in n?r(n,c):"companyId"in n?s(n,c):a(n,c)}function d(){var c,o={},t=!1,r=i((function(n){if(!c)throw new Error("Not connected");var t=u(n);t in o&&(delete o[t],c.emit("unsubscribe",n))})),s=i((function(n){if(!c)throw new Error("Not connected");var e=u(n);o[e]=n,t&&c.emit("subscribe",n)})),a=i((function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.onDataReceive,u=void 0===a?void 0:a,d=i.onResubscribe,p=void 0===d?void 0:d,b=!1;return(c=n(e,{transports:["websocket"]})).on("connect",(function(){b&&(Object.values(o).forEach((function(n){r(n),s(n),p&&p(n)})),b=!1)})),c.on("authenticated",(function(){t=!0,Object.values(o).forEach(s)})),u&&c.on("data",u),c.on("disconnect",(function(n){"io server disconnect"===n&&(b=!0,c.connect())})),c.on("reconnect",(function(){b=!0})),c}));return{connect:a,disconnect:i((function(){c&&(c.disconnect(),c=null)})),subscribe:s,unsubscribe:r}}var p=function(){var n=window[Symbol.for("socket")];null!=n&&n.socket&&(console.warn("Existing socket, disconnecting."),n.disconnect());var c=d(),o=c.connect,t=c.disconnect,e=c.subscribe,i=c.unsubscribe,r=o();window[Symbol.for("socket")]={subscribe:e,unsubscribe:i,disconnect:t,socket:r}};export{u as getSubscriptionId,d as getSubscriptionsClient,p as initializeSocketClient};
1
+ import n from"socket.io-client";import*as c from"query-string";import o from"lodash/noop";var t=new RegExp("^/reports.*$"),e=c.parse(window.location.search).subscriptions_url||process.env.REACT_APP_SUBSCRIPTIONS_URL||"https://subscriptions.qa.corva.ai";function r(n){return t.test(window.location.pathname)?o:n}function i(n,c){return"".concat(n.appInstanceId||c,":").concat(n.companyId,":").concat(n.userId,":").concat(n.collection)}function s(n,c){return"".concat(n.appInstanceId||c,":").concat(n.companyId,":").concat(n.collection)}function a(n,c){return n.event?"".concat(n.appInstanceId||c,":").concat(n.provider,":").concat(n.collection,":").concat(n.assetId,":").concat(n.event):"".concat(n.appInstanceId||c,":").concat(n.provider,":").concat(n.collection,":").concat(n.assetId)}function u(n){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"userId"in n?i(n,c):"companyId"in n?s(n,c):a(n,c)}function d(){var c,o={},t=!1,i=r((function(n){if(!c)throw new Error("Not connected");var t=u(n);t in o&&(delete o[t],c.emit("unsubscribe",n))})),s=r((function(n){if(!c)throw new Error("Not connected");var e=u(n);o[e]=n,t&&c.emit("subscribe",n)})),a=r((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.onDataReceive,a=void 0===i?void 0:i,u=r.onResubscribe,d=void 0===u?void 0:u,p=!1;return(c=n(e,{transports:["websocket"]})).on("authenticated",(function(){t=!0,Object.values(o).forEach((function(n){s(n),p&&d&&d(n)})),p=!1})),a&&c.on("data",a),c.on("reconnect",(function(){p=!0})),c}));return{connect:a,disconnect:r((function(){c&&(c.disconnect(),c=null)})),subscribe:s,unsubscribe:i}}var p=function(){var n=window[Symbol.for("socket")];null!=n&&n.socket&&(console.warn("Existing socket, disconnecting."),n.disconnect());var c=d(),o=c.connect,t=c.disconnect,e=c.subscribe,r=c.unsubscribe,i=o();window[Symbol.for("socket")]={subscribe:e,unsubscribe:r,disconnect:t,socket:i}};export{u as getSubscriptionId,d as getSubscriptionsClient,p as initializeSocketClient};
2
2
  //# sourceMappingURL=subscriptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.js","sources":["../../src/clients/subscriptions.js"],"sourcesContent":["import io from 'socket.io-client';\nimport * as queryString from 'query-string';\nimport noop from 'lodash/noop';\n\nconst SERVER_DISCONNECT_REASON = 'io server disconnect';\nconst REPORTS_ROUTE_REG_EXP = new RegExp('^/reports.*$');\n\nconst parameters = queryString.parse(window.location.search);\nconst socketUrl =\n parameters.subscriptions_url ||\n process.env.REACT_APP_SUBSCRIPTIONS_URL ||\n 'https://subscriptions.qa.corva.ai';\n\nfunction reportsDisableDecorator(func) {\n // NOTE: Disable subscription events on reports pages\n return REPORTS_ROUTE_REG_EXP.test(window.location.pathname) ? noop : func;\n}\n\nfunction getUserSubscriptionId(options, hookId) {\n return `${options.appInstanceId || hookId}:${options.companyId}:${options.userId}:${\n options.collection\n }`;\n}\n\nfunction getCompanySubscriptionId(options, hookId) {\n return `${options.appInstanceId || hookId}:${options.companyId}:${options.collection}`;\n}\n\nfunction getAssetSubscriptionId(options, hookId) {\n return options.event\n ? `${options.appInstanceId || hookId}:${options.provider}:${options.collection}:${\n options.assetId\n }:${options.event}`\n : `${options.appInstanceId || hookId}:${options.provider}:${options.collection}:${\n options.assetId\n }`;\n}\n\nexport function getSubscriptionId(options, hookId = '') {\n if ('userId' in options) return getUserSubscriptionId(options, hookId);\n else if ('companyId' in options) return getCompanySubscriptionId(options, hookId);\n return getAssetSubscriptionId(options, hookId);\n}\n\nexport function getSubscriptionsClient() {\n let socket;\n\n // NOTE: Is used in order to reset subscriptions in case of network failure\n const subscriptions = {};\n let isAuthenticated = false;\n\n const unsubscribe = reportsDisableDecorator(options => {\n if (!socket) {\n throw new Error('Not connected');\n }\n const subscriptionId = getSubscriptionId(options);\n\n if (subscriptionId in subscriptions) {\n delete subscriptions[subscriptionId];\n socket.emit('unsubscribe', options);\n }\n });\n\n const subscribe = reportsDisableDecorator(options => {\n if (!socket) {\n throw new Error('Not connected');\n }\n\n const subscriptionId = getSubscriptionId(options);\n subscriptions[subscriptionId] = options;\n\n // NOTE: Events could be:\n // 1) 'update' - fires in case of records are updated;\n // 2) 'destroy' - fires in case or records are destroyed;\n // 3) '' (empty) - fires in case of new records are created;\n if (isAuthenticated) {\n socket.emit('subscribe', options);\n }\n });\n\n const connect = reportsDisableDecorator(\n ({ onDataReceive = undefined, onResubscribe = undefined } = {}) => {\n let resubscribe = false;\n\n socket = io(socketUrl, { transports: ['websocket'] });\n socket.on('connect', () => {\n if (resubscribe) {\n Object.values(subscriptions).forEach(subscription => {\n unsubscribe(subscription);\n subscribe(subscription);\n if (onResubscribe) onResubscribe(subscription);\n });\n resubscribe = false;\n }\n });\n socket.on('authenticated', () => {\n isAuthenticated = true;\n Object.values(subscriptions).forEach(subscribe);\n });\n if (onDataReceive) socket.on('data', onDataReceive);\n\n socket.on('disconnect', reason => {\n if (reason === SERVER_DISCONNECT_REASON) {\n resubscribe = true;\n socket.connect();\n }\n });\n socket.on('reconnect', () => {\n resubscribe = true;\n });\n\n return socket;\n }\n );\n\n const disconnect = reportsDisableDecorator(() => {\n if (socket) {\n socket.disconnect();\n socket = null;\n }\n });\n\n return { connect, disconnect, subscribe, unsubscribe };\n}\n\nexport const initializeSocketClient = () => {\n const existingSocket = window[Symbol.for('socket')];\n if (existingSocket?.socket) {\n console.warn('Existing socket, disconnecting.');\n existingSocket.disconnect();\n }\n const { connect, disconnect, subscribe, unsubscribe } = getSubscriptionsClient();\n const socket = connect();\n window[Symbol.for('socket')] = {\n subscribe,\n unsubscribe,\n disconnect,\n socket,\n };\n};\n"],"names":["REPORTS_ROUTE_REG_EXP","RegExp","socketUrl","queryString","parse","window","location","search","subscriptions_url","process","env","REACT_APP_SUBSCRIPTIONS_URL","reportsDisableDecorator","func","test","pathname","noop","getUserSubscriptionId","options","hookId","concat","appInstanceId","companyId","userId","collection","getCompanySubscriptionId","getAssetSubscriptionId","event","provider","assetId","getSubscriptionId","getSubscriptionsClient","socket","subscriptions","isAuthenticated","unsubscribe","Error","subscriptionId","emit","subscribe","connect","_ref","arguments","length","undefined","_ref$onDataReceive","onDataReceive","_ref$onResubscribe","onResubscribe","resubscribe","io","transports","on","Object","values","forEach","subscription","reason","disconnect","initializeSocketClient","existingSocket","Symbol","for","console","warn","_getSubscriptionsClie"],"mappings":"0FAIA,IACMA,EAAwB,IAAIC,OAAO,gBAGnCC,EADaC,EAAYC,MAAMC,OAAOC,SAASC,QAExCC,mBACXC,QAAQC,IAAIC,6BACZ,oCAEF,SAASC,EAAwBC,GAE/B,OAAOb,EAAsBc,KAAKT,OAAOC,SAASS,UAAYC,EAAOH,CACvE,CAEA,SAASI,EAAsBC,EAASC,GACtC,MAAA,GAAAC,OAAUF,EAAQG,eAAiBF,cAAUD,EAAQI,UAAS,KAAAF,OAAIF,EAAQK,OACxEL,KAAAA,OAAAA,EAAQM,WAEZ,CAEA,SAASC,EAAyBP,EAASC,GACzC,MAAA,GAAAC,OAAUF,EAAQG,eAAiBF,EAAM,KAAAC,OAAIF,EAAQI,UAAS,KAAAF,OAAIF,EAAQM,WAC5E,CAEA,SAASE,EAAuBR,EAASC,GACvC,OAAOD,EAAQS,gBACRT,EAAQG,eAAiBF,cAAUD,EAAQU,SAAYV,KAAAA,OAAAA,EAAQM,WAAU,KAAAJ,OAC1EF,EAAQW,oBACNX,EAAQS,OACTT,GAAAA,OAAAA,EAAQG,eAAiBF,EAAUD,KAAAA,OAAAA,EAAQU,SAAQ,KAAAR,OAAIF,EAAQM,uBAChEN,EAAQW,QAEhB,CAEO,SAASC,EAAkBZ,GAAsB,IAAbC,yDAAS,GAClD,MAAI,WAAYD,EAAgBD,EAAsBC,EAASC,GACtD,cAAeD,EAAgBO,EAAyBP,EAASC,GACnEO,EAAuBR,EAASC,EACzC,CAEO,SAASY,IACd,IAAIC,EAGEC,EAAgB,CAAA,EAClBC,GAAkB,EAEhBC,EAAcvB,GAAwB,SAAAM,GAC1C,IAAKc,EACH,MAAM,IAAII,MAAM,iBAElB,IAAMC,EAAiBP,EAAkBZ,GAErCmB,KAAkBJ,WACbA,EAAcI,G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AA,YAClCH,EAASQ,IACfnC,OAAOwD,OAAOC,IAAI,WAAa,CAC7BvB,UAAAA,EACAJ,YAAAA,EACAuB,WAAAA,EACA1B,OAAAA,EAEJ"}
1
+ {"version":3,"file":"subscriptions.js","sources":["../../src/clients/subscriptions.js"],"sourcesContent":["import io from 'socket.io-client';\nimport * as queryString from 'query-string';\nimport noop from 'lodash/noop';\n\nconst REPORTS_ROUTE_REG_EXP = new RegExp('^/reports.*$');\n\nconst parameters = queryString.parse(window.location.search);\nconst socketUrl =\n parameters.subscriptions_url ||\n process.env.REACT_APP_SUBSCRIPTIONS_URL ||\n 'https://subscriptions.qa.corva.ai';\n\nfunction reportsDisableDecorator(func) {\n // NOTE: Disable subscription events on reports pages\n return REPORTS_ROUTE_REG_EXP.test(window.location.pathname) ? noop : func;\n}\n\nfunction getUserSubscriptionId(options, hookId) {\n return `${options.appInstanceId || hookId}:${options.companyId}:${options.userId}:${\n options.collection\n }`;\n}\n\nfunction getCompanySubscriptionId(options, hookId) {\n return `${options.appInstanceId || hookId}:${options.companyId}:${options.collection}`;\n}\n\nfunction getAssetSubscriptionId(options, hookId) {\n return options.event\n ? `${options.appInstanceId || hookId}:${options.provider}:${options.collection}:${\n options.assetId\n }:${options.event}`\n : `${options.appInstanceId || hookId}:${options.provider}:${options.collection}:${\n options.assetId\n }`;\n}\n\nexport function getSubscriptionId(options, hookId = '') {\n if ('userId' in options) return getUserSubscriptionId(options, hookId);\n else if ('companyId' in options) return getCompanySubscriptionId(options, hookId);\n return getAssetSubscriptionId(options, hookId);\n}\n\nexport function getSubscriptionsClient() {\n let socket;\n\n // NOTE: Is used in order to reset subscriptions in case of network failure\n const subscriptions = {};\n let isAuthenticated = false;\n\n const unsubscribe = reportsDisableDecorator(options => {\n if (!socket) {\n throw new Error('Not connected');\n }\n const subscriptionId = getSubscriptionId(options);\n\n if (subscriptionId in subscriptions) {\n delete subscriptions[subscriptionId];\n socket.emit('unsubscribe', options);\n }\n });\n\n const subscribe = reportsDisableDecorator(options => {\n if (!socket) {\n throw new Error('Not connected');\n }\n\n const subscriptionId = getSubscriptionId(options);\n subscriptions[subscriptionId] = options;\n\n // NOTE: Events could be:\n // 1) 'update' - fires in case of records are updated;\n // 2) 'destroy' - fires in case or records are destroyed;\n // 3) '' (empty) - fires in case of new records are created;\n if (isAuthenticated) {\n socket.emit('subscribe', options);\n }\n });\n\n const connect = reportsDisableDecorator(\n ({ onDataReceive = undefined, onResubscribe = undefined } = {}) => {\n let resubscribe = false;\n\n socket = io(socketUrl, { transports: ['websocket'] });\n // TODO: Once authentication is moved on connect, move this as well\n socket.on('authenticated', () => {\n isAuthenticated = true;\n Object.values(subscriptions).forEach(subscription => {\n subscribe(subscription);\n if (resubscribe && onResubscribe) onResubscribe(subscription);\n });\n resubscribe = false;\n });\n if (onDataReceive) socket.on('data', onDataReceive);\n\n socket.on('reconnect', () => {\n resubscribe = true;\n });\n\n return socket;\n }\n );\n\n const disconnect = reportsDisableDecorator(() => {\n if (socket) {\n socket.disconnect();\n socket = null;\n }\n });\n\n return { connect, disconnect, subscribe, unsubscribe };\n}\n\nexport const initializeSocketClient = () => {\n const existingSocket = window[Symbol.for('socket')];\n if (existingSocket?.socket) {\n console.warn('Existing socket, disconnecting.');\n existingSocket.disconnect();\n }\n const { connect, disconnect, subscribe, unsubscribe } = getSubscriptionsClient();\n const socket = connect();\n window[Symbol.for('socket')] = {\n subscribe,\n unsubscribe,\n disconnect,\n socket,\n };\n};\n"],"names":["REPORTS_ROUTE_REG_EXP","RegExp","socketUrl","queryString","parse","window","location","search","subscriptions_url","process","env","REACT_APP_SUBSCRIPTIONS_URL","reportsDisableDecorator","func","test","pathname","noop","getUserSubscriptionId","options","hookId","concat","appInstanceId","companyId","userId","collection","getCompanySubscriptionId","getAssetSubscriptionId","event","provider","assetId","getSubscriptionId","getSubscriptionsClient","socket","subscriptions","isAuthenticated","unsubscribe","Error","subscriptionId","emit","subscribe","connect","_ref","arguments","length","undefined","_ref$onDataReceive","onDataReceive","_ref$onResubscribe","onResubscribe","resubscribe","io","transports","on","Object","values","forEach","subscription","disconnect","initializeSocketClient","existingSocket","Symbol","for","console","warn","_getSubscriptionsClie"],"mappings":"0FAIA,IAAMA,EAAwB,IAAIC,OAAO,gBAGnCC,EADaC,EAAYC,MAAMC,OAAOC,SAASC,QAExCC,mBACXC,QAAQC,IAAIC,6BACZ,oCAEF,SAASC,EAAwBC,GAE/B,OAAOb,EAAsBc,KAAKT,OAAOC,SAASS,UAAYC,EAAOH,CACvE,CAEA,SAASI,EAAsBC,EAASC,GACtC,MAAA,GAAAC,OAAUF,EAAQG,eAAiBF,cAAUD,EAAQI,UAAS,KAAAF,OAAIF,EAAQK,OACxEL,KAAAA,OAAAA,EAAQM,WAEZ,CAEA,SAASC,EAAyBP,EAASC,GACzC,MAAA,GAAAC,OAAUF,EAAQG,eAAiBF,EAAM,KAAAC,OAAIF,EAAQI,UAAS,KAAAF,OAAIF,EAAQM,WAC5E,CAEA,SAASE,EAAuBR,EAASC,GACvC,OAAOD,EAAQS,gBACRT,EAAQG,eAAiBF,cAAUD,EAAQU,SAAYV,KAAAA,OAAAA,EAAQM,WAAU,KAAAJ,OAC1EF,EAAQW,oBACNX,EAAQS,OACTT,GAAAA,OAAAA,EAAQG,eAAiBF,EAAUD,KAAAA,OAAAA,EAAQU,SAAQ,KAAAR,OAAIF,EAAQM,uBAChEN,EAAQW,QAEhB,CAEO,SAASC,EAAkBZ,GAAsB,IAAbC,yDAAS,GAClD,MAAI,WAAYD,EAAgBD,EAAsBC,EAASC,GACtD,cAAeD,EAAgBO,EAAyBP,EAASC,GACnEO,EAAuBR,EAASC,EACzC,CAEO,SAASY,IACd,IAAIC,EAGEC,EAAgB,CAAA,EAClBC,GAAkB,EAEhBC,EAAcvB,GAAwB,SAAAM,GAC1C,IAAKc,EACH,MAAM,IAAII,MAAM,iBAElB,IAAMC,EAAiBP,EAAkBZ,GAErCmB,KAAkBJ,WACbA,EAAcI,GACrBL,EAAOM,KAAK,cA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Notifications/Notifications.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUhD,KAAK,KAAK,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAElD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,KAAK,CAGrB,CAAC;AA2BF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,UAAW,KAAK,gBAAiC,CAAC;AAEtE,eAAO,MAAM,iBAAiB,mBAuB7B,CAAC;AAUF,eAAO,MAAM,kBAAkB,mBAuB9B,CAAC"}
1
+ {"version":3,"file":"Notifications.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/Notifications.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUhD,KAAK,KAAK,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAElD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,KAAK,CAGrB,CAAC;AA2BF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,UAAW,KAAK,gBAInC,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAuB7B,CAAC;AAUF,eAAO,MAAM,kBAAkB,mBAuB9B,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__rest as o,__assign as s}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as i,jsxs as c}from"react/jsx-runtime";import{useEffect as n,cloneElement as t}from"react";import e from"classnames";import{noop as r}from"lodash";import{Grow as m,SnackbarContent as a,Tooltip as l,Typography as p}from"@material-ui/core";import{useStyles as u}from"./Toast.styles.js";import d from"../IconButton/index.js";import{NOTIFICATION_VARIANTS as j}from"../../constants/notifications.js";import{CheckOneIcon as I,CautionIcon as h,AttentionIcon as C,InfoIcon as f,CloseSmallIcon as v}from"../../icons/iconParkIcons.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/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/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";var b,k=((b={})[j.success]=I,b[j.warning]=h,b[j.error]=C,b[j.info]=f,b),F=function(I){var h,C=I.onDismissClick,f=I.toast,b=o(I,["onDismissClick","toast"]),F=f.alertLevel,N=f.autoHideDuration,g=void 0===N?3e3:N,x=f.content,A=f.hideIcon,P=f.icon,D=f.id,O=f.onClick,T=void 0===O?r:O,R=f.onClose,W=void 0===R?r:R,z=f.timestamp,B=f.title,E=f.tooltipProps,L=f.variant,M=void 0===L?"info":L;n((function(){if(g!==1/0){var o=setTimeout((function(){return C(D)}),g);return function(){return clearTimeout(o)}}}),[]);var q=u(),y=k[M];return i(m,{appear:!0,in:!0,children:i(a,s({classes:{root:e(q.main,!F&&q[M],F&&q.alertNotification,F&&q["alertLevels-".concat(F)]),action:q.actionContainer,message:q.messageContainer},"aria-describedby":"client-snackbar","data-testid":"notificationPopup_".concat(j[M]),message:i(l,s({},E,{title:x,classes:{tooltip:q.tooltip},placement:"bottom",children:c("div",{id:"client-snackbar",className:q.messageWrapper,onClick:T,children:[!A&&i("div",{className:q.iconWrapper,children:P?t(P,{className:q.icon,nativeColor:"#000"}):i(y,{size:16,className:q.icon})}),c("div",{className:q.message,children:[c("div",{className:q.messageTop,children:[B&&i(p,{"data-testid":"title",variant:"subtitle2",className:e(q.title,(h={},h[q.alertTitle]=F,h)),children:B}),z&&i(p,{className:e(q.timestamp,!F&&q[M]),children:z})]}),i("div",{className:e(q.messageContent,!F&&q[M]),children:i(p,{"data-testid":"content",className:e(F?q.alertContent:q.content),children:x})})]})]})})),action:[i(d,{"data-testid":"closeButton","aria-label":"Close",color:"inherit",onClick:function(){W(),C(D)},size:"small",tooltipProps:{title:"Close",classes:{tooltip:q.tooltip}},className:q.closeIconButton,children:i(v,{size:24,fill:"#000"})},"close")]},b))})};export{F as Toast};
1
+ import{__rest as o,__assign as s}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as i,jsxs as c}from"react/jsx-runtime";import{useEffect as n,cloneElement as t}from"react";import e from"classnames";import{noop as r}from"lodash";import{Grow as m,SnackbarContent as a,Tooltip as l,Typography as p}from"@material-ui/core";import{useStyles as u}from"./Toast.styles.js";import d from"../IconButton/index.js";import{NOTIFICATION_VARIANTS as j}from"../../constants/notifications.js";import{CheckOneIcon as I,CautionIcon as h,AttentionIcon as C,InfoIcon as f,CloseSmallIcon as v}from"../../icons/iconParkIcons.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/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/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";var b,k=((b={})[j.success]=I,b[j.warning]=h,b[j.error]=C,b[j.info]=f,b),F=function(I){var h,C=I.onDismissClick,f=I.toast,b=o(I,["onDismissClick","toast"]),F=f.alertLevel,N=f.autoHideDuration,g=void 0===N?3e3:N,x=f.content,A=f.hideIcon,P=f.icon,D=f.id,O=f.onClick,T=void 0===O?r:O,R=f.onClose,W=void 0===R?r:R,z=f.timestamp,B=f.title,E=f.tooltipProps,L=f.variant,M=void 0===L?"info":L;n((function(){if(g!==1/0){var o=setTimeout((function(){return C(D)}),g);return function(){return clearTimeout(o)}}}),[]);var q=u(),y=k[M];return i(m,{appear:!0,in:!0,children:i(a,s({classes:{root:e(q.main,!F&&q[M],F&&q.alertNotification,F&&q["alertLevels-".concat(F)]),action:q.actionContainer,message:q.messageContainer},"aria-describedby":"client-snackbar","data-testid":"notificationPopup_".concat(j[M]),message:i(l,s({},E,{title:x,classes:{tooltip:q.tooltip},placement:"bottom",children:c("div",{id:"client-snackbar",className:q.messageWrapper,onClick:T,children:[!A&&i("div",{className:q.iconWrapper,children:P?t(P,{className:q.icon,nativeColor:"#000"}):i(y,{size:16,className:q.icon})}),c("div",{className:q.message,children:[c("div",{className:q.messageTop,children:[B&&i(p,{"data-testid":"title",variant:"subtitle2",className:e(q.title,(h={},h[q.alertTitle]=F,h)),children:B}),z&&i(p,{className:e(q.timestamp,!F&&q[M]),children:z})]}),i("div",{className:e(q.messageContent,!F&&q[M]),children:i(p,{"data-testid":"content",className:e(F?q.alertContent:q.content),children:x})})]})]})})),action:[i(d,{"data-testid":"closeButton","aria-label":"Close",color:"inherit",onClick:function(){W(),C(D)},size:"small",tooltipProps:{title:"Close",classes:{tooltip:q.tooltip}},className:q.closeIconButton,children:i(v,{size:20,fill:"#000"})},"close")]},b))})};export{F as Toast};
2
2
  //# sourceMappingURL=Toast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/Toast.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,qEA6HnB,CAAC"}
1
+ {"version":3,"file":"Toast.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/Toast.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,qEA8HnB,CAAC"}
@@ -1,2 +1,2 @@
1
- import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{main:{width:443,height:48,maxWidth:"85vw",display:"flex",flexWrap:"nowrap",alignItems:"center",padding:0,marginBottom:e.spacing(2),boxShadow:"0px 8px 24px 0px rgba(0, 0, 0, 0.24)"},success:{backgroundColor:e.palette.success.main},error:{backgroundColor:e.palette.error.main},warning:{backgroundColor:e.palette.warning.main},info:{backgroundColor:e.palette.info.main},title:{color:e.palette.background.b2,fontWeight:400},alertTitle:{color:e.palette.background.b2},content:{fontSize:"14px",lineHeight:"16px",color:e.palette.background.b2,fontWeight:400,whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":2,height:"fit-content",display:"-webkit-box",flexDirection:"column",justifyContent:"center"},alertContent:{color:"#CCCCCC"},iconWrapper:{display:"flex",alignSelf:"center",alignItems:"center",height:35,padding:"0px 10px 0 18px"},icon:{transform:"scale(1.2)"},closeIconButton:{"&.MuiButtonBase-root":{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.2)"},"&:active":{backgroundColor:"rgba(255, 255, 255, 0.4)"}},"& svg, & .i-icon":{width:"24px !important",height:"24px !important"}},messageContainer:{overflowX:"hidden",flex:1},messageWrapper:{display:"flex"},message:{display:"flex",flex:1,alignItems:"center",minHeight:35,height:"100%",overflowY:"hidden",justifyContent:"center",flexDirection:"column"},messageTop:{display:"flex",justifyContent:"space-between",overflowX:"hidden",textOverflow:"ellipsis",width:"100%"},messageContent:{overflowX:"hidden",textOverflow:"ellipsis",width:"100%"},timestamp:{marginLeft:10,alignSelf:"flex-end"},actionContainer:{paddingLeft:"8px",marginRight:"16px"},alertNotification:{paddingLeft:12,backgroundColor:e.palette.background.b9,height:"unset"},"alertLevels-info":{borderLeft:"15px solid rgb(119, 195, 241)"},"alertLevels-warning":{borderLeft:"15px solid rgb(242, 192, 70)"},"alertLevels-critical":{borderLeft:"15px solid rgb(237, 70, 48)"},tooltip:{marginTop:8,color:e.palette.primary.contrastText}}}));export{t as useStyles};
1
+ import{makeStyles as e}from"@material-ui/core";var t=e((function(e){return{main:{width:443,minHeight:48,maxWidth:"85vw",display:"flex",flexWrap:"nowrap",alignItems:"center",padding:0,marginBottom:e.spacing(2),boxShadow:"none",borderRadius:8},success:{backgroundColor:e.palette.success.main},error:{backgroundColor:e.palette.error.main},warning:{backgroundColor:e.palette.warning.main},info:{backgroundColor:e.palette.info.main},title:{color:e.palette.background.b2,fontWeight:400},alertTitle:{color:e.palette.background.b2},content:{fontSize:"14px",lineHeight:"16px",color:e.palette.background.b2,fontWeight:400,whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":2,height:"fit-content",display:"-webkit-box",flexDirection:"column",justifyContent:"center"},alertContent:{color:"#CCCCCC"},iconWrapper:{display:"flex",alignSelf:"center",alignItems:"center",height:35,padding:"0px 10px 0 18px"},icon:{transform:"scale(1.2)"},closeIconButton:{"&.MuiButtonBase-root":{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.2)"},"&:active":{backgroundColor:"rgba(255, 255, 255, 0.4)"}},"& svg, & .i-icon":{width:"20px !important",height:"20px !important"}},messageContainer:{overflowX:"hidden",flex:1},messageWrapper:{display:"flex"},message:{display:"flex",flex:1,alignItems:"center",minHeight:35,height:"100%",overflowY:"hidden",justifyContent:"center",flexDirection:"column"},messageTop:{display:"flex",justifyContent:"space-between",overflowX:"hidden",textOverflow:"ellipsis",width:"100%"},messageContent:{overflowX:"hidden",textOverflow:"ellipsis",width:"100%"},timestamp:{marginLeft:10,alignSelf:"flex-end"},actionContainer:{paddingLeft:"8px",marginRight:"16px"},alertNotification:{paddingLeft:12,backgroundColor:e.palette.background.b9,height:"unset"},"alertLevels-info":{borderLeft:"15px solid rgb(119, 195, 241)"},"alertLevels-warning":{borderLeft:"15px solid rgb(242, 192, 70)"},"alertLevels-critical":{borderLeft:"15px solid rgb(237, 70, 48)"},tooltip:{marginTop:8,color:e.palette.primary.contrastText}}}));export{t as useStyles};
2
2
  //# sourceMappingURL=Toast.styles.js.map
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as l,useState as i,useRef as a,useCallback as n,useEffect as s,useMemo as r}from"react";import o from"prop-types";import{omit as c,startCase as d,get as u}from"lodash";import m from"classnames";import f from"moment";import{TableRow as h,TableCell as y,Tooltip as b,Checkbox as p,Typography as v}from"@material-ui/core";import{ColumnType as w,ROW_HEIGHT as N,ViewType as W,EXPANDED_WELL_NAME_WIDTH as g,LEAVE_TOUCH_DELAY as R,StatusOptions as k}from"../../constants.js";import{SubjectWellMark as C}from"./SubjectWellMark.js";import q from"./ViewWellSectionsName.js";import T from"./OffsetWellsTableRow.module.css.js";import{convertValue as x}from"../../../../utils/index.js";import{jsxs as D,jsx as O}from"react/jsx-runtime";var S="OffsetWellsTableRow";function I(e,t,l){var i=t.find((function(e){return e.key===l})),a=u(e,i.key);return"undefined"===a?"loading...":Number.isFinite(a)||a?i.unitType?x(a,i.unitType,i.from,i.to):a:"—"}function j(e,t){var l=u(e,w.distance);return Number.isFinite(l)?t?l:x(l,"length","mi","km"):"—"}function M(e,t){var l,i=e.find((function(e){return e.wellId===t.id}));return null!==(l=null==i?void 0:i.taScore)&&void 0!==l?l:""}function _(e,t){var l=e.find((function(e){return e.key===t}));return(null==l?void 0:l.width)||0}var A=function(l){var o,u,x,A=l.columnsWithDict,L=l.data,V=l.subjectWellId,Y=l.metricsKeys,z=l.metricsColumns,E=l.handleChangeOffsetWell,F=l.isWellNameExpand,P=l.wellNameStyle,H=l.wellNameWidth,K=l.isViewOnly,U=l.isImperial,B=l.isLimitedOffsetWells,G=l.maxOffsetWellNumber,J=l.wellSections,Q=l.setActiveWellId,X=l.viewType,Z=l.newCheckedWellId,$=l.setNewCheckedWellId,ee=l.index,te=l.flyDuration,le=l.isWDUser,ie=l.taScores,ae=V===L.id,ne=t({},T.subjectWellRow,ae),se=i(L.checked),re=e(se,2),oe=re[0],ce=re[1],de=a(),ue=!1,me=L[w.name]||"—",fe=me;if(!F&&2*H<8*me.length){var he=function(e){var t=document.createElement("span");document.body.appendChild(t),t.style.font="Roboto",t.style.fontSize="14px",t.style.letterSpacing="0.01071em",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="nowrap",t.innerHTML=e;var l=Math.ceil(t.clientWidth);return document.body.removeChild(t),l}(me);if(he>2*H){var ye=2*H/(he/me.length);fe="".concat(me.substring(0,ye/2-2),"\n... ").concat(me.substring(me.length-ye/2+6)),ue=!0}}var be=n((function(e,t,l,i,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=t-e;de.current.style.position="absolute",de.current.style.top="".concat(e,"px"),de.current.style.zIndex=l===i?4:3,de.current.style.transition="transform ".concat(a,"ms ease ").concat(50*n,"ms"),de.current.style.transform="translateY(".concat(s,"px)")}),[]),pe=n((function(){de.current.style.position="unset",de.current.style.zIndex=1,de.current.style.transition="none",de.current.style.transform="none"}),[]),ve=n((function(e){$(L.id);var t=c(L,"moveTo");E(t,e),ce(e)}),[L,$,E]);s((function(){if(Z){var e=ee*N+16;if(L.moveTo){var t=e+N*L.moveTo;be(e,t,Z,L.id,te,L.delayTime)}}else pe()}),[L.moveTo,Z]),s((function(){ce(L.checked)}),[L.checked]);var we,Ne,We=r((function(){return L[w.wellSection]}),[L]),ge=r((function(){return K?"View only mode. To edit offsets, use ".concat(le?"Offset Selection App":"WellHub","."):B&&!L.checked?"App can’t process more than (".concat(G-1,") Offset Wells."):""}),[K,B,L.checked]);return D(h,{"data-testid":"".concat(S,"_row_").concat(me),className:m(T.bodyRow,t({},T.moveRow,1===Math.abs(L.moveTo)&&Z!==L.id)),innerRef:de,onMouseEnter:function(){Q(L.id)},onMouseLeave:function(){Q(null)},children:[D(y,{"data-testid":"".concat(S,"_well"),className:m(T.bodyCell,T.wellNameCell,ne,(o={},t(o,P,X!==W.mobile),t(o,T.wellNameCellMobile,X===W.mobile),o)),style:{width:F?g:_(A,w.name)},children:[ae&&O(C,{className:m(T.subjectWellMark,t({},T.subjectWellMarkMobile,X===W.mobile))}),!ae&&O(b,{title:ge,placement:"bottom-start",classes:{tooltipPlacementBottom:T.checkboxTooltip},children:O("div",{children:O(p,{"data-testid":"".concat(S,"_checkbox"),size:"medium",checked:oe,classes:{disabled:T.checkboxDisabled},disabled:K||B&&!L.checked,onChange:function(e){return ve(e.target.checked)}})})}),O(b,{title:ue?me:"",children:O(v,{variant:"body2",className:m(T.wellNameCursor,(u={},t(u,T.cellDataViewOnly,ae),t(u,T.wellNamePreWrap,ue),u)),children:ue?fe:me})})]}),O(y,{"data-testid":"".concat(S,"_dot"),className:m(T.bodyCell,ne),style:{width:_(A,w.status)},children:!ae&&O(b,{title:d(L[w.status]),enterTouchDelay:X===W.mobile&&0,leaveTouchDelay:X===W.mobile&&R,children:O("div",{className:T.statusContainer,children:O("div",{"data-testid":"".concat(S,"_color"),className:T.status,style:{background:null===(x=k.find((function(e){return e.value===L[w.status]})))||void 0===x?void 0:x.color}})})})}),O(y,{"data-testid":"".concat(S,"_rig"),className:m(T.bodyCell,ne),style:{width:_(A,w.rig)},children:O(v,{variant:"body2",className:T.cellData,children:L[w.rig]&&"Null"!==L[w.rig]?L[w.rig]:"—"})}),O(y,{"data-testid":"".concat(S,"_distance"),className:m(T.bodyCell,ne),style:{width:_(A,w.distance)},children:O(v,{variant:"body2",className:T.cellData,children:j(L,U)})}),!!ie.length&&O(y,{"data-testid":"".concat(S,"_ta"),className:m(T.bodyCell,ne),style:{width:_(A,w.taScore)},children:O(v,{variant:"body2",className:T.cellData,children:M(ie,L)})}),O(y,{"data-testid":"".concat(S,"_lastActive"),className:m(T.bodyCell,ne),style:{width:_(A,w.lastActive)},children:O(v,{variant:"body2",className:T.cellData,children:L[w.lastActive]&&Number.isFinite(L[w.lastActive])?f.unix(L[w.lastActive]).format("MM/DD/YYYY"):"—"})}),Y.map((function(e){return O(y,{"data-testid":"".concat(S,"_").concat(e),className:m(T.bodyCell,ne),style:{width:_(A,e)},children:O(v,{variant:"body2",className:T.cellData,children:I(L,z,e)})},e)})),O(y,{"data-testid":"".concat(S,"_wellSection"),className:m(T.bodyCell,T.lastCell,ne),style:{width:_(A,w.wellSection)},children:We&&We.length>1?O(b,{classes:{tooltip:T.customTooltip},title:O(q,{wellSectionNames:We}),children:O("div",{className:T.sectionLength,children:We.length})}):O(b,{title:We||"",children:O(v,{variant:"body2",className:T.cellData,style:{color:We&&1===We.length&&(we=We,Ne=e(we,1)[0],J.find((function(e){return e.label===Ne})).color)},children:We})})})]})};A.propTypes={columnsWithDict:o.arrayOf(o.shape({})).isRequired,data:o.shape({id:o.number,checked:o.bool,name:o.string,status:o.string,moveTo:o.number,delayTime:o.number}).isRequired,subjectWellId:o.number.isRequired,metricsKeys:o.arrayOf(o.string).isRequired,metricsColumns:o.arrayOf(o.shape({})).isRequired,handleChangeOffsetWell:o.func.isRequired,isWellNameExpand:o.bool.isRequired,wellNameStyle:o.string.isRequired,wellNameWidth:o.number.isRequired,isViewOnly:o.bool.isRequired,isImperial:o.bool.isRequired,isLimitedOffsetWells:o.bool.isRequired,maxOffsetWellNumber:o.number.isRequired,wellSections:o.arrayOf(o.shape({})).isRequired,setActiveWellId:o.func.isRequired,viewType:o.string.isRequired,newCheckedWellId:o.number.isRequired,setNewCheckedWellId:o.func.isRequired,index:o.number.isRequired,flyDuration:o.number.isRequired,isWDUser:o.bool.isRequired,taScores:o.arrayOf(o.shape({})).isRequired};var L=l(A);export{L as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as l,useState as i,useRef as a,useCallback as n,useEffect as s,useMemo as r}from"react";import o from"prop-types";import{omit as c,startCase as d,get as u}from"lodash";import m from"classnames";import f from"moment";import{TableRow as h,TableCell as y,Tooltip as b,Checkbox as p,Typography as v}from"@material-ui/core";import{ColumnType as w,ROW_HEIGHT as N,ViewType as W,EXPANDED_WELL_NAME_WIDTH as g,LEAVE_TOUCH_DELAY as R,StatusOptions as k}from"../../constants.js";import{SubjectWellMark as C}from"./SubjectWellMark.js";import q from"./ViewWellSectionsName.js";import T from"./OffsetWellsTableRow.module.css.js";import{convertValue as x}from"../../../../utils/index.js";import{jsxs as D,jsx as O}from"react/jsx-runtime";var S="OffsetWellsTableRow";function I(e,t,l){var i=t.find((function(e){return e.key===l})),a=u(e,i.key);return"undefined"===a?"loading...":Number.isFinite(a)||a&&"Null"!==a?i.unitType?x(a,i.unitType,i.from,i.to):a:"—"}function j(e,t){var l=u(e,w.distance);return Number.isFinite(l)?t?l:x(l,"length","mi","km"):"—"}function M(e,t){var l,i=e.find((function(e){return e.wellId===t.id}));return null!==(l=null==i?void 0:i.taScore)&&void 0!==l?l:""}function _(e,t){var l=e.find((function(e){return e.key===t}));return(null==l?void 0:l.width)||0}var A=function(l){var o,u,x,A=l.columnsWithDict,L=l.data,V=l.subjectWellId,Y=l.metricsKeys,z=l.metricsColumns,E=l.handleChangeOffsetWell,F=l.isWellNameExpand,P=l.wellNameStyle,H=l.wellNameWidth,K=l.isViewOnly,U=l.isImperial,B=l.isLimitedOffsetWells,G=l.maxOffsetWellNumber,J=l.wellSections,Q=l.setActiveWellId,X=l.viewType,Z=l.newCheckedWellId,$=l.setNewCheckedWellId,ee=l.index,te=l.flyDuration,le=l.isWDUser,ie=l.taScores,ae=V===L.id,ne=t({},T.subjectWellRow,ae),se=i(L.checked),re=e(se,2),oe=re[0],ce=re[1],de=a(),ue=!1,me=L[w.name]||"—",fe=me;if(!F&&2*H<8*me.length){var he=function(e){var t=document.createElement("span");document.body.appendChild(t),t.style.font="Roboto",t.style.fontSize="14px",t.style.letterSpacing="0.01071em",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="nowrap",t.innerHTML=e;var l=Math.ceil(t.clientWidth);return document.body.removeChild(t),l}(me);if(he>2*H){var ye=2*H/(he/me.length);fe="".concat(me.substring(0,ye/2-2),"\n... ").concat(me.substring(me.length-ye/2+6)),ue=!0}}var be=n((function(e,t,l,i,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=t-e;de.current.style.position="absolute",de.current.style.top="".concat(e,"px"),de.current.style.zIndex=l===i?4:3,de.current.style.transition="transform ".concat(a,"ms ease ").concat(50*n,"ms"),de.current.style.transform="translateY(".concat(s,"px)")}),[]),pe=n((function(){de.current.style.position="unset",de.current.style.zIndex=1,de.current.style.transition="none",de.current.style.transform="none"}),[]),ve=n((function(e){$(L.id);var t=c(L,"moveTo");E(t,e),ce(e)}),[L,$,E]);s((function(){if(Z){var e=ee*N+16;if(L.moveTo){var t=e+N*L.moveTo;be(e,t,Z,L.id,te,L.delayTime)}}else pe()}),[L.moveTo,Z]),s((function(){ce(L.checked)}),[L.checked]);var we,Ne,We=r((function(){return L[w.wellSection]}),[L]),ge=r((function(){return K?"View only mode. To edit offsets, use ".concat(le?"Offset Selection App":"WellHub","."):B&&!L.checked?"App can’t process more than (".concat(G-1,") Offset Wells."):""}),[K,B,L.checked]);return D(h,{"data-testid":"".concat(S,"_row_").concat(me),className:m(T.bodyRow,t({},T.moveRow,1===Math.abs(L.moveTo)&&Z!==L.id)),innerRef:de,onMouseEnter:function(){Q(L.id)},onMouseLeave:function(){Q(null)},children:[D(y,{"data-testid":"".concat(S,"_well"),className:m(T.bodyCell,T.wellNameCell,ne,(o={},t(o,P,X!==W.mobile),t(o,T.wellNameCellMobile,X===W.mobile),o)),style:{width:F?g:_(A,w.name)},children:[ae&&O(C,{className:m(T.subjectWellMark,t({},T.subjectWellMarkMobile,X===W.mobile))}),!ae&&O(b,{title:ge,placement:"bottom-start",classes:{tooltipPlacementBottom:T.checkboxTooltip},children:O("div",{children:O(p,{"data-testid":"".concat(S,"_checkbox"),size:"medium",checked:oe,classes:{disabled:T.checkboxDisabled},disabled:K||B&&!L.checked,onChange:function(e){return ve(e.target.checked)}})})}),O(b,{title:ue?me:"",children:O(v,{variant:"body2",className:m(T.wellNameCursor,(u={},t(u,T.cellDataViewOnly,ae),t(u,T.wellNamePreWrap,ue),u)),children:ue?fe:me})})]}),O(y,{"data-testid":"".concat(S,"_dot"),className:m(T.bodyCell,ne),style:{width:_(A,w.status)},children:!ae&&O(b,{title:d(L[w.status]),enterTouchDelay:X===W.mobile&&0,leaveTouchDelay:X===W.mobile&&R,children:O("div",{className:T.statusContainer,children:O("div",{"data-testid":"".concat(S,"_color"),className:T.status,style:{background:null===(x=k.find((function(e){return e.value===L[w.status]})))||void 0===x?void 0:x.color}})})})}),O(y,{"data-testid":"".concat(S,"_rig"),className:m(T.bodyCell,ne),style:{width:_(A,w.rig)},children:O(v,{variant:"body2",className:T.cellData,children:L[w.rig]&&"Null"!==L[w.rig]?L[w.rig]:"—"})}),O(y,{"data-testid":"".concat(S,"_distance"),className:m(T.bodyCell,ne),style:{width:_(A,w.distance)},children:O(v,{variant:"body2",className:T.cellData,children:j(L,U)})}),!!ie.length&&O(y,{"data-testid":"".concat(S,"_ta"),className:m(T.bodyCell,ne),style:{width:_(A,w.taScore)},children:O(v,{variant:"body2",className:T.cellData,children:M(ie,L)})}),O(y,{"data-testid":"".concat(S,"_lastActive"),className:m(T.bodyCell,ne),style:{width:_(A,w.lastActive)},children:O(v,{variant:"body2",className:T.cellData,children:L[w.lastActive]&&Number.isFinite(L[w.lastActive])?f.unix(L[w.lastActive]).format("MM/DD/YYYY"):"—"})}),Y.map((function(e){return O(y,{"data-testid":"".concat(S,"_").concat(e),className:m(T.bodyCell,ne),style:{width:_(A,e)},children:O(v,{variant:"body2",className:T.cellData,children:I(L,z,e)})},e)})),O(y,{"data-testid":"".concat(S,"_wellSection"),className:m(T.bodyCell,T.lastCell,ne),style:{width:_(A,w.wellSection)},children:We&&We.length>1?O(b,{classes:{tooltip:T.customTooltip},title:O(q,{wellSectionNames:We}),children:O("div",{className:T.sectionLength,children:We.length})}):O(b,{title:We||"",children:O(v,{variant:"body2",className:T.cellData,style:{color:We&&1===We.length&&(we=We,Ne=e(we,1)[0],J.find((function(e){return e.label===Ne})).color)},children:We})})})]})};A.propTypes={columnsWithDict:o.arrayOf(o.shape({})).isRequired,data:o.shape({id:o.number,checked:o.bool,name:o.string,status:o.string,moveTo:o.number,delayTime:o.number}).isRequired,subjectWellId:o.number.isRequired,metricsKeys:o.arrayOf(o.string).isRequired,metricsColumns:o.arrayOf(o.shape({})).isRequired,handleChangeOffsetWell:o.func.isRequired,isWellNameExpand:o.bool.isRequired,wellNameStyle:o.string.isRequired,wellNameWidth:o.number.isRequired,isViewOnly:o.bool.isRequired,isImperial:o.bool.isRequired,isLimitedOffsetWells:o.bool.isRequired,maxOffsetWellNumber:o.number.isRequired,wellSections:o.arrayOf(o.shape({})).isRequired,setActiveWellId:o.func.isRequired,viewType:o.string.isRequired,newCheckedWellId:o.number.isRequired,setNewCheckedWellId:o.func.isRequired,index:o.number.isRequired,flyDuration:o.number.isRequired,isWDUser:o.bool.isRequired,taScores:o.arrayOf(o.shape({})).isRequired};var L=l(A);export{L as default};
2
2
  //# sourceMappingURL=OffsetWellsTableRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffsetWellsTableRow.js","sources":["../../../../../src/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js"],"sourcesContent":["import { memo, useCallback, useEffect, useRef, useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { startCase, get, omit } from 'lodash';\nimport classNames from 'classnames';\nimport moment from 'moment';\nimport { Typography, Checkbox, Tooltip, TableCell, TableRow } from '@material-ui/core';\n\nimport {\n ColumnType,\n EXPANDED_WELL_NAME_WIDTH,\n LEAVE_TOUCH_DELAY,\n ROW_HEIGHT,\n StatusOptions,\n ViewType,\n} from '../../constants';\n\nimport { SubjectWellMark } from './SubjectWellMark';\nimport ViewWellSectionsName from './ViewWellSectionsName';\n\nimport styles from './OffsetWellsTableRow.module.css';\n\nimport { convertValue } from '~/utils';\n\nconst PAGE_NAME = 'OffsetWellsTableRow';\nconst AVG_CHAR_WIDTH = 8;\n\nfunction formatMetricItem(data, metricsColumns, metricKey) {\n const metric = metricsColumns.find(item => item.key === metricKey);\n const value = get(data, metric.key);\n\n if (value === 'undefined') {\n return 'loading...';\n }\n\n if (Number.isFinite(value) || value) {\n return metric.unitType ? convertValue(value, metric.unitType, metric.from, metric.to) : value;\n }\n\n return '—';\n}\n\nfunction formatDistance(data, isImperial) {\n const value = get(data, ColumnType.distance);\n if (Number.isFinite(value)) {\n return isImperial ? value : convertValue(value, 'length', 'mi', 'km');\n }\n return '—';\n}\n\nfunction getTaValue(taScores, data) {\n const value = taScores.find(taData => taData.wellId === data.id);\n return value?.taScore ?? '';\n}\n\nfunction getCellWidth(columnsWithDict, key) {\n const cell = columnsWithDict.find(item => item.key === key);\n return cell?.width || 0;\n}\n\nfunction getTextWidth(strText) {\n const text = document.createElement('span');\n document.body.appendChild(text);\n text.style.font = 'Roboto';\n text.style.fontSize = '14px';\n text.style.letterSpacing = '0.01071em';\n text.style.height = 'auto';\n text.style.width = 'auto';\n text.style.position = 'absolute';\n text.style.whiteSpace = 'nowrap';\n text.innerHTML = strText;\n const textWidth = Math.ceil(text.clientWidth);\n document.body.removeChild(text);\n return textWidth;\n}\n\nconst OffsetWellsTableRow = ({\n columnsWithDict,\n data,\n subjectWellId,\n metricsKeys,\n metricsColumns,\n handleChangeOffsetWell,\n isWellNameExpand,\n wellNameStyle,\n wellNameWidth,\n isViewOnly,\n isImperial,\n isLimitedOffsetWells,\n maxOffsetWellNumber,\n wellSections,\n setActiveWellId,\n viewType,\n newCheckedWellId,\n setNewCheckedWellId,\n index,\n flyDuration,\n isWDUser,\n taScores,\n}) => {\n const isSubjectWell = subjectWellId === data.id;\n const borderStyle = { [styles.subjectWellRow]: isSubjectWell };\n const [isChecked, setIsChecked] = useState(data.checked);\n const tableRowRef = useRef();\n\n let isOverFlowWellName = false;\n const wellName = data[ColumnType.name] || '—';\n let truncWellName = wellName;\n if (!isWellNameExpand && wellNameWidth * 2 < wellName.length * AVG_CHAR_WIDTH) {\n const wellNameRealWidth = getTextWidth(wellName);\n if (wellNameRealWidth > wellNameWidth * 2) {\n const maxCounts = (wellNameWidth * 2) / (wellNameRealWidth / wellName.length);\n truncWellName = `${wellName.substring(0, maxCounts / 2 - 2)}\\n... ${wellName.substring(\n wellName.length - maxCounts / 2 + 6\n )}`;\n isOverFlowWellName = true;\n }\n }\n\n const flyingAnimation = useCallback(\n (currentTop, targetTop, newCheckedWellId, ownId, flyDuration, delayTime = 0) => {\n const movingOffsetY = targetTop - currentTop;\n tableRowRef.current.style.position = 'absolute';\n tableRowRef.current.style.top = `${currentTop}px`;\n tableRowRef.current.style.zIndex = newCheckedWellId === ownId ? 4 : 3;\n tableRowRef.current.style.transition = `transform ${flyDuration}ms ease ${delayTime * 50}ms`;\n tableRowRef.current.style.transform = `translateY(${movingOffsetY}px)`;\n },\n []\n );\n const clearAnimation = useCallback(() => {\n tableRowRef.current.style.position = 'unset';\n tableRowRef.current.style.zIndex = 1;\n tableRowRef.current.style.transition = 'none';\n tableRowRef.current.style.transform = 'none';\n }, []);\n\n const handleChangeCheckbox = useCallback(\n checked => {\n setNewCheckedWellId(data.id);\n const updateData = omit(data, 'moveTo');\n handleChangeOffsetWell(updateData, checked);\n setIsChecked(checked);\n },\n [data, setNewCheckedWellId, handleChangeOffsetWell]\n );\n useEffect(() => {\n if (newCheckedWellId) {\n const currentTop = index * ROW_HEIGHT + 16;\n if (data.moveTo) {\n const targetTop = currentTop + ROW_HEIGHT * data.moveTo;\n flyingAnimation(\n currentTop,\n targetTop,\n newCheckedWellId,\n data.id,\n flyDuration,\n data.delayTime\n );\n }\n } else {\n clearAnimation();\n }\n }, [data.moveTo, newCheckedWellId]);\n\n useEffect(() => {\n setIsChecked(data.checked);\n }, [data.checked]);\n\n const getSectionColor = ([sectionName]) => {\n return wellSections.find(wellSection => wellSection.label === sectionName).color;\n };\n\n const wellSectionData = useMemo(() => {\n return data[ColumnType.wellSection];\n }, [data]);\n\n const checkboxTooltipText = useMemo(() => {\n if (isViewOnly) {\n return `View only mode. To edit offsets, use ${\n isWDUser ? 'Offset Selection App' : 'WellHub'\n }.`;\n } else if (isLimitedOffsetWells && !data.checked) {\n return `App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`;\n } else {\n return '';\n }\n }, [isViewOnly, isLimitedOffsetWells, data.checked]);\n\n const handleMouseEnter = () => {\n setActiveWellId(data.id);\n };\n\n const handleMouseLeave = () => {\n setActiveWellId(null);\n };\n\n return (\n <TableRow\n data-testid={`${PAGE_NAME}_row_${wellName}`}\n className={classNames(styles.bodyRow, {\n [styles.moveRow]: Math.abs(data.moveTo) === 1 && newCheckedWellId !== data.id,\n })}\n innerRef={tableRowRef}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <TableCell\n data-testid={`${PAGE_NAME}_well`}\n className={classNames(styles.bodyCell, styles.wellNameCell, borderStyle, {\n [wellNameStyle]: viewType !== ViewType.mobile,\n [styles.wellNameCellMobile]: viewType === ViewType.mobile,\n })}\n style={{\n width: isWellNameExpand\n ? EXPANDED_WELL_NAME_WIDTH\n : getCellWidth(columnsWithDict, ColumnType.name),\n }}\n >\n {isSubjectWell && (\n <SubjectWellMark\n className={classNames(styles.subjectWellMark, {\n [styles.subjectWellMarkMobile]: viewType === ViewType.mobile,\n })}\n />\n )}\n {!isSubjectWell && (\n <Tooltip\n title={checkboxTooltipText}\n placement=\"bottom-start\"\n classes={{ tooltipPlacementBottom: styles.checkboxTooltip }}\n >\n <div>\n <Checkbox\n data-testid={`${PAGE_NAME}_checkbox`}\n size=\"medium\"\n checked={isChecked}\n classes={{ disabled: styles.checkboxDisabled }}\n disabled={isViewOnly || (isLimitedOffsetWells && !data.checked)}\n onChange={event => handleChangeCheckbox(event.target.checked)}\n />\n </div>\n </Tooltip>\n )}\n <Tooltip title={isOverFlowWellName ? wellName : ''}>\n <Typography\n variant=\"body2\"\n className={classNames(styles.wellNameCursor, {\n [styles.cellDataViewOnly]: isSubjectWell,\n [styles.wellNamePreWrap]: isOverFlowWellName,\n })}\n >\n {isOverFlowWellName ? truncWellName : wellName}\n </Typography>\n </Tooltip>\n </TableCell>\n\n <TableCell\n data-testid={`${PAGE_NAME}_dot`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.status) }}\n >\n {!isSubjectWell && (\n <Tooltip\n title={startCase(data[ColumnType.status])}\n enterTouchDelay={viewType === ViewType.mobile && 0}\n leaveTouchDelay={viewType === ViewType.mobile && LEAVE_TOUCH_DELAY}\n >\n <div className={styles.statusContainer}>\n <div\n data-testid={`${PAGE_NAME}_color`}\n className={styles.status}\n style={{\n background: StatusOptions.find(item => item.value === data[ColumnType.status])\n ?.color,\n }}\n />\n </div>\n </Tooltip>\n )}\n </TableCell>\n\n <TableCell\n data-testid={`${PAGE_NAME}_rig`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.rig) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {data[ColumnType.rig] && data[ColumnType.rig] !== 'Null' ? data[ColumnType.rig] : '—'}\n </Typography>\n </TableCell>\n\n <TableCell\n data-testid={`${PAGE_NAME}_distance`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.distance) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {formatDistance(data, isImperial)}\n </Typography>\n </TableCell>\n\n {!!taScores.length && (\n <TableCell\n data-testid={`${PAGE_NAME}_ta`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.taScore) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {getTaValue(taScores, data)}\n </Typography>\n </TableCell>\n )}\n\n <TableCell\n data-testid={`${PAGE_NAME}_lastActive`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.lastActive) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {data[ColumnType.lastActive] && Number.isFinite(data[ColumnType.lastActive])\n ? moment.unix(data[ColumnType.lastActive]).format('MM/DD/YYYY')\n : '—'}\n </Typography>\n </TableCell>\n\n {metricsKeys.map(metricsKey => (\n <TableCell\n data-testid={`${PAGE_NAME}_${metricsKey}`}\n key={metricsKey}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, metricsKey) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {formatMetricItem(data, metricsColumns, metricsKey)}\n </Typography>\n </TableCell>\n ))}\n\n <TableCell\n data-testid={`${PAGE_NAME}_wellSection`}\n className={classNames(styles.bodyCell, styles.lastCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.wellSection) }}\n >\n {wellSectionData && wellSectionData.length > 1 ? (\n <Tooltip\n classes={{\n tooltip: styles.customTooltip,\n }}\n title={<ViewWellSectionsName wellSectionNames={wellSectionData} />}\n >\n <div className={styles.sectionLength}>{wellSectionData.length}</div>\n </Tooltip>\n ) : (\n <Tooltip title={wellSectionData || ''}>\n <Typography\n variant=\"body2\"\n className={styles.cellData}\n style={{\n color:\n wellSectionData &&\n wellSectionData.length === 1 &&\n getSectionColor(wellSectionData),\n }}\n >\n {wellSectionData}\n </Typography>\n </Tooltip>\n )}\n </TableCell>\n </TableRow>\n );\n};\n\nOffsetWellsTableRow.propTypes = {\n columnsWithDict: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n data: PropTypes.shape({\n id: PropTypes.number,\n checked: PropTypes.bool,\n name: PropTypes.string,\n status: PropTypes.string,\n moveTo: PropTypes.number,\n delayTime: PropTypes.number,\n }).isRequired,\n subjectWellId: PropTypes.number.isRequired,\n metricsKeys: PropTypes.arrayOf(PropTypes.string).isRequired,\n metricsColumns: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n handleChangeOffsetWell: PropTypes.func.isRequired,\n isWellNameExpand: PropTypes.bool.isRequired,\n wellNameStyle: PropTypes.string.isRequired,\n wellNameWidth: PropTypes.number.isRequired,\n isViewOnly: PropTypes.bool.isRequired,\n isImperial: PropTypes.bool.isRequired,\n isLimitedOffsetWells: PropTypes.bool.isRequired,\n maxOffsetWellNumber: PropTypes.number.isRequired,\n wellSections: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n setActiveWellId: PropTypes.func.isRequired,\n viewType: PropTypes.string.isRequired,\n newCheckedWellId: PropTypes.number.isRequired,\n setNewCheckedWellId: PropTypes.func.isRequired,\n index: PropTypes.number.isRequired,\n flyDuration: PropTypes.number.isRequired,\n isWDUser: PropTypes.bool.isRequired,\n taScores: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n};\n\nexport default memo(OffsetWellsTableRow);\n"],"names":["PAGE_NAME","formatMetricItem","data","metricsColumns","metricKey","metric","find","item","key","value","get","Number","isFinite","unitType","convertValue","from","to","formatDistance","isImperial","ColumnType","distance","getTaValue","taScores","_value$taScore","taData","wellId","id","taScore","getCellWidth","columnsWithDict","cell","width","OffsetWellsTableRow","_ref","_classNames2","_classNames4","_StatusOptions$find","subjectWellId","metricsKeys","handleChangeOffsetWell","isWellNameExpand","wellNameStyle","wellNameWidth","isViewOnly","isLimitedOffsetWells","maxOffsetWellNumber","wellSections","setActiveWellId","viewType","newCheckedWellId","setNewCheckedWellId","index","flyDuration","isWDUser","isSubjectWell","borderStyle","styles","subjectWellRow","_useState","useState","checked","_useState2","_slicedToArray","isChecked","setIsChecked","tableRowRef","useRef","isOverFlowWellName","wellName","name","truncWellName","length","wellNameRealWidth","strText","text","document","createElement","body","appendChild","style","font","fontSize","letterSpacing","height","position","whiteSpace","innerHTML","textWidth","Math","ceil","clientWidth","removeChild","getTextWidth","maxCounts","substring","concat","flyingAnimation","useCallback","currentTop","targetTop","ownId","delayTime","movingOffsetY","current","top","zIndex","transition","transform","clearAnimation","handleChangeCheckbox","updateData","omit","useEffect","ROW_HEIGHT","moveTo","_ref2","sectionName","wellSectionData","useMemo","wellSection","checkboxTooltipText","_jsxs","TableRow","className","classNames","bodyRow","_defineProperty","moveRow","abs","innerRef","onMouseEnter","onMouseLeave","children","TableCell","bodyCell","wellNameCell","ViewType","mobile","wellNameCellMobile","EXPANDED_WELL_NAME_WIDTH","_jsx","SubjectWellMark","subjectWellMark","subjectWellMarkMobile","Tooltip","title","placement","classes","tooltipPlacementBottom","checkboxTooltip","Checkbox","size","disabled","checkboxDisabled","onChange","event","target","Typography","variant","wellNameCursor","cellDataViewOnly","wellNamePreWrap","status","startCase","enterTouchDelay","leaveTouchDelay","LEAVE_TOUCH_DELAY","statusContainer","background","StatusOptions","color","rig","cellData","lastActive","moment","unix","format","map","metricsKey","lastCell","tooltip","customTooltip","ViewWellSectionsName","wellSectionNames","sectionLength","label","propTypes","PropTypes","arrayOf","shape","isRequired","number","bool","string","func","memo"],"mappings":"y0BAuBA,IAAMA,EAAY,sBAGlB,SAASC,EAAiBC,EAAMC,EAAgBC,GAC9C,IAAMC,EAASF,EAAeG,MAAK,SAAAC,GAAI,OAAIA,EAAKC,MAAQJ,KAClDK,EAAQC,EAAIR,EAAMG,EAAOG,KAE/B,MAAc,cAAVC,EACK,aAGLE,OAAOC,SAASH,IAAUA,EACrBJ,EAAOQ,SAAWC,EAAaL,EAAOJ,EAAOQ,SAAUR,EAAOU,KAAMV,EAAOW,IAAMP,EAGnF,GACT,CAEA,SAASQ,EAAef,EAAMgB,GAC5B,IAAMT,EAAQC,EAAIR,EAAMiB,EAAWC,UACnC,OAAIT,OAAOC,SAASH,GACXS,EAAaT,EAAQK,EAAaL,EAAO,SAAU,KAAM,MAE3D,GACT,CAEA,SAASY,EAAWC,EAAUpB,GAAM,IAAAqB,EAC5Bd,EAAQa,EAAShB,MAAK,SAA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AQyB,EAAUM,OAClB/E,OAAQyE,EAAUI,OAClB1F,UAAWsF,EAAUI,SACpBD,WACHzJ,cAAesJ,EAAUI,OAAOD,WAChCxJ,YAAaqJ,EAAUC,QAAQD,EAAUM,QAAQH,WACjD3L,eAAgBwL,EAAUC,QAAQD,EAAUE,MAAM,CAAA,IAAKC,WACvDvJ,uBAAwBoJ,EAAUO,KAAKJ,WACvCtJ,iBAAkBmJ,EAAUK,KAAKF,WACjCrJ,cAAekJ,EAAUM,OAAOH,WAChCpJ,cAAeiJ,EAAUI,OAAOD,WAChCnJ,WAAYgJ,EAAUK,KAAKF,WAC3B5K,WAAYyK,EAAUK,KAAKF,WAC3BlJ,qBAAsB+I,EAAUK,KAAKF,WACrCjJ,oBAAqB8I,EAAUI,OAAOD,WACtChJ,aAAc6I,EAAUC,QAAQD,EAAUE,MAAM,CAAA,IAAKC,WACrD/I,gBAAiB4I,EAAUO,KAAKJ,WAChC9I,SAAU2I,EAAUM,OAAOH,WAC3B7I,iBAAkB0I,EAAUI,OAAOD,WACnC5I,oBAAqByI,EAAUO,KAAKJ,WACpC3I,MAAOwI,EAAUI,OAAOD,WACxB1I,YAAauI,EAAUI,OAAOD,WAC9BzI,SAAUsI,EAAUK,KAAKF,WACzBxK,SAAUqK,EAAUC,QAAQD,EAAUE,MAAM,CAAA,IAAKC,YAGnD,IAAeK,EAAAA,EAAKnK"}
1
+ {"version":3,"file":"OffsetWellsTableRow.js","sources":["../../../../../src/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js"],"sourcesContent":["import { memo, useCallback, useEffect, useRef, useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { startCase, get, omit } from 'lodash';\nimport classNames from 'classnames';\nimport moment from 'moment';\nimport { Typography, Checkbox, Tooltip, TableCell, TableRow } from '@material-ui/core';\n\nimport {\n ColumnType,\n EXPANDED_WELL_NAME_WIDTH,\n LEAVE_TOUCH_DELAY,\n ROW_HEIGHT,\n StatusOptions,\n ViewType,\n} from '../../constants';\n\nimport { SubjectWellMark } from './SubjectWellMark';\nimport ViewWellSectionsName from './ViewWellSectionsName';\n\nimport styles from './OffsetWellsTableRow.module.css';\n\nimport { convertValue } from '~/utils';\n\nconst PAGE_NAME = 'OffsetWellsTableRow';\nconst AVG_CHAR_WIDTH = 8;\n\nfunction formatMetricItem(data, metricsColumns, metricKey) {\n const metric = metricsColumns.find(item => item.key === metricKey);\n const value = get(data, metric.key);\n\n if (value === 'undefined') {\n return 'loading...';\n }\n\n if (Number.isFinite(value) || (value && value !== 'Null')) {\n return metric.unitType ? convertValue(value, metric.unitType, metric.from, metric.to) : value;\n }\n\n return '—';\n}\n\nfunction formatDistance(data, isImperial) {\n const value = get(data, ColumnType.distance);\n if (Number.isFinite(value)) {\n return isImperial ? value : convertValue(value, 'length', 'mi', 'km');\n }\n return '—';\n}\n\nfunction getTaValue(taScores, data) {\n const value = taScores.find(taData => taData.wellId === data.id);\n return value?.taScore ?? '';\n}\n\nfunction getCellWidth(columnsWithDict, key) {\n const cell = columnsWithDict.find(item => item.key === key);\n return cell?.width || 0;\n}\n\nfunction getTextWidth(strText) {\n const text = document.createElement('span');\n document.body.appendChild(text);\n text.style.font = 'Roboto';\n text.style.fontSize = '14px';\n text.style.letterSpacing = '0.01071em';\n text.style.height = 'auto';\n text.style.width = 'auto';\n text.style.position = 'absolute';\n text.style.whiteSpace = 'nowrap';\n text.innerHTML = strText;\n const textWidth = Math.ceil(text.clientWidth);\n document.body.removeChild(text);\n return textWidth;\n}\n\nconst OffsetWellsTableRow = ({\n columnsWithDict,\n data,\n subjectWellId,\n metricsKeys,\n metricsColumns,\n handleChangeOffsetWell,\n isWellNameExpand,\n wellNameStyle,\n wellNameWidth,\n isViewOnly,\n isImperial,\n isLimitedOffsetWells,\n maxOffsetWellNumber,\n wellSections,\n setActiveWellId,\n viewType,\n newCheckedWellId,\n setNewCheckedWellId,\n index,\n flyDuration,\n isWDUser,\n taScores,\n}) => {\n const isSubjectWell = subjectWellId === data.id;\n const borderStyle = { [styles.subjectWellRow]: isSubjectWell };\n const [isChecked, setIsChecked] = useState(data.checked);\n const tableRowRef = useRef();\n\n let isOverFlowWellName = false;\n const wellName = data[ColumnType.name] || '—';\n let truncWellName = wellName;\n if (!isWellNameExpand && wellNameWidth * 2 < wellName.length * AVG_CHAR_WIDTH) {\n const wellNameRealWidth = getTextWidth(wellName);\n if (wellNameRealWidth > wellNameWidth * 2) {\n const maxCounts = (wellNameWidth * 2) / (wellNameRealWidth / wellName.length);\n truncWellName = `${wellName.substring(0, maxCounts / 2 - 2)}\\n... ${wellName.substring(\n wellName.length - maxCounts / 2 + 6\n )}`;\n isOverFlowWellName = true;\n }\n }\n\n const flyingAnimation = useCallback(\n (currentTop, targetTop, newCheckedWellId, ownId, flyDuration, delayTime = 0) => {\n const movingOffsetY = targetTop - currentTop;\n tableRowRef.current.style.position = 'absolute';\n tableRowRef.current.style.top = `${currentTop}px`;\n tableRowRef.current.style.zIndex = newCheckedWellId === ownId ? 4 : 3;\n tableRowRef.current.style.transition = `transform ${flyDuration}ms ease ${delayTime * 50}ms`;\n tableRowRef.current.style.transform = `translateY(${movingOffsetY}px)`;\n },\n []\n );\n const clearAnimation = useCallback(() => {\n tableRowRef.current.style.position = 'unset';\n tableRowRef.current.style.zIndex = 1;\n tableRowRef.current.style.transition = 'none';\n tableRowRef.current.style.transform = 'none';\n }, []);\n\n const handleChangeCheckbox = useCallback(\n checked => {\n setNewCheckedWellId(data.id);\n const updateData = omit(data, 'moveTo');\n handleChangeOffsetWell(updateData, checked);\n setIsChecked(checked);\n },\n [data, setNewCheckedWellId, handleChangeOffsetWell]\n );\n useEffect(() => {\n if (newCheckedWellId) {\n const currentTop = index * ROW_HEIGHT + 16;\n if (data.moveTo) {\n const targetTop = currentTop + ROW_HEIGHT * data.moveTo;\n flyingAnimation(\n currentTop,\n targetTop,\n newCheckedWellId,\n data.id,\n flyDuration,\n data.delayTime\n );\n }\n } else {\n clearAnimation();\n }\n }, [data.moveTo, newCheckedWellId]);\n\n useEffect(() => {\n setIsChecked(data.checked);\n }, [data.checked]);\n\n const getSectionColor = ([sectionName]) => {\n return wellSections.find(wellSection => wellSection.label === sectionName).color;\n };\n\n const wellSectionData = useMemo(() => {\n return data[ColumnType.wellSection];\n }, [data]);\n\n const checkboxTooltipText = useMemo(() => {\n if (isViewOnly) {\n return `View only mode. To edit offsets, use ${\n isWDUser ? 'Offset Selection App' : 'WellHub'\n }.`;\n } else if (isLimitedOffsetWells && !data.checked) {\n return `App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`;\n } else {\n return '';\n }\n }, [isViewOnly, isLimitedOffsetWells, data.checked]);\n\n const handleMouseEnter = () => {\n setActiveWellId(data.id);\n };\n\n const handleMouseLeave = () => {\n setActiveWellId(null);\n };\n\n return (\n <TableRow\n data-testid={`${PAGE_NAME}_row_${wellName}`}\n className={classNames(styles.bodyRow, {\n [styles.moveRow]: Math.abs(data.moveTo) === 1 && newCheckedWellId !== data.id,\n })}\n innerRef={tableRowRef}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <TableCell\n data-testid={`${PAGE_NAME}_well`}\n className={classNames(styles.bodyCell, styles.wellNameCell, borderStyle, {\n [wellNameStyle]: viewType !== ViewType.mobile,\n [styles.wellNameCellMobile]: viewType === ViewType.mobile,\n })}\n style={{\n width: isWellNameExpand\n ? EXPANDED_WELL_NAME_WIDTH\n : getCellWidth(columnsWithDict, ColumnType.name),\n }}\n >\n {isSubjectWell && (\n <SubjectWellMark\n className={classNames(styles.subjectWellMark, {\n [styles.subjectWellMarkMobile]: viewType === ViewType.mobile,\n })}\n />\n )}\n {!isSubjectWell && (\n <Tooltip\n title={checkboxTooltipText}\n placement=\"bottom-start\"\n classes={{ tooltipPlacementBottom: styles.checkboxTooltip }}\n >\n <div>\n <Checkbox\n data-testid={`${PAGE_NAME}_checkbox`}\n size=\"medium\"\n checked={isChecked}\n classes={{ disabled: styles.checkboxDisabled }}\n disabled={isViewOnly || (isLimitedOffsetWells && !data.checked)}\n onChange={event => handleChangeCheckbox(event.target.checked)}\n />\n </div>\n </Tooltip>\n )}\n <Tooltip title={isOverFlowWellName ? wellName : ''}>\n <Typography\n variant=\"body2\"\n className={classNames(styles.wellNameCursor, {\n [styles.cellDataViewOnly]: isSubjectWell,\n [styles.wellNamePreWrap]: isOverFlowWellName,\n })}\n >\n {isOverFlowWellName ? truncWellName : wellName}\n </Typography>\n </Tooltip>\n </TableCell>\n\n <TableCell\n data-testid={`${PAGE_NAME}_dot`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.status) }}\n >\n {!isSubjectWell && (\n <Tooltip\n title={startCase(data[ColumnType.status])}\n enterTouchDelay={viewType === ViewType.mobile && 0}\n leaveTouchDelay={viewType === ViewType.mobile && LEAVE_TOUCH_DELAY}\n >\n <div className={styles.statusContainer}>\n <div\n data-testid={`${PAGE_NAME}_color`}\n className={styles.status}\n style={{\n background: StatusOptions.find(item => item.value === data[ColumnType.status])\n ?.color,\n }}\n />\n </div>\n </Tooltip>\n )}\n </TableCell>\n\n <TableCell\n data-testid={`${PAGE_NAME}_rig`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.rig) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {data[ColumnType.rig] && data[ColumnType.rig] !== 'Null' ? data[ColumnType.rig] : '—'}\n </Typography>\n </TableCell>\n\n <TableCell\n data-testid={`${PAGE_NAME}_distance`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.distance) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {formatDistance(data, isImperial)}\n </Typography>\n </TableCell>\n\n {!!taScores.length && (\n <TableCell\n data-testid={`${PAGE_NAME}_ta`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.taScore) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {getTaValue(taScores, data)}\n </Typography>\n </TableCell>\n )}\n\n <TableCell\n data-testid={`${PAGE_NAME}_lastActive`}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.lastActive) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {data[ColumnType.lastActive] && Number.isFinite(data[ColumnType.lastActive])\n ? moment.unix(data[ColumnType.lastActive]).format('MM/DD/YYYY')\n : '—'}\n </Typography>\n </TableCell>\n\n {metricsKeys.map(metricsKey => (\n <TableCell\n data-testid={`${PAGE_NAME}_${metricsKey}`}\n key={metricsKey}\n className={classNames(styles.bodyCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, metricsKey) }}\n >\n <Typography variant=\"body2\" className={styles.cellData}>\n {formatMetricItem(data, metricsColumns, metricsKey)}\n </Typography>\n </TableCell>\n ))}\n\n <TableCell\n data-testid={`${PAGE_NAME}_wellSection`}\n className={classNames(styles.bodyCell, styles.lastCell, borderStyle)}\n style={{ width: getCellWidth(columnsWithDict, ColumnType.wellSection) }}\n >\n {wellSectionData && wellSectionData.length > 1 ? (\n <Tooltip\n classes={{\n tooltip: styles.customTooltip,\n }}\n title={<ViewWellSectionsName wellSectionNames={wellSectionData} />}\n >\n <div className={styles.sectionLength}>{wellSectionData.length}</div>\n </Tooltip>\n ) : (\n <Tooltip title={wellSectionData || ''}>\n <Typography\n variant=\"body2\"\n className={styles.cellData}\n style={{\n color:\n wellSectionData &&\n wellSectionData.length === 1 &&\n getSectionColor(wellSectionData),\n }}\n >\n {wellSectionData}\n </Typography>\n </Tooltip>\n )}\n </TableCell>\n </TableRow>\n );\n};\n\nOffsetWellsTableRow.propTypes = {\n columnsWithDict: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n data: PropTypes.shape({\n id: PropTypes.number,\n checked: PropTypes.bool,\n name: PropTypes.string,\n status: PropTypes.string,\n moveTo: PropTypes.number,\n delayTime: PropTypes.number,\n }).isRequired,\n subjectWellId: PropTypes.number.isRequired,\n metricsKeys: PropTypes.arrayOf(PropTypes.string).isRequired,\n metricsColumns: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n handleChangeOffsetWell: PropTypes.func.isRequired,\n isWellNameExpand: PropTypes.bool.isRequired,\n wellNameStyle: PropTypes.string.isRequired,\n wellNameWidth: PropTypes.number.isRequired,\n isViewOnly: PropTypes.bool.isRequired,\n isImperial: PropTypes.bool.isRequired,\n isLimitedOffsetWells: PropTypes.bool.isRequired,\n maxOffsetWellNumber: PropTypes.number.isRequired,\n wellSections: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n setActiveWellId: PropTypes.func.isRequired,\n viewType: PropTypes.string.isRequired,\n newCheckedWellId: PropTypes.number.isRequired,\n setNewCheckedWellId: PropTypes.func.isRequired,\n index: PropTypes.number.isRequired,\n flyDuration: PropTypes.number.isRequired,\n isWDUser: PropTypes.bool.isRequired,\n taScores: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n};\n\nexport default memo(OffsetWellsTableRow);\n"],"names":["PAGE_NAME","formatMetricItem","data","metricsColumns","metricKey","metric","find","item","key","value","get","Number","isFinite","unitType","convertValue","from","to","formatDistance","isImperial","ColumnType","distance","getTaValue","taScores","_value$taScore","taData","wellId","id","taScore","getCellWidth","columnsWithDict","cell","width","OffsetWellsTableRow","_ref","_classNames2","_classNames4","_StatusOptions$find","subjectWellId","metricsKeys","handleChangeOffsetWell","isWellNameExpand","wellNameStyle","wellNameWidth","isViewOnly","isLimitedOffsetWells","maxOffsetWellNumber","wellSections","setActiveWellId","viewType","newCheckedWellId","setNewCheckedWellId","index","flyDuration","isWDUser","isSubjectWell","borderStyle","styles","subjectWellRow","_useState","useState","checked","_useState2","_slicedToArray","isChecked","setIsChecked","tableRowRef","useRef","isOverFlowWellName","wellName","name","truncWellName","length","wellNameRealWidth","strText","text","document","createElement","body","appendChild","style","font","fontSize","letterSpacing","height","position","whiteSpace","innerHTML","textWidth","Math","ceil","clientWidth","removeChild","getTextWidth","maxCounts","substring","concat","flyingAnimation","useCallback","currentTop","targetTop","ownId","delayTime","movingOffsetY","current","top","zIndex","transition","transform","clearAnimation","handleChangeCheckbox","updateData","omit","useEffect","ROW_HEIGHT","moveTo","_ref2","sectionName","wellSectionData","useMemo","wellSection","checkboxTooltipText","_jsxs","TableRow","className","classNames","bodyRow","_defineProperty","moveRow","abs","innerRef","onMouseEnter","onMouseLeave","children","TableCell","bodyCell","wellNameCell","ViewType","mobile","wellNameCellMobile","EXPANDED_WELL_NAME_WIDTH","_jsx","SubjectWellMark","subjectWellMark","subjectWellMarkMobile","Tooltip","title","placement","classes","tooltipPlacementBottom","checkboxTooltip","Checkbox","size","disabled","checkboxDisabled","onChange","event","target","Typography","variant","wellNameCursor","cellDataViewOnly","wellNamePreWrap","status","startCase","enterTouchDelay","leaveTouchDelay","LEAVE_TOUCH_DELAY","statusContainer","background","StatusOptions","color","rig","cellData","lastActive","moment","unix","format","map","metricsKey","lastCell","tooltip","customTooltip","ViewWellSectionsName","wellSectionNames","sectionLength","label","propTypes","PropTypes","arrayOf","shape","isRequired","number","bool","string","func","memo"],"mappings":"y0BAuBA,IAAMA,EAAY,sBAGlB,SAASC,EAAiBC,EAAMC,EAAgBC,GAC9C,IAAMC,EAASF,EAAeG,MAAK,SAAAC,GAAI,OAAIA,EAAKC,MAAQJ,KAClDK,EAAQC,EAAIR,EAAMG,EAAOG,KAE/B,MAAc,cAAVC,EACK,aAGLE,OAAOC,SAASH,IAAWA,GAAmB,SAAVA,EAC/BJ,EAAOQ,SAAWC,EAAaL,EAAOJ,EAAOQ,SAAUR,EAAOU,KAAMV,EAAOW,IAAMP,EAGnF,GACT,CAEA,SAASQ,EAAef,EAAMgB,GAC5B,IAAMT,EAAQC,EAAIR,EAAMiB,EAAWC,UACnC,OAAIT,OAAOC,SAASH,GACXS,EAAaT,EAAQK,EAAaL,EAAO,SAAU,KAAM,MAE3D,GACT,CAEA,SAASY,EAAWC,EAAU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,QAAS+H,EAAUK,KACnB3H,KAAMsH,EAAUM,OAChB/B,OAAQyB,EAAUM,OAClB/E,OAAQyE,EAAUI,OAClB1F,UAAWsF,EAAUI,SACpBD,WACHzJ,cAAesJ,EAAUI,OAAOD,WAChCxJ,YAAaqJ,EAAUC,QAAQD,EAAUM,QAAQH,WACjD3L,eAAgBwL,EAAUC,QAAQD,EAAUE,MAAM,CAAA,IAAKC,WACvDvJ,uBAAwBoJ,EAAUO,KAAKJ,WACvCtJ,iBAAkBmJ,EAAUK,KAAKF,WACjCrJ,cAAekJ,EAAUM,OAAOH,WAChCpJ,cAAeiJ,EAAUI,OAAOD,WAChCnJ,WAAYgJ,EAAUK,KAAKF,WAC3B5K,WAAYyK,EAAUK,KAAKF,WAC3BlJ,qBAAsB+I,EAAUK,KAAKF,WACrCjJ,oBAAqB8I,EAAUI,OAAOD,WACtChJ,aAAc6I,EAAUC,QAAQD,EAAUE,MAAM,CAAA,IAAKC,WACrD/I,gBAAiB4I,EAAUO,KAAKJ,WAChC9I,SAAU2I,EAAUM,OAAOH,WAC3B7I,iBAAkB0I,EAAUI,OAAOD,WACnC5I,oBAAqByI,EAAUO,KAAKJ,WACpC3I,MAAOwI,EAAUI,OAAOD,WACxB1I,YAAauI,EAAUI,OAAOD,WAC9BzI,SAAUsI,EAAUK,KAAKF,WACzBxK,SAAUqK,EAAUC,QAAQD,EAAUE,MAAM,CAAA,IAAKC,YAGnD,IAAeK,EAAAA,EAAKnK"}
@@ -23,6 +23,7 @@ export const LEAVE_TOUCH_DELAY: 10000;
23
23
  export const COMPANY_PROVIDERS_FOR_IDAS: string[];
24
24
  export const SEARCH_CELL_DEFAULT_WIDTH: 1020;
25
25
  export const SEARCH_CELL_EXPAND_WIDTH: 1270;
26
+ export const NonConvertableMetrics: string[];
26
27
  export namespace FilterType {
27
28
  let status: string;
28
29
  let rig: string;
@@ -76,69 +77,10 @@ export const OBJECTIVE_PERIOD_LIST: {
76
77
  label: string;
77
78
  }[];
78
79
  export const MAX_METRICS_COUNT: 3;
79
- export const METRICS_LIST: ({
80
+ export const METRICS_LIST: {
80
81
  label: string;
81
82
  key: string;
82
- isBiggestBest: boolean;
83
- unitType: string;
84
- from: string;
85
- convertForMultiRigs: ({ maxVal }: {
86
- maxVal: any;
87
- }) => any;
88
- category: {
89
- label: string;
90
- value: string;
91
- };
92
- } | {
93
- label: string;
94
- key: string;
95
- unitType: string;
96
- from: string;
97
- convertForMultiRigs: ({ sumVal }: {
98
- sumVal: any;
99
- }) => any;
100
- category: {
101
- label: string;
102
- value: string;
103
- };
104
- } | {
105
- label: string;
106
- key: string;
107
- to: string;
108
- convertForMultiRigs: ({ sumVal }: {
109
- sumVal: any;
110
- }) => any;
111
- category: {
112
- label: string;
113
- value: string;
114
- };
115
- } | {
116
- label: string;
117
- labelFunc: () => string;
118
- key: string;
119
- customConvert: (value: any) => number;
120
- convertForMultiRigs: ({ sumVal, number }: {
121
- sumVal: any;
122
- number: any;
123
- }) => number;
124
- category: {
125
- label: string;
126
- value: string;
127
- };
128
- } | {
129
- label: string;
130
- key: string;
131
- unitType: string;
132
- from: string;
133
- to: string;
134
- convertForMultiRigs: ({ maxVal }: {
135
- maxVal: any;
136
- }) => any;
137
- category: {
138
- label: string;
139
- value: string;
140
- };
141
- })[];
83
+ }[];
142
84
  export namespace DEFAULT_SETTINGS {
143
85
  let radius_1: number;
144
86
  export { radius_1 as radius };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV4/constants.js"],"names":[],"mappings":"AAIA,sCAAuC;AACvC,qCAAsC;;;;;;;;AAQtC,mCAAoC;AACpC,yCAA0C;AAC1C,2CAA4C;AAE5C,uCAAwC;AACxC,+BAAgC;AAChC,2CAA4C;AAC5C,mCAAoC;AAEpC,oCAAqC;AACrC,sCAAuC;AACvC,2CAA4C;AAC5C,+BAAgC;AAChC,4BAA6B;AAC7B,sCAAuC;AACvC,kDAAkD;AAClD,6CAA8C;AAC9C,4CAA6C;;;;;;;;;;;;;;;;AAmB7C;;;IA6BE;;;;;;;;AAUF;;;IAME;;;;;;;;;;;;;AAaF;;;;;IAiDE;AAEF;;;IAOE;AAEF,kCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCE;;;;;;;;;;AAWF,yCAYE;AAEF;;EAME;AAEF,sDAAuD"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV4/constants.js"],"names":[],"mappings":"AAIA,sCAAuC;AACvC,qCAAsC;;;;;;;;AAQtC,mCAAoC;AACpC,yCAA0C;AAC1C,2CAA4C;AAE5C,uCAAwC;AACxC,+BAAgC;AAChC,2CAA4C;AAC5C,mCAAoC;AAEpC,oCAAqC;AACrC,sCAAuC;AACvC,2CAA4C;AAC5C,+BAAgC;AAChC,4BAA6B;AAC7B,sCAAuC;AACvC,kDAAkD;AAClD,6CAA8C;AAC9C,4CAA6C;AAG7C,6CAA4D;;;;;;;;;;;;;;;;AAkB5D;;;IA6BE;;;;;;;;AAUF;;;IAME;;;;;;;;;;;;;AAaF;;;;;IAiDE;AAEF;;;IAOE;AAEF,kCAAmC;AAEnC;;;IAuCE;;;;;;;;;;AAWF,yCAYE;AAEF;;EAME;AAEF,sDAAuD"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{sortBy as a}from"lodash";import"../../utils/index.js";import*as l from"../../utils/metrics/metricsConfig.js";var i,o=800,r=650,s={none:"none",normal:"normal",small:"small screen",tablet:"tablet",mobile:"mobile"},n=1e3,p=50,_=50,d="Android",m="iOS",c="Window Phone",u="other",g="all",b="All",v=450,h=50,y=60,F=1e4,E=["xto"],A=1020,w=1270,f=l,D={status:"status",rig:"rigName",program:"programName",basin:"basin",county:"county",area:"area",formation:"formation",stringDesign:"stringDesign",radius:"radius",period:"period",sideTracks:"sideTracks",timeRangeFrom:"timeRangeFrom",timeRangeTo:"timeRangeTo"},S=[{value:D.rig,label:"Rig"},{value:D.program,label:"Program/BU"},{value:D.basin,label:"Basin"},{value:D.county,label:"County"},{value:D.area,label:"Area"},{value:D.formation,label:"Target Formation"},{value:D.stringDesign,label:"String Design"}],k={unknown:"unknown",idle:"idle",active:"active",paused:"paused",complete:"complete"},C=[{value:k.unknown,color:"#9E9E9E"},{value:k.idle,color:"#BDBDBD"},{value:k.active,color:"#95F126"},{value:k.paused,color:"#FFF350"},{value:k.complete,color:"#2196F3"}],R={name:"name",status:"status",rig:"rigName",distance:"distance",taScore:"TA",lastActive:"lastActive",metrics:"metrics",wellSection:"wellSection"},N=[{type:R.name,label:"Well Name",key:R.name,width:[280,197,197,186]},{type:R.status,label:"",key:R.status,width:[40,40,40,30]},{type:R.rig,label:"Rig",key:R.rig,width:[220,140,140,93]},{type:R.distance,label:"Distance",key:R.distance,width:[160,160,122,93]},{type:R.taScore,label:"TA",key:R.taScore,width:[90,90,75,70]},{type:R.lastActive,label:"Last Active",key:R.lastActive,width:[140,140,108,98]},{type:R.metrics,label:"",key:"",width:[0,212,141,141]},{type:R.wellSection,label:"Well Section",key:R.wellSection,width:[180,131,131,97]}],T=[{value:"all",label:"All"},{value:"last12h",label:"Last 12 hrs"},{value:"last24h",label:"Last 24 hrs"},{value:"last7d",label:"Last 7 days"},{value:"lastMonth",label:"Last Month"},{value:"custom",label:"Custom"}],B=3,I=a([f.weight_to_weight_average,f.bottom_to_slips_average,f.drilling_connection_average,f.slips_to_bottom_average,f.hole_depth,f.hole_depth_change,f.drilled_feet_rotary,f.drilled_feet_slide,f.rop_gross,f.rop,f.rop_rotary,f.rop_slide,f.drilled_feet_rotary_percentage,f.drilled_feet_slide_percentage,f.on_bottom_percentage,f.on_bottom_time,f.cost_per_ft,f.cost_per_lat_ft,f.feet_per_day,f.tripping_in_speed_cased,f.tripping_in_speed_open,f.tripping_in_speed,f.tripping_out_speed_cased,f.tripping_out_speed_open,f.tripping_out_speed].concat(t("production"!==process.env.REACT_APP_ENVIRONMENT?[f.npt,f.circulating_time,f.spud_to_rig_release_time,f.spud_to_total_depth_time]:[])),"label"),L=["#6EACFF","#69B919","#E95DAF","#A77DFF","#77FFC1","#018EFE","#FF5D7E","#B9E310","#FFD111","#24BB8E","#C426F3"],P=(e(i={},s.small,0),e(i,s.mobile,52),e(i,s.none,48),e(i,s.tablet,48),e(i,s.normal,48),i),U="hole_depth_change",x={SUCCESS:"succeeded",FAILURE:"failed"},G={INITIAL:0,TRIGGERED:1,RUNNING:2,SUCCEEDED:3,FAILED:-1};export{g as ALL_SECTION_KEY,b as ALL_SECTION_LABEL,d as ANDROID_DEVICE,E as COMPANY_PROVIDERS_FOR_IDAS,R as ColumnType,p as DEFAULT_BIC_OFFSET_SIZE,_ as DEFAULT_LOCAL_OFFSET_SIZE,U as DEFAULT_METRICS_KEY,v as EXPANDED_WELL_NAME_WIDTH,S as FilterOptions,D as FilterType,m as IOS_DEVICE,F as LEAVE_TOUCH_DELAY,B as MAX_METRICS_COUNT,n as MAX_OFFSET_SIZE,I as METRICS_LIST,T as OBJECTIVE_PERIOD_LIST,u as OTHER_DEVICE,G as RESYNC_STATUS,x as RESYNC_TASK_RESPONSE,h as ROWS_PER_PAGE,y as ROW_HEIGHT,A as SEARCH_CELL_DEFAULT_WIDTH,w as SEARCH_CELL_EXPAND_WIDTH,o as SMALL_SCREEN_HEIGHT,r as SMALL_SCREEN_WIDTH,C as StatusOptions,P as TOP_GRADIENT_MAP,N as TableColumns,s as ViewType,c as WINDOWS_PHONE,L as WellSectionColors,k as WellStatus};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{sortBy as a}from"lodash";import"../../utils/index.js";import*as l from"../../utils/metrics/metricsConfig.js";var i,o=800,r=650,s={none:"none",normal:"normal",small:"small screen",tablet:"tablet",mobile:"mobile"},n=1e3,p=50,_=50,d="Android",m="iOS",c="Window Phone",u="other",g="all",b="All",v=450,h=50,y=60,F=1e4,E=["xto"],A=1020,f=1270,w=l,D=[w.mud_type.key],k={status:"status",rig:"rigName",program:"programName",basin:"basin",county:"county",area:"area",formation:"formation",stringDesign:"stringDesign",radius:"radius",period:"period",sideTracks:"sideTracks",timeRangeFrom:"timeRangeFrom",timeRangeTo:"timeRangeTo"},S=[{value:k.rig,label:"Rig"},{value:k.program,label:"Program/BU"},{value:k.basin,label:"Basin"},{value:k.county,label:"County"},{value:k.area,label:"Area"},{value:k.formation,label:"Target Formation"},{value:k.stringDesign,label:"String Design"}],C={unknown:"unknown",idle:"idle",active:"active",paused:"paused",complete:"complete"},R=[{value:C.unknown,color:"#9E9E9E"},{value:C.idle,color:"#BDBDBD"},{value:C.active,color:"#95F126"},{value:C.paused,color:"#FFF350"},{value:C.complete,color:"#2196F3"}],N={name:"name",status:"status",rig:"rigName",distance:"distance",taScore:"TA",lastActive:"lastActive",metrics:"metrics",wellSection:"wellSection"},T=[{type:N.name,label:"Well Name",key:N.name,width:[280,197,197,186]},{type:N.status,label:"",key:N.status,width:[40,40,40,30]},{type:N.rig,label:"Rig",key:N.rig,width:[220,140,140,93]},{type:N.distance,label:"Distance",key:N.distance,width:[160,160,122,93]},{type:N.taScore,label:"TA",key:N.taScore,width:[90,90,75,70]},{type:N.lastActive,label:"Last Active",key:N.lastActive,width:[140,140,108,98]},{type:N.metrics,label:"",key:"",width:[0,212,141,141]},{type:N.wellSection,label:"Well Section",key:N.wellSection,width:[180,131,131,97]}],B=[{value:"all",label:"All"},{value:"last12h",label:"Last 12 hrs"},{value:"last24h",label:"Last 24 hrs"},{value:"last7d",label:"Last 7 days"},{value:"lastMonth",label:"Last Month"},{value:"custom",label:"Custom"}],I=3,L=a([w.weight_to_weight_average,w.bottom_to_slips_average,w.drilling_connection_average,w.slips_to_bottom_average,w.hole_depth,w.hole_depth_change,w.drilled_feet_rotary,w.drilled_feet_slide,w.rop_gross,w.rop,w.rop_rotary,w.rop_slide,w.drilled_feet_rotary_percentage,w.drilled_feet_slide_percentage,w.on_bottom_percentage,w.on_bottom_time,w.cost_per_ft,w.cost_per_lat_ft,w.feet_per_day,w.tripping_in_speed_cased,w.tripping_in_speed_open,w.tripping_in_speed,w.tripping_out_speed_cased,w.tripping_out_speed_open,w.tripping_out_speed,w.target_formation,w.mud_type].concat(t("production"!==process.env.REACT_APP_ENVIRONMENT?[w.npt,w.circulating_time,w.spud_to_rig_release_time,w.spud_to_total_depth_time]:[])),"label"),P=["#6EACFF","#69B919","#E95DAF","#A77DFF","#77FFC1","#018EFE","#FF5D7E","#B9E310","#FFD111","#24BB8E","#C426F3"],U=(e(i={},s.small,0),e(i,s.mobile,52),e(i,s.none,48),e(i,s.tablet,48),e(i,s.normal,48),i),x="hole_depth_change",G={SUCCESS:"succeeded",FAILURE:"failed"},M={INITIAL:0,TRIGGERED:1,RUNNING:2,SUCCEEDED:3,FAILED:-1};export{g as ALL_SECTION_KEY,b as ALL_SECTION_LABEL,d as ANDROID_DEVICE,E as COMPANY_PROVIDERS_FOR_IDAS,N as ColumnType,p as DEFAULT_BIC_OFFSET_SIZE,_ as DEFAULT_LOCAL_OFFSET_SIZE,x as DEFAULT_METRICS_KEY,v as EXPANDED_WELL_NAME_WIDTH,S as FilterOptions,k as FilterType,m as IOS_DEVICE,F as LEAVE_TOUCH_DELAY,I as MAX_METRICS_COUNT,n as MAX_OFFSET_SIZE,L as METRICS_LIST,D as NonConvertableMetrics,B as OBJECTIVE_PERIOD_LIST,u as OTHER_DEVICE,M as RESYNC_STATUS,G as RESYNC_TASK_RESPONSE,h as ROWS_PER_PAGE,y as ROW_HEIGHT,A as SEARCH_CELL_DEFAULT_WIDTH,f as SEARCH_CELL_EXPAND_WIDTH,o as SMALL_SCREEN_HEIGHT,r as SMALL_SCREEN_WIDTH,R as StatusOptions,U as TOP_GRADIENT_MAP,T as TableColumns,s as ViewType,c as WINDOWS_PHONE,P as WellSectionColors,C as WellStatus};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../src/components/OffsetWellPickerV4/constants.js"],"sourcesContent":["import { sortBy } from 'lodash';\n\nimport { metricsUtils } from '~/utils';\n\nexport const SMALL_SCREEN_HEIGHT = 800;\nexport const SMALL_SCREEN_WIDTH = 650;\nexport const ViewType = {\n none: 'none',\n normal: 'normal',\n small: 'small screen',\n tablet: 'tablet',\n mobile: 'mobile',\n};\nexport const MAX_OFFSET_SIZE = 1000;\nexport const DEFAULT_BIC_OFFSET_SIZE = 50;\nexport const DEFAULT_LOCAL_OFFSET_SIZE = 50;\n\nexport const ANDROID_DEVICE = 'Android';\nexport const IOS_DEVICE = 'iOS';\nexport const WINDOWS_PHONE = 'Window Phone';\nexport const OTHER_DEVICE = 'other';\n\nexport const ALL_SECTION_KEY = 'all';\nexport const ALL_SECTION_LABEL = 'All';\nexport const EXPANDED_WELL_NAME_WIDTH = 450;\nexport const ROWS_PER_PAGE = 50;\nexport const ROW_HEIGHT = 60;\nexport const LEAVE_TOUCH_DELAY = 10000;\nexport const COMPANY_PROVIDERS_FOR_IDAS = ['xto'];\nexport const SEARCH_CELL_DEFAULT_WIDTH = 1020;\nexport const SEARCH_CELL_EXPAND_WIDTH = 1270;\nconst metrics = metricsUtils.default;\n\nexport const FilterType = {\n status: 'status',\n rig: 'rigName',\n program: 'programName',\n basin: 'basin',\n county: 'county',\n area: 'area',\n formation: 'formation',\n stringDesign: 'stringDesign',\n radius: 'radius',\n period: 'period',\n sideTracks: 'sideTracks',\n timeRangeFrom: 'timeRangeFrom',\n timeRangeTo: 'timeRangeTo',\n};\n\nexport const FilterOptions = [\n {\n value: FilterType.rig,\n label: 'Rig',\n },\n {\n value: FilterType.program,\n label: 'Program/BU',\n },\n {\n value: FilterType.basin,\n label: 'Basin',\n },\n {\n value: FilterType.county,\n label: 'County',\n },\n {\n value: FilterType.area,\n label: 'Area',\n },\n {\n value: FilterType.formation,\n label: 'Target Formation',\n },\n {\n value: FilterType.stringDesign,\n label: 'String Design',\n },\n];\n\nexport const WellStatus = {\n unknown: 'unknown',\n idle: 'idle',\n active: 'active',\n paused: 'paused',\n complete: 'complete',\n};\n\nexport const StatusOptions = [\n { value: WellStatus.unknown, color: '#9E9E9E' },\n { value: WellStatus.idle, color: '#BDBDBD' },\n { value: WellStatus.active, color: '#95F126' },\n { value: WellStatus.paused, color: '#FFF350' },\n { value: WellStatus.complete, color: '#2196F3' },\n];\n\nexport const ColumnType = {\n name: 'name',\n status: 'status',\n rig: 'rigName',\n distance: 'distance',\n taScore: 'TA',\n lastActive: 'lastActive',\n metrics: 'metrics',\n wellSection: 'wellSection',\n};\n\nexport const TableColumns = [\n {\n type: ColumnType.name,\n label: 'Well Name',\n key: ColumnType.name,\n width: [280, 197, 197, 186],\n },\n {\n type: ColumnType.status,\n label: '',\n key: ColumnType.status,\n width: [40, 40, 40, 30],\n },\n {\n type: ColumnType.rig,\n label: 'Rig',\n key: ColumnType.rig,\n width: [220, 140, 140, 93],\n },\n {\n type: ColumnType.distance,\n label: 'Distance',\n key: ColumnType.distance,\n width: [160, 160, 122, 93],\n },\n {\n type: ColumnType.taScore,\n label: 'TA',\n key: ColumnType.taScore,\n width: [90, 90, 75, 70],\n },\n {\n type: ColumnType.lastActive,\n label: 'Last Active',\n key: ColumnType.lastActive,\n width: [140, 140, 108, 98],\n },\n {\n type: ColumnType.metrics,\n label: '',\n key: '',\n width: [0, 212, 141, 141],\n },\n {\n type: ColumnType.wellSection,\n label: 'Well Section',\n key: ColumnType.wellSection,\n width: [180, 131, 131, 97],\n },\n];\n\nexport const OBJECTIVE_PERIOD_LIST = [\n { value: 'all', label: 'All' },\n { value: 'last12h', label: 'Last 12 hrs' },\n { value: 'last24h', label: 'Last 24 hrs' },\n { value: 'last7d', label: 'Last 7 days' },\n { value: 'lastMonth', label: 'Last Month' },\n { value: 'custom', label: 'Custom' },\n];\n\nexport const MAX_METRICS_COUNT = 3;\n\nexport const METRICS_LIST = sortBy(\n [\n metrics.weight_to_weight_average,\n metrics.bottom_to_slips_average,\n metrics.drilling_connection_average,\n metrics.slips_to_bottom_average,\n metrics.hole_depth,\n metrics.hole_depth_change,\n metrics.drilled_feet_rotary,\n metrics.drilled_feet_slide,\n metrics.rop_gross,\n metrics.rop,\n metrics.rop_rotary,\n metrics.rop_slide,\n metrics.drilled_feet_rotary_percentage,\n metrics.drilled_feet_slide_percentage,\n metrics.on_bottom_percentage,\n metrics.on_bottom_time,\n metrics.cost_per_ft,\n metrics.cost_per_lat_ft,\n metrics.feet_per_day,\n metrics.tripping_in_speed_cased,\n metrics.tripping_in_speed_open,\n metrics.tripping_in_speed,\n metrics.tripping_out_speed_cased,\n metrics.tripping_out_speed_open,\n metrics.tripping_out_speed,\n ...(process.env.REACT_APP_ENVIRONMENT !== 'production'\n ? [\n metrics.npt,\n metrics.circulating_time,\n metrics.spud_to_rig_release_time,\n metrics.spud_to_total_depth_time,\n ]\n : []),\n ],\n 'label'\n);\n\nexport const DEFAULT_SETTINGS = {\n radius: 0,\n filters: {},\n sortInfo: {\n key: 'name',\n direction: 1,\n },\n};\n\nexport const WellSectionColors = [\n '#6EACFF',\n '#69B919',\n '#E95DAF',\n '#A77DFF',\n '#77FFC1',\n '#018EFE',\n '#FF5D7E',\n '#B9E310',\n '#FFD111',\n '#24BB8E',\n '#C426F3',\n];\n\nexport const TOP_GRADIENT_MAP = {\n [ViewType.small]: 0,\n [ViewType.mobile]: 52,\n [ViewType.none]: 48,\n [ViewType.tablet]: 48,\n [ViewType.normal]: 48,\n};\n\nexport const DEFAULT_METRICS_KEY = 'hole_depth_change';\n\nexport const RESYNC_TASK_RESPONSE = {\n SUCCESS: 'succeeded',\n FAILURE: 'failed',\n};\n\nexport const RESYNC_STATUS = {\n INITIAL: 0,\n TRIGGERED: 1,\n RUNNING: 2,\n SUCCEEDED: 3,\n FAILED: -1,\n};\n"],"names":["SMALL_SCREEN_HEIGHT","SMALL_SCREEN_WIDTH","ViewType","none","normal","small","tablet","mobile","MAX_OFFSET_SIZE","DEFAULT_BIC_OFFSET_SIZE","DEFAULT_LOCAL_OFFSET_SIZE","ANDROID_DEVICE","IOS_DEVICE","WINDOWS_PHONE","OTHER_DEVICE","ALL_SECTION_KEY","ALL_SECTION_LABEL","EXPANDED_WELL_NAME_WIDTH","ROWS_PER_PAGE","ROW_HEIGHT","LEAVE_TOUCH_DELAY","COMPANY_PROVIDERS_FOR_IDAS","SEARCH_CELL_DEFAULT_WIDTH","SEARCH_CELL_EXPAND_WIDTH","metrics","metricsUtils","FilterType","status","rig","program","basin","county","area","formation","stringDesign","radius","period","sideTracks","timeRangeFrom","timeRangeTo","FilterOptions","value","label","WellStatus","unknown","idle","active","paused","complete","StatusOptions","color","ColumnType","name","distance","taScore","lastActive","wellSection","TableColumns","type","key","width","OBJECTIVE_PERIOD_LIST","MAX_METRICS_COUNT","METRICS_LIST","sortBy","weight_to_weight_average","bottom_to_slips_average","drilling_connection_average","slips_to_bottom_average","hole_depth","hole_depth_change","drilled_feet_rotary","drilled_feet_slide","rop_gross","rop","rop_rotary","rop_slide","drilled_feet_rotary_percentage","drilled_feet_slide_percentage","on_bottom_percentage","on_bottom_time","cost_per_ft","cost_per_lat_ft","feet_per_day","tripping_in_speed_cased","tripping_in_speed_open","tripping_in_speed","tripping_out_speed_cased","tripping_out_speed_open","tripping_out_speed","concat","_toConsumableArray","process","env","REACT_APP_ENVIRONMENT","npt","circulating_time","spud_to_rig_release_time","spud_to_total_depth_time","WellSectionColors","TOP_GRADIENT_MAP","_defineProperty","_TOP_GRADIENT_MAP","DEFAULT_METRICS_KEY","RESYNC_TASK_RESPONSE","SUCCESS","FAILURE","RESYNC_STATUS","INITIAL","TRIGGERED","RUNNING","SUCCEEDED","FAILED"],"mappings":"uOAIaA,EAAsB,IACtBC,EAAqB,IACrBC,EAAW,CACtBC,KAAM,OACNC,OAAQ,SACRC,MAAO,eACPC,OAAQ,SACRC,OAAQ,UAEGC,EAAkB,IAClBC,EAA0B,GAC1BC,EAA4B,GA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,EAAQ4D,wBACR5D,EAAQ6D,uBACR7D,EAAQ8D,kBACR9D,EAAQ+D,yBACR/D,EAAQgE,wBACRhE,EAAQiE,oBAAkBC,OAAAC,EACgB,eAAtCC,QAAQC,IAAIC,sBACZ,CACEtE,EAAQuE,IACRvE,EAAQwE,iBACRxE,EAAQyE,yBACRzE,EAAQ0E,0BAEV,KAEN,SAYWC,EAAoB,CAC/B,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,WAGWC,GACVlG,EAAAA,EAAAA,CAAAA,EAAAA,EAASG,MAAQ,GAACgG,EAAAC,EAClBpG,EAASK,OAAS,IAClBL,EAAAA,EAAAA,EAASC,KAAO,IAChBD,EAAAA,EAAAA,EAASI,OAAS,IAAE+F,EAAAC,EACpBpG,EAASE,OAAS,IACpBkG,GAEYC,EAAsB,oBAEtBC,EAAuB,CAClCC,QAAS,YACTC,QAAS,UAGEC,EAAgB,CAC3BC,QAAS,EACTC,UAAW,EACXC,QAAS,EACTC,UAAW,EACXC,QAAS"}
1
+ {"version":3,"file":"constants.js","sources":["../../../src/components/OffsetWellPickerV4/constants.js"],"sourcesContent":["import { sortBy } from 'lodash';\n\nimport { metricsUtils } from '~/utils';\n\nexport const SMALL_SCREEN_HEIGHT = 800;\nexport const SMALL_SCREEN_WIDTH = 650;\nexport const ViewType = {\n none: 'none',\n normal: 'normal',\n small: 'small screen',\n tablet: 'tablet',\n mobile: 'mobile',\n};\nexport const MAX_OFFSET_SIZE = 1000;\nexport const DEFAULT_BIC_OFFSET_SIZE = 50;\nexport const DEFAULT_LOCAL_OFFSET_SIZE = 50;\n\nexport const ANDROID_DEVICE = 'Android';\nexport const IOS_DEVICE = 'iOS';\nexport const WINDOWS_PHONE = 'Window Phone';\nexport const OTHER_DEVICE = 'other';\n\nexport const ALL_SECTION_KEY = 'all';\nexport const ALL_SECTION_LABEL = 'All';\nexport const EXPANDED_WELL_NAME_WIDTH = 450;\nexport const ROWS_PER_PAGE = 50;\nexport const ROW_HEIGHT = 60;\nexport const LEAVE_TOUCH_DELAY = 10000;\nexport const COMPANY_PROVIDERS_FOR_IDAS = ['xto'];\nexport const SEARCH_CELL_DEFAULT_WIDTH = 1020;\nexport const SEARCH_CELL_EXPAND_WIDTH = 1270;\nconst metrics = metricsUtils.default;\n\nexport const NonConvertableMetrics = [metrics.mud_type.key];\n\nexport const FilterType = {\n status: 'status',\n rig: 'rigName',\n program: 'programName',\n basin: 'basin',\n county: 'county',\n area: 'area',\n formation: 'formation',\n stringDesign: 'stringDesign',\n radius: 'radius',\n period: 'period',\n sideTracks: 'sideTracks',\n timeRangeFrom: 'timeRangeFrom',\n timeRangeTo: 'timeRangeTo',\n};\n\nexport const FilterOptions = [\n {\n value: FilterType.rig,\n label: 'Rig',\n },\n {\n value: FilterType.program,\n label: 'Program/BU',\n },\n {\n value: FilterType.basin,\n label: 'Basin',\n },\n {\n value: FilterType.county,\n label: 'County',\n },\n {\n value: FilterType.area,\n label: 'Area',\n },\n {\n value: FilterType.formation,\n label: 'Target Formation',\n },\n {\n value: FilterType.stringDesign,\n label: 'String Design',\n },\n];\n\nexport const WellStatus = {\n unknown: 'unknown',\n idle: 'idle',\n active: 'active',\n paused: 'paused',\n complete: 'complete',\n};\n\nexport const StatusOptions = [\n { value: WellStatus.unknown, color: '#9E9E9E' },\n { value: WellStatus.idle, color: '#BDBDBD' },\n { value: WellStatus.active, color: '#95F126' },\n { value: WellStatus.paused, color: '#FFF350' },\n { value: WellStatus.complete, color: '#2196F3' },\n];\n\nexport const ColumnType = {\n name: 'name',\n status: 'status',\n rig: 'rigName',\n distance: 'distance',\n taScore: 'TA',\n lastActive: 'lastActive',\n metrics: 'metrics',\n wellSection: 'wellSection',\n};\n\nexport const TableColumns = [\n {\n type: ColumnType.name,\n label: 'Well Name',\n key: ColumnType.name,\n width: [280, 197, 197, 186],\n },\n {\n type: ColumnType.status,\n label: '',\n key: ColumnType.status,\n width: [40, 40, 40, 30],\n },\n {\n type: ColumnType.rig,\n label: 'Rig',\n key: ColumnType.rig,\n width: [220, 140, 140, 93],\n },\n {\n type: ColumnType.distance,\n label: 'Distance',\n key: ColumnType.distance,\n width: [160, 160, 122, 93],\n },\n {\n type: ColumnType.taScore,\n label: 'TA',\n key: ColumnType.taScore,\n width: [90, 90, 75, 70],\n },\n {\n type: ColumnType.lastActive,\n label: 'Last Active',\n key: ColumnType.lastActive,\n width: [140, 140, 108, 98],\n },\n {\n type: ColumnType.metrics,\n label: '',\n key: '',\n width: [0, 212, 141, 141],\n },\n {\n type: ColumnType.wellSection,\n label: 'Well Section',\n key: ColumnType.wellSection,\n width: [180, 131, 131, 97],\n },\n];\n\nexport const OBJECTIVE_PERIOD_LIST = [\n { value: 'all', label: 'All' },\n { value: 'last12h', label: 'Last 12 hrs' },\n { value: 'last24h', label: 'Last 24 hrs' },\n { value: 'last7d', label: 'Last 7 days' },\n { value: 'lastMonth', label: 'Last Month' },\n { value: 'custom', label: 'Custom' },\n];\n\nexport const MAX_METRICS_COUNT = 3;\n\nexport const METRICS_LIST = sortBy(\n [\n metrics.weight_to_weight_average,\n metrics.bottom_to_slips_average,\n metrics.drilling_connection_average,\n metrics.slips_to_bottom_average,\n metrics.hole_depth,\n metrics.hole_depth_change,\n metrics.drilled_feet_rotary,\n metrics.drilled_feet_slide,\n metrics.rop_gross,\n metrics.rop,\n metrics.rop_rotary,\n metrics.rop_slide,\n metrics.drilled_feet_rotary_percentage,\n metrics.drilled_feet_slide_percentage,\n metrics.on_bottom_percentage,\n metrics.on_bottom_time,\n metrics.cost_per_ft,\n metrics.cost_per_lat_ft,\n metrics.feet_per_day,\n metrics.tripping_in_speed_cased,\n metrics.tripping_in_speed_open,\n metrics.tripping_in_speed,\n metrics.tripping_out_speed_cased,\n metrics.tripping_out_speed_open,\n metrics.tripping_out_speed,\n metrics.target_formation,\n metrics.mud_type,\n ...(process.env.REACT_APP_ENVIRONMENT !== 'production'\n ? [\n metrics.npt,\n metrics.circulating_time,\n metrics.spud_to_rig_release_time,\n metrics.spud_to_total_depth_time,\n ]\n : []),\n ],\n 'label'\n);\n\nexport const DEFAULT_SETTINGS = {\n radius: 0,\n filters: {},\n sortInfo: {\n key: 'name',\n direction: 1,\n },\n};\n\nexport const WellSectionColors = [\n '#6EACFF',\n '#69B919',\n '#E95DAF',\n '#A77DFF',\n '#77FFC1',\n '#018EFE',\n '#FF5D7E',\n '#B9E310',\n '#FFD111',\n '#24BB8E',\n '#C426F3',\n];\n\nexport const TOP_GRADIENT_MAP = {\n [ViewType.small]: 0,\n [ViewType.mobile]: 52,\n [ViewType.none]: 48,\n [ViewType.tablet]: 48,\n [ViewType.normal]: 48,\n};\n\nexport const DEFAULT_METRICS_KEY = 'hole_depth_change';\n\nexport const RESYNC_TASK_RESPONSE = {\n SUCCESS: 'succeeded',\n FAILURE: 'failed',\n};\n\nexport const RESYNC_STATUS = {\n INITIAL: 0,\n TRIGGERED: 1,\n RUNNING: 2,\n SUCCEEDED: 3,\n FAILED: -1,\n};\n"],"names":["SMALL_SCREEN_HEIGHT","SMALL_SCREEN_WIDTH","ViewType","none","normal","small","tablet","mobile","MAX_OFFSET_SIZE","DEFAULT_BIC_OFFSET_SIZE","DEFAULT_LOCAL_OFFSET_SIZE","ANDROID_DEVICE","IOS_DEVICE","WINDOWS_PHONE","OTHER_DEVICE","ALL_SECTION_KEY","ALL_SECTION_LABEL","EXPANDED_WELL_NAME_WIDTH","ROWS_PER_PAGE","ROW_HEIGHT","LEAVE_TOUCH_DELAY","COMPANY_PROVIDERS_FOR_IDAS","SEARCH_CELL_DEFAULT_WIDTH","SEARCH_CELL_EXPAND_WIDTH","metrics","metricsUtils","NonConvertableMetrics","mud_type","key","FilterType","status","rig","program","basin","county","area","formation","stringDesign","radius","period","sideTracks","timeRangeFrom","timeRangeTo","FilterOptions","value","label","WellStatus","unknown","idle","active","paused","complete","StatusOptions","color","ColumnType","name","distance","taScore","lastActive","wellSection","TableColumns","type","width","OBJECTIVE_PERIOD_LIST","MAX_METRICS_COUNT","METRICS_LIST","sortBy","weight_to_weight_average","bottom_to_slips_average","drilling_connection_average","slips_to_bottom_average","hole_depth","hole_depth_change","drilled_feet_rotary","drilled_feet_slide","rop_gross","rop","rop_rotary","rop_slide","drilled_feet_rotary_percentage","drilled_feet_slide_percentage","on_bottom_percentage","on_bottom_time","cost_per_ft","cost_per_lat_ft","feet_per_day","tripping_in_speed_cased","tripping_in_speed_open","tripping_in_speed","tripping_out_speed_cased","tripping_out_speed_open","tripping_out_speed","target_formation","concat","_toConsumableArray","process","env","REACT_APP_ENVIRONMENT","npt","circulating_time","spud_to_rig_release_time","spud_to_total_depth_time","WellSectionColors","TOP_GRADIENT_MAP","_defineProperty","_TOP_GRADIENT_MAP","DEFAULT_METRICS_KEY","RESYNC_TASK_RESPONSE","SUCCESS","FAILURE","RESYNC_STATUS","INITIAL","TRIGGERED","RUNNING","SUCCEEDED","FAILED"],"mappings":"uOAIaA,EAAsB,IACtBC,EAAqB,IACrBC,EAAW,CACtBC,KAAM,OACNC,OAAQ,SACRC,MAAO,eACPC,OAAQ,SACRC,OAAQ,UAEGC,EAAkB,IAClBC,EAA0B,GAC1BC,EAA4B,GAE5BC,EAAiB,UACjBC,EAAa,MACbC,EAAgB,eAChBC,EAAe,QAEfC,EAAkB,MAClBC,EAAoB,MACpBC,EAA2B,IAC3BC,EAAgB,GAChBC,EAAa,GACbC,EAAoB,IACpBC,EAA6B,CAAC,OAC9BC,EAA4B,KAC5BC,EAA2B,KAClCC,EAAUC,EAEHC,EAAwB,CAACF,EAAQG,SAASC,KAE1CC,EAAa,CACxBC,OAAQ,SACRC,IAAK,UACLC,QAAS,cACTC,MAAO,QACPC,OAAQ,SACRC,KAAM,OACNC,UAAW,YACXC,aAAc,eACdC,OAAQ,SACRC,OAAQ,SACRC,WAAY,aACZC,cAAe,gBACfC,YAAa,eAGFC,EAAgB,CAC3B,CACEC,MAAOf,EAAWE,IAClBc,MAAO,OAET,CACED,MAAOf,EAAWG,QAClBa,MAAO,cAET,CACED,M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,IAAEkG,EAAAC,EACpBvG,EAASE,OAAS,IACpBqG,GAEYC,EAAsB,oBAEtBC,EAAuB,CAClCC,QAAS,YACTC,QAAS,UAGEC,EAAgB,CAC3BC,QAAS,EACTC,UAAW,EACXC,QAAS,EACTC,UAAW,EACXC,QAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAdvancedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"names":[],"mappings":"AAYA,oKAwHC"}
1
+ {"version":3,"file":"useAdvancedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"names":[],"mappings":"AAYA,oKA2HC"}
@@ -1,2 +1,2 @@
1
- import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as i,useEffect as u}from"react";import{groupBy as a,get as c}from"lodash";import{fetchMetricsData as f}from"../utils/apiCalls.js";import{ALL_SECTION_KEY as l,ColumnType as s}from"../constants.js";import{mapbox as p}from"../../../utils/index.js";function m(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function d(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}var b=p.getAssetV2Coordinates,v=p.getDistanceByCoordinates,y=function(r){return Number.isFinite(r)?parseFloat(r.toFixed(2)):null};function h(p,m,h,O,j,g,w){var P=o(null),x=e(P,2),F=x[0],D=x[1],E=o(null),k=e(E,2),C=k[0],S=k[1],A=o(null),H=e(A,2),T=H[0],B=H[1],G=i({});function N(r){return V.apply(this,arguments)}function V(){return(V=r(n.mark((function r(e){var o,i,u,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f(p,e,g);case 2:o=r.sent,i={},u=a(o,"asset_id"),e.forEach((function(r){var e,n=null===(e=u[r])||void 0===e?void 0:e.reduce((function(r,e){var n=c(e,"data.value"),o=c(e,"data.key");return d(d({},r),{},t({},o,y(n)))}),{});i[r]=n})),G.current=d(d({},G.current),i),l=[],T.forEach((function(r){l.push(d(d({},r),G.current[r.id]))})),D(l);case 10:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return u((function(){m&&w&&function(){var r=m.find((function(r){return r.id===j})),t=r&&b(r,"topHole");if(t){var e=m.map((function(r){try{var e=b(r,"topHole");if(e){var n=parseFloat(v(t,e));return d(d({},r),{},{distance:parseFloat(n.toFixed(2))})}return r}catch(t){return r}}));S(e)}else S(m)}()}),[m,j,w]),u((function(){var r,e;C&&h&&O&&w&&(r=h.filter((function(r){return r.value!==l})),e=C.map((function(e){var n=r.filter((function(r){return(O[r.value]||[]).includes(e.id)})).map((function(r){return r.label}));return n.length>0?d(d({},e),{},t({},s.wellSection,n)):e})),B(e))}),[C,h,O,w]),u((function(){if(T&&w){var r=[];T.forEach((function(t){G.current[t.id]||r.push(t.id)})),N(r)}}),[T,w]),u((function(){F&&N(F.map((function(r){return r.id})))}),[g]),F}export{h as useAdvancedWells};
1
+ import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as o,useRef as i,useEffect as u}from"react";import{groupBy as a,get as c}from"lodash";import{fetchMetricsData as f}from"../utils/apiCalls.js";import{ALL_SECTION_KEY as l,ColumnType as s,NonConvertableMetrics as p}from"../constants.js";import{mapbox as m}from"../../../utils/index.js";function d(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function b(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}var v=m.getAssetV2Coordinates,y=m.getDistanceByCoordinates,h=function(r){return Number.isFinite(r)?parseFloat(r.toFixed(2)):null};function O(m,d,O,j,g,w,P){var x=o(null),F=e(x,2),D=F[0],E=F[1],k=o(null),C=e(k,2),S=C[0],A=C[1],H=o(null),T=e(H,2),B=T[0],G=T[1],N=i({});function V(r){return _.apply(this,arguments)}function _(){return(_=r(n.mark((function r(e){var o,i,u,l;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f(m,e,w);case 2:o=r.sent,i={},u=a(o,"asset_id"),e.forEach((function(r){var e,n=null===(e=u[r])||void 0===e?void 0:e.reduce((function(r,e){var n=c(e,"data.value"),o=c(e,"data.key");return b(b({},r),{},t({},o,p.includes(o)?n:h(n)))}),{});i[r]=n})),N.current=b(b({},N.current),i),l=[],B.forEach((function(r){l.push(b(b({},r),N.current[r.id]))})),E(l);case 10:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return u((function(){d&&P&&function(){var r=d.find((function(r){return r.id===g})),t=r&&v(r,"topHole");if(t){var e=d.map((function(r){try{var e=v(r,"topHole");if(e){var n=parseFloat(y(t,e));return b(b({},r),{},{distance:parseFloat(n.toFixed(2))})}return r}catch(t){return r}}));A(e)}else A(d)}()}),[d,g,P]),u((function(){var r,e;S&&O&&j&&P&&(r=O.filter((function(r){return r.value!==l})),e=S.map((function(e){var n=r.filter((function(r){return(j[r.value]||[]).includes(e.id)})).map((function(r){return r.label}));return n.length>0?b(b({},e),{},t({},s.wellSection,n)):e})),G(e))}),[S,O,j,P]),u((function(){if(B&&P){var r=[];B.forEach((function(t){N.current[t.id]||r.push(t.id)})),V(r)}}),[B,P]),u((function(){D&&V(D.map((function(r){return r.id})))}),[w]),D}export{O as useAdvancedWells};
2
2
  //# sourceMappingURL=useAdvancedWells.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAdvancedWells.js","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { get, groupBy } from 'lodash';\n\nimport { fetchMetricsData } from '../utils/apiCalls';\nimport { ColumnType, ALL_SECTION_KEY } from '../constants';\n\nimport { mapbox } from '~/utils';\n\nconst { getAssetV2Coordinates, getDistanceByCoordinates } = mapbox;\n\nconst parseMetricValue = value => (Number.isFinite(value) ? parseFloat(value.toFixed(2)) : null);\n\nexport function useAdvancedWells(\n companyId,\n rawWells,\n wellSections,\n offsetWellsBySection,\n subjectWellId,\n metricsKeys,\n open\n) {\n const [wells, setWells] = useState(null);\n const [coordinatedWells, setCoordinatedWells] = useState(null);\n const [sectionizedWells, setSectionizedWells] = useState(null);\n const fetchedData = useRef({});\n\n // NOTE: Add coordinate in wells\n\n function handleCoordinatedWells() {\n const subjectWell = rawWells.find(well => well.id === subjectWellId);\n const subjectWellCoord = subjectWell && getAssetV2Coordinates(subjectWell, 'topHole');\n if (!subjectWellCoord) {\n setCoordinatedWells(rawWells);\n return;\n }\n\n const result = rawWells.map(well => {\n try {\n const coord = getAssetV2Coordinates(well, 'topHole');\n if (coord) {\n const distance = parseFloat(getDistanceByCoordinates(subjectWellCoord, coord));\n return { ...well, distance: parseFloat(distance.toFixed(2)) };\n }\n return well;\n } catch {\n return well;\n }\n });\n\n setCoordinatedWells(result);\n }\n\n useEffect(() => {\n if (rawWells && open) {\n handleCoordinatedWells();\n }\n }, [rawWells, subjectWellId, open]);\n\n // NOTE: Add offset well section names in wells\n\n function handleSectionizedWells() {\n const filteredSections = wellSections.filter(item => item.value !== ALL_SECTION_KEY);\n const result = coordinatedWells.map(well => {\n const sectionNames = filteredSections\n .filter(section => (offsetWellsBySection[section.value] || []).includes(well.id))\n .map(section => section.label);\n if (sectionNames.length > 0) return { ...well, [ColumnType.wellSection]: sectionNames };\n return well;\n });\n\n setSectionizedWells(result);\n }\n\n useEffect(() => {\n if (coordinatedWells && wellSections && offsetWellsBySection && open) {\n handleSectionizedWells();\n }\n }, [coordinatedWells, wellSections, offsetWellsBySection, open]);\n\n // NOTE: Add metrics fields\n\n async function handleFetchMetricsData(wellIdsToFetch) {\n const records = await fetchMetricsData(companyId, wellIdsToFetch, metricsKeys);\n const wellsMetrics = {};\n const recordsPerAsset = groupBy(records, 'asset_id');\n\n wellIdsToFetch.forEach(wellId => {\n const wellMetrics = recordsPerAsset[wellId]?.reduce((acc, record) => {\n const value = get(record, 'data.value');\n const key = get(record, 'data.key');\n\n return { ...acc, [key]: parseMetricValue(value) };\n }, {});\n\n wellsMetrics[wellId] = wellMetrics;\n });\n // NOTE: Store previous fetching result\n fetchedData.current = {\n ...fetchedData.current,\n ...wellsMetrics,\n };\n const result = [];\n sectionizedWells.forEach(well => {\n result.push({\n ...well,\n ...fetchedData.current[well.id],\n });\n });\n setWells(result);\n }\n\n useEffect(() => {\n if (sectionizedWells && open) {\n // NOTE: Make api calls for only missing wells\n const missingWellIds = [];\n sectionizedWells.forEach(well => {\n if (!fetchedData.current[well.id]) {\n missingWellIds.push(well.id);\n }\n });\n handleFetchMetricsData(missingWellIds);\n }\n }, [sectionizedWells, open]);\n\n useEffect(() => {\n if (wells) {\n const wellIdsToFetch = wells.map(well => well.id);\n handleFetchMetricsData(wellIdsToFetch);\n }\n }, [metricsKeys]);\n\n return wells;\n}\n"],"names":["getAssetV2Coordinates","mapbox","getDistanceByCoordinates","parseMetricValue","value","Number","isFinite","parseFloat","toFixed","useAdvancedWells","companyId","rawWells","wellSections","offsetWellsBySection","subjectWellId","metricsKeys","open","useState","_useState2","_slicedToArray","_useState","wells","setWells","_useState4","_useState3","coordinatedWells","setCoordinatedWells","_useState6","_useState5","sectionizedWells","setSectionizedWells","fetchedData","useRef","handleFetchMetricsData","_x","_handleFetchMetricsData","apply","this","arguments","_asyncToGenerator","_regeneratorRuntime","mark","wellIdsToFetch","records","wellsMetrics","recordsPerAsset","result","wrap","_context","prev","next","fetchMetricsData","sent","groupBy","forEach","wellId","_recordsPerAsset$well","wellMetrics","reduce","acc","record","get","key","_objectSpread","current","well","push","id","stop","_callee","useEffect","subjectWell","find","subjectWellCoord","map","coord","distance","_unused","handleCoordinatedWells","filteredSections","filter","item","ALL_SECTION_KEY","sectionNames","section","includes","label","length","ColumnType","wellSection","missingWellIds"],"mappings":"0hCAQA,IAAQA,EAAoDC,EAApDD,sBAAuBE,EAA6BD,EAA7BC,yBAEzBC,EAAmB,SAAAC,GAAK,OAAKC,OAAOC,SAASF,GAASG,WAAWH,EAAMI,QAAQ,IAAM,IAAI,EAExF,SAASC,EACdC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,IAA0BC,EAAAA,EAAS,MAAKC,EAAAC,EAAAC,EAAA,GAAjCC,EAAKH,EAAA,GAAEI,EAAQJ,EAAA,GAC0BD,EAAAA,EAAS,MAAKM,EAAAJ,EAAAK,EAAA,GAAvDC,EAAgBF,EAAA,GAAEG,EAAmBH,EAAA,GACIN,EAAAA,EAAS,MAAKU,EAAAR,EAAAS,EAAA,GAAvDC,EAAgBF,EAAA,GAAEG,EAAmBH,EAAA,GACtCI,EAAcC,EAAO,CAAA,GAuD3B,SAEeC,EAAsBC,GAAA,OAAAC,EAAAC,MAAAC,KAAAC,UAAA,CAAA,SAAAH,IA4BpC,OA5BoCA,EAAAI,EAAAC,EAAAC,MAArC,WAAsCC,GAAc,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAN,EAAAO,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,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yD,CAGT,CAFE,MAAMY,GACN,OAAOZ,CACT,CACF,IAEAvC,EAAoBoB,EAfpB,MAFEpB,EAAoBf,EAkBxB,CAIImE,EAEH,GAAE,CAACnE,EAAUG,EAAeE,IAiB7BsD,GAAU,WAbV,IACQS,EACAjC,EAYFrB,GAAoBb,GAAgBC,GAAwBG,IAb1D+D,EAAmBnE,EAAaoE,QAAO,SAAAC,GAAI,OAAIA,EAAK7E,QAAU8E,KAC9DpC,EAASrB,EAAiBiD,KAAI,SAAAT,GAClC,IAAMkB,EAAeJ,EAClBC,QAAO,SAAAI,GAAO,OAAKvE,EAAqBuE,EAAQhF,QAAU,IAAIiF,SAASpB,EAAKE,GAAG,IAC/EO,KAAI,SAAAU,GAAO,OAAIA,EAAQE,SAC1B,OAAIH,EAAaI,OAAS,EAAetB,EAAAA,EAAAA,GAAAA,GAAOuB,CAAAA,EAAAA,EAAAA,CAAAA,EAAAA,EAAWC,YAAcN,IAClElB,CACT,IAEAnC,EAAoBgB,GAOrB,GAAE,CAACrB,EAAkBb,EAAcC,EAAsBG,IAkC1DsD,GAAU,WACR,GAAIzC,GAAoBb,EAAM,CAE5B,IAAM0E,EAAiB,GACvB7D,EAAiByB,SAAQ,SAAAW,GAClBlC,EAAYiC,QAAQC,EAAKE,KAC5BuB,EAAexB,KAAKD,EAAKE,GAE7B,IACAlC,EAAuByD,EACzB,CACF,GAAG,CAAC7D,EAAkBb,IAEtBsD,GAAU,WACJjD,GAEFY,EADuBZ,EAAMqD,KAAI,SAAAT,GAAI,OAAIA,EAAKE,MAGlD,GAAG,CAACpD,IAEGM,CACT"}
1
+ {"version":3,"file":"useAdvancedWells.js","sources":["../../../../src/components/OffsetWellPickerV4/effects/useAdvancedWells.js"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { get, groupBy } from 'lodash';\n\nimport { fetchMetricsData } from '../utils/apiCalls';\nimport { ColumnType, ALL_SECTION_KEY, NonConvertableMetrics } from '../constants';\n\nimport { mapbox } from '~/utils';\n\nconst { getAssetV2Coordinates, getDistanceByCoordinates } = mapbox;\n\nconst parseMetricValue = value => (Number.isFinite(value) ? parseFloat(value.toFixed(2)) : null);\n\nexport function useAdvancedWells(\n companyId,\n rawWells,\n wellSections,\n offsetWellsBySection,\n subjectWellId,\n metricsKeys,\n open\n) {\n const [wells, setWells] = useState(null);\n const [coordinatedWells, setCoordinatedWells] = useState(null);\n const [sectionizedWells, setSectionizedWells] = useState(null);\n const fetchedData = useRef({});\n\n // NOTE: Add coordinate in wells\n\n function handleCoordinatedWells() {\n const subjectWell = rawWells.find(well => well.id === subjectWellId);\n const subjectWellCoord = subjectWell && getAssetV2Coordinates(subjectWell, 'topHole');\n if (!subjectWellCoord) {\n setCoordinatedWells(rawWells);\n return;\n }\n\n const result = rawWells.map(well => {\n try {\n const coord = getAssetV2Coordinates(well, 'topHole');\n if (coord) {\n const distance = parseFloat(getDistanceByCoordinates(subjectWellCoord, coord));\n return { ...well, distance: parseFloat(distance.toFixed(2)) };\n }\n return well;\n } catch {\n return well;\n }\n });\n\n setCoordinatedWells(result);\n }\n\n useEffect(() => {\n if (rawWells && open) {\n handleCoordinatedWells();\n }\n }, [rawWells, subjectWellId, open]);\n\n // NOTE: Add offset well section names in wells\n\n function handleSectionizedWells() {\n const filteredSections = wellSections.filter(item => item.value !== ALL_SECTION_KEY);\n const result = coordinatedWells.map(well => {\n const sectionNames = filteredSections\n .filter(section => (offsetWellsBySection[section.value] || []).includes(well.id))\n .map(section => section.label);\n if (sectionNames.length > 0) return { ...well, [ColumnType.wellSection]: sectionNames };\n return well;\n });\n\n setSectionizedWells(result);\n }\n\n useEffect(() => {\n if (coordinatedWells && wellSections && offsetWellsBySection && open) {\n handleSectionizedWells();\n }\n }, [coordinatedWells, wellSections, offsetWellsBySection, open]);\n\n // NOTE: Add metrics fields\n\n async function handleFetchMetricsData(wellIdsToFetch) {\n const records = await fetchMetricsData(companyId, wellIdsToFetch, metricsKeys);\n const wellsMetrics = {};\n const recordsPerAsset = groupBy(records, 'asset_id');\n\n wellIdsToFetch.forEach(wellId => {\n const wellMetrics = recordsPerAsset[wellId]?.reduce((acc, record) => {\n const value = get(record, 'data.value');\n const key = get(record, 'data.key');\n\n return {\n ...acc,\n [key]: NonConvertableMetrics.includes(key) ? value : parseMetricValue(value),\n };\n }, {});\n\n wellsMetrics[wellId] = wellMetrics;\n });\n // NOTE: Store previous fetching result\n fetchedData.current = {\n ...fetchedData.current,\n ...wellsMetrics,\n };\n const result = [];\n sectionizedWells.forEach(well => {\n result.push({\n ...well,\n ...fetchedData.current[well.id],\n });\n });\n setWells(result);\n }\n\n useEffect(() => {\n if (sectionizedWells && open) {\n // NOTE: Make api calls for only missing wells\n const missingWellIds = [];\n sectionizedWells.forEach(well => {\n if (!fetchedData.current[well.id]) {\n missingWellIds.push(well.id);\n }\n });\n handleFetchMetricsData(missingWellIds);\n }\n }, [sectionizedWells, open]);\n\n useEffect(() => {\n if (wells) {\n const wellIdsToFetch = wells.map(well => well.id);\n handleFetchMetricsData(wellIdsToFetch);\n }\n }, [metricsKeys]);\n\n return wells;\n}\n"],"names":["getAssetV2Coordinates","mapbox","getDistanceByCoordinates","parseMetricValue","value","Number","isFinite","parseFloat","toFixed","useAdvancedWells","companyId","rawWells","wellSections","offsetWellsBySection","subjectWellId","metricsKeys","open","useState","_useState2","_slicedToArray","_useState","wells","setWells","_useState4","_useState3","coordinatedWells","setCoordinatedWells","_useState6","_useState5","sectionizedWells","setSectionizedWells","fetchedData","useRef","handleFetchMetricsData","_x","_handleFetchMetricsData","apply","this","arguments","_asyncToGenerator","_regeneratorRuntime","mark","wellIdsToFetch","records","wellsMetrics","recordsPerAsset","result","wrap","_context","prev","next","fetchMetricsData","sent","groupBy","forEach","wellId","_recordsPerAsset$well","wellMetrics","reduce","acc","record","get","key","_objectSpread","NonConvertableMetrics","includes","current","well","push","id","stop","_callee","useEffect","subjectWell","find","subjectWellCoord","map","coord","distance","_unused","handleCoordinatedWells","filteredSections","filter","item","ALL_SECT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,EAAqByE,EAAQlF,QAAU,IAAI6D,SAASE,EAAKE,GAAG,IAC/EO,KAAI,SAAAU,GAAO,OAAIA,EAAQC,SAC1B,OAAIF,EAAaG,OAAS,EAAerB,EAAAA,EAAAA,GAAAA,GAAOsB,CAAAA,EAAAA,EAAAA,CAAAA,EAAAA,EAAWC,YAAcL,IAClElB,CACT,IAEArC,EAAoBgB,GAOrB,GAAE,CAACrB,EAAkBb,EAAcC,EAAsBG,IAqC1DwD,GAAU,WACR,GAAI3C,GAAoBb,EAAM,CAE5B,IAAM2E,EAAiB,GACvB9D,EAAiByB,SAAQ,SAAAa,GAClBpC,EAAYmC,QAAQC,EAAKE,KAC5BsB,EAAevB,KAAKD,EAAKE,GAE7B,IACApC,EAAuB0D,EACzB,CACF,GAAG,CAAC9D,EAAkBb,IAEtBwD,GAAU,WACJnD,GAEFY,EADuBZ,EAAMuD,KAAI,SAAAT,GAAI,OAAIA,EAAKE,MAGlD,GAAG,CAACtD,IAEGM,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSortedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useSortedWells.js"],"names":[],"mappings":"AAkBA,wHAiCC"}
1
+ {"version":3,"file":"useSortedWells.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV4/effects/useSortedWells.js"],"names":[],"mappings":"AA+BA,wHAiCC"}
@@ -1,2 +1,2 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/toConsumableArray";import{useState as n,useMemo as o,useEffect as i}from"react";import{isEmpty as c}from"lodash";import{SortDirection as u}from"react-virtualized";import{ColumnType as f}from"../constants.js";function a(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var l=function(r,t,n){var o=e(r),i=t===f.lastActive;return o.sort((function(r,e){return r[t]||0===r[t]&&!i?e[t]||0===e[t]&&!i?n===u.ASC?r[t]>=e[t]?1:-1:e[t]>=r[t]?1:-1:-1:1})),o};function s(r,e,a,s){var m=n(f.distance),b=t(m,2),O=b[0],d=b[1],y=n(u.ASC),j=t(y,2),v=j[0],h=j[1],P=o((function(){if(!e)return null;var t=a.map((function(r){return r.id})),n=a.filter((function(t){return t.id!==(null==r?void 0:r.id)})),o=l(n,O,v),i=e.filter((function(r){return!t.includes(r.id)})),u=l(i,O,v);return(c(r)?[]:[r]).concat(o).concat(u).map((function(r){return p(p({},r),{},{checked:a.some((function(t){return t.id===r.id}))})}))}),[e,O,v,r,a]);return i((function(){null!==P&&s(!1)}),[P,s]),[O,d,v,h,P]}export{s as useSortedWells};
1
+ import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/toConsumableArray";import{useState as n,useMemo as o,useEffect as i}from"react";import{isEmpty as c}from"lodash";import{SortDirection as u}from"react-virtualized";import{ColumnType as f}from"../constants.js";function a(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var p=function(r,t,n){var o=e(r),i=t===f.lastActive;return o.sort((function(r,e){var o=r[t],c=e[t],f=!o||"string"==typeof o&&"null"===o.toLowerCase(),a=!c||"string"==typeof c&&"null"===c.toLowerCase();return f&&(0!==o||i)?1:a&&(0!==c||i)?-1:"string"==typeof o&&"string"==typeof c?n===u.ASC?o.localeCompare(c):c.localeCompare(o):n===u.ASC?o>=c?1:-1:c>=o?1:-1})),o};function s(r,e,a,s){var m=n(f.distance),b=t(m,2),y=b[0],O=b[1],d=n(u.ASC),j=t(d,2),v=j[0],g=j[1],h=o((function(){if(!e)return null;var t=a.map((function(r){return r.id})),n=a.filter((function(t){return t.id!==(null==r?void 0:r.id)})),o=p(n,y,v),i=e.filter((function(r){return!t.includes(r.id)})),u=p(i,y,v);return(c(r)?[]:[r]).concat(o).concat(u).map((function(r){return l(l({},r),{},{checked:a.some((function(t){return t.id===r.id}))})}))}),[e,y,v,r,a]);return i((function(){null!==h&&s(!1)}),[h,s]),[y,O,v,g,h]}export{s as useSortedWells};
2
2
  //# sourceMappingURL=useSortedWells.js.map