"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("react/jsx-runtime"),r=require("lodash"),n=require("../../../components/PadModeSelect/PadModeSelect.js"),i=require("../../TextMiddleTruncated/TextMiddleTruncated.js");require("../../TextMiddleTruncated/TextMiddleTruncated.constants.js");var l=require("../../Text/Text.js"),s=require("./PadMode.scss.js"),a=require("../../../constants/completion.js"),o=require("../../../utils/completion.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e);function u(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=function(e){var r=e.name,n=e.statusBadge;return t.jsxs("div",{className:s.activeAsset,children:[t.jsx(l.Text,{className:s.activeAssetName,size:12,children:t.jsx(i.TextMiddleTruncated,{children:r})}),n]})};exports.PadMode=function(e){var i,l,c,u,v,j,m=e.fracFleet,P=e.wells,b=e.well,y=e.onSettingChange,g=e.appSettings,O=e.app,T=(null==O||null===(i=O.package)||void 0===i||null===(l=i.manifest)||void 0===l||null===(c=l.application)||void 0===c?void 0:c.ui)||{},x=T.enableSimulFracInPadSelect,S=T.completionAppType,M=T.disableActiveWellsInPadSelect;if(b||r.isEmpty(P)||!m)return null;var A=g.padId,h=S||a.COMPLETION_APP_TYPES.fracMultiWellApp,q=o.getAssetKey(m,b,A),w=null==g||null===(u=g.settingsByAsset)||void 0===u?void 0:u[q],_=r.isEmpty(w)?o.getDefaultPadModeSetting(m,b,h):w,C=(null===(v=m.pad_frac_fleets)||void 0===v||null===(j=v.find((function(e){return A&&e.pad.id?+e.pad.id==+A:e.current})))||void 0===j?void 0:j.frac_fleet_lines)||[];return t.jsx(n,{assets:P,completionAppType:h,disableActiveWellsInPadSelect:M,enableSimulFracInPadSelect:x,padModeSetting:_,fracFleetLines:C,onChange:function(e){return y("settingsByAsset",p(p({},null==g?void 0:g.settingsByAsset),{},d.default({},q,e)))},formControlClassName:s.formField,activeAssetComponent:f})};
//# sourceMappingURL=PadMode.js.map
