//>>built
require({cache:{"url:app/ui/managers/templates/RelationManager.html":'\x3cdiv\x3e\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"broaderContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eBroader\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addBroader" title\x3d"Add broader concept"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"broaderGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"narrowerContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eNarrower\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addNarrower" title\x3d"Add narrower concept"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"narrowerGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"relatedContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eRelated\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addRelated" title\x3d"Add related concept"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"relatedGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"membersContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eMembers\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addMembers" title\x3d"Add members"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"membersGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"memberOfContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eMember of\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addMemberOf" title\x3d"Add member of concept"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"memberOfGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"subordinateArraysContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eSubordinate arrays\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addSubordinateArray" title\x3d"Add subordinate array"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"subordinateGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row relation-row" data-dojo-attach-point\x3d"superordinatesCollContainerNode"\x3e\n    \x3cdiv class\x3d"large-11 columns"\x3e\n      \x3cp\x3eSuperordinates\x3c/p\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-1 columns"\x3e\n      \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _addSuperordinates" title\x3d"Add superordinates"\x3e\x3ci class\x3d"fa fa-plus"\x3e\x3c/i\x3e\x3c/a\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"row large-12 columns"\n       data-dojo-attach-point\x3d"superordinatesCollGridNode"\x3e\n  \x3c/div\x3e\n\n  \x3cdiv class\x3d"row" data-dojo-attach-point\x3d"inferConceptRelationsContainerNode" style\x3d"margin-top: 10px"\x3e\n    \x3cdiv class\x3d"placeholder-container radio-container"\x3e\n      \x3clabel style\x3d"width: 80%"\x3eShould member concepts of this collection be seen as narrower concept of a superordinate of the collection\x3c/label\x3e\n      \x3cinput type\x3d"radio" name\x3d"inferConceptRelations" data-dojo-attach-point\x3d"inferConceptRelationsYesNode" /\x3e Yes\n      \x3cinput type\x3d"radio" name\x3d"inferConceptRelations" data-dojo-attach-point\x3d"inferConceptRelationsNoNode" /\x3e No\n    \x3c/div\x3e\n  \x3c/div\x3e\n\n\x3c/div\x3e'}});
define("app/ui/managers/RelationManager","dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/dom-construct dojo/dom-class dojo/dom-style dojo/json dojo/topic dojo/on dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/RelationManager.html dstore/Memory dstore/Trackable dgrid/OnDemandGrid dgrid/extensions/DijitRegistry dgrid/extensions/ColumnResizer ../../utils/DomUtils ../dialogs/AddRelationDialog".split(" "),function(e,d,f,g,v,w,x,y,l,m,n,p,h,k,q,r,t,z,u){return e([m,n],{templateString:p,
baseClass:"relation-manager",languageController:null,listController:null,conceptSchemeController:null,concept:null,scheme:null,_broaderStore:null,_broaderGrid:null,_narrowerStore:null,_narrowerGrid:null,_relatedStore:null,_relatedGrid:null,_memberOfStore:null,_memberOfGrid:null,_membersStore:null,_membersGrid:null,_subordinateStore:null,_subordinateGrid:null,_superordinatesCollStore:null,_superordinatesCollGrid:null,_index:0,_isCollection:null,_relationStore:null,_addRelationDialog:null,postCreate:function(){this.inherited(arguments);
this.trackableMemory=e([h,k]);this._broaderStore=new this.trackableMemory({data:this.concept?this.concept.broader:[]});this._broaderGrid=this._createGrid({collection:this._broaderStore,type:"broader"},this.broaderGridNode);this._narrowerStore=new this.trackableMemory({data:this.concept?this.concept.narrower:[]});this._narrowerGrid=this._createGrid({collection:this._narrowerStore,type:"narrower"},this.narrowerGridNode);this._relatedStore=new this.trackableMemory({data:this.concept?this.concept.related:
[]});this._relatedGrid=this._createGrid({collection:this._relatedStore,type:"related"},this.relatedGridNode);this._memberOfStore=new this.trackableMemory({data:this.concept?this.concept.member_of:[]});this._memberOfGrid=this._createGrid({collection:this._memberOfStore,type:"memberOf"},this.memberOfGridNode);this._membersStore=new this.trackableMemory({data:this.concept?this.concept.members:[]});this._membersGrid=this._createGrid({collection:this._membersStore,type:"members"},this.membersGridNode);
this._subordinateStore=new this.trackableMemory({data:this.concept?this.concept.subordinate_arrays:[]});this._subordinateGrid=this._createGrid({collection:this._subordinateStore,type:"subordinate"},this.subordinateGridNode);this._superordinatesCollStore=new this.trackableMemory({data:this.concept?this.concept.superordinates:[]});this._superordinatesCollGrid=this._createGrid({collection:this._superordinatesCollStore,type:"superordinate"},this.superordinatesCollGridNode);this._relationStore=this.conceptSchemeController.getConceptSchemeTree(this.scheme);
this._addRelationDialog=new u({parentNode:this,relationStore:this._relationStore,concept:this.concept,scheme:this.scheme});this._addRelationDialog.startup();this.own(l(this._addRelationDialog,"ok",f.hitch(this,function(a){this._addRelation(a.conceptId,a.conceptLabel,a.conceptPath,a.relation)})));this.concept&&"collection"===this.concept.type?this.setCollectionTypes():this.setConceptTypes()},startup:function(){this.inherited(arguments);this._broaderGrid.startup();this._narrowerGrid.startup();this._relatedGrid.startup();
this._memberOfGrid.startup();this._membersGrid.startup();this._subordinateGrid.startup();this._superordinatesCollGrid.startup()},setScheme:function(a){this.scheme=a;this._relationStore=this.conceptSchemeController.getConceptSchemeTree(this.scheme);this._addRelationDialog.setScheme(a)},reset:function(){var a=e([h,k]);this._broaderStore=new a({data:[]});this._broaderGrid.set("collection",this._broaderStore);this._narrowerStore=new a({data:[]});this._narrowerGrid.set("collection",this._narrowerStore);
this._relatedStore=new a({data:[]});this._relatedGrid.set("collection",this._relatedStore);this._memberOfStore=new a({data:[]});this._memberOfGrid.set("collection",this._memberOfStore);this._subordinateStore=new a({data:[]});this._subordinateGrid.set("collection",this._subordinateStore);this._superordinatesCollStore=new a({data:[]});this._superordinatesCollGrid.set("collection",this._superordinatesCollStore);this.inferConceptRelationsYesNode.checked=!1;this.inferConceptRelationsNoNode.checked=!1},
setCollectionTypes:function(){this._isCollection=!0;this.broaderContainerNode.style.display="none";this.broaderGridNode.style.display="none";this.narrowerContainerNode.style.display="none";this.narrowerGridNode.style.display="none";this.relatedContainerNode.style.display="none";this.relatedGridNode.style.display="none";this.subordinateArraysContainerNode.style.display="none";this.subordinateGridNode.style.display="none";this.superordinatesCollContainerNode.style.display="block";this.superordinatesCollGridNode.style.display=
"block";this.membersContainerNode.style.display="block";this.membersGridNode.style.display="block";this.inferConceptRelationsContainerNode.style.display="block"},setConceptTypes:function(){this._isCollection=!1;this.broaderContainerNode.style.display="block";this.broaderGridNode.style.display="block";this.narrowerContainerNode.style.display="block";this.narrowerGridNode.style.display="block";this.relatedContainerNode.style.display="block";this.relatedGridNode.style.display="block";this.subordinateArraysContainerNode.style.display=
"block";this.subordinateGridNode.style.display="block";this.membersContainerNode.style.display="none";this.membersGridNode.style.display="none";this.superordinatesCollContainerNode.style.display="none";this.superordinatesCollGridNode.style.display="none";this.inferConceptRelationsContainerNode.style.display="none"},_createGrid:function(a,c){var b={label:{label:""},remove:{label:"",renderCell:f.hitch(this,function(b){if(void 0===b.id)return null;var c=g.create("div",{"class":"dGridHyperlink"});g.create("a",
{href:"#",title:"Remove relation",className:"fa fa-trash",innerHTML:"",onclick:f.hitch(this,function(c){c.preventDefault();this._removeRow(b.id,a.type)})},c);return c})}},b=new (e([q,r,t]))({className:"dgrid-autoheight",collection:a.collection,columns:b,showHeader:!1,noDataMessage:"",loadingMessage:"Fetching data.."},c);b.on("dgrid-error",function(a){});return b},getData:function(){var a={};this._isCollection?(a.members=d.map(this._membersStore.data,function(a){var b={};b.id=a.id;return b},this),
a.superordinates=d.map(this._superordinatesCollStore.data,function(a){var b={};b.id=a.id;return b},this),a.infer_concept_relations=this.inferConceptRelationsYesNode.checked?!0:this.inferConceptRelationsNoNode.checked?!1:void 0):(a.related=d.map(this._relatedStore.data,function(a){var b={};b.id=a.id;return b},this),a.narrower=d.map(this._narrowerStore.data,function(a){var b={};b.id=a.id;return b},this),a.broader=d.map(this._broaderStore.data,function(a){var b={};b.id=a.id;return b},this),a.subordinate_arrays=
d.map(this._subordinateStore.data,function(a){var b={};b.id=a.id;return b},this));a.member_of=d.map(this._memberOfStore.data,function(a){var b={};b.id=a.id;return b},this);return a},_addRelation:function(a,c,b,e){return d.some(e.data,function(b){return b.id==a})?!1:(e.add({id:a,label:c,path:b}),!0)},setConcept:function(a){a&&(this.concept=a,this._broaderStore=new this.trackableMemory({data:this.concept?this.concept.broader:[]}),this._broaderGrid.set("collection",this._broaderStore),this._narrowerStore=
new this.trackableMemory({data:this.concept?this.concept.narrower:[]}),this._narrowerGrid.set("collection",this._narrowerStore),this._relatedStore=new this.trackableMemory({data:this.concept?this.concept.related:[]}),this._relatedGrid.set("collection",this._relatedStore),this._memberOfStore=new this.trackableMemory({data:this.concept?this.concept.member_of:[]}),this._memberOfGrid.set("collection",this._memberOfStore),this._membersStore=new this.trackableMemory({data:this.concept?this.concept.members:
[]}),this._membersGrid.set("collection",this._membersStore),this._subordinateStore=new this.trackableMemory({data:this.concept?this.concept.subordinate_arrays:[]}),this._subordinateGrid.set("collection",this._subordinateStore),this._superordinatesCollStore=new this.trackableMemory({data:this.concept?this.concept.superordinates:[]}),this._superordinatesCollGrid.set("collection",this._superordinatesCollStore),!0===a.infer_concept_relations?this.inferConceptRelationsYesNode.checked=!0:!1===a.infer_concept_relations&&
(this.inferConceptRelationsNoNode.checked=!0),"collection"===this.concept.type?this.setCollectionTypes():this.setConceptTypes())},_addBroader:function(a){a?a.preventDefault():null;this._addRelationDialog.show(this._broaderStore,this._relationStore)},_addNarrower:function(a){a?a.preventDefault():null;this._addRelationDialog.show(this._narrowerStore,this._relationStore)},_addRelated:function(a){a?a.preventDefault():null;this._addRelationDialog.show(this._relatedStore,this._relationStore)},_addMemberOf:function(a){a?
a.preventDefault():null;this._addRelationDialog.show(this._memberOfStore,this._relationStore)},_addMembers:function(a){a?a.preventDefault():null;this._addRelationDialog.show(this._membersStore,this._relationStore)},_addSubordinateArray:function(a){a?a.preventDefault():null;this._addRelationDialog.show(this._subordinateStore,this._relationStore)},_addSuperordinates:function(a){a?a.preventDefault():null;this._addRelationDialog.show(this._superordinatesCollStore,this._relationStore)},_removeRow:function(a,
c){var b=null;switch(c){case "broader":b=this._broaderStore;break;case "narrower":b=this._narrowerStore;break;case "related":b=this._relatedStore;break;case "memberOf":b=this._memberOfStore;break;case "members":b=this._membersStore;break;case "subordinate":b=this._subordinateStore;break;case "superordinate":b=this._superordinatesCollStore}b&&b.remove(a)}})});
//# sourceMappingURL=RelationManager.js.map