import{jsx as e,jsxs as t}from"react/jsx-runtime";import s from"classnames";import{useMemo as o}from"react";import{isEmpty as a}from"lodash";import{Header as i}from"../Header/Header.js";import{TextEndTruncated as n}from"../TextEndTruncated/TextEndTruncated.js";import{getAppSegment as l}from"../../utils/devcenter.js";import{SEGMENTS as r}from"../../constants/segment.js";import{useAppCommons as d}from"../AppCommonsProvider/AppCommonsContext.js";import{AppBadge as p}from"./AppBadge/AppBadge.js";import{AppAssets as m}from"./AppAssets/AppAssets.js";import{PadMode as c}from"./PadMode/PadMode.js";import{AppHeaderTestIds as g}from"./AppHeader.constants.js";import{AppHeaderV3 as C}from"./V3/AppHeaderV3.js";import f from"./AppHeader.scss.js";var h=function(h){var A=h.className,v=h.testId,N=h.logo,u=h.children,j=h.padModeDisabled,S=h.padModeWells,M=h.onPadModeChange,w=h.elementsClassNames,b=h.title,T=h.asset,P=h.dqData,H=h.lastUpdate,x=h.additionalActions,I=h.showComments,D=h.titleControls,E=h.titleControlsPosition,B=void 0===E?"right":E,V=h.disableSettings,q=h.showAssetChips,F=void 0===q||q,L=h.additionalControls,O=h.rightSideContent,U=h.disableAssetSelector,W=h.titleMenuActions,y=h.responsivenessConfig,k=d(),z=k.app,G=k.well,J=k.fracFleet,K=k.wells,Q=k.onSettingChange,R=k.appSettings,X=void 0===R?{}:R,Y=k.appHeadersV3Enabled,Z=k.disableAppAssetSelection,$=k.appName,_=S||K,ee=l(z)===r.COMPLETION&&!G,te=!a(_)&&!!J,se=!Z&&!j&&ee&&te,oe=o((function(){return M?function(e,t){return M(t)}:Q}),[M,Q]);return Y?e(C,{testId:v,className:A,elementsClassNames:w,logo:N,title:b,padModeDisabled:j,padModeWells:S,asset:T,dqData:P,lastUpdate:H,additionalActions:x,showComments:I,titleControls:D,disableSettings:V,showAssetChips:!Z&&F,additionalControls:L||u,disableAssetSelector:Z||U,titleMenuActions:W,titleControlsPosition:B,responsivenessConfig:y}):t("div",{className:s(f.root,A),"data-testid":v,children:[t(i,{className:s(f.logoTitleBadgeContainer,null==w?void 0:w.title),appearance:"appName",children:[N&&e("div",{className:f.logoContainer,children:"string"==typeof N?e("img",{className:f.logo,src:N,alt:"Logo"}):N}),e(n,{className:f.appName,testId:g.AppTitleTestId,children:b||$}),e(p,{app:z})]}),(u||L||se)&&t("div",{className:s(f.additional,null==w?void 0:w.additional),children:[se&&e(c,{app:z,appSettings:X,fracFleet:J,onSettingChange:oe,well:G,wells:_}),L||u]}),e("div",{className:s(f.assetChips,null==w?void 0:w.chips),children:e(m,{forceNarrow:se||!!u})}),O&&e("div",{className:f.rightSideContent,children:O})]})};export{h as AppHeader};
//# sourceMappingURL=AppHeader.js.map
