diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js index 4512ec70200..3e8e4ea267e 100644 --- a/static/scripts/bundled/analysis.bundled.js +++ b/static/scripts/bundled/analysis.bundled.js @@ -1,15 +1,13 @@ -webpackJsonp([3,1],[function(t,e,i){(function(t,e){var n=i(1),s=n,a=i(69),o=i(13),r=i(116),l=i(115),c=i(35),h=i(24);window.app=function(i,n){Galaxy.debug("building app:",i,n);var d=new r({el:"#left",userIsAnonymous:Galaxy.user.isAnonymous(),require_login:i.config.require_login,spinner_url:i.config.spinner_url,search_url:i.config.search_url,toolbox:i.config.toolbox,toolbox_in_panel:i.config.toolbox_in_panel,stored_workflow_menu_entries:i.config.stored_workflow_menu_entries}),u=new o.CenterPanel({el:"#center"}),p=new l({el:"#right",galaxyRoot:Galaxy.root,userIsAnonymous:Galaxy.user.isAnonymous(),allow_user_dataset_purge:Galaxy.config.allow_user_dataset_purge}),f=new c.PageLayoutView(t.extend(i,{el:"body",left:d,center:u,right:p}));Galaxy.page=f,Galaxy.params=Galaxy.config.params,Galaxy.toolPanel=d.tool_panel,Galaxy.upload=d.uploadButton,Galaxy.currHistoryPanel=p.historyView,Galaxy.currHistoryPanel.connectToQuotaMeter(Galaxy.quotaMeter),Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),Galaxy.app={display:function(t,e){s(".select2-hidden-accessible").remove(),u.display(t)}};new(e.Router.extend({initialize:function(t){this.options=t},execute:function(t,e,i){Galaxy.debug("router execute:",t,e,i);var n=a.parse(e.pop());e.push(n),t&&t.apply(this,e)},routes:{"(/)":"home","(/)root*":"home"},home:function(t){(t.tool_id||t.job_id)&&"upload1"!==t.tool_id?this._loadToolForm(t):t.workflow_id?this._loadCenterIframe(Galaxy.root+"workflow/run?id="+t.workflow_id):t.m_c?this._loadCenterIframe(Galaxy.root+t.m_c+"/"+t.m_a):this._loadCenterIframe(Galaxy.root+"root/welcome")},_loadToolForm:function(t){t.id=t.tool_id,u.display(new h.View(t))},_loadCenterIframe:function(t){u.$("#galaxy_main").prop("src",t)}}))(i);s(function(){f.render().right.historyView.loadCurrentHistory(),e.history.start({root:Galaxy.root,pushState:!0})})}}).call(e,i(3),i(2))},,,,function(t,e,i){var n,s;(function(i,a,o){n=[],s=function(){function t(t){return''),n},_templateShadow:function(t){return'
'},_templateBackground:function(){return'
'},_templateMenu:function(){return'
'}});return{View:t}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s,a;!function(o){s=[i(1)],n=o,a="function"==typeof n?n.apply(e,s):n,!(void 0!==a&&(t.exports=a))}(function(t){"use_strict";var e=t;e.fn.make_text_editable=function(t){var i="num_cols"in t?t.num_cols:30,n="num_rows"in t?t.num_rows:4,s="use_textarea"in t?t.use_textarea:!1,a="on_finish"in t?t.on_finish:null,o="help_text"in t?t.help_text:null,r=e(this);return r.addClass("editable-text").click(function(o){if(!(e(this).children(":input").length>0)){r.removeClass("editable-text");var l,c,h=function(t){r.find(":input").remove(),""!==t?r.text(t):r.html("
"),r.addClass("editable-text"),a&&a(t)},d="cur_text"in t?t.cur_text:r.text();s?(l=e("',"",""].join("")}});return{CitationView:n,CitationListView:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(a,o,r){n=[i(53),i(42),i(6),i(5)],s=function(t,e,i,n){var s=t.FoldoutListItemView,l=t.ListItemView,c=s.extend({className:s.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(t){this.linkTarget=t.linkTarget||"_blank",this.hasUser=t.hasUser,s.prototype.initialize.call(this,t)},_setUpListeners:function(){s.prototype._setUpListeners.call(this),this.model.on("change",function(t,e){a.isEqual(a.keys(t.changed),["deleted"])&&this.render()},this)},_renderSubtitle:function(){var t=o('
');switch(this.model.get("collection_type")){case"list":return t.text(n("a list of datasets"));case"paired":return t.text(n("a pair of datasets"));case"list:paired":return t.text(n("a list of paired datasets"))}return t},_getFoldoutPanelOptions:function(){var t=s.prototype._getFoldoutPanelOptions.call(this);return a.extend(t,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){var t=this.model?this.model+"":"(no model)";return"DCListItemView("+t+")"}});c.prototype.templates=function(){var t=a.extend({},s.prototype.templates.warnings,{error:i.wrapTemplate(["<% if( model.error ){ %>",'
',n("There was an error getting the data for this collection"),": <%- model.error %>","
","<% } %>"]),purged:i.wrapTemplate(["<% if( model.purged ){ %>",'
',n("This collection has been deleted and removed from disk"),"
","<% } %>"]),deleted:i.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
',n("This collection has been deleted"),"
","<% } %>"])}),e=i.wrapTemplate(['
','
','<%- collection.element_identifier || collection.name %>',"
",'
',"
"],"collection");return a.extend({},s.prototype.templates,{warnings:t,titleBar:e})}();var h=l.extend({className:l.prototype.className+" dataset-collection-element",initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log("DCEListItemView.initialize:",t),l.prototype.initialize.call(this,t)},toString:function(){var t=this.model?this.model+"":"(no model)";return"DCEListItemView("+t+")"}});h.prototype.templates=function(){var t=i.wrapTemplate(['
','
','<%- element.element_identifier %>',"
",'
',"
"],"element");return a.extend({},l.prototype.templates,{titleBar:t})}();var d=e.DatasetListItemView.extend({className:e.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log("DatasetDCEListItemView.initialize:",t),e.DatasetListItemView.prototype.initialize.call(this,t)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):r.when()},toString:function(){var t=this.model?this.model+"":"(no model)";return"DatasetDCEListItemView("+t+")"}});d.prototype.templates=function(){var t=i.wrapTemplate(['
','','
','<%- element.element_identifier %>',"
","
"],"element");return a.extend({},e.DatasetListItemView.prototype.templates,{titleBar:t})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(t){c.prototype._swapNewRender.call(this,t);var e=this.model.get("state")||"ok";return this.$el.addClass("state-"+e),this.$el},toString:function(){var t=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+t+")"}});return{DCListItemView:c,DCEListItemView:h,DatasetDCEListItemView:d,NestedDCDCEListItemView:u}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(1),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(99),i(6),i(5)],s=function(t,e,i){var n="collections",s={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(t){return a.extend(t,t.object,{element_id:t.id}),delete t.object,t},constructor:function(t,e){t=this._mergeObject(t),this.idAttribute="element_id",o.Model.apply(this,arguments)},parse:function(t,e){var i=t;return i=this._mergeObject(i)}},l=o.Model.extend(e.LoggableMixin).extend(s).extend({_logNamespace:n}),c=o.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,model:l,initialize:function(t,e){this.debug(this+"(DCECollection).initialize:",t,e),e=e||{}},toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),h=t.DatasetAssociation.extend(e.mixin(s,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:a.extend({},t.DatasetAssociation.prototype.defaults,s.defaults),constructor:function(t,e){this.debug(" DatasetDCE.constructor:",t,e),s.constructor.call(this,t,e)},initialize:function(e,i){this.debug(this+"(DatasetDCE).initialize:",e,i),t.DatasetAssociation.prototype.initialize.call(this,e,i)},hasDetails:function(){return a.has(this.attributes,"annotation")},toString:function(){var t=this.get("element_identifier");return["DatasetDCE(",t,")"].join("")}})),d=c.extend({model:h,initialize:function(t,e){this.debug(this+"(DatasetDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),u=o.Model.extend(e.LoggableMixin).extend(e.SearchableModelMixin).extend({_logNamespace:n,defaults:{collection_type:null,deleted:!1},collectionClass:c,initialize:function(t,e){this.debug(this+"(DatasetCollection).initialize:",t,e,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var t=this.get("elements")||[];return this.unset("elements",{silent:!0}),this.elements=new this.collectionClass(t),this.elements},toJSON:function(){var t=o.Model.prototype.toJSON.call(this);return this.elements&&(t.elements=this.elements.toJSON()),t},inReadyState:function(){var t=this.get("populated");return this.isDeletedOrPurged()||t},hasDetails:function(){return this.debug("hasDetails:",this.elements.length),0!==this.elements.length},getVisibleContents:function(t){return this.elements},"delete":function(t){return this.get("deleted")?r.when():this.save({deleted:!0},t)},undelete:function(t){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},t)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var t=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+t.join(",")+")"}}),p=u.extend({collectionClass:d,initialize:function(t,e){this.debug(this+"(ListDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListDatasetCollection(",this.get("name"),")"].join("")}}),f=p.extend({initialize:function(t,e){this.debug(this+"(PairDatasetCollection).initialize:",t,e),p.prototype.initialize.call(this,t,e)},toString:function(){return["PairDatasetCollection(",this.get("name"),")"].join("")}}),g=u.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",t,")"].join("")}})),m=c.extend({model:g,initialize:function(t,e){this.debug(this+"(NestedDCDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),v=f.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedPairDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",t,")"].join("")}})),_=m.extend({model:v,initialize:function(t,e){this.debug(this+"(NestedPairDCDCECollection).initialize:",t,e),m.prototype.initialize.call(this,t,e)},toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),y=u.extend({collectionClass:_,initialize:function(t,e){this.debug(this+"(ListPairedDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:p,PairDatasetCollection:f,ListPairedDatasetCollection:y}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(2),i(1))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(50),i(15),i(6),i(10),i(112),i(5),i(109)],s=function(t,e,i,n,s,c){function h(t){var e=t.toJSON(),i=g(e,{creationFn:function(e,i){return e=e.map(function(t){return{id:t.id,name:t.name,src:"dataset"===t.history_content_type?"hda":"hdca"}}),t.createHDCA(e,"list",i)}});return i}var d="collections",u=a.View.extend(i.LoggableMixin).extend({_logNamespace:d,tagName:"li",className:"collection-element",initialize:function(t){this.element=t.element||{},this.selected=t.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:o.template(['',"<%- element.name %>","",'"].join("")),select:function(t){this.$el.toggleClass("selected",t),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var t=this,e=this.$el.parent().width();this.$el.animate({"margin-right":e},"fast",function(){t.trigger("discard",{source:t}),t.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(t){t.stopPropagation(),this.select(t)},_clickName:function(t){t.stopPropagation(),t.preventDefault();var e=([c("Enter a new name for the element"),":\n(",c("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(c("Enter a new name for the element")+":",this.element.name));e&&(this.element.name=e,this.render())},_clickDiscard:function(t){t.stopPropagation(),this.discard()},_dragstart:function(t){t.originalEvent&&(t=t.originalEvent),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(t){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(t){this.$el.parent().trigger(t)},toString:function(){return"DatasetCollectionElementView()"}}),p=a.View.extend(i.LoggableMixin).extend({_logNamespace:d,elementViewClass:u,collectionClass:t.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},initialize:function(t){this.metric("ListCollectionCreator.initialize",t);var e=this;o.each(this.defaultAttributes,function(i,n){i=t[n]||i,e[n]=i}),e.initialElements=t.elements||[],this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(t){t.hasOwnProperty("id")||(t.id=o.uniqueId())}),this.workingElements},_validateElements:function(){var t=this;return t.invalidElements=[],this.workingElements=this.workingElements.filter(function(e){var i=t._isElementInvalid(e);return i&&t.invalidElements.push({element:e,text:i}),!i}),this.workingElements},_isElementInvalid:function(t){return"dataset"!==t.history_content_type?c("is not a dataset"):t.state!==e.OK?c(o.contains(e.NOT_READY_STATES,t.state)?"hasn't finished running yet":"has errored, is paused, or is not accessible"):t.deleted||t.purged?c("has been deleted or purged"):null},_mangleDuplicateNames:function(){var t=900,e=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+e+")",e+=1,e>=t)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(t){},render:function(t,e){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(t,e){var i=this,n=l("
"),s=i.$list();o.each(this.elementViews,function(t){t.destroy(),i.removeElementView(t)}),i.workingElements.forEach(function(t){var e=i._createElementView(t);n.append(e.$el)}),i._renderClearSelected(),s.empty().append(n.children()),o.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(t){var e=new this.elementViewClass({element:t,selected:o.has(this.selectedIds,t.id)});return this.elementViews.push(e),this._listenToElementView(e),e},_listenToElementView:function(t){var e=this;e.listenTo(t,{select:function(t){var i=t.source.element;t.selected?e.selectedIds[i.id]=!0:delete e.selectedIds[i.id],e.trigger("elements:select",t)},discard:function(t){e.trigger("elements:discard",t)}})},addElementView:function(t){},removeElementView:function(t){delete this.selectedIds[t.element.id],this._renderClearSelected(),this.elementViews=o.without(this.elementViews,t),this.stopListening(t)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(t){return t},createList:function(t){if(!this.workingElements.length){var e=c("No valid elements for final list")+". ";return e+=''+c("Cancel")+" ",e+=c("or"),e+=' '+c("start over")+".",void this._showAlert(e)}var i=this,n=this.workingElements.map(function(t){return i._elementToJSON(t)});return i.blocking=!0,i.creationFn(n,t).always(function(){i.blocking=!1}).fail(function(t,e,n){i.trigger("error",{xhr:t,status:e,message:c("An error occurred while creating this collection")})}).done(function(t,e,n){i.trigger("collection:created",t,e,n),i.metric("collection:created",t),"function"==typeof i.oncreate&&i.oncreate.call(this,t,e,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(t){this._renderClearSelected()}),this.on("elements:discard",function(t){var e=t.source.element;this.removeElementView(t.source),this.workingElements=o.without(this.workingElements,e),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(t){this.error(t);var e=this;if(content=t.message||c("An error occurred"),t.xhr){var i=t.xhr,n=t.message;0===i.readyState&&0===i.status?content+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes."):i.responseJSON?content+=":
"+JSON.stringify(i.responseJSON)+"
":content+=": "+n}e._showAlert(content,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(t){"function"==typeof this.oncancel&&this.oncancel.call(this)},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(t){t.stopPropagation(),this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(t){t.stopPropagation(),this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_toggleHelp:function(t){t.stopPropagation(),this.$(".main-help").toggleClass("expanded"),this.$(".more-help").toggle()},_showAlert:function(t,e){e=e||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(e).show().find(".alert-message").html(t)},_hideAlert:function(t){this.$(".main-help").show(),this.$(".header .alert").hide()},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(t){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(t){t.preventDefault();var e=this.$list();this._checkForAutoscroll(e,t.originalEvent.clientY);var i=this._getNearestElement(t.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=r('
');i.size()?i.before(n):e.append(n)},_checkForAutoscroll:function(t,e){var i=2,n=t.offset(),s=t.scrollTop(),a=e-n.top,o=n.top+t.outerHeight()-e;a>=0&&a=0&&ot&&t>a-o)return s}return r()},_dropElements:function(t){t.originalEvent&&(t=t.originalEvent),t.preventDefault(),t.dataTransfer.dropEffect="move";var e=this._getNearestElement(t.clientY);return e.size()?this.$dragging.insertBefore(e):this.$dragging.insertAfter(this.$(".collection-elements .collection-element").last()),this._syncOrderToDom(),!1},_syncOrderToDom:function(){var t=this,e=[];this.$(".collection-elements .collection-element").each(function(){var i=r(this).attr("data-element-id"),n=o.findWhere(t.workingElements,{id:i});n?e.push(n):console.error("missing element: ",i)}),this.workingElements=e,this._renderList()},_elementDragstart:function(t,e){e.select(!0),this.$dragging=this.$(".collection-elements .collection-element.selected")},_elementDragend:function(t,e){r(".element-drop-placeholder").remove(),this.$dragging=null},_changeName:function(t){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(t){13!==t.keyCode||this.blocking||this._clickCreate()},_getName:function(){return o.escape(this.$(".collection-name").val())},_clickCreate:function(t){var e=this._getName();e?this.blocking||this.createList(e):this._validationWarning("name")},templates:{main:o.template(['
','
',''].join("")),header:o.template(['",'
','','',"
"].join("")),middle:o.template(['",'
',"
"].join("")),footer:o.template(['
','
','','
',c("Name"),":
","
","
",'
','
','",'
','",'","
","
",'
','","
","
"].join("")),helpContent:o.template(["

",c(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"

","
    ","
  • ",c(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
  • ","
  • ",c(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
  • ","
  • ",c(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
  • ","
  • ",c(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
  • ","
  • ",c(['Click the "Cancel" button to exit the interface.'].join("")),"
  • ","

","

",c(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"

"].join("")),invalidElements:o.template([c("The following selections could not be included due to problems:"),"
    <% _.each( problems, function( problem ){ %>","
  • <%- problem.element.name %>: <%- problem.text %>
  • ","<% }); %>
"].join("")),noElementsLeft:o.template(['
  • ',c("No elements left! "),c("Would you like to "),'',c("start over"),"?","
  • "].join("")),invalidInitial:o.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",c("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",c("No datasets were selected"),".","<% } %>","
    ",c("At least one element is needed for the collection"),". ",c("You may need to "),'',c("cancel")," ",c("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))},toString:function(){return"ListCollectionCreator"}}),f=function(t,e,i){var s,a=l.Deferred(),r=Galaxy.modal||new n.View;return e=o.defaults(e||{},{elements:t,oncancel:function(){r.hide(),a.reject("cancelled")},oncreate:function(t,e){r.hide(),a.resolve(e)}}),s=new i(e),r.show({title:e.title||c("Create a collection"),body:s.$el,width:"80%",height:"min-content",closing_events:!0}),s.render(),window._collectionCreator=s,a},g=function(t,e){return e=e||{},e.title=c("Create a collection from a list of datasets"),f(t,e,p)};return{DatasetCollectionElementView:u,ListCollectionCreator:p,collectionCreatorModal:f,listCollectionCreatorModal:g,createListCollection:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1),i(1))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(53),i(15),i(27),i(6),i(5)],s=function(t,e,i,n,s){var c="dataset",h=t.ListItemView,d=h.extend({_logNamespace:c,className:h.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log(this+".initialize:",t),h.prototype.initialize.call(this,t),this.linkTarget=t.linkTarget||"_blank"},_setUpListeners:function(){h.prototype._setUpListeners.call(this), -this.model.on("change",function(t,e){this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()?this.model.fetch():this.render()},this)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):a.when()},remove:function(t,e){var i=this;t=t||this.fxSpeed,this.$el.fadeOut(t,function(){o.View.prototype.remove.call(i),e&&e.call(i)})},render:function(t){return h.prototype.render.call(this,t)},_swapNewRender:function(t){return h.prototype._swapNewRender.call(this,t),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var t=this.model.get("state");if(t===e.NOT_VIEWABLE||t===e.DISCARDED||!this.model.get("accessible"))return null;var n={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))n.disabled=!0,n.title=s("Cannot display datasets removed from disk");else if(t===e.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(t===e.NEW)n.disabled=!0,n.title=s("This dataset is not yet viewable");else{n.title=s("View data"),n.href=this.model.urls.display;var a=this;n.onclick=function(t){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add_dataset(a.model.get("id")),t.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===e.NOT_VIEWABLE)return r(this.templates.noAccess(this.model.toJSON(),this));var t=h.prototype._renderDetails.call(this);return t.find(".actions .left").empty().append(this._renderSecondaryActions()),t.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),t.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(t),t},_renderSummary:function(){var t=this.model.toJSON(),e=this.templates.summaries[t.state];return(e=e||this.templates.summaries.unknown)(t,this)},_renderDetailMessages:function(){var t=this,e=r('
    '),i=t.model.toJSON();return l.each(t.templates.detailMessages,function(n){e.append(r(n(i,t)))}),e},_renderDisplayApplications:function(){return this.model.isDeletedOrPurged()?"":[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){switch(this.debug("_renderSecondaryActions"),this.model.get("state")){case e.NOT_VIEWABLE:return[];case e.OK:case e.FAILED_METADATA:case e.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return i({title:s("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:l.isEmpty(this.model.get("meta_files"))?r(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var t=this.model.urls;return r(['"].join("\n"))},events:l.extend(l.clone(h.prototype.events),{"click .display-btn":function(t){this.trigger("display",this,t)},"click .params-btn":function(t){this.trigger("params",this,t)},"click .download-btn":function(t){this.trigger("download",this,t)}}),toString:function(){var t=this.model?this.model+"":"(no model)";return"DatasetListItemView("+t+")"}});return d.prototype.templates=function(){var t=l.extend({},h.prototype.templates.warnings,{failed_metadata:n.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','
    ',s("An error occurred setting the metadata for this dataset"),"
    ","<% } %>"]),error:n.wrapTemplate(["<% if( model.error ){ %>",'
    ',s("There was an error getting the data for this dataset"),": <%- model.error %>","
    ","<% } %>"]),purged:n.wrapTemplate(["<% if( model.purged ){ %>",'
    ',s("This dataset has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:n.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',s("This dataset has been deleted"),"
    ","<% } %>"])}),i=n.wrapTemplate(['
    ','
    ','
    ','
    ','
    ',"
    ","<% if( !dataset.deleted && !dataset.purged ){ %>",'
    ','
    ','
    ',"<% if( dataset.peek ){ %>",'
    <%= dataset.peek %>
    ',"<% } %>","<% } %>","
    "],"dataset"),a=n.wrapTemplate(['
    ','
    ',s("You do not have permission to view this dataset"),"
    ","
    "],"dataset"),o={};o[e.OK]=o[e.FAILED_METADATA]=n.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'
    ','<%- dataset.misc_blurb %>',"
    ","<% } %>","<% if( dataset.file_ext ){ %>",'
    ','",'<%- dataset.file_ext %>',"
    ","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'
    ','",'',"<%- dataset.metadata_dbkey %>","","
    ","<% } %>","<% if( dataset.misc_info ){ %>",'
    ','<%- dataset.misc_info %>',"
    ","<% } %>"],"dataset"),o[e.NEW]=n.wrapTemplate(["
    ",s("This is a new dataset and not all of its data are available yet"),"
    "],"dataset"),o[e.NOT_VIEWABLE]=n.wrapTemplate(["
    ",s("You do not have permission to view this dataset"),"
    "],"dataset"),o[e.DISCARDED]=n.wrapTemplate(["
    ",s("The job creating this dataset was cancelled before completion"),"
    "],"dataset"),o[e.QUEUED]=n.wrapTemplate(["
    ",s("This job is waiting to run"),"
    "],"dataset"),o[e.RUNNING]=n.wrapTemplate(["
    ",s("This job is currently running"),"
    "],"dataset"),o[e.UPLOAD]=n.wrapTemplate(["
    ",s("This dataset is currently uploading"),"
    "],"dataset"),o[e.SETTING_METADATA]=n.wrapTemplate(["
    ",s("Metadata is being auto-detected"),"
    "],"dataset"),o[e.PAUSED]=n.wrapTemplate(["
    ",s('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"
    "],"dataset"),o[e.ERROR]=n.wrapTemplate(["<% if( !dataset.purged ){ %>","
    <%- dataset.misc_blurb %>
    ","<% } %>",'',s("An error occurred with this dataset"),":",'
    <%- dataset.misc_info %>
    '],"dataset"),o[e.EMPTY]=n.wrapTemplate(["
    ",s("No data"),": <%- dataset.misc_blurb %>
    "],"dataset"),o.unknown=n.wrapTemplate(['
    Error: unknown dataset state: "<%- dataset.state %>"
    '],"dataset");var r={resubmitted:n.wrapTemplate(["<% if( model.resubmitted ){ %>",'
    ',s("The job creating this dataset has been resubmitted"),"
    ","<% } %>"])},c=n.wrapTemplate(["<% _.each( apps, function( app ){ %>",'
    ','<%- app.label %> ','',"<% _.each( app.links, function( link ){ %>",'',"<% print( _l( link.text ) ); %>"," ","<% }); %>","","
    ","<% }); %>"],"apps");return l.extend({},h.prototype.templates,{warnings:t,details:i,noAccess:a,summaries:o,detailMessages:r,displayApplications:c})}(),{DatasetListItemView:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(1),i(2),i(1),i(3))},function(t,e,i){var n,s;(function(a,o){n=[i(4)],s=function(t){return a.Model.extend({initialize:function(t){this.app=t},checksum:function(){var t="",e=this;return this.app.section.$el.find(".section-row").each(function(){var i=o(this).attr("id"),n=e.app.field_list[i];n&&(t+=i+":"+JSON.stringify(n.value&&n.value())+":"+n.collapsed+";")}),t},create:function(){function t(t,e,n){i.map_dict[t]=e,s[t]=n}function e(n,s){for(var a in s){var o=s[a];if(o.input){var r=o.input,l=n;switch(""!=n&&(l+="|"),l+=r.name,r.type){case"repeat":var c="section-",h=[],d=null;for(var u in o){var p=u.indexOf(c);-1!=p&&(p+=c.length,h.push(parseInt(u.substr(p))),d||(d=u.substr(0,p)))}h.sort(function(t,e){return t-e});var a=0;for(var f in h)e(l+"_"+a++,o[d+h[f]]);break;case"conditional":var g=i.app.field_list[r.id].value();t(l+"|"+r.test_param.name,r.id,g);var m=i.matchCase(r,g);-1!=m&&e(l,s[r.id+"-section-"+m]);break;case"section":e(!r.flat&&l||"",o);break;default:var v=i.app.field_list[r.id];if(v&&v.value){var g=v.value();if((void 0===r.ignore||r.ignore!=g)&&(v.collapsed&&r.collapsible_value&&(g=r.collapsible_value),t(l,r.id,g),r.payload))for(var _ in r.payload)t(_,r.id,r.payload[_])}}}}}var i=this,n={};this._iterate(this.app.section.$el,n);var s={};return this.map_dict={},e("",n),s},match:function(t){return this.map_dict&&this.map_dict[t]},matchCase:function(t,e){"boolean"==t.test_param.type&&(e="true"==e?t.test_param.truevalue||"true":t.test_param.falsevalue||"false");for(var i in t.cases)if(t.cases[i].value==e)return i;return-1},matchModel:function(t,e){function i(t,n){for(var a in n){var o=n[a],r=o.name;switch(""!=t&&(r=t+"|"+r),o.type){case"repeat":for(var l in o.cache)i(r+"_"+l,o.cache[l]);break;case"conditional":var c=o.test_param&&o.test_param.value,h=s.matchCase(o,c);-1!=h&&i(r,o.cases[h].inputs);break;case"section":i(r,o.inputs);break;default:var d=s.map_dict[r];d&&e(d,o)}}}var n={},s=this;return i("",t.inputs),n},matchResponse:function(t){function e(t,s){if("string"==typeof s){var a=n.map_dict[t];a&&(i[a]=s)}else for(var o in s){var r=o;if(""!==t){var l="|";s instanceof Array&&(l="_"),r=t+l+r}e(r,s[o])}}var i={},n=this;return e("",t),i},_iterate:function(t,e){var i=this,n=o(t).children();n.each(function(){var t=this,n=o(t).attr("id");if(o(t).hasClass("section-row")){e[n]={};var s=i.app.input_list[n];s&&(e[n]={input:s}),i._iterate(t,e[n])}else i._iterate(t,e)})}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i){n=[],s=function(){return i.View.extend({initialize:function(t,e){this.app=t,this.text_enable=t.options.text_enable||"Enable",this.text_disable=t.options.text_disable||"Disable",this.cls_enable=t.options.cls_enable||"fa fa-caret-square-o-down",this.cls_disable=t.options.cls_disable||"fa fa-caret-square-o-up",this.field=e.field,this.default_value=e.default_value,this.setElement(this._template(e)),this.$field=this.$el.find(".ui-table-form-field"),this.$optional=this.$el.find(".ui-table-form-optional"),this.$optional_icon=this.$el.find(".ui-table-form-optional").find(".icon"),this.$error_text=this.$el.find(".ui-table-form-error-text"),this.$error=this.$el.find(".ui-table-form-error"),this.$field.prepend(this.field.$el),this.field.collapsed=e.collapsible&&e.value&&JSON.stringify(e.value)==JSON.stringify(e.collapsible_value),this._refresh();var i=this;this.$optional.on("click",function(){i.field.collapsed=!i.field.collapsed,i._refresh(),i.app.trigger("change")})},error:function(t){this.$error_text.html(t),this.$error.show(),this.$el.addClass("ui-error")},reset:function(){this.$error.hide(),this.$el.removeClass("ui-error")},_refresh:function(){this.$optional_icon.removeClass().addClass("icon"),this.field.collapsed?(this.$field.hide(),this._tooltip(this.text_enable,this.cls_enable),this.field.value&&this.field.value(this.default_value)):(this.$field.fadeIn("fast"),this._tooltip(this.text_disable,this.cls_disable),this.app.trigger("change"))},_tooltip:function(t,e){this.$optional.length&&this.$optional_icon.addClass(e).tooltip({placement:"bottom"}).attr("data-original-title",t).tooltip("fixTitle").tooltip("hide")},_template:function(t){var e='
    ';return e+=t.collapsible?'
    '+t.label+"
    ":t.label,e+='
    ',e+='
    ',t.help&&(e+=t.help,t.argument&&-1==t.help.indexOf("("+t.argument+")")&&(e+=" ("+t.argument+")")),e+="
    ",e+="
    "}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(a,o){n=[i(4),i(7),i(48),i(62),i(61),i(58)],s=function(t,e,i,n,s,r){return a.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(t,e){this.app=t},create:function(t){void 0===t.value&&(t.value=null),void 0===t.default_value&&(t.default_value=t.value);var e=null,i=this.types[t.type];return i&&"function"==typeof this[i]&&(e=this[i].call(this,t)),e||(this.app.incompatible=!0,e=t.options?this._fieldSelect(t):this._fieldText(t),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+t.type+").")),void 0!==t.value&&e.value(t.value),e},_fieldData:function(e){if(this.app.options.is_workflow)return e.info="Data input '"+e.name+"' ("+t.textify(e.extensions.toString())+")",e.value=null,this._fieldHidden(e);var n=this;return new i.View(this.app,{id:"field-"+e.id,extensions:e.extensions,optional:e.optional,multiple:e.multiple,type:e.type,data:e.options,onchange:function(){n.app.trigger("change")}})},_fieldSelect:function(t){if(0==t.options.length&&this.app.options.is_workflow)return this._fieldText(t);"data_column"==t.type&&(t.error_text="Missing columns in referenced dataset.");var i=[];for(var n in t.options){var s=t.options[n];i.push({label:s[0],value:s[1]})}var a=e.Select;switch(t.display){case"checkboxes":a=e.Checkbox;break;case"radio":a=e.Radio}var o=this;return new a.View({id:"field-"+t.id,data:i,error_text:t.error_text||"No options available",optional:t.optional&&null===t.default_value,multiple:t.multiple,optional:t.optional,searchable:t.searchable,onchange:function(){o.app.trigger("change")}})},_fieldDrilldown:function(t){if(0==t.options.length&&this.app.options.is_workflow)return this._fieldText(t);var i=this;return new e.Drilldown.View({id:"field-"+t.id,data:t.options,display:t.display,onchange:function(){i.app.trigger("change")}})},_fieldText:function(i){if(i.options)if(i.area=i.multiple,t.validate(i.value)){if(o.isArray(i.value)){var n="";for(var s in i.value){if(n+=String(i.value[s]),!i.multiple)break;n+="\n"}i.value=n}}else i.value="";var a=this;return new e.Input({id:"field-"+i.id,area:i.area,onchange:function(){a.app.trigger("change")}})},_fieldSlider:function(t){var i=this;return new e.Slider.View({id:"field-"+t.id,precise:"float"==t.type,min:t.min,max:t.max,onchange:function(){i.app.trigger("change")}})},_fieldHidden:function(t){return new e.Hidden({id:"field-"+t.id,info:t.info})},_fieldBoolean:function(t){var i=this;return new e.RadioButton.View({id:"field-"+t.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){i.app.trigger("change")}})},_fieldColor:function(t){var e=this;return new r({id:"field-"+t.id,onchange:function(){e.app.trigger("change")}})},_fieldLibrary:function(t){var e=this;return new n.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})},_fieldFtp:function(t){var e=this;return new s.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a,o){n=[i(4),i(18),i(11),i(7)],s=function(t,e,i,n){var s=a.View.extend({optionsDefault:{title:"Section",max:null,min:null},initialize:function(i){this.options=t.merge(i,this.optionsDefault),this.setElement("
    ");this.button_new=new n.ButtonIcon({icon:"fa-plus",title:"Insert "+i.title_new,tooltip:"Add new "+i.title_new+" block",floating:"clear",onclick:function(){i.onnew&&i.onnew()}}),this.table=new e.View({cls:"ui-table-plain",content:""}),this.$el.append(this.table.$el),this.$el.append(o("
    ").append(this.button_new.$el)),this.list={},this.n=0},size:function(){return this.n},add:function(t){if(!t.id||this.list[t.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate repeat block id.");this.n++;var e=new n.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain",onclick:function(){t.ondel&&t.ondel()}}),s=new i.View({id:t.id,title:"placeholder",cls:"ui-portlet-repeat",operations:{button_delete:e}});s.append(t.$el),s.$el.addClass("section-row"),this.list[t.id]=s,this.table.add(s.$el),this.table.append("row_"+t.id,!0),this.options.max>0&&this.n>=this.options.max&&this.button_new.disable(),this._refresh()},del:function(t){if(!this.list[t])return void Galaxy.emit.debug("form-repeat::del()","Invalid repeat block id.");this.n--;var e=this.table.get("row_"+t);e.remove(),delete this.list[t],this.button_new.enable(),this._refresh()},_refresh:function(){var t=0;for(var e in this.list){var i=this.list[e];i.title(++t+": "+this.options.title),this.n>this.options.min?i.showOperation("button_delete"):i.hideOperation("button_delete")}}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(4),i(18),i(7),i(11),i(46),i(44),i(45)],s=function(t,e,i,n,s,c,h){var d=a.View.extend({initialize:function(t,i){this.app=t,this.inputs=i.inputs,i.cls="ui-table-plain",i.cls_tr="section-row",this.table=new e.View(i),this.parameters=new h(t,i),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var t in this.inputs)this.add(this.inputs[t])},add:function(e){var i=o.extend(!0,{},e);i.id=e.id=t.uid(),this.app.input_list[i.id]=i;var n=i.type;switch(n){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(t){var e=this;t.test_param.id=t.id;var i=this._addRow(t.test_param);i.options.onchange=function(i){var n=e.app.data.matchCase(t,i);for(var s in t.cases){var a=t.cases[s],o=t.id+"-section-"+s,r=e.table.get(o),l=!1;for(var c in a.inputs)if(!a.inputs[c].hidden){l=!0;break}s==n&&l?r.fadeIn("fast"):r.hide()}e.app.trigger("change")};for(var n in t.cases){var s=t.id+"-section-"+n,a=new d(this.app,{inputs:t.cases[n].inputs});a.$el.addClass("ui-table-section"),this.table.add(a.$el),this.table.append(s)}i.trigger("change")},_addRepeat:function(t){function e(e){var s=t.id+"-section-"+n++,o=new d(i.app,{inputs:e});a.add({id:s,$el:o.$el,ondel:function(){a.del(s),i.app.trigger("change")}})}for(var i=this,n=0,a=new s.View({title:t.title,title_new:t.title,min:t.min,max:t.max,onnew:function(){e(t.inputs),i.app.trigger("change")}}),o=t.min,l=r.size(t.cache),h=0;hh?t.cache[h]:t.inputs,e(u)}var p=new c(this.app,{label:t.title,help:t.help,field:a});this.table.add(p.$el),this.table.append(t.id)},_addSection:function(t){var e=this,s=new d(e.app,{inputs:t.inputs}),a=new i.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),o=new n.View({title:t.title,cls:"ui-portlet-section",operations:{button_visible:a}});o.append(s.$el),o.append(l("
    ").addClass("ui-table-form-info").html(t.help));var r=!1;o.$content.hide(),o.$header.css("cursor","pointer"),o.$header.on("click",function(){r?(r=!1,o.$content.hide(),a.setIcon("fa-eye-slash")):(r=!0,o.$content.fadeIn("fast"),a.setIcon("fa-eye"))}),this.app.on("expand",function(t){o.$el.find("#"+t).length>0&&!r&&o.$header.trigger("click")}),t.expanded&&o.$header.trigger("click"),this.table.add(o.$el),this.table.append(t.id)},_addRow:function(t){var e=t.id,i=this.parameters.create(t);this.app.field_list[e]=i;var n=new c(this.app,{name:t.name,label:t.label||t.name,value:t.value,default_value:t.default_value,collapsible:t.collapsible,collapsible_value:t.collapsible_value,help:t.help,argument:t.argument,field:i});return this.app.element_list[e]=n,this.table.add(n.$el),this.table.append(e),t.hidden&&this.table.get(e).hide(),i}});return{View:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(4),i(7),i(31),i(16)],s=function(t,e,i,n){var s=a.View.extend({initialize:function(i,n){this.app=i,this.options=n,this.history={};var s=this;this.setElement('
    '),this.list={};var a=[];"data_collection"==n.type?this.mode="collection":n.multiple?this.mode="multiple":this.mode="single",this.current=this.mode,this.list={};var l=t.textify(n.extensions),c="No dataset available.";l&&(c="No "+l+" dataset available.");var h="No dataset list available.";l&&(h="No "+l+" dataset collection available."),"single"==this.mode&&(a.push({icon:"fa-file-o",value:"single",tooltip:"Single dataset"}),this.select_single=new e.Select.View({optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.single={field:this.select_single,type:"hda"}),("single"==this.mode||"multiple"==this.mode)&&(a.push({icon:"fa-files-o",value:"multiple",tooltip:"Multiple datasets"}),this.select_multiple=new e.Select.View({multiple:!0,searchable:!1,optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.multiple={field:this.select_multiple,type:"hda"}),("single"==this.mode||"multiple"==this.mode||"collection"==this.mode)&&(a.push({icon:"fa-folder-o",value:"collection",tooltip:"Dataset collection"}),this.select_collection=new e.Select.View({error_text:h,optional:n.optional,onchange:function(){s.trigger("change")}}),this.list.collection={field:this.select_collection,type:"hdca"}),this.button_type=new e.RadioButton.View({value:this.current,data:a,onchange:function(t){s.current=t,s.refresh(),s.trigger("change")}}),this.$batch=o(this.template_batch());var d=r.size(this.list),u=0;d>1&&(this.$el.append(this.button_type.$el),u=Math.max(0,35*r.size(this.list))+"px");for(var p in this.list)this.$el.append(this.list[p].field.$el.css({"margin-left":u}));this.$el.append(this.$batch.css({"margin-left":u})),this.update(n.data),void 0!==this.options.value&&this.value(this.options.value),this.refresh(),this.on("change",function(){n.onchange&&n.onchange(s.value())})},wait:function(){for(var t in this.list)this.list[t].field.wait()},unwait:function(){for(var t in this.list)this.list[t].field.unwait()},update:function(t){function e(t,e){if(t){var n=[];for(var s in e){var a=e[s];n.push({label:a.hid+": "+a.name,value:a.id}),i.history[a.id+"_"+a.src]=a}t.update(n)}}var i=this;e(this.select_single,t.hda),e(this.select_multiple,t.hda),e(this.select_collection,t.hdca)},value:function(t){if(void 0!==t)if(t&&t.values)try{var e=[];for(var i in t.values)e.push(t.values[i].id);t&&t.values.length>0&&"hdca"==t.values[0].src?(this.current="collection",this.select_collection.value(e[0])):"multiple"==this.mode?(this.current="multiple",this.select_multiple.value(e)):(this.current="single",this.select_single.value(e[0]))}catch(n){Galaxy.emit.debug("tools-select-content::value()","Skipped.")}else for(var i in this.list)this.list[i].field.value(null);this.refresh();var s=this._select().value();if(null===s)return null;if(s instanceof Array||(s=[s]),0===s.length)return null;var a={batch:this._batch(),values:[]};for(var i in s){var o=this.history[s[i]+"_"+this.list[this.current].type];if(!o)return null;a.values.push(o)}return a.values.sort(function(t,e){return t.hid-e.hid}),a},refresh:function(){this.button_type.value(this.current);for(var t in this.list){var e=this.list[t].field.$el;this.current==t?e.show():e.hide()}this._batch()?this.$batch.show():this.$batch.hide()},_select:function(){return this.list[this.current].field},_batch:function(){if("collection"==this.current){var t=this.history[this._select().value()+"_hdca"];if(t&&t.map_over_type)return!0}return"single"!=this.current&&"single"==this.mode?!0:!1},template_batch:function(){return'
    This is a batch mode input field. A separate job will be triggered for each dataset.
    '}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3))},function(t,e,i){var n,s;(function(a,o,r){n=[i(4),i(11),i(7),i(47),i(43)],s=function(t,e,i,n,s){return a.View.extend({initialize:function(e){this.optionsDefault={is_workflow:!1,initial_errors:!1,cls:"ui-portlet-limited"},this.options=t.merge(e,this.optionsDefault),Galaxy.emit.debug("form-view::initialize()","Ready to build form.",this.options);var n=parent.Galaxy;n&&n.modal?this.modal=n.modal:this.modal=new i.Modal.View,this.setElement("
    "),this._build()},update:function(t){var e=this;this.data.matchModel(t,function(t,i){var n=e.input_list[t];if(n&&n.options&&!o.isEqual(n.options,i.options)){n.options=i.options;var s=e.field_list[t];if(s.update){var a=[];if(-1!=["data","data_collection","drill_down"].indexOf(n.type))a=n.options;else for(var r in i.options){var l=i.options[r];l.length>2&&a.push({label:l[0],value:l[1]})}s.update(a),s.trigger("change"),Galaxy.emit.debug("form-view::update()","Updating options for "+t)}}})},wait:function(t){for(var e in this.input_list){var i=this.field_list[e],n=this.input_list[e];n.is_dynamic&&i.wait&&i.unwait&&(t?i.wait():i.unwait())}},highlight:function(t,e,i){var n=this.element_list[t];if(n&&(n.error(e||"Please verify this parameter."),this.trigger("expand",t),!i))if(self==top){var s=this.$el.parents().filter(function(){return"auto"==r(this).css("overflow")}).first();s.animate({scrollTop:s.scrollTop()+n.$el.offset().top-50},500)}else r("html, body").animate({scrollTop:n.$el.offset().top-20},500)},errors:function(t){if(this.trigger("reset"),t&&t.errors){var e=this.data.matchResponse(t.errors);for(var i in this.element_list){this.element_list[i];e[i]&&this.highlight(i,e[i],!0)}}},_build:function(){var t=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new s(this),this._renderForm(),this.data.create(),this.options.initial_errors&&this.errors(this.options);var e=this.data.checksum();this.on("change",function(){var i=t.data.checksum();i!=e&&(e=i,t.options.onchange&&t.options.onchange())}),this.on("reset",function(){for(var t in this.element_list)this.element_list[t].reset()})},_renderForm:function(){this.message=new i.Message,this.section=new n.View(this,{inputs:this.options.inputs}),r(".tooltip").remove(),this.portlet=new e.View({icon:"fa-wrench",title:this.options.title,cls:this.options.cls,operations:this.options.operations,buttons:this.options.buttons}),this.portlet.append(this.message.$el.addClass("ui-margin-top")),this.portlet.append(this.section.$el),this.$el.empty(),this.$el.append(this.portlet.$el),this.options.message&&this.message.update({persistent:!0,status:"warning",message:this.options.message}),Galaxy.emit.debug("form-view::initialize()","Completed")}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(a){n=[i(40),i(51),i(5)],s=function(t,e,i){function n(t){return function(e,i){return this.isNew()&&(i=i||{},i.url=this.urlRoot+this.get("history_id")+"/contents",e=e||{},e.type="dataset_collection"),t.call(this,e,i)}}var s=e.HistoryContentMixin,o=t.ListDatasetCollection,r=t.PairDatasetCollection,l=t.ListPairedDatasetCollection,c=o.extend(s).extend({defaults:a.extend(a.clone(o.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list",model_class:"HistoryDatasetCollectionAssociation"}),initialize:function(t,e){o.prototype.initialize.call(this,t,e),s.initialize.call(this,t,e)},save:n(o.prototype.save),toString:function(){return["HistoryListDatasetCollection(",this.get("name"),")"].join("")}}),h=r.extend(s).extend({defaults:a.extend(a.clone(r.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"paired",model_class:"HistoryDatasetCollectionAssociation"}),initialize:function(t,e){r.prototype.initialize.call(this,t,e),s.initialize.call(this,t,e)},save:n(r.prototype.save),toString:function(){return["HistoryPairDatasetCollection(",this.get("name"),")"].join("")}}),d=l.extend(s).extend({defaults:a.extend(a.clone(l.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list:paired",model_class:"HistoryDatasetCollectionAssociation"}),initialize:function(t,e){l.prototype.initialize.call(this,t,e),s.initialize.call(this,t,e)},save:n(l.prototype.save),toString:function(){return["HistoryListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{HistoryListDatasetCollection:c,HistoryPairDatasetCollection:h,HistoryListPairedDatasetCollection:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3))},function(t,e,i){var n,s;(function(a,o){n=[i(15),i(6),i(5)],s=function(t,e,i){var n="history",s=function(t,e){return[t,e].join("-")},r={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",constructor:function(t,e){t.type_id=s(t.history_content_type,t.id),this.debug("HistoryContentMixin.constructor:",t.type_id),a.Model.apply(this,arguments)},_typeIdStr:function(){return s(this.get("history_content_type"),this.get("id"))},initialize:function(t,e){this.on("change:id",this._createTypeId)},_createTypeId:function(){this.set("type_id",this._typeIdStr())},isNew:function(){return!this.get("id")},hidden:function(){return!this.get("visible")},isVisible:function(t,e){var i=!0;return t||!this.get("deleted")&&!this.get("purged")||(i=!1),e||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var t=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return t},hide:function(t){return this.get("visible")?this.save({visible:!1},t):o.when()},unhide:function(t){return this.get("visible")?o.when():this.save({visible:!0},t)},toString:function(){var t=this.get("id")||"";return this.get("name")&&(t=this.get("hid")+' :"'+this.get("name")+'",'+t),"HistoryContent("+t+")"}},l=a.Model.extend(e.LoggableMixin).extend(r).extend({_logNamespace:n});return{typeIdStr:s,HistoryContentMixin:r,HistoryContent:l}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(51),i(101),i(50),i(6),i(5)],s=function(t,e,i,n,s){var l="history",c=a.Collection.extend(n.LoggableMixin).extend({_logNamespace:l,model:function(t,n){if("dataset"===t.history_content_type)return new e.HistoryDatasetAssociation(t,n);if("dataset_collection"===t.history_content_type){switch(t.collection_type){case"list":return new i.HistoryListDatasetCollection(t,n);case"paired":return new i.HistoryPairDatasetCollection(t,n);case"list:paired":return new i.HistoryListPairedDatasetCollection(t,n)}return{validationError:"Unknown collection_type: "+t.history_content_type}}return{validationError:"Unknown history_content_type: "+t.history_content_type -}},initialize:function(t,e){e=e||{},this.historyId=e.historyId,this.model.prototype.idAttribute="type_id",this.on("all",function(){this.debug(this+".event:",arguments)})},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},ids:function(){return this.map(function(t){return t.get("id")})},notReady:function(){return this.filter(function(t){return!t.inReadyState()})},running:function(){var t=[];return this.each(function(e){var i=!e.inReadyState();i&&t.push(e.get("id"))}),t},getByHid:function(t){return o.first(this.filter(function(e){return e.get("hid")===t}))},getVisible:function(t,e,i){i=i||[],this.debug("checking isVisible");var n=new c(this.filter(function(i){return i.isVisible(t,e)}));return o.each(i,function(t){o.isFunction(t)&&(n=new c(n.filter(t)))}),n},hidden:function(){function t(t){return t.hidden()}return new c(this.filter(t))},deleted:function(){function t(t){return t.get("deleted")}return new c(this.filter(t))},haveDetails:function(){return this.all(function(t){return t.hasDetails()})},fetchAllDetails:function(t){t=t||{};var e={details:"all"};return t.data=t.data?o.extend(t.data,e):e,this.fetch(t)},ajaxQueue:function(t,e){var i=r.Deferred(),n=this.length,s=[];if(!n)return i.resolve([]),i;var a=this.chain().reverse().map(function(o,r){return function(){var l=t.call(o,e);l.done(function(t){i.notify({curr:r,total:n,response:t,model:o})}),l.always(function(t){s.push(t),a.length?a.shift()():i.resolve(s)})}}).value();return a.shift()(),i},isCopyable:function(t){var e=["HistoryDatasetAssociation","HistoryDatasetCollectionAssociation"];return o.isObject(t)&&t.id&&o.contains(e,t.model_class)},copy:function(t){var e,i,n;o.isString(t)?(e=t,n="hda",i="dataset"):(e=t.id,n={HistoryDatasetAssociation:"hda",LibraryDatasetDatasetAssociation:"ldda",HistoryDatasetCollectionAssociation:"hdca"}[t.model_class]||"hda",i="hdca"===n?"dataset_collection":"dataset");var s=this,a=r.post(this.url(),{content:e,source:n,type:i}).done(function(t){s.add([t])}).fail(function(t,o,r){s.trigger("error",s,a,{},"Error copying contents",{type:i,id:e,source:n})});return a},matches:function(t){return this.filter(function(e){return e.matches(t)})},set:function(e,i){e=o.isArray(e)?e:[e],o.each(e,function(e){e.type_id&&e.get&&e.get("type_id")||(e.type_id=t.typeIdStr(e.history_content_type,e.id))}),a.Collection.prototype.set.call(this,e,i)},createHDCA:function(t,e,n,s){var a=this,o={list:i.HistoryListDatasetCollection,paired:i.HistoryPairDatasetCollection},r=new o[e]({history_id:this.historyId,name:n,element_identifiers:t});return r.save().done(function(t){a.add(r)}).fail(function(t,e,i){a.trigger("error",t,e,i)})},clone:function(){var t=a.Collection.prototype.clone.call(this);return t.historyId=this.historyId,t},print:function(){var t=this;t.each(function(e){t.debug(e),e.elements&&t.debug(" elements:",e.elements)})},toString:function(){return["HistoryContents(",[this.historyId,this.length].join(),")"].join("")}});return{HistoryContents:c}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(6),i(5)],s=function(t,e){var i="list",n=a.View.extend(t.LoggableMixin).extend({_logNamespace:i,initialize:function(t){this.expanded=t.expanded||!1,this.log(" expanded:",this.expanded),this.fxSpeed=void 0!==t.fxSpeed?t.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(t){var e=this._buildNewRender();return this._setUpBehaviors(e),this._queueNewRender(e,t),this},_buildNewRender:function(){var t=o(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(t).replaceWith(this._renderDetails().show()),t},_queueNewRender:function(t,e){e=void 0===e?this.fxSpeed:e;var i=this;o(i).queue("fx",[function(t){this.$el.fadeOut(e,t)},function(e){i._swapNewRender(t),e()},function(t){this.$el.fadeIn(e,t)},function(t){this.trigger("rendered",i),t()}])},_swapNewRender:function(t){return this.$el.empty().attr("class",r.isFunction(this.className)?this.className():this.className).append(t.children())},_setUpBehaviors:function(t){t=t||this.$el,t.find("[title]").tooltip({placement:"bottom"})},$details:function(t){return t=t||this.$el,t.find("> .details")},_renderDetails:function(){var t=o(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(t),t},toggleExpanded:function(t){return t=void 0===t?!this.expanded:t,t?this.expand():this.collapse(),this},expand:function(){var t=this;return t._fetchModelDetails().always(function(){t._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?l.when():this.model.fetch()},_expand:function(){var t=this,e=t._renderDetails();t.$details().replaceWith(e),t.expanded=!0,t.$details().slideDown({duration:t.fxSpeed,step:function(){t.trigger("expanding",t)},complete:function(){t.trigger("expanded",t)}})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var t=this;t.expanded=!1,this.$details().slideUp({duration:t.fxSpeed,step:function(){t.trigger("collapsing",t)},complete:function(){t.trigger("collapsed",t)}})}}),s=n.extend(t.mixin(t.SelectableViewMixin,t.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(e){n.prototype.initialize.call(this,e),t.SelectableViewMixin.initialize.call(this,e),t.DraggableViewMixin.initialize.call(this,e),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(t){t?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var t=n.prototype._buildNewRender.call(this);return t.children(".warnings").replaceWith(this._renderWarnings()),t.children(".title-bar").replaceWith(this._renderTitleBar()),t.children(".primary-actions").append(this._renderPrimaryActions()),t.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),t},_swapNewRender:function(t){return n.prototype._swapNewRender.call(this,t),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var t=this,e=o('
    '),i=t.model.toJSON();return r.each(t.templates.warnings,function(n){e.append(o(n(i,t)))}),e},_renderTitleBar:function(){return o(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(t){t.stopPropagation(),t.altKey?(this.toggleSelect(t),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(t){var e=32,i=13;return!t||"keydown"!==t.type||t.keyCode!==e&&t.keyCode!==i?!0:(this.toggleExpanded(),t.stopPropagation(),!1)},toString:function(){var t=this.model?this.model+"":"(no model)";return"ListItemView("+t+")"}}));s.prototype.templates=function(){var e=t.wrapTemplate(['
    ','
    ','
    ','',"
    ",'
    ','
    ','
    ',"
    "]),i={},n=t.wrapTemplate(['
    ','','
    ','<%- element.name %>',"
    ",'
    ',"
    "],"element"),s=t.wrapTemplate(['
    ']),a=t.wrapTemplate(['
    ']);return{el:e,warnings:i,titleBar:n,subtitle:s,details:a}}();var c=s.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(t){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=t.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=t.foldoutPanelClass||this.foldoutPanelClass,s.prototype.initialize.call(this,t),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return o();var t=s.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,t)},_createFoldoutPanel:function(){var t=this.model,e=this._getFoldoutPanelClass(t),i=this._getFoldoutPanelOptions(t),n=new e(r.extend(i,{model:t}));return n},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(t,e){return e=e||this.$("> .details"),this.foldout=t.render(0),t.$("> .controls").hide(),e.append(t.$el)},expand:function(){var t=this;return t._fetchModelDetails().always(function(){"foldout"===t.foldoutStyle?t._expand():"drilldown"===t.foldoutStyle&&t._expandByDrilldown()})},_expandByDrilldown:function(){var t=this;t.foldout.on("close",function(){t.trigger("collapsed:drilldown",t,t.foldout)}),t.trigger("expanded:drilldown",t,t.foldout)}});return c.prototype.templates=function(){var e=t.wrapTemplate(['
    ',"
    "],"collection");return r.extend({},s.prototype.templates,{details:e})}(),{ExpandableView:n,ListItemView:s,FoldoutListItemView:c}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3),i(1))},function(t,e,i){var n,s;(function(a,o){n=[i(4),i(68),i(7),i(49),i(16),i(23),i(38)],s=function(t,e,i,n,s,r,l){return a.View.extend({initialize:function(i){if(this.options=t.merge(i,{}),this.setElement("
    "),this.deferred=new e,i.inputs)this._buildForm(i);else{var n=this;this.deferred.execute(function(t){n._buildModel(t,i,!0)})}},remove:function(){var t=this;this.$el.hide(),this.deferred.execute(function(){a.View.prototype.remove.call(t),Galaxy.emit.debug("tools-form-base::remove()","Destroy view.")})},_buildForm:function(e){var i=this;this.options=t.merge(e,this.options),this.options=t.merge({icon:"fa-wrench",title:""+e.name+" "+e.description+" (Galaxy Tool Version "+e.version+")",operations:this._operations(),onchange:function(){i.deferred.reset(),i.deferred.execute(function(t){i._updateModel(t)})}},this.options),this.options.customize&&this.options.customize(this.options),this.form=new n(this.options),this._footer(),this.$el.empty(),this.$el.append(this.form.$el)},_buildModel:function(e,n,s){var a=this;this.options.id=n.id,this.options.version=n.version;var r="",l={};n.job_id?r=Galaxy.root+"api/jobs/"+n.job_id+"/build_for_rerun":(r=Galaxy.root+"api/tools/"+n.id+"/build",Galaxy.params&&Galaxy.params.tool_id==n.id&&(l=o.extend({},Galaxy.params),n.version&&(l.tool_version=n.version))),t.request({type:"GET",url:r,data:l,success:function(t){a._buildForm(t.tool_model||t),!s&&a.form.message.update({status:"success",message:"Now you are using '"+a.options.name+"' version "+a.options.version+".",persistent:!1}),Galaxy.emit.debug("tools-form-base::initialize()","Initial tool model ready.",t),e.resolve()},error:function(t){var n=t&&t.err_msg||"Uncaught error.";a.$el.is(":empty")?a.$el.prepend(new i.Message({message:n,status:"danger",persistent:!0,large:!0}).$el):Galaxy.modal.show({title:"Tool request failed",body:n,buttons:{Close:function(){Galaxy.modal.hide()}}}),Galaxy.emit.debug("tools-form::initialize()","Initial tool model request failed.",t),e.reject()}})},_updateModel:function(e){var i=this.options.update_url||Galaxy.root+"api/tools/"+this.options.id+"/build",n=this,s=this.form,a={tool_id:this.options.id,tool_version:this.options.version,inputs:o.extend(!0,{},n.form.data.create())};s.wait(!0),Galaxy.emit.debug("tools-form-base::_updateModel()","Sending current state.",a),t.request({type:"POST",url:i,data:a,success:function(t){n.form.update(t.tool_model||t),n.options.update&&n.options.update(t),s.wait(!1),Galaxy.emit.debug("tools-form-base::_updateModel()","Received new model.",t),e.resolve()},error:function(t){Galaxy.emit.debug("tools-form-base::_updateModel()","Refresh request failed.",t),e.reject()}})},_operations:function(){var t=this,e=this.options,n=new i.ButtonMenu({icon:"fa-cubes",title:!e.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!e.is_workflow&&e.versions&&e.versions.length>1)for(var a in e.versions){var o=e.versions[a];o!=e.version&&n.addMenu({title:"Switch to "+o,version:o,icon:"fa-cube",onclick:function(){var i=e.id.replace(e.version,this.version),n=this.version;t.deferred.reset(),t.deferred.execute(function(e){t._buildModel(e,{id:i,version:n})})}})}else n.$el.hide();var r=new i.ButtonMenu({icon:"fa-caret-down",title:!e.narrow&&"Options"||null,tooltip:"View available options"});return e.biostar_url&&(r.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(e.biostar_url+"/p/new/post/")}}),r.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(e.biostar_url+"/local/search/page/?q="+e.name)}})),r.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+e.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&r.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=Galaxy.root+"api/tools/"+e.id+"/download"}}),e.requirements&&e.requirements.length>0&&r.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){this.visible?(this.visible=!1,t.form.message.update({message:""})):(this.visible=!0,t.form.message.update({persistent:!0,message:s.requirements(e),status:"info"}))}}),e.sharable_url&&r.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(e.sharable_url)}}),{menu:r,versions:n}},_footer:function(){var t=this.options;if(""!=t.help&&this.form.$el.append(s.help(t)),t.citations){var e=o("
    "),i=new r.ToolCitationCollection;i.tool_id=t.id;var n=new l.CitationListView({el:e,collection:i});n.render(),i.fetch(),this.form.$el.append(e)}}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;n=[i(4),i(16)],s=function(t,e){return{submit:function(i,n,s){var a=this,o={tool_id:n.id,tool_version:n.version,inputs:i.data.create()};return i.trigger("reset"),this._validation(i,o)?(Galaxy.emit.debug("tools-jobs::submit()","Validation complete.",o),void t.request({type:"POST",url:Galaxy.root+"api/tools",data:o,success:function(t){s&&s(),i.$el.replaceWith(e.success(t)),a._refreshHdas()},error:function(t){if(s&&s(),Galaxy.emit.debug("tools-jobs::submit","Submission failed.",t),t&&t.err_data){var n=i.data.matchResponse(t.err_data);for(var a in n){i.highlight(a,n[a]);break}}else i.modal.show({title:"Job submission failed",body:t&&t.err_msg||e.error(o),buttons:{Close:function(){i.modal.hide()}}})}})):(Galaxy.emit.debug("tools-jobs::submit()","Submission canceled. Validation failed."),void(s&&s()))},_validation:function(t,e){var i=e.inputs,n=-1,s=null;for(var a in i){var o=i[a],r=t.data.match(a),l=t.field_list[r],c=t.input_list[r];if(r&&c&&l){if(!c.optional&&null==o)return t.highlight(r),!1;if(o&&o.batch){var h=o.values.length,d=null;if(h>0&&(d=o.values[0]&&o.values[0].src),d)if(null===s)s=d;else if(s!==d)return t.highlight(r,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===n)n=h;else if(n!==h)return t.highlight(r,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+h+" selection(s) while a previous field contains "+n+"."),!1}}else Galaxy.emit.debug("tools-jobs::_validation()","Retrieving input objects failed.")}return!0},_refreshHdas:function(t,e){parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents(t,e)}}}.apply(e,n),!(void 0!==s&&(t.exports=s))},function(t,e,i){var n,s;(function(a,o){n=[i(3),i(22),i(14),i(24),i(71),i(72),i(70),i(73)],s=function(t,e,i,n,s,r,l,c){var h={hidden:!1,show:function(){this.set("hidden",!1)},hide:function(){this.set("hidden",!0)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return!this.attributes.hidden}},d=a.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(t){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new d(this.toJSON())},set_value:function(t){this.set("value",t||"")}}),u=a.Collection.extend({model:d}),p=d.extend({}),f=d.extend({set_value:function(t){this.set("value",parseInt(t,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}}),g=f.extend({set_value:function(t){this.set("value",parseFloat(t))}}),m=d.extend({get_samples:function(){return t.map(this.get("options"),function(t){return t[0]})}});d.subModelTypes={integer:f,"float":g,data:p,select:m};var v=a.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:Galaxy.root+"api/tools",initialize:function(e){this.set("inputs",new u(t.map(e.inputs,function(t){var e=d.subModelTypes[t.type]||d;return new e(t)})))},toJSON:function(){var t=a.Model.prototype.toJSON.call(this);return t.inputs=this.get("inputs").map(function(t){return t.toJSON()}),t},remove_inputs:function(t){var e=this,i=e.get("inputs").filter(function(e){return-1!==t.indexOf(e.get("type"))});e.get("inputs").remove(i)},copy:function(t){var e=new v(this.toJSON());if(t){var i=new a.Collection;e.get("inputs").each(function(t){t.get_samples()&&i.push(t)}),e.set("inputs",i)}return e},apply_search_results:function(e){return-1!==t.indexOf(e,this.attributes.id)?this.show():this.hide(),this.is_visible()},set_input_value:function(t,e){this.get("inputs").find(function(e){return e.get("name")===t}).set("value",e)},set_input_values:function(e){var i=this;t.each(t.keys(e),function(t){i.set_input_value(t,e[t])})},run:function(){return this._run()},rerun:function(t,e){return this._run({action:"rerun",target_dataset_id:t.id,regions:e})},get_inputs_dict:function(){var t={};return this.get("inputs").each(function(e){t[e.get("name")]=e.get("value")}),t},_run:function(n){var s=t.extend({tool_id:this.id,inputs:this.get_inputs_dict()},n),a=o.Deferred(),r=new e.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(s),dataType:"json",contentType:"application/json",type:"POST"},interval:2e3,success_fn:function(t){return"pending"!==t}});return o.when(r.go()).then(function(t){a.resolve(new i.DatasetCollection(t))}),a}});t.extend(v.prototype,h);var _=(a.View.extend({}),a.Collection.extend({model:v})),y=a.Model.extend(h),b=a.Model.extend({defaults:{elems:[],open:!1},clear_search_results:function(){t.each(this.attributes.elems,function(t){t.show()}),this.show(),this.set("open",!1)},apply_search_results:function(e){var i,n=!0;t.each(this.attributes.elems,function(t){t instanceof y?(i=t,i.hide()):t instanceof v&&t.apply_search_results(e)&&(n=!1,i&&i.show())}),n?this.hide():(this.show(),this.set("open",!0))}});t.extend(b.prototype,h);var w=a.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:!0,query:"",results:null,clear_key:27},urlRoot:Galaxy.root+"api/tools",initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var t=this.attributes.query;if(t.length");if(t.append(r(this.model.toJSON())),"upload1"===this.model.id)t.find("a").on("click",function(t){t.preventDefault(),Galaxy.upload.show()});else if("Tool"===this.model.get("model_class")){var e=this;t.find("a").on("click",function(t){t.preventDefault();var i=new n.View({id:e.model.id,version:e.model.get("version")});i.deferred.execute(function(){Galaxy.app.display(i)})})}return this.$el.append(t),this}}),S=C.extend({tagName:"div",className:"toolPanelLabel",render:function(){return this.$el.append(o("").text(this.model.attributes.text)),this}}),E=C.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){C.prototype.initialize.call(this),this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(l(this.model.toJSON()));var e=this.$el.find(".toolSectionBody");return t.each(this.model.attributes.elems,function(t){if(t instanceof v){var i=new k({model:t,className:"toolTitle"});i.render(),e.append(i.$el)}else if(t instanceof y){var n=new S({model:t});n.render(),e.append(n.$el)}}),this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast")}}),T=a.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){return this.$el.append(c(this.model.toJSON())),this.model.is_visible()||this.$el.hide(),this.$el.find("[title]").tooltip(),this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){return this.model.clear_search(),this.$el.find(":input").val(""),this.focus_and_select(),!1},query_changed:function(t){return this.model.attributes.clear_key&&this.model.attributes.clear_key===t.which?(this.clear(),!1):void this.model.set("query",this.$el.find(":input").val())}}),$=a.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var t=this,e=new T({model:this.model.get("tool_search")});return e.render(),t.$el.append(e.$el),this.model.get("layout").each(function(e){if(e instanceof b){var i=new E({model:e});i.render(),t.$el.append(i.$el)}else if(e instanceof v){var n=new k({model:e,className:"toolTitleNoSection"});n.render(),t.$el.append(n.$el)}else if(e instanceof y){var s=new S({model:e});s.render(),t.$el.append(s.$el)}}),t.$el.find("a.tool-link").click(function(e){var i=o(this).attr("class").split(/\s+/)[0],n=t.model.get("tools").get(i);t.trigger("tool_link_click",e,n)}),this},handle_search_results:function(){var t=this.model.get("tool_search").get("results");t&&0===t.length?o("#search-no-results").show():o("#search-no-results").hide()}}),A=a.View.extend({className:"toolForm",render:function(){this.$el.children().remove(),this.$el.append(s(this.model.toJSON()))}});a.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new $({collection:this.collection}),this.tool_form_view=new A},render:function(){this.tool_panel_view.render(),this.tool_panel_view.$el.css("float","left"),this.$el.append(this.tool_panel_view.$el),this.tool_form_view.$el.hide(),this.$el.append(this.tool_form_view.$el);var t=this;this.tool_panel_view.on("tool_link_click",function(e,i){e.preventDefault(),t.show_tool(i)})},show_tool:function(t){var e=this;t.fetch().done(function(){e.tool_form_view.model=t,e.tool_form_view.render(),e.tool_form_view.$el.show(),o("#left").width("650px")})}});return{ToolParameter:d,IntegerToolParameter:f,SelectToolParameter:m,Tool:v,ToolCollection:_,ToolSearch:w,ToolPanel:x,ToolPanelView:$,ToolFormView:A}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i,a,o,r){n=[],s=function(){var t=i.View.extend({initialize:function(t,e){this.$button=t,this.$button.size()||(this.$button=a("
    ")),this.options=e||[];var i=this;this.$button.click(function(t){return a(".popmenu-wrapper").remove(),i._renderAndShow(t),!1})},_renderAndShow:function(t){this.render(),this.$el.appendTo("body").css(this._getShownPosition(t)).show(),this._setUpCloseBehavior()},render:function(){if(this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options)),this.options.length){var t=this;this.$el.find("li").each(function(e,i){var n=t.options[e];n.func&&a(this).children("a.popupmenu-option").click(function(e){n.func.call(t,e,n),e.preventDefault()})})}return this},template:function(t,e){return['"].join("")},_templateOptions:function(t){return t.length?o.map(t,function(t){if(t.divider)return'
  • ';if(t.header)return['
  • ',t.html,"
  • "].join("");var e=t.href||"javascript:void(0);",i=t.target?' target="'+t.target+'"':"",n=t.checked?'':"";return['
  • ",n,t.html,"
  • "].join("")}).join(""):"
  • (no options)
  • "},_getShownPosition:function(t){var e=this.$el.width(),i=t.pageX-e/2;return i=Math.min(i,a(document).scrollLeft()+a(window).width()-e-5),i=Math.max(i,a(document).scrollLeft()+5),{top:t.pageY,left:i}},_setUpCloseBehavior:function(){function t(t){if(a(document).off("click.close_popup"),window.parent!==window)try{a(window.parent.document).off("click.close_popup")}catch(i){}else try{a("iframe#galaxy_main").contents().off("click.close_popup")}catch(i){}e.remove()}var e=this;if(a("html").one("click.close_popup",t),window.parent!==window)try{a(window.parent.document).find("html").one("click.close_popup",t)}catch(i){}else try{a("iframe#galaxy_main").contents().one("click.close_popup",t)}catch(i){}},addItem:function(t,e){return e=e>=0?e:this.options.length,this.options.splice(e,0,t),this},removeItem:function(t){return t>=0&&this.options.splice(t,1),this},findIndexByHtml:function(t){for(var e=0;e'},_templateContent:function(){return'
    '},_templateBox:function(t){return'
    '},_template:function(){return'
    Select a color
    '}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,n){var s,a;(function(o){s=[n(4),n(26)],a=function(t,e){var n=e.BaseIcons.extend({initialize:function(t){t.type=t.display||"checkbox",t.multiple="checkbox"==t.display,e.BaseIcons.prototype.initialize.call(this,t), -this.initial=!0},value:function(t){var i=e.BaseIcons.prototype.value.call(this,t);if(this.initial&&null!==i&&this.header_index){this.initial=!1;var n=i;o.isArray(n)||(n=[n]);for(var s in n){var a=this.header_index[n[s]];for(var r in a)this._setState(a[r],!0)}}return i},_setState:function(t,e){var i=this.$(".button-"+t),n=this.$(".subgroup-"+t);i.data("is_expanded",e),e?(n.fadeIn("fast"),i.removeClass("toggle-expand"),i.addClass("toggle")):(n.hide(),i.removeClass("toggle"),i.addClass("toggle-expand"))},_templateOptions:function(e){function n(t,e){var i=t.find(".button-"+e);i.on("click",function(){a._setState(e,!i.data("is_expanded"))})}function s(e,r,l){l=l||[];for(i in r){var c=r[i],h=c.options.length>0,d=l.slice(0);a.header_index[c.value]=d.slice(0);var u=o("
    ");if(h){var p=t.uid(),f=o(''),g=o('