import e from"@babel/runtime/helpers/slicedToArray";import{memo as i,useState as r}from"react";import n from"prop-types";import{get as l}from"lodash";import{makeStyles as o}from"@material-ui/core";import{FILTERS_LIST as s}from"../../constants.js";import a from"./SubjectWellSearch.js";import t from"./RadiusInput.js";import d from"./SidetrackSwitch.js";import u from"./NonEngineeredWellsSwitch.js";import c from"./ToggleFiltersButton.js";import p from"./ToggleMapButton.js";import m from"./SingleSelect.js";import f from"./MultiSelect.js";import g from"./ClearFiltersButton.js";import{isNativeDetected as h,isMobileDetected as C}from"../../../../utils/mobileDetect.js";import{jsxs as b,jsx as R}from"react/jsx-runtime";var j=o({container:{display:"flex"},filters:{display:"flex",flexWrap:"wrap"},fileterSection:{display:"flex",width:"100%",alignItems:"center",flexWrap:"wrap"},subjectWellWrapper:{display:"flex",alignItems:"center",flexWrap:"wrap"}}),W=h||C;function q(i){var n=i.companyId,o=i.companies,h=i.canViewCompanies,C=i.wells,q=i.subjectWell,S=i.radius,y=i.excludeSideTrack,x=i.includeNonEngineeredWells,w=i.filters,v=i.filtersOptions,E=i.mapHidden,N=i.isRadiusEditable,T=i.isExistNonEngineeredWells,k=i.onChangeCompany,F=i.onSetSubjectWell,M=i.onChangeFilters,V=i.onChangeRadius,I=i.onChangeSidetrack,H=i.onChangeNonEngineeredWells,O=i.onClearFilters,B=i.onToggleMap,z=r(W),D=e(z,2),A=D[0],P=D[1],_=j({isMobile:W});return b("div",{children:[W&&R(c,{filtersHidden:A,onToggleFilters:function(){P((function(e){return!e}))}}),!A&&b("div",{className:_.container,children:[R(p,{mapHidden:E,onToggleMap:B}),R("div",{className:_.filters,children:b("div",{className:_.fileterSection,children:[h&&R(m,{"data-testid":"".concat("Filter","_companyDropdown"),label:"Company",items:o,currentValue:n,onChange:function(e){return k(e.target.value)}},"company"),s.map((function(e){var i=e.key,r=e.title,n=e.size,o=e.renderValue;return R(f,{title:r,size:n,options:l(v,i,[]),currentValues:l(w,i,[]),renderValue:o,onChange:function(e){return M(i,e)}},i)})),b("div",{className:_.subjectWellWrapper,children:[R(a,{wells:C,subjectWell:q,onChange:F}),R(t,{radius:S,editable:N,onChange:V}),R(d,{initialChecked:y,onChange:I}),T&&R(u,{value:x,onChange:H}),R(g,{onClick:O})]})]})})]})]})}q.propTypes={canViewCompanies:n.bool.isRequired,isExistNonEngineeredWells:n.bool.isRequired,companies:n.arrayOf(n.shape({})).isRequired,wells:n.arrayOf(n.shape({})).isRequired,subjectWell:n.shape({}),companyId:n.number.isRequired,radius:n.number.isRequired,isRadiusEditable:n.bool.isRequired,excludeSideTrack:n.bool.isRequired,includeNonEngineeredWells:n.bool.isRequired,filters:n.shape({}).isRequired,filtersOptions:n.shape({}).isRequired,mapHidden:n.bool.isRequired,onChangeCompany:n.func.isRequired,onSetSubjectWell:n.func.isRequired,onChangeFilters:n.func.isRequired,onChangeRadius:n.func.isRequired,onChangeSidetrack:n.func.isRequired,onChangeNonEngineeredWells:n.func.isRequired,onClearFilters:n.func.isRequired,onToggleMap:n.func.isRequired},q.defaultProps={subjectWell:null};var S=i(q);export{S as default};
