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