import{memo as e}from"react";import i from"prop-types";import{get as r}from"lodash";import{makeStyles as t,Dialog as l,DialogTitle as n,Typography as a,DialogContent as o}from"@material-ui/core";import{Close as s}from"@material-ui/icons";import{FILTERS_LIST as d}from"../../constants.js";import c from"./RadiusInput.js";import p from"./SidetrackSwitch.js";import u from"./MultiSelect.js";import f from"./ClearFiltersButton.js";import{jsxs as m,jsx as h}from"react/jsx-runtime";var g=t((function(e){return{container:{display:"flex",marginBottom:"24px"},filters:{display:"flex",flexWrap:"wrap"},fileterSection:{display:"flex",width:"100%",alignItems:"center",flexWrap:"wrap"},filterRow:{display:"flex",width:"100%",flexFlow:"row wrap",alignContent:"flex-start",gap:"24px"},paper:{background:e.palette.background.b4,overflow:"hidden"},dialogTitle:{padding:"14px 0",height:"60px",borderBottom:"1px solid ".concat(e.palette.background.b7)},titleWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"18px"},title:{fontSize:"20px"},dialogContent:{display:"flex",width:"100%",flexFlow:"row wrap",alignContent:"flex-start",height:"100%",paddingRight:"16px",justifyContent:"space-between"}}}));function b(e){var i=e.radius,t=e.excludeSideTrack,b=e.filters,x=e.filtersOptions,C=e.isRadiusEditable,R=e.filtersHidden,w=e.onChangeFilters,k=e.onChangeRadius,q=e.onChangeSidetrack,y=e.onClearFilters,S=e.isTablet,v=e.isMobile,j=e.onToggleFilters,F=g({isMobile:v}),T=S?200:150,N=function(){j(!1)};return R&&v&&!S?m(l,{onBackdropClick:N,onEscapeKeyDown:N,fullScreen:!0,maxWidth:"xs",fullWidth:!0,open:!0,classes:{paper:F.paper},children:[h(n,{className:F.dialogTitle,children:m("div",{className:F.titleWrapper,children:[h(a,{className:F.title,children:"Filter"}),h(s,{className:F.closeIcon,onClick:N})]})}),m(o,{className:F.dialogContent,children:[d.map((function(e){var i=e.key,t=e.title,l=e.renderValue;return h(u,{title:t,size:T,options:r(x,i,[]),currentValues:r(b,i,[]),renderValue:l,onChange:function(e){return w(i,e)}},i)})),h(c,{radius:i,editable:C,onChange:k,isMobile:v}),h(p,{checked:t,onChange:q,isMobile:v})]})]}):R||v&&!S?null:h("div",{className:F.container,children:h("div",{className:F.filters,children:h("div",{className:F.fileterSection,children:m("div",{className:F.filterRow,children:[d.map((function(e){var i=e.key,t=e.title,l=e.renderValue;return h(u,{title:t,size:T,options:r(x,i,[]),currentValues:r(b,i,[]),renderValue:l,onChange:function(e){return w(i,e)}},i)})),h(c,{radius:i,editable:C,onChange:k,isTablet:S}),h(p,{checked:t,onChange:q,isMobile:v}),h(f,{onClick:y})]})})})})}b.propTypes={subjectWell:i.shape({}),radius:i.number.isRequired,isRadiusEditable:i.bool.isRequired,excludeSideTrack:i.bool.isRequired,filters:i.shape({}).isRequired,filtersOptions:i.shape({}).isRequired,filtersHidden:i.bool.isRequired,onChangeFilters:i.func.isRequired,onChangeRadius:i.func.isRequired,onChangeSidetrack:i.func.isRequired,onClearFilters:i.func.isRequired,isTablet:i.bool.isRequired,isMobile:i.bool.isRequired,onToggleFilters:i.func.isRequired},b.defaultProps={subjectWell:null};var x=e(b);export{x as default};
