import{aY as m,r as f,bP as z,bU as S,bS as p}from"./index-D3uELfdo.js";import{s as H,u as P,e as Y,t as Z}from"./base-input-DjjpNP8Y-DtsTHlXD.js";function O(t){"@babel/helpers - typeof";return O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(t)}var G=["Root","StartEnhancer","EndEnhancer"],J=["startEnhancer","endEnhancer","overrides"];function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},c.apply(this,arguments)}function v(t,e){return V(t)||Q(t,e)||M(t,e)||K()}function K(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(t,e){if(t){if(typeof t=="string")return F(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,e)}}function F(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Q(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,u=!1,a,i;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));o=!0);}catch(d){u=!0,i=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(u)throw i}}return r}}function V(t){if(Array.isArray(t))return t}function A(t,e){if(t==null)return{};var n=W(t,e),r,o;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(o=0;o<u.length;o++)r=u[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function W(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,u;for(u=0;u<r.length;u++)o=r[u],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function X(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function tt(t,e,n){return e&&L(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function et(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},g(t,e)}function rt(t){var e=ot();return function(){var n=h(t),r;if(e){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return nt(this,r)}}function nt(t,e){if(e&&(O(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ot(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(t)}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ut=(function(t){et(n,t);var e=rt(n);function n(){var r;X(this,n);for(var o=arguments.length,u=new Array(o),a=0;a<o;a++)u[a]=arguments[a];return r=e.call.apply(e,[this].concat(u)),b(y(r),"state",{isFocused:r.props.autoFocus||!1}),b(y(r),"onFocus",function(i){r.setState({isFocused:!0}),r.props.onFocus(i)}),b(y(r),"onBlur",function(i){r.setState({isFocused:!1}),r.props.onBlur(i)}),r}return tt(n,[{key:"render",value:function(){var r=this.props,o=r.startEnhancer,u=r.endEnhancer,a=r.overrides,i=a.Root,d=a.StartEnhancer,R=a.EndEnhancer,_=A(a,G),x=A(r,J),B=m(i,H),E=v(B,2),$=E[0],T=E[1],C=m(d,P),j=v(C,2),N=j[0],k=j[1],D=m(R,P),w=v(D,2),U=w[0],q=w[1],l=Y(this.props,this.state);return f.createElement($,c({"data-baseweb":"input"},l,T,{$adjoined:I(o,u),$hasIconTrailing:this.props.clearable||this.props.type=="password"}),s(o)&&f.createElement(N,c({},l,k,{$position:S.start}),typeof o=="function"?o(l):o),f.createElement(Z,c({},x,{overrides:_,adjoined:I(o,u),onFocus:this.onFocus,onBlur:this.onBlur})),s(u)&&f.createElement(U,c({},l,q,{$position:S.end}),typeof u=="function"?u(l):u))}}]),n})(f.Component);b(ut,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:z.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});function I(t,e){return s(t)&&s(e)?p.both:s(t)?p.left:s(e)?p.right:p.none}function s(t){return!!(t||t===0)}export{ut as a};
