import{jsxs as o,jsx as i}from"react/jsx-runtime";import{useState as s}from"react";import t from"prop-types";import n from"classnames";import{makeStyles as e,Typography as c,Tooltip as r}from"@material-ui/core";import{Info as a}from"@material-ui/icons";import l from"../IconButton/index.js";import{WriteIcon as m,UpIcon as p,DownIcon as d}from"../../icons/iconParkIcons.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"../../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";var u=e((function(o){var i=o.palette;return{disabled:{opacity:.4,pointerEvents:"none"},offsetContainer:{cursor:"pointer",display:"flex",whiteSpace:"nowrap",flexWrap:"nowrap",alignItems:"center",width:"fit-content"},hoveredContainer:{backgroundColor:"rgba(255, 255, 255, 0.16)",color:i.primary.light},offsetText:{color:i.primary.text6,fontSize:12,paddingRight:4,"&:hover":{color:i.primary.contrastText}},buttons:{display:"flex",alignItems:"center"},isActive:{color:i.primary.contrastText},primaryIcon:{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}},infoIcon:{marginRight:"8px",fontSize:"20px",color:i.info.light},infoTooltip:{maxWidth:"264px"}}})),f=function(t){var e=t.onClick,f=t.wells,I=t.label,b=t.disabled,h=t.expanded,x=t.onExpand,j=t.offsetWellsLimited,C=t.isTooltipDisabled,g=t.iconElement,v=s(!1),y=v[0],k=v[1],E=u(),T=f.length,W=!(!T||!x),w=o("div",{"data-testid":"offsetWellsButton",className:n(E.offsetContainer,b&&E.disabled),onClick:e,onMouseMove:function(o){var i=o.target,s=i.parentNode;i.getAttribute("data-icon")||s.getAttribute("data-icon")?k(!1):k(!0)},onMouseLeave:function(){k(!1)},children:[o(c,{className:n(E.offsetText,y&&E.isActive),children:[I," (",T,")"]}),i(l,{className:n(E.primaryIcon,y&&E.hoveredContainer),color:"primary",size:"medium",children:g||i(m,{size:24})})]});return o("div",{className:E.buttons,children:[j&&i(r,{title:"".concat(I," list wasn't populated completely due to technical limitations of the app."),classes:{tooltip:E.infoTooltip},children:i(a,{className:E.infoIcon})}),i(r,{title:"Edit ".concat(I),placement:"bottom",children:w}),W&&i(l,{"data-testid":"expandOffsetWellChipsTabButton",tooltipProps:!C&&{title:h?"Collapse ".concat(I):"Expand ".concat(I)},onClick:function(o){o.stopPropagation(),x()},color:"default",size:"medium","data-icon":"expandIcon",children:i(h?p:d,{"data-icon":"expandIcon"})})]})},I={onClick:t.func.isRequired,wells:t.arrayOf(t.shape({id:t.number,title:t.string})),label:t.string,disabled:t.bool,onExpand:t.func,expanded:t.bool,offsetWellsLimited:t.bool,isTooltipDisabled:t.bool,iconElement:t.node};f.propTypes=I,f.defaultProps={onExpand:null,expanded:!1,wells:[],disabled:!1,offsetWellsLimited:!1,isTooltipDisabled:!1,label:"Offset Wells",iconElement:null};export{f as default};
