mdc-react
Version:
Material Components for the web implemented in React
2 lines • 24.5 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={3578:(e,t,r)=>{"use strict";r.d(t,{Z:()=>b});var n=r(6575),o=r(5697),i=r.n(o),c=r(4184),l=r.n(c),a=r(5893),u=["label","float","required","className","children"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=(0,n.forwardRef)((function(e,t){var r,n=e.label,o=e.float,i=void 0!==o&&o,c=e.required,s=void 0!==c&&c,d=e.className,b=e.children,O=void 0===b?n:b,y=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,u),v=l()("mdc-floating-label",(p(r={},"mdc-floating-label--float-above",i),p(r,"mdc-floating-label--required",s),r),d);return(0,a.jsx)("span",f(f({ref:t,className:v},y),{},{children:O}))}));d.displayName="MDCFloatingLabel",d.propTypes={label:i().string,float:i().bool,required:i().bool};const b=d},8229:(e,t,r)=>{"use strict";r.d(t,{U:()=>n});var n={ROOT:"mdc-icon",LIGHT:"mdc-icon--light",DARK:"mdc-icon--dark",INACTIVE:"mdc-icon--inactive"}},8263:(e,t,r)=>{"use strict";r.d(t,{Z:()=>O});var n=r(6575),o=r(5697),i=r.n(o),c=r(4184),l=r.n(c),a=r(8229),u=r(5893),s=["name","type","size","light","dark","inactive","element","component","children","className"];function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=(0,n.forwardRef)((function(e,t){var r,n=e.name,o=e.type,i=e.size,c=e.light,f=void 0!==c&&c,b=e.dark,O=void 0!==b&&b,y=e.inactive,v=void 0!==y&&y,m=e.element,j=void 0===m?"i":m,g=e.component,h=void 0===g?j:g,x=e.children,P=void 0===x?n:x,w=e.className,S=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,s),E=l()(a.U.ROOT,(d(r={},"".concat(a.U.ROOT,"--").concat(o),o),d(r,"".concat(a.U.ROOT,"--").concat(i),i),d(r,a.U.LIGHT,f),d(r,a.U.DARK,O),d(r,a.U.INACTIVE,v),r),w);return(0,u.jsx)(h,p(p({ref:t,className:E},S),{},{children:P}))}));b.displayName="MDCIcon",b.propTypes={type:i().oneOf(["","filled","outlined","round","sharp","two-tone"]),size:i().string,light:i().bool,dark:i().bool,inactive:i().bool};const O=b},4188:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(6575),o=r(5697),i=r.n(o),c=r(4184),l=r.n(c),a=r(5893),u=["active","transformOrigin"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,n.forwardRef)((function(e,t){var r=e.active,n=void 0!==r&&r,o=e.transformOrigin,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,u),c=o&&{transformOrigin:"".concat(o,"px")},p=l()("mdc-line-ripple",f({},"mdc-line-ripple--active",n));return(0,a.jsx)("span",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({ref:t,style:c,className:p},i))}));p.displayName="MDCLineRipple",p.propTypes={active:i().bool};const d=p},2919:(e,t,r)=>{"use strict";r.d(t,{Z:()=>b});var n=r(6575),o=r(5697),i=r.n(o),c=r(4184),l=r.n(c),a=r(5893),u=["notched","className","children"];function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=(0,n.forwardRef)((function(e,t){var r,o=e.notched,i=void 0!==o&&o,c=e.className,s=e.children,d=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,u),b=(0,n.useRef)();(0,n.useLayoutEffect)((function(){var e=b.current,t=null==e?void 0:e.firstChild;if(e&&t){var r=function(e){if(null!==e.offsetParent)return e.clientWidth;var t=e.cloneNode(!0);t.style.setProperty("position","absolute"),t.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(t);var r=t.clientWidth;return document.documentElement.removeChild(t),r}(t);b.current.style.width=i?"".concat(.75*r+8,"px"):"auto"}}),[i]);var O=l()("mdc-notched-outline","mdc-notched-outline--upgraded",(p(r={},"mdc-notched-outline--notched",i),p(r,"mdc-notched-outline--no-label",!s),r),c);return(0,a.jsxs)("span",f(f({ref:t,className:O},d),{},{children:[(0,a.jsx)("span",{className:"mdc-notched-outline__leading"}),s&&(0,a.jsx)("span",{ref:b,className:"mdc-notched-outline__notch",children:s}),(0,a.jsx)("span",{className:"mdc-notched-outline__trailing"})]}))}));d.displayName="MDCNotchedOutline",d.propTypes={notched:i().bool};const b=d},4184:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var l in r)n.call(r,l)&&r[l]&&e.push(l);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var c,l,a=o(e),u=1;u<arguments.length;u++){for(var s in c=Object(arguments[u]))r.call(c,s)&&(a[s]=c[s]);if(t){l=t(c);for(var f=0;f<l.length;f++)n.call(c,l[f])&&(a[l[f]]=c[l[f]])}}return a}},2703:(e,t,r)=>{"use strict";var n=r(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,c){if(c!==n){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},5697:(e,t,r)=>{e.exports=r(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5251:(e,t,r)=>{"use strict";r(7418);var n=r(6575),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,i={},u=null,s=null;for(n in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(s=t.ref),t)l.call(t,n)&&!a.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:o,type:e,key:u,ref:s,props:i,_owner:c.current}}t.jsx=u,t.jsxs=u},5893:(e,t,r)=>{"use strict";e.exports=r(5251)},6575:e=>{"use strict";e.exports=void 0}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(6575),t=r(5697),n=r.n(t),o=r(4184),i=r.n(o),c=["component","fallback","className","children"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=(0,e.forwardRef)((function(t,r){var n=t.component,o=t.fallback,l=t.className,u=t.children,s=void 0===u?n:u,f=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,c);return(0,e.isValidElement)(n)?(0,e.cloneElement)(n,a({ref:r,className:i()(l,n.props.className)},f)):(0,e.isValidElement)(o)?(0,e.cloneElement)(o,a({ref:r,className:i()(l,o.props.className)},f)):o?(0,e.createElement)(o,a({ref:r,className:l},f),s):s})),f=r(2919),p=r(4188),d=r(3578),b=r(8263),O="mdc-text-field__icon",y="mdc-text-field__affix",v=r(5893),m=["persistent","validation"];function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=function(e){var t,r=e.persistent,n=void 0!==r&&r,o=e.validation,c=void 0!==o&&o,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,m),a=i()("mdc-text-field-helper-text",(g(t={},"mdc-text-field-helper-text--persistent",n),g(t,"mdc-text-field-helper-text--validation-msg",c),t));return(0,v.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({className:a},l))};h.displayName="MDCTextFieldHelperText",h.propTypes={persistent:n().bool,validation:n().bool};const x=h;var P=["value","maxValue"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e){var t=e.value,r=void 0===t?0:t,n=e.maxValue,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,P);return(0,v.jsx)("div",S(S({className:"mdc-text-field-character-counter"},o),{},{children:r+(n?" / ".concat(n):"")}))}D.displayName="MDCTextFieldCharacterCounter",D.propTypes={value:n().number,maxValue:n().number};var N=["textarea","autoResize","element"];function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var k=(0,e.forwardRef)((function(t,r){var n=t.textarea,o=t.autoResize,i=t.element,c=void 0===i?n?"textarea":"input":i,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,N);return(0,e.useLayoutEffect)((function(){if(o){var e=r.current;return t(),e.addEventListener("input",t),function(){return e.removeEventListener("input",t)}}function t(){e.style.height="1rem",e.style.height="".concat(e.scrollHeight,"px")}}),[o,r]),(0,v.jsx)(c,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({ref:r,className:"mdc-text-field__input"},l))}));k.displayName="MDCTextFieldInput";const C=k;var I=["textarea","autoResize","children"];function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){A(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M=function(e){var t=e.textarea,r=e.autoResize,n=e.children,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,I);return t&&!r?(0,v.jsx)("span",F(F({className:"mdc-text-field__resizer"},o),{},{children:n})):n};M.displayName="MDCTextFieldResizer";const L=M;var z=["value","defaultValue","label","leadingIcon","trailingIcon","prefix","suffix","persistentHelperText","helperText","validationMessage","filled","outlined","fullWidth","disabled","textarea","endAligned","autoResize","characterCounter","internalCharacterCounter","className","element","onFocus","onBlur","onChange"];function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){Z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],c=!0,l=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var H=(0,e.forwardRef)((function(t,r){var n,o,c,l=t.value,a=t.defaultValue,u=t.label,m=t.leadingIcon,j=t.trailingIcon,g=t.prefix,h=t.suffix,P=t.persistentHelperText,w=t.helperText,S=void 0===w?P:w,E=t.validationMessage,N=t.filled,_=void 0!==N&&N,T=t.outlined,k=void 0!==T&&T,I=t.fullWidth,R=void 0!==I&&I,F=t.disabled,A=void 0!==F&&F,M=t.textarea,V=void 0!==M&&M,B=t.endAligned,H=void 0!==B&&B,q=t.autoResize,Y=void 0!==q&&q,$=t.characterCounter,G=void 0!==$&&$,K=t.internalCharacterCounter,X=void 0===K?"internal"===G:K,J=t.className,Q=t.element,ee=void 0===Q?"label":Q,te=t.onFocus,re=void 0===te?Function.prototype:te,ne=t.onBlur,oe=void 0===ne?Function.prototype:ne,ie=t.onChange,ce=void 0===ie?Function.prototype:ie,le=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,z),ae=(0,e.useRef)(),ue=W((0,e.useState)(!1),2),se=ue[0],fe=ue[1],pe=W((0,e.useState)(!1),2),de=pe[0],be=pe[1],Oe=W((0,e.useState)(!0),2),ye=Oe[0],ve=Oe[1],me=W((0,e.useState)(),2),je=me[0],ge=me[1],he=W((0,e.useState)((null==l?void 0:l.length)||(null==a?void 0:a.value)||0),2),xe=he[0],Pe=he[1],we=(0,e.useCallback)((function(e){var t=e.target.getBoundingClientRect();ge({x:e.clientX-t.left,y:e.clientY-t.top})}),[]),Se=(0,e.useCallback)((function(e){fe(!0),be(!0),re(e)}),[re]),Ee=(0,e.useCallback)((function(e){fe(!1),ge(),oe(e)}),[oe]),De=(0,e.useCallback)((function(e){var t,r=ae.current.value,n=null===(t=ae.current)||void 0===t?void 0:t.validity.valid;Pe(r.length),ve(n),ce(e,r)}),[ce]),Ne=se||null!=l&&""!==l||null!=a&&""!==a||Boolean(null===(n=ae.current)||void 0===n?void 0:n.value),_e=S||E||G,Te=i()("mdc-text-field",(Z(o={},"mdc-text-field--filled",_&&!R),Z(o,"mdc-text-field--outlined",k&&!R),Z(o,"mdc-text-field--textarea",V),Z(o,"mdc-text-field--disabled",A),Z(o,"mdc-text-field--focused",se),Z(o,"mdc-text-field--invalid",!ye&&de),Z(o,"mdc-text-field--label-floating",Ne),Z(o,"mdc-text-field--no-label",!u),Z(o,"mdc-text-field--end-aligned",H),Z(o,"mdc-text-field--with-leading-icon",m),Z(o,"mdc-text-field--with-trailing-icon",j),Z(o,"mdc-text-field--with-internal-counter",X),o),J);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(ee,{ref:r,className:Te,onMouseDown:we,onTouchStart:we,children:[_&&(0,v.jsx)("div",{className:"mdc-text-field__ripple"}),_&&u&&(0,v.jsx)(d.Z,{label:u,float:Ne}),k&&(0,v.jsx)(f.Z,{notched:Ne,children:u&&(0,v.jsx)(d.Z,{label:u,float:Ne})}),m&&(0,v.jsx)(s,{component:m,fallback:b.Z,className:"".concat(O," ").concat("mdc-text-field__icon--leading"),tabIndex:"0",role:"button"}),g&&(0,v.jsx)("span",{className:"".concat(y," ").concat("mdc-text-field__affix--prefix"),children:g}),(0,v.jsxs)(L,{textarea:V,autoResize:Y,children:[(0,v.jsx)(C,U({ref:ae,value:l,defaultValue:a,textarea:V,autoResize:Y,disabled:A,onInput:De,onFocus:Se,onBlur:Ee},le)),X&&(0,v.jsx)(D,{value:xe,maxValue:le.maxLength})]}),h&&(0,v.jsx)("span",{className:"".concat(y," ").concat("mdc-text-field__affix--suffix"),children:h}),j&&(0,v.jsx)(s,{component:j,fallback:b.Z,className:"".concat(O," ").concat("mdc-text-field__icon--trailing"),tabIndex:"0",role:"button"}),_&&(0,v.jsx)(p.Z,{active:se,transformOrigin:null==je?void 0:je.x})]}),_e&&(0,v.jsxs)("div",{className:"mdc-text-field-helper-line",children:[S&&(0,v.jsx)(x,{persistent:Boolean(P),children:S}),E&&!ye&&(0,v.jsx)(x,{validation:!0,children:"string"==typeof E?E:null===(c=ae.current)||void 0===c?void 0:c.validationMessage}),G&&!X&&(0,v.jsx)(D,{value:xe,maxValue:le.maxLength})]})]})}));H.displayName="MDCTextField",H.propTypes={value:n().any,label:n().string,leadingIcon:n().node,trailingIcon:n().node,prefix:n().string,suffix:n().string,outline:n().bool,fullWidth:n().bool,textarea:n().bool,dense:n().bool,disabled:n().bool,helperText:n().string,persistentHelperText:n().string,validationMessage:n().oneOfType([n().bool,n().string])}})()})();