import e from"@babel/runtime/helpers/slicedToArray";import{memo as t,useState as o}from"react";import r from"prop-types";import{makeStyles as i,TextField as l,InputAdornment as a,Popover as n,Dialog as s,DialogTitle as c,Typography as p,DialogContent as m}from"@material-ui/core";import{Search as d,Close as h}from"@material-ui/icons";import f from"./AutoCompleteAssetSearch/AutoCompleteAssetSearch.js";import{jsxs as u,Fragment as b,jsx as x}from"react/jsx-runtime";var g=i((function(e){return{searchInput:{fontSize:"16px",width:"270px","&:hover":{"&::before":{borderBottom:"2px solid ".concat(e.palette.primary.text1," !important")}},"&:hover $searchIcon":{fill:"".concat(e.palette.primary.text1," !important")}},searchIcon:{fill:"".concat(e.palette.primary.text6," !important"),fontSize:"24px !important"},paper:{background:e.palette.background.b9,overflow:"hidden"},dialogTitle:{padding:"16px",height:"60px"},titleWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"20px"},title:{fontSize:"20px"},dialogContent:{display:"flex",width:"100%",height:"100%",flexFlow:"row wrap",alignContent:"flex-start",padding:0,justifyContent:"space-between",overflow:"hidden"},closeIcon:{color:e.palette.primary.text6}}}));function y(t){var r=t.company,i=t.onClickAsset,y=t.isTablet,C=t.isMobile,A=g(),v=o(null),w=e(v,2),I=w[0],S=w[1],T=function(){S(null)},k=function(e){var t=e.redirectAssetId;t&&(i(t),T())};return u(b,{children:[x(l,{type:"text",id:"well-section-search-textfield",placeholder:!y&&C?"Well/Rig Search":"Add to List by Well/Rig Search",InputProps:{startAdornment:x(a,{position:"start",children:x(d,{className:A.searchIcon})}),className:A.searchInput},onClick:function(e){S(e.currentTarget)}}),(y||!C)&&x(n,{open:Boolean(I),anchorEl:I,onClose:T,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:x(f,{company:r,onClickAsset:k,onClose:T,isTablet:y,isMobile:C})}),!y&&C&&u(s,{fullScreen:!0,open:Boolean(I),classes:{paper:A.paper},children:[x(c,{className:A.dialogTitle,children:u("div",{className:A.titleWrapper,children:[x(p,{className:A.title,children:"Search"}),x(h,{className:A.closeIcon,onClick:T})]})}),x(m,{className:A.dialogContent,children:x(f,{company:r,onClickAsset:k,onClose:T,isTablet:y,isMobile:C})})]})]})}y.propTypes={company:r.number.isRequired,onClickAsset:r.func.isRequired,isTablet:r.bool.isRequired,isMobile:r.bool.isRequired};var C=t(y);export{C as default};
//# sourceMappingURL=AssetSearch.js.map
