//>>built
require({cache:{"url:app/ui/dialogs/templates/ManageConceptDialog.html":'\x3cdiv\x3e\n  \x3cdiv class\x3d"large-12 columns"\x3e\n    \x3cdiv class\x3d"large-4 columns"\x3e\n      \x3cdiv class\x3d"placeholder-container"\x3e\n        \x3clabel\x3eSCHEME\x3c/label\x3e\n        \x3cselect class\x3d"no-arrow-select" data-dojo-attach-point\x3d"schemeNode" disabled\x3e\x3c/select\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-4 columns"\x3e\n      \x3cdiv class\x3d"placeholder-container"\x3e\n        \x3clabel\x3eTYPE\x3c/label\x3e\n        \x3cselect data-dojo-attach-point\x3d"typeNode"\x3e\x3c/select\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3chr class\x3d"concept-hr"\x3e\n  \x3cdiv class\x3d"large-12 columns" style\x3d"padding-bottom: 20px;"\x3e\n    \x3cdiv data-dojo-type\x3d"dijit/layout/TabContainer"\n         data-dojo-attach-point\x3d"tabContainer"\n         data-dojo-props\x3d"doLayout:false"\n         class\x3d""\x3e\n\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Labels"\n           data-dojo-attach-point\x3d"tabLabels"\n           data-dojo-props\x3d"selected:true"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"labelsNode"\x3e[ LABELS ]\x3c/div\x3e\n      \x3c/div\x3e\n\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Notes"\n           data-dojo-attach-point\x3d"tabNotes"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"notesNode"\x3e[ NOTES ]\x3c/div\x3e\n      \x3c/div\x3e\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Sources"\n           data-dojo-attach-point\x3d"tabSources"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"sourcesNode"\x3e[ SOURCES ]\x3c/div\x3e\n      \x3c/div\x3e\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Relations"\n           data-dojo-attach-point\x3d"tabRelations"\n           style\x3d"max-height: 408px; overflow-y: scroll;"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"relationsNode"\x3e[ RELATIONS ]\x3c/div\x3e\n      \x3c/div\x3e\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Matches"\n           data-dojo-attach-point\x3d"tabMatches"\n           style\x3d"max-height: 408px; overflow-y: scroll;"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"matchesNode"\x3e[ MATCHES ]\x3c/div\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"large-12 columns text-center" style\x3d"margin-top: 30px; margin-bottom: 20px;"\x3e\n    \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _saveConcept"\x3eSave\x3c/a\x3e\n    \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _cancel"\x3eCancel\x3c/a\x3e\n  \x3c/div\x3e\n\x3c/div\x3e'}});
define("app/ui/dialogs/ManageConceptDialog","dojo/_base/declare dojo/_base/lang dojo/topic dojo/dom-attr dojo/on dijit/Dialog dijit/_Widget dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin ../../utils/DomUtils ../managers/LabelManager ../managers/NoteManager ../managers/RelationManager ../managers/MatchesManager ../managers/SourcesManager ../../utils/DomUtils dojo/text!./templates/ManageConceptDialog.html dijit/layout/TabContainer dijit/layout/ContentPane".split(" "),function(e,c,f,v,g,h,k,l,m,
w,n,p,q,r,t,d,u){return e([k,l,m],{templateString:u,baseClass:"concept-add-dialog",dialog:null,parent:null,concept:null,scheme:null,languageController:null,listController:null,conceptSchemeController:null,relationManager:null,labelManager:null,noteManager:null,matchesManager:null,sourcesManager:null,_mode:"add",postCreate:function(){this.inherited(arguments);this.dialog=new h({title:"Add new concept",style:"width: 1000px; min-height: 700px;"});this.dialog.closeText.innerHTML='\x3ci class\x3d"fa fa-times"\x3e\x3c/i\x3e';
this.dialog.set("content",this);d.addOptionsToSelect(this.typeNode,{data:this.listController.getConceptTypes(),idProperty:"value",labelProperty:"label"});g(this.typeNode,"change",c.hitch(this,function(a){this._toggleMatches(a.target.value);this._toggleRelations(a.target.value)}));d.addOptionsToSelect(this.schemeNode,{data:this.conceptSchemeController.conceptSchemeList,idProperty:"id",labelProperty:"name"});f.subscribe("languages.updated",c.hitch(this,function(){this.updateLanguages()}));this.scheme=
this.schemeNode.value;this._createLabelsTab();this._createNotesTab();this._createSourcesTab();this._createRelationsTab();this._createMatchesTab()},startup:function(){this.inherited(arguments);this.tabContainer.layout();this.dialog.resize()},showDialog:function(a,b,c){c&&(this._mode=c);a&&(this.schemeNode.value=a,this.updateScheme(a),this.dialog.set("title","Add new concept or collection"),this.relationManager.reset(),this.labelManager.reset(),this.noteManager.reset(),this.matchesManager.reset(),this.sourcesManager.reset(),
b&&(b.id&&this.dialog.set("title","Edit \x3cstrong\x3e"+b.label+"\x3c/strong\x3e"),this.relationManager.setConcept(b),this.labelManager.setConcept(b),this.noteManager.setConcept(b),this.matchesManager.setConcept(b),this.sourcesManager.setConcept(b),this.concept=b,this.typeNode.value=b.type,this._toggleMatches(b.type),this._toggleRelations(b.type)));this.dialog.show();this.tabContainer.selectChild(this.tabLabels);this.tabContainer.layout();this.dialog.resize()},updateScheme:function(a){this.scheme=
a;this.relationManager.setScheme(a)},updateLanguages:function(){this.languageController.getLanguageStore().fetch().then(c.hitch(this,function(a){this.noteManager.updateLanguages(a);this.labelManager.updateLanguages(a)}))},_toggleMatches:function(a){"collection"===a?(this.tabMatches.set("disabled",!0),this.tabContainer.selectedChildWidget===this.tabMatches&&this.tabContainer.selectChild(this.tabLabels)):this.tabMatches.set("disabled",!1)},_toggleRelations:function(a){"collection"===a?this.relationManager.setCollectionTypes():
this.relationManager.setConceptTypes()},_close:function(){this._reset();this.dialog.hide()},_saveConcept:function(a){a?a.preventDefault():null;a={};this.concept&&(a.id=this.concept.id||void 0,a.uri=this.concept.uri||void 0);a.concept_scheme=this.scheme;a.type=this.typeNode.value;var b=this.labelManager.getData();c.mixin(a,b);b=this.noteManager.getData();c.mixin(a,b);b=this.sourcesManager.getData();c.mixin(a,b);b=this.relationManager.getData();c.mixin(a,b);"collection"!==a.type&&(b=this.matchesManager.getData(),
c.mixin(a,b));"add"===this._mode?this.emit("new.concept.save",{concept:a,schemeId:this.schemeNode.value}):this.emit("concept.save",{concept:a,schemeId:this.schemeNode.value})},_cancel:function(a){a?a.preventDefault():null;this._close()},_reset:function(){this.schemeNode.selectedIndex=0;this.typeNode.selectedIndex=0;this.labelManager.reset();this.noteManager.reset();this.relationManager.reset();this.matchesManager.reset()},_createLabelsTab:function(a){this.languageController.getLanguageStore().fetch().then(c.hitch(this,
function(b){this.labelManager=new n({languageController:this.languageController,listController:this.listController,concept:a,languageList:b},this.labelsNode);this.labelManager.startup()}))},_createNotesTab:function(a){this.languageController.getLanguageStore().fetch().then(c.hitch(this,function(b){this.noteManager=new p({languageController:this.languageController,listController:this.listController,concept:a,languageList:b},this.notesNode);this.noteManager.startup()}))},_createSourcesTab:function(a){this.sourcesManager=
new t({listController:this.listController,concept:a},this.sourcesNode);this.sourcesManager.startup()},_createRelationsTab:function(a){this.relationManager=new q({languageController:this.languageController,listController:this.listController,conceptSchemeController:this.conceptSchemeController,scheme:this.scheme,concept:a},this.relationsNode);this.relationManager.startup();this.updateScheme(this.schemeNode.value)},_createMatchesTab:function(a){this.matchesManager=new r({languageController:this.languageController,
listController:this.listController,conceptSchemeController:this.conceptSchemeController,scheme:this.scheme,concept:a,matchTypes:this.listController.getMatchTypes()},this.matchesNode);this.matchesManager.startup()}})});
//# sourceMappingURL=ManageConceptDialog.js.map