define(["require","exports","tslib","react","./utils"],function(e,t,n,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o=n.__importDefault(o);var i,o=(i=o.default.Component,n.__extends(s,i),Object.defineProperty(s.prototype,"elementRegistration",{get:function(){var e,t=this.props.host;if(!!(e=t)&&"function"==typeof e.getElementRegistration)return t.getElementRegistration(this.element)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"element",{get:function(){var e=this.props,t=e.host,e=e.name;if(e)return t.find(e)},enumerable:!0,configurable:!0}),s.prototype.prepare=function(){void 0===this.id&&(this.id=r.makeId()),this.enabled=!0;var e=this.props.host;return!1===e.enabled&&(this.enabled=!1),void 0!==this.element&&(void 0!==(e=e.find(this.element.section))&&!1===e.enabled&&(this.enabled=!1),!1===this.element.enabled&&(this.enabled=!1)),this.element},s.prototype.render=function(){return this.props.host.renderVisual(this)},s);function s(){var r=null!==i&&i.apply(this,arguments)||this;return r.raiseEvent=function(e,t){var n;return null===(n=r.props.host)||void 0===n?void 0:n.post(e,{name:r.props.name,value:t})},r.setProperty=function(e,t){var n=r.props.host,o=r.props.name;n.assignElementProperty(o,e,t)},r.setValue=function(e){return r.setProperty("value",e)},r}t.FormComponent=o;var p,n=(p=o,n.__extends(a,p),a.prototype.componentDidMount=function(){var e=this.props;e.host.refs[e.name]=this},a.prototype.componentDidUpdate=function(){var e=this.props;e.host.refs[e.name]=this},a.prototype.componentWillUnmount=function(){var e=this.props;e.host.refs[e.name]=void 0},a);function a(){return null!==p&&p.apply(this,arguments)||this}t.FormElement=n});