Liferay.Loader.define("document-library-web@6.0.75/document_library/js/FileNameInput.es",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(a("@frontend-taglib-clay$clayui/form")),n=f(a("@frontend-taglib-clay$clayui/icon")),l=f(a("liferay!frontend-js-react-web$classnames")),i=(f(a("liferay!frontend-js-react-web$prop-types")),c(a("liferay!frontend-js-react-web$react")));function f(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}const e=()=>i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"inline-item-after reference-mark text-warning"},i.default.createElement(n.default,{symbol:"asterisk"})),i.default.createElement("span",{className:"hide-accessible"},Liferay.Language.get("required"))),s=({message:e,warning:t})=>i.default.createElement(r.default.FeedbackGroup,null,i.default.createElement(r.default.FeedbackItem,null,t&&i.default.createElement(n.default,{className:"mr-1",symbol:"warning-full"}),e));var o=({initialValue:t,portletNamespace:a,required:n,visible:f})=>{const u=a+"fileName",[c,o]=(0,i.useState)(t),d=t!==c,m=n?d&&c:d,y=n&&!c;return i.default.createElement(r.default.Group,{className:(0,l.default)({"has-error":y,"has-warning":m})},i.default.createElement("label",{htmlFor:u},Liferay.Language.get("file-name"),n&&i.default.createElement(e,null)),i.default.createElement(r.ClayInput,{className:"form-control",id:u,name:u,onChange:({target:{value:e}})=>o(e),required:n,type:f?"text":"hidden",value:c}),y&&i.default.createElement(s,{message:Liferay.Language.get("this-field-is-required")}),m&&i.default.createElement(s,{message:Liferay.Language.get("warning-changing-file-name-will-affect-existing-links-to-this-document"),warning:!0}))};t.default=o}}));
//# sourceMappingURL=FileNameInput.es.js.map