import o from"@babel/runtime/helpers/slicedToArray";import{useState as s,useRef as c}from"react";import e from"prop-types";import{TextField as n,InputAdornment as i,Popover as r}from"@material-ui/core";import t from"./AutoCompleteAssetSearch.js";import m from"./AdvancedSearch.module.css.js";import"../../../../../icons/WithCustomSize.js";import"../../../../../icons/IconParkProvider.js";import"../../../../../icons/customIcons/icons/AddMessage.js";import"../../../../../icons/customIcons/icons/Attention.js";import"../../../../../icons/customIcons/icons/Collapse.js";import"../../../../../icons/customIcons/icons/Dashboard.js";import"../../../../../icons/customIcons/icons/Expand.js";import"../../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../../icons/customIcons/icons/LessOrEqual.js";import{SearchIcon as a}from"../../../../../icons/customIcons/icons/Search.js";import"../../../../../icons/customIcons/icons/Wellhub.js";import"../../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../../icons/customIcons/icons/Checkbox.js";import"../../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../../icons/customIcons/icons/Radio.js";import"../../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../../icons/customIcons/icons/MoreApp.js";import{jsxs as l,Fragment as u,jsx as p}from"react/jsx-runtime";var d=function(e){var d=e.companyId,I=e.subjectWellId,h=e.onChange,j=e.selectedWellIds,f=e.onHideAdvancedSearch,C=s(null),b=o(C,2),v=b[0],A=b[1],g=s(""),R=o(g,2),W=R[0],k=R[1],q=c(),x=function(){k(""),A(null),f()};return l(u,{children:[p(n,{"data-testid":"ows_advanced_search",id:"well-section-search-textfield",placeholder:"Add Offset ...",InputProps:{startAdornment:p(i,{position:"start",children:p(a,{size:"small",className:m.searchIcon})}),className:m.searchInput},classes:{root:m.searchRoot},ref:q,value:W,onChange:function(o){k(o.target.value),o.target.value&&A(q.current)},onClick:function(o){A(o.currentTarget)}}),p(r,{open:Boolean(v),anchorEl:v,onClose:x,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:p(t,{subjectWellId:I,value:W,company:d,selectedWellIds:j,onChange:h,onClose:x})})]})};d.propTypes={companyId:e.number.isRequired,subjectWellId:e.number.isRequired,onChange:e.func.isRequired,selectedWellIds:e.arrayOf(e.number).isRequired,onHideAdvancedSearch:e.func.isRequired};export{d as AdvancedSearch};
