text: define("modules/clean/form",["require","exports","tslib","purify","jquery","modules/clean/ajax","modules/core/cookies","modules/core/exception","modules/core/i18n"],(function(e,t,r,n,s,a,o,i,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n=r.__importStar(n),s=r.__importDefault(s),a=r.__importStar(a);var p=u.intl.formatMessage({id:"bLA3rA",defaultMessage:"There was a problem completing this request."});function l(e){for(var t={},r=0,n=Array.from(e.find("input, select, textarea"));r<n.length;r++){var a=n[r],o=s.default(a).attr("name");if(o){var i=void 0;if("checkbox"===s.default(a).attr("type"))i=s.default(a).prop("checked")?"True":"";else if("radio"===s.default(a).attr("type")){if(!s.default(a).prop("checked"))continue;i=s.default(a).val()}else i=s.default(a).val();o in t?("string"==typeof t[o]&&(t[o]=[t[o]]),t[o].push(i)):t[o]=i}}return t}function d(e){if(0!==e.indexOf("err:"))return[!0,e];var t=e.substr(4);try{return[!1,JSON.parse(t)]}catch(e){return[!1,t||p]}}function c(e,t,r){return void 0===r&&(r=!1),(function(){for(var a=[],o=0,i=Object.keys(t||{});o<i.length;o++){var u=i[o],p=s.default("<input>",{type:"hidden",name:u});p.val(t[u]);var l=n.sanitize(p.prop("outerHTML"));!0===r&&s.default("input[name='"+u+"']").remove(),a.push(e.append(l))}return a})()}t.submit=function(e,t,r,n){return a.FormWebRequest({url:e.attr("action"),data:l(e),skipErrorHandling:!0,success:function(e,n,s){var a=Array.from(d(s.responseText)),o=a[0],i=a[1];return o?t(i):r(i)},error:function(e,t,n){return r(p)},complete:n})},t.collect_data=l,t.parse_response=d,t.parse_error=function(e){if("string"==typeof e)return[!0,e];if("object"==typeof e)for(var t in e){var r=e[t];if("message_text"in r)return[!0,r.message_text]}return[!1,p]},t.add_vars=c,t.post_request=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r={}),i.assert(null!=e,"post_request missing action");var a=s.default("<form>",{action:e,method:"POST",target:r.target?r.target:void 0});t.t=o.Cookies.read("__Host-js_csrf"),c(a,t);var u=s.default(n.sanitize(a.prop("outerHTML")));return s.default("body").append(u),u.submit()}})),define("modules/clean/react/input",["require","exports","tslib","classnames","create-react-class","react","react-dom","react-dom-factories","prop-types","external/lodash","jquery","modules/clean/keycode","modules/clean/react/form_error_mixin","modules/clean/react/sprite","modules/core/cancelable_promise","modules/core/i18n"],(function(e,t,r,n,s,a,o,i,u,p,l,d,c,f,h,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n=r.__importDefault(n),s=r.__importDefault(s),a=r.__importDefault(a),o=r.__importStar(o),i=r.__importDefault(i),u=r.__importStar(u),p=r.__importStar(p),l=r.__importDefault(l),c=r.__importDefault(c);var v=a.default.createElement;function _(e,t){void 0===t&&(t=!1);var r=function(t){if(e>=t)return"password-input-dot-selected"},n="password-input-meter";t&&(n="password-input-meter-standalone");var s=i.default.div({className:n,ref:"meter"},i.default.div({className:"password-input-dot "+r(4)}),i.default.div({className:"password-input-dot "+r(3)}),i.default.div({className:"password-input-dot "+r(2)}),i.default.div({className:"password-input-dot "+r(1)}));return t?i.default.span({className:"standalone-password-meter-container"},s):s}t.password_strength_meter=_;var g=function(t,a){return s.default({displayName:t+"."+a,propTypes:{expandable:u.bool,expandedWidthOffset:u.number,animationCurve:u.string,animationDuration:u.number,onCloseClick:u.func,defaultValue:u.string,value:u.string,autofocus:u.bool,autoresize:u.bool,inline:u.bool,className:u.string,valueLink:u.object,variant:u.string,id:u.string,label:u.string,afterRender:u.func,onClick:u.func,onFocus:u.func,onBlur:u.func,onKeyDown:u.func,onChange:u.func,compatiblePlaceholder:u.bool,placeholder:u.string,measureStrength:u.bool,error:u.shape({message_text:u.string,message_html:u.string}),closeOnBlur:u.bool},mixins:[c.default],getDefaultProps:function(){return{errorWrapperClassName:"text-input-error-wrapper",expandedWidthOffset:90,expandable:!1,animationCurve:"easeOutSine",animationDuration:300,compatiblePlaceholder:!1}},getInitialState:function(){return{inputWidth:0,expanded:!1,value:this.props.defaultValue}},zxcvbnPromise:void 0,componentWillMount:function(){var t=this;this.props.measureStrength&&(this.zxcvbnPromise=h.makeCancelable(new Promise((function(t,r){e(["zxcvbn"],t,r)})).then(r.__importStar)),this.zxcvbnPromise.then((function(e){var r=e.default;t.setState({zxcvbn:r})})))},componentWillUnmount:function(){this.zxcvbnPromise&&this.zxcvbnPromise.cancel()},componentDidMount:function(){this._renderFinished();var e=o.findDOMNode(this.refs.inputComponent).offsetWidth;return this.setState({inputWidth:e})},componentDidUpdate:function(){return this._renderFinished()},render:function(){var e={"text-input-input":!0,autofocus:this.props.autofocus,"password-input":"password"===a},r={"text-input":!0,"text-input-expandable":this.props.expandable,"text-input-inline":this.props.inline,"textarea-input":"textarea"===t};if(r[this.props.variant||"standard"]=!0,null!=this.props.className)for(var s=0,o=Array.from(this.props.className.split(/\s/));s<o.length;s++){r[o[s]]=!0}var u=this.renderErrorIfEnabled(),l=void 0;((null!=this.props.error?this.props.error.message_text:void 0)||null!=(null!=this.props.error?this.props.error.message_html:void 0))&&(l=this.state.errorWrapperIdName);var d=p.omit(this.props,"expandable","expandedWidthOffset","animationCurve","animationDuration","onCloseClick","defaultValue","value","autofocus","autoresize","inline","className","valueLink","variant","id","name","label","afterRender","onClick","onFocus","onBlur","onKeyDown","onChange","compatiblePlaceholder","placeholder","measureStrength","error","error-after","disable-errors","errorWrapperClassName","closeOnBlur"),c=i.default[t](p.assignIn({id:this.props.id,name:this.props.name,"aria-describedby":l,className:n.default(e),type:a,value:this.props.value||(null!=this.props.valueLink?this.props.valueLink.value:void 0)||this.state.value,onChange:this.onChangeInternal,onFocus:this.onFocusInternal,onBlur:this.onBlurInternal,onKeyDown:this.onKeyDownInternal,autoFocus:this.props.autofocus,ref:"inputComponent",placeholder:this.props.placeholder||""},d));return i.default.div({className:n.default(r)},this.props["error-after"]?void 0:u,i.default.div({className:"text-input-wrapper"},this._renderPasswordStrengthBar(),c,this.props.expandable?i.default.a({href:"#",onClick:this.onCloseClick,ref:"closeButton",className:"close-button u-mar-left-xs"},v(f.Sprite,{group:"web",name:"xclose",alt:m.intl.formatMessage({id:"u/p3Pl",defaultMessage:"Close"})})):void 0,this.props.label&&!(this.props.value||(null!=this.props.valueLink?this.props.valueLink.value:void 0)||this.state.value)?i.default.label({htmlFor:this.props.id},this.props.label):void 0),this.props["error-after"]?u:void 0)},getValue:function(){return o.findDOMNode(this.refs.inputComponent).value},setValue:function(e){return o.findDOMNode(this.refs.inputComponent).value=e,this.setState({value:e})},resizeComponent:function(){var e=o.findDOMNode(this.refs.inputComponent),t=l.default(e);return t.css("height","1px"),t.css("height",e.scrollHeight+"px")},_renderPasswordStrengthBar:function(){return this.props.measureStrength?_(this.state.score):null},_renderFinished:function(){return this.props.autoresize&&this.resizeComponent(),"function"==typeof this.props.afterRender?this.props.afterRender():void 0},onCloseClick:function(e){if(null!=e&&e.preventDefault(),this.props.expandable){var t=l.default(o.findDOMNode(this.refs.closeButton)),r=l.default(o.findDOMNode(this.refs.inputComponent));return t.stop().animate({opacity:0},this.props.animationDuration),r.stop().animate({width:this.state.inputWidth},this.props.animationDuration,this.props.animationCurve),"function"==typeof this.props.onCloseClick&&this.props.onCloseClick(e),this.setState({expanded:!1})}"function"==typeof this.props.onCloseClick&&this.props.onCloseClick(e)},onChangeInternal:function(e){if("function"==typeof this.props.onChange&&this.props.onChange(e),null!=this.props.value||(this.props.valueLink?this.props.valueLink.requestChange(e.target.value):this.setState({value:e.target.value})),this.props.measureStrength){var t=void 0;return t=this.state.zxcvbn&&e.target.value?Math.max(1,this.state.zxcvbn(e.target.value).score):0,this.setState({score:t})}},onFocusInternal:function(e){var t=this;if("function"==typeof this.props.onFocus&&this.props.onFocus(e),!1!==this.props.expandable){var r=l.default(e.target),n=l.default(o.findDOMNode(this.refs.closeButton)),s=this.state.inputWidth;0===s&&(s=o.findDOMNode(this.refs.inputComponent).offsetWidth,this.setState({inputWidth:s}));var a=s+this.props.expandedWidthOffset,i=a-parseInt(r.css("padding-right"))+n.width()/2;return n.css({left:i}),r.stop().animate({width:a},this.props.animationDuration,this.props.animationCurve,(function(){return n.stop().animate({opacity:1},t.props.animationDuration)})),this.setState({expanded:!0})}},onBlurInternal:function(e){var t=e.target.value;return!0===this.props.closeOnBlur&&0===t.length&&this.onCloseClick(),"function"==typeof this.props.onBlur?this.props.onBlur(e):void 0},onKeyDownInternal:function(e){if("function"==typeof this.props.onKeyDown&&this.props.onKeyDown(e),null!=this.state.expanded!=!1)switch(e.keyCode){case d.KeyCode.ESC:return e.target.blur(),this.onCloseClick()}}})};t.password=g("input","password"),t.text=g("input","text"),t.textarea=g("textarea","text")})),define("modules/clean/react/form_error_mixin",["require","exports","tslib","react-dom-factories","prop-types","external/lodash"],(function(e,t,r,n,s,a){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),n=r.__importDefault(n),s=r.__importStar(s),a=r.__importStar(a),o={propTypes:{errorWrapperClassName:s.string,errorWrapperIdName:s.string,"disable-errors":s.bool,"error-after":s.bool,error:s.shape({message_text:s.string,message_html:s.string})},getInitialState:function(){return{errorWrapperIdName:this.props.errorWrapperIdName?this.props.errorWrapperIdName:a.uniqueId("error-message")}},renderErrorIfEnabled:function(){if(!this.props["disable-errors"])return this.renderError()},renderError:function(){return null!=(null!=this.props.error?this.props.error.message_html:void 0)?n.default.div({id:this.state.errorWrapperIdName,className:this.props.errorWrapperClassName,dangerouslySetInnerHTML:{__html:this.props.error.message_html}}):n.default.div({id:this.state.errorWrapperIdName,className:this.props.errorWrapperClassName},null!=this.props.error?this.props.error.message_text:void 0)}},t.default=o})),define("prod_assets_web_modules/react-addons-linked-state-mixin",["exports"],(function(e){"use strict";function t(e,t){this.value=e,this.requestChange=t}var r={createStateSetter:function(e,t){return function(r,n,s,a,o,i){var u=t.call(e,r,n,s,a,o,i);u&&e.setState(u)}},createStateKeySetter:function(e,t){var r=e.__keySetters||(e.__keySetters={});return r[t]||(r[t]=(function(e,t){var r={};return function(n){r[t]=n,e.setState(r)}})(e,t))}};r.Mixin={createStateSetter:function(e){return r.createStateSetter(this,e)},createStateKeySetter:function(e){return r.createStateKeySetter(this,e)}};var n={linkState:function(e){return new t(this.state[e],r.createStateKeySetter(this,e))}};e.default=n,Object.defineProperty(e,"__esModule",{value:!0})}));
  //# sourceMappingURL=pkg-coreui-forms.min.js-vflBxFrkO.map