import*as e from"react";import{omitThemingProps as t}from"../../../system/dist/esm/system.utils.js";import{__DEV__ as r}from"../../../utils/dist/esm/assertion.js";import{forwardRef as s}from"../../../system/dist/esm/forward-ref.js";import{useMultiStyleConfig as o}from"../../../system/dist/esm/use-style-config.js";import{split as i}from"../../../utils/dist/esm/object.js";import{layoutPropNames as l}from"../../../styled-system/dist/esm/system.js";import n from"../../../../lodash.mergewith/index.js";import{chakra as a}from"../../../system/dist/esm/system.js";import{useFormControl as c}from"../../../form-control/dist/esm/use-form-control.js";import{cx as m}from"../../../utils/dist/esm/dom.js";function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e}).apply(this,arguments)}function p(e,t){if(null==e)return{};var r,s,o={},i=Object.keys(e);for(s=0;s<i.length;s++)r=i[s],t.indexOf(r)>=0||(o[r]=e[r]);return o}var h=s(((t,r)=>{var{children:s,placeholder:o,className:i}=t,l=p(t,["children","placeholder","className"]),n=c(l);return e.createElement(a.select,d({},n,{ref:r,className:m("chakra-select",i)}),o&&e.createElement("option",{value:""},o),s)}));r&&(h.displayName="SelectField");var f=s(((r,s)=>{var c=o("Select",r),m=t(r),{rootProps:f,placeholder:u,icon:y,color:g,height:j,h:E,minH:_,minHeight:b,iconColor:N,iconSize:w}=m,S=p(m,["rootProps","placeholder","icon","color","height","h","minH","minHeight","iconColor","iconSize","isFullWidth"]),[x,k]=i(S,l),z={width:"100%",height:"fit-content",position:"relative",color:g},C=n({},c.field,{paddingEnd:"2rem",_focus:{zIndex:"unset"}});return e.createElement(a.div,d({className:"chakra-select__wrapper",__css:z},x,f),e.createElement(h,d({ref:s,height:null!=E?E:j,minH:null!=_?_:b,placeholder:u},k,{__css:C}),r.children),e.createElement(v,d({"data-disabled":r.isDisabled},(N||g)&&{color:N||g},{__css:c.icon},w&&{fontSize:w}),y))}));r&&(f.displayName="Select");var u=t=>e.createElement("svg",d({viewBox:"0 0 24 24"},t),e.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),y=a("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),v=t=>{var{children:r=e.createElement(u,null)}=t,s=p(t,["children"]),o=e.cloneElement(r,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return e.createElement(y,d({},s,{className:"chakra-select__icon-wrapper"}),e.isValidElement(r)?o:null)};r&&(v.displayName="SelectIcon");export{u as DefaultIcon,f as Select,h as SelectField};
//# sourceMappingURL=select.js.map
