"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),a=require("react"),i=require("prop-types"),r=require("classnames"),s=require("@material-ui/core"),o=require("../../DevCenter/AppHeader/AppHeader.js"),n=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p,d=l(e),u=l(t),c=l(i),f=l(r),m={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"}},b={empty:"empty",error:"error",noData:"noData",noSubscription:"noSubscription"},g=(p={},u.default(p,b.empty,"/static/media/e607e3aa0a4603bb7ae7f83a2148511e.svg"),u.default(p,b.error,"/static/media/9b185a425ea91b6c2beedfef39c06663.svg"),u.default(p,b.noData,"/static/media/1bfc6e5d9cbb531a554ab8d025fa23e9.svg"),u.default(p,b.noSubscription,"/static/media/76e3ee12638391cba164716321509ad7.svg"),p),h=s.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([g[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"}}}));function x(e){var t=e.title,i=e.subtitle,r=e.state,s=e.withAppHeader,l=e.app,p=e.actions,u=h({state:r}),c=a.useState(!1),m=d.default(c,2),b=m[0],g=m[1];a.useEffect((function(){g(!0)}),[]);var x=a.useRef(null),v=x.current,S=(null==v?void 0:v.offsetHeight)<300,y=(null==v?void 0:v.offsetHeight)<400;return n.jsxs("div",{className:u.container,children:[s&&n.jsx(o.default,{app:l,classes:{appHeader:u.appHeader}}),n.jsx("div",{className:u.wrapper,ref:x,children:b&&n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-testid":"".concat("EmptyAppView","_title"),className:f.default(u.title,y&&"medium",S&&"small"),children:t}),p,i&&n.jsx("div",{"data-testid":"".concat("EmptyAppView","_subtitle"),className:f.default(u.subtitle,y&&"medium",S&&"small"),children:i}),!S&&n.jsx("div",{className:f.default(u.imageWrapper,y&&"medium"),children:n.jsx("div",{className:u.backgroundImage})})]})})]})}x.propTypes={actions:c.default.node,app:c.default.shape({}),state:c.default.string,subtitle:c.default.oneOfType([c.default.string,c.default.node]),title:c.default.string.isRequired,withAppHeader:c.default.bool},x.defaultProps={actions:null,app:void 0,state:b.empty,subtitle:"",withAppHeader:!1},x.APP_MESSAGES=m,x.EMPTY_STATES=b,exports.APP_MESSAGES=m,exports.EMPTY_STATES=b,exports.default=x;
