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