import{__assign as t}from'./../../../../../ext-esm/tslib/tslib.es6.js';import{jsx as e}from"react/jsx-runtime";import a from"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import r from"../../../../LoadingIndicator/LoadingIndicator.js";import{SEGMENTS as i}from"../../../../../constants/segment.js";import o from"../../../../EmptyState/EmptyState.js";import{ChooseAssetButton as p}from"./components/ChooseAssetButton.js";import s from"../AppInfoMessage/AppInfoMessage.js";var n="DevCenterAppView",l=function(t){return"".concat(t," has no active well")};function d(d){var c,u=d.AppComponent,S=d.app,m=d.appData,A=d.appProps,E=d.availability,g=d.isCLIApp,P=d.isLoading,f=d.isMultiRig,b=d.layoutEnvironment,M=d.openIntercom,v=d.segment,y=d.toggleAppSettingsDialog,I=null==A?void 0:A.appHeaderProps;if(!S.package)return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),title:o.APP_MESSAGES.appPackageWasNotFound.title,subtitle:o.APP_MESSAGES.appPackageWasNotFound.subtitle,image:o.IMAGES.AppLoadingError})});if(P)return e(s,{appHeaderProps:I,children:e(r,{})});if(!E.hasProductSubscription||!E.isAppSubscribedForAsset){var _=o.APP_MESSAGES,N=_.appNotSubscribed,H=_.appNotSubscribedForAsset,h=o.IMAGES.NoSubscription,G=E.hasProductSubscription?H:N,F=G.title,C=G.subtitle;return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),title:F,subtitle:C,image:h})})}if(!u)return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),title:o.APP_MESSAGES.appComponentWasNotFound.title,image:o.IMAGES.AppLoadingError})});if(!f){var j=g&&e(p,{toggleAppSettingsDialog:y});if(m.rig&&!m.well)return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),title:l(m.rig.name),image:o.IMAGES.RigHasNoActiveWell,subtitle:j})});if("general"===(null==b?void 0:b.type)&&v===i.COMPLETION&&!m.fracFleet)return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),title:o.APP_MESSAGES.fracFleetWasNotFound.title,image:o.IMAGES.FracFleetHasNoActivePad,subtitle:j})});if("general"===(null==b?void 0:b.type)&&v===i.COMPLETION&&!(null===(c=m.fracFleet)||void 0===c?void 0:c.current_pad_id)&&!S.settings.padId)return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),image:o.IMAGES.FracFleetHasNoActivePad,subtitle:j,title:o.APP_MESSAGES.fracFleetHasNoPad.title})});if("general"===(null==b?void 0:b.type)&&v===i.COMPLETION&&(!m.wells||m.wells.length<1))return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),image:o.IMAGES.NoWellsSelected,subtitle:j,title:o.APP_MESSAGES.padHasNoWells.title})});if(!(m.rig||m.well||m.settings||m.wells))return e(s,{appHeaderProps:I,children:e(o,{"data-testid":"".concat(n,"_EmptyState"),image:o.IMAGES.AssetHasNoData,subtitle:j,title:o.APP_MESSAGES.assetNotAvailable.title})})}return e(a,{appHeaderProps:I,openIntercom:M,children:e(u,t({app:S},S.settings,m,A))})}d.defaultProps={availability:{hasProductSubscription:!0,isAppSubscribedForAsset:!0}};export{d as default,l as getNoActiveWellMessage};
