angular.module("c8y.ui").component("c8ySchemaEditor",{bindings:{_schema:"<schema",onChange:"&"},templateUrl:":::PLUGIN_PATH:::/ui/schemaForm/schemaEditor.html",controller:function(){var n=this,s={type:"object",properties:{}},r=!1;_.assign(n,{schema:{},property:{},$onChanges:function(e){e._schema&&(n.schema=_.defaults(_.cloneDeep(n._schema),s),r=!0,n.properties=_.map(n.schema.properties,function(e,s){return{key:s,schema:e}}),0===n.properties.length)&&n.properties.push({key:"",schema:{type:"string"}})},$doCheck:function(){r&&(n.onChange({schema:n.schema,originalSchema:n._schema}),r=!1)},onPropertyChange:function(e,s){_.unset(n.schema,["properties",s.key]),_.set(n.schema,["properties",e.key],e.schema),s=_.find(n.properties,{key:s.key}),_.assign(s,e),r=!0}})},controllerAs:"vm"});