Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rjsf/core

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rjsf/core - npm Package Compare versions

Comparing version 5.0.0-beta.20 to 5.0.0

2

dist/core.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@rjsf/utils"),r=require("lodash/get"),a=require("lodash/isEmpty"),i=require("lodash/pick"),n=require("lodash/isObject"),o=require("lodash/set"),l=require("nanoid"),s=require("lodash/omit"),d=require("lodash/has"),u=require("lodash/unset");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(e),f=c(r),p=c(a),h=c(i),v=c(n),y=c(o),g=c(s),E=c(d),S=c(u);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},b.apply(this,arguments)}function C(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,F(e,t)}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}function D(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)t.indexOf(r=n[a])>=0||(i[r]=e[r]);return i}var O=["widget"],k=["widget"],x=["widget"];function T(){return l.nanoid()}function A(e){return Array.isArray(e)?e.map((function(e){return{key:T(),item:e}})):[]}function N(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var w=function(e){function r(r){var a;(a=e.call(this,r)||this)._getNewFormDataRow=function(){var e=a.props,r=e.schema,i=e.registry.schemaUtils,n=r.items;return t.isFixedItems(r)&&t.allowAdditionalItems(r)&&(n=r.additionalItems),i.getDefaultFormState(n)},a.onAddClick=function(e){a._handleAddClick(e)},a.onAddIndexClick=function(e){return function(t){a._handleAddClick(t,e)}},a.onDropIndexClick=function(e){return function(t){t&&t.preventDefault();var r,i=a.props,n=i.onChange,o=i.errorSchema,l=a.state.keyedFormData;if(o)for(var s in r={},o){var d=parseInt(s);d<e?y.default(r,[d],o[s]):d>e&&y.default(r,[d-1],o[s])}var u=l.filter((function(t,r){return r!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(N(u),r)}))}},a.onReorderClick=function(e,t){return function(r){r&&(r.preventDefault(),r.currentTarget.blur());var i,n=a.props,o=n.onChange,l=n.errorSchema;if(a.props.errorSchema)for(var s in i={},l){var d=parseInt(s);d==e?y.default(i,[t],l[e]):d==t?y.default(i,[e],l[t]):y.default(i,[s],l[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(t,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(N(m),i)}))}},a.onChangeForIndex=function(e){return function(t,r,i){var n,o=a.props,l=o.formData,s=o.errorSchema;(0,o.onChange)((Array.isArray(l)?l:[]).map((function(r,a){return e===a?void 0===t?null:t:r})),s&&s&&b({},s,((n={})[e]=r,n)),i)}},a.onSelectChange=function(e){var t=a.props,r=t.idSchema;(0,t.onChange)(e,void 0,r&&r.$id)};var i=r.formData,n=A(void 0===i?[]:i);return a.state={keyedFormData:n,updatedKeyedFormData:!1},a}C(r,e),r.getDerivedStateFromProps=function(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};var r=Array.isArray(e.formData)?e.formData:[],a=t.keyedFormData||[];return{keyedFormData:r.length===a.length?a.map((function(e,t){return{key:e.key,item:r[t]}})):A(r)}};var a,i,n=r.prototype;return n.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},n.canAddItem=function(e){var r=this.props,a=r.schema,i=t.getUiOptions(r.uiSchema).addable;return!1!==i&&(i=void 0===a.maxItems||e.length<a.maxItems),i},n._handleAddClick=function(e,t){e&&e.preventDefault();var r=this.props.onChange,a=this.state.keyedFormData,i={key:T(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==t?n.splice(t,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return r(N(n))}))},n.render=function(){var e=this.props,r=e.schema,a=e.uiSchema,i=e.idSchema,n=e.registry,o=n.schemaUtils;if(!(t.ITEMS_KEY in r)){var l=t.getUiOptions(a),s=t.getTemplate("UnsupportedFieldTemplate",n,l);return m.default.createElement(s,{schema:r,idSchema:i,reason:"Missing items definition",registry:n})}return o.isMultiSelect(r)?this.renderMultiSelect():t.isCustomWidget(a)?this.renderCustomWidget():t.isFixedItems(r)?this.renderFixedArray():o.isFilesArray(r,a)?this.renderFiles():this.renderNormalArray()},n.renderNormalArray=function(){var e=this,r=this.props,a=r.schema,i=r.uiSchema,n=void 0===i?{}:i,o=r.errorSchema,l=r.idSchema,s=r.name,d=r.disabled,u=void 0!==d&&d,c=r.readonly,f=void 0!==c&&c,p=r.autofocus,h=void 0!==p&&p,y=r.required,g=void 0!==y&&y,E=r.registry,S=r.onBlur,C=r.onFocus,F=r.idPrefix,D=r.idSeparator,O=void 0===D?"_":D,k=r.rawErrors,x=this.state.keyedFormData,T=void 0===a.title?s:a.title,A=E.schemaUtils,w=E.formContext,I=t.getUiOptions(n),B=v.default(a.items)?a.items:{},U=A.retrieveSchema(B),q=N(this.state.keyedFormData),P=this.canAddItem(q),R={canAdd:P,items:x.map((function(t,r){var a=t.key,i=t.item,d=A.retrieveSchema(B,i),u=o?o[r]:void 0,c=A.toIdSchema(d,l.$id+O+r,i,F,O);return e.renderArrayFieldItem({key:a,index:r,name:s&&s+"-"+r,canAdd:P,canMoveUp:r>0,canMoveDown:r<q.length-1,itemSchema:d,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:n.items,autofocus:h&&0===r,onBlur:S,onFocus:C,rawErrors:k,totalItems:x.length})})),className:"field field-array field-array-of-"+U.type,disabled:u,idSchema:l,uiSchema:n,onAddClick:this.onAddClick,readonly:f,required:g,schema:a,title:T,formContext:w,formData:q,rawErrors:k,registry:E},_=t.getTemplate("ArrayFieldTemplate",E,I);return m.default.createElement(_,b({},R))},n.renderCustomWidget=function(){var e=this.props,r=e.schema,a=e.idSchema,i=e.uiSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,f=void 0!==c&&c,p=e.hideError,h=e.placeholder,v=e.onBlur,y=e.onFocus,g=e.formData,E=void 0===g?[]:g,S=e.registry,b=e.rawErrors,C=S.widgets,F=S.formContext,k=r.title||e.name,x=t.getUiOptions(i),T=x.widget,A=D(x,O),N=t.getWidget(r,T,C);return m.default.createElement(N,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:r,uiSchema:i,registry:S,value:E,disabled:o,readonly:s,hideError:p,required:f,label:k,placeholder:h,formContext:F,autofocus:u,rawErrors:b})},n.renderMultiSelect=function(){var e=this.props,r=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=void 0===n?[]:n,l=e.disabled,s=void 0!==l&&l,d=e.readonly,u=void 0!==d&&d,c=e.autofocus,f=void 0!==c&&c,p=e.required,h=void 0!==p&&p,v=e.placeholder,y=e.onBlur,g=e.onFocus,E=e.registry,S=e.rawErrors,C=e.name,F=E.widgets,O=E.formContext,x=E.schemaUtils.retrieveSchema(r.items,o),T=r.title||C,A=t.optionsList(x),N=t.getUiOptions(i),w=N.widget,I=void 0===w?"select":w,B=D(N,k),U=t.getWidget(r,I,F);return m.default.createElement(U,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:g,options:b({},B,{enumOptions:A}),schema:r,uiSchema:i,registry:E,value:o,disabled:s,readonly:u,required:h,label:T,placeholder:v,formContext:O,autofocus:f,rawErrors:S})},n.renderFiles=function(){var e=this.props,r=e.schema,a=e.uiSchema,i=e.idSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,f=void 0!==c&&c,p=e.onBlur,h=e.onFocus,v=e.registry,y=e.formData,g=void 0===y?[]:y,E=e.rawErrors,S=r.title||e.name,b=v.widgets,C=v.formContext,F=t.getUiOptions(a),O=F.widget,k=void 0===O?"files":O,T=D(F,x),A=t.getWidget(r,k,b);return m.default.createElement(A,{options:T,id:i.$id,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:h,schema:r,uiSchema:a,title:S,value:g,disabled:o,readonly:s,required:f,registry:v,formContext:C,autofocus:u,rawErrors:E,label:""})},n.renderFixedArray=function(){var e=this,r=this.props,a=r.schema,i=r.uiSchema,n=void 0===i?{}:i,o=r.formData,l=void 0===o?[]:o,s=r.errorSchema,d=r.idPrefix,u=r.idSeparator,c=void 0===u?"_":u,f=r.idSchema,p=r.name,h=r.disabled,y=void 0!==h&&h,g=r.readonly,E=void 0!==g&&g,S=r.autofocus,C=void 0!==S&&S,F=r.required,D=void 0!==F&&F,O=r.registry,k=r.onBlur,x=r.onFocus,T=r.rawErrors,A=this.state.keyedFormData,N=this.props.formData,w=void 0===N?[]:N,I=a.title||p,B=t.getUiOptions(n),U=O.schemaUtils,q=O.formContext,P=(v.default(a.items)?a.items:[]).map((function(e,t){return U.retrieveSchema(e,l[t])})),R=v.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,l):null;(!w||w.length<P.length)&&(w=(w=w||[]).concat(new Array(P.length-w.length)));var _=this.canAddItem(w)&&!!R,j={canAdd:_,className:"field field-array field-array-fixed-items",disabled:y,idSchema:f,formData:l,items:A.map((function(t,r){var i=t.key,o=t.item,l=r>=P.length,u=l&&v.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,o):P[r],m=U.toIdSchema(u,f.$id+c+r,o,d,c),h=l?n.additionalItems||{}:Array.isArray(n.items)?n.items[r]:n.items||{};return e.renderArrayFieldItem({key:i,index:r,name:p&&p+"-"+r,canAdd:_,canRemove:l,canMoveUp:r>=P.length+1,canMoveDown:l&&r<w.length-1,itemSchema:u,itemData:o,itemUiSchema:h,itemIdSchema:m,itemErrorSchema:s?s[r]:void 0,autofocus:C&&0===r,onBlur:k,onFocus:x,rawErrors:T,totalItems:A.length})})),onAddClick:this.onAddClick,readonly:E,required:D,registry:O,schema:a,uiSchema:n,title:I,formContext:q,rawErrors:T},V=t.getTemplate("ArrayFieldTemplate",O,B);return m.default.createElement(V,b({},j))},n.renderArrayFieldItem=function(e){var r=e.key,a=e.index,i=e.name,n=e.canAdd,o=e.canRemove,l=void 0===o||o,s=e.canMoveUp,d=void 0===s||s,u=e.canMoveDown,c=void 0===u||u,f=e.itemSchema,p=e.itemData,h=e.itemUiSchema,v=e.itemIdSchema,y=e.itemErrorSchema,g=e.autofocus,E=e.onBlur,S=e.onFocus,b=e.rawErrors,C=e.totalItems,F=this.props,D=F.disabled,O=F.hideError,k=F.idPrefix,x=F.idSeparator,T=F.readonly,A=F.registry,N=F.formContext,w=A.fields,I=w.ArraySchemaField||w.SchemaField,B=t.getUiOptions(F.uiSchema),U=B.orderable,q=void 0===U||U,P=B.removable,R={moveUp:q&&d,moveDown:q&&c,remove:(void 0===P||P)&&l,toolbar:!1};return R.toolbar=Object.keys(R).some((function(e){return R[e]})),{children:m.default.createElement(I,{name:i,index:a,schema:f,uiSchema:h,formData:p,formContext:N,errorSchema:y,idPrefix:k,idSeparator:x,idSchema:v,required:this.isItemRequired(f),onChange:this.onChangeForIndex(a),onBlur:E,onFocus:S,registry:A,disabled:D,readonly:T,hideError:O,autofocus:g,rawErrors:b}),className:"array-item",disabled:D,canAdd:n,hasToolbar:R.toolbar,hasMoveUp:R.moveUp,hasMoveDown:R.moveDown,hasRemove:R.remove,index:a,totalItems:C,key:r,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:T,registry:A,schema:f,uiSchema:h}},a=r,(i=[{key:"itemTitle",get:function(){var e=this.props.schema;return f.default(e,[t.ITEMS_KEY,"title"],f.default(e,[t.ITEMS_KEY,"description"],"Item"))}}])&&function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(a.prototype,i),Object.defineProperty(a,"prototype",{writable:!1}),r}(e.Component),I=["widget"];function B(e){var r,a=e.schema,i=e.name,n=e.uiSchema,o=e.idSchema,l=e.formData,s=e.registry,d=e.required,u=e.disabled,c=e.readonly,f=e.autofocus,p=e.onChange,h=e.onFocus,y=e.onBlur,g=e.rawErrors,E=a.title,S=s.widgets,C=s.formContext,F=t.getUiOptions(n),O=F.widget,k=void 0===O?"checkbox":O,x=D(F,I),T=t.getWidget(a,k,S);if(Array.isArray(a.oneOf))r=t.optionsList({oneOf:a.oneOf.map((function(e){if(v.default(e))return b({},e,{title:e.title||(!0===e.const?"Yes":"No")})})).filter((function(e){return e}))});else{var A,N=a,w=null!=(A=a.enum)?A:[!0,!1];r=!N.enumNames&&2===w.length&&w.every((function(e){return"boolean"==typeof e}))?[{value:w[0],label:w[0]?"Yes":"No"},{value:w[1],label:w[1]?"Yes":"No"}]:t.optionsList({enum:w,enumNames:N.enumNames})}return m.default.createElement(T,{options:b({},x,{enumOptions:r}),schema:a,uiSchema:n,id:o.$id,onChange:p,onFocus:h,onBlur:y,label:void 0===E?i:E,value:l,required:d,disabled:u,readonly:c,registry:s,formContext:C,autofocus:f,rawErrors:g})}var U=["widget","placeholder","autofocus","autocomplete","title"],q=function(e){function r(t){var r;(r=e.call(this,t)||this).onOptionChange=function(e){var t=r.state,a=t.selectedOption,i=t.retrievedOptions,n=r.props,o=n.formData,l=n.onChange,s=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=s.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=s.getDefaultFormState(u,c,"excludeObjectChildren")),l(c,void 0,r.getFieldId()),r.setState({selectedOption:d})}};var a=r.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return r.state={retrievedOptions:o,selectedOption:r.getMatchingOption(0,i,o)},r}C(r,e);var a=r.prototype;return a.componentDidUpdate=function(e,r){var a=this.props,i=a.formData,n=a.options,o=a.idSchema,l=this.state.selectedOption,s=this.state;if(!t.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;s={selectedOption:l,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!t.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=s.retrievedOptions,c=this.getMatchingOption(l,i,u);r&&c!==l&&(s={selectedOption:c,retrievedOptions:u})}s!==this.state&&this.setState(s)},a.getMatchingOption=function(e,t,r){var a=this.props.registry.schemaUtils.getClosestMatchingOption(t,r,e);return a>0?a:e||0},a.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},a.render=function(){var e,r=this.props,a=r.baseType,i=r.disabled,n=void 0!==i&&i,o=r.errorSchema,l=void 0===o?{}:o,s=r.formContext,d=r.onBlur,u=r.onFocus,c=r.registry,h=r.schema,v=c.widgets,y=c.fields.SchemaField,E=this.state,S=E.selectedOption,C=E.retrievedOptions,F=t.getUiOptions(r.uiSchema),O=F.widget,k=void 0===O?"select":O,x=F.placeholder,T=F.autofocus,A=F.autocomplete,N=F.title,w=void 0===N?h.title:N,I=D(F,U),B=t.getWidget({type:"number"},k,v),q=f.default(l,t.ERRORS_KEY,[]),P=g.default(l,[t.ERRORS_KEY]),R=S>=0&&C[S]||null;R&&(e=R.type?R:Object.assign({},R,{type:a}));var _=w?w+" "+"Option".toLowerCase():"Option",j=C.map((function(e,t){return{label:e.title||_+" "+(t+1),value:t}}));return m.default.createElement("div",{className:"panel panel-default panel-body"},m.default.createElement("div",{className:"form-group"},m.default.createElement(B,{id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:d,onFocus:u,disabled:n||p.default(j),multiple:!1,rawErrors:q,errorSchema:P,value:S>=0?S:void 0,options:b({enumOptions:j},I),registry:c,formContext:s,placeholder:x,autocomplete:A,autofocus:T,label:""})),null!==R&&m.default.createElement(y,b({},this.props,{schema:e})))},r}(e.Component),P=/\.([0-9]*0)*$/,R=/[0.]0*$/;function _(r){var a=r.registry,i=r.onChange,n=r.formData,o=e.useState(r.value),l=o[0],s=o[1],d=a.fields.StringField,u=n,c=e.useCallback((function(e){s(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(P)?t.asNumber(e.replace(R,"")):t.asNumber(e);i(r)}),[i]);if("string"==typeof l&&"number"==typeof u){var f=new RegExp((""+u).replace(".","\\.")+"\\.?0*$");l.match(f)&&(u=l)}return m.default.createElement(d,b({},r,{formData:u,onChange:c}))}var j=function(e){function r(){for(var r,a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(r=e.call.apply(e,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},r.onPropertyChange=function(e,t){return void 0===t&&(t=!1),function(a,i,n){var o,l,s=r.props,d=s.errorSchema;void 0===a&&t&&(a=""),(0,s.onChange)(b({},s.formData,((o={})[e]=a,o)),d&&d&&b({},d,((l={})[e]=i,l)),n)}},r.onDropPropertyClick=function(e){return function(t){t.preventDefault();var a=r.props,i=a.onChange,n=b({},a.formData);S.default(n,e),i(n)}},r.getAvailableKey=function(e,a){for(var i=t.getUiOptions(r.props.uiSchema).duplicateKeySuffixSeparator,n=void 0===i?"-":i,o=0,l=e;E.default(a,l);)l=""+e+n+ ++o;return l},r.onKeyChange=function(e){return function(t,a){var i,n;if(e!==t){var o=r.props,l=o.formData,s=o.onChange,d=o.errorSchema;t=r.getAvailableKey(t,l);var u=b({},l),c=((i={})[e]=t,i),m=Object.keys(u).map((function(e){var t;return(t={})[c[e]||e]=u[e],t})),f=Object.assign.apply(Object,[{}].concat(m));r.setState({wasPropertyKeyModified:!0}),s(f,d&&d&&b({},d,((n={})[t]=a,n)))}}},r.handleAddClick=function(e){return function(){if(e.additionalProperties){var a=r.props,i=a.formData,n=a.onChange,o=a.registry,l=b({},i),s=void 0;if(v.default(e.additionalProperties)){s=e.additionalProperties.type;var d=e.additionalProperties;t.REF_KEY in d&&(s=(d=o.schemaUtils.retrieveSchema({$ref:d[t.REF_KEY]},i)).type),s||!(t.ANY_OF_KEY in d)&&!(t.ONE_OF_KEY in d)||(s="object")}var u=r.getAvailableKey("newKey",l);y.default(l,u,r.getDefaultValue(s)),n(l)}}},r}C(r,e);var a=r.prototype;return a.isRequired=function(e){var t=this.props.schema;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)},a.getDefaultValue=function(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}},a.render=function(){var e,r=this,a=this.props,i=a.uiSchema,n=void 0===i?{}:i,o=a.formData,l=a.errorSchema,s=a.idSchema,d=a.name,u=a.required,c=void 0!==u&&u,p=a.disabled,h=void 0!==p&&p,v=a.readonly,y=void 0!==v&&v,g=a.hideError,S=a.idPrefix,C=a.idSeparator,F=a.onBlur,D=a.onFocus,O=a.registry,k=O.formContext,x=O.fields.SchemaField,T=O.schemaUtils.retrieveSchema(a.schema,o),A=t.getUiOptions(n),N=T.properties,w=void 0===N?{}:N,I=void 0===T.title?d:T.title,B=A.description||T.description;try{var U=Object.keys(w);e=t.orderProperties(U,A.order)}catch(e){return m.default.createElement("div",null,m.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",d||"root"," object field configuration:",m.default.createElement("em",null,e.message),"."),m.default.createElement("pre",null,JSON.stringify(T)))}var q=t.getTemplate("ObjectFieldTemplate",O,A),P={title:A.title||I,description:B,properties:e.map((function(e){var a=E.default(T,[t.PROPERTIES_KEY,e,t.ADDITIONAL_PROPERTY_FLAG]),i=a?n.additionalProperties:n[e],d="hidden"===t.getUiOptions(i).widget,u=f.default(s,[e],{});return{content:m.default.createElement(x,{key:e,name:e,required:r.isRequired(e),schema:f.default(T,[t.PROPERTIES_KEY,e],{}),uiSchema:i,errorSchema:f.default(l,e),idSchema:u,idPrefix:S,idSeparator:C,formData:f.default(o,e),formContext:k,wasPropertyKeyModified:r.state.wasPropertyKeyModified,onKeyChange:r.onKeyChange(e),onChange:r.onPropertyChange(e,a),onBlur:F,onFocus:D,registry:O,disabled:h,readonly:y,hideError:g,onDropPropertyClick:r.onDropPropertyClick}),name:e,readonly:y,disabled:h,required:c,hidden:d}})),readonly:y,disabled:h,required:c,idSchema:s,uiSchema:n,schema:T,formData:o,formContext:k,registry:O};return m.default.createElement(q,b({},P,{onAddClick:this.handleAddClick}))},r}(e.Component),V=["__errors"],K={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function M(e){var r=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=e.errorSchema,l=e.idPrefix,s=e.idSeparator,d=e.name,u=e.onChange,c=e.onKeyChange,f=e.onDropPropertyClick,p=e.required,h=e.registry,y=e.wasPropertyKeyModified,E=void 0!==y&&y,S=h.formContext,C=h.schemaUtils,F=t.getUiOptions(i),O=t.getTemplate("FieldTemplate",h,F),k=t.getTemplate("DescriptionFieldTemplate",h,F),x=t.getTemplate("FieldHelpTemplate",h,F),T=t.getTemplate("FieldErrorTemplate",h,F),A=C.retrieveSchema(r,n),N=a[t.ID_KEY],w=t.mergeObjects(C.toIdSchema(A,N,n,l,s),a),I=m.default.useCallback((function(e,t,r){return u(e,t,r||N)}),[N,u]),B=function(e,r,a,i){var n=r.field,o=i.fields;if("function"==typeof n)return n;if("string"==typeof n&&n in o)return o[n];var l=t.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=K[s];return d||!e.anyOf&&!e.oneOf?d in o?o[d]:function(){var n=t.getTemplate("UnsupportedFieldTemplate",i,r);return m.default.createElement(n,{schema:e,idSchema:a,reason:"Unknown field type "+e.type,registry:i})}:function(){return null}}(A,F,w,h),U=Boolean(e.disabled||F.disabled),q=Boolean(e.readonly||F.readonly||e.schema.readOnly||A.readOnly),P=F.hideError,R=void 0===P?e.hideError:Boolean(P),_=Boolean(e.autofocus||F.autofocus);if(0===Object.keys(A).length)return null;var j=C.getDisplayLabel(A,i),M=o||{},W=M.__errors,L=D(M,V),Y=g.default(i,["ui:classNames","classNames","ui:style"]);t.UI_OPTIONS_KEY in Y&&(Y[t.UI_OPTIONS_KEY]=g.default(Y[t.UI_OPTIONS_KEY],["classNames","style"]));var $,z=m.default.createElement(B,b({},e,{onChange:I,idSchema:w,schema:A,uiSchema:Y,disabled:U,readonly:q,hideError:R,autofocus:_,errorSchema:L,formContext:S,rawErrors:W})),H=w[t.ID_KEY];$=E||t.ADDITIONAL_PROPERTY_FLAG in A?d:F.title||e.schema.title||A.title||d;var J=F.description||e.schema.description||A.description||"",G=F.help,Q="hidden"===F.widget,X=["form-group","field","field-"+A.type];!R&&W&&W.length>0&&X.push("field-error has-error has-danger"),null!=i&&i.classNames&&X.push(i.classNames),F.classNames&&X.push(F.classNames);var Z=m.default.createElement(x,{help:G,idSchema:w,schema:A,uiSchema:i,hasErrors:!R&&W&&W.length>0,registry:h}),ee=R?void 0:m.default.createElement(T,{errors:W,errorSchema:o,idSchema:w,schema:A,uiSchema:i,registry:h}),te={description:m.default.createElement(k,{id:t.descriptionId(H),description:J,schema:A,uiSchema:i,registry:h}),rawDescription:J,help:Z,rawHelp:"string"==typeof G?G:void 0,errors:ee,rawErrors:R?void 0:W,id:H,label:$,hidden:Q,onChange:u,onKeyChange:c,onDropPropertyClick:f,required:p,disabled:U,readonly:q,hideError:R,displayLabel:j,classNames:X.join(" ").trim(),style:F.style,formContext:S,formData:n,schema:A,uiSchema:i,registry:h},re=h.fields.AnyOfField,ae=h.fields.OneOfField,ie=(null==i?void 0:i["ui:field"])&&!0===(null==i?void 0:i["ui:fieldReplacesAnyOrOneOf"]);return m.default.createElement(O,b({},te),m.default.createElement(m.default.Fragment,null,z,A.anyOf&&!ie&&!C.isSelect(A)&&m.default.createElement(re,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:S,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.anyOf.map((function(e){return C.retrieveSchema(v.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i}),A.oneOf&&!ie&&!C.isSelect(A)&&m.default.createElement(ae,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:S,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.oneOf.map((function(e){return C.retrieveSchema(v.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i})))}var W=function(e){function r(){return e.apply(this,arguments)||this}C(r,e);var a=r.prototype;return a.shouldComponentUpdate=function(e){return!t.deepEquals(this.props,e)},a.render=function(){return m.default.createElement(M,b({},this.props))},r}(m.default.Component),L=["widget","placeholder"];function Y(e){var r=e.schema,a=e.name,i=e.uiSchema,n=e.idSchema,o=e.formData,l=e.required,s=e.disabled,d=void 0!==s&&s,u=e.readonly,c=void 0!==u&&u,f=e.autofocus,p=void 0!==f&&f,h=e.onChange,v=e.onBlur,y=e.onFocus,g=e.registry,E=e.rawErrors,S=r.title,C=r.format,F=g.widgets,O=g.formContext,k=g.schemaUtils.isSelect(r)?t.optionsList(r):void 0,x=k?"select":"text";C&&t.hasWidget(r,C,F)&&(x=C);var T=t.getUiOptions(i),A=T.widget,N=void 0===A?x:A,w=T.placeholder,I=void 0===w?"":w,B=D(T,L),U=t.getWidget(r,N,F);return m.default.createElement(U,{options:b({},B,{enumOptions:k}),schema:r,uiSchema:i,id:n.$id,label:void 0===S?a:S,value:o,onChange:h,onBlur:v,onFocus:y,required:l,disabled:d,readonly:c,formContext:O,autofocus:p,registry:g,placeholder:I,rawErrors:E})}function $(t){var r=t.formData,a=t.onChange;return e.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function z(e){var r=e.idSchema,a=e.description,i=e.registry,n=e.schema,o=e.uiSchema,l=t.getUiOptions(o),s=l.label;if(!a||void 0!==s&&!s)return null;var d=t.getTemplate("DescriptionFieldTemplate",i,l);return m.default.createElement(d,{id:t.descriptionId(r),description:a,schema:n,uiSchema:o,registry:i})}function H(e){var t=e.disabled,r=e.hasToolbar,a=e.hasMoveDown,i=e.hasMoveUp,n=e.hasRemove,o=e.index,l=e.onDropIndexClick,s=e.onReorderClick,d=e.readonly,u=e.registry,c=e.uiSchema,f=u.templates.ButtonTemplates,p=f.MoveDownButton,h=f.MoveUpButton,v=f.RemoveButton,y={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return m.default.createElement("div",{className:e.className},m.default.createElement("div",{className:r?"col-xs-9":"col-xs-12"},e.children),r&&m.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},m.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(i||a)&&m.default.createElement(h,{style:y,disabled:t||d||!i,onClick:s(o,o-1),uiSchema:c,registry:u}),(i||a)&&m.default.createElement(p,{style:y,disabled:t||d||!a,onClick:s(o,o+1),uiSchema:c,registry:u}),n&&m.default.createElement(v,{style:y,disabled:t||d,onClick:l(o),uiSchema:c,registry:u}))))}var J=["key"];function G(e){var r=e.canAdd,a=e.className,i=e.disabled,n=e.idSchema,o=e.uiSchema,l=e.items,s=e.onAddClick,d=e.readonly,u=e.registry,c=e.required,f=e.schema,p=e.title,h=t.getUiOptions(o),v=t.getTemplate("ArrayFieldDescriptionTemplate",u,h),y=t.getTemplate("ArrayFieldItemTemplate",u,h),g=t.getTemplate("ArrayFieldTitleTemplate",u,h),E=u.templates.ButtonTemplates.AddButton;return m.default.createElement("fieldset",{className:a,id:n.$id},m.default.createElement(g,{idSchema:n,title:h.title||p,required:c,schema:f,uiSchema:o,registry:u}),m.default.createElement(v,{idSchema:n,description:h.description||f.description,schema:f,uiSchema:o,registry:u}),m.default.createElement("div",{className:"row array-item-list"},l&&l.map((function(e){var t=e.key,r=D(e,J);return m.default.createElement(y,b({key:t},r))}))),r&&m.default.createElement(E,{className:"array-item-add",onClick:s,disabled:i||d,uiSchema:o,registry:u}))}function Q(e){var r=e.idSchema,a=e.title,i=e.schema,n=e.uiSchema,o=e.required,l=e.registry,s=t.getUiOptions(n),d=s.label;if(!a||void 0!==d&&!d)return null;var u=t.getTemplate("TitleFieldTemplate",l,s);return m.default.createElement(u,{id:t.titleId(r),title:a,required:o,schema:i,uiSchema:n,registry:l})}var X=["id","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","options","schema","uiSchema","formContext","registry","rawErrors","type"];function Z(r){var a=r.id,i=r.value,n=r.readonly,o=r.disabled,l=r.autofocus,s=r.onBlur,d=r.onFocus,u=r.onChange,c=r.options,f=r.schema,p=r.type,h=D(r,X);if(!a)throw console.log("No id for",r),new Error("no id for props "+JSON.stringify(r));var v,y=b({},h,t.getInputProps(f,p,c));v="number"===y.type||"integer"===y.type?i||0===i?i:"":null==i?"":i;var g=e.useCallback((function(e){var t=e.target.value;return u(""===t?c.emptyValue:t)}),[u,c]),E=e.useCallback((function(e){return s(a,e.target.value)}),[s,a]),S=e.useCallback((function(e){return d(a,e.target.value)}),[d,a]);return m.default.createElement(m.default.Fragment,null,m.default.createElement("input",b({id:a,name:a,className:"form-control",readOnly:n,disabled:o,autoFocus:l,value:v},y,{list:f.examples?t.examplesId(a):void 0,onChange:g,onBlur:E,onFocus:S,"aria-describedby":t.ariaDescribedByIds(a,!!f.examples)})),Array.isArray(f.examples)&&m.default.createElement("datalist",{key:"datalist_"+a,id:t.examplesId(a)},f.examples.concat(f.default&&!f.examples.includes(f.default)?[f.default]:[]).map((function(e){return m.default.createElement("option",{key:e,value:e})}))))}function ee(e){var r=t.getSubmitButtonOptions(e.uiSchema),a=r.submitText,i=r.props,n=void 0===i?{}:i;return r.norender?null:m.default.createElement("div",null,m.default.createElement("button",b({type:"submit"},n,{className:"btn btn-info "+n.className}),a))}var te=["iconType","icon","className","uiSchema","registry"];function re(e){var t=e.iconType,r=void 0===t?"default":t,a=e.icon,i=e.className,n=D(e,te);return m.default.createElement("button",b({type:"button",className:"btn btn-"+r+" "+i},n),m.default.createElement("i",{className:"glyphicon glyphicon-"+a}))}function ae(e){return m.default.createElement(re,b({title:"Move down",className:"array-item-move-down"},e,{icon:"arrow-down"}))}function ie(e){return m.default.createElement(re,b({title:"Move up",className:"array-item-move-up"},e,{icon:"arrow-up"}))}function ne(e){return m.default.createElement(re,b({title:"Remove",className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function oe(e){return m.default.createElement("div",{className:"row"},m.default.createElement("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className},m.default.createElement(re,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:e.onClick,disabled:e.disabled,registry:e.registry})))}function le(e){var t=e.description;return t?m.default.createElement("string"==typeof t?"p":"div",{id:e.id,className:"field-description"},t):null}function se(e){var t=e.errors;return m.default.createElement("div",{className:"panel panel-danger errors"},m.default.createElement("div",{className:"panel-heading"},m.default.createElement("h3",{className:"panel-title"},"Errors")),m.default.createElement("ul",{className:"list-group"},t.map((function(e,t){return m.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)}))))}function de(e){var t=e.label;return t?m.default.createElement("label",{className:"control-label",htmlFor:e.id},t,e.required&&m.default.createElement("span",{className:"required"},"*")):null}function ue(e){var r=e.id,a=e.label,i=e.children,n=e.errors,o=e.help,l=e.description,s=e.hidden,d=e.required,u=e.displayLabel,c=e.registry,f=t.getUiOptions(e.uiSchema),p=t.getTemplate("WrapIfAdditionalTemplate",c,f);return s?m.default.createElement("div",{className:"hidden"},i):m.default.createElement(p,b({},e),u&&m.default.createElement(de,{label:a,required:d,id:r}),u&&l?l:null,i,n,o)}function ce(e){var r=e.errors,a=void 0===r?[]:r;if(0===a.length)return null;var i=t.errorId(e.idSchema);return m.default.createElement("div",null,m.default.createElement("ul",{id:i,className:"error-detail bs-callout bs-callout-info"},a.filter((function(e){return!!e})).map((function(e,t){return m.default.createElement("li",{className:"text-danger",key:t},e)}))))}function me(e){var r=e.help;if(!r)return null;var a=t.helpId(e.idSchema);return m.default.createElement("string"==typeof r?"p":"div",{id:a,className:"help-block"},r)}function fe(e){var r=e.description,a=e.disabled,i=e.formData,n=e.idSchema,o=e.onAddClick,l=e.properties,s=e.readonly,d=e.registry,u=e.required,c=e.schema,f=e.title,p=e.uiSchema,h=t.getUiOptions(p),v=t.getTemplate("TitleFieldTemplate",d,h),y=t.getTemplate("DescriptionFieldTemplate",d,h),g=d.templates.ButtonTemplates.AddButton;return m.default.createElement("fieldset",{id:n.$id},(h.title||f)&&m.default.createElement(v,{id:t.titleId(n),title:h.title||f,required:u,schema:c,uiSchema:p,registry:d}),(h.description||r)&&m.default.createElement(y,{id:t.descriptionId(n),description:h.description||r,schema:c,uiSchema:p,registry:d}),l.map((function(e){return e.content})),t.canExpand(c,p,i)&&m.default.createElement(g,{className:"object-property-expand",onClick:o(c),disabled:a||s,uiSchema:p,registry:d}))}function pe(e){return m.default.createElement("legend",{id:e.id},e.title,e.required&&m.default.createElement("span",{className:"required"},"*"))}function he(e){var t=e.schema,r=e.idSchema,a=e.reason;return m.default.createElement("div",{className:"unsupported-field"},m.default.createElement("p",null,"Unsupported field schema",r&&r.$id&&m.default.createElement("span",null," for"," field ",m.default.createElement("code",null,r.$id)),a&&m.default.createElement("em",null,": ",a),"."),t&&m.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ve(e){var r=e.id,a=e.disabled,i=e.label,n=e.onKeyChange,o=e.onDropPropertyClick,l=e.readonly,s=e.children,d=e.uiSchema,u=e.registry,c=u.templates.ButtonTemplates.RemoveButton;return m.default.createElement("div",{className:e.classNames,style:e.style},t.ADDITIONAL_PROPERTY_FLAG in e.schema?m.default.createElement("div",{className:"row"},m.default.createElement("div",{className:"col-xs-5 form-additional"},m.default.createElement("div",{className:"form-group"},m.default.createElement(de,{label:i+" Key",required:e.required,id:r+"-key"}),m.default.createElement("input",{className:"form-control",type:"text",id:r+"-key",onBlur:function(e){return n(e.target.value)},defaultValue:i}))),m.default.createElement("div",{className:"form-additional form-group col-xs-5"},s),m.default.createElement("div",{className:"col-xs-2"},m.default.createElement(c,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||l,onClick:o(i),uiSchema:d,registry:u}))):s)}function ye(e,r){for(var a=[],i=e;i<=r;i++)a.push({value:i,label:t.pad(i,2)});return a}function ge(e){var r=e.type,a=e.range,i=e.value,n=e.select,o=e.rootId,l=e.disabled,s=e.readonly,d=e.autofocus,u=e.registry,c=e.onBlur,f=e.onFocus;return m.default.createElement(u.widgets.SelectWidget,{schema:{type:"integer"},id:o+"_"+r,className:"form-control",options:{enumOptions:ye(a[0],a[1])},placeholder:r,value:i,disabled:l,readonly:s,autofocus:d,onChange:function(e){return n(r,e)},onBlur:c,onFocus:f,registry:u,label:"","aria-describedby":t.ariaDescribedByIds(o)})}function Ee(r){var a=r.time,i=void 0!==a&&a,n=r.disabled,o=void 0!==n&&n,l=r.readonly,s=void 0!==l&&l,d=r.autofocus,u=void 0!==d&&d,c=r.options,f=r.id,p=r.registry,h=r.onBlur,v=r.onFocus,y=r.onChange,g=r.value,E=e.useReducer((function(e,t){return b({},e,t)}),t.parseDateString(g,i)),S=E[0],C=E[1];e.useEffect((function(){g&&g!==t.toDateString(S,i)&&C(t.parseDateString(g,i))}),[g,S,i]),e.useEffect((function(){(function(e){return Object.values(e).every((function(e){return-1!==e}))})(S)&&y(t.toDateString(S,i))}),[S,i,y]);var F=e.useCallback((function(e,t){var r;C(((r={})[e]=t,r))}),[]),D=e.useCallback((function(e){if(e.preventDefault(),!o&&!s){var r=t.parseDateString((new Date).toJSON(),i);C(r)}}),[o,s,i]),O=e.useCallback((function(e){e.preventDefault(),o||s||(C(t.parseDateString("",i)),y(void 0))}),[o,s,i,y]);return m.default.createElement("ul",{className:"list-inline"},function(e,t,r){void 0===r&&(r=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:r,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return t&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}(S,i,c.yearsRange).map((function(e,t){return m.default.createElement("li",{key:t},m.default.createElement(ge,b({rootId:f,select:F},e,{disabled:o,readonly:s,registry:p,onBlur:h,onFocus:v,autofocus:u&&0===t})))})),("undefined"===c.hideNowButton||!c.hideNowButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:D},"Now")),("undefined"===c.hideClearButton||!c.hideClearButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:O},"Clear")))}var Se=["time"];function be(e){var t=e.time,r=void 0===t||t,a=D(e,Se);return m.default.createElement(a.registry.widgets.AltDateWidget,b({time:r},a))}function Ce(r){var a=r.schema,i=r.uiSchema,n=r.id,o=r.value,l=r.disabled,s=r.readonly,d=r.label,u=r.autofocus,c=void 0!==u&&u,f=r.onBlur,p=r.onFocus,h=r.onChange,v=r.registry,y=t.getTemplate("DescriptionFieldTemplate",v,r.options),g=t.schemaRequiresTrueValue(a),E=e.useCallback((function(e){return h(e.target.checked)}),[h]),S=e.useCallback((function(e){return f(n,e.target.checked)}),[f,n]),b=e.useCallback((function(e){return p(n,e.target.checked)}),[p,n]);return m.default.createElement("div",{className:"checkbox "+(l||s?"disabled":"")},a.description&&m.default.createElement(y,{id:t.descriptionId(n),description:a.description,schema:a,uiSchema:i,registry:v}),m.default.createElement("label",null,m.default.createElement("input",{type:"checkbox",id:n,name:n,checked:void 0!==o&&o,required:g,disabled:l||s,autoFocus:c,onChange:E,onBlur:S,onFocus:b,"aria-describedby":t.ariaDescribedByIds(n)}),m.default.createElement("span",null,d)))}function Fe(e){var r=e.id,a=e.disabled,i=e.options,n=i.inline,o=void 0!==n&&n,l=i.enumOptions,s=i.enumDisabled,d=e.value,u=e.autofocus,c=void 0!==u&&u,f=e.readonly,p=e.onChange,h=Array.isArray(d)?d:[d];return m.default.createElement("div",{className:"checkboxes",id:r},Array.isArray(l)&&l.map((function(e,i){var n=h.includes(e.value),d=Array.isArray(s)&&-1!=s.indexOf(e.value),u=a||d||f?"disabled":"",v=m.default.createElement("span",null,m.default.createElement("input",{type:"checkbox",id:t.optionId(r,e),name:r,checked:n,disabled:a||d||f,autoFocus:c&&0===i,onChange:function(r){p(r.target.checked?t.enumOptionsSelectValue(e.value,h,l):t.enumOptionsDeselectValue(e.value,h))},"aria-describedby":t.ariaDescribedByIds(r)}),m.default.createElement("span",null,e.label));return o?m.default.createElement("label",{key:e.value,className:"checkbox-inline "+u},v):m.default.createElement("div",{key:e.value,className:"checkbox "+u},m.default.createElement("label",null,v))})))}function De(e){var r=e.disabled,a=e.readonly,i=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(i,b({type:"color"},e,{disabled:r||a}))}function Oe(r){var a=r.onChange,i=t.getTemplate("BaseInputTemplate",r.registry,r.options),n=e.useCallback((function(e){return a(e||void 0)}),[a]);return m.default.createElement(i,b({type:"date"},r,{onChange:n}))}function ke(e){var r=e.onChange,a=e.value,i=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(i,b({type:"datetime-local"},e,{value:t.utcToLocal(a),onChange:function(e){return r(t.localToUTC(e))}}))}function xe(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"email"},e))}function Te(e,t){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(t)+";base64")}function Ae(e){var t=e.name,r=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:Te(e.target.result,t),name:t,size:r,type:a}):i({dataURL:null,name:t,size:r,type:a})},o.readAsDataURL(e)}))}function Ne(e){var t=e.filesInfo;return 0===t.length?null:m.default.createElement("ul",{className:"file-info"},t.map((function(e,t){var r=e.size,a=e.type;return m.default.createElement("li",{key:t},m.default.createElement("strong",null,e.name)," (",a,", ",r," bytes)")})))}function we(e){return e.filter((function(e){return void 0!==e})).map((function(e){var r=t.dataURItoBlob(e),a=r.blob;return{name:r.name,size:a.size,type:a.type}}))}function Ie(r){var a=r.multiple,i=r.id,n=r.readonly,o=r.disabled,l=r.onChange,s=r.value,d=r.autofocus,u=void 0!==d&&d,c=r.options,f=e.useMemo((function(){return Array.isArray(s)?we(s):we([s])}),[s]),p=e.useState(f),h=p[0],v=p[1],y=e.useCallback((function(e){var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(Ae))).then((function(e){v(e);var t=e.map((function(e){return e.dataURL}));l(a?t:t[0])}))}),[a,l]);return m.default.createElement("div",null,m.default.createElement("p",null,m.default.createElement("input",{id:i,name:i,type:"file",disabled:n||o,onChange:y,defaultValue:"",autoFocus:u,multiple:a,accept:c.accept?String(c.accept):void 0,"aria-describedby":t.ariaDescribedByIds(i)})),m.default.createElement(Ne,{filesInfo:h}))}function Be(e){var t=e.id,r=e.value;return m.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===r?"":r})}function Ue(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"password"},e))}function qe(r){var a=r.options,i=r.value,n=r.required,o=r.disabled,l=r.readonly,s=r.autofocus,d=void 0!==s&&s,u=r.onBlur,c=r.onFocus,f=r.onChange,p=r.id,h=Math.random().toString(),v=a.enumOptions,y=a.enumDisabled,g=a.inline,E=e.useCallback((function(e){return u(p,e.target.value)}),[u,p]),S=e.useCallback((function(e){return c(p,e.target.value)}),[c,p]);return m.default.createElement("div",{className:"field-radio-group",id:p},Array.isArray(v)&&v.map((function(e,r){var a=e.value===i,s=Array.isArray(y)&&-1!=y.indexOf(e.value),u=o||s||l?"disabled":"",c=m.default.createElement("span",null,m.default.createElement("input",{type:"radio",id:t.optionId(p,e),checked:a,name:h,required:n,value:e.value,disabled:o||s||l,autoFocus:d&&0===r,onChange:function(){return f(e.value)},onBlur:E,onFocus:S,"aria-describedby":t.ariaDescribedByIds(p)}),m.default.createElement("span",null,e.label));return g?m.default.createElement("label",{key:e.value,className:"radio-inline "+u},c):m.default.createElement("div",{key:e.value,className:"radio "+u},m.default.createElement("label",null,c))})))}function Pe(e){var t=e.value;return m.default.createElement("div",{className:"field-range-wrapper"},m.default.createElement(e.registry.templates.BaseInputTemplate,b({type:"range"},e)),m.default.createElement("span",{className:"range-view"},t))}function Re(e,t){return t?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function _e(r){var a=r.schema,i=r.id,n=r.options,o=r.value,l=r.required,s=r.disabled,d=r.readonly,u=r.multiple,c=void 0!==u&&u,f=r.autofocus,p=void 0!==f&&f,h=r.onChange,v=r.onBlur,y=r.onFocus,g=r.placeholder,E=n.enumOptions,S=n.enumDisabled,b=c?[]:"",C=e.useCallback((function(e){var r=Re(e,c);return y(i,t.processSelectValue(a,r,n))}),[y,i,a,c,n]),F=e.useCallback((function(e){var r=Re(e,c);return v(i,t.processSelectValue(a,r,n))}),[v,i,a,c,n]),D=e.useCallback((function(e){var r=Re(e,c);return h(t.processSelectValue(a,r,n))}),[h,a,c,n]);return m.default.createElement("select",{id:i,name:i,multiple:c,className:"form-control",value:void 0===o?b:o,required:l,disabled:s||d,autoFocus:p,onBlur:F,onFocus:C,onChange:D,"aria-describedby":t.ariaDescribedByIds(i)},!c&&void 0===a.default&&m.default.createElement("option",{value:""},g),Array.isArray(E)&&E.map((function(e,t){var r=e.value,a=e.label,i=S&&-1!=S.indexOf(r);return m.default.createElement("option",{key:t,value:r,disabled:i},a)})))}function je(r){var a=r.id,i=r.options,n=void 0===i?{}:i,o=r.placeholder,l=r.value,s=r.required,d=r.disabled,u=r.readonly,c=r.autofocus,f=void 0!==c&&c,p=r.onChange,h=r.onBlur,v=r.onFocus,y=e.useCallback((function(e){var t=e.target.value;return p(""===t?n.emptyValue:t)}),[p,n.emptyValue]),g=e.useCallback((function(e){return h(a,e.target.value)}),[h,a]),E=e.useCallback((function(e){return v(a,e.target.value)}),[a,v]);return m.default.createElement("textarea",{id:a,name:a,className:"form-control",value:l||"",placeholder:o,required:s,disabled:d,readOnly:u,autoFocus:f,rows:n.rows,onBlur:g,onFocus:E,onChange:y,"aria-describedby":t.ariaDescribedByIds(a)})}function Ve(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({},e))}function Ke(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"url"},e))}function Me(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"number"},e))}function We(){return{fields:{AnyOfField:q,ArrayField:w,BooleanField:B,NumberField:_,ObjectField:j,OneOfField:q,SchemaField:W,StringField:Y,NullField:$},templates:{ArrayFieldDescriptionTemplate:z,ArrayFieldItemTemplate:H,ArrayFieldTemplate:G,ArrayFieldTitleTemplate:Q,ButtonTemplates:{SubmitButton:ee,AddButton:oe,MoveDownButton:ae,MoveUpButton:ie,RemoveButton:ne},BaseInputTemplate:Z,DescriptionFieldTemplate:le,ErrorListTemplate:se,FieldTemplate:ue,FieldErrorTemplate:ce,FieldHelpTemplate:me,ObjectFieldTemplate:fe,TitleFieldTemplate:pe,UnsupportedFieldTemplate:he,WrapIfAdditionalTemplate:ve},widgets:{PasswordWidget:Ue,RadioWidget:qe,UpDownWidget:Me,RangeWidget:Pe,SelectWidget:_e,TextWidget:Ve,DateWidget:Oe,DateTimeWidget:ke,AltDateWidget:Ee,AltDateTimeWidget:be,EmailWidget:xe,URLWidget:Ke,TextareaWidget:je,HiddenWidget:Be,ColorWidget:De,FileWidget:Ie,CheckboxWidget:Ce,CheckboxesWidget:Fe},rootSchema:{},formContext:{}}}je.defaultProps={autofocus:!1,options:{}};var Le=function(e){function r(r){var a;if((a=e.call(this,r)||this).formElement=void 0,a.getUsedFormData=function(e,t){if(0===t.length&&"object"!=typeof e)return e;var r=h.default(e,t);return Array.isArray(e)?Object.keys(r).map((function(e){return r[e]})):r},a.getFieldNames=function(e,r){return function e(a,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var l=n.map((function(e){return[].concat(e,[o])}));a[o][t.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][t.NAME_KEY]?i.push(a[o][t.NAME_KEY]):e(a[o],i,l)}else o===t.NAME_KEY&&""!==a[o]&&n.forEach((function(e){var t=f.default(r,e);("object"!=typeof t||p.default(t))&&i.push(e)}))})),i}(e)},a.onChange=function(e,r,i){var n=a.props,o=n.extraErrors,l=n.omitExtraData,s=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=a.state,f=m.schemaUtils,p=m.schema;(t.isObject(e)||Array.isArray(e))&&(e=a.getStateFromProps(a.props,e).formData);var h=!d&&u,v={formData:e,schema:p},y=e;if(!0===l&&!0===s){var g=f.retrieveSchema(p,e),E=f.toPathSchema(g,"",e),S=a.getFieldNames(E,e);y=a.getUsedFormData(e,S),v={formData:y}}if(h){var C=a.validate(y),F=C.errors,D=C.errorSchema,O=F,k=D;if(o){var x=f.mergeValidationData(C,o);D=x.errorSchema,F=x.errors}v={formData:y,errors:F,errorSchema:D,schemaValidationErrors:O,schemaValidationErrorSchema:k}}else if(!d&&r){var T=o?t.mergeObjects(r,o,"preventDuplicates"):r;v={formData:y,errorSchema:T,errors:f.getValidator().toErrorList(T)}}a.setState(v,(function(){return c&&c(b({},a.state,v),i)}))},a.onBlur=function(e,t){var r=a.props.onBlur;r&&r(e,t)},a.onFocus=function(e,t){var r=a.props.onFocus;r&&r(e,t)},a.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var t=a.props,r=t.extraErrors,i=t.noValidate,n=t.onSubmit,o=a.state.formData,l=a.state,s=l.schemaUtils;if(!0===t.omitExtraData){var d=s.retrieveSchema(l.schema,o),u=s.toPathSchema(d,"",o),c=a.getFieldNames(u,o);o=a.getUsedFormData(o,c)}if(i||a.validateForm()){var m=r||{},f=r?s.getValidator().toErrorList(r):[];a.setState({formData:o,errors:f,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(b({},a.state,{formData:o,status:"submitted"}),e)}))}}},!r.validator)throw new Error("A validator is required for Form functionality to work");return a.state=a.getStateFromProps(r,r.formData),a.props.onChange&&!t.deepEquals(a.state.formData,a.props.formData)&&a.props.onChange(a.state),a.formElement=m.default.createRef(),a}C(r,e);var a=r.prototype;return a.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);t.deepEquals(r.formData,e.formData)||t.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},a.getStateFromProps=function(e,r){var a=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,l=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=i,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=t.createSchemaUtils(e.validator,s));var u,c,m=d.getDefaultFormState(i,r,"excludeObjectChildren"),f=d.retrieveSchema(i,m),p=a.schemaValidationErrors,h=a.schemaValidationErrorSchema;if(l){var v=this.validate(m,i,d);p=u=v.errors,h=c=v.errorSchema}else{var y=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=y.errors,c=y.errorSchema}if(e.extraErrors){var g=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=g.errorSchema,u=g.errors}var E=d.toIdSchema(f,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:E,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:p,schemaValidationErrorSchema:h}},a.shouldComponentUpdate=function(e,r){return t.shouldRender(this,e,r)},a.validate=function(e,t,r){void 0===t&&(t=this.props.schema);var a=r||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,l=i.uiSchema,s=a.retrieveSchema(t,e);return a.getValidator().validateFormData(e,s,n,o,l)},a.renderErrors=function(e){var r=this.state,a=r.errors,i=r.errorSchema,n=r.schema,o=r.uiSchema,l=this.props.formContext,s=t.getUiOptions(o),d=t.getTemplate("ErrorListTemplate",e,s);return a&&a.length?m.default.createElement(d,{errors:a,errorSchema:i||{},schema:n,uiSchema:o,formContext:l}):null},a.getRegistry=function(){var e,t=this.state.schemaUtils,r=We(),a=r.templates,i=r.widgets,n=r.formContext;return{fields:b({},r.fields,this.props.fields),templates:b({},a,this.props.templates,{ButtonTemplates:b({},a.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:b({},i,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||n,schemaUtils:t}},a.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},a.validateForm=function(){var e=this.props,t=e.extraErrors,r=e.onError,a=this.state.schemaUtils,i=this.validate(this.state.formData),n=i.errors,o=i.errorSchema,l=n,s=o;if(n.length>0){if(t){var d=a.mergeValidationData(i,t);o=d.errorSchema,n=d.errors}return this.setState({errors:n,errorSchema:o,schemaValidationErrors:l,schemaValidationErrorSchema:s},(function(){r?r(n):console.error("Form validation failed",n)})),!1}return!0},a.render=function(){var e=this.props,t=e.children,r=e.id,a=e.idPrefix,i=e.idSeparator,n=e.className,o=void 0===n?"":n,l=e.tagName,s=e.name,d=e.method,u=e.target,c=e.action,f=e.autoComplete,p=e.enctype,h=e.acceptcharset,v=e.noHtml5Validate,y=void 0!==v&&v,g=e.disabled,E=void 0!==g&&g,S=e.readonly,b=void 0!==S&&S,C=e.formContext,F=e.showErrorList,D=void 0===F?"top":F,O=e._internalFormWrapper,k=this.state,x=k.schema,T=k.uiSchema,A=k.formData,N=k.errorSchema,w=k.idSchema,I=this.getRegistry(),B=I.fields.SchemaField,U=I.templates.ButtonTemplates.SubmitButton;return m.default.createElement(O||l||"form",{className:o||"rjsf",id:r,name:s,method:d,target:u,action:c,autoComplete:f,encType:p,acceptCharset:h,noValidate:y,onSubmit:this.onSubmit,as:O?l:void 0,ref:this.formElement},"top"===D&&this.renderErrors(I),m.default.createElement(B,{name:"",schema:x,uiSchema:T,errorSchema:N,idSchema:w,idPrefix:a,idSeparator:i,formContext:C,formData:A,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:I,disabled:E,readonly:b}),t||m.default.createElement(U,{uiSchema:T,registry:I}),"bottom"===D&&this.renderErrors(I))},r}(e.Component),Ye=["fields","widgets","templates"];exports.default=Le,exports.getDefaultRegistry=We,exports.withTheme=function(t){return e.forwardRef((function(e,r){var a,i,n=e.fields,o=e.widgets,l=e.templates,s=D(e,Ye);return n=b({},null==t?void 0:t.fields,n),o=b({},null==t?void 0:t.widgets,o),l=b({},null==t?void 0:t.templates,l,{ButtonTemplates:b({},null==t||null===(a=t.templates)||void 0===a?void 0:a.ButtonTemplates,null===(i=l)||void 0===i?void 0:i.ButtonTemplates)}),m.default.createElement(Le,b({},t,s,{fields:n,widgets:o,templates:l,ref:r}))}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@rjsf/utils"),r=require("lodash/get"),a=require("lodash/isEmpty"),i=require("lodash/pick"),n=require("lodash/isObject"),o=require("lodash/set"),l=require("nanoid"),s=require("lodash/omit"),d=require("lodash/has"),u=require("lodash/unset");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(e),f=c(r),p=c(a),h=c(i),v=c(n),g=c(o),y=c(s),E=c(d),S=c(u);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},b.apply(this,arguments)}function C(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,F(e,t)}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}function D(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)t.indexOf(r=n[a])>=0||(i[r]=e[r]);return i}var O=["widget"],x=["widget"],k=["widget"];function T(){return l.nanoid()}function A(e){return Array.isArray(e)?e.map((function(e){return{key:T(),item:e}})):[]}function N(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var w=function(e){function r(r){var a;(a=e.call(this,r)||this)._getNewFormDataRow=function(){var e=a.props,r=e.schema,i=e.registry.schemaUtils,n=r.items;return t.isFixedItems(r)&&t.allowAdditionalItems(r)&&(n=r.additionalItems),i.getDefaultFormState(n)},a.onAddClick=function(e){a._handleAddClick(e)},a.onAddIndexClick=function(e){return function(t){a._handleAddClick(t,e)}},a.onDropIndexClick=function(e){return function(t){t&&t.preventDefault();var r,i=a.props,n=i.onChange,o=i.errorSchema,l=a.state.keyedFormData;if(o)for(var s in r={},o){var d=parseInt(s);d<e?g.default(r,[d],o[s]):d>e&&g.default(r,[d-1],o[s])}var u=l.filter((function(t,r){return r!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(N(u),r)}))}},a.onReorderClick=function(e,t){return function(r){r&&(r.preventDefault(),r.currentTarget.blur());var i,n=a.props,o=n.onChange,l=n.errorSchema;if(a.props.errorSchema)for(var s in i={},l){var d=parseInt(s);d==e?g.default(i,[t],l[e]):d==t?g.default(i,[e],l[t]):g.default(i,[s],l[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(t,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(N(m),i)}))}},a.onChangeForIndex=function(e){return function(t,r,i){var n,o=a.props,l=o.formData,s=o.errorSchema;(0,o.onChange)((Array.isArray(l)?l:[]).map((function(r,a){return e===a?void 0===t?null:t:r})),s&&s&&b({},s,((n={})[e]=r,n)),i)}},a.onSelectChange=function(e){var t=a.props,r=t.idSchema;(0,t.onChange)(e,void 0,r&&r.$id)};var i=r.formData,n=A(void 0===i?[]:i);return a.state={keyedFormData:n,updatedKeyedFormData:!1},a}C(r,e),r.getDerivedStateFromProps=function(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};var r=Array.isArray(e.formData)?e.formData:[],a=t.keyedFormData||[];return{keyedFormData:r.length===a.length?a.map((function(e,t){return{key:e.key,item:r[t]}})):A(r)}};var a,i,n=r.prototype;return n.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},n.canAddItem=function(e){var r=this.props,a=r.schema,i=t.getUiOptions(r.uiSchema).addable;return!1!==i&&(i=void 0===a.maxItems||e.length<a.maxItems),i},n._handleAddClick=function(e,t){e&&e.preventDefault();var r=this.props.onChange,a=this.state.keyedFormData,i={key:T(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==t?n.splice(t,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return r(N(n))}))},n.render=function(){var e=this.props,r=e.schema,a=e.uiSchema,i=e.idSchema,n=e.registry,o=n.schemaUtils;if(!(t.ITEMS_KEY in r)){var l=t.getUiOptions(a),s=t.getTemplate("UnsupportedFieldTemplate",n,l);return m.default.createElement(s,{schema:r,idSchema:i,reason:"Missing items definition",registry:n})}return o.isMultiSelect(r)?this.renderMultiSelect():t.isCustomWidget(a)?this.renderCustomWidget():t.isFixedItems(r)?this.renderFixedArray():o.isFilesArray(r,a)?this.renderFiles():this.renderNormalArray()},n.renderNormalArray=function(){var e=this,r=this.props,a=r.schema,i=r.uiSchema,n=void 0===i?{}:i,o=r.errorSchema,l=r.idSchema,s=r.name,d=r.disabled,u=void 0!==d&&d,c=r.readonly,f=void 0!==c&&c,p=r.autofocus,h=void 0!==p&&p,g=r.required,y=void 0!==g&&g,E=r.registry,S=r.onBlur,C=r.onFocus,F=r.idPrefix,D=r.idSeparator,O=void 0===D?"_":D,x=r.rawErrors,k=this.state.keyedFormData,T=void 0===a.title?s:a.title,A=E.schemaUtils,w=E.formContext,I=t.getUiOptions(n),B=v.default(a.items)?a.items:{},U=A.retrieveSchema(B),q=N(this.state.keyedFormData),P=this.canAddItem(q),R={canAdd:P,items:k.map((function(t,r){var a=t.key,i=t.item,d=A.retrieveSchema(B,i),u=o?o[r]:void 0,c=A.toIdSchema(d,l.$id+O+r,i,F,O);return e.renderArrayFieldItem({key:a,index:r,name:s&&s+"-"+r,canAdd:P,canMoveUp:r>0,canMoveDown:r<q.length-1,itemSchema:d,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:n.items,autofocus:h&&0===r,onBlur:S,onFocus:C,rawErrors:x,totalItems:k.length})})),className:"field field-array field-array-of-"+U.type,disabled:u,idSchema:l,uiSchema:n,onAddClick:this.onAddClick,readonly:f,required:y,schema:a,title:T,formContext:w,formData:q,rawErrors:x,registry:E},_=t.getTemplate("ArrayFieldTemplate",E,I);return m.default.createElement(_,b({},R))},n.renderCustomWidget=function(){var e=this.props,r=e.schema,a=e.idSchema,i=e.uiSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,f=void 0!==c&&c,p=e.hideError,h=e.placeholder,v=e.onBlur,g=e.onFocus,y=e.formData,E=void 0===y?[]:y,S=e.registry,b=e.rawErrors,C=S.widgets,F=S.formContext,x=r.title||e.name,k=t.getUiOptions(i),T=k.widget,A=D(k,O),N=t.getWidget(r,T,C);return m.default.createElement(N,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:g,options:A,schema:r,uiSchema:i,registry:S,value:E,disabled:o,readonly:s,hideError:p,required:f,label:x,placeholder:h,formContext:F,autofocus:u,rawErrors:b})},n.renderMultiSelect=function(){var e=this.props,r=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=void 0===n?[]:n,l=e.disabled,s=void 0!==l&&l,d=e.readonly,u=void 0!==d&&d,c=e.autofocus,f=void 0!==c&&c,p=e.required,h=void 0!==p&&p,v=e.placeholder,g=e.onBlur,y=e.onFocus,E=e.registry,S=e.rawErrors,C=e.name,F=E.widgets,O=E.formContext,k=E.schemaUtils.retrieveSchema(r.items,o),T=r.title||C,A=t.optionsList(k),N=t.getUiOptions(i),w=N.widget,I=void 0===w?"select":w,B=D(N,x),U=t.getWidget(r,I,F);return m.default.createElement(U,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:y,options:b({},B,{enumOptions:A}),schema:r,uiSchema:i,registry:E,value:o,disabled:s,readonly:u,required:h,label:T,placeholder:v,formContext:O,autofocus:f,rawErrors:S})},n.renderFiles=function(){var e=this.props,r=e.schema,a=e.uiSchema,i=e.idSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,f=void 0!==c&&c,p=e.onBlur,h=e.onFocus,v=e.registry,g=e.formData,y=void 0===g?[]:g,E=e.rawErrors,S=r.title||e.name,b=v.widgets,C=v.formContext,F=t.getUiOptions(a),O=F.widget,x=void 0===O?"files":O,T=D(F,k),A=t.getWidget(r,x,b);return m.default.createElement(A,{options:T,id:i.$id,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:h,schema:r,uiSchema:a,title:S,value:y,disabled:o,readonly:s,required:f,registry:v,formContext:C,autofocus:u,rawErrors:E,label:""})},n.renderFixedArray=function(){var e=this,r=this.props,a=r.schema,i=r.uiSchema,n=void 0===i?{}:i,o=r.formData,l=void 0===o?[]:o,s=r.errorSchema,d=r.idPrefix,u=r.idSeparator,c=void 0===u?"_":u,f=r.idSchema,p=r.name,h=r.disabled,g=void 0!==h&&h,y=r.readonly,E=void 0!==y&&y,S=r.autofocus,C=void 0!==S&&S,F=r.required,D=void 0!==F&&F,O=r.registry,x=r.onBlur,k=r.onFocus,T=r.rawErrors,A=this.state.keyedFormData,N=this.props.formData,w=void 0===N?[]:N,I=a.title||p,B=t.getUiOptions(n),U=O.schemaUtils,q=O.formContext,P=(v.default(a.items)?a.items:[]).map((function(e,t){return U.retrieveSchema(e,l[t])})),R=v.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,l):null;(!w||w.length<P.length)&&(w=(w=w||[]).concat(new Array(P.length-w.length)));var _=this.canAddItem(w)&&!!R,V={canAdd:_,className:"field field-array field-array-fixed-items",disabled:g,idSchema:f,formData:l,items:A.map((function(t,r){var i=t.key,o=t.item,l=r>=P.length,u=l&&v.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,o):P[r],m=U.toIdSchema(u,f.$id+c+r,o,d,c),h=l?n.additionalItems||{}:Array.isArray(n.items)?n.items[r]:n.items||{};return e.renderArrayFieldItem({key:i,index:r,name:p&&p+"-"+r,canAdd:_,canRemove:l,canMoveUp:r>=P.length+1,canMoveDown:l&&r<w.length-1,itemSchema:u,itemData:o,itemUiSchema:h,itemIdSchema:m,itemErrorSchema:s?s[r]:void 0,autofocus:C&&0===r,onBlur:x,onFocus:k,rawErrors:T,totalItems:A.length})})),onAddClick:this.onAddClick,readonly:E,required:D,registry:O,schema:a,uiSchema:n,title:I,formContext:q,rawErrors:T},j=t.getTemplate("ArrayFieldTemplate",O,B);return m.default.createElement(j,b({},V))},n.renderArrayFieldItem=function(e){var r=e.key,a=e.index,i=e.name,n=e.canAdd,o=e.canRemove,l=void 0===o||o,s=e.canMoveUp,d=void 0===s||s,u=e.canMoveDown,c=void 0===u||u,f=e.itemSchema,p=e.itemData,h=e.itemUiSchema,v=e.itemIdSchema,g=e.itemErrorSchema,y=e.autofocus,E=e.onBlur,S=e.onFocus,b=e.rawErrors,C=e.totalItems,F=this.props,D=F.disabled,O=F.hideError,x=F.idPrefix,k=F.idSeparator,T=F.readonly,A=F.registry,N=F.formContext,w=A.fields,I=w.ArraySchemaField||w.SchemaField,B=t.getUiOptions(F.uiSchema),U=B.orderable,q=void 0===U||U,P=B.removable,R={moveUp:q&&d,moveDown:q&&c,remove:(void 0===P||P)&&l,toolbar:!1};return R.toolbar=Object.keys(R).some((function(e){return R[e]})),{children:m.default.createElement(I,{name:i,index:a,schema:f,uiSchema:h,formData:p,formContext:N,errorSchema:g,idPrefix:x,idSeparator:k,idSchema:v,required:this.isItemRequired(f),onChange:this.onChangeForIndex(a),onBlur:E,onFocus:S,registry:A,disabled:D,readonly:T,hideError:O,autofocus:y,rawErrors:b}),className:"array-item",disabled:D,canAdd:n,hasToolbar:R.toolbar,hasMoveUp:R.moveUp,hasMoveDown:R.moveDown,hasRemove:R.remove,index:a,totalItems:C,key:r,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:T,registry:A,schema:f,uiSchema:h}},a=r,(i=[{key:"itemTitle",get:function(){var e=this.props.schema;return f.default(e,[t.ITEMS_KEY,"title"],f.default(e,[t.ITEMS_KEY,"description"],"Item"))}}])&&function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(a.prototype,i),Object.defineProperty(a,"prototype",{writable:!1}),r}(e.Component),I=["widget"];function B(e){var r,a=e.schema,i=e.name,n=e.uiSchema,o=e.idSchema,l=e.formData,s=e.registry,d=e.required,u=e.disabled,c=e.readonly,f=e.autofocus,p=e.onChange,h=e.onFocus,g=e.onBlur,y=e.rawErrors,E=a.title,S=s.widgets,C=s.formContext,F=t.getUiOptions(n),O=F.widget,x=void 0===O?"checkbox":O,k=D(F,I),T=t.getWidget(a,x,S);if(Array.isArray(a.oneOf))r=t.optionsList({oneOf:a.oneOf.map((function(e){if(v.default(e))return b({},e,{title:e.title||(!0===e.const?"Yes":"No")})})).filter((function(e){return e}))});else{var A,N=a,w=null!=(A=a.enum)?A:[!0,!1];r=!N.enumNames&&2===w.length&&w.every((function(e){return"boolean"==typeof e}))?[{value:w[0],label:w[0]?"Yes":"No"},{value:w[1],label:w[1]?"Yes":"No"}]:t.optionsList({enum:w,enumNames:N.enumNames})}return m.default.createElement(T,{options:b({},k,{enumOptions:r}),schema:a,uiSchema:n,id:o.$id,onChange:p,onFocus:h,onBlur:g,label:void 0===E?i:E,value:l,required:d,disabled:u,readonly:c,registry:s,formContext:C,autofocus:f,rawErrors:y})}var U=["widget","placeholder","autofocus","autocomplete","title"],q=function(e){function r(t){var r;(r=e.call(this,t)||this).onOptionChange=function(e){var t=r.state,a=t.selectedOption,i=t.retrievedOptions,n=r.props,o=n.formData,l=n.onChange,s=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=s.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=s.getDefaultFormState(u,c,"excludeObjectChildren")),l(c,void 0,r.getFieldId()),r.setState({selectedOption:d})}};var a=r.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return r.state={retrievedOptions:o,selectedOption:r.getMatchingOption(0,i,o)},r}C(r,e);var a=r.prototype;return a.componentDidUpdate=function(e,r){var a=this.props,i=a.formData,n=a.options,o=a.idSchema,l=this.state.selectedOption,s=this.state;if(!t.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;s={selectedOption:l,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!t.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=s.retrievedOptions,c=this.getMatchingOption(l,i,u);r&&c!==l&&(s={selectedOption:c,retrievedOptions:u})}s!==this.state&&this.setState(s)},a.getMatchingOption=function(e,t,r){var a=this.props.registry.schemaUtils.getClosestMatchingOption(t,r,e);return a>0?a:e||0},a.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},a.render=function(){var e,r=this.props,a=r.baseType,i=r.disabled,n=void 0!==i&&i,o=r.errorSchema,l=void 0===o?{}:o,s=r.formContext,d=r.onBlur,u=r.onFocus,c=r.registry,h=r.schema,v=c.widgets,g=c.fields.SchemaField,E=this.state,S=E.selectedOption,C=E.retrievedOptions,F=t.getUiOptions(r.uiSchema),O=F.widget,x=void 0===O?"select":O,k=F.placeholder,T=F.autofocus,A=F.autocomplete,N=F.title,w=void 0===N?h.title:N,I=D(F,U),B=t.getWidget({type:"number"},x,v),q=f.default(l,t.ERRORS_KEY,[]),P=y.default(l,[t.ERRORS_KEY]),R=S>=0&&C[S]||null;R&&(e=R.type?R:Object.assign({},R,{type:a}));var _=w?w+" "+"Option".toLowerCase():"Option",V=C.map((function(e,t){return{label:e.title||_+" "+(t+1),value:t}}));return m.default.createElement("div",{className:"panel panel-default panel-body"},m.default.createElement("div",{className:"form-group"},m.default.createElement(B,{id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:d,onFocus:u,disabled:n||p.default(V),multiple:!1,rawErrors:q,errorSchema:P,value:S>=0?S:void 0,options:b({enumOptions:V},I),registry:c,formContext:s,placeholder:k,autocomplete:A,autofocus:T,label:""})),null!==R&&m.default.createElement(g,b({},this.props,{schema:e})))},r}(e.Component),P=/\.([0-9]*0)*$/,R=/[0.]0*$/;function _(r){var a=r.registry,i=r.onChange,n=r.formData,o=e.useState(r.value),l=o[0],s=o[1],d=a.fields.StringField,u=n,c=e.useCallback((function(e){s(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(P)?t.asNumber(e.replace(R,"")):t.asNumber(e);i(r)}),[i]);if("string"==typeof l&&"number"==typeof u){var f=new RegExp((""+u).replace(".","\\.")+"\\.?0*$");l.match(f)&&(u=l)}return m.default.createElement(d,b({},r,{formData:u,onChange:c}))}var V=function(e){function r(){for(var r,a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(r=e.call.apply(e,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},r.onPropertyChange=function(e,t){return void 0===t&&(t=!1),function(a,i,n){var o,l,s=r.props,d=s.errorSchema;void 0===a&&t&&(a=""),(0,s.onChange)(b({},s.formData,((o={})[e]=a,o)),d&&d&&b({},d,((l={})[e]=i,l)),n)}},r.onDropPropertyClick=function(e){return function(t){t.preventDefault();var a=r.props,i=a.onChange,n=b({},a.formData);S.default(n,e),i(n)}},r.getAvailableKey=function(e,a){for(var i=t.getUiOptions(r.props.uiSchema).duplicateKeySuffixSeparator,n=void 0===i?"-":i,o=0,l=e;E.default(a,l);)l=""+e+n+ ++o;return l},r.onKeyChange=function(e){return function(t,a){var i,n;if(e!==t){var o=r.props,l=o.formData,s=o.onChange,d=o.errorSchema;t=r.getAvailableKey(t,l);var u=b({},l),c=((i={})[e]=t,i),m=Object.keys(u).map((function(e){var t;return(t={})[c[e]||e]=u[e],t})),f=Object.assign.apply(Object,[{}].concat(m));r.setState({wasPropertyKeyModified:!0}),s(f,d&&d&&b({},d,((n={})[t]=a,n)))}}},r.handleAddClick=function(e){return function(){if(e.additionalProperties){var a=r.props,i=a.formData,n=a.onChange,o=a.registry,l=b({},i),s=void 0;if(v.default(e.additionalProperties)){s=e.additionalProperties.type;var d=e.additionalProperties;t.REF_KEY in d&&(s=(d=o.schemaUtils.retrieveSchema({$ref:d[t.REF_KEY]},i)).type),s||!(t.ANY_OF_KEY in d)&&!(t.ONE_OF_KEY in d)||(s="object")}var u=r.getAvailableKey("newKey",l);g.default(l,u,r.getDefaultValue(s)),n(l)}}},r}C(r,e);var a=r.prototype;return a.isRequired=function(e){var t=this.props.schema;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)},a.getDefaultValue=function(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}},a.render=function(){var e,r=this,a=this.props,i=a.uiSchema,n=void 0===i?{}:i,o=a.formData,l=a.errorSchema,s=a.idSchema,d=a.name,u=a.required,c=void 0!==u&&u,p=a.disabled,h=void 0!==p&&p,v=a.readonly,g=void 0!==v&&v,y=a.hideError,S=a.idPrefix,C=a.idSeparator,F=a.onBlur,D=a.onFocus,O=a.registry,x=O.formContext,k=O.fields.SchemaField,T=O.schemaUtils.retrieveSchema(a.schema,o),A=t.getUiOptions(n),N=T.properties,w=void 0===N?{}:N,I=void 0===T.title?d:T.title,B=A.description||T.description;try{var U=Object.keys(w);e=t.orderProperties(U,A.order)}catch(e){return m.default.createElement("div",null,m.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",d||"root"," object field configuration:",m.default.createElement("em",null,e.message),"."),m.default.createElement("pre",null,JSON.stringify(T)))}var q=t.getTemplate("ObjectFieldTemplate",O,A),P={title:A.title||I,description:B,properties:e.map((function(e){var a=E.default(T,[t.PROPERTIES_KEY,e,t.ADDITIONAL_PROPERTY_FLAG]),i=a?n.additionalProperties:n[e],d="hidden"===t.getUiOptions(i).widget,u=f.default(s,[e],{});return{content:m.default.createElement(k,{key:e,name:e,required:r.isRequired(e),schema:f.default(T,[t.PROPERTIES_KEY,e],{}),uiSchema:i,errorSchema:f.default(l,e),idSchema:u,idPrefix:S,idSeparator:C,formData:f.default(o,e),formContext:x,wasPropertyKeyModified:r.state.wasPropertyKeyModified,onKeyChange:r.onKeyChange(e),onChange:r.onPropertyChange(e,a),onBlur:F,onFocus:D,registry:O,disabled:h,readonly:g,hideError:y,onDropPropertyClick:r.onDropPropertyClick}),name:e,readonly:g,disabled:h,required:c,hidden:d}})),readonly:g,disabled:h,required:c,idSchema:s,uiSchema:n,schema:T,formData:o,formContext:x,registry:O};return m.default.createElement(q,b({},P,{onAddClick:this.handleAddClick}))},r}(e.Component),j=["__errors"],K={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function M(e){var r=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=e.errorSchema,l=e.idPrefix,s=e.idSeparator,d=e.name,u=e.onChange,c=e.onKeyChange,f=e.onDropPropertyClick,p=e.required,h=e.registry,g=e.wasPropertyKeyModified,E=void 0!==g&&g,S=h.formContext,C=h.schemaUtils,F=t.getUiOptions(i),O=t.getTemplate("FieldTemplate",h,F),x=t.getTemplate("DescriptionFieldTemplate",h,F),k=t.getTemplate("FieldHelpTemplate",h,F),T=t.getTemplate("FieldErrorTemplate",h,F),A=C.retrieveSchema(r,n),N=a[t.ID_KEY],w=t.mergeObjects(C.toIdSchema(A,N,n,l,s),a),I=m.default.useCallback((function(e,t,r){return u(e,t,r||N)}),[N,u]),B=function(e,r,a,i){var n=r.field,o=i.fields;if("function"==typeof n)return n;if("string"==typeof n&&n in o)return o[n];var l=t.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=K[s];return d||!e.anyOf&&!e.oneOf?d in o?o[d]:function(){var n=t.getTemplate("UnsupportedFieldTemplate",i,r);return m.default.createElement(n,{schema:e,idSchema:a,reason:"Unknown field type "+e.type,registry:i})}:function(){return null}}(A,F,w,h),U=Boolean(e.disabled||F.disabled),q=Boolean(e.readonly||F.readonly||e.schema.readOnly||A.readOnly),P=F.hideError,R=void 0===P?e.hideError:Boolean(P),_=Boolean(e.autofocus||F.autofocus);if(0===Object.keys(A).length)return null;var V=C.getDisplayLabel(A,i),M=o||{},W=M.__errors,L=D(M,j),Y=y.default(i,["ui:classNames","classNames","ui:style"]);t.UI_OPTIONS_KEY in Y&&(Y[t.UI_OPTIONS_KEY]=y.default(Y[t.UI_OPTIONS_KEY],["classNames","style"]));var $,z=m.default.createElement(B,b({},e,{onChange:I,idSchema:w,schema:A,uiSchema:Y,disabled:U,readonly:q,hideError:R,autofocus:_,errorSchema:L,formContext:S,rawErrors:W})),H=w[t.ID_KEY];$=E||t.ADDITIONAL_PROPERTY_FLAG in A?d:F.title||e.schema.title||A.title||d;var J=F.description||e.schema.description||A.description||"",G=F.help,Q="hidden"===F.widget,X=["form-group","field","field-"+A.type];!R&&W&&W.length>0&&X.push("field-error has-error has-danger"),null!=i&&i.classNames&&X.push(i.classNames),F.classNames&&X.push(F.classNames);var Z=m.default.createElement(k,{help:G,idSchema:w,schema:A,uiSchema:i,hasErrors:!R&&W&&W.length>0,registry:h}),ee=R?void 0:m.default.createElement(T,{errors:W,errorSchema:o,idSchema:w,schema:A,uiSchema:i,registry:h}),te={description:m.default.createElement(x,{id:t.descriptionId(H),description:J,schema:A,uiSchema:i,registry:h}),rawDescription:J,help:Z,rawHelp:"string"==typeof G?G:void 0,errors:ee,rawErrors:R?void 0:W,id:H,label:$,hidden:Q,onChange:u,onKeyChange:c,onDropPropertyClick:f,required:p,disabled:U,readonly:q,hideError:R,displayLabel:V,classNames:X.join(" ").trim(),style:F.style,formContext:S,formData:n,schema:A,uiSchema:i,registry:h},re=h.fields.AnyOfField,ae=h.fields.OneOfField,ie=(null==i?void 0:i["ui:field"])&&!0===(null==i?void 0:i["ui:fieldReplacesAnyOrOneOf"]);return m.default.createElement(O,b({},te),m.default.createElement(m.default.Fragment,null,z,A.anyOf&&!ie&&!C.isSelect(A)&&m.default.createElement(re,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:S,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.anyOf.map((function(e){return C.retrieveSchema(v.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i}),A.oneOf&&!ie&&!C.isSelect(A)&&m.default.createElement(ae,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:S,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.oneOf.map((function(e){return C.retrieveSchema(v.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i})))}var W=function(e){function r(){return e.apply(this,arguments)||this}C(r,e);var a=r.prototype;return a.shouldComponentUpdate=function(e){return!t.deepEquals(this.props,e)},a.render=function(){return m.default.createElement(M,b({},this.props))},r}(m.default.Component),L=["widget","placeholder"];function Y(e){var r=e.schema,a=e.name,i=e.uiSchema,n=e.idSchema,o=e.formData,l=e.required,s=e.disabled,d=void 0!==s&&s,u=e.readonly,c=void 0!==u&&u,f=e.autofocus,p=void 0!==f&&f,h=e.onChange,v=e.onBlur,g=e.onFocus,y=e.registry,E=e.rawErrors,S=r.title,C=r.format,F=y.widgets,O=y.formContext,x=y.schemaUtils.isSelect(r)?t.optionsList(r):void 0,k=x?"select":"text";C&&t.hasWidget(r,C,F)&&(k=C);var T=t.getUiOptions(i),A=T.widget,N=void 0===A?k:A,w=T.placeholder,I=void 0===w?"":w,B=D(T,L),U=t.getWidget(r,N,F);return m.default.createElement(U,{options:b({},B,{enumOptions:x}),schema:r,uiSchema:i,id:n.$id,label:void 0===S?a:S,value:o,onChange:h,onBlur:v,onFocus:g,required:l,disabled:d,readonly:c,formContext:O,autofocus:p,registry:y,placeholder:I,rawErrors:E})}function $(t){var r=t.formData,a=t.onChange;return e.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function z(e){var r=e.idSchema,a=e.description,i=e.registry,n=e.schema,o=e.uiSchema,l=t.getUiOptions(o),s=l.label;if(!a||void 0!==s&&!s)return null;var d=t.getTemplate("DescriptionFieldTemplate",i,l);return m.default.createElement(d,{id:t.descriptionId(r),description:a,schema:n,uiSchema:o,registry:i})}function H(e){var t=e.disabled,r=e.hasToolbar,a=e.hasMoveDown,i=e.hasMoveUp,n=e.hasRemove,o=e.index,l=e.onDropIndexClick,s=e.onReorderClick,d=e.readonly,u=e.registry,c=e.uiSchema,f=u.templates.ButtonTemplates,p=f.MoveDownButton,h=f.MoveUpButton,v=f.RemoveButton,g={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return m.default.createElement("div",{className:e.className},m.default.createElement("div",{className:r?"col-xs-9":"col-xs-12"},e.children),r&&m.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},m.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(i||a)&&m.default.createElement(h,{style:g,disabled:t||d||!i,onClick:s(o,o-1),uiSchema:c,registry:u}),(i||a)&&m.default.createElement(p,{style:g,disabled:t||d||!a,onClick:s(o,o+1),uiSchema:c,registry:u}),n&&m.default.createElement(v,{style:g,disabled:t||d,onClick:l(o),uiSchema:c,registry:u}))))}var J=["key"];function G(e){var r=e.canAdd,a=e.className,i=e.disabled,n=e.idSchema,o=e.uiSchema,l=e.items,s=e.onAddClick,d=e.readonly,u=e.registry,c=e.required,f=e.schema,p=e.title,h=t.getUiOptions(o),v=t.getTemplate("ArrayFieldDescriptionTemplate",u,h),g=t.getTemplate("ArrayFieldItemTemplate",u,h),y=t.getTemplate("ArrayFieldTitleTemplate",u,h),E=u.templates.ButtonTemplates.AddButton;return m.default.createElement("fieldset",{className:a,id:n.$id},m.default.createElement(y,{idSchema:n,title:h.title||p,required:c,schema:f,uiSchema:o,registry:u}),m.default.createElement(v,{idSchema:n,description:h.description||f.description,schema:f,uiSchema:o,registry:u}),m.default.createElement("div",{className:"row array-item-list"},l&&l.map((function(e){var t=e.key,r=D(e,J);return m.default.createElement(g,b({key:t},r))}))),r&&m.default.createElement(E,{className:"array-item-add",onClick:s,disabled:i||d,uiSchema:o,registry:u}))}function Q(e){var r=e.idSchema,a=e.title,i=e.schema,n=e.uiSchema,o=e.required,l=e.registry,s=t.getUiOptions(n),d=s.label;if(!a||void 0!==d&&!d)return null;var u=t.getTemplate("TitleFieldTemplate",l,s);return m.default.createElement(u,{id:t.titleId(r),title:a,required:o,schema:i,uiSchema:n,registry:l})}var X=["id","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","options","schema","uiSchema","formContext","registry","rawErrors","type"];function Z(r){var a=r.id,i=r.value,n=r.readonly,o=r.disabled,l=r.autofocus,s=r.onBlur,d=r.onFocus,u=r.onChange,c=r.options,f=r.schema,p=r.type,h=D(r,X);if(!a)throw console.log("No id for",r),new Error("no id for props "+JSON.stringify(r));var v,g=b({},h,t.getInputProps(f,p,c));v="number"===g.type||"integer"===g.type?i||0===i?i:"":null==i?"":i;var y=e.useCallback((function(e){var t=e.target.value;return u(""===t?c.emptyValue:t)}),[u,c]),E=e.useCallback((function(e){return s(a,e.target.value)}),[s,a]),S=e.useCallback((function(e){return d(a,e.target.value)}),[d,a]);return m.default.createElement(m.default.Fragment,null,m.default.createElement("input",b({id:a,name:a,className:"form-control",readOnly:n,disabled:o,autoFocus:l,value:v},g,{list:f.examples?t.examplesId(a):void 0,onChange:y,onBlur:E,onFocus:S,"aria-describedby":t.ariaDescribedByIds(a,!!f.examples)})),Array.isArray(f.examples)&&m.default.createElement("datalist",{key:"datalist_"+a,id:t.examplesId(a)},f.examples.concat(f.default&&!f.examples.includes(f.default)?[f.default]:[]).map((function(e){return m.default.createElement("option",{key:e,value:e})}))))}function ee(e){var r=t.getSubmitButtonOptions(e.uiSchema),a=r.submitText,i=r.props,n=void 0===i?{}:i;return r.norender?null:m.default.createElement("div",null,m.default.createElement("button",b({type:"submit"},n,{className:"btn btn-info "+n.className}),a))}var te=["iconType","icon","className","uiSchema","registry"];function re(e){var t=e.iconType,r=void 0===t?"default":t,a=e.icon,i=e.className,n=D(e,te);return m.default.createElement("button",b({type:"button",className:"btn btn-"+r+" "+i},n),m.default.createElement("i",{className:"glyphicon glyphicon-"+a}))}function ae(e){return m.default.createElement(re,b({title:"Move down",className:"array-item-move-down"},e,{icon:"arrow-down"}))}function ie(e){return m.default.createElement(re,b({title:"Move up",className:"array-item-move-up"},e,{icon:"arrow-up"}))}function ne(e){return m.default.createElement(re,b({title:"Remove",className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function oe(e){return m.default.createElement("div",{className:"row"},m.default.createElement("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className},m.default.createElement(re,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:e.onClick,disabled:e.disabled,registry:e.registry})))}function le(e){var t=e.description;return t?m.default.createElement("string"==typeof t?"p":"div",{id:e.id,className:"field-description"},t):null}function se(e){var t=e.errors;return m.default.createElement("div",{className:"panel panel-danger errors"},m.default.createElement("div",{className:"panel-heading"},m.default.createElement("h3",{className:"panel-title"},"Errors")),m.default.createElement("ul",{className:"list-group"},t.map((function(e,t){return m.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)}))))}function de(e){var t=e.label;return t?m.default.createElement("label",{className:"control-label",htmlFor:e.id},t,e.required&&m.default.createElement("span",{className:"required"},"*")):null}function ue(e){var r=e.id,a=e.label,i=e.children,n=e.errors,o=e.help,l=e.description,s=e.hidden,d=e.required,u=e.displayLabel,c=e.registry,f=t.getUiOptions(e.uiSchema),p=t.getTemplate("WrapIfAdditionalTemplate",c,f);return s?m.default.createElement("div",{className:"hidden"},i):m.default.createElement(p,b({},e),u&&m.default.createElement(de,{label:a,required:d,id:r}),u&&l?l:null,i,n,o)}function ce(e){var r=e.errors,a=void 0===r?[]:r;if(0===a.length)return null;var i=t.errorId(e.idSchema);return m.default.createElement("div",null,m.default.createElement("ul",{id:i,className:"error-detail bs-callout bs-callout-info"},a.filter((function(e){return!!e})).map((function(e,t){return m.default.createElement("li",{className:"text-danger",key:t},e)}))))}function me(e){var r=e.help;if(!r)return null;var a=t.helpId(e.idSchema);return m.default.createElement("string"==typeof r?"p":"div",{id:a,className:"help-block"},r)}function fe(e){var r=e.description,a=e.disabled,i=e.formData,n=e.idSchema,o=e.onAddClick,l=e.properties,s=e.readonly,d=e.registry,u=e.required,c=e.schema,f=e.title,p=e.uiSchema,h=t.getUiOptions(p),v=t.getTemplate("TitleFieldTemplate",d,h),g=t.getTemplate("DescriptionFieldTemplate",d,h),y=d.templates.ButtonTemplates.AddButton;return m.default.createElement("fieldset",{id:n.$id},(h.title||f)&&m.default.createElement(v,{id:t.titleId(n),title:h.title||f,required:u,schema:c,uiSchema:p,registry:d}),(h.description||r)&&m.default.createElement(g,{id:t.descriptionId(n),description:h.description||r,schema:c,uiSchema:p,registry:d}),l.map((function(e){return e.content})),t.canExpand(c,p,i)&&m.default.createElement(y,{className:"object-property-expand",onClick:o(c),disabled:a||s,uiSchema:p,registry:d}))}function pe(e){return m.default.createElement("legend",{id:e.id},e.title,e.required&&m.default.createElement("span",{className:"required"},"*"))}function he(e){var t=e.schema,r=e.idSchema,a=e.reason;return m.default.createElement("div",{className:"unsupported-field"},m.default.createElement("p",null,"Unsupported field schema",r&&r.$id&&m.default.createElement("span",null," for"," field ",m.default.createElement("code",null,r.$id)),a&&m.default.createElement("em",null,": ",a),"."),t&&m.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ve(e){var r=e.id,a=e.disabled,i=e.label,n=e.onKeyChange,o=e.onDropPropertyClick,l=e.readonly,s=e.children,d=e.uiSchema,u=e.registry,c=u.templates.ButtonTemplates.RemoveButton;return m.default.createElement("div",{className:e.classNames,style:e.style},t.ADDITIONAL_PROPERTY_FLAG in e.schema?m.default.createElement("div",{className:"row"},m.default.createElement("div",{className:"col-xs-5 form-additional"},m.default.createElement("div",{className:"form-group"},m.default.createElement(de,{label:i+" Key",required:e.required,id:r+"-key"}),m.default.createElement("input",{className:"form-control",type:"text",id:r+"-key",onBlur:function(e){return n(e.target.value)},defaultValue:i}))),m.default.createElement("div",{className:"form-additional form-group col-xs-5"},s),m.default.createElement("div",{className:"col-xs-2"},m.default.createElement(c,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||l,onClick:o(i),uiSchema:d,registry:u}))):s)}function ge(e,r){for(var a=[],i=e;i<=r;i++)a.push({value:i,label:t.pad(i,2)});return a}function ye(e){var r=e.type,a=e.range,i=e.value,n=e.select,o=e.rootId,l=e.disabled,s=e.readonly,d=e.autofocus,u=e.registry,c=e.onBlur,f=e.onFocus;return m.default.createElement(u.widgets.SelectWidget,{schema:{type:"integer"},id:o+"_"+r,className:"form-control",options:{enumOptions:ge(a[0],a[1])},placeholder:r,value:i,disabled:l,readonly:s,autofocus:d,onChange:function(e){return n(r,e)},onBlur:c,onFocus:f,registry:u,label:"","aria-describedby":t.ariaDescribedByIds(o)})}function Ee(r){var a=r.time,i=void 0!==a&&a,n=r.disabled,o=void 0!==n&&n,l=r.readonly,s=void 0!==l&&l,d=r.autofocus,u=void 0!==d&&d,c=r.options,f=r.id,p=r.registry,h=r.onBlur,v=r.onFocus,g=r.onChange,y=r.value,E=e.useReducer((function(e,t){return b({},e,t)}),t.parseDateString(y,i)),S=E[0],C=E[1];e.useEffect((function(){y&&y!==t.toDateString(S,i)&&C(t.parseDateString(y,i))}),[y,S,i]),e.useEffect((function(){(function(e){return Object.values(e).every((function(e){return-1!==e}))})(S)&&g(t.toDateString(S,i))}),[S,i,g]);var F=e.useCallback((function(e,t){var r;C(((r={})[e]=t,r))}),[]),D=e.useCallback((function(e){if(e.preventDefault(),!o&&!s){var r=t.parseDateString((new Date).toJSON(),i);C(r)}}),[o,s,i]),O=e.useCallback((function(e){e.preventDefault(),o||s||(C(t.parseDateString("",i)),g(void 0))}),[o,s,i,g]);return m.default.createElement("ul",{className:"list-inline"},function(e,t,r){void 0===r&&(r=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:r,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return t&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}(S,i,c.yearsRange).map((function(e,t){return m.default.createElement("li",{key:t},m.default.createElement(ye,b({rootId:f,select:F},e,{disabled:o,readonly:s,registry:p,onBlur:h,onFocus:v,autofocus:u&&0===t})))})),("undefined"===c.hideNowButton||!c.hideNowButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:D},"Now")),("undefined"===c.hideClearButton||!c.hideClearButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:O},"Clear")))}var Se=["time"];function be(e){var t=e.time,r=void 0===t||t,a=D(e,Se);return m.default.createElement(a.registry.widgets.AltDateWidget,b({time:r},a))}function Ce(r){var a=r.schema,i=r.uiSchema,n=r.id,o=r.value,l=r.disabled,s=r.readonly,d=r.label,u=r.autofocus,c=void 0!==u&&u,f=r.onBlur,p=r.onFocus,h=r.onChange,v=r.registry,g=t.getTemplate("DescriptionFieldTemplate",v,r.options),y=t.schemaRequiresTrueValue(a),E=e.useCallback((function(e){return h(e.target.checked)}),[h]),S=e.useCallback((function(e){return f(n,e.target.checked)}),[f,n]),b=e.useCallback((function(e){return p(n,e.target.checked)}),[p,n]);return m.default.createElement("div",{className:"checkbox "+(l||s?"disabled":"")},a.description&&m.default.createElement(g,{id:t.descriptionId(n),description:a.description,schema:a,uiSchema:i,registry:v}),m.default.createElement("label",null,m.default.createElement("input",{type:"checkbox",id:n,name:n,checked:void 0!==o&&o,required:y,disabled:l||s,autoFocus:c,onChange:E,onBlur:S,onFocus:b,"aria-describedby":t.ariaDescribedByIds(n)}),m.default.createElement("span",null,d)))}function Fe(r){var a=r.id,i=r.disabled,n=r.options,o=n.inline,l=void 0!==o&&o,s=n.enumOptions,d=n.enumDisabled,u=n.emptyValue,c=r.value,f=r.autofocus,p=void 0!==f&&f,h=r.readonly,v=r.onChange,g=r.onBlur,y=r.onFocus,E=Array.isArray(c)?c:[c],S=e.useCallback((function(e){return g(a,t.enumOptionsValueForIndex(e.target.value,s,u))}),[g,a]),b=e.useCallback((function(e){return y(a,t.enumOptionsValueForIndex(e.target.value,s,u))}),[y,a]);return m.default.createElement("div",{className:"checkboxes",id:a},Array.isArray(s)&&s.map((function(e,r){var n=t.enumOptionsIsSelected(e.value,E),o=Array.isArray(d)&&-1!==d.indexOf(e.value),u=i||o||h?"disabled":"",c=m.default.createElement("span",null,m.default.createElement("input",{type:"checkbox",id:t.optionId(a,r),name:a,checked:n,value:String(r),disabled:i||o||h,autoFocus:p&&0===r,onChange:function(e){v(e.target.checked?t.enumOptionsSelectValue(r,E,s):t.enumOptionsDeselectValue(r,E,s))},onBlur:S,onFocus:b,"aria-describedby":t.ariaDescribedByIds(a)}),m.default.createElement("span",null,e.label));return l?m.default.createElement("label",{key:r,className:"checkbox-inline "+u},c):m.default.createElement("div",{key:r,className:"checkbox "+u},m.default.createElement("label",null,c))})))}function De(e){var r=e.disabled,a=e.readonly,i=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(i,b({type:"color"},e,{disabled:r||a}))}function Oe(r){var a=r.onChange,i=t.getTemplate("BaseInputTemplate",r.registry,r.options),n=e.useCallback((function(e){return a(e||void 0)}),[a]);return m.default.createElement(i,b({type:"date"},r,{onChange:n}))}function xe(e){var r=e.onChange,a=e.value,i=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(i,b({type:"datetime-local"},e,{value:t.utcToLocal(a),onChange:function(e){return r(t.localToUTC(e))}}))}function ke(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"email"},e))}function Te(e,t){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(t)+";base64")}function Ae(e){var t=e.name,r=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:Te(e.target.result,t),name:t,size:r,type:a}):i({dataURL:null,name:t,size:r,type:a})},o.readAsDataURL(e)}))}function Ne(e){var t=e.filesInfo;return 0===t.length?null:m.default.createElement("ul",{className:"file-info"},t.map((function(e,t){var r=e.size,a=e.type;return m.default.createElement("li",{key:t},m.default.createElement("strong",null,e.name)," (",a,", ",r," bytes)")})))}function we(e){return e.filter((function(e){return void 0!==e})).map((function(e){var r=t.dataURItoBlob(e),a=r.blob;return{name:r.name,size:a.size,type:a.type}}))}function Ie(r){var a=r.multiple,i=r.id,n=r.readonly,o=r.disabled,l=r.onChange,s=r.value,d=r.autofocus,u=void 0!==d&&d,c=r.options,f=e.useMemo((function(){return Array.isArray(s)?we(s):we([s])}),[s]),p=e.useState(f),h=p[0],v=p[1],g=e.useCallback((function(e){var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(Ae))).then((function(e){v(e);var t=e.map((function(e){return e.dataURL}));l(a?t:t[0])}))}),[a,l]);return m.default.createElement("div",null,m.default.createElement("p",null,m.default.createElement("input",{id:i,name:i,type:"file",disabled:n||o,onChange:g,defaultValue:"",autoFocus:u,multiple:a,accept:c.accept?String(c.accept):void 0,"aria-describedby":t.ariaDescribedByIds(i)})),m.default.createElement(Ne,{filesInfo:h}))}function Be(e){var t=e.id,r=e.value;return m.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===r?"":r})}function Ue(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"password"},e))}function qe(r){var a=r.options,i=r.value,n=r.required,o=r.disabled,l=r.readonly,s=r.autofocus,d=void 0!==s&&s,u=r.onBlur,c=r.onFocus,f=r.onChange,p=r.id,h=Math.random().toString(),v=a.enumOptions,g=a.enumDisabled,y=a.inline,E=a.emptyValue,S=e.useCallback((function(e){return u(p,t.enumOptionsValueForIndex(e.target.value,v,E))}),[u,p]),b=e.useCallback((function(e){return c(p,t.enumOptionsValueForIndex(e.target.value,v,E))}),[c,p]);return m.default.createElement("div",{className:"field-radio-group",id:p},Array.isArray(v)&&v.map((function(e,r){var a=t.enumOptionsIsSelected(e.value,i),s=Array.isArray(g)&&-1!==g.indexOf(e.value),u=o||s||l?"disabled":"",c=m.default.createElement("span",null,m.default.createElement("input",{type:"radio",id:t.optionId(p,r),checked:a,name:h,required:n,value:String(r),disabled:o||s||l,autoFocus:d&&0===r,onChange:function(){return f(e.value)},onBlur:S,onFocus:b,"aria-describedby":t.ariaDescribedByIds(p)}),m.default.createElement("span",null,e.label));return y?m.default.createElement("label",{key:r,className:"radio-inline "+u},c):m.default.createElement("div",{key:r,className:"radio "+u},m.default.createElement("label",null,c))})))}function Pe(e){var t=e.value;return m.default.createElement("div",{className:"field-range-wrapper"},m.default.createElement(e.registry.templates.BaseInputTemplate,b({type:"range"},e)),m.default.createElement("span",{className:"range-view"},t))}function Re(e,t){return t?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function _e(r){var a=r.schema,i=r.id,n=r.options,o=r.value,l=r.required,s=r.disabled,d=r.readonly,u=r.multiple,c=void 0!==u&&u,f=r.autofocus,p=void 0!==f&&f,h=r.onChange,v=r.onBlur,g=r.onFocus,y=r.placeholder,E=n.enumOptions,S=n.enumDisabled,b=n.emptyValue,C=c?[]:"",F=e.useCallback((function(e){var r=Re(e,c);return g(i,t.enumOptionsValueForIndex(r,E,b))}),[g,i,a,c,n]),D=e.useCallback((function(e){var r=Re(e,c);return v(i,t.enumOptionsValueForIndex(r,E,b))}),[v,i,a,c,n]),O=e.useCallback((function(e){var r=Re(e,c);return h(t.enumOptionsValueForIndex(r,E,b))}),[h,a,c,n]),x=t.enumOptionsIndexForValue(o,E,c);return m.default.createElement("select",{id:i,name:i,multiple:c,className:"form-control",value:void 0===x?C:x,required:l,disabled:s||d,autoFocus:p,onBlur:D,onFocus:F,onChange:O,"aria-describedby":t.ariaDescribedByIds(i)},!c&&void 0===a.default&&m.default.createElement("option",{value:""},y),Array.isArray(E)&&E.map((function(e,t){var r=e.label,a=S&&-1!==S.indexOf(e.value);return m.default.createElement("option",{key:t,value:String(t),disabled:a},r)})))}function Ve(r){var a=r.id,i=r.options,n=void 0===i?{}:i,o=r.placeholder,l=r.value,s=r.required,d=r.disabled,u=r.readonly,c=r.autofocus,f=void 0!==c&&c,p=r.onChange,h=r.onBlur,v=r.onFocus,g=e.useCallback((function(e){var t=e.target.value;return p(""===t?n.emptyValue:t)}),[p,n.emptyValue]),y=e.useCallback((function(e){return h(a,e.target.value)}),[h,a]),E=e.useCallback((function(e){return v(a,e.target.value)}),[a,v]);return m.default.createElement("textarea",{id:a,name:a,className:"form-control",value:l||"",placeholder:o,required:s,disabled:d,readOnly:u,autoFocus:f,rows:n.rows,onBlur:y,onFocus:E,onChange:g,"aria-describedby":t.ariaDescribedByIds(a)})}function je(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({},e))}function Ke(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"url"},e))}function Me(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"number"},e))}function We(){return{fields:{AnyOfField:q,ArrayField:w,BooleanField:B,NumberField:_,ObjectField:V,OneOfField:q,SchemaField:W,StringField:Y,NullField:$},templates:{ArrayFieldDescriptionTemplate:z,ArrayFieldItemTemplate:H,ArrayFieldTemplate:G,ArrayFieldTitleTemplate:Q,ButtonTemplates:{SubmitButton:ee,AddButton:oe,MoveDownButton:ae,MoveUpButton:ie,RemoveButton:ne},BaseInputTemplate:Z,DescriptionFieldTemplate:le,ErrorListTemplate:se,FieldTemplate:ue,FieldErrorTemplate:ce,FieldHelpTemplate:me,ObjectFieldTemplate:fe,TitleFieldTemplate:pe,UnsupportedFieldTemplate:he,WrapIfAdditionalTemplate:ve},widgets:{PasswordWidget:Ue,RadioWidget:qe,UpDownWidget:Me,RangeWidget:Pe,SelectWidget:_e,TextWidget:je,DateWidget:Oe,DateTimeWidget:xe,AltDateWidget:Ee,AltDateTimeWidget:be,EmailWidget:ke,URLWidget:Ke,TextareaWidget:Ve,HiddenWidget:Be,ColorWidget:De,FileWidget:Ie,CheckboxWidget:Ce,CheckboxesWidget:Fe},rootSchema:{},formContext:{}}}Ve.defaultProps={autofocus:!1,options:{}};var Le=function(e){function r(r){var a;if((a=e.call(this,r)||this).formElement=void 0,a.getUsedFormData=function(e,t){if(0===t.length&&"object"!=typeof e)return e;var r=h.default(e,t);return Array.isArray(e)?Object.keys(r).map((function(e){return r[e]})):r},a.getFieldNames=function(e,r){return function e(a,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var l=n.map((function(e){return[].concat(e,[o])}));a[o][t.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][t.NAME_KEY]?i.push(a[o][t.NAME_KEY]):e(a[o],i,l)}else o===t.NAME_KEY&&""!==a[o]&&n.forEach((function(e){var t=f.default(r,e);("object"!=typeof t||p.default(t))&&i.push(e)}))})),i}(e)},a.onChange=function(e,r,i){var n=a.props,o=n.extraErrors,l=n.omitExtraData,s=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=a.state,f=m.schemaUtils,p=m.schema;(t.isObject(e)||Array.isArray(e))&&(e=a.getStateFromProps(a.props,e).formData);var h=!d&&u,v={formData:e,schema:p},g=e;if(!0===l&&!0===s){var y=f.retrieveSchema(p,e),E=f.toPathSchema(y,"",e),S=a.getFieldNames(E,e);g=a.getUsedFormData(e,S),v={formData:g}}if(h){var C=a.validate(g),F=C.errors,D=C.errorSchema,O=F,x=D;if(o){var k=f.mergeValidationData(C,o);D=k.errorSchema,F=k.errors}v={formData:g,errors:F,errorSchema:D,schemaValidationErrors:O,schemaValidationErrorSchema:x}}else if(!d&&r){var T=o?t.mergeObjects(r,o,"preventDuplicates"):r;v={formData:g,errorSchema:T,errors:f.getValidator().toErrorList(T)}}a.setState(v,(function(){return c&&c(b({},a.state,v),i)}))},a.onBlur=function(e,t){var r=a.props.onBlur;r&&r(e,t)},a.onFocus=function(e,t){var r=a.props.onFocus;r&&r(e,t)},a.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var t=a.props,r=t.extraErrors,i=t.noValidate,n=t.onSubmit,o=a.state.formData,l=a.state,s=l.schemaUtils;if(!0===t.omitExtraData){var d=s.retrieveSchema(l.schema,o),u=s.toPathSchema(d,"",o),c=a.getFieldNames(u,o);o=a.getUsedFormData(o,c)}if(i||a.validateForm()){var m=r||{},f=r?s.getValidator().toErrorList(r):[];a.setState({formData:o,errors:f,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(b({},a.state,{formData:o,status:"submitted"}),e)}))}}},!r.validator)throw new Error("A validator is required for Form functionality to work");return a.state=a.getStateFromProps(r,r.formData),a.props.onChange&&!t.deepEquals(a.state.formData,a.props.formData)&&a.props.onChange(a.state),a.formElement=m.default.createRef(),a}C(r,e);var a=r.prototype;return a.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);t.deepEquals(r.formData,e.formData)||t.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},a.getStateFromProps=function(e,r){var a=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,l=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=i,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=t.createSchemaUtils(e.validator,s));var u,c,m=d.getDefaultFormState(i,r,"excludeObjectChildren"),f=d.retrieveSchema(i,m),p=a.schemaValidationErrors,h=a.schemaValidationErrorSchema;if(l){var v=this.validate(m,i,d);p=u=v.errors,h=c=v.errorSchema}else{var g=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=g.errors,c=g.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var E=d.toIdSchema(f,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:E,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:p,schemaValidationErrorSchema:h}},a.shouldComponentUpdate=function(e,r){return t.shouldRender(this,e,r)},a.validate=function(e,t,r){void 0===t&&(t=this.props.schema);var a=r||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,l=i.uiSchema,s=a.retrieveSchema(t,e);return a.getValidator().validateFormData(e,s,n,o,l)},a.renderErrors=function(e){var r=this.state,a=r.errors,i=r.errorSchema,n=r.schema,o=r.uiSchema,l=this.props.formContext,s=t.getUiOptions(o),d=t.getTemplate("ErrorListTemplate",e,s);return a&&a.length?m.default.createElement(d,{errors:a,errorSchema:i||{},schema:n,uiSchema:o,formContext:l}):null},a.getRegistry=function(){var e,t=this.state.schemaUtils,r=We(),a=r.templates,i=r.widgets,n=r.formContext;return{fields:b({},r.fields,this.props.fields),templates:b({},a,this.props.templates,{ButtonTemplates:b({},a.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:b({},i,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||n,schemaUtils:t}},a.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},a.validateForm=function(){var e=this.props,t=e.extraErrors,r=e.onError,a=this.state.schemaUtils,i=this.validate(this.state.formData),n=i.errors,o=i.errorSchema,l=n,s=o;if(n.length>0){if(t){var d=a.mergeValidationData(i,t);o=d.errorSchema,n=d.errors}return this.setState({errors:n,errorSchema:o,schemaValidationErrors:l,schemaValidationErrorSchema:s},(function(){r?r(n):console.error("Form validation failed",n)})),!1}return!0},a.render=function(){var e=this.props,t=e.children,r=e.id,a=e.idPrefix,i=e.idSeparator,n=e.className,o=void 0===n?"":n,l=e.tagName,s=e.name,d=e.method,u=e.target,c=e.action,f=e.autoComplete,p=e.enctype,h=e.acceptcharset,v=e.noHtml5Validate,g=void 0!==v&&v,y=e.disabled,E=void 0!==y&&y,S=e.readonly,b=void 0!==S&&S,C=e.formContext,F=e.showErrorList,D=void 0===F?"top":F,O=e._internalFormWrapper,x=this.state,k=x.schema,T=x.uiSchema,A=x.formData,N=x.errorSchema,w=x.idSchema,I=this.getRegistry(),B=I.fields.SchemaField,U=I.templates.ButtonTemplates.SubmitButton;return m.default.createElement(O||l||"form",{className:o||"rjsf",id:r,name:s,method:d,target:u,action:c,autoComplete:f,encType:p,acceptCharset:h,noValidate:g,onSubmit:this.onSubmit,as:O?l:void 0,ref:this.formElement},"top"===D&&this.renderErrors(I),m.default.createElement(B,{name:"",schema:k,uiSchema:T,errorSchema:N,idSchema:w,idPrefix:a,idSeparator:i,formContext:C,formData:A,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:I,disabled:E,readonly:b}),t||m.default.createElement(U,{uiSchema:T,registry:I}),"bottom"===D&&this.renderErrors(I))},r}(e.Component),Ye=["fields","widgets","templates"];exports.default=Le,exports.getDefaultRegistry=We,exports.withTheme=function(t){return e.forwardRef((function(e,r){var a,i,n=e.fields,o=e.widgets,l=e.templates,s=D(e,Ye);return n=b({},null==t?void 0:t.fields,n),o=b({},null==t?void 0:t.widgets,o),l=b({},null==t?void 0:t.templates,l,{ButtonTemplates:b({},null==t||null===(a=t.templates)||void 0===a?void 0:a.ButtonTemplates,null===(i=l)||void 0===i?void 0:i.ButtonTemplates)}),m.default.createElement(Le,b({},t,s,{fields:n,widgets:o,templates:l,ref:r}))}))};
//# sourceMappingURL=core.cjs.production.min.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@rjsf/utils"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("lodash-es/pick"),require("lodash-es/isObject"),require("lodash-es/set"),require("nanoid"),require("lodash-es/omit"),require("lodash-es/has"),require("lodash-es/unset")):"function"==typeof define&&define.amd?define(["exports","react","@rjsf/utils","lodash-es/get","lodash-es/isEmpty","lodash-es/pick","lodash-es/isObject","lodash-es/set","nanoid","lodash-es/omit","lodash-es/has","lodash-es/unset"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JSONSchemaForm={},e.React,e.utils,e.get,e.isEmpty,e._pick,e.isObject,e.set,e.nanoid,e.omit,e.has,e.unset)}(this,(function(e,t,r,a,i,n,o,l,s,d,u,c){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(t),p=m(a),h=m(i),v=m(n),y=m(o),g=m(l),E=m(d),b=m(u),S=m(c);function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)}function F(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,D(e,t)}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function O(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)t.indexOf(r=n[a])>=0||(i[r]=e[r]);return i}var k=["widget"],T=["widget"],x=["widget"];function A(){return s.nanoid()}function N(e){return Array.isArray(e)?e.map((function(e){return{key:A(),item:e}})):[]}function w(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var I=function(e){function t(t){var a;(a=e.call(this,t)||this)._getNewFormDataRow=function(){var e=a.props,t=e.schema,i=e.registry.schemaUtils,n=t.items;return r.isFixedItems(t)&&r.allowAdditionalItems(t)&&(n=t.additionalItems),i.getDefaultFormState(n)},a.onAddClick=function(e){a._handleAddClick(e)},a.onAddIndexClick=function(e){return function(t){a._handleAddClick(t,e)}},a.onDropIndexClick=function(e){return function(t){t&&t.preventDefault();var r,i=a.props,n=i.onChange,o=i.errorSchema,l=a.state.keyedFormData;if(o)for(var s in r={},o){var d=parseInt(s);d<e?g.default(r,[d],o[s]):d>e&&g.default(r,[d-1],o[s])}var u=l.filter((function(t,r){return r!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(w(u),r)}))}},a.onReorderClick=function(e,t){return function(r){r&&(r.preventDefault(),r.currentTarget.blur());var i,n=a.props,o=n.onChange,l=n.errorSchema;if(a.props.errorSchema)for(var s in i={},l){var d=parseInt(s);d==e?g.default(i,[t],l[e]):d==t?g.default(i,[e],l[t]):g.default(i,[s],l[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(t,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(w(m),i)}))}},a.onChangeForIndex=function(e){return function(t,r,i){var n,o=a.props,l=o.formData,s=o.errorSchema;(0,o.onChange)((Array.isArray(l)?l:[]).map((function(r,a){return e===a?void 0===t?null:t:r})),s&&s&&C({},s,((n={})[e]=r,n)),i)}},a.onSelectChange=function(e){var t=a.props,r=t.idSchema;(0,t.onChange)(e,void 0,r&&r.$id)};var i=t.formData,n=N(void 0===i?[]:i);return a.state={keyedFormData:n,updatedKeyedFormData:!1},a}F(t,e),t.getDerivedStateFromProps=function(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};var r=Array.isArray(e.formData)?e.formData:[],a=t.keyedFormData||[];return{keyedFormData:r.length===a.length?a.map((function(e,t){return{key:e.key,item:r[t]}})):N(r)}};var a,i,n=t.prototype;return n.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},n.canAddItem=function(e){var t=this.props,a=t.schema,i=r.getUiOptions(t.uiSchema).addable;return!1!==i&&(i=void 0===a.maxItems||e.length<a.maxItems),i},n._handleAddClick=function(e,t){e&&e.preventDefault();var r=this.props.onChange,a=this.state.keyedFormData,i={key:A(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==t?n.splice(t,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return r(w(n))}))},n.render=function(){var e=this.props,t=e.schema,a=e.uiSchema,i=e.idSchema,n=e.registry,o=n.schemaUtils;if(!(r.ITEMS_KEY in t)){var l=r.getUiOptions(a),s=r.getTemplate("UnsupportedFieldTemplate",n,l);return f.default.createElement(s,{schema:t,idSchema:i,reason:"Missing items definition",registry:n})}return o.isMultiSelect(t)?this.renderMultiSelect():r.isCustomWidget(a)?this.renderCustomWidget():r.isFixedItems(t)?this.renderFixedArray():o.isFilesArray(t,a)?this.renderFiles():this.renderNormalArray()},n.renderNormalArray=function(){var e=this,t=this.props,a=t.schema,i=t.uiSchema,n=void 0===i?{}:i,o=t.errorSchema,l=t.idSchema,s=t.name,d=t.disabled,u=void 0!==d&&d,c=t.readonly,m=void 0!==c&&c,p=t.autofocus,h=void 0!==p&&p,v=t.required,g=void 0!==v&&v,E=t.registry,b=t.onBlur,S=t.onFocus,F=t.idPrefix,D=t.idSeparator,O=void 0===D?"_":D,k=t.rawErrors,T=this.state.keyedFormData,x=void 0===a.title?s:a.title,A=E.schemaUtils,N=E.formContext,I=r.getUiOptions(n),B=y.default(a.items)?a.items:{},U=A.retrieveSchema(B),q=w(this.state.keyedFormData),P=this.canAddItem(q),R={canAdd:P,items:T.map((function(t,r){var a=t.key,i=t.item,d=A.retrieveSchema(B,i),u=o?o[r]:void 0,c=A.toIdSchema(d,l.$id+O+r,i,F,O);return e.renderArrayFieldItem({key:a,index:r,name:s&&s+"-"+r,canAdd:P,canMoveUp:r>0,canMoveDown:r<q.length-1,itemSchema:d,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:n.items,autofocus:h&&0===r,onBlur:b,onFocus:S,rawErrors:k,totalItems:T.length})})),className:"field field-array field-array-of-"+U.type,disabled:u,idSchema:l,uiSchema:n,onAddClick:this.onAddClick,readonly:m,required:g,schema:a,title:x,formContext:N,formData:q,rawErrors:k,registry:E},_=r.getTemplate("ArrayFieldTemplate",E,I);return f.default.createElement(_,C({},R))},n.renderCustomWidget=function(){var e=this.props,t=e.schema,a=e.idSchema,i=e.uiSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,m=void 0!==c&&c,p=e.hideError,h=e.placeholder,v=e.onBlur,y=e.onFocus,g=e.formData,E=void 0===g?[]:g,b=e.registry,S=e.rawErrors,C=b.widgets,F=b.formContext,D=t.title||e.name,T=r.getUiOptions(i),x=T.widget,A=O(T,k),N=r.getWidget(t,x,C);return f.default.createElement(N,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:t,uiSchema:i,registry:b,value:E,disabled:o,readonly:s,hideError:p,required:m,label:D,placeholder:h,formContext:F,autofocus:u,rawErrors:S})},n.renderMultiSelect=function(){var e=this.props,t=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=void 0===n?[]:n,l=e.disabled,s=void 0!==l&&l,d=e.readonly,u=void 0!==d&&d,c=e.autofocus,m=void 0!==c&&c,p=e.required,h=void 0!==p&&p,v=e.placeholder,y=e.onBlur,g=e.onFocus,E=e.registry,b=e.rawErrors,S=e.name,F=E.widgets,D=E.formContext,k=E.schemaUtils.retrieveSchema(t.items,o),x=t.title||S,A=r.optionsList(k),N=r.getUiOptions(i),w=N.widget,I=void 0===w?"select":w,B=O(N,T),U=r.getWidget(t,I,F);return f.default.createElement(U,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:g,options:C({},B,{enumOptions:A}),schema:t,uiSchema:i,registry:E,value:o,disabled:s,readonly:u,required:h,label:x,placeholder:v,formContext:D,autofocus:m,rawErrors:b})},n.renderFiles=function(){var e=this.props,t=e.schema,a=e.uiSchema,i=e.idSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,m=void 0!==c&&c,p=e.onBlur,h=e.onFocus,v=e.registry,y=e.formData,g=void 0===y?[]:y,E=e.rawErrors,b=t.title||e.name,S=v.widgets,C=v.formContext,F=r.getUiOptions(a),D=F.widget,k=void 0===D?"files":D,T=O(F,x),A=r.getWidget(t,k,S);return f.default.createElement(A,{options:T,id:i.$id,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:h,schema:t,uiSchema:a,title:b,value:g,disabled:o,readonly:s,required:m,registry:v,formContext:C,autofocus:u,rawErrors:E,label:""})},n.renderFixedArray=function(){var e=this,t=this.props,a=t.schema,i=t.uiSchema,n=void 0===i?{}:i,o=t.formData,l=void 0===o?[]:o,s=t.errorSchema,d=t.idPrefix,u=t.idSeparator,c=void 0===u?"_":u,m=t.idSchema,p=t.name,h=t.disabled,v=void 0!==h&&h,g=t.readonly,E=void 0!==g&&g,b=t.autofocus,S=void 0!==b&&b,F=t.required,D=void 0!==F&&F,O=t.registry,k=t.onBlur,T=t.onFocus,x=t.rawErrors,A=this.state.keyedFormData,N=this.props.formData,w=void 0===N?[]:N,I=a.title||p,B=r.getUiOptions(n),U=O.schemaUtils,q=O.formContext,P=(y.default(a.items)?a.items:[]).map((function(e,t){return U.retrieveSchema(e,l[t])})),R=y.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,l):null;(!w||w.length<P.length)&&(w=(w=w||[]).concat(new Array(P.length-w.length)));var _=this.canAddItem(w)&&!!R,j={canAdd:_,className:"field field-array field-array-fixed-items",disabled:v,idSchema:m,formData:l,items:A.map((function(t,r){var i=t.key,o=t.item,l=r>=P.length,u=l&&y.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,o):P[r],f=U.toIdSchema(u,m.$id+c+r,o,d,c),h=l?n.additionalItems||{}:Array.isArray(n.items)?n.items[r]:n.items||{};return e.renderArrayFieldItem({key:i,index:r,name:p&&p+"-"+r,canAdd:_,canRemove:l,canMoveUp:r>=P.length+1,canMoveDown:l&&r<w.length-1,itemSchema:u,itemData:o,itemUiSchema:h,itemIdSchema:f,itemErrorSchema:s?s[r]:void 0,autofocus:S&&0===r,onBlur:k,onFocus:T,rawErrors:x,totalItems:A.length})})),onAddClick:this.onAddClick,readonly:E,required:D,registry:O,schema:a,uiSchema:n,title:I,formContext:q,rawErrors:x},V=r.getTemplate("ArrayFieldTemplate",O,B);return f.default.createElement(V,C({},j))},n.renderArrayFieldItem=function(e){var t=e.key,a=e.index,i=e.name,n=e.canAdd,o=e.canRemove,l=void 0===o||o,s=e.canMoveUp,d=void 0===s||s,u=e.canMoveDown,c=void 0===u||u,m=e.itemSchema,p=e.itemData,h=e.itemUiSchema,v=e.itemIdSchema,y=e.itemErrorSchema,g=e.autofocus,E=e.onBlur,b=e.onFocus,S=e.rawErrors,C=e.totalItems,F=this.props,D=F.disabled,O=F.hideError,k=F.idPrefix,T=F.idSeparator,x=F.readonly,A=F.registry,N=F.formContext,w=A.fields,I=w.ArraySchemaField||w.SchemaField,B=r.getUiOptions(F.uiSchema),U=B.orderable,q=void 0===U||U,P=B.removable,R={moveUp:q&&d,moveDown:q&&c,remove:(void 0===P||P)&&l,toolbar:!1};return R.toolbar=Object.keys(R).some((function(e){return R[e]})),{children:f.default.createElement(I,{name:i,index:a,schema:m,uiSchema:h,formData:p,formContext:N,errorSchema:y,idPrefix:k,idSeparator:T,idSchema:v,required:this.isItemRequired(m),onChange:this.onChangeForIndex(a),onBlur:E,onFocus:b,registry:A,disabled:D,readonly:x,hideError:O,autofocus:g,rawErrors:S}),className:"array-item",disabled:D,canAdd:n,hasToolbar:R.toolbar,hasMoveUp:R.moveUp,hasMoveDown:R.moveDown,hasRemove:R.remove,index:a,totalItems:C,key:t,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:x,registry:A,schema:m,uiSchema:h}},a=t,(i=[{key:"itemTitle",get:function(){var e=this.props.schema;return p.default(e,[r.ITEMS_KEY,"title"],p.default(e,[r.ITEMS_KEY,"description"],"Item"))}}])&&function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(a.prototype,i),Object.defineProperty(a,"prototype",{writable:!1}),t}(t.Component),B=["widget"];function U(e){var t,a=e.schema,i=e.name,n=e.uiSchema,o=e.idSchema,l=e.formData,s=e.registry,d=e.required,u=e.disabled,c=e.readonly,m=e.autofocus,p=e.onChange,h=e.onFocus,v=e.onBlur,g=e.rawErrors,E=a.title,b=s.widgets,S=s.formContext,F=r.getUiOptions(n),D=F.widget,k=void 0===D?"checkbox":D,T=O(F,B),x=r.getWidget(a,k,b);if(Array.isArray(a.oneOf))t=r.optionsList({oneOf:a.oneOf.map((function(e){if(y.default(e))return C({},e,{title:e.title||(!0===e.const?"Yes":"No")})})).filter((function(e){return e}))});else{var A,N=a,w=null!=(A=a.enum)?A:[!0,!1];t=!N.enumNames&&2===w.length&&w.every((function(e){return"boolean"==typeof e}))?[{value:w[0],label:w[0]?"Yes":"No"},{value:w[1],label:w[1]?"Yes":"No"}]:r.optionsList({enum:w,enumNames:N.enumNames})}return f.default.createElement(x,{options:C({},T,{enumOptions:t}),schema:a,uiSchema:n,id:o.$id,onChange:p,onFocus:h,onBlur:v,label:void 0===E?i:E,value:l,required:d,disabled:u,readonly:c,registry:s,formContext:S,autofocus:m,rawErrors:g})}var q=["widget","placeholder","autofocus","autocomplete","title"],P="Option",R=function(e){function t(t){var r;(r=e.call(this,t)||this).onOptionChange=function(e){var t=r.state,a=t.selectedOption,i=t.retrievedOptions,n=r.props,o=n.formData,l=n.onChange,s=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=s.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=s.getDefaultFormState(u,c,"excludeObjectChildren")),l(c,void 0,r.getFieldId()),r.setState({selectedOption:d})}};var a=r.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return r.state={retrievedOptions:o,selectedOption:r.getMatchingOption(0,i,o)},r}F(t,e);var a=t.prototype;return a.componentDidUpdate=function(e,t){var a=this.props,i=a.formData,n=a.options,o=a.idSchema,l=this.state.selectedOption,s=this.state;if(!r.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;s={selectedOption:l,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!r.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=s.retrievedOptions,c=this.getMatchingOption(l,i,u);t&&c!==l&&(s={selectedOption:c,retrievedOptions:u})}s!==this.state&&this.setState(s)},a.getMatchingOption=function(e,t,r){var a=this.props.registry.schemaUtils.getClosestMatchingOption(t,r,e);return a>0?a:e||0},a.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},a.render=function(){var e,t=this.props,a=t.baseType,i=t.disabled,n=void 0!==i&&i,o=t.errorSchema,l=void 0===o?{}:o,s=t.formContext,d=t.onBlur,u=t.onFocus,c=t.registry,m=t.schema,v=c.widgets,y=c.fields.SchemaField,g=this.state,b=g.selectedOption,S=g.retrievedOptions,F=r.getUiOptions(t.uiSchema),D=F.widget,k=void 0===D?"select":D,T=F.placeholder,x=F.autofocus,A=F.autocomplete,N=F.title,w=void 0===N?m.title:N,I=O(F,q),B=r.getWidget({type:"number"},k,v),U=p.default(l,r.ERRORS_KEY,[]),R=E.default(l,[r.ERRORS_KEY]),_=b>=0&&S[b]||null;_&&(e=_.type?_:Object.assign({},_,{type:a}));var j=w?w+" "+P.toLowerCase():P,V=S.map((function(e,t){return{label:e.title||j+" "+(t+1),value:t}}));return f.default.createElement("div",{className:"panel panel-default panel-body"},f.default.createElement("div",{className:"form-group"},f.default.createElement(B,{id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:d,onFocus:u,disabled:n||h.default(V),multiple:!1,rawErrors:U,errorSchema:R,value:b>=0?b:void 0,options:C({enumOptions:V},I),registry:c,formContext:s,placeholder:T,autocomplete:A,autofocus:x,label:""})),null!==_&&f.default.createElement(y,C({},this.props,{schema:e})))},t}(t.Component),_=/\.([0-9]*0)*$/,j=/[0.]0*$/;function V(e){var a=e.registry,i=e.onChange,n=e.formData,o=t.useState(e.value),l=o[0],s=o[1],d=a.fields.StringField,u=n,c=t.useCallback((function(e){s(e),"."===(""+e).charAt(0)&&(e="0"+e);var t="string"==typeof e&&e.match(_)?r.asNumber(e.replace(j,"")):r.asNumber(e);i(t)}),[i]);if("string"==typeof l&&"number"==typeof u){var m=new RegExp((""+u).replace(".","\\.")+"\\.?0*$");l.match(m)&&(u=l)}return f.default.createElement(d,C({},e,{formData:u,onChange:c}))}var K=function(e){function t(){for(var t,a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(t=e.call.apply(e,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},t.onPropertyChange=function(e,r){return void 0===r&&(r=!1),function(a,i,n){var o,l,s=t.props,d=s.errorSchema;void 0===a&&r&&(a=""),(0,s.onChange)(C({},s.formData,((o={})[e]=a,o)),d&&d&&C({},d,((l={})[e]=i,l)),n)}},t.onDropPropertyClick=function(e){return function(r){r.preventDefault();var a=t.props,i=a.onChange,n=C({},a.formData);S.default(n,e),i(n)}},t.getAvailableKey=function(e,a){for(var i=r.getUiOptions(t.props.uiSchema).duplicateKeySuffixSeparator,n=void 0===i?"-":i,o=0,l=e;b.default(a,l);)l=""+e+n+ ++o;return l},t.onKeyChange=function(e){return function(r,a){var i,n;if(e!==r){var o=t.props,l=o.formData,s=o.onChange,d=o.errorSchema;r=t.getAvailableKey(r,l);var u=C({},l),c=((i={})[e]=r,i),m=Object.keys(u).map((function(e){var t;return(t={})[c[e]||e]=u[e],t})),f=Object.assign.apply(Object,[{}].concat(m));t.setState({wasPropertyKeyModified:!0}),s(f,d&&d&&C({},d,((n={})[r]=a,n)))}}},t.handleAddClick=function(e){return function(){if(e.additionalProperties){var a=t.props,i=a.formData,n=a.onChange,o=a.registry,l=C({},i),s=void 0;if(y.default(e.additionalProperties)){s=e.additionalProperties.type;var d=e.additionalProperties;r.REF_KEY in d&&(s=(d=o.schemaUtils.retrieveSchema({$ref:d[r.REF_KEY]},i)).type),s||!(r.ANY_OF_KEY in d)&&!(r.ONE_OF_KEY in d)||(s="object")}var u=t.getAvailableKey("newKey",l);g.default(l,u,t.getDefaultValue(s)),n(l)}}},t}F(t,e);var a=t.prototype;return a.isRequired=function(e){var t=this.props.schema;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)},a.getDefaultValue=function(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}},a.render=function(){var e,t=this,a=this.props,i=a.uiSchema,n=void 0===i?{}:i,o=a.formData,l=a.errorSchema,s=a.idSchema,d=a.name,u=a.required,c=void 0!==u&&u,m=a.disabled,h=void 0!==m&&m,v=a.readonly,y=void 0!==v&&v,g=a.hideError,E=a.idPrefix,S=a.idSeparator,F=a.onBlur,D=a.onFocus,O=a.registry,k=O.formContext,T=O.fields.SchemaField,x=O.schemaUtils.retrieveSchema(a.schema,o),A=r.getUiOptions(n),N=x.properties,w=void 0===N?{}:N,I=void 0===x.title?d:x.title,B=A.description||x.description;try{var U=Object.keys(w);e=r.orderProperties(U,A.order)}catch(e){return f.default.createElement("div",null,f.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",d||"root"," object field configuration:",f.default.createElement("em",null,e.message),"."),f.default.createElement("pre",null,JSON.stringify(x)))}var q=r.getTemplate("ObjectFieldTemplate",O,A),P={title:A.title||I,description:B,properties:e.map((function(e){var a=b.default(x,[r.PROPERTIES_KEY,e,r.ADDITIONAL_PROPERTY_FLAG]),i=a?n.additionalProperties:n[e],d="hidden"===r.getUiOptions(i).widget,u=p.default(s,[e],{});return{content:f.default.createElement(T,{key:e,name:e,required:t.isRequired(e),schema:p.default(x,[r.PROPERTIES_KEY,e],{}),uiSchema:i,errorSchema:p.default(l,e),idSchema:u,idPrefix:E,idSeparator:S,formData:p.default(o,e),formContext:k,wasPropertyKeyModified:t.state.wasPropertyKeyModified,onKeyChange:t.onKeyChange(e),onChange:t.onPropertyChange(e,a),onBlur:F,onFocus:D,registry:O,disabled:h,readonly:y,hideError:g,onDropPropertyClick:t.onDropPropertyClick}),name:e,readonly:y,disabled:h,required:c,hidden:d}})),readonly:y,disabled:h,required:c,idSchema:s,uiSchema:n,schema:x,formData:o,formContext:k,registry:O};return f.default.createElement(q,C({},P,{onAddClick:this.handleAddClick}))},t}(t.Component),M=["__errors"],W={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function L(e){var t=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=e.errorSchema,l=e.idPrefix,s=e.idSeparator,d=e.name,u=e.onChange,c=e.onKeyChange,m=e.onDropPropertyClick,p=e.required,h=e.registry,v=e.wasPropertyKeyModified,g=void 0!==v&&v,b=h.formContext,S=h.schemaUtils,F=r.getUiOptions(i),D=r.getTemplate("FieldTemplate",h,F),k=r.getTemplate("DescriptionFieldTemplate",h,F),T=r.getTemplate("FieldHelpTemplate",h,F),x=r.getTemplate("FieldErrorTemplate",h,F),A=S.retrieveSchema(t,n),N=a[r.ID_KEY],w=r.mergeObjects(S.toIdSchema(A,N,n,l,s),a),I=f.default.useCallback((function(e,t,r){return u(e,t,r||N)}),[N,u]),B=function(e,t,a,i){var n=t.field,o=i.fields;if("function"==typeof n)return n;if("string"==typeof n&&n in o)return o[n];var l=r.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=W[s];return d||!e.anyOf&&!e.oneOf?d in o?o[d]:function(){var n=r.getTemplate("UnsupportedFieldTemplate",i,t);return f.default.createElement(n,{schema:e,idSchema:a,reason:"Unknown field type "+e.type,registry:i})}:function(){return null}}(A,F,w,h),U=Boolean(e.disabled||F.disabled),q=Boolean(e.readonly||F.readonly||e.schema.readOnly||A.readOnly),P=F.hideError,R=void 0===P?e.hideError:Boolean(P),_=Boolean(e.autofocus||F.autofocus);if(0===Object.keys(A).length)return null;var j=S.getDisplayLabel(A,i),V=o||{},K=V.__errors,L=O(V,M),Y=E.default(i,["ui:classNames","classNames","ui:style"]);r.UI_OPTIONS_KEY in Y&&(Y[r.UI_OPTIONS_KEY]=E.default(Y[r.UI_OPTIONS_KEY],["classNames","style"]));var $,z=f.default.createElement(B,C({},e,{onChange:I,idSchema:w,schema:A,uiSchema:Y,disabled:U,readonly:q,hideError:R,autofocus:_,errorSchema:L,formContext:b,rawErrors:K})),J=w[r.ID_KEY];$=g||r.ADDITIONAL_PROPERTY_FLAG in A?d:F.title||e.schema.title||A.title||d;var H=F.description||e.schema.description||A.description||"",G=F.help,Q="hidden"===F.widget,X=["form-group","field","field-"+A.type];!R&&K&&K.length>0&&X.push("field-error has-error has-danger"),null!=i&&i.classNames&&X.push(i.classNames),F.classNames&&X.push(F.classNames);var Z=f.default.createElement(T,{help:G,idSchema:w,schema:A,uiSchema:i,hasErrors:!R&&K&&K.length>0,registry:h}),ee=R?void 0:f.default.createElement(x,{errors:K,errorSchema:o,idSchema:w,schema:A,uiSchema:i,registry:h}),te={description:f.default.createElement(k,{id:r.descriptionId(J),description:H,schema:A,uiSchema:i,registry:h}),rawDescription:H,help:Z,rawHelp:"string"==typeof G?G:void 0,errors:ee,rawErrors:R?void 0:K,id:J,label:$,hidden:Q,onChange:u,onKeyChange:c,onDropPropertyClick:m,required:p,disabled:U,readonly:q,hideError:R,displayLabel:j,classNames:X.join(" ").trim(),style:F.style,formContext:b,formData:n,schema:A,uiSchema:i,registry:h},re=h.fields.AnyOfField,ae=h.fields.OneOfField,ie=(null==i?void 0:i["ui:field"])&&!0===(null==i?void 0:i["ui:fieldReplacesAnyOrOneOf"]);return f.default.createElement(D,C({},te),f.default.createElement(f.default.Fragment,null,z,A.anyOf&&!ie&&!S.isSelect(A)&&f.default.createElement(re,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:b,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.anyOf.map((function(e){return S.retrieveSchema(y.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i}),A.oneOf&&!ie&&!S.isSelect(A)&&f.default.createElement(ae,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:b,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.oneOf.map((function(e){return S.retrieveSchema(y.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i})))}var Y=function(e){function t(){return e.apply(this,arguments)||this}F(t,e);var a=t.prototype;return a.shouldComponentUpdate=function(e){return!r.deepEquals(this.props,e)},a.render=function(){return f.default.createElement(L,C({},this.props))},t}(f.default.Component),$=["widget","placeholder"];function z(e){var t=e.schema,a=e.name,i=e.uiSchema,n=e.idSchema,o=e.formData,l=e.required,s=e.disabled,d=void 0!==s&&s,u=e.readonly,c=void 0!==u&&u,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,v=e.onBlur,y=e.onFocus,g=e.registry,E=e.rawErrors,b=t.title,S=t.format,F=g.widgets,D=g.formContext,k=g.schemaUtils.isSelect(t)?r.optionsList(t):void 0,T=k?"select":"text";S&&r.hasWidget(t,S,F)&&(T=S);var x=r.getUiOptions(i),A=x.widget,N=void 0===A?T:A,w=x.placeholder,I=void 0===w?"":w,B=O(x,$),U=r.getWidget(t,N,F);return f.default.createElement(U,{options:C({},B,{enumOptions:k}),schema:t,uiSchema:i,id:n.$id,label:void 0===b?a:b,value:o,onChange:h,onBlur:v,onFocus:y,required:l,disabled:d,readonly:c,formContext:D,autofocus:p,registry:g,placeholder:I,rawErrors:E})}function J(e){var r=e.formData,a=e.onChange;return t.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function H(e){var t=e.idSchema,a=e.description,i=e.registry,n=e.schema,o=e.uiSchema,l=r.getUiOptions(o),s=l.label;if(!a||void 0!==s&&!s)return null;var d=r.getTemplate("DescriptionFieldTemplate",i,l);return f.default.createElement(d,{id:r.descriptionId(t),description:a,schema:n,uiSchema:o,registry:i})}function G(e){var t=e.disabled,r=e.hasToolbar,a=e.hasMoveDown,i=e.hasMoveUp,n=e.hasRemove,o=e.index,l=e.onDropIndexClick,s=e.onReorderClick,d=e.readonly,u=e.registry,c=e.uiSchema,m=u.templates.ButtonTemplates,p=m.MoveDownButton,h=m.MoveUpButton,v=m.RemoveButton,y={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return f.default.createElement("div",{className:e.className},f.default.createElement("div",{className:r?"col-xs-9":"col-xs-12"},e.children),r&&f.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},f.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(i||a)&&f.default.createElement(h,{style:y,disabled:t||d||!i,onClick:s(o,o-1),uiSchema:c,registry:u}),(i||a)&&f.default.createElement(p,{style:y,disabled:t||d||!a,onClick:s(o,o+1),uiSchema:c,registry:u}),n&&f.default.createElement(v,{style:y,disabled:t||d,onClick:l(o),uiSchema:c,registry:u}))))}var Q=["key"];function X(e){var t=e.canAdd,a=e.className,i=e.disabled,n=e.idSchema,o=e.uiSchema,l=e.items,s=e.onAddClick,d=e.readonly,u=e.registry,c=e.required,m=e.schema,p=e.title,h=r.getUiOptions(o),v=r.getTemplate("ArrayFieldDescriptionTemplate",u,h),y=r.getTemplate("ArrayFieldItemTemplate",u,h),g=r.getTemplate("ArrayFieldTitleTemplate",u,h),E=u.templates.ButtonTemplates.AddButton;return f.default.createElement("fieldset",{className:a,id:n.$id},f.default.createElement(g,{idSchema:n,title:h.title||p,required:c,schema:m,uiSchema:o,registry:u}),f.default.createElement(v,{idSchema:n,description:h.description||m.description,schema:m,uiSchema:o,registry:u}),f.default.createElement("div",{className:"row array-item-list"},l&&l.map((function(e){var t=e.key,r=O(e,Q);return f.default.createElement(y,C({key:t},r))}))),t&&f.default.createElement(E,{className:"array-item-add",onClick:s,disabled:i||d,uiSchema:o,registry:u}))}function Z(e){var t=e.idSchema,a=e.title,i=e.schema,n=e.uiSchema,o=e.required,l=e.registry,s=r.getUiOptions(n),d=s.label;if(!a||void 0!==d&&!d)return null;var u=r.getTemplate("TitleFieldTemplate",l,s);return f.default.createElement(u,{id:r.titleId(t),title:a,required:o,schema:i,uiSchema:n,registry:l})}var ee=["id","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","options","schema","uiSchema","formContext","registry","rawErrors","type"];function te(e){var a=e.id,i=e.value,n=e.readonly,o=e.disabled,l=e.autofocus,s=e.onBlur,d=e.onFocus,u=e.onChange,c=e.options,m=e.schema,p=e.type,h=O(e,ee);if(!a)throw console.log("No id for",e),new Error("no id for props "+JSON.stringify(e));var v,y=C({},h,r.getInputProps(m,p,c));v="number"===y.type||"integer"===y.type?i||0===i?i:"":null==i?"":i;var g=t.useCallback((function(e){var t=e.target.value;return u(""===t?c.emptyValue:t)}),[u,c]),E=t.useCallback((function(e){return s(a,e.target.value)}),[s,a]),b=t.useCallback((function(e){return d(a,e.target.value)}),[d,a]);return f.default.createElement(f.default.Fragment,null,f.default.createElement("input",C({id:a,name:a,className:"form-control",readOnly:n,disabled:o,autoFocus:l,value:v},y,{list:m.examples?r.examplesId(a):void 0,onChange:g,onBlur:E,onFocus:b,"aria-describedby":r.ariaDescribedByIds(a,!!m.examples)})),Array.isArray(m.examples)&&f.default.createElement("datalist",{key:"datalist_"+a,id:r.examplesId(a)},m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map((function(e){return f.default.createElement("option",{key:e,value:e})}))))}function re(e){var t=r.getSubmitButtonOptions(e.uiSchema),a=t.submitText,i=t.props,n=void 0===i?{}:i;return t.norender?null:f.default.createElement("div",null,f.default.createElement("button",C({type:"submit"},n,{className:"btn btn-info "+n.className}),a))}var ae=["iconType","icon","className","uiSchema","registry"];function ie(e){var t=e.iconType,r=void 0===t?"default":t,a=e.icon,i=e.className,n=O(e,ae);return f.default.createElement("button",C({type:"button",className:"btn btn-"+r+" "+i},n),f.default.createElement("i",{className:"glyphicon glyphicon-"+a}))}function ne(e){return f.default.createElement(ie,C({title:"Move down",className:"array-item-move-down"},e,{icon:"arrow-down"}))}function oe(e){return f.default.createElement(ie,C({title:"Move up",className:"array-item-move-up"},e,{icon:"arrow-up"}))}function le(e){return f.default.createElement(ie,C({title:"Remove",className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function se(e){return f.default.createElement("div",{className:"row"},f.default.createElement("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className},f.default.createElement(ie,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:e.onClick,disabled:e.disabled,registry:e.registry})))}function de(e){var t=e.description;return t?f.default.createElement("string"==typeof t?"p":"div",{id:e.id,className:"field-description"},t):null}function ue(e){var t=e.errors;return f.default.createElement("div",{className:"panel panel-danger errors"},f.default.createElement("div",{className:"panel-heading"},f.default.createElement("h3",{className:"panel-title"},"Errors")),f.default.createElement("ul",{className:"list-group"},t.map((function(e,t){return f.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)}))))}function ce(e){var t=e.label;return t?f.default.createElement("label",{className:"control-label",htmlFor:e.id},t,e.required&&f.default.createElement("span",{className:"required"},"*")):null}function me(e){var t=e.id,a=e.label,i=e.children,n=e.errors,o=e.help,l=e.description,s=e.hidden,d=e.required,u=e.displayLabel,c=e.registry,m=r.getUiOptions(e.uiSchema),p=r.getTemplate("WrapIfAdditionalTemplate",c,m);return s?f.default.createElement("div",{className:"hidden"},i):f.default.createElement(p,C({},e),u&&f.default.createElement(ce,{label:a,required:d,id:t}),u&&l?l:null,i,n,o)}function fe(e){var t=e.errors,a=void 0===t?[]:t;if(0===a.length)return null;var i=r.errorId(e.idSchema);return f.default.createElement("div",null,f.default.createElement("ul",{id:i,className:"error-detail bs-callout bs-callout-info"},a.filter((function(e){return!!e})).map((function(e,t){return f.default.createElement("li",{className:"text-danger",key:t},e)}))))}function pe(e){var t=e.help;if(!t)return null;var a=r.helpId(e.idSchema);return f.default.createElement("string"==typeof t?"p":"div",{id:a,className:"help-block"},t)}function he(e){var t=e.description,a=e.disabled,i=e.formData,n=e.idSchema,o=e.onAddClick,l=e.properties,s=e.readonly,d=e.registry,u=e.required,c=e.schema,m=e.title,p=e.uiSchema,h=r.getUiOptions(p),v=r.getTemplate("TitleFieldTemplate",d,h),y=r.getTemplate("DescriptionFieldTemplate",d,h),g=d.templates.ButtonTemplates.AddButton;return f.default.createElement("fieldset",{id:n.$id},(h.title||m)&&f.default.createElement(v,{id:r.titleId(n),title:h.title||m,required:u,schema:c,uiSchema:p,registry:d}),(h.description||t)&&f.default.createElement(y,{id:r.descriptionId(n),description:h.description||t,schema:c,uiSchema:p,registry:d}),l.map((function(e){return e.content})),r.canExpand(c,p,i)&&f.default.createElement(g,{className:"object-property-expand",onClick:o(c),disabled:a||s,uiSchema:p,registry:d}))}function ve(e){return f.default.createElement("legend",{id:e.id},e.title,e.required&&f.default.createElement("span",{className:"required"},"*"))}function ye(e){var t=e.schema,r=e.idSchema,a=e.reason;return f.default.createElement("div",{className:"unsupported-field"},f.default.createElement("p",null,"Unsupported field schema",r&&r.$id&&f.default.createElement("span",null," for"," field ",f.default.createElement("code",null,r.$id)),a&&f.default.createElement("em",null,": ",a),"."),t&&f.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ge(e){var t=e.id,a=e.disabled,i=e.label,n=e.onKeyChange,o=e.onDropPropertyClick,l=e.readonly,s=e.children,d=e.uiSchema,u=e.registry,c=u.templates.ButtonTemplates.RemoveButton;return f.default.createElement("div",{className:e.classNames,style:e.style},r.ADDITIONAL_PROPERTY_FLAG in e.schema?f.default.createElement("div",{className:"row"},f.default.createElement("div",{className:"col-xs-5 form-additional"},f.default.createElement("div",{className:"form-group"},f.default.createElement(ce,{label:i+" Key",required:e.required,id:t+"-key"}),f.default.createElement("input",{className:"form-control",type:"text",id:t+"-key",onBlur:function(e){return n(e.target.value)},defaultValue:i}))),f.default.createElement("div",{className:"form-additional form-group col-xs-5"},s),f.default.createElement("div",{className:"col-xs-2"},f.default.createElement(c,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||l,onClick:o(i),uiSchema:d,registry:u}))):s)}function Ee(e,t){for(var a=[],i=e;i<=t;i++)a.push({value:i,label:r.pad(i,2)});return a}function be(e){var t=e.type,a=e.range,i=e.value,n=e.select,o=e.rootId,l=e.disabled,s=e.readonly,d=e.autofocus,u=e.registry,c=e.onBlur,m=e.onFocus;return f.default.createElement(u.widgets.SelectWidget,{schema:{type:"integer"},id:o+"_"+t,className:"form-control",options:{enumOptions:Ee(a[0],a[1])},placeholder:t,value:i,disabled:l,readonly:s,autofocus:d,onChange:function(e){return n(t,e)},onBlur:c,onFocus:m,registry:u,label:"","aria-describedby":r.ariaDescribedByIds(o)})}function Se(e){var a=e.time,i=void 0!==a&&a,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.options,m=e.id,p=e.registry,h=e.onBlur,v=e.onFocus,y=e.onChange,g=e.value,E=t.useReducer((function(e,t){return C({},e,t)}),r.parseDateString(g,i)),b=E[0],S=E[1];t.useEffect((function(){g&&g!==r.toDateString(b,i)&&S(r.parseDateString(g,i))}),[g,b,i]),t.useEffect((function(){(function(e){return Object.values(e).every((function(e){return-1!==e}))})(b)&&y(r.toDateString(b,i))}),[b,i,y]);var F=t.useCallback((function(e,t){var r;S(((r={})[e]=t,r))}),[]),D=t.useCallback((function(e){if(e.preventDefault(),!o&&!s){var t=r.parseDateString((new Date).toJSON(),i);S(t)}}),[o,s,i]),O=t.useCallback((function(e){e.preventDefault(),o||s||(S(r.parseDateString("",i)),y(void 0))}),[o,s,i,y]);return f.default.createElement("ul",{className:"list-inline"},function(e,t,r){void 0===r&&(r=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:r,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return t&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}(b,i,c.yearsRange).map((function(e,t){return f.default.createElement("li",{key:t},f.default.createElement(be,C({rootId:m,select:F},e,{disabled:o,readonly:s,registry:p,onBlur:h,onFocus:v,autofocus:u&&0===t})))})),("undefined"===c.hideNowButton||!c.hideNowButton)&&f.default.createElement("li",null,f.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:D},"Now")),("undefined"===c.hideClearButton||!c.hideClearButton)&&f.default.createElement("li",null,f.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:O},"Clear")))}var Ce=["time"];function Fe(e){var t=e.time,r=void 0===t||t,a=O(e,Ce);return f.default.createElement(a.registry.widgets.AltDateWidget,C({time:r},a))}function De(e){var a=e.schema,i=e.uiSchema,n=e.id,o=e.value,l=e.disabled,s=e.readonly,d=e.label,u=e.autofocus,c=void 0!==u&&u,m=e.onBlur,p=e.onFocus,h=e.onChange,v=e.registry,y=r.getTemplate("DescriptionFieldTemplate",v,e.options),g=r.schemaRequiresTrueValue(a),E=t.useCallback((function(e){return h(e.target.checked)}),[h]),b=t.useCallback((function(e){return m(n,e.target.checked)}),[m,n]),S=t.useCallback((function(e){return p(n,e.target.checked)}),[p,n]);return f.default.createElement("div",{className:"checkbox "+(l||s?"disabled":"")},a.description&&f.default.createElement(y,{id:r.descriptionId(n),description:a.description,schema:a,uiSchema:i,registry:v}),f.default.createElement("label",null,f.default.createElement("input",{type:"checkbox",id:n,name:n,checked:void 0!==o&&o,required:g,disabled:l||s,autoFocus:c,onChange:E,onBlur:b,onFocus:S,"aria-describedby":r.ariaDescribedByIds(n)}),f.default.createElement("span",null,d)))}function Oe(e){var t=e.id,a=e.disabled,i=e.options,n=i.inline,o=void 0!==n&&n,l=i.enumOptions,s=i.enumDisabled,d=e.value,u=e.autofocus,c=void 0!==u&&u,m=e.readonly,p=e.onChange,h=Array.isArray(d)?d:[d];return f.default.createElement("div",{className:"checkboxes",id:t},Array.isArray(l)&&l.map((function(e,i){var n=h.includes(e.value),d=Array.isArray(s)&&-1!=s.indexOf(e.value),u=a||d||m?"disabled":"",v=f.default.createElement("span",null,f.default.createElement("input",{type:"checkbox",id:r.optionId(t,e),name:t,checked:n,disabled:a||d||m,autoFocus:c&&0===i,onChange:function(t){p(t.target.checked?r.enumOptionsSelectValue(e.value,h,l):r.enumOptionsDeselectValue(e.value,h))},"aria-describedby":r.ariaDescribedByIds(t)}),f.default.createElement("span",null,e.label));return o?f.default.createElement("label",{key:e.value,className:"checkbox-inline "+u},v):f.default.createElement("div",{key:e.value,className:"checkbox "+u},f.default.createElement("label",null,v))})))}function ke(e){var t=e.disabled,a=e.readonly,i=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(i,C({type:"color"},e,{disabled:t||a}))}function Te(e){var a=e.onChange,i=r.getTemplate("BaseInputTemplate",e.registry,e.options),n=t.useCallback((function(e){return a(e||void 0)}),[a]);return f.default.createElement(i,C({type:"date"},e,{onChange:n}))}function xe(e){var t=e.onChange,a=e.value,i=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(i,C({type:"datetime-local"},e,{value:r.utcToLocal(a),onChange:function(e){return t(r.localToUTC(e))}}))}function Ae(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"email"},e))}function Ne(e,t){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(t)+";base64")}function we(e){var t=e.name,r=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:Ne(e.target.result,t),name:t,size:r,type:a}):i({dataURL:null,name:t,size:r,type:a})},o.readAsDataURL(e)}))}function Ie(e){var t=e.filesInfo;return 0===t.length?null:f.default.createElement("ul",{className:"file-info"},t.map((function(e,t){var r=e.size,a=e.type;return f.default.createElement("li",{key:t},f.default.createElement("strong",null,e.name)," (",a,", ",r," bytes)")})))}function Be(e){return e.filter((function(e){return void 0!==e})).map((function(e){var t=r.dataURItoBlob(e),a=t.blob;return{name:t.name,size:a.size,type:a.type}}))}function Ue(e){var a=e.multiple,i=e.id,n=e.readonly,o=e.disabled,l=e.onChange,s=e.value,d=e.autofocus,u=void 0!==d&&d,c=e.options,m=t.useMemo((function(){return Array.isArray(s)?Be(s):Be([s])}),[s]),p=t.useState(m),h=p[0],v=p[1],y=t.useCallback((function(e){var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(we))).then((function(e){v(e);var t=e.map((function(e){return e.dataURL}));l(a?t:t[0])}))}),[a,l]);return f.default.createElement("div",null,f.default.createElement("p",null,f.default.createElement("input",{id:i,name:i,type:"file",disabled:n||o,onChange:y,defaultValue:"",autoFocus:u,multiple:a,accept:c.accept?String(c.accept):void 0,"aria-describedby":r.ariaDescribedByIds(i)})),f.default.createElement(Ie,{filesInfo:h}))}function qe(e){var t=e.id,r=e.value;return f.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===r?"":r})}function Pe(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"password"},e))}function Re(e){var a=e.options,i=e.value,n=e.required,o=e.disabled,l=e.readonly,s=e.autofocus,d=void 0!==s&&s,u=e.onBlur,c=e.onFocus,m=e.onChange,p=e.id,h=Math.random().toString(),v=a.enumOptions,y=a.enumDisabled,g=a.inline,E=t.useCallback((function(e){return u(p,e.target.value)}),[u,p]),b=t.useCallback((function(e){return c(p,e.target.value)}),[c,p]);return f.default.createElement("div",{className:"field-radio-group",id:p},Array.isArray(v)&&v.map((function(e,t){var a=e.value===i,s=Array.isArray(y)&&-1!=y.indexOf(e.value),u=o||s||l?"disabled":"",c=f.default.createElement("span",null,f.default.createElement("input",{type:"radio",id:r.optionId(p,e),checked:a,name:h,required:n,value:e.value,disabled:o||s||l,autoFocus:d&&0===t,onChange:function(){return m(e.value)},onBlur:E,onFocus:b,"aria-describedby":r.ariaDescribedByIds(p)}),f.default.createElement("span",null,e.label));return g?f.default.createElement("label",{key:e.value,className:"radio-inline "+u},c):f.default.createElement("div",{key:e.value,className:"radio "+u},f.default.createElement("label",null,c))})))}function _e(e){var t=e.value;return f.default.createElement("div",{className:"field-range-wrapper"},f.default.createElement(e.registry.templates.BaseInputTemplate,C({type:"range"},e)),f.default.createElement("span",{className:"range-view"},t))}function je(e,t){return t?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function Ve(e){var a=e.schema,i=e.id,n=e.options,o=e.value,l=e.required,s=e.disabled,d=e.readonly,u=e.multiple,c=void 0!==u&&u,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,v=e.onBlur,y=e.onFocus,g=e.placeholder,E=n.enumOptions,b=n.enumDisabled,S=c?[]:"",C=t.useCallback((function(e){var t=je(e,c);return y(i,r.processSelectValue(a,t,n))}),[y,i,a,c,n]),F=t.useCallback((function(e){var t=je(e,c);return v(i,r.processSelectValue(a,t,n))}),[v,i,a,c,n]),D=t.useCallback((function(e){var t=je(e,c);return h(r.processSelectValue(a,t,n))}),[h,a,c,n]);return f.default.createElement("select",{id:i,name:i,multiple:c,className:"form-control",value:void 0===o?S:o,required:l,disabled:s||d,autoFocus:p,onBlur:F,onFocus:C,onChange:D,"aria-describedby":r.ariaDescribedByIds(i)},!c&&void 0===a.default&&f.default.createElement("option",{value:""},g),Array.isArray(E)&&E.map((function(e,t){var r=e.value,a=e.label,i=b&&-1!=b.indexOf(r);return f.default.createElement("option",{key:t,value:r,disabled:i},a)})))}function Ke(e){var a=e.id,i=e.options,n=void 0===i?{}:i,o=e.placeholder,l=e.value,s=e.required,d=e.disabled,u=e.readonly,c=e.autofocus,m=void 0!==c&&c,p=e.onChange,h=e.onBlur,v=e.onFocus,y=t.useCallback((function(e){var t=e.target.value;return p(""===t?n.emptyValue:t)}),[p,n.emptyValue]),g=t.useCallback((function(e){return h(a,e.target.value)}),[h,a]),E=t.useCallback((function(e){return v(a,e.target.value)}),[a,v]);return f.default.createElement("textarea",{id:a,name:a,className:"form-control",value:l||"",placeholder:o,required:s,disabled:d,readOnly:u,autoFocus:m,rows:n.rows,onBlur:g,onFocus:E,onChange:y,"aria-describedby":r.ariaDescribedByIds(a)})}function Me(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({},e))}function We(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"url"},e))}function Le(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"number"},e))}function Ye(){return{fields:{AnyOfField:R,ArrayField:I,BooleanField:U,NumberField:V,ObjectField:K,OneOfField:R,SchemaField:Y,StringField:z,NullField:J},templates:{ArrayFieldDescriptionTemplate:H,ArrayFieldItemTemplate:G,ArrayFieldTemplate:X,ArrayFieldTitleTemplate:Z,ButtonTemplates:{SubmitButton:re,AddButton:se,MoveDownButton:ne,MoveUpButton:oe,RemoveButton:le},BaseInputTemplate:te,DescriptionFieldTemplate:de,ErrorListTemplate:ue,FieldTemplate:me,FieldErrorTemplate:fe,FieldHelpTemplate:pe,ObjectFieldTemplate:he,TitleFieldTemplate:ve,UnsupportedFieldTemplate:ye,WrapIfAdditionalTemplate:ge},widgets:{PasswordWidget:Pe,RadioWidget:Re,UpDownWidget:Le,RangeWidget:_e,SelectWidget:Ve,TextWidget:Me,DateWidget:Te,DateTimeWidget:xe,AltDateWidget:Se,AltDateTimeWidget:Fe,EmailWidget:Ae,URLWidget:We,TextareaWidget:Ke,HiddenWidget:qe,ColorWidget:ke,FileWidget:Ue,CheckboxWidget:De,CheckboxesWidget:Oe},rootSchema:{},formContext:{}}}Ke.defaultProps={autofocus:!1,options:{}};var $e=function(e){function t(t){var a;if((a=e.call(this,t)||this).formElement=void 0,a.getUsedFormData=function(e,t){if(0===t.length&&"object"!=typeof e)return e;var r=v.default(e,t);return Array.isArray(e)?Object.keys(r).map((function(e){return r[e]})):r},a.getFieldNames=function(e,t){return function e(a,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var l=n.map((function(e){return[].concat(e,[o])}));a[o][r.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][r.NAME_KEY]?i.push(a[o][r.NAME_KEY]):e(a[o],i,l)}else o===r.NAME_KEY&&""!==a[o]&&n.forEach((function(e){var r=p.default(t,e);("object"!=typeof r||h.default(r))&&i.push(e)}))})),i}(e)},a.onChange=function(e,t,i){var n=a.props,o=n.extraErrors,l=n.omitExtraData,s=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=a.state,f=m.schemaUtils,p=m.schema;(r.isObject(e)||Array.isArray(e))&&(e=a.getStateFromProps(a.props,e).formData);var h=!d&&u,v={formData:e,schema:p},y=e;if(!0===l&&!0===s){var g=f.retrieveSchema(p,e),E=f.toPathSchema(g,"",e),b=a.getFieldNames(E,e);y=a.getUsedFormData(e,b),v={formData:y}}if(h){var S=a.validate(y),F=S.errors,D=S.errorSchema,O=F,k=D;if(o){var T=f.mergeValidationData(S,o);D=T.errorSchema,F=T.errors}v={formData:y,errors:F,errorSchema:D,schemaValidationErrors:O,schemaValidationErrorSchema:k}}else if(!d&&t){var x=o?r.mergeObjects(t,o,"preventDuplicates"):t;v={formData:y,errorSchema:x,errors:f.getValidator().toErrorList(x)}}a.setState(v,(function(){return c&&c(C({},a.state,v),i)}))},a.onBlur=function(e,t){var r=a.props.onBlur;r&&r(e,t)},a.onFocus=function(e,t){var r=a.props.onFocus;r&&r(e,t)},a.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var t=a.props,r=t.extraErrors,i=t.noValidate,n=t.onSubmit,o=a.state.formData,l=a.state,s=l.schemaUtils;if(!0===t.omitExtraData){var d=s.retrieveSchema(l.schema,o),u=s.toPathSchema(d,"",o),c=a.getFieldNames(u,o);o=a.getUsedFormData(o,c)}if(i||a.validateForm()){var m=r||{},f=r?s.getValidator().toErrorList(r):[];a.setState({formData:o,errors:f,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(C({},a.state,{formData:o,status:"submitted"}),e)}))}}},!t.validator)throw new Error("A validator is required for Form functionality to work");return a.state=a.getStateFromProps(t,t.formData),a.props.onChange&&!r.deepEquals(a.state.formData,a.props.formData)&&a.props.onChange(a.state),a.formElement=f.default.createRef(),a}F(t,e);var a=t.prototype;return a.UNSAFE_componentWillReceiveProps=function(e){var t=this.getStateFromProps(e,e.formData);r.deepEquals(t.formData,e.formData)||r.deepEquals(t.formData,this.state.formData)||!e.onChange||e.onChange(t),this.setState(t)},a.getStateFromProps=function(e,t){var a=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==t,l=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=i,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=r.createSchemaUtils(e.validator,s));var u,c,m=d.getDefaultFormState(i,t,"excludeObjectChildren"),f=d.retrieveSchema(i,m),p=a.schemaValidationErrors,h=a.schemaValidationErrorSchema;if(l){var v=this.validate(m,i,d);p=u=v.errors,h=c=v.errorSchema}else{var y=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=y.errors,c=y.errorSchema}if(e.extraErrors){var g=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=g.errorSchema,u=g.errors}var E=d.toIdSchema(f,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:E,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:p,schemaValidationErrorSchema:h}},a.shouldComponentUpdate=function(e,t){return r.shouldRender(this,e,t)},a.validate=function(e,t,r){void 0===t&&(t=this.props.schema);var a=r||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,l=i.uiSchema,s=a.retrieveSchema(t,e);return a.getValidator().validateFormData(e,s,n,o,l)},a.renderErrors=function(e){var t=this.state,a=t.errors,i=t.errorSchema,n=t.schema,o=t.uiSchema,l=this.props.formContext,s=r.getUiOptions(o),d=r.getTemplate("ErrorListTemplate",e,s);return a&&a.length?f.default.createElement(d,{errors:a,errorSchema:i||{},schema:n,uiSchema:o,formContext:l}):null},a.getRegistry=function(){var e,t=this.state.schemaUtils,r=Ye(),a=r.templates,i=r.widgets,n=r.formContext;return{fields:C({},r.fields,this.props.fields),templates:C({},a,this.props.templates,{ButtonTemplates:C({},a.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:C({},i,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||n,schemaUtils:t}},a.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},a.validateForm=function(){var e=this.props,t=e.extraErrors,r=e.onError,a=this.state.schemaUtils,i=this.validate(this.state.formData),n=i.errors,o=i.errorSchema,l=n,s=o;if(n.length>0){if(t){var d=a.mergeValidationData(i,t);o=d.errorSchema,n=d.errors}return this.setState({errors:n,errorSchema:o,schemaValidationErrors:l,schemaValidationErrorSchema:s},(function(){r?r(n):console.error("Form validation failed",n)})),!1}return!0},a.render=function(){var e=this.props,t=e.children,r=e.id,a=e.idPrefix,i=e.idSeparator,n=e.className,o=void 0===n?"":n,l=e.tagName,s=e.name,d=e.method,u=e.target,c=e.action,m=e.autoComplete,p=e.enctype,h=e.acceptcharset,v=e.noHtml5Validate,y=void 0!==v&&v,g=e.disabled,E=void 0!==g&&g,b=e.readonly,S=void 0!==b&&b,C=e.formContext,F=e.showErrorList,D=void 0===F?"top":F,O=e._internalFormWrapper,k=this.state,T=k.schema,x=k.uiSchema,A=k.formData,N=k.errorSchema,w=k.idSchema,I=this.getRegistry(),B=I.fields.SchemaField,U=I.templates.ButtonTemplates.SubmitButton;return f.default.createElement(O||l||"form",{className:o||"rjsf",id:r,name:s,method:d,target:u,action:c,autoComplete:m,encType:p,acceptCharset:h,noValidate:y,onSubmit:this.onSubmit,as:O?l:void 0,ref:this.formElement},"top"===D&&this.renderErrors(I),f.default.createElement(B,{name:"",schema:T,uiSchema:x,errorSchema:N,idSchema:w,idPrefix:a,idSeparator:i,formContext:C,formData:A,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:I,disabled:E,readonly:S}),t||f.default.createElement(U,{uiSchema:x,registry:I}),"bottom"===D&&this.renderErrors(I))},t}(t.Component),ze=["fields","widgets","templates"];e.default=$e,e.getDefaultRegistry=Ye,e.withTheme=function(e){return t.forwardRef((function(t,r){var a,i,n=t.fields,o=t.widgets,l=t.templates,s=O(t,ze);return n=C({},null==e?void 0:e.fields,n),o=C({},null==e?void 0:e.widgets,o),l=C({},null==e?void 0:e.templates,l,{ButtonTemplates:C({},null==e||null===(a=e.templates)||void 0===a?void 0:a.ButtonTemplates,null===(i=l)||void 0===i?void 0:i.ButtonTemplates)}),f.default.createElement($e,C({},e,s,{fields:n,widgets:o,templates:l,ref:r}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@rjsf/utils"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("lodash-es/pick"),require("lodash-es/isObject"),require("lodash-es/set"),require("nanoid"),require("lodash-es/omit"),require("lodash-es/has"),require("lodash-es/unset")):"function"==typeof define&&define.amd?define(["exports","react","@rjsf/utils","lodash-es/get","lodash-es/isEmpty","lodash-es/pick","lodash-es/isObject","lodash-es/set","nanoid","lodash-es/omit","lodash-es/has","lodash-es/unset"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JSONSchemaForm={},e.React,e.utils,e.get,e.isEmpty,e._pick,e.isObject,e.set,e.nanoid,e.omit,e.has,e.unset)}(this,(function(e,t,r,a,i,n,o,l,s,d,u,c){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(t),p=m(a),h=m(i),v=m(n),y=m(o),g=m(l),b=m(d),E=m(u),S=m(c);function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)}function F(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,D(e,t)}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function O(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)t.indexOf(r=n[a])>=0||(i[r]=e[r]);return i}var k=["widget"],x=["widget"],T=["widget"];function A(){return s.nanoid()}function N(e){return Array.isArray(e)?e.map((function(e){return{key:A(),item:e}})):[]}function w(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var I=function(e){function t(t){var a;(a=e.call(this,t)||this)._getNewFormDataRow=function(){var e=a.props,t=e.schema,i=e.registry.schemaUtils,n=t.items;return r.isFixedItems(t)&&r.allowAdditionalItems(t)&&(n=t.additionalItems),i.getDefaultFormState(n)},a.onAddClick=function(e){a._handleAddClick(e)},a.onAddIndexClick=function(e){return function(t){a._handleAddClick(t,e)}},a.onDropIndexClick=function(e){return function(t){t&&t.preventDefault();var r,i=a.props,n=i.onChange,o=i.errorSchema,l=a.state.keyedFormData;if(o)for(var s in r={},o){var d=parseInt(s);d<e?g.default(r,[d],o[s]):d>e&&g.default(r,[d-1],o[s])}var u=l.filter((function(t,r){return r!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return n(w(u),r)}))}},a.onReorderClick=function(e,t){return function(r){r&&(r.preventDefault(),r.currentTarget.blur());var i,n=a.props,o=n.onChange,l=n.errorSchema;if(a.props.errorSchema)for(var s in i={},l){var d=parseInt(s);d==e?g.default(i,[t],l[e]):d==t?g.default(i,[e],l[t]):g.default(i,[s],l[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(t,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(w(m),i)}))}},a.onChangeForIndex=function(e){return function(t,r,i){var n,o=a.props,l=o.formData,s=o.errorSchema;(0,o.onChange)((Array.isArray(l)?l:[]).map((function(r,a){return e===a?void 0===t?null:t:r})),s&&s&&C({},s,((n={})[e]=r,n)),i)}},a.onSelectChange=function(e){var t=a.props,r=t.idSchema;(0,t.onChange)(e,void 0,r&&r.$id)};var i=t.formData,n=N(void 0===i?[]:i);return a.state={keyedFormData:n,updatedKeyedFormData:!1},a}F(t,e),t.getDerivedStateFromProps=function(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};var r=Array.isArray(e.formData)?e.formData:[],a=t.keyedFormData||[];return{keyedFormData:r.length===a.length?a.map((function(e,t){return{key:e.key,item:r[t]}})):N(r)}};var a,i,n=t.prototype;return n.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},n.canAddItem=function(e){var t=this.props,a=t.schema,i=r.getUiOptions(t.uiSchema).addable;return!1!==i&&(i=void 0===a.maxItems||e.length<a.maxItems),i},n._handleAddClick=function(e,t){e&&e.preventDefault();var r=this.props.onChange,a=this.state.keyedFormData,i={key:A(),item:this._getNewFormDataRow()},n=[].concat(a);void 0!==t?n.splice(t,0,i):n.push(i),this.setState({keyedFormData:n,updatedKeyedFormData:!0},(function(){return r(w(n))}))},n.render=function(){var e=this.props,t=e.schema,a=e.uiSchema,i=e.idSchema,n=e.registry,o=n.schemaUtils;if(!(r.ITEMS_KEY in t)){var l=r.getUiOptions(a),s=r.getTemplate("UnsupportedFieldTemplate",n,l);return f.default.createElement(s,{schema:t,idSchema:i,reason:"Missing items definition",registry:n})}return o.isMultiSelect(t)?this.renderMultiSelect():r.isCustomWidget(a)?this.renderCustomWidget():r.isFixedItems(t)?this.renderFixedArray():o.isFilesArray(t,a)?this.renderFiles():this.renderNormalArray()},n.renderNormalArray=function(){var e=this,t=this.props,a=t.schema,i=t.uiSchema,n=void 0===i?{}:i,o=t.errorSchema,l=t.idSchema,s=t.name,d=t.disabled,u=void 0!==d&&d,c=t.readonly,m=void 0!==c&&c,p=t.autofocus,h=void 0!==p&&p,v=t.required,g=void 0!==v&&v,b=t.registry,E=t.onBlur,S=t.onFocus,F=t.idPrefix,D=t.idSeparator,O=void 0===D?"_":D,k=t.rawErrors,x=this.state.keyedFormData,T=void 0===a.title?s:a.title,A=b.schemaUtils,N=b.formContext,I=r.getUiOptions(n),B=y.default(a.items)?a.items:{},U=A.retrieveSchema(B),q=w(this.state.keyedFormData),P=this.canAddItem(q),R={canAdd:P,items:x.map((function(t,r){var a=t.key,i=t.item,d=A.retrieveSchema(B,i),u=o?o[r]:void 0,c=A.toIdSchema(d,l.$id+O+r,i,F,O);return e.renderArrayFieldItem({key:a,index:r,name:s&&s+"-"+r,canAdd:P,canMoveUp:r>0,canMoveDown:r<q.length-1,itemSchema:d,itemIdSchema:c,itemErrorSchema:u,itemData:i,itemUiSchema:n.items,autofocus:h&&0===r,onBlur:E,onFocus:S,rawErrors:k,totalItems:x.length})})),className:"field field-array field-array-of-"+U.type,disabled:u,idSchema:l,uiSchema:n,onAddClick:this.onAddClick,readonly:m,required:g,schema:a,title:T,formContext:N,formData:q,rawErrors:k,registry:b},_=r.getTemplate("ArrayFieldTemplate",b,I);return f.default.createElement(_,C({},R))},n.renderCustomWidget=function(){var e=this.props,t=e.schema,a=e.idSchema,i=e.uiSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,m=void 0!==c&&c,p=e.hideError,h=e.placeholder,v=e.onBlur,y=e.onFocus,g=e.formData,b=void 0===g?[]:g,E=e.registry,S=e.rawErrors,C=E.widgets,F=E.formContext,D=t.title||e.name,x=r.getUiOptions(i),T=x.widget,A=O(x,k),N=r.getWidget(t,T,C);return f.default.createElement(N,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:y,options:A,schema:t,uiSchema:i,registry:E,value:b,disabled:o,readonly:s,hideError:p,required:m,label:D,placeholder:h,formContext:F,autofocus:u,rawErrors:S})},n.renderMultiSelect=function(){var e=this.props,t=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=void 0===n?[]:n,l=e.disabled,s=void 0!==l&&l,d=e.readonly,u=void 0!==d&&d,c=e.autofocus,m=void 0!==c&&c,p=e.required,h=void 0!==p&&p,v=e.placeholder,y=e.onBlur,g=e.onFocus,b=e.registry,E=e.rawErrors,S=e.name,F=b.widgets,D=b.formContext,k=b.schemaUtils.retrieveSchema(t.items,o),T=t.title||S,A=r.optionsList(k),N=r.getUiOptions(i),w=N.widget,I=void 0===w?"select":w,B=O(N,x),U=r.getWidget(t,I,F);return f.default.createElement(U,{id:a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:y,onFocus:g,options:C({},B,{enumOptions:A}),schema:t,uiSchema:i,registry:b,value:o,disabled:s,readonly:u,required:h,label:T,placeholder:v,formContext:D,autofocus:m,rawErrors:E})},n.renderFiles=function(){var e=this.props,t=e.schema,a=e.uiSchema,i=e.idSchema,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,m=void 0!==c&&c,p=e.onBlur,h=e.onFocus,v=e.registry,y=e.formData,g=void 0===y?[]:y,b=e.rawErrors,E=t.title||e.name,S=v.widgets,C=v.formContext,F=r.getUiOptions(a),D=F.widget,k=void 0===D?"files":D,x=O(F,T),A=r.getWidget(t,k,S);return f.default.createElement(A,{options:x,id:i.$id,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:h,schema:t,uiSchema:a,title:E,value:g,disabled:o,readonly:s,required:m,registry:v,formContext:C,autofocus:u,rawErrors:b,label:""})},n.renderFixedArray=function(){var e=this,t=this.props,a=t.schema,i=t.uiSchema,n=void 0===i?{}:i,o=t.formData,l=void 0===o?[]:o,s=t.errorSchema,d=t.idPrefix,u=t.idSeparator,c=void 0===u?"_":u,m=t.idSchema,p=t.name,h=t.disabled,v=void 0!==h&&h,g=t.readonly,b=void 0!==g&&g,E=t.autofocus,S=void 0!==E&&E,F=t.required,D=void 0!==F&&F,O=t.registry,k=t.onBlur,x=t.onFocus,T=t.rawErrors,A=this.state.keyedFormData,N=this.props.formData,w=void 0===N?[]:N,I=a.title||p,B=r.getUiOptions(n),U=O.schemaUtils,q=O.formContext,P=(y.default(a.items)?a.items:[]).map((function(e,t){return U.retrieveSchema(e,l[t])})),R=y.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,l):null;(!w||w.length<P.length)&&(w=(w=w||[]).concat(new Array(P.length-w.length)));var _=this.canAddItem(w)&&!!R,V={canAdd:_,className:"field field-array field-array-fixed-items",disabled:v,idSchema:m,formData:l,items:A.map((function(t,r){var i=t.key,o=t.item,l=r>=P.length,u=l&&y.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,o):P[r],f=U.toIdSchema(u,m.$id+c+r,o,d,c),h=l?n.additionalItems||{}:Array.isArray(n.items)?n.items[r]:n.items||{};return e.renderArrayFieldItem({key:i,index:r,name:p&&p+"-"+r,canAdd:_,canRemove:l,canMoveUp:r>=P.length+1,canMoveDown:l&&r<w.length-1,itemSchema:u,itemData:o,itemUiSchema:h,itemIdSchema:f,itemErrorSchema:s?s[r]:void 0,autofocus:S&&0===r,onBlur:k,onFocus:x,rawErrors:T,totalItems:A.length})})),onAddClick:this.onAddClick,readonly:b,required:D,registry:O,schema:a,uiSchema:n,title:I,formContext:q,rawErrors:T},j=r.getTemplate("ArrayFieldTemplate",O,B);return f.default.createElement(j,C({},V))},n.renderArrayFieldItem=function(e){var t=e.key,a=e.index,i=e.name,n=e.canAdd,o=e.canRemove,l=void 0===o||o,s=e.canMoveUp,d=void 0===s||s,u=e.canMoveDown,c=void 0===u||u,m=e.itemSchema,p=e.itemData,h=e.itemUiSchema,v=e.itemIdSchema,y=e.itemErrorSchema,g=e.autofocus,b=e.onBlur,E=e.onFocus,S=e.rawErrors,C=e.totalItems,F=this.props,D=F.disabled,O=F.hideError,k=F.idPrefix,x=F.idSeparator,T=F.readonly,A=F.registry,N=F.formContext,w=A.fields,I=w.ArraySchemaField||w.SchemaField,B=r.getUiOptions(F.uiSchema),U=B.orderable,q=void 0===U||U,P=B.removable,R={moveUp:q&&d,moveDown:q&&c,remove:(void 0===P||P)&&l,toolbar:!1};return R.toolbar=Object.keys(R).some((function(e){return R[e]})),{children:f.default.createElement(I,{name:i,index:a,schema:m,uiSchema:h,formData:p,formContext:N,errorSchema:y,idPrefix:k,idSeparator:x,idSchema:v,required:this.isItemRequired(m),onChange:this.onChangeForIndex(a),onBlur:b,onFocus:E,registry:A,disabled:D,readonly:T,hideError:O,autofocus:g,rawErrors:S}),className:"array-item",disabled:D,canAdd:n,hasToolbar:R.toolbar,hasMoveUp:R.moveUp,hasMoveDown:R.moveDown,hasRemove:R.remove,index:a,totalItems:C,key:t,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:T,registry:A,schema:m,uiSchema:h}},a=t,(i=[{key:"itemTitle",get:function(){var e=this.props.schema;return p.default(e,[r.ITEMS_KEY,"title"],p.default(e,[r.ITEMS_KEY,"description"],"Item"))}}])&&function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a.key))?i:String(i),a)}var i}(a.prototype,i),Object.defineProperty(a,"prototype",{writable:!1}),t}(t.Component),B=["widget"];function U(e){var t,a=e.schema,i=e.name,n=e.uiSchema,o=e.idSchema,l=e.formData,s=e.registry,d=e.required,u=e.disabled,c=e.readonly,m=e.autofocus,p=e.onChange,h=e.onFocus,v=e.onBlur,g=e.rawErrors,b=a.title,E=s.widgets,S=s.formContext,F=r.getUiOptions(n),D=F.widget,k=void 0===D?"checkbox":D,x=O(F,B),T=r.getWidget(a,k,E);if(Array.isArray(a.oneOf))t=r.optionsList({oneOf:a.oneOf.map((function(e){if(y.default(e))return C({},e,{title:e.title||(!0===e.const?"Yes":"No")})})).filter((function(e){return e}))});else{var A,N=a,w=null!=(A=a.enum)?A:[!0,!1];t=!N.enumNames&&2===w.length&&w.every((function(e){return"boolean"==typeof e}))?[{value:w[0],label:w[0]?"Yes":"No"},{value:w[1],label:w[1]?"Yes":"No"}]:r.optionsList({enum:w,enumNames:N.enumNames})}return f.default.createElement(T,{options:C({},x,{enumOptions:t}),schema:a,uiSchema:n,id:o.$id,onChange:p,onFocus:h,onBlur:v,label:void 0===b?i:b,value:l,required:d,disabled:u,readonly:c,registry:s,formContext:S,autofocus:m,rawErrors:g})}var q=["widget","placeholder","autofocus","autocomplete","title"],P="Option",R=function(e){function t(t){var r;(r=e.call(this,t)||this).onOptionChange=function(e){var t=r.state,a=t.selectedOption,i=t.retrievedOptions,n=r.props,o=n.formData,l=n.onChange,s=n.registry.schemaUtils,d=void 0!==e?parseInt(e,10):-1;if(d!==a){var u=d>=0?i[d]:void 0,c=s.sanitizeDataForNewSchema(u,a>=0?i[a]:void 0,o);c&&u&&(c=s.getDefaultFormState(u,c,"excludeObjectChildren")),l(c,void 0,r.getFieldId()),r.setState({selectedOption:d})}};var a=r.props,i=a.formData,n=a.registry.schemaUtils,o=a.options.map((function(e){return n.retrieveSchema(e,i)}));return r.state={retrievedOptions:o,selectedOption:r.getMatchingOption(0,i,o)},r}F(t,e);var a=t.prototype;return a.componentDidUpdate=function(e,t){var a=this.props,i=a.formData,n=a.options,o=a.idSchema,l=this.state.selectedOption,s=this.state;if(!r.deepEquals(e.options,n)){var d=this.props.registry.schemaUtils;s={selectedOption:l,retrievedOptions:n.map((function(e){return d.retrieveSchema(e,i)}))}}if(!r.deepEquals(i,e.formData)&&o.$id===e.idSchema.$id){var u=s.retrievedOptions,c=this.getMatchingOption(l,i,u);t&&c!==l&&(s={selectedOption:c,retrievedOptions:u})}s!==this.state&&this.setState(s)},a.getMatchingOption=function(e,t,r){var a=this.props.registry.schemaUtils.getClosestMatchingOption(t,r,e);return a>0?a:e||0},a.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},a.render=function(){var e,t=this.props,a=t.baseType,i=t.disabled,n=void 0!==i&&i,o=t.errorSchema,l=void 0===o?{}:o,s=t.formContext,d=t.onBlur,u=t.onFocus,c=t.registry,m=t.schema,v=c.widgets,y=c.fields.SchemaField,g=this.state,E=g.selectedOption,S=g.retrievedOptions,F=r.getUiOptions(t.uiSchema),D=F.widget,k=void 0===D?"select":D,x=F.placeholder,T=F.autofocus,A=F.autocomplete,N=F.title,w=void 0===N?m.title:N,I=O(F,q),B=r.getWidget({type:"number"},k,v),U=p.default(l,r.ERRORS_KEY,[]),R=b.default(l,[r.ERRORS_KEY]),_=E>=0&&S[E]||null;_&&(e=_.type?_:Object.assign({},_,{type:a}));var V=w?w+" "+P.toLowerCase():P,j=S.map((function(e,t){return{label:e.title||V+" "+(t+1),value:t}}));return f.default.createElement("div",{className:"panel panel-default panel-body"},f.default.createElement("div",{className:"form-group"},f.default.createElement(B,{id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:d,onFocus:u,disabled:n||h.default(j),multiple:!1,rawErrors:U,errorSchema:R,value:E>=0?E:void 0,options:C({enumOptions:j},I),registry:c,formContext:s,placeholder:x,autocomplete:A,autofocus:T,label:""})),null!==_&&f.default.createElement(y,C({},this.props,{schema:e})))},t}(t.Component),_=/\.([0-9]*0)*$/,V=/[0.]0*$/;function j(e){var a=e.registry,i=e.onChange,n=e.formData,o=t.useState(e.value),l=o[0],s=o[1],d=a.fields.StringField,u=n,c=t.useCallback((function(e){s(e),"."===(""+e).charAt(0)&&(e="0"+e);var t="string"==typeof e&&e.match(_)?r.asNumber(e.replace(V,"")):r.asNumber(e);i(t)}),[i]);if("string"==typeof l&&"number"==typeof u){var m=new RegExp((""+u).replace(".","\\.")+"\\.?0*$");l.match(m)&&(u=l)}return f.default.createElement(d,C({},e,{formData:u,onChange:c}))}var K=function(e){function t(){for(var t,a=arguments.length,i=new Array(a),n=0;n<a;n++)i[n]=arguments[n];return(t=e.call.apply(e,[this].concat(i))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},t.onPropertyChange=function(e,r){return void 0===r&&(r=!1),function(a,i,n){var o,l,s=t.props,d=s.errorSchema;void 0===a&&r&&(a=""),(0,s.onChange)(C({},s.formData,((o={})[e]=a,o)),d&&d&&C({},d,((l={})[e]=i,l)),n)}},t.onDropPropertyClick=function(e){return function(r){r.preventDefault();var a=t.props,i=a.onChange,n=C({},a.formData);S.default(n,e),i(n)}},t.getAvailableKey=function(e,a){for(var i=r.getUiOptions(t.props.uiSchema).duplicateKeySuffixSeparator,n=void 0===i?"-":i,o=0,l=e;E.default(a,l);)l=""+e+n+ ++o;return l},t.onKeyChange=function(e){return function(r,a){var i,n;if(e!==r){var o=t.props,l=o.formData,s=o.onChange,d=o.errorSchema;r=t.getAvailableKey(r,l);var u=C({},l),c=((i={})[e]=r,i),m=Object.keys(u).map((function(e){var t;return(t={})[c[e]||e]=u[e],t})),f=Object.assign.apply(Object,[{}].concat(m));t.setState({wasPropertyKeyModified:!0}),s(f,d&&d&&C({},d,((n={})[r]=a,n)))}}},t.handleAddClick=function(e){return function(){if(e.additionalProperties){var a=t.props,i=a.formData,n=a.onChange,o=a.registry,l=C({},i),s=void 0;if(y.default(e.additionalProperties)){s=e.additionalProperties.type;var d=e.additionalProperties;r.REF_KEY in d&&(s=(d=o.schemaUtils.retrieveSchema({$ref:d[r.REF_KEY]},i)).type),s||!(r.ANY_OF_KEY in d)&&!(r.ONE_OF_KEY in d)||(s="object")}var u=t.getAvailableKey("newKey",l);g.default(l,u,t.getDefaultValue(s)),n(l)}}},t}F(t,e);var a=t.prototype;return a.isRequired=function(e){var t=this.props.schema;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)},a.getDefaultValue=function(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}},a.render=function(){var e,t=this,a=this.props,i=a.uiSchema,n=void 0===i?{}:i,o=a.formData,l=a.errorSchema,s=a.idSchema,d=a.name,u=a.required,c=void 0!==u&&u,m=a.disabled,h=void 0!==m&&m,v=a.readonly,y=void 0!==v&&v,g=a.hideError,b=a.idPrefix,S=a.idSeparator,F=a.onBlur,D=a.onFocus,O=a.registry,k=O.formContext,x=O.fields.SchemaField,T=O.schemaUtils.retrieveSchema(a.schema,o),A=r.getUiOptions(n),N=T.properties,w=void 0===N?{}:N,I=void 0===T.title?d:T.title,B=A.description||T.description;try{var U=Object.keys(w);e=r.orderProperties(U,A.order)}catch(e){return f.default.createElement("div",null,f.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",d||"root"," object field configuration:",f.default.createElement("em",null,e.message),"."),f.default.createElement("pre",null,JSON.stringify(T)))}var q=r.getTemplate("ObjectFieldTemplate",O,A),P={title:A.title||I,description:B,properties:e.map((function(e){var a=E.default(T,[r.PROPERTIES_KEY,e,r.ADDITIONAL_PROPERTY_FLAG]),i=a?n.additionalProperties:n[e],d="hidden"===r.getUiOptions(i).widget,u=p.default(s,[e],{});return{content:f.default.createElement(x,{key:e,name:e,required:t.isRequired(e),schema:p.default(T,[r.PROPERTIES_KEY,e],{}),uiSchema:i,errorSchema:p.default(l,e),idSchema:u,idPrefix:b,idSeparator:S,formData:p.default(o,e),formContext:k,wasPropertyKeyModified:t.state.wasPropertyKeyModified,onKeyChange:t.onKeyChange(e),onChange:t.onPropertyChange(e,a),onBlur:F,onFocus:D,registry:O,disabled:h,readonly:y,hideError:g,onDropPropertyClick:t.onDropPropertyClick}),name:e,readonly:y,disabled:h,required:c,hidden:d}})),readonly:y,disabled:h,required:c,idSchema:s,uiSchema:n,schema:T,formData:o,formContext:k,registry:O};return f.default.createElement(q,C({},P,{onAddClick:this.handleAddClick}))},t}(t.Component),M=["__errors"],W={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function L(e){var t=e.schema,a=e.idSchema,i=e.uiSchema,n=e.formData,o=e.errorSchema,l=e.idPrefix,s=e.idSeparator,d=e.name,u=e.onChange,c=e.onKeyChange,m=e.onDropPropertyClick,p=e.required,h=e.registry,v=e.wasPropertyKeyModified,g=void 0!==v&&v,E=h.formContext,S=h.schemaUtils,F=r.getUiOptions(i),D=r.getTemplate("FieldTemplate",h,F),k=r.getTemplate("DescriptionFieldTemplate",h,F),x=r.getTemplate("FieldHelpTemplate",h,F),T=r.getTemplate("FieldErrorTemplate",h,F),A=S.retrieveSchema(t,n),N=a[r.ID_KEY],w=r.mergeObjects(S.toIdSchema(A,N,n,l,s),a),I=f.default.useCallback((function(e,t,r){return u(e,t,r||N)}),[N,u]),B=function(e,t,a,i){var n=t.field,o=i.fields;if("function"==typeof n)return n;if("string"==typeof n&&n in o)return o[n];var l=r.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=W[s];return d||!e.anyOf&&!e.oneOf?d in o?o[d]:function(){var n=r.getTemplate("UnsupportedFieldTemplate",i,t);return f.default.createElement(n,{schema:e,idSchema:a,reason:"Unknown field type "+e.type,registry:i})}:function(){return null}}(A,F,w,h),U=Boolean(e.disabled||F.disabled),q=Boolean(e.readonly||F.readonly||e.schema.readOnly||A.readOnly),P=F.hideError,R=void 0===P?e.hideError:Boolean(P),_=Boolean(e.autofocus||F.autofocus);if(0===Object.keys(A).length)return null;var V=S.getDisplayLabel(A,i),j=o||{},K=j.__errors,L=O(j,M),Y=b.default(i,["ui:classNames","classNames","ui:style"]);r.UI_OPTIONS_KEY in Y&&(Y[r.UI_OPTIONS_KEY]=b.default(Y[r.UI_OPTIONS_KEY],["classNames","style"]));var $,z=f.default.createElement(B,C({},e,{onChange:I,idSchema:w,schema:A,uiSchema:Y,disabled:U,readonly:q,hideError:R,autofocus:_,errorSchema:L,formContext:E,rawErrors:K})),J=w[r.ID_KEY];$=g||r.ADDITIONAL_PROPERTY_FLAG in A?d:F.title||e.schema.title||A.title||d;var H=F.description||e.schema.description||A.description||"",G=F.help,Q="hidden"===F.widget,X=["form-group","field","field-"+A.type];!R&&K&&K.length>0&&X.push("field-error has-error has-danger"),null!=i&&i.classNames&&X.push(i.classNames),F.classNames&&X.push(F.classNames);var Z=f.default.createElement(x,{help:G,idSchema:w,schema:A,uiSchema:i,hasErrors:!R&&K&&K.length>0,registry:h}),ee=R?void 0:f.default.createElement(T,{errors:K,errorSchema:o,idSchema:w,schema:A,uiSchema:i,registry:h}),te={description:f.default.createElement(k,{id:r.descriptionId(J),description:H,schema:A,uiSchema:i,registry:h}),rawDescription:H,help:Z,rawHelp:"string"==typeof G?G:void 0,errors:ee,rawErrors:R?void 0:K,id:J,label:$,hidden:Q,onChange:u,onKeyChange:c,onDropPropertyClick:m,required:p,disabled:U,readonly:q,hideError:R,displayLabel:V,classNames:X.join(" ").trim(),style:F.style,formContext:E,formData:n,schema:A,uiSchema:i,registry:h},re=h.fields.AnyOfField,ae=h.fields.OneOfField,ie=(null==i?void 0:i["ui:field"])&&!0===(null==i?void 0:i["ui:fieldReplacesAnyOrOneOf"]);return f.default.createElement(D,C({},te),f.default.createElement(f.default.Fragment,null,z,A.anyOf&&!ie&&!S.isSelect(A)&&f.default.createElement(re,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:E,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.anyOf.map((function(e){return S.retrieveSchema(y.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i}),A.oneOf&&!ie&&!S.isSelect(A)&&f.default.createElement(ae,{name:d,disabled:U,readonly:q,hideError:R,errorSchema:o,formData:n,formContext:E,idPrefix:l,idSchema:w,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:A.oneOf.map((function(e){return S.retrieveSchema(y.default(e)?e:{},n)})),baseType:A.type,registry:h,schema:A,uiSchema:i})))}var Y=function(e){function t(){return e.apply(this,arguments)||this}F(t,e);var a=t.prototype;return a.shouldComponentUpdate=function(e){return!r.deepEquals(this.props,e)},a.render=function(){return f.default.createElement(L,C({},this.props))},t}(f.default.Component),$=["widget","placeholder"];function z(e){var t=e.schema,a=e.name,i=e.uiSchema,n=e.idSchema,o=e.formData,l=e.required,s=e.disabled,d=void 0!==s&&s,u=e.readonly,c=void 0!==u&&u,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,v=e.onBlur,y=e.onFocus,g=e.registry,b=e.rawErrors,E=t.title,S=t.format,F=g.widgets,D=g.formContext,k=g.schemaUtils.isSelect(t)?r.optionsList(t):void 0,x=k?"select":"text";S&&r.hasWidget(t,S,F)&&(x=S);var T=r.getUiOptions(i),A=T.widget,N=void 0===A?x:A,w=T.placeholder,I=void 0===w?"":w,B=O(T,$),U=r.getWidget(t,N,F);return f.default.createElement(U,{options:C({},B,{enumOptions:k}),schema:t,uiSchema:i,id:n.$id,label:void 0===E?a:E,value:o,onChange:h,onBlur:v,onFocus:y,required:l,disabled:d,readonly:c,formContext:D,autofocus:p,registry:g,placeholder:I,rawErrors:b})}function J(e){var r=e.formData,a=e.onChange;return t.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function H(e){var t=e.idSchema,a=e.description,i=e.registry,n=e.schema,o=e.uiSchema,l=r.getUiOptions(o),s=l.label;if(!a||void 0!==s&&!s)return null;var d=r.getTemplate("DescriptionFieldTemplate",i,l);return f.default.createElement(d,{id:r.descriptionId(t),description:a,schema:n,uiSchema:o,registry:i})}function G(e){var t=e.disabled,r=e.hasToolbar,a=e.hasMoveDown,i=e.hasMoveUp,n=e.hasRemove,o=e.index,l=e.onDropIndexClick,s=e.onReorderClick,d=e.readonly,u=e.registry,c=e.uiSchema,m=u.templates.ButtonTemplates,p=m.MoveDownButton,h=m.MoveUpButton,v=m.RemoveButton,y={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return f.default.createElement("div",{className:e.className},f.default.createElement("div",{className:r?"col-xs-9":"col-xs-12"},e.children),r&&f.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},f.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(i||a)&&f.default.createElement(h,{style:y,disabled:t||d||!i,onClick:s(o,o-1),uiSchema:c,registry:u}),(i||a)&&f.default.createElement(p,{style:y,disabled:t||d||!a,onClick:s(o,o+1),uiSchema:c,registry:u}),n&&f.default.createElement(v,{style:y,disabled:t||d,onClick:l(o),uiSchema:c,registry:u}))))}var Q=["key"];function X(e){var t=e.canAdd,a=e.className,i=e.disabled,n=e.idSchema,o=e.uiSchema,l=e.items,s=e.onAddClick,d=e.readonly,u=e.registry,c=e.required,m=e.schema,p=e.title,h=r.getUiOptions(o),v=r.getTemplate("ArrayFieldDescriptionTemplate",u,h),y=r.getTemplate("ArrayFieldItemTemplate",u,h),g=r.getTemplate("ArrayFieldTitleTemplate",u,h),b=u.templates.ButtonTemplates.AddButton;return f.default.createElement("fieldset",{className:a,id:n.$id},f.default.createElement(g,{idSchema:n,title:h.title||p,required:c,schema:m,uiSchema:o,registry:u}),f.default.createElement(v,{idSchema:n,description:h.description||m.description,schema:m,uiSchema:o,registry:u}),f.default.createElement("div",{className:"row array-item-list"},l&&l.map((function(e){var t=e.key,r=O(e,Q);return f.default.createElement(y,C({key:t},r))}))),t&&f.default.createElement(b,{className:"array-item-add",onClick:s,disabled:i||d,uiSchema:o,registry:u}))}function Z(e){var t=e.idSchema,a=e.title,i=e.schema,n=e.uiSchema,o=e.required,l=e.registry,s=r.getUiOptions(n),d=s.label;if(!a||void 0!==d&&!d)return null;var u=r.getTemplate("TitleFieldTemplate",l,s);return f.default.createElement(u,{id:r.titleId(t),title:a,required:o,schema:i,uiSchema:n,registry:l})}var ee=["id","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","options","schema","uiSchema","formContext","registry","rawErrors","type"];function te(e){var a=e.id,i=e.value,n=e.readonly,o=e.disabled,l=e.autofocus,s=e.onBlur,d=e.onFocus,u=e.onChange,c=e.options,m=e.schema,p=e.type,h=O(e,ee);if(!a)throw console.log("No id for",e),new Error("no id for props "+JSON.stringify(e));var v,y=C({},h,r.getInputProps(m,p,c));v="number"===y.type||"integer"===y.type?i||0===i?i:"":null==i?"":i;var g=t.useCallback((function(e){var t=e.target.value;return u(""===t?c.emptyValue:t)}),[u,c]),b=t.useCallback((function(e){return s(a,e.target.value)}),[s,a]),E=t.useCallback((function(e){return d(a,e.target.value)}),[d,a]);return f.default.createElement(f.default.Fragment,null,f.default.createElement("input",C({id:a,name:a,className:"form-control",readOnly:n,disabled:o,autoFocus:l,value:v},y,{list:m.examples?r.examplesId(a):void 0,onChange:g,onBlur:b,onFocus:E,"aria-describedby":r.ariaDescribedByIds(a,!!m.examples)})),Array.isArray(m.examples)&&f.default.createElement("datalist",{key:"datalist_"+a,id:r.examplesId(a)},m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map((function(e){return f.default.createElement("option",{key:e,value:e})}))))}function re(e){var t=r.getSubmitButtonOptions(e.uiSchema),a=t.submitText,i=t.props,n=void 0===i?{}:i;return t.norender?null:f.default.createElement("div",null,f.default.createElement("button",C({type:"submit"},n,{className:"btn btn-info "+n.className}),a))}var ae=["iconType","icon","className","uiSchema","registry"];function ie(e){var t=e.iconType,r=void 0===t?"default":t,a=e.icon,i=e.className,n=O(e,ae);return f.default.createElement("button",C({type:"button",className:"btn btn-"+r+" "+i},n),f.default.createElement("i",{className:"glyphicon glyphicon-"+a}))}function ne(e){return f.default.createElement(ie,C({title:"Move down",className:"array-item-move-down"},e,{icon:"arrow-down"}))}function oe(e){return f.default.createElement(ie,C({title:"Move up",className:"array-item-move-up"},e,{icon:"arrow-up"}))}function le(e){return f.default.createElement(ie,C({title:"Remove",className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function se(e){return f.default.createElement("div",{className:"row"},f.default.createElement("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className},f.default.createElement(ie,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:e.onClick,disabled:e.disabled,registry:e.registry})))}function de(e){var t=e.description;return t?f.default.createElement("string"==typeof t?"p":"div",{id:e.id,className:"field-description"},t):null}function ue(e){var t=e.errors;return f.default.createElement("div",{className:"panel panel-danger errors"},f.default.createElement("div",{className:"panel-heading"},f.default.createElement("h3",{className:"panel-title"},"Errors")),f.default.createElement("ul",{className:"list-group"},t.map((function(e,t){return f.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)}))))}function ce(e){var t=e.label;return t?f.default.createElement("label",{className:"control-label",htmlFor:e.id},t,e.required&&f.default.createElement("span",{className:"required"},"*")):null}function me(e){var t=e.id,a=e.label,i=e.children,n=e.errors,o=e.help,l=e.description,s=e.hidden,d=e.required,u=e.displayLabel,c=e.registry,m=r.getUiOptions(e.uiSchema),p=r.getTemplate("WrapIfAdditionalTemplate",c,m);return s?f.default.createElement("div",{className:"hidden"},i):f.default.createElement(p,C({},e),u&&f.default.createElement(ce,{label:a,required:d,id:t}),u&&l?l:null,i,n,o)}function fe(e){var t=e.errors,a=void 0===t?[]:t;if(0===a.length)return null;var i=r.errorId(e.idSchema);return f.default.createElement("div",null,f.default.createElement("ul",{id:i,className:"error-detail bs-callout bs-callout-info"},a.filter((function(e){return!!e})).map((function(e,t){return f.default.createElement("li",{className:"text-danger",key:t},e)}))))}function pe(e){var t=e.help;if(!t)return null;var a=r.helpId(e.idSchema);return f.default.createElement("string"==typeof t?"p":"div",{id:a,className:"help-block"},t)}function he(e){var t=e.description,a=e.disabled,i=e.formData,n=e.idSchema,o=e.onAddClick,l=e.properties,s=e.readonly,d=e.registry,u=e.required,c=e.schema,m=e.title,p=e.uiSchema,h=r.getUiOptions(p),v=r.getTemplate("TitleFieldTemplate",d,h),y=r.getTemplate("DescriptionFieldTemplate",d,h),g=d.templates.ButtonTemplates.AddButton;return f.default.createElement("fieldset",{id:n.$id},(h.title||m)&&f.default.createElement(v,{id:r.titleId(n),title:h.title||m,required:u,schema:c,uiSchema:p,registry:d}),(h.description||t)&&f.default.createElement(y,{id:r.descriptionId(n),description:h.description||t,schema:c,uiSchema:p,registry:d}),l.map((function(e){return e.content})),r.canExpand(c,p,i)&&f.default.createElement(g,{className:"object-property-expand",onClick:o(c),disabled:a||s,uiSchema:p,registry:d}))}function ve(e){return f.default.createElement("legend",{id:e.id},e.title,e.required&&f.default.createElement("span",{className:"required"},"*"))}function ye(e){var t=e.schema,r=e.idSchema,a=e.reason;return f.default.createElement("div",{className:"unsupported-field"},f.default.createElement("p",null,"Unsupported field schema",r&&r.$id&&f.default.createElement("span",null," for"," field ",f.default.createElement("code",null,r.$id)),a&&f.default.createElement("em",null,": ",a),"."),t&&f.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ge(e){var t=e.id,a=e.disabled,i=e.label,n=e.onKeyChange,o=e.onDropPropertyClick,l=e.readonly,s=e.children,d=e.uiSchema,u=e.registry,c=u.templates.ButtonTemplates.RemoveButton;return f.default.createElement("div",{className:e.classNames,style:e.style},r.ADDITIONAL_PROPERTY_FLAG in e.schema?f.default.createElement("div",{className:"row"},f.default.createElement("div",{className:"col-xs-5 form-additional"},f.default.createElement("div",{className:"form-group"},f.default.createElement(ce,{label:i+" Key",required:e.required,id:t+"-key"}),f.default.createElement("input",{className:"form-control",type:"text",id:t+"-key",onBlur:function(e){return n(e.target.value)},defaultValue:i}))),f.default.createElement("div",{className:"form-additional form-group col-xs-5"},s),f.default.createElement("div",{className:"col-xs-2"},f.default.createElement(c,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||l,onClick:o(i),uiSchema:d,registry:u}))):s)}function be(e,t){for(var a=[],i=e;i<=t;i++)a.push({value:i,label:r.pad(i,2)});return a}function Ee(e){var t=e.type,a=e.range,i=e.value,n=e.select,o=e.rootId,l=e.disabled,s=e.readonly,d=e.autofocus,u=e.registry,c=e.onBlur,m=e.onFocus;return f.default.createElement(u.widgets.SelectWidget,{schema:{type:"integer"},id:o+"_"+t,className:"form-control",options:{enumOptions:be(a[0],a[1])},placeholder:t,value:i,disabled:l,readonly:s,autofocus:d,onChange:function(e){return n(t,e)},onBlur:c,onFocus:m,registry:u,label:"","aria-describedby":r.ariaDescribedByIds(o)})}function Se(e){var a=e.time,i=void 0!==a&&a,n=e.disabled,o=void 0!==n&&n,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.options,m=e.id,p=e.registry,h=e.onBlur,v=e.onFocus,y=e.onChange,g=e.value,b=t.useReducer((function(e,t){return C({},e,t)}),r.parseDateString(g,i)),E=b[0],S=b[1];t.useEffect((function(){g&&g!==r.toDateString(E,i)&&S(r.parseDateString(g,i))}),[g,E,i]),t.useEffect((function(){(function(e){return Object.values(e).every((function(e){return-1!==e}))})(E)&&y(r.toDateString(E,i))}),[E,i,y]);var F=t.useCallback((function(e,t){var r;S(((r={})[e]=t,r))}),[]),D=t.useCallback((function(e){if(e.preventDefault(),!o&&!s){var t=r.parseDateString((new Date).toJSON(),i);S(t)}}),[o,s,i]),O=t.useCallback((function(e){e.preventDefault(),o||s||(S(r.parseDateString("",i)),y(void 0))}),[o,s,i,y]);return f.default.createElement("ul",{className:"list-inline"},function(e,t,r){void 0===r&&(r=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:r,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return t&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}(E,i,c.yearsRange).map((function(e,t){return f.default.createElement("li",{key:t},f.default.createElement(Ee,C({rootId:m,select:F},e,{disabled:o,readonly:s,registry:p,onBlur:h,onFocus:v,autofocus:u&&0===t})))})),("undefined"===c.hideNowButton||!c.hideNowButton)&&f.default.createElement("li",null,f.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:D},"Now")),("undefined"===c.hideClearButton||!c.hideClearButton)&&f.default.createElement("li",null,f.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:O},"Clear")))}var Ce=["time"];function Fe(e){var t=e.time,r=void 0===t||t,a=O(e,Ce);return f.default.createElement(a.registry.widgets.AltDateWidget,C({time:r},a))}function De(e){var a=e.schema,i=e.uiSchema,n=e.id,o=e.value,l=e.disabled,s=e.readonly,d=e.label,u=e.autofocus,c=void 0!==u&&u,m=e.onBlur,p=e.onFocus,h=e.onChange,v=e.registry,y=r.getTemplate("DescriptionFieldTemplate",v,e.options),g=r.schemaRequiresTrueValue(a),b=t.useCallback((function(e){return h(e.target.checked)}),[h]),E=t.useCallback((function(e){return m(n,e.target.checked)}),[m,n]),S=t.useCallback((function(e){return p(n,e.target.checked)}),[p,n]);return f.default.createElement("div",{className:"checkbox "+(l||s?"disabled":"")},a.description&&f.default.createElement(y,{id:r.descriptionId(n),description:a.description,schema:a,uiSchema:i,registry:v}),f.default.createElement("label",null,f.default.createElement("input",{type:"checkbox",id:n,name:n,checked:void 0!==o&&o,required:g,disabled:l||s,autoFocus:c,onChange:b,onBlur:E,onFocus:S,"aria-describedby":r.ariaDescribedByIds(n)}),f.default.createElement("span",null,d)))}function Oe(e){var a=e.id,i=e.disabled,n=e.options,o=n.inline,l=void 0!==o&&o,s=n.enumOptions,d=n.enumDisabled,u=n.emptyValue,c=e.value,m=e.autofocus,p=void 0!==m&&m,h=e.readonly,v=e.onChange,y=e.onBlur,g=e.onFocus,b=Array.isArray(c)?c:[c],E=t.useCallback((function(e){return y(a,r.enumOptionsValueForIndex(e.target.value,s,u))}),[y,a]),S=t.useCallback((function(e){return g(a,r.enumOptionsValueForIndex(e.target.value,s,u))}),[g,a]);return f.default.createElement("div",{className:"checkboxes",id:a},Array.isArray(s)&&s.map((function(e,t){var n=r.enumOptionsIsSelected(e.value,b),o=Array.isArray(d)&&-1!==d.indexOf(e.value),u=i||o||h?"disabled":"",c=f.default.createElement("span",null,f.default.createElement("input",{type:"checkbox",id:r.optionId(a,t),name:a,checked:n,value:String(t),disabled:i||o||h,autoFocus:p&&0===t,onChange:function(e){v(e.target.checked?r.enumOptionsSelectValue(t,b,s):r.enumOptionsDeselectValue(t,b,s))},onBlur:E,onFocus:S,"aria-describedby":r.ariaDescribedByIds(a)}),f.default.createElement("span",null,e.label));return l?f.default.createElement("label",{key:t,className:"checkbox-inline "+u},c):f.default.createElement("div",{key:t,className:"checkbox "+u},f.default.createElement("label",null,c))})))}function ke(e){var t=e.disabled,a=e.readonly,i=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(i,C({type:"color"},e,{disabled:t||a}))}function xe(e){var a=e.onChange,i=r.getTemplate("BaseInputTemplate",e.registry,e.options),n=t.useCallback((function(e){return a(e||void 0)}),[a]);return f.default.createElement(i,C({type:"date"},e,{onChange:n}))}function Te(e){var t=e.onChange,a=e.value,i=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(i,C({type:"datetime-local"},e,{value:r.utcToLocal(a),onChange:function(e){return t(r.localToUTC(e))}}))}function Ae(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"email"},e))}function Ne(e,t){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(t)+";base64")}function we(e){var t=e.name,r=e.size,a=e.type;return new Promise((function(i,n){var o=new window.FileReader;o.onerror=n,o.onload=function(e){var n;"string"==typeof(null===(n=e.target)||void 0===n?void 0:n.result)?i({dataURL:Ne(e.target.result,t),name:t,size:r,type:a}):i({dataURL:null,name:t,size:r,type:a})},o.readAsDataURL(e)}))}function Ie(e){var t=e.filesInfo;return 0===t.length?null:f.default.createElement("ul",{className:"file-info"},t.map((function(e,t){var r=e.size,a=e.type;return f.default.createElement("li",{key:t},f.default.createElement("strong",null,e.name)," (",a,", ",r," bytes)")})))}function Be(e){return e.filter((function(e){return void 0!==e})).map((function(e){var t=r.dataURItoBlob(e),a=t.blob;return{name:t.name,size:a.size,type:a.type}}))}function Ue(e){var a=e.multiple,i=e.id,n=e.readonly,o=e.disabled,l=e.onChange,s=e.value,d=e.autofocus,u=void 0!==d&&d,c=e.options,m=t.useMemo((function(){return Array.isArray(s)?Be(s):Be([s])}),[s]),p=t.useState(m),h=p[0],v=p[1],y=t.useCallback((function(e){var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(we))).then((function(e){v(e);var t=e.map((function(e){return e.dataURL}));l(a?t:t[0])}))}),[a,l]);return f.default.createElement("div",null,f.default.createElement("p",null,f.default.createElement("input",{id:i,name:i,type:"file",disabled:n||o,onChange:y,defaultValue:"",autoFocus:u,multiple:a,accept:c.accept?String(c.accept):void 0,"aria-describedby":r.ariaDescribedByIds(i)})),f.default.createElement(Ie,{filesInfo:h}))}function qe(e){var t=e.id,r=e.value;return f.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===r?"":r})}function Pe(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"password"},e))}function Re(e){var a=e.options,i=e.value,n=e.required,o=e.disabled,l=e.readonly,s=e.autofocus,d=void 0!==s&&s,u=e.onBlur,c=e.onFocus,m=e.onChange,p=e.id,h=Math.random().toString(),v=a.enumOptions,y=a.enumDisabled,g=a.inline,b=a.emptyValue,E=t.useCallback((function(e){return u(p,r.enumOptionsValueForIndex(e.target.value,v,b))}),[u,p]),S=t.useCallback((function(e){return c(p,r.enumOptionsValueForIndex(e.target.value,v,b))}),[c,p]);return f.default.createElement("div",{className:"field-radio-group",id:p},Array.isArray(v)&&v.map((function(e,t){var a=r.enumOptionsIsSelected(e.value,i),s=Array.isArray(y)&&-1!==y.indexOf(e.value),u=o||s||l?"disabled":"",c=f.default.createElement("span",null,f.default.createElement("input",{type:"radio",id:r.optionId(p,t),checked:a,name:h,required:n,value:String(t),disabled:o||s||l,autoFocus:d&&0===t,onChange:function(){return m(e.value)},onBlur:E,onFocus:S,"aria-describedby":r.ariaDescribedByIds(p)}),f.default.createElement("span",null,e.label));return g?f.default.createElement("label",{key:t,className:"radio-inline "+u},c):f.default.createElement("div",{key:t,className:"radio "+u},f.default.createElement("label",null,c))})))}function _e(e){var t=e.value;return f.default.createElement("div",{className:"field-range-wrapper"},f.default.createElement(e.registry.templates.BaseInputTemplate,C({type:"range"},e)),f.default.createElement("span",{className:"range-view"},t))}function Ve(e,t){return t?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function je(e){var a=e.schema,i=e.id,n=e.options,o=e.value,l=e.required,s=e.disabled,d=e.readonly,u=e.multiple,c=void 0!==u&&u,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,v=e.onBlur,y=e.onFocus,g=e.placeholder,b=n.enumOptions,E=n.enumDisabled,S=n.emptyValue,C=c?[]:"",F=t.useCallback((function(e){var t=Ve(e,c);return y(i,r.enumOptionsValueForIndex(t,b,S))}),[y,i,a,c,n]),D=t.useCallback((function(e){var t=Ve(e,c);return v(i,r.enumOptionsValueForIndex(t,b,S))}),[v,i,a,c,n]),O=t.useCallback((function(e){var t=Ve(e,c);return h(r.enumOptionsValueForIndex(t,b,S))}),[h,a,c,n]),k=r.enumOptionsIndexForValue(o,b,c);return f.default.createElement("select",{id:i,name:i,multiple:c,className:"form-control",value:void 0===k?C:k,required:l,disabled:s||d,autoFocus:p,onBlur:D,onFocus:F,onChange:O,"aria-describedby":r.ariaDescribedByIds(i)},!c&&void 0===a.default&&f.default.createElement("option",{value:""},g),Array.isArray(b)&&b.map((function(e,t){var r=e.label,a=E&&-1!==E.indexOf(e.value);return f.default.createElement("option",{key:t,value:String(t),disabled:a},r)})))}function Ke(e){var a=e.id,i=e.options,n=void 0===i?{}:i,o=e.placeholder,l=e.value,s=e.required,d=e.disabled,u=e.readonly,c=e.autofocus,m=void 0!==c&&c,p=e.onChange,h=e.onBlur,v=e.onFocus,y=t.useCallback((function(e){var t=e.target.value;return p(""===t?n.emptyValue:t)}),[p,n.emptyValue]),g=t.useCallback((function(e){return h(a,e.target.value)}),[h,a]),b=t.useCallback((function(e){return v(a,e.target.value)}),[a,v]);return f.default.createElement("textarea",{id:a,name:a,className:"form-control",value:l||"",placeholder:o,required:s,disabled:d,readOnly:u,autoFocus:m,rows:n.rows,onBlur:g,onFocus:b,onChange:y,"aria-describedby":r.ariaDescribedByIds(a)})}function Me(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({},e))}function We(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"url"},e))}function Le(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"number"},e))}function Ye(){return{fields:{AnyOfField:R,ArrayField:I,BooleanField:U,NumberField:j,ObjectField:K,OneOfField:R,SchemaField:Y,StringField:z,NullField:J},templates:{ArrayFieldDescriptionTemplate:H,ArrayFieldItemTemplate:G,ArrayFieldTemplate:X,ArrayFieldTitleTemplate:Z,ButtonTemplates:{SubmitButton:re,AddButton:se,MoveDownButton:ne,MoveUpButton:oe,RemoveButton:le},BaseInputTemplate:te,DescriptionFieldTemplate:de,ErrorListTemplate:ue,FieldTemplate:me,FieldErrorTemplate:fe,FieldHelpTemplate:pe,ObjectFieldTemplate:he,TitleFieldTemplate:ve,UnsupportedFieldTemplate:ye,WrapIfAdditionalTemplate:ge},widgets:{PasswordWidget:Pe,RadioWidget:Re,UpDownWidget:Le,RangeWidget:_e,SelectWidget:je,TextWidget:Me,DateWidget:xe,DateTimeWidget:Te,AltDateWidget:Se,AltDateTimeWidget:Fe,EmailWidget:Ae,URLWidget:We,TextareaWidget:Ke,HiddenWidget:qe,ColorWidget:ke,FileWidget:Ue,CheckboxWidget:De,CheckboxesWidget:Oe},rootSchema:{},formContext:{}}}Ke.defaultProps={autofocus:!1,options:{}};var $e=function(e){function t(t){var a;if((a=e.call(this,t)||this).formElement=void 0,a.getUsedFormData=function(e,t){if(0===t.length&&"object"!=typeof e)return e;var r=v.default(e,t);return Array.isArray(e)?Object.keys(r).map((function(e){return r[e]})):r},a.getFieldNames=function(e,t){return function e(a,i,n){return void 0===i&&(i=[]),void 0===n&&(n=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var l=n.map((function(e){return[].concat(e,[o])}));a[o][r.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][r.NAME_KEY]?i.push(a[o][r.NAME_KEY]):e(a[o],i,l)}else o===r.NAME_KEY&&""!==a[o]&&n.forEach((function(e){var r=p.default(t,e);("object"!=typeof r||h.default(r))&&i.push(e)}))})),i}(e)},a.onChange=function(e,t,i){var n=a.props,o=n.extraErrors,l=n.omitExtraData,s=n.liveOmit,d=n.noValidate,u=n.liveValidate,c=n.onChange,m=a.state,f=m.schemaUtils,p=m.schema;(r.isObject(e)||Array.isArray(e))&&(e=a.getStateFromProps(a.props,e).formData);var h=!d&&u,v={formData:e,schema:p},y=e;if(!0===l&&!0===s){var g=f.retrieveSchema(p,e),b=f.toPathSchema(g,"",e),E=a.getFieldNames(b,e);y=a.getUsedFormData(e,E),v={formData:y}}if(h){var S=a.validate(y),F=S.errors,D=S.errorSchema,O=F,k=D;if(o){var x=f.mergeValidationData(S,o);D=x.errorSchema,F=x.errors}v={formData:y,errors:F,errorSchema:D,schemaValidationErrors:O,schemaValidationErrorSchema:k}}else if(!d&&t){var T=o?r.mergeObjects(t,o,"preventDuplicates"):t;v={formData:y,errorSchema:T,errors:f.getValidator().toErrorList(T)}}a.setState(v,(function(){return c&&c(C({},a.state,v),i)}))},a.onBlur=function(e,t){var r=a.props.onBlur;r&&r(e,t)},a.onFocus=function(e,t){var r=a.props.onFocus;r&&r(e,t)},a.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var t=a.props,r=t.extraErrors,i=t.noValidate,n=t.onSubmit,o=a.state.formData,l=a.state,s=l.schemaUtils;if(!0===t.omitExtraData){var d=s.retrieveSchema(l.schema,o),u=s.toPathSchema(d,"",o),c=a.getFieldNames(u,o);o=a.getUsedFormData(o,c)}if(i||a.validateForm()){var m=r||{},f=r?s.getValidator().toErrorList(r):[];a.setState({formData:o,errors:f,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){n&&n(C({},a.state,{formData:o,status:"submitted"}),e)}))}}},!t.validator)throw new Error("A validator is required for Form functionality to work");return a.state=a.getStateFromProps(t,t.formData),a.props.onChange&&!r.deepEquals(a.state.formData,a.props.formData)&&a.props.onChange(a.state),a.formElement=f.default.createRef(),a}F(t,e);var a=t.prototype;return a.UNSAFE_componentWillReceiveProps=function(e){var t=this.getStateFromProps(e,e.formData);r.deepEquals(t.formData,e.formData)||r.deepEquals(t.formData,this.state.formData)||!e.onChange||e.onChange(t),this.setState(t)},a.getStateFromProps=function(e,t){var a=this.state||{},i="schema"in e?e.schema:this.props.schema,n=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==t,l=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=i,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=r.createSchemaUtils(e.validator,s));var u,c,m=d.getDefaultFormState(i,t,"excludeObjectChildren"),f=d.retrieveSchema(i,m),p=a.schemaValidationErrors,h=a.schemaValidationErrorSchema;if(l){var v=this.validate(m,i,d);p=u=v.errors,h=c=v.errorSchema}else{var y=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=y.errors,c=y.errorSchema}if(e.extraErrors){var g=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=g.errorSchema,u=g.errors}var b=d.toIdSchema(f,n["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:i,uiSchema:n,idSchema:b,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:p,schemaValidationErrorSchema:h}},a.shouldComponentUpdate=function(e,t){return r.shouldRender(this,e,t)},a.validate=function(e,t,r){void 0===t&&(t=this.props.schema);var a=r||this.state.schemaUtils,i=this.props,n=i.customValidate,o=i.transformErrors,l=i.uiSchema,s=a.retrieveSchema(t,e);return a.getValidator().validateFormData(e,s,n,o,l)},a.renderErrors=function(e){var t=this.state,a=t.errors,i=t.errorSchema,n=t.schema,o=t.uiSchema,l=this.props.formContext,s=r.getUiOptions(o),d=r.getTemplate("ErrorListTemplate",e,s);return a&&a.length?f.default.createElement(d,{errors:a,errorSchema:i||{},schema:n,uiSchema:o,formContext:l}):null},a.getRegistry=function(){var e,t=this.state.schemaUtils,r=Ye(),a=r.templates,i=r.widgets,n=r.formContext;return{fields:C({},r.fields,this.props.fields),templates:C({},a,this.props.templates,{ButtonTemplates:C({},a.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:C({},i,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||n,schemaUtils:t}},a.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},a.validateForm=function(){var e=this.props,t=e.extraErrors,r=e.onError,a=this.state.schemaUtils,i=this.validate(this.state.formData),n=i.errors,o=i.errorSchema,l=n,s=o;if(n.length>0){if(t){var d=a.mergeValidationData(i,t);o=d.errorSchema,n=d.errors}return this.setState({errors:n,errorSchema:o,schemaValidationErrors:l,schemaValidationErrorSchema:s},(function(){r?r(n):console.error("Form validation failed",n)})),!1}return!0},a.render=function(){var e=this.props,t=e.children,r=e.id,a=e.idPrefix,i=e.idSeparator,n=e.className,o=void 0===n?"":n,l=e.tagName,s=e.name,d=e.method,u=e.target,c=e.action,m=e.autoComplete,p=e.enctype,h=e.acceptcharset,v=e.noHtml5Validate,y=void 0!==v&&v,g=e.disabled,b=void 0!==g&&g,E=e.readonly,S=void 0!==E&&E,C=e.formContext,F=e.showErrorList,D=void 0===F?"top":F,O=e._internalFormWrapper,k=this.state,x=k.schema,T=k.uiSchema,A=k.formData,N=k.errorSchema,w=k.idSchema,I=this.getRegistry(),B=I.fields.SchemaField,U=I.templates.ButtonTemplates.SubmitButton;return f.default.createElement(O||l||"form",{className:o||"rjsf",id:r,name:s,method:d,target:u,action:c,autoComplete:m,encType:p,acceptCharset:h,noValidate:y,onSubmit:this.onSubmit,as:O?l:void 0,ref:this.formElement},"top"===D&&this.renderErrors(I),f.default.createElement(B,{name:"",schema:x,uiSchema:T,errorSchema:N,idSchema:w,idPrefix:a,idSeparator:i,formContext:C,formData:A,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:I,disabled:b,readonly:S}),t||f.default.createElement(U,{uiSchema:T,registry:I}),"bottom"===D&&this.renderErrors(I))},t}(t.Component),ze=["fields","widgets","templates"];e.default=$e,e.getDefaultRegistry=Ye,e.withTheme=function(e){return t.forwardRef((function(t,r){var a,i,n=t.fields,o=t.widgets,l=t.templates,s=O(t,ze);return n=C({},null==e?void 0:e.fields,n),o=C({},null==e?void 0:e.widgets,o),l=C({},null==e?void 0:e.templates,l,{ButtonTemplates:C({},null==e||null===(a=e.templates)||void 0===a?void 0:a.ButtonTemplates,null===(i=l)||void 0===i?void 0:i.ButtonTemplates)}),f.default.createElement($e,C({},e,s,{fields:n,widgets:o,templates:l,ref:r}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=core.umd.production.min.js.map
{
"name": "@rjsf/core",
"version": "5.0.0-beta.20",
"version": "5.0.0",
"description": "A simple React component capable of building HTML forms out of a JSON schema.",

@@ -55,5 +55,5 @@ "scripts": {

"@babel/register": "^7.18.9",
"@rjsf/utils": "^5.0.0-beta.20",
"@rjsf/validator-ajv6": "^5.0.0-beta.20",
"@rjsf/validator-ajv8": "^5.0.0-beta.20",
"@rjsf/utils": "^5.0.0",
"@rjsf/validator-ajv6": "^5.0.0",
"@rjsf/validator-ajv8": "^5.0.0",
"@types/lodash": "^4.14.191",

@@ -97,3 +97,3 @@ "@types/react": "^17.0.39",

},
"gitHead": "da7c4b298abd59d19d58b4ce3cde47eecb6606b6"
"gitHead": "251bdbc60d2efdbab3a2b4058a2338d0d4794942"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc