"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react/jsx-runtime"),a=require("react"),i=require("classnames"),r=require("@material-ui/core"),o=require("../../DevCenter/AppHeader/AppHeader.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(e),l=s(i),p={appNotSubscribed:{title:"No Subscription exists for this app.",subtitle:"Contact your Corva Account rep to get access to this app."},appNotSubscribedForAsset:{title:"No Subscription exists for this asset.",subtitle:"Contact your Corva Account rep to get access to this asset."},internalAppError:{title:"App Loading Error"},appPackageWasNotFound:{title:"App package was not found",subtitle:"Please choose another version in the app settings menu or delete and add app again on your dashboard"},fracFleetWasNotFound:{title:"Frac fleet was not found"},fracFleetHasNoPad:{title:"Frac fleet has no active pad"},padHasNoWells:{title:"This pad has no wells"},appComponentWasNotFound:{title:"App component was not found"},noAssetData:{title:"No asset data found"},assetNotAvailable:{title:"Asset unavailable"}},d={empty:"empty",error:"error",noData:"noData",noSubscription:"noSubscription"},c={empty:"/static/media/e607e3aa0a4603bb7ae7f83a2148511e.svg",error:"/static/media/9b185a425ea91b6c2beedfef39c06663.svg",noData:"/static/media/1bfc6e5d9cbb531a554ab8d025fa23e9.svg",noSubscription:"/static/media/76e3ee12638391cba164716321509ad7.svg"},u=r.makeStyles((function(e){var t=e.palette;return{wrapper:{display:"flex",flexDirection:"column",textAlign:"center",alignItems:"center",justifyContent:"center",height:"100%",padding:24,overflow:"auto"},title:{color:t.primary.text7,fontSize:32,lineHeight:"38px",marginBottom:8,"&.medium":{fontSize:24,lineHeight:"28px"},"&.small":{fontSize:24,lineHeight:"28px"},fontStyle:"italic"},subtitle:{color:t.primary.text6,fontSize:16,lineHeight:"22px",marginBottom:24,"&.medium":{fontSize:14,lineHeight:"20px"},"&.small":{fontSize:14,lineHeight:"20px"}},imageWrapper:{display:"flex",flexGrow:1,maxWidth:390,maxHeight:300,width:"100%","&.medium":{maxidth:260,maxHeight:200}},backgroundImage:{width:"100%",backgroundImage:function(e){return"url(".concat([c[e.state]],")")},backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"},appHeader:{display:"flex",padding:"12px",flexWrap:"wrap",justifyContent:"space-between"},container:{height:"100%",flexDirection:"column",display:"flex"}}})),m=function(e){var i,r,s=e.title,p=e.subtitle,d=void 0===p?"":p,c=e.state,m=void 0===c?"empty":c,f=e.withAppHeader,g=void 0!==f&&f,b=e.app,x=e.actions,h=void 0===x?null:x,v=u({state:m}),S=a.useState(!1),A=n.default(S,2),y=A[0],H=A[1];a.useEffect((function(){H(!0)}),[]);var N=a.useRef(null),E=N.current,w=(null!==(i=null==E?void 0:E.offsetHeight)&&void 0!==i?i:0)<300,j=(null!==(r=null==E?void 0:E.offsetHeight)&&void 0!==r?r:0)<400;return t.jsxs("div",{className:v.container,children:[g&&t.jsx(o.default,{app:b,classes:{appHeader:v.appHeader}}),t.jsx("div",{className:v.wrapper,ref:N,children:y&&t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-testid":"".concat("EmptyAppView","_title"),className:l.default(v.title,j&&"medium",w&&"small"),children:s}),h,d&&t.jsx("div",{"data-testid":"".concat("EmptyAppView","_subtitle"),className:l.default(v.subtitle,j&&"medium",w&&"small"),children:d}),!w&&t.jsx("div",{className:l.default(v.imageWrapper,j&&"medium"),children:t.jsx("div",{className:v.backgroundImage})})]})})]})};m.APP_MESSAGES=p,m.EMPTY_STATES=d,exports.APP_MESSAGES=p,exports.EMPTY_STATES=d,exports.HEIGHT_MEDIUM_BREAKPOINT=400,exports.HEIGHT_SMALL_BREAKPOINT=300,exports.default=m;
//# sourceMappingURL=EmptyAppView.js.map
