import e from"@babel/runtime/helpers/defineProperty";import{noop as t,isEmpty as r,get as n}from"lodash";import l from"prop-types";import o from"../../PadModeSelect/PadModeSelect.js";import{COMPLETION_APP_TYPES as i}from"../../../constants/completion.js";import{getAssetKey as p,getDefaultPadModeSetting as a}from"../../../utils/completion.js";import{jsx as s}from"react/jsx-runtime";function c(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 d(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=function(t){var l,c=t.fracFleet,f=t.wells,u=t.well,m=t.onSettingChange,b=t.appSettings,S=t.completionAppType,g=t.disableActiveWellsInPadSelect,y=t.enableSimulFracInPadSelect;if(u||r(f)||!c)return null;var P=b.padId,O=S||i.fracMultiWellApp,v=p(c,u,P),j=n(b,["settingsByAsset",v]),h=r(j)?a(c,u,O,y,P):j,w=(null===(l=c.pad_frac_fleets.find((function(e){return P?+e.pad.id==+P:e.current})))||void 0===l?void 0:l.frac_fleet_lines)||[];return s(o,{assets:f,completionAppType:O,disableActiveWellsInPadSelect:g,enableSimulFracInPadSelect:y,padModeSetting:h,fracFleetLines:w,onChange:function(t){return m("settingsByAsset",d(d({},n(b,"settingsByAsset",{})),{},e({},v,t)))}})};f.propTypes={appSettings:l.shape({padId:l.number}),completionAppType:l.string,fracFleet:l.shape({}),onSettingChange:l.func,well:l.shape({}),wells:l.arrayOf(l.shape()),disableActiveWellsInPadSelect:l.bool,enableSimulFracInPadSelect:l.bool},f.defaultProps={appSettings:{},completionAppType:void 0,fracFleet:void 0,onSettingChange:t,well:void 0,wells:void 0,disableActiveWellsInPadSelect:!1,enableSimulFracInPadSelect:!1};export{f as default};
//# sourceMappingURL=PadMode.js.map
