var Z=Object.create;var v=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var F=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports);var H=(t,n,a,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of x(n))!C.call(t,e)&&e!==a&&v(t,e,{get:()=>n[e],enumerable:!(l=g(n,e))||l.enumerable});return t};var D=(t,n,a)=>(a=t!=null?Z(w(t)):{},H(n||!t||!t.__esModule?v(a,"default",{value:t,enumerable:!0}):a,t));var h=F((j,c)=>{(function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(e=l(e,a(o)))}return e}function a(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var r="";for(var o in e)t.call(e,o)&&e[o]&&(r=l(r,o));return r}function l(e,r){return r?e?e+" "+r:e+r:e}typeof c<"u"&&c.exports?(n.default=n,c.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});import s,{useState as m}from"react";import p from"react-datepicker";import f from"react";function u({className:t,size:n=32,color:a="white"}){return f.createElement("svg",{width:n,height:n,viewBox:"0 0 32 32",fill:"none",className:t},f.createElement("path",{fill:a,d:"M7 4a3 3 0 0 0-3 3v18a3 3 0 0 0 3 3h14c.8 0 1.7-.3 2.3-.9l3.8-3.8c.6-.6.9-1.5.9-2.3V7a3 3 0 0 0-3-3H7ZM6 7c0-.6.4-1 1-1h18c.6 0 1 .4 1 1v14h-3a2 2 0 0 0-2 2v3H7a1 1 0 0 1-1-1V7Z"}),f.createElement("path",{fill:a,d:"M26 11H6v-1h20v1ZM11 17H8v3h3v-3ZM11 21H8v3h3v-3ZM15 13h-3v3h3v-3ZM15 17h-3v3h3v-3ZM15 21h-3v3h3v-3ZM19 13h-3v3h3v-3ZM19 17h-3v3h3v-3ZM23 13h-3v3h3v-3ZM23 17h-3v3h3v-3Z"}))}var b=D(h());import"react-datepicker/dist/react-datepicker.css";var S=p.default??p;function k({label:t,errorMessage:n,...a}){function l(i){return i!==""&&i!==null&&i!==void 0}let[e,r]=m(l(a.selected)),[o,d]=m(!1);function M(i,P){a.onChange?.(i,P),r(l(i))}function N(i){a.onFocus?.(i),d(!0)}function y(i){a.onBlur?.(i),r(l(i.currentTarget.value)),d(!1)}return s.createElement("div",{className:(0,b.default)("leaf-input-container","leaf-date-input",{filled:e,focused:o,error:n,disabled:a.disabled})},s.createElement("div",{className:"leaf-label-area"},s.createElement("label",{className:"leaf-label"},t)),s.createElement(S,{fixedHeight:!0,showIcon:!0,icon:s.createElement(u,{className:"react-datepicker__calendar-icon",color:"currentColor"}),...a,wrapperClassName:"leaf-input-area",className:"leaf-input",clearButtonClassName:"leaf-clear-button",isClearable:a.isClearable??!0,onChange:M,onFocus:N,onBlur:y}),s.createElement("div",{className:"leaf-extra-area"},s.createElement("p",{className:"leaf-error-message leaf-desc"},n)))}export{k as default};
/*! Bundled license information:

classnames/index.js:
  (*!
  	Copyright (c) 2018 Jed Watson.
  	Licensed under the MIT License (MIT), see
  	http://jedwatson.github.io/classnames
  *)
*/
