@corva/ui 0.25.0-6 → 0.26.0-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 (73) hide show
  1. package/CLI/components/App/App.js +1 -1
  2. package/CLI/hocs/withAppDataProviderHOC.js +1 -1
  3. package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
  4. package/CLI/hocs/withPDFLayoutHOC.js +1 -1
  5. package/CLI/hocs/withReactRouterHOC.js +1 -1
  6. package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
  7. package/clients/api/apiCore.js +1 -1
  8. package/clients/clientStorage/core.js +1 -1
  9. package/components/Annotations/AnnotationsContext.js +1 -1
  10. package/components/Annotations/components/AnnotationsList/components/AddAnnotationForm/index.js +1 -1
  11. package/components/Annotations/components/AnnotationsList/components/AnnotationComments/index.js +1 -1
  12. package/components/AssetEditor/effects/index.js +1 -1
  13. package/components/Attachment/index.js +1 -1
  14. package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
  15. package/components/BICOffsetPickerDialog/components/WellSection/AutoCompleteAssetSearch/utils/apiCalls.js +1 -1
  16. package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
  17. package/components/BICOffsetPickerDialog/index.js +1 -1
  18. package/components/Breadcrumbs/index.js +1 -1
  19. package/components/CollapsableSidebar.js +1 -1
  20. package/components/Comment/index.js +1 -1
  21. package/components/CommentInput/index.js +1 -1
  22. package/components/DevCenter/AppHeader/AppHeader.js +1 -1
  23. package/components/DevCenter/AppHeader/PadMode.js +1 -1
  24. package/components/DevCenter/AppSideBar/AppSideBar.js +1 -1
  25. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
  26. package/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
  27. package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
  28. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  29. package/components/DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js +1 -1
  30. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
  31. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/RemoveAppButton.js +1 -1
  32. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js +1 -1
  33. package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
  34. package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
  35. package/components/FileUploadIconButton.js +1 -1
  36. package/components/FilesLoader/FilesLoader.js +1 -1
  37. package/components/HeaderLayout/HeaderLayout.js +1 -1
  38. package/components/HeaderLayout/utils.js +1 -1
  39. package/components/InfiniteList/index.js +1 -1
  40. package/components/Notifications/NotificationsContainer.js +1 -1
  41. package/components/OffsetWellPickerV2/components/Table/index.js +1 -1
  42. package/components/OffsetWellPickerV2/constants.js +1 -1
  43. package/components/OffsetWellPickerV2/effects/index.js +1 -1
  44. package/components/OffsetWellPickerV2/utils/apiCalls.js +1 -1
  45. package/components/PadModeSelect/PadModeSelect.js +1 -1
  46. package/components/PadOffsetsPicker/OffsetAssetChip.js +1 -0
  47. package/components/PadOffsetsPicker/OffsetAssetsListExpander.js +1 -0
  48. package/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -0
  49. package/components/PadOffsetsPicker/StagesSelector.js +1 -0
  50. package/components/PadOffsetsPicker/index.js +1 -0
  51. package/components/ParameterCharts/AddEditTrack.js +1 -1
  52. package/components/ParameterCharts/components/Track.js +1 -1
  53. package/components/ParameterCharts/components/TrackSettings.js +1 -1
  54. package/components/PostPreviewDialog/index.js +1 -1
  55. package/components/SlateFormattedText/SlateFormattedText.js +1 -1
  56. package/components/Template/TemplateSharingDialog/ChipSelector.js +1 -1
  57. package/components/VirtualizedTable/VirtualizedTable.js +1 -1
  58. package/components/WellSummary/WellSummaryItemValue.js +1 -1
  59. package/components/WellSummary/effects/useWellSummaryData.js +1 -1
  60. package/components/index.js +1 -1
  61. package/constants/index.js +1 -1
  62. package/package.json +2 -1
  63. package/utils/DrillstringUtils.js +1 -1
  64. package/utils/FluidCheckUtils.js +1 -1
  65. package/utils/casing/conversion.js +1 -1
  66. package/utils/casing/validation.js +1 -1
  67. package/utils/completion.js +1 -1
  68. package/utils/dashboardReports.js +1 -1
  69. package/utils/devcenter.js +1 -1
  70. package/utils/index.js +1 -1
  71. package/utils/lasParser.js +1 -1
  72. package/utils/main.js +1 -1
  73. package/utils/torqueAndHookloadUtils.js +1 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"moment";import{getUnitDisplay as r,getUnitPreference as n,convertValue as i}from"../convert.js";import{MIN_ID as o,MAX_ID as a,MIN_OD as h,MAX_OD as l,MIN_TOP_DEPTH as m,MAX_TOP_DEPTH as s,MIN_BOTTOM_DEPTH as u,MAX_BOTTOM_DEPTH as _,DP_MIN_ID as d,DP_MIN_OD as g,DP_MAX_ID as p,DP_MAX_OD as f,DP_MIN_TJ_ID as c,DP_MIN_TJ_OD as b,DP_MAX_TJ_ID as j,DP_MAX_TJ_OD as O,DP_MIN_LENGTH as F,DP_MAX_LENGTH as w,HWDP_MIN_ID as y,HWDP_MIN_OD as L,HWDP_MAX_ID as v,HWDP_MAX_OD as D,HWDP_MIN_TJ_ID as I,HWDP_MIN_TJ_OD as N,HWDP_MAX_TJ_ID as P,HWDP_MAX_TJ_OD as V,HWDP_MIN_LENGTH as q,HWDP_MAX_LENGTH as k}from"../../constants/casing.js";function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?x(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S=r("shortLength"),T=r("length");function E(e,t,r,n){var i=r?e.toFixed(r):e,o=r?t.toFixed(r):t;return"".concat(i,"~").concat(o).concat(n?" (".concat(n,")"):"")}function J(e,t,r){return!(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(r))||(e<t||e>r)}function B(e,t){var r=n("shortLength"),o="in"!==r?i(e,"shortLength",r,"in"):e,a="in"!==r?i(t,"shortLength",r,"in"):t,h=2.673*(o*o-a*a);return"in"!==r?i(h,"massPerLength","lb-ft"):h}function C(e,t,r){var n=B(e,t);return r>=.5*n&&r<=1.5*n}function W(e){var t=function(e){return A(A({},e),{},{inner_diameter:parseFloat(e.inner_diameter),outer_diameter:parseFloat(e.outer_diameter),linear_weight:parseFloat(e.linear_weight),number_of_joints:parseFloat(e.number_of_joints),component_length:parseFloat(e.component_length),length:parseFloat(e.length),weight:parseFloat(e.weight),outer_diameter_tooljoint:parseFloat(e.outer_diameter_tooljoint),inner_diameter_tooljoint:parseFloat(e.inner_diameter_tooljoint),length_tooljoint:parseFloat(e.length_tooljoint)})}(e),r=A(A({},function(e){var t={};return Number.isFinite(e.inner_diameter)||(t.inner_diameter="It must be a number."),Number.isFinite(e.outer_diameter)||(t.outer_diameter="It must be a number."),Number.isFinite(e.linear_weight)||(t.linear_weight="It must be a number."),t.inner_diameter||t.outer_diameter||(e.outer_diameter<e.inner_diameter?t.outer_diameter="O.D > I.D":t.linear_weight||C(e.outer_diameter,e.inner_diameter,e.linear_weight)||(t.linear_weight="Invalid linear weight")),Number.isFinite(e.number_of_joints)||(t.number_of_joints="It must be a number."),Number.isFinite(e.component_length)||(t.component_length="It must be a number."),Number.isFinite(e.length)||(t.length="It must be a number."),Number.isFinite(e.weight)||(t.weight="It must be a number."),t}(t)),function(e){var t,r,n,o,a,h,l,m,s,u,_=e.family,x={};return"dp"!==_&&"hwdp"!==_||("dp"===_?(t=d,r=g,n=p,o=f,a=c,h=b,l=j,m=O,s=F,u=w):(t=y,r=L,n=v,o=D,a=I,h=N,l=P,m=V,s=q,u=k),t=i(t,"shortLength","in"),r=i(r,"shortLength","in"),n=i(n,"shortLength","in"),o=i(o,"shortLength","in"),a=i(a,"shortLength","in"),h=i(h,"shortLength","in"),l=i(l,"shortLength","in"),m=i(m,"shortLength","in"),s=i(s,"length","ft"),u=i(u,"length","ft"),J(e.inner_diameter,t,n)&&(x.inner_diameter=E(t,n,2,S)),J(e.outer_diameter,r,o)&&(x.outer_diameter=E(r,o,2,S)),J(e.inner_diameter_tooljoint,a,l)&&(x.inner_diameter_tooljoint=E(a,l,2,S)),J(e.outer_diameter_tooljoint,h,m)&&(x.outer_diameter_tooljoint=E(h,m,2,S)),J(e.length,s,u)&&(x.length=E(s,u,2,T)),!x.outer_diameter_tooljoint&&e.outer_diameter_tooljoint<e.outer_diameter&&(x.outer_diameter_tooljoint="Tool Joint O.D >= O.D"),e.length_tooljoint>e.component_length&&(x.length_tooljoint="Tool Joint Length < Component Length")),x}(t));return Object.keys(r).length>0?{isValid:!1,errors:r}:{isValid:!0}}function z(e,t){var r=[];if(t.length&&!e){var n=t.filter((function(e){return"casing_joints"===e.family})),i=t.filter((function(e){return"float_shoe"===e.family})),o=t[t.length-1],a=t[0];n.length<1&&r.push("At least one casing joints required."),0===i.length?r.push("At least one float shoe required."):i.length>1?r.push("Only one float shoe required."):"float_shoe"!==a.family&&"float_shoe"!==o.family&&r.push("Float Shoe should be on the bottom of the list")}if(e){var h=t.filter((function(e){return"riser"===e.family}));0===h.length?r.push("At least one riser required."):h.length>1&&r.push("Only one riser required.")}return r.length>0?{isValid:!1,errors:r}:{isValid:!0}}function G(e){var r=e.data,n={},d=i(o,"shortLength","in"),g=i(a,"shortLength","in"),p=i(h,"shortLength","in"),f=i(l,"shortLength","in"),c=i(m,"length","ft"),b=i(s,"length","ft"),j=i(u,"length","ft"),O=i(_,"length","ft");return r.start_timestamp&&!t(new Date(r.start_timestamp)).isValid()&&(n.start_timestamp="Invalid Date."),J(r.inner_diameter,d,g)&&(n.inner_diameter=E(d,g,2,S)),J(r.outer_diameter,p,f)&&(n.outer_diameter=E(p,f,2,S)),!n.inner_diameter&&!n.outer_diamter&&r.inner_diamter>r.outer_diameter&&(n.outer_diameter="O.D > I.D"),J(r.top_depth,c,b)&&(n.top_depth=E(c,b,2,T)),J(r.bottom_depth,j,O)&&(n.bottom_depth=E(j,O,2,T)),!n.top_depth&&!n.bottom_depth&&r.top_depth>r.bottom_depth&&(n.bottom_depth="Bottom Depth > Top Depth"),n.inner_diameter||n.outer_diameter||!C(r.outer_diameter,r.inner_diameter,r.linear_weight)||(n.linear_weight="Invalid Linear Weight"),Object.keys(n).length>0?{isValid:!1,errors:n}:{isValid:!0}}export{B as calculateLinearWeight,C as isValidLinearWeight,W as validateComponent,z as validateInterComponents,G as validateMainFields};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"moment";import{MIN_ID as r,MAX_ID as n,MIN_OD as i,MAX_OD as o,MIN_TOP_DEPTH as a,MAX_TOP_DEPTH as h,MIN_BOTTOM_DEPTH as l,MAX_BOTTOM_DEPTH as m,DP_MIN_ID as s,DP_MIN_OD as u,DP_MAX_ID as _,DP_MAX_OD as d,DP_MIN_TJ_ID as g,DP_MIN_TJ_OD as p,DP_MAX_TJ_ID as f,DP_MAX_TJ_OD as c,DP_MIN_LENGTH as b,DP_MAX_LENGTH as j,HWDP_MIN_ID as O,HWDP_MIN_OD as F,HWDP_MAX_ID as w,HWDP_MAX_OD as y,HWDP_MIN_TJ_ID as L,HWDP_MIN_TJ_OD as v,HWDP_MAX_TJ_ID as D,HWDP_MAX_TJ_OD as I,HWDP_MIN_LENGTH as N,HWDP_MAX_LENGTH as P}from"../../constants/casing.js";import{getUnitDisplay as V,getUnitPreference as q,convertValue as k}from"../convert.js";function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?x(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S=V("shortLength"),T=V("length");function E(e,t,r,n){var i=r?e.toFixed(r):e,o=r?t.toFixed(r):t;return"".concat(i,"~").concat(o).concat(n?" (".concat(n,")"):"")}function J(e,t,r){return!(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(r))||(e<t||e>r)}function B(e,t){var r=q("shortLength"),n="in"!==r?k(e,"shortLength",r,"in"):e,i="in"!==r?k(t,"shortLength",r,"in"):t,o=2.673*(n*n-i*i);return"in"!==r?k(o,"massPerLength","lb-ft"):o}function C(e,t,r){var n=B(e,t);return r>=.5*n&&r<=1.5*n}function W(e){var t=function(e){return A(A({},e),{},{inner_diameter:parseFloat(e.inner_diameter),outer_diameter:parseFloat(e.outer_diameter),linear_weight:parseFloat(e.linear_weight),number_of_joints:parseFloat(e.number_of_joints),component_length:parseFloat(e.component_length),length:parseFloat(e.length),weight:parseFloat(e.weight),outer_diameter_tooljoint:parseFloat(e.outer_diameter_tooljoint),inner_diameter_tooljoint:parseFloat(e.inner_diameter_tooljoint),length_tooljoint:parseFloat(e.length_tooljoint)})}(e),r=A(A({},function(e){var t={};return Number.isFinite(e.inner_diameter)||(t.inner_diameter="It must be a number."),Number.isFinite(e.outer_diameter)||(t.outer_diameter="It must be a number."),Number.isFinite(e.linear_weight)||(t.linear_weight="It must be a number."),t.inner_diameter||t.outer_diameter||(e.outer_diameter<e.inner_diameter?t.outer_diameter="O.D > I.D":t.linear_weight||C(e.outer_diameter,e.inner_diameter,e.linear_weight)||(t.linear_weight="Invalid linear weight")),Number.isFinite(e.number_of_joints)||(t.number_of_joints="It must be a number."),Number.isFinite(e.component_length)||(t.component_length="It must be a number."),Number.isFinite(e.length)||(t.length="It must be a number."),Number.isFinite(e.weight)||(t.weight="It must be a number."),t}(t)),function(e){var t,r,n,i,o,a,h,l,m,V,q=e.family,x={};return"dp"!==q&&"hwdp"!==q||("dp"===q?(t=s,r=u,n=_,i=d,o=g,a=p,h=f,l=c,m=b,V=j):(t=O,r=F,n=w,i=y,o=L,a=v,h=D,l=I,m=N,V=P),t=k(t,"shortLength","in"),r=k(r,"shortLength","in"),n=k(n,"shortLength","in"),i=k(i,"shortLength","in"),o=k(o,"shortLength","in"),a=k(a,"shortLength","in"),h=k(h,"shortLength","in"),l=k(l,"shortLength","in"),m=k(m,"length","ft"),V=k(V,"length","ft"),J(e.inner_diameter,t,n)&&(x.inner_diameter=E(t,n,2,S)),J(e.outer_diameter,r,i)&&(x.outer_diameter=E(r,i,2,S)),J(e.inner_diameter_tooljoint,o,h)&&(x.inner_diameter_tooljoint=E(o,h,2,S)),J(e.outer_diameter_tooljoint,a,l)&&(x.outer_diameter_tooljoint=E(a,l,2,S)),J(e.length,m,V)&&(x.length=E(m,V,2,T)),!x.outer_diameter_tooljoint&&e.outer_diameter_tooljoint<e.outer_diameter&&(x.outer_diameter_tooljoint="Tool Joint O.D >= O.D"),e.length_tooljoint>e.component_length&&(x.length_tooljoint="Tool Joint Length < Component Length")),x}(t));return Object.keys(r).length>0?{isValid:!1,errors:r}:{isValid:!0}}function z(e,t){var r=[];if(t.length&&!e){var n=t.filter((function(e){return"casing_joints"===e.family})),i=t.filter((function(e){return"float_shoe"===e.family})),o=t[t.length-1],a=t[0];n.length<1&&r.push("At least one casing joints required."),0===i.length?r.push("At least one float shoe required."):i.length>1?r.push("Only one float shoe required."):"float_shoe"!==a.family&&"float_shoe"!==o.family&&r.push("Float Shoe should be on the bottom of the list")}if(e){var h=t.filter((function(e){return"riser"===e.family}));0===h.length?r.push("At least one riser required."):h.length>1&&r.push("Only one riser required.")}return r.length>0?{isValid:!1,errors:r}:{isValid:!0}}function G(e){var s=e.data,u={},_=k(r,"shortLength","in"),d=k(n,"shortLength","in"),g=k(i,"shortLength","in"),p=k(o,"shortLength","in"),f=k(a,"length","ft"),c=k(h,"length","ft"),b=k(l,"length","ft"),j=k(m,"length","ft");return s.start_timestamp&&!t(new Date(s.start_timestamp)).isValid()&&(u.start_timestamp="Invalid Date."),J(s.inner_diameter,_,d)&&(u.inner_diameter=E(_,d,2,S)),J(s.outer_diameter,g,p)&&(u.outer_diameter=E(g,p,2,S)),!u.inner_diameter&&!u.outer_diamter&&s.inner_diamter>s.outer_diameter&&(u.outer_diameter="O.D > I.D"),J(s.top_depth,f,c)&&(u.top_depth=E(f,c,2,T)),J(s.bottom_depth,b,j)&&(u.bottom_depth=E(b,j,2,T)),!u.top_depth&&!u.bottom_depth&&s.top_depth>s.bottom_depth&&(u.bottom_depth="Bottom Depth > Top Depth"),u.inner_diameter||u.outer_diameter||!C(s.outer_diameter,s.inner_diameter,s.linear_weight)||(u.linear_weight="Invalid Linear Weight"),Object.keys(u).length>0?{isValid:!1,errors:u}:{isValid:!0}}export{B as calculateLinearWeight,C as isValidLinearWeight,W as validateComponent,z as validateInterComponents,G as validateMainFields};
@@ -1 +1 @@
1
- import{set as t}from"lodash";import{COMPLETION_APPTYPE_MODES_DICT as a,COMPLETION_APP_TYPES as e}from"../constants/completion.js";var n=function(t,a){return t?"pad--".concat(t.current_pad_id):a?"well--".concat(a.id):"common"},r=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.fracMultiWellApp,c={};return t?c={mode:a[r][0]}:n&&(c={mode:"custom",selectedAssets:[n.id]}),c},c=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,n){var r=(n.app_streams||[]).find((function(t){return"frac"===t.source_type&&(e||"active"===t.status)}));return!r||a&&a.last_frac_at>r.last_active_at?a:t(n,"last_frac_at",r.last_active_at)}),null)},i=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,n){var r=(n.app_streams||[]).find((function(t){return"wireline"===t.source_type&&(e||"active"===t.status)}));return!r||a&&a.last_wireline_at>r.last_active_at?a:t(n,"last_wireline_at",r.last_active_at)}),null)},u=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,n){var r=(n.app_streams||[]).find((function(t){return"pumpdown"===t.source_type&&(e||"active"===t.status)}));return!r||a&&a.last_pumpdown_at>r.last_active_at?a:t(n,"last_pumpdown_at",r.last_active_at)}),null)};export{n as getAssetKey,r as getDefaultPadModeSetting,c as resolveActiveFracAsset,u as resolveActivePumpdownAsset,i as resolveActiveWirelineAsset};
1
+ import{COMPLETION_APPTYPE_MODES_DICT as t,COMPLETION_APP_TYPES as a}from"../constants/completion.js";import{set as e}from"lodash";var n=function(t,a){return t?"pad--".concat(t.current_pad_id):a?"well--".concat(a.id):"common"},r=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.fracMultiWellApp,c={};return e?c={mode:t[r][0]}:n&&(c={mode:"custom",selectedAssets:[n.id]}),c},c=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.reduce((function(t,n){var r=(n.app_streams||[]).find((function(t){return"frac"===t.source_type&&(a||"active"===t.status)}));return!r||t&&t.last_frac_at>r.last_active_at?t:e(n,"last_frac_at",r.last_active_at)}),null)},i=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.reduce((function(t,n){var r=(n.app_streams||[]).find((function(t){return"wireline"===t.source_type&&(a||"active"===t.status)}));return!r||t&&t.last_wireline_at>r.last_active_at?t:e(n,"last_wireline_at",r.last_active_at)}),null)},u=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.reduce((function(t,n){var r=(n.app_streams||[]).find((function(t){return"pumpdown"===t.source_type&&(a||"active"===t.status)}));return!r||t&&t.last_pumpdown_at>r.last_active_at?t:e(n,"last_pumpdown_at",r.last_active_at)}),null)};export{n as getAssetKey,r as getDefaultPadModeSetting,c as resolveActiveFracAsset,u as resolveActivePumpdownAsset,i as resolveActiveWirelineAsset};
@@ -1 +1 @@
1
- import"@babel/runtime/helpers/toConsumableArray";var t=37.7952755906,i=18.8976377953,n=function(t){var i=t.width,n=t.height;return{pixelWidth:Math.round(18.8976377953*i),pixelHeight:Math.round(18.8976377953*n)}},e={NORMAL:{type:"NORMAL",columns:{min:1,max:7},rows:{min:1,max:1e3},slots:1,height:17.5,width:20.8},WIDE:{type:"WIDE",columns:{min:8,max:12},rows:{min:1,max:25},slots:2,height:17.5,width:41.8},HALFSCREEN:{type:"HALFSCREEN",columns:{min:8,max:12},rows:{min:26,max:40},slots:4,height:26.5,width:41.8},FULLSCREEN:{type:"FULLSCREEN",columns:{min:8,max:12},rows:{min:41,max:1e3},slots:6,height:53.3,width:41.8}};function m(t){var i=t.coordinates,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dashboard";if("singleApp"===n)return e.FULLSCREEN;var m=i.w,o=i.h;return Object.values(e).find((function(t){return m>=t.columns.min&&m<=t.columns.max&&o>=t.rows.min&&o<=t.rows.max}))}export{i as PDF_REPORT_PIXEL_RATIO,t as PIXELS_IN_CM,n as getAppPixelSize,m as getAppType};
1
+ import t from"@babel/runtime/helpers/toConsumableArray";var r="SMALL",n="MEDIUM",e="LARGE",o="XLARGE",i=37.7952755906,a=18.8976377953,s=function(t){var r=t.width,n=t.height;return{pixelWidth:Math.round(18.8976377953*r),pixelHeight:Math.round(18.8976377953*n)}},u={NORMAL:{type:"NORMAL",columns:{min:1,max:7},rows:{min:1,max:1e3},slots:1,height:17.5,width:20.8},WIDE:{type:"WIDE",columns:{min:8,max:12},rows:{min:1,max:25},slots:2,height:17.5,width:41.8},HALFSCREEN:{type:"HALFSCREEN",columns:{min:8,max:12},rows:{min:26,max:40},slots:4,height:26.5,width:41.8},FULLSCREEN:{type:"FULLSCREEN",columns:{min:8,max:12},rows:{min:41,max:1e3},slots:6,height:53.3,width:41.8}};function c(t){return t.concat().sort((function(t,r){var n=t.coordinates.y,e=r.coordinates.y;if(n<e)return-1;if(n>e)return 1;if(n===e){var o=t.coordinates.x,i=r.coordinates.x;if(o<i)return-1;if(o>i)return 1}return 0}))}function m(t){var r=t.coordinates,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dashboard";if("singleApp"===n)return u.FULLSCREEN;var e=r.w,o=r.h;return Object.values(u).find((function(t){return e>=t.columns.min&&e<=t.columns.max&&o>=t.rows.min&&o<=t.rows.max}))}function l(r,n){var e,o=[],i=[o],a=0;return r.reduce((function(i,s,c){e=!1;var l=m(s,n),h=l.slots,f=l.type;if(f!==u.FULLSCREEN.type){var p=r[c+1];if(p){var d=m(p,n);if(a%2==0&&1===h&&d.slots%2==0){var E=u.WIDE;h=E.slots,f=E.type}}else if(c%2==0){var v=u.WIDE;h=v.slots,f=v.type}}a+=h;var L={app:s,slots:h,reportAppSize:l},x=i.map((function(r){if(e)return r;var n=6-r.reduce((function(t,r){return t+r.slots}),0);return n>=h&&(e=!0),n>=h?[].concat(t(r),[L]):r}));return e?x:[].concat(t(x),[[].concat(o,[L])])}),i)}function h(t){var i=t.w,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a?o:i>=5?e:i>=3?n:r}export{a as PDF_REPORT_PIXEL_RATIO,i as PIXELS_IN_CM,s as getAppPixelSize,m as getAppType,h as getPDFAppSize,l as getPages,c as sortPDFDashboardApps};
@@ -1 +1 @@
1
- import"lodash";import"../constants/goals.js";import"../constants/apps.js";import"../constants/completion.js";import"../constants/segment.js";import"../constants/alerts.js";import{DEV_CENTER_CLI_APP_ID as n}from"../constants/devcenter.js";import"../constants/drillstring.js";var t=function(n,t){return n?"".concat(n.replace(/\./g,"_"),"-").concat(t):""},o=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return o===+(null==t?void 0:t.maximizeDC)};function a(n){return{push:function(t){"string"==typeof t?n.push(t):n.push({pathname:t.pathname,query:t.query})},location:{pathname:n.location.pathname,query:n.location.query}}}var r=function(n){return n?+(n.split("#")[2]||"").replace("}",""):void 0},e=function(n){var t,o;return null!==(t=null==n||null===(o=n.package)||void 0===o?void 0:o.manifest.application.name)&&void 0!==t?t:n.name},i=function(n){return"dev_center"===n.app.platform};export{a as createDevCenterRouter,t as getAppIdentifier,e as getAppName,r as getTimestampFromQuery,o as isAppMaximized,i as isDevCenterApp};
1
+ import"../constants/completion.js";import"../constants/alerts.js";import"lodash";import{DEV_CENTER_CLI_APP_ID as n}from"../constants/devcenter.js";import"../constants/goals.js";import"../constants/segment.js";import"../constants/apps.js";import"../constants/drillstring.js";var t=function(n,t){return n?"".concat(n.replace(/\./g,"_"),"-").concat(t):""},o=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return o===+(null==t?void 0:t.maximizeDC)};function a(n){return{push:function(t){"string"==typeof t?n.push(t):n.push({pathname:t.pathname,query:t.query})},location:{pathname:n.location.pathname,query:n.location.query}}}var r=function(n){return n?+(n.split("#")[2]||"").replace("}",""):void 0},e=function(n){var t,o;return null!==(t=null==n||null===(o=n.package)||void 0===o?void 0:o.manifest.application.name)&&void 0!==t?t:n.name},i=function(n){return"dev_center"===n.app.platform};export{a as createDevCenterRouter,t as getAppIdentifier,e as getAppName,r as getTimestampFromQuery,o as isAppMaximized,i as isDevCenterApp};
package/utils/index.js CHANGED
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";export{default as AccuracyUtils}from"./AccuracyUtils.js";import{convertArray as t,convertValue as o,getAllUnitTypes as e,getDefaultImperialUnit as s,getDefaultUnits as i,getUnitDescription as a,getUnitDisplay as n,getUnitPlural as p,getUnitPreference as m,getUnitsByType as f,getUnitSingular as c,getUnitSystem as l,updateUserUnits as j,getUserUnits as u,subscribeForUserUnitsUpdates as x,convertImmutables as g,convertImmutablesByBatch as y,getUniqueUnitsByType as U}from"./convert.js";import*as b from"./convert.js";export{b as convert};import*as v from"./DrillstringUtils.js";export{v as drillstringUtils};import*as d from"./FluidCheckUtils.js";export{d as fluidCheckUtils};import*as O from"./chartSeries.js";export{O as chartSeries};import*as h from"./metrics/index.js";export{h as metricsUtils};import*as P from"./main.js";export{P as main};import*as w from"./sqlParser.js";export{w as sqlParser};import*as D from"./completion.js";export{D as completion};import*as S from"./mapUnits.js";export{S as mapUnits};import*as A from"./time.js";export{A as time};import*as C from"./components.js";import*as N from"./mapbox.js";import*as T from"./torqueAndHookloadUtils.js";export{T as torqueAndHookloadUtils};import*as k from"./StageDesignVActualUtils.js";export{k as StageDesignVActualUtils};import*as B from"./reports.js";export{B as reports};import*as E from"./ga.js";export{E as ga};import*as I from"./nativeMessages.js";export{I as nativeMessages};import*as K from"./goals.js";export{K as goals};import*as q from"./notifications.js";export{q as notifications};import*as F from"./permissions.js";export{F as permissions};import*as J from"./alerts.js";export{J as alerts};import*as V from"./lasParser.js";export{V as lasParser};import*as H from"./audio.js";export{H as audio};import*as M from"./loadable.js";export{M as loadable};import*as W from"./rollbar.js";export{W as rollbar};import*as z from"./devcenter.js";export{z as devcenter};import*as G from"./mobileDetect.js";export{G as mobileDetect};import*as L from"./drillstring/index.js";export{L as drillstring};import*as Q from"./casing/index.js";export{Q as casing};import*as R from"./csvExport.js";export{R as csvExport};import*as X from"./formatting.js";export{X as formatting};export{createNotification,removeNotification,showErrorNotification,showInfoNotification,showSuccessNotification,showWarningNotification}from"./notificationToasts.js";export{convertKeysToCamelCase,convertKeysToSnakeCase,getConvertKeys}from"./convertKeys.js";function Y(r,t){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),o.push.apply(o,e)}return o}var Z={get:function(r,t){var o=r[t];return"function"==typeof o?function(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return o.apply(r,e.map((function(r){return r.toJS?r.toJS():r})))}:o}};function $(t){return new Proxy(function(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?Y(Object(e),!0).forEach((function(o){r(t,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Y(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({},t),Z)}var _=t,rr=o,tr=e,or=s,er=i,sr=a,ir=n,ar=p,nr=m,pr=f,mr=c,fr=l,cr=j,lr=u,jr=x,ur=g,xr=y,gr=U,yr=$(N),Ur=$(C);export{Ur as components,_ as convertArray,ur as convertImmutables,xr as convertImmutablesByBatch,rr as convertValue,tr as getAllUnitTypes,or as getDefaultImperialUnit,er as getDefaultUnits,gr as getUniqueUnitsByType,sr as getUnitDescription,ir as getUnitDisplay,ar as getUnitPlural,nr as getUnitPreference,mr as getUnitSingular,fr as getUnitSystem,pr as getUnitsByType,lr as getUserUnits,yr as mapbox,jr as subscribeForUserUnitsUpdates,cr as updateUserUnits};
1
+ import r from"@babel/runtime/helpers/defineProperty";import*as t from"./StageDesignVActualUtils.js";export{t as StageDesignVActualUtils};import*as o from"./alerts.js";export{o as alerts};import*as e from"./audio.js";export{e as audio};import{convertArray as s,convertValue as i,getAllUnitTypes as a,getDefaultImperialUnit as p,getDefaultUnits as n,getUnitDescription as m,getUnitDisplay as f,getUnitPlural as c,getUnitPreference as l,getUnitsByType as j,getUnitSingular as x,getUnitSystem as u,updateUserUnits as g,getUserUnits as y,subscribeForUserUnitsUpdates as U,convertImmutables as b,convertImmutablesByBatch as v,getUniqueUnitsByType as d}from"./convert.js";import*as O from"./convert.js";export{O as convert};import*as h from"./casing/index.js";export{h as casing};import*as P from"./chartSeries.js";export{P as chartSeries};import*as w from"./completion.js";export{w as completion};import*as D from"./components.js";import*as S from"./csvExport.js";export{S as csvExport};import*as A from"./metrics/index.js";export{A as metricsUtils};import*as C from"./devcenter.js";export{C as devcenter};import*as N from"./drillstring/index.js";export{N as drillstring};import*as T from"./DrillstringUtils.js";export{T as drillstringUtils};import*as k from"./FluidCheckUtils.js";export{k as fluidCheckUtils};import*as B from"./formatting.js";export{B as formatting};import*as E from"./reports.js";export{E as reports};import*as I from"./ga.js";export{I as ga};import*as K from"./goals.js";export{K as goals};import*as q from"./lasParser.js";export{q as lasParser};import*as F from"./loadable.js";export{F as loadable};import*as J from"./main.js";export{J as main};import*as V from"./mapUnits.js";export{V as mapUnits};import*as H from"./mapbox.js";import*as M from"./mobileDetect.js";export{M as mobileDetect};import*as R from"./nativeMessages.js";export{R as nativeMessages};import*as W from"./notifications.js";export{W as notifications};import*as z from"./permissions.js";export{z as permissions};import*as G from"./rollbar.js";export{G as rollbar};import*as L from"./sqlParser.js";export{L as sqlParser};import*as Q from"./time.js";export{Q as time};import*as X from"./torqueAndHookloadUtils.js";export{X as torqueAndHookloadUtils};export{default as AccuracyUtils}from"./AccuracyUtils.js";export{createNotification,removeNotification,showErrorNotification,showInfoNotification,showSuccessNotification,showWarningNotification}from"./notificationToasts.js";export{convertKeysToCamelCase,convertKeysToSnakeCase,getConvertKeys}from"./convertKeys.js";import*as Y from"./dashboardReports.js";export{Y as dashboardReports};import*as Z from"./apps.js";export{Z as apps};function $(r,t){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),o.push.apply(o,e)}return o}var _={get:function(r,t){var o=r[t];return"function"==typeof o?function(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return o.apply(r,e.map((function(r){return r.toJS?r.toJS():r})))}:o}};function rr(t){return new Proxy(function(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?$(Object(e),!0).forEach((function(o){r(t,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):$(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({},t),_)}var tr=s,or=i,er=a,sr=p,ir=n,ar=m,pr=f,nr=c,mr=l,fr=j,cr=x,lr=u,jr=g,xr=y,ur=U,gr=b,yr=v,Ur=d,br=rr(H),vr=rr(D);export{vr as components,tr as convertArray,gr as convertImmutables,yr as convertImmutablesByBatch,or as convertValue,er as getAllUnitTypes,sr as getDefaultImperialUnit,ir as getDefaultUnits,Ur as getUniqueUnitsByType,ar as getUnitDescription,pr as getUnitDisplay,nr as getUnitPlural,mr as getUnitPreference,cr as getUnitSingular,lr as getUnitSystem,fr as getUnitsByType,xr as getUserUnits,br as mapbox,ur as subscribeForUserUnitsUpdates,jr as updateUserUnits};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import e from"@babel/runtime/helpers/slicedToArray";function n(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 i(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}return t}var s=function n(){var s=this;t(this,n),r(this,"getConfiguration",(function(r){var t=null,n=null,i=null,o=!1;r.forEach((function(r){if(r.toLowerCase().startsWith("~version"))o=!0;else if(r.toLowerCase().startsWith("~"))o=!1;else{if(o){var a=r.split(" ").filter(Boolean),u=e(a,3),l=u[0],c=u[1],f=u[2];switch(l){case"VERS.":t=c;break;case"WRAP.":n=c;break;case"DLM":i=f}}s.config={version:t,wrap:n,delimiter:i}}}))})),r(this,"parseHeaders",(function(r){var t=r.split("\n");s.getConfiguration(t);var e=!1;return t.reduce((function(r,t){if(t.toLowerCase().startsWith("~curve"))return e=!0,r;if(t.startsWith("~")&&(e=!1),e&&!t.startsWith("#")&&!t.startsWith("\r")){var n=t.split(" ").filter(Boolean);return n?r.push(n[0]):r}return r}),[])})),r(this,"parseData",(function(t,e,n){var s=t.split("\n"),o=!1;return s.reduce((function(t,s){if(s.toLowerCase().startsWith("~a"))return o=!0,t;if(s.startsWith("~")&&(o=!1),o){var a=s.split(/[\t\s,]/).filter(Boolean).reduce((function(t,s,o){var a=e[o],u=n.find((function(r){return r.parsingKey===a}));if(u){var l=u.innerKey;return i(i({},t),{},r({},l,parseFloat(s,2)))}return t}),{});return a.isEmpty()?t:t.push(a)}return t}),[])})),this.config={version:null,wrap:null,delimiter:null}};export default s;
1
+ import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/classCallCheck";function n(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 i(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}return t}var s=function n(){var s=this;e(this,n),r(this,"getConfiguration",(function(r){var e=null,n=null,i=null,o=!1;r.forEach((function(r){if(r.toLowerCase().startsWith("~version"))o=!0;else if(r.toLowerCase().startsWith("~"))o=!1;else{if(o){var a=r.split(" ").filter(Boolean),u=t(a,3),l=u[0],c=u[1],f=u[2];switch(l){case"VERS.":e=c;break;case"WRAP.":n=c;break;case"DLM":i=f}}s.config={version:e,wrap:n,delimiter:i}}}))})),r(this,"parseHeaders",(function(r){var t=r.split("\n");s.getConfiguration(t);var e=!1;return t.reduce((function(r,t){if(t.toLowerCase().startsWith("~curve"))return e=!0,r;if(t.startsWith("~")&&(e=!1),e&&!t.startsWith("#")&&!t.startsWith("\r")){var n=t.split(" ").filter(Boolean);return n?r.push(n[0]):r}return r}),[])})),r(this,"parseData",(function(t,e,n){var s=t.split("\n"),o=!1;return s.reduce((function(t,s){if(s.toLowerCase().startsWith("~a"))return o=!0,t;if(s.startsWith("~")&&(o=!1),o){var a=s.split(/[\t\s,]/).filter(Boolean).reduce((function(t,s,o){var a=e[o],u=n.find((function(r){return r.parsingKey===a}));if(u){var l=u.innerKey;return i(i({},t),{},r({},l,parseFloat(s,2)))}return t}),{});return a.isEmpty()?t:t.push(a)}return t}),[])})),this.config={version:null,wrap:null,delimiter:null}};export default s;
package/utils/main.js CHANGED
@@ -1 +1 @@
1
- import e from"lodash/isNumber";import t from"@babel/runtime/regenerator";import r from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/toConsumableArray";import o from"file-saver";import i from"chroma-js";import a from"lodash/round";import u from"lodash/isNaN";import c from"html2canvas";import m from"@material-ui/core/colors/grey";import s from"@material-ui/core/colors/red";import l from"@material-ui/core/colors/yellow";import f from"@material-ui/core/colors/blue";import p from"@material-ui/core/colors/green";import{SUPPORTED_DRILLING_OPERATIONS as h,DEFAULT_DRILLING_OPERATION_TYPE as d}from"../constants/apps.js";var g=m[500],v=s[500],b=l[500],N=f[500],F=p[500],w={formatValuePrecision:function(e){return Number.isFinite(e)?e<100&&e>-100?e.formatNumeral("0,0.00"):e.formatNumeral("0,0.0"):e},downloadPDF:function(e,t){var r=new File([t],"".concat(e,".pdf"),{type:"application/pdf;charset=utf-8"});o.saveAs(r)},unescapeLineBreaks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/\\n/g,"\n")},dataURLtoBlob:function(e){for(var t=window.atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),o=new Uint8Array(n),i=0;i<t.length;i+=1)o[i]=t.charCodeAt(i);return new Blob([n],{type:r})},banchmarkTimer:function(e){var t=new Date;return{stop:function(){var r=(new Date).getTime()-t.getTime();console.info("Timer:",e,"finished in",r,"ms")}}},convertToPercent:function(e,t){return e&&Number.isFinite(t)&&0!==t?Math.round(100*e/t*100)/100:0},getAverageByColumnsForCSV:function(t){var r=this,o=t.split("\n"),i=o[0].split(","),c=o[1].split(",").map((function(e){return[r.parseNumberFromString(e)]})),m=this.getLinesFrequency(o.length);o.shift();var s=o.reduce((function(t,o,i){if(i%m==0){var a=o.split(",").map(r.parseNumberFromString);return t.map((function(t,r){var o=+a[r];return e(o)&&!u(o)&&o>0?[].concat(n(t),[o]):t}))}return t}),c).map((function(e){return e.reduce((function(e,t){return e+t}))/e.length}));return s.map((function(e,t){return{header:i[t],value:a(e,5)}}))},parseNumberFromString:function(e){var t=+e;return u(t)?0:t},getLinesFrequency:function(e){var t="".concat(e);if(t.length<=4)return 1;var r=t.slice(4).length;return 1*Math.pow(10,r)},getColorFromString:function(e){return this.intToRGB(this.hashCode(e))},intToRGB:function(e){var t=(16777215&e).toString(16).toUpperCase();return"00000".substring(0,6-t.length)+t},hashCode:function(e){for(var t=0,r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t);return t},throttledEventListener:function(e,t,r,n){var o=!1,i=function(){o||(o=!0,window.requestAnimationFrame((function(){r.call(n),o=!1})))};return e.addEventListener(t,i),function(){e.removeEventListener(t,i)}},getSnapshotForElement:function(e){return r(t.mark((function r(){var n,o,i,a;return t.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=window.document.getElementById(e)){t.next=3;break}return t.abrupt("return",null);case 3:return o=n.clientHeight,i=n.clientWidth,t.next=6,c(n,{height:o,width:i,logging:!1});case 6:return a=t.sent,t.abrupt("return",a.toDataURL());case 8:case"end":return t.stop()}}),r)})))()},getAssetStatusColor:function(e){return"active"===e?F:"complete"===e?N:"paused"===e?b:"idle"===e||"unknown"===e?g:v},closest:function(e,t){return e.reduce((function(e,r){return Math.abs(r-t)<Math.abs(e-t)?r:e}))},mathMax:function(e,t){return Number.isFinite(e)?Number.isFinite(t)?Math.max(e,t):e:t},mathMin:function(e,t){return Number.isFinite(e)?Number.isFinite(t)?Math.min(e,t):e:t},getOperationByType:function(e){return Object.values(h).find((function(t){return t.value===e||d}))},getUserFullName:function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},getNameInitials:function(e){return e.split(" ").slice(0,2).map((function(e){return e.substr(0,1)})).join("")},getS3BucketName:function(){return"development"===process.env.REACT_APP_ENVIRONMENT||"qa"===process.env.REACT_APP_ENVIRONMENT?"corva-files-qa":"corva-files"},getS3FileUrl:function(e,t){return"https://".concat(e,".s3.amazonaws.com/").concat(t)},getFileNameWithExtensionFromPath:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/^.*[\\/]/,"")},hexToRgbA:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=i(e).rgba();return r[r.length-1]=t,"rgba(".concat(r.join(","),")")},truncateString:function(e,t){return e.length>t?"".concat(e.substr(0,t-1),"&hellip;"):e},copyToClipboard:function(e){var t=document.createElement("textarea");t.textContent=e,document.body.appendChild(t);var r=document.getSelection(),n=document.createRange();n.selectNode(t),r.removeAllRanges(),r.addRange(n),document.execCommand("copy"),r.removeAllRanges(),document.body.removeChild(t)}};window.getSnapshotForElement=w.getSnapshotForElement;export default w;
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"file-saver";import{SUPPORTED_DRILLING_OPERATIONS as r,DEFAULT_DRILLING_OPERATION_TYPE as n}from"../constants/apps.js";import o from"lodash/isNumber";import i from"@babel/runtime/regenerator";import a from"@babel/runtime/helpers/asyncToGenerator";import u from"chroma-js";import c from"lodash/round";import m from"lodash/isNaN";import s from"html2canvas";import l from"@material-ui/core/colors/grey";import f from"@material-ui/core/colors/red";import p from"@material-ui/core/colors/yellow";import h from"@material-ui/core/colors/blue";import d from"@material-ui/core/colors/green";var g=l[500],v=f[500],b=p[500],N=h[500],F=d[500],w={formatValuePrecision:function(e){return Number.isFinite(e)?e<100&&e>-100?e.formatNumeral("0,0.00"):e.formatNumeral("0,0.0"):e},downloadPDF:function(e,r){var n=new File([r],"".concat(e,".pdf"),{type:"application/pdf;charset=utf-8"});t.saveAs(n)},unescapeLineBreaks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/\\n/g,"\n")},dataURLtoBlob:function(e){for(var t=window.atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),o=new Uint8Array(n),i=0;i<t.length;i+=1)o[i]=t.charCodeAt(i);return new Blob([n],{type:r})},banchmarkTimer:function(e){var t=new Date;return{stop:function(){var r=(new Date).getTime()-t.getTime();console.info("Timer:",e,"finished in",r,"ms")}}},convertToPercent:function(e,t){return e&&Number.isFinite(t)&&0!==t?Math.round(100*e/t*100)/100:0},getAverageByColumnsForCSV:function(t){var r=this,n=t.split("\n"),i=n[0].split(","),a=n[1].split(",").map((function(e){return[r.parseNumberFromString(e)]})),u=this.getLinesFrequency(n.length);n.shift();var s=n.reduce((function(t,n,i){if(i%u==0){var a=n.split(",").map(r.parseNumberFromString);return t.map((function(t,r){var n=+a[r];return o(n)&&!m(n)&&n>0?[].concat(e(t),[n]):t}))}return t}),a).map((function(e){return e.reduce((function(e,t){return e+t}))/e.length}));return s.map((function(e,t){return{header:i[t],value:c(e,5)}}))},parseNumberFromString:function(e){var t=+e;return m(t)?0:t},getLinesFrequency:function(e){var t="".concat(e);if(t.length<=4)return 1;var r=t.slice(4).length;return 1*Math.pow(10,r)},getColorFromString:function(e){return this.intToRGB(this.hashCode(e))},intToRGB:function(e){var t=(16777215&e).toString(16).toUpperCase();return"00000".substring(0,6-t.length)+t},hashCode:function(e){for(var t=0,r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t);return t},throttledEventListener:function(e,t,r,n){var o=!1,i=function(){o||(o=!0,window.requestAnimationFrame((function(){r.call(n),o=!1})))};return e.addEventListener(t,i),function(){e.removeEventListener(t,i)}},getSnapshotForElement:function(e){return a(i.mark((function t(){var r,n,o,a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=window.document.getElementById(e)){t.next=3;break}return t.abrupt("return",null);case 3:return n=r.clientHeight,o=r.clientWidth,t.next=6,s(r,{height:n,width:o,logging:!1});case 6:return a=t.sent,t.abrupt("return",a.toDataURL());case 8:case"end":return t.stop()}}),t)})))()},getAssetStatusColor:function(e){return"active"===e?F:"complete"===e?N:"paused"===e?b:"idle"===e||"unknown"===e?g:v},closest:function(e,t){return e.reduce((function(e,r){return Math.abs(r-t)<Math.abs(e-t)?r:e}))},mathMax:function(e,t){return Number.isFinite(e)?Number.isFinite(t)?Math.max(e,t):e:t},mathMin:function(e,t){return Number.isFinite(e)?Number.isFinite(t)?Math.min(e,t):e:t},getOperationByType:function(e){return Object.values(r).find((function(t){return t.value===e||n}))},getUserFullName:function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},getNameInitials:function(e){return e.split(" ").slice(0,2).map((function(e){return e.substr(0,1)})).join("")},getS3BucketName:function(){return"development"===process.env.REACT_APP_ENVIRONMENT||"qa"===process.env.REACT_APP_ENVIRONMENT?"corva-files-qa":"corva-files"},getS3FileUrl:function(e,t){return"https://".concat(e,".s3.amazonaws.com/").concat(t)},getFileNameWithExtensionFromPath:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/^.*[\\/]/,"")},hexToRgbA:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=u(e).rgba();return r[r.length-1]=t,"rgba(".concat(r.join(","),")")},truncateString:function(e,t){return e.length>t?"".concat(e.substr(0,t-1),"&hellip;"):e},copyToClipboard:function(e){var t=document.createElement("textarea");t.textContent=e,document.body.appendChild(t);var r=document.getSelection(),n=document.createRange();n.selectNode(t),r.removeAllRanges(),r.addRange(n),document.execCommand("copy"),r.removeAllRanges(),document.body.removeChild(t)}};window.getSnapshotForElement=w.getSnapshotForElement;export default w;
@@ -1 +1 @@
1
- import a from"lodash/get";import t from"@babel/runtime/helpers/slicedToArray";var r=function(r,i){var e=a(i,["data","activity_groups","start_timestamp"]),o=a(i,["data","activity_groups","end_timestamp"]),m=t(r,2),p=m[0],s=m[1],l=p&&s&&p!==s&&p>=e&&p<=o&&s>=e&&s<=o?r:[e,o];return{playbackValue:l,isValidPlayback:l[0]&&l[1]&&l[0]!==l[1]}};export{r as getPlaybackValue};
1
+ import a from"@babel/runtime/helpers/slicedToArray";import t from"lodash/get";var r=function(r,i){var e=t(i,["data","activity_groups","start_timestamp"]),o=t(i,["data","activity_groups","end_timestamp"]),m=a(r,2),p=m[0],s=m[1],l=p&&s&&p!==s&&p>=e&&p<=o&&s>=e&&s<=o?r:[e,o];return{playbackValue:l,isValidPlayback:l[0]&&l[1]&&l[0]!==l[1]}};export{r as getPlaybackValue};