diff --git a/static/scripts/bundled/admin.bundled.js b/static/scripts/bundled/admin.bundled.js index 1b67dca8cd7..ea683701bb8 100644 --- a/static/scripts/bundled/admin.bundled.js +++ b/static/scripts/bundled/admin.bundled.js @@ -1 +1 @@ -webpackJsonp([2],{23:function(e,t,o){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function s(e,t){return this._init(e||{},t||{})}Object.defineProperty(t,"__esModule",{value:!0});var n=o(1),r=a(n),l=o(2),u=a(l),c=o(5),d=i(c),p=o(24),g=i(p),_=o(25),f=i(_),h=o(32),m=i(h),y=o(4),v=i(y);(0,m.default)(s,"GalaxyApp");var b="galaxy:debug:namespaces",w=!1;try{w="true"==localStorage.getItem("galaxy:debug")}catch(e){console.log((0,v.default)("localStorage not available for debug flag retrieval"))}s.prototype._init=function(e,t){var o=this;return r.extend(o,u.Events),w&&(o.logger=console,console.debug("debugging galaxy:","options:",e,"bootstrapped:",t)),o._processOptions(e),o.root=e.root||"/",o.params=e.params||{},o.session_csrf_token=e.session_csrf_token||null,o._initConfig(e.config||{}),o._patchGalaxy(window.Galaxy),o._initLogger(o.options.loggerOptions||{}),o.debug("GalaxyApp.options: ",o.options),o.debug("GalaxyApp.config: ",o.config),o.debug("GalaxyApp.logger: ",o.logger),o._initLocale(),o.debug("GalaxyApp.localize: ",o.localize),o.config=e.config||{},o.debug("GalaxyApp.config: ",o.config),o._initUser(e.user||{}),o.debug("GalaxyApp.user: ",o.user),o._setUpListeners(),o.trigger("ready",o),o},s.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},s.prototype._processOptions=function(e){var t=this,o=t.defaultOptions;t.options={};for(var i in o)o.hasOwnProperty(i)&&(t.options[i]=e.hasOwnProperty(i)?e[i]:o[i]);return t},s.prototype._initConfig=function(e){var t=this;return t.config=e,t.config.debug=w||t.config.debug,t},s.prototype._patchGalaxy=function(e){var t=this;if(t.options.patchExisting&&e)for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])},s.prototype._initLogger=function(e){var t=this;if(t.config.debug){e.consoleLogger=e.consoleLogger||console,e.consoleLevel=e.consoleLevel||f.default.MetricsLogger.ALL;try{e.consoleNamespaceWhitelist=localStorage.getItem(b).split(",")}catch(e){}try{e.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(e){}console.log(e.consoleFlattenMessages)}return t.logger=new f.default.MetricsLogger(e),t.emit={},["log","debug","info","warn","error","metric"].map(function(e){t.emit[e]=function(o){t.logger.emit(e,arguments[0],Array.prototype.slice.call(arguments,1))}}),t.config.debug&&(d.default.LoggableMixin.logger=t.logger),t},s.prototype._initLocale=function(e){var t=this;return t.debug("_initLocale:",e),t.localize=v.default,window._l=t.localize,t},s.prototype._initUser=function(e){var t=this;return t.debug("_initUser:",e),t.user=new g.default.User(e),t.user.logger=t.logger,t},s.prototype._setUpListeners=function(){var t=this;return t.lastAjax={},e(document).bind("ajaxSend",function(e,o,i){var a=i.data;try{a=JSON.parse(a)}catch(e){}t.lastAjax={url:location.href.slice(0,-1)+i.url,data:a}}),t},s.prototype.debugging=function(e){var t=this;try{if(void 0===e)return"true"===localStorage.getItem("galaxy:debug");if(e)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),t.debuggingNamespaces(null)}catch(e){console.log((0,v.default)("localStorage not available for debug flag retrieval"))}return!1},s.prototype.debuggingNamespaces=function(e){var t=this;try{if(void 0===e){var o=localStorage.getItem(b);return"string"==typeof o?o.split(","):[]}null===e?localStorage.removeItem(b):localStorage.setItem(b,e);var i=t.debuggingNamespaces();return t.logger&&(t.logger.options.consoleNamespaceWhitelist=i),i}catch(e){console.log((0,v.default)("localStorage not available for debug namespace retrieval"))}},s.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},t.default={GalaxyApp:s}}).call(t,o(0))},25:function(e,t,o){"use strict";(function(e){function o(e){e=e||{};var t=this;return t.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,t.userId=t.userId||e.userId||null,t.consoleLogger=e.consoleLogger||null,t._init(e),t}function i(e){var t=String(e);return"[object Object]"==t&&(t=JSON.stringify(e)),t}function a(e){return this._init(e||{})}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o.ALL=0,o.LOG=0,o.DEBUG=10,o.INFO=20,o.WARN=30,o.ERROR=40,o.METRIC=50,o.NONE=100,o.defaultOptions={logLevel:o.NONE,consoleLevel:o.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},o.prototype._init=function(e){var t=this;t.options={};for(var i in o.defaultOptions)o.defaultOptions.hasOwnProperty(i)&&(t.options[i]=e.hasOwnProperty(i)?e[i]:o.defaultOptions[i]);return t.options.logLevel=t._parseLevel(t.options.logLevel),t.options.consoleLevel=t._parseLevel(t.options.consoleLevel),t._sending=!1,t._waiting=null,t._postSize=t.options.postSize,t._initCache(),t},o.prototype._initCache=function(){try{this.cache=new a({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(e){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",e]),this.options.logLevel=o.NONE}},o.prototype._parseLevel=function(e){var t=void 0===e?"undefined":s(e);if("number"===t)return e;if("string"===t){var i=e.toUpperCase();if(o.hasOwnProperty(i))return o[i]}throw new Error("Unknown log level: "+e)},o.prototype.emit=function(e,t,o){var i=this;return t=t||i.options.defaultNamespace,e&&o?(e=i._parseLevel(e),e>=i.options.logLevel&&i._addToCache(e,t,o),i.consoleLogger&&e>=i.options.consoleLevel&&i._emitToConsole(e,t,o),i):i},o.prototype._addToCache=function(e,t,o){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var i=this;try{i.cache.add(i._buildEntry(e,t,o))>=i._postSize&&i._postCache()}catch(e){i._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",t,o]),i._emitToConsole("error","MetricsLogger",[e])}return i},o.prototype._buildEntry=function(e,t,o){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var i={level:e,namespace:this.options.clientPrefix+t,args:o};return this.options.addTime&&(i.time=(new Date).toISOString()),i},o.prototype._postCache=function(t){if(t=t||{},this._emitToConsole("info","MetricsLogger",["_postCache",t,this._postSize]),!this.options.postUrl||this._sending)return e.when({});var o=this,i=t.count||o._postSize,a=o.cache.get(i),s=a.length,n="function"==typeof o.options.getPingData?o.options.getPingData():{};return n.metrics=JSON.stringify(a),o._sending=!0,e.post(o.options.postUrl,n).always(function(){o._sending=!1}).fail(function(e,t,i){o._postSize=o.options.maxCacheSize,o.emit("error","MetricsLogger",["_postCache error:",e.readyState,e.status,e.responseJSON||e.responseText])}).done(function(e){"function"==typeof o.options.onServerResponse&&o.options.onServerResponse(e),o.cache.remove(s),o._postSize=o.options.postSize})},o.prototype._delayPost=function(){var e=this;e._waiting=setTimeout(function(){e._waiting=null},e.options.delayPostInMs)},o.prototype._emitToConsole=function(e,t,a){var s=this,n=s.options.consoleNamespaceWhitelist;if(!s.consoleLogger)return s;if(n&&-1===n.indexOf(t))return s;var r=Array.prototype.slice.call(a,0);return r.unshift(t),s.options.consoleFlattenMessages&&(r=[r.map(i).join(" ")]),e>=o.METRIC&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=o.ERROR&&"function"==typeof s.consoleLogger.error?s.consoleLogger.error.apply(s.consoleLogger,r):(e>=o.WARN&&"function"==typeof s.consoleLogger.warn?s.consoleLogger.warn.apply(s.consoleLogger,r):e>=o.INFO&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=o.DEBUG&&"function"==typeof s.consoleLogger.debug?s.consoleLogger.debug.apply(s.consoleLogger,r):"function"==typeof s.consoleLogger.log&&s.consoleLogger.log.apply(s.consoleLogger,r),s)},o.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.debug=function(){this.emit(o.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.info=function(){this.emit(o.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.warn=function(){this.emit(o.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.error=function(){this.emit(o.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.metric=function(){this.emit(o.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},a.defaultOptions={maxSize:5e3},a.prototype._init=function(e){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!e.key)throw new Error("LoggingCache needs key for localStorage");return this.key=e.key,this._initStorage(),this.maxSize=e.maxSize||a.defaultOptions.maxSize,this},a.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},a.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},a.prototype.add=function(e){var t=this,o=t._fetchAndParse(),i=o.length+1-t.maxSize;return i>0&&o.splice(0,i),o.push(e),t._unparseAndStore(o),o.length},a.prototype._fetchAndParse=function(){var e=this;return JSON.parse(localStorage.getItem(e.key))},a.prototype._unparseAndStore=function(e){var t=this;return localStorage.setItem(t.key,JSON.stringify(e))},a.prototype.length=function(){return this._fetchAndParse().length},a.prototype.get=function(e){return this._fetchAndParse().slice(0,e)},a.prototype.remove=function(e){var t=this._fetchAndParse(),o=t.splice(0,e);return this._unparseAndStore(t),o},a.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},a.prototype.stringify=function(e){return JSON.stringify(this.get(e))},a.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},t.default={MetricsLogger:o,LoggingCache:a}}).call(t,o(0))},26:function(e,t,o){"use strict";(function(e,i,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o(33),r=s(n),l=o(22),u=s(l),c=o(8),d=s(c),p=o(3),g=s(p),_=e.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(t){var o=this;this.config=i.defaults(t.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new d.default.View,Galaxy.display=this.display=function(e){e.title?(g.default.setWindowTitle(e.title),e.allow_title_display=!1):(g.default.setWindowTitle(),e.allow_title_display=!0),o.center.display(e)},Galaxy.router=this.router=t.Router&&new t.Router(o,t),this.masthead=new r.default.View(this.config),this.center=new u.default.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},i.each(this._panelids,function(e){var i=e.charAt(0).toUpperCase()+e.slice(1),a=t[i];if(a){var s=new a(o,t);o[s.toString()]=s,o.panels[e]=new u.default.SidePanel({id:e,el:o.$("#"+e),view:s})}}),this.render(),this.router&&e.history.start({root:Galaxy.root,pushState:!0})},render:function(){return a(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var e=this.config.message_box_content||"",t=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+t+"-message").html(e).toggle(!!e).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var e=this.config.inactivity_box_content||"",t=a("").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(e+" ").append(t).toggle(!!e).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var e=this;return i.each(this._panelids,function(t){var o=e.panels[t];o?o.render():(e.$("#center").css(t,0),e.$("#"+t).hide())}),this},_template:function(){return['
','
','
','
','
','
','
','",'
'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var e=window.Galaxy.config.communication_server_host,t=window.Galaxy.config.communication_server_port,o=window.Galaxy.user.attributes.preferences,i=a("#show-chat-online");o&&-1!=["1","true"].indexOf(o.communication_server)?a.ajax({url:e+":"+t}).success(function(e){null!==window.Galaxy.user.id&&"hidden"===i.css("visibility")&&i.css("visibility","visible")}).error(function(e){i.css("visibility","hidden")}):i.css("visibility","hidden")}});t.default={View:_}}).call(t,o(2),o(1),o(0))},277:function(e,t,o){"use strict";(function(e){function t(e){return e&&e.__esModule?e:{default:e}}var i=o(0),a=t(i),s=o(23),n=t(s),r=o(278),l=t(r),u=o(68),c=t(u),d=o(19),p=t(d),g=o(6),_=(t(g),o(14)),f=t(_),h=o(53),m=t(h),y=o(3),v=t(y),b=o(26),w=t(b),x=o(31),S=t(x),L=o(279),G=t(L),O=a.default;window.app=function(t,o){window.Galaxy=new n.default.GalaxyApp(t,o),Galaxy.debug("admin app");var i=m.default.extend({routes:{"(/)admin(/)users":"show_users","(/)admin(/)roles":"show_roles","(/)admin(/)groups":"show_groups","(/)admin(/)tool_versions":"show_tool_versions","(/)admin(/)quotas":"show_quotas","(/)admin(/)repositories":"show_repositories","(/)admin(/)forms":"show_forms","(/)admin(/)form(/)(:form_id)":"show_form","(/)admin/api_keys":"show_user_api_keys"},authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id&&Galaxy.user.get("is_admin")},show_users:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/users_list",url_data:Galaxy.params,dict_format:!0}))},show_roles:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/roles_list",url_data:Galaxy.params,dict_format:!0}))},show_groups:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/groups_list",url_data:Galaxy.params,dict_format:!0}))},show_repositories:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin_toolshed/browse_repositories",url_data:Galaxy.params,dict_format:!0}))},show_tool_versions:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/tool_versions_list",url_data:Galaxy.params,dict_format:!0}))},show_quotas:function(){this.page.display(new p.default({url_base:Galaxy.root+"admin/quotas_list",url_data:Galaxy.params,dict_format:!0}))},show_user_api_keys:function(){var e=document.createElement("div");this.page.display(e),new S.default(G.default).$mount(e)},show_forms:function(){this.page.display(new p.default({url_base:Galaxy.root+"forms/forms_list",url_data:Galaxy.params,dict_format:!0}))},show_form:function(e){var t="?id="+f.default.get("id"),o={reset_user_password:{title:"Reset passwords",url:"admin/reset_user_password"+t,icon:"fa-user",submit_title:"Save new password",redirect:"admin/users"},manage_roles_and_groups_for_user:{url:"admin/manage_roles_and_groups_for_user"+t,icon:"fa-users",redirect:"admin/users"},manage_users_and_groups_for_role:{url:"admin/manage_users_and_groups_for_role"+t,redirect:"admin/roles"},manage_users_and_roles_for_group:{url:"admin/manage_users_and_roles_for_group"+t,redirect:"admin/groups"},manage_users_and_groups_for_quota:{url:"admin/manage_users_and_groups_for_quota"+t,redirect:"admin/quotas"},create_role:{url:"admin/create_role",redirect:"admin/roles"},create_group:{url:"admin/create_group",redirect:"admin/groups"},create_quota:{url:"admin/create_quota",redirect:"admin/quotas"},rename_role:{url:"admin/rename_role"+t,redirect:"admin/roles"},rename_group:{url:"admin/rename_group"+t,redirect:"admin/groups"},rename_quota:{url:"admin/rename_quota"+t,redirect:"admin/quotas"},edit_quota:{url:"admin/edit_quota"+t,redirect:"admin/quotas"},set_quota_default:{url:"admin/set_quota_default"+t,redirect:"admin/quotas"},create_form:{url:"forms/create_form",redirect:"admin/forms"},edit_form:{url:"forms/edit_form"+t,redirect:"admin/forms"}};this.page.display(new c.default.View(o[e]))}});O(function(){e.extend(t.config,{active_view:"admin"}),v.default.setWindowTitle("Administration"),Galaxy.page=new w.default.View(e.extend(t,{Left:l.default,Router:i}))})}}).call(t,o(1))},278:function(e,t,o){"use strict";(function(e,i,a){Object.defineProperty(t,"__esModule",{value:!0});var s=o(4),n=function(e){return e&&e.__esModule?e:{default:e}}(s),r=e.View.extend({initialize:function(t,o){var i=this;this.page=t,this.root=o.root,this.config=o.config,this.settings=o.settings,this.message=o.message,this.status=o.status,this.model=new e.Model({title:(0,n.default)("Administration")}),this.categories=new e.Collection([{title:"Server",items:[{title:"Data types",url:"admin/view_datatypes_registry"},{title:"Data tables",url:"admin/view_tool_data_tables"},{title:"Display applications",url:"admin/display_applications"},{title:"Manage jobs",url:"admin/jobs"},{title:"Local data",url:"data_manager"}]},{title:"User Management",items:[{title:"Users",url:"admin/users",target:"__use_router__"},{title:"Quotas",url:"admin/quotas",target:"__use_router__",enabled:i.config.enable_quotas},{title:"Groups",url:"admin/groups",target:"__use_router__"},{title:"Roles",url:"admin/roles",target:"__use_router__"},{title:"Forms",url:"admin/forms",target:"__use_router__"},{title:"API keys",url:"admin/api_keys",target:"__use_router__"},{title:"Impersonate a user",url:"admin/impersonate",enabled:i.config.allow_user_impersonation}]},{title:"Tool Management",items:[{title:"Install new tools",url:"admin_toolshed/browse_tool_sheds",enabled:i.settings.is_tool_shed_installed},{title:"Install new tools (Beta)",url:"admin_toolshed/browse_toolsheds",enabled:i.settings.is_tool_shed_installed&&i.config.enable_beta_ts_api_install},{title:"Monitor installation",url:"admin_toolshed/monitor_repository_installation",enabled:i.settings.installing_repository_ids},{title:"Manage tools",url:"admin/repositories",enabled:i.settings.is_repo_installed,target:"__use_router__"},{title:"Manage metadata",url:"admin_toolshed/reset_metadata_on_selected_installed_repositories",enabled:i.settings.is_repo_installed},{title:"Manage whitelist",url:"admin/sanitize_whitelist"},{title:"Manage dependencies",url:"admin/manage_tool_dependencies"},{title:"View lineage",url:"admin/tool_versions",target:"__use_router__"},{title:"View migration stages",url:"admin/review_tool_migration_stages"},{title:"View error logs",url:"admin/tool_errors"}]}]),this.setElement(this._template())},render:function(){var e=this;this.$el.empty(),this.categories.each(function(t){var o=i(e._templateSection(t.attributes)),s=o.find(".ui-side-section-body");a.each(t.get("items"),function(t){if(void 0===t.enabled||t.enabled){var o=i("").attr({href:e.root+t.url}).text((0,n.default)(t.title));"__use_router__"==t.target?o.on("click",function(o){o.preventDefault(),e.page.router.push(t.url)}):o.attr("target","galaxy_main"),s.append(i("
").addClass("ui-side-section-body-title").append(o))}}),e.$el.append(o)}),this.page.$("#galaxy_main").prop("src",this.root+"admin/center?message="+this.message+"&status="+this.status)},_templateSection:function(e){return["
",'
'+(0,n.default)(e.title)+"
",'
',"
"].join("")},_template:function(){return'
'},toString:function(){return"adminPanel"}});t.default=r}).call(t,o(2),o(0),o(1))},279:function(e,t,o){"use strict";function i(e){o(280)}Object.defineProperty(t,"__esModule",{value:!0});var a=o(282),s=o.n(a),n=o(283),r=o(48),l=i,u=r(s.a,n.a,!1,l,null,null);t.default=u.exports},280:function(e,t,o){var i=o(281);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);o(47)("b1b74e4e",i,!0)},281:function(e,t,o){t=e.exports=o(46)(void 0),t.push([e.i,"",""])},282:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(92),a=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default={data:function(){return{users:[],errors:[]}},created:function(){var e=this;a.default.get(Galaxy.root+"userskeys/all_users").then(function(t){e.users=t.data}).catch(function(t){e.errors.push(t)})},methods:{generateKey:function(e){var t=this;a.default.get(Galaxy.root+"userskeys/admin_api_keys",{params:{uid:e}}).then(function(e){t.users=e.data}).catch(function(e){t.errors.push(e)})}}}},283:function(e,t,o){"use strict";var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"toolForm",attrs:{id:"form-userkeys"}},[o("div",{staticClass:"toolFormTitle"},[e._v("User Information")]),e._v(" "),e.users&&e.users.length>0?o("div",[o("table",{staticClass:"grid"},[e._m(0),e._v(" "),o("tbody",e._l(e.users,function(t){return o("tr",[o("td",[e._v("\n "+e._s(t.uid)+"\n ")]),e._v(" "),o("td",[e._v("\n "+e._s(t.email)+"\n ")]),e._v(" "),o("td",[e._v("\n "+e._s(t.key)+"\n ")]),e._v(" "),o("td",[o("input",{attrs:{type:"button",value:"Generate a new key now"},on:{click:function(o){e.generateKey(t.uid)}}})])])}))])]):o("div",[o("div",[e._v("No user information available")])]),e._v(" "),o("div",{staticStyle:{clear:"both"}})])},a=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("thead",[o("th",[e._v("Encoded UID")]),o("th",[e._v("Email")]),o("th",[e._v("API Key")]),o("th",[e._v("Actions")])])}],s={render:i,staticRenderFns:a};t.a=s},53:function(e,t,o){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(0),s=i(a),n=o(14),r=i(n),l=o(6),u=i(l),c=s.default,d=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),c.isEmptyObject(t)||(e+=-1==e.indexOf("?")?"?":"&",e+=c.param(t,!0)),Galaxy.params=t,this.navigate(e,{trigger:!0})},execute:function(e,t,o){Galaxy.debug("router execute:",e,t,o);var i=r.default.parse(t.pop());t.push(i),e&&(this.authenticate(t,o)?e.apply(this,t):this.access_denied())},authenticate:function(e,t){return!0},access_denied:function(){this.page.display(new u.default.Message({status:"danger",message:"You must be logged in with proper credentials to make this request.",persistent:!0}))}});t.default=d}).call(t,o(2))},68:function(e,t,o){"use strict";(function(e,i){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=o(11),n=a(s),r=o(6),l=a(r),u=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
"),this.render()},render:function(){var e=this;i.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(t){var o=i.extend({},e.model.attributes,t),a=new n.default({title:o.title,message:o.message,status:o.status||"warning",icon:o.icon,initial_errors:!0,errors:o.errors,inputs:o.inputs,buttons:{submit:new l.default.Button({tooltip:o.submit_tooltip,title:o.submit_title||"Save",icon:o.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){e._submit(a)}})}});e.$el.empty().append(a.$el)}).fail(function(t){e.$el.empty().append(new l.default.Message({message:"Failed to load resource "+e.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;i.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(o){var a={};o.id?a.id=o.id:a={message:o.message,status:"success",persistent:!1},t.redirect?window.location=Galaxy.root+t.redirect+"?"+i.param(a):(e.data.matchModel(o,function(t,o){e.field_list[o].value(t.value)}),t._showMessage(e,success_message))}).fail(function(o){t._showMessage(e,{message:o.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){e.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(i(this).css("overflow"))}).first().animate({scrollTop:0},500),e.message.update(t)}});t.default={View:u}}).call(t,o(2),o(0))}},[277]); \ No newline at end of file +webpackJsonp([2],{23:function(e,t,o){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function s(e,t){return this._init(e||{},t||{})}Object.defineProperty(t,"__esModule",{value:!0});var n=o(1),r=a(n),l=o(2),u=a(l),d=o(5),c=i(d),p=o(24),g=i(p),f=o(25),_=i(f),h=o(32),m=i(h),y=o(3),v=i(y);(0,m.default)(s,"GalaxyApp");var b="galaxy:debug:namespaces",w=!1;try{w="true"==localStorage.getItem("galaxy:debug")}catch(e){console.log((0,v.default)("localStorage not available for debug flag retrieval"))}s.prototype._init=function(e,t){var o=this;return r.extend(o,u.Events),w&&(o.logger=console,console.debug("debugging galaxy:","options:",e,"bootstrapped:",t)),o._processOptions(e),o.root=e.root||"/",o.params=e.params||{},o.session_csrf_token=e.session_csrf_token||null,o._initConfig(e.config||{}),o._patchGalaxy(window.Galaxy),o._initLogger(o.options.loggerOptions||{}),o.debug("GalaxyApp.options: ",o.options),o.debug("GalaxyApp.config: ",o.config),o.debug("GalaxyApp.logger: ",o.logger),o._initLocale(),o.debug("GalaxyApp.localize: ",o.localize),o.config=e.config||{},o.debug("GalaxyApp.config: ",o.config),o._initUser(e.user||{}),o.debug("GalaxyApp.user: ",o.user),o._setUpListeners(),o.trigger("ready",o),o},s.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},s.prototype._processOptions=function(e){var t=this,o=t.defaultOptions;t.options={};for(var i in o)o.hasOwnProperty(i)&&(t.options[i]=e.hasOwnProperty(i)?e[i]:o[i]);return t},s.prototype._initConfig=function(e){var t=this;return t.config=e,t.config.debug=w||t.config.debug,t},s.prototype._patchGalaxy=function(e){var t=this;if(t.options.patchExisting&&e)for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])},s.prototype._initLogger=function(e){var t=this;if(t.config.debug){e.consoleLogger=e.consoleLogger||console,e.consoleLevel=e.consoleLevel||_.default.MetricsLogger.ALL;try{e.consoleNamespaceWhitelist=localStorage.getItem(b).split(",")}catch(e){}try{e.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(e){}console.log(e.consoleFlattenMessages)}return t.logger=new _.default.MetricsLogger(e),t.emit={},["log","debug","info","warn","error","metric"].map(function(e){t.emit[e]=function(o){t.logger.emit(e,arguments[0],Array.prototype.slice.call(arguments,1))}}),t.config.debug&&(c.default.LoggableMixin.logger=t.logger),t},s.prototype._initLocale=function(e){var t=this;return t.debug("_initLocale:",e),t.localize=v.default,window._l=t.localize,t},s.prototype._initUser=function(e){var t=this;return t.debug("_initUser:",e),t.user=new g.default.User(e),t.user.logger=t.logger,t},s.prototype._setUpListeners=function(){var t=this;return t.lastAjax={},e(document).bind("ajaxSend",function(e,o,i){var a=i.data;try{a=JSON.parse(a)}catch(e){}t.lastAjax={url:location.href.slice(0,-1)+i.url,data:a}}),t},s.prototype.debugging=function(e){var t=this;try{if(void 0===e)return"true"===localStorage.getItem("galaxy:debug");if(e)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),t.debuggingNamespaces(null)}catch(e){console.log((0,v.default)("localStorage not available for debug flag retrieval"))}return!1},s.prototype.debuggingNamespaces=function(e){var t=this;try{if(void 0===e){var o=localStorage.getItem(b);return"string"==typeof o?o.split(","):[]}null===e?localStorage.removeItem(b):localStorage.setItem(b,e);var i=t.debuggingNamespaces();return t.logger&&(t.logger.options.consoleNamespaceWhitelist=i),i}catch(e){console.log((0,v.default)("localStorage not available for debug namespace retrieval"))}},s.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},t.default={GalaxyApp:s}}).call(t,o(0))},25:function(e,t,o){"use strict";(function(e){function o(e){e=e||{};var t=this;return t.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,t.userId=t.userId||e.userId||null,t.consoleLogger=e.consoleLogger||null,t._init(e),t}function i(e){var t=String(e);return"[object Object]"==t&&(t=JSON.stringify(e)),t}function a(e){return this._init(e||{})}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o.ALL=0,o.LOG=0,o.DEBUG=10,o.INFO=20,o.WARN=30,o.ERROR=40,o.METRIC=50,o.NONE=100,o.defaultOptions={logLevel:o.NONE,consoleLevel:o.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},o.prototype._init=function(e){var t=this;t.options={};for(var i in o.defaultOptions)o.defaultOptions.hasOwnProperty(i)&&(t.options[i]=e.hasOwnProperty(i)?e[i]:o.defaultOptions[i]);return t.options.logLevel=t._parseLevel(t.options.logLevel),t.options.consoleLevel=t._parseLevel(t.options.consoleLevel),t._sending=!1,t._waiting=null,t._postSize=t.options.postSize,t._initCache(),t},o.prototype._initCache=function(){try{this.cache=new a({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(e){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",e]),this.options.logLevel=o.NONE}},o.prototype._parseLevel=function(e){var t=void 0===e?"undefined":s(e);if("number"===t)return e;if("string"===t){var i=e.toUpperCase();if(o.hasOwnProperty(i))return o[i]}throw new Error("Unknown log level: "+e)},o.prototype.emit=function(e,t,o){var i=this;return t=t||i.options.defaultNamespace,e&&o?(e=i._parseLevel(e),e>=i.options.logLevel&&i._addToCache(e,t,o),i.consoleLogger&&e>=i.options.consoleLevel&&i._emitToConsole(e,t,o),i):i},o.prototype._addToCache=function(e,t,o){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var i=this;try{i.cache.add(i._buildEntry(e,t,o))>=i._postSize&&i._postCache()}catch(e){i._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",t,o]),i._emitToConsole("error","MetricsLogger",[e])}return i},o.prototype._buildEntry=function(e,t,o){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var i={level:e,namespace:this.options.clientPrefix+t,args:o};return this.options.addTime&&(i.time=(new Date).toISOString()),i},o.prototype._postCache=function(t){if(t=t||{},this._emitToConsole("info","MetricsLogger",["_postCache",t,this._postSize]),!this.options.postUrl||this._sending)return e.when({});var o=this,i=t.count||o._postSize,a=o.cache.get(i),s=a.length,n="function"==typeof o.options.getPingData?o.options.getPingData():{};return n.metrics=JSON.stringify(a),o._sending=!0,e.post(o.options.postUrl,n).always(function(){o._sending=!1}).fail(function(e,t,i){o._postSize=o.options.maxCacheSize,o.emit("error","MetricsLogger",["_postCache error:",e.readyState,e.status,e.responseJSON||e.responseText])}).done(function(e){"function"==typeof o.options.onServerResponse&&o.options.onServerResponse(e),o.cache.remove(s),o._postSize=o.options.postSize})},o.prototype._delayPost=function(){var e=this;e._waiting=setTimeout(function(){e._waiting=null},e.options.delayPostInMs)},o.prototype._emitToConsole=function(e,t,a){var s=this,n=s.options.consoleNamespaceWhitelist;if(!s.consoleLogger)return s;if(n&&-1===n.indexOf(t))return s;var r=Array.prototype.slice.call(a,0);return r.unshift(t),s.options.consoleFlattenMessages&&(r=[r.map(i).join(" ")]),e>=o.METRIC&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=o.ERROR&&"function"==typeof s.consoleLogger.error?s.consoleLogger.error.apply(s.consoleLogger,r):(e>=o.WARN&&"function"==typeof s.consoleLogger.warn?s.consoleLogger.warn.apply(s.consoleLogger,r):e>=o.INFO&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=o.DEBUG&&"function"==typeof s.consoleLogger.debug?s.consoleLogger.debug.apply(s.consoleLogger,r):"function"==typeof s.consoleLogger.log&&s.consoleLogger.log.apply(s.consoleLogger,r),s)},o.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.debug=function(){this.emit(o.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.info=function(){this.emit(o.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.warn=function(){this.emit(o.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.error=function(){this.emit(o.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},o.prototype.metric=function(){this.emit(o.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},a.defaultOptions={maxSize:5e3},a.prototype._init=function(e){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!e.key)throw new Error("LoggingCache needs key for localStorage");return this.key=e.key,this._initStorage(),this.maxSize=e.maxSize||a.defaultOptions.maxSize,this},a.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},a.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},a.prototype.add=function(e){var t=this,o=t._fetchAndParse(),i=o.length+1-t.maxSize;return i>0&&o.splice(0,i),o.push(e),t._unparseAndStore(o),o.length},a.prototype._fetchAndParse=function(){var e=this;return JSON.parse(localStorage.getItem(e.key))},a.prototype._unparseAndStore=function(e){var t=this;return localStorage.setItem(t.key,JSON.stringify(e))},a.prototype.length=function(){return this._fetchAndParse().length},a.prototype.get=function(e){return this._fetchAndParse().slice(0,e)},a.prototype.remove=function(e){var t=this._fetchAndParse(),o=t.splice(0,e);return this._unparseAndStore(t),o},a.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},a.prototype.stringify=function(e){return JSON.stringify(this.get(e))},a.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},t.default={MetricsLogger:o,LoggingCache:a}}).call(t,o(0))},26:function(e,t,o){"use strict";(function(e,i,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o(33),r=s(n),l=o(22),u=s(l),d=o(8),c=s(d),p=o(4),g=s(p),f=e.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(t){var o=this;this.config=i.defaults(t.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new c.default.View,Galaxy.display=this.display=function(e){e.title?(g.default.setWindowTitle(e.title),e.allow_title_display=!1):(g.default.setWindowTitle(),e.allow_title_display=!0),o.center.display(e)},Galaxy.router=this.router=t.Router&&new t.Router(o,t),this.masthead=new r.default.View(this.config),this.center=new u.default.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},i.each(this._panelids,function(e){var i=e.charAt(0).toUpperCase()+e.slice(1),a=t[i];if(a){var s=new a(o,t);o[s.toString()]=s,o.panels[e]=new u.default.SidePanel({id:e,el:o.$("#"+e),view:s})}}),this.render(),this.router&&e.history.start({root:Galaxy.root,pushState:!0})},render:function(){return a(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var e=this.config.message_box_content||"",t=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+t+"-message").html(e).toggle(!!e).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var e=this.config.inactivity_box_content||"",t=a("").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(e+" ").append(t).toggle(!!e).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var e=this;return i.each(this._panelids,function(t){var o=e.panels[t];o?o.render():(e.$("#center").css(t,0),e.$("#"+t).hide())}),this},_template:function(){return['
','
','
','
','
','
','
','",'
'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var e=window.Galaxy.config.communication_server_host,t=window.Galaxy.config.communication_server_port,o=window.Galaxy.user.attributes.preferences,i=a("#show-chat-online");o&&-1!=["1","true"].indexOf(o.communication_server)?a.ajax({url:e+":"+t}).success(function(e){null!==window.Galaxy.user.id&&"hidden"===i.css("visibility")&&i.css("visibility","visible")}).error(function(e){i.css("visibility","hidden")}):i.css("visibility","hidden")}});t.default={View:f}}).call(t,o(2),o(1),o(0))},277:function(e,t,o){"use strict";(function(e){function t(e){return e&&e.__esModule?e:{default:e}}var i=o(3),a=t(i),s=o(0),n=t(s),r=o(23),l=t(r),u=o(278),d=t(u),c=o(68),p=t(c),g=o(19),f=t(g),_=o(6),h=(t(_),o(14)),m=t(h),y=o(53),v=t(y),b=o(4),w=t(b),x=o(26),S=t(x),L=o(31),G=t(L),O=o(279),M=t(O),C=n.default;window.app=function(t,o){window.Galaxy=new l.default.GalaxyApp(t,o),Galaxy.debug("admin app");var i=v.default.extend({routes:{"(/)admin(/)users":"show_users","(/)admin(/)roles":"show_roles","(/)admin(/)groups":"show_groups","(/)admin(/)tool_versions":"show_tool_versions","(/)admin(/)quotas":"show_quotas","(/)admin(/)repositories":"show_repositories","(/)admin(/)forms":"show_forms","(/)admin(/)form(/)(:form_id)":"show_form","(/)admin/api_keys":"show_user_api_keys"},authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id&&Galaxy.user.get("is_admin")},show_users:function(){this.page.display(new f.default({url_base:Galaxy.root+"admin/users_list",url_data:Galaxy.params,dict_format:!0}))},show_roles:function(){this.page.display(new f.default({url_base:Galaxy.root+"admin/roles_list",url_data:Galaxy.params,dict_format:!0}))},show_groups:function(){this.page.display(new f.default({url_base:Galaxy.root+"admin/groups_list",url_data:Galaxy.params,dict_format:!0}))},show_repositories:function(){this.page.display(new f.default({url_base:Galaxy.root+"admin_toolshed/browse_repositories",url_data:Galaxy.params,dict_format:!0}))},show_tool_versions:function(){this.page.display(new f.default({url_base:Galaxy.root+"admin/tool_versions_list",url_data:Galaxy.params,dict_format:!0}))},show_quotas:function(){this.page.display(new f.default({url_base:Galaxy.root+"admin/quotas_list",url_data:Galaxy.params,dict_format:!0}))},show_user_api_keys:function(){var e=document.createElement("div");this.page.display(e),new G.default(M.default).$mount(e)},show_forms:function(){this.page.display(new f.default({url_base:Galaxy.root+"forms/forms_list",url_data:Galaxy.params,dict_format:!0}))},show_form:function(e){var t="?id="+m.default.get("id"),o={reset_user_password:{title:(0,a.default)("Reset passwords"),url:"admin/reset_user_password"+t,icon:"fa-user",submit_title:"Save new password",redirect:"admin/users"},manage_roles_and_groups_for_user:{url:"admin/manage_roles_and_groups_for_user"+t,icon:"fa-users",redirect:"admin/users"},manage_users_and_groups_for_role:{url:"admin/manage_users_and_groups_for_role"+t,redirect:"admin/roles"},manage_users_and_roles_for_group:{url:"admin/manage_users_and_roles_for_group"+t,redirect:"admin/groups"},manage_users_and_groups_for_quota:{url:"admin/manage_users_and_groups_for_quota"+t,redirect:"admin/quotas"},create_role:{url:"admin/create_role",redirect:"admin/roles"},create_group:{url:"admin/create_group",redirect:"admin/groups"},create_quota:{url:"admin/create_quota",redirect:"admin/quotas"},rename_role:{url:"admin/rename_role"+t,redirect:"admin/roles"},rename_group:{url:"admin/rename_group"+t,redirect:"admin/groups"},rename_quota:{url:"admin/rename_quota"+t,redirect:"admin/quotas"},edit_quota:{url:"admin/edit_quota"+t,redirect:"admin/quotas"},set_quota_default:{url:"admin/set_quota_default"+t,redirect:"admin/quotas"},create_form:{url:"forms/create_form",redirect:"admin/forms"},edit_form:{url:"forms/edit_form"+t,redirect:"admin/forms"}};this.page.display(new p.default.View(o[e]))}});C(function(){e.extend(t.config,{active_view:"admin"}),w.default.setWindowTitle("Administration"),Galaxy.page=new S.default.View(e.extend(t,{Left:d.default,Router:i}))})}}).call(t,o(1))},278:function(e,t,o){"use strict";(function(e,i,a){Object.defineProperty(t,"__esModule",{value:!0});var s=o(3),n=function(e){return e&&e.__esModule?e:{default:e}}(s),r=e.View.extend({initialize:function(t,o){var i=this;this.page=t,this.root=o.root,this.config=o.config,this.settings=o.settings,this.message=o.message,this.status=o.status,this.model=new e.Model({title:(0,n.default)("Administration")}),this.categories=new e.Collection([{title:(0,n.default)("Server"),items:[{title:(0,n.default)("Data types"),url:"admin/view_datatypes_registry"},{title:(0,n.default)("Data tables"),url:"admin/view_tool_data_tables"},{title:(0,n.default)("Display applications"),url:"admin/display_applications"},{title:(0,n.default)("Manage jobs"),url:"admin/jobs"},{title:(0,n.default)("Local data"),url:"data_manager"}]},{title:(0,n.default)("User Management"),items:[{title:(0,n.default)("Users"),url:"admin/users",target:"__use_router__"},{title:(0,n.default)("Quotas"),url:"admin/quotas",target:"__use_router__",enabled:i.config.enable_quotas},{title:(0,n.default)("Groups"),url:"admin/groups",target:"__use_router__"},{title:(0,n.default)("Roles"),url:"admin/roles",target:"__use_router__"},{title:(0,n.default)("Forms"),url:"admin/forms",target:"__use_router__"},{title:(0,n.default)("API keys"),url:"admin/api_keys",target:"__use_router__"},{title:(0,n.default)("Impersonate a user"),url:"admin/impersonate",enabled:i.config.allow_user_impersonation}]},{title:(0,n.default)("Tool Management"),items:[{title:(0,n.default)("Install new tools"),url:"admin_toolshed/browse_tool_sheds",enabled:i.settings.is_tool_shed_installed},{title:"Install new tools (Beta)",url:"admin_toolshed/browse_toolsheds",enabled:i.settings.is_tool_shed_installed&&i.config.enable_beta_ts_api_install},{title:(0,n.default)("Monitor installation"),url:"admin_toolshed/monitor_repository_installation",enabled:i.settings.installing_repository_ids},{title:(0,n.default)("Manage tools"),url:"admin/repositories",enabled:i.settings.is_repo_installed,target:"__use_router__"},{title:(0,n.default)("Manage metadata"),url:"admin_toolshed/reset_metadata_on_selected_installed_repositories",enabled:i.settings.is_repo_installed},{title:(0,n.default)("Manage whitelist"),url:"admin/sanitize_whitelist"},{title:(0,n.default)("Manage dependencies"),url:"admin/manage_tool_dependencies"},{title:(0,n.default)("View lineage"),url:"admin/tool_versions",target:"__use_router__"},{title:(0,n.default)("View migration stages"),url:"admin/review_tool_migration_stages"},{title:(0,n.default)("View error logs"),url:"admin/tool_errors"}]}]),this.setElement(this._template())},render:function(){var e=this;this.$el.empty(),this.categories.each(function(t){var o=i(e._templateSection(t.attributes)),s=o.find(".ui-side-section-body");a.each(t.get("items"),function(t){if(void 0===t.enabled||t.enabled){var o=i("").attr({href:e.root+t.url}).text((0,n.default)(t.title));"__use_router__"==t.target?o.on("click",function(o){o.preventDefault(),e.page.router.push(t.url)}):o.attr("target","galaxy_main"),s.append(i("
").addClass("ui-side-section-body-title").append(o))}}),e.$el.append(o)}),this.page.$("#galaxy_main").prop("src",this.root+"admin/center?message="+this.message+"&status="+this.status)},_templateSection:function(e){return["
",'
'+(0,n.default)(e.title)+"
",'
',"
"].join("")},_template:function(){return'
'},toString:function(){return"adminPanel"}});t.default=r}).call(t,o(2),o(0),o(1))},279:function(e,t,o){"use strict";function i(e){o(280)}Object.defineProperty(t,"__esModule",{value:!0});var a=o(282),s=o.n(a),n=o(283),r=o(48),l=i,u=r(s.a,n.a,!1,l,null,null);t.default=u.exports},280:function(e,t,o){var i=o(281);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);o(47)("b1b74e4e",i,!0)},281:function(e,t,o){t=e.exports=o(46)(void 0),t.push([e.i,"",""])},282:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(92),a=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default={data:function(){return{users:[],errors:[]}},created:function(){var e=this;a.default.get(Galaxy.root+"userskeys/all_users").then(function(t){e.users=t.data}).catch(function(t){e.errors.push(t)})},methods:{generateKey:function(e){var t=this;a.default.get(Galaxy.root+"userskeys/admin_api_keys",{params:{uid:e}}).then(function(e){t.users=e.data}).catch(function(e){t.errors.push(e)})}}}},283:function(e,t,o){"use strict";var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"toolForm",attrs:{id:"form-userkeys"}},[o("div",{staticClass:"toolFormTitle"},[e._v("User Information")]),e._v(" "),e.users&&e.users.length>0?o("div",[o("table",{staticClass:"grid"},[e._m(0),e._v(" "),o("tbody",e._l(e.users,function(t){return o("tr",[o("td",[e._v("\n "+e._s(t.uid)+"\n ")]),e._v(" "),o("td",[e._v("\n "+e._s(t.email)+"\n ")]),e._v(" "),o("td",[e._v("\n "+e._s(t.key)+"\n ")]),e._v(" "),o("td",[o("input",{attrs:{type:"button",value:"Generate a new key now"},on:{click:function(o){e.generateKey(t.uid)}}})])])}))])]):o("div",[o("div",[e._v("No user information available")])]),e._v(" "),o("div",{staticStyle:{clear:"both"}})])},a=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("thead",[o("th",[e._v("Encoded UID")]),o("th",[e._v("Email")]),o("th",[e._v("API Key")]),o("th",[e._v("Actions")])])}],s={render:i,staticRenderFns:a};t.a=s},53:function(e,t,o){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(0),s=i(a),n=o(14),r=i(n),l=o(6),u=i(l),d=s.default,c=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),d.isEmptyObject(t)||(e+=-1==e.indexOf("?")?"?":"&",e+=d.param(t,!0)),Galaxy.params=t,this.navigate(e,{trigger:!0})},execute:function(e,t,o){Galaxy.debug("router execute:",e,t,o);var i=r.default.parse(t.pop());t.push(i),e&&(this.authenticate(t,o)?e.apply(this,t):this.access_denied())},authenticate:function(e,t){return!0},access_denied:function(){this.page.display(new u.default.Message({status:"danger",message:"You must be logged in with proper credentials to make this request.",persistent:!0}))}});t.default=c}).call(t,o(2))},68:function(e,t,o){"use strict";(function(e,i){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=o(11),n=a(s),r=o(6),l=a(r),u=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
"),this.render()},render:function(){var e=this;i.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(t){var o=i.extend({},e.model.attributes,t),a=new n.default({title:o.title,message:o.message,status:o.status||"warning",icon:o.icon,initial_errors:!0,errors:o.errors,inputs:o.inputs,buttons:{submit:new l.default.Button({tooltip:o.submit_tooltip,title:o.submit_title||"Save",icon:o.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){e._submit(a)}})}});e.$el.empty().append(a.$el)}).fail(function(t){e.$el.empty().append(new l.default.Message({message:"Failed to load resource "+e.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;i.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(o){var a={};o.id?a.id=o.id:a={message:o.message,status:"success",persistent:!1},t.redirect?window.location=Galaxy.root+t.redirect+"?"+i.param(a):(e.data.matchModel(o,function(t,o){e.field_list[o].value(t.value)}),t._showMessage(e,success_message))}).fail(function(o){t._showMessage(e,{message:o.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){e.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(i(this).css("overflow"))}).first().animate({scrollTop:0},500),e.message.update(t)}});t.default={View:u}}).call(t,o(2),o(0))}},[277]); \ No newline at end of file diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js index dbe3278b080..b7356fd59ce 100644 --- a/static/scripts/bundled/analysis.bundled.js +++ b/static/scripts/bundled/analysis.bundled.js @@ -1,3 +1,3 @@ -webpackJsonp([0],[,,,,,,,,,,function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=function(e){return e&&e.__esModule?e:{default:e}}(s),o=e.View.extend({optionsDefault:{css:"",placeholder:"No data available",data:[],value:null,multiple:!1,minimumInputLength:0,initialData:""},initialize:function(e){if(this.options=a.default.merge(e,this.optionsDefault),this.setElement(this._template(this.options)),!this.options.container)return void console.log("ui-select::initialize() : container not specified.");if(this.options.container.append(this.$el),this.select_data=this.options.data,this._refresh(),!this.options.multiple){this.options.value&&this._setValue(this.options.value);var t=this;this.options.onchange&&this.$el.on("change",function(){t.options.onchange(t.value())})}},value:function(e){var t=this._getValue();void 0!==e&&this._setValue(e);var i=this._getValue();return i!=t&&this.options.onchange&&this.options.onchange(i),i},text:function(){return this.$el.select2("data").text},disabled:function(){return!this.$el.select2("enable")},enable:function(){this.$el.select2("enable",!0)},disable:function(){this.$el.select2("enable",!1)},add:function(e){this.select_data.push({id:e.id,text:e.text}),this._refresh()},del:function(e){var t=this._getIndex(e);-1!=t&&(this.select_data.splice(t,1),this._refresh())},remove:function(){this.$el.select2("destroy")},update:function(e){this.select_data=[];for(var t in e.data)this.select_data.push(e.data[t]);this._refresh()},_refresh:function(){if(this.options.multiple){var e={multiple:this.options.multiple,containerCssClass:this.options.css,placeholder:this.options.placeholder,minimumInputLength:this.options.minimumInputLength,ajax:this.options.ajax,dropdownCssClass:this.options.dropdownCssClass,escapeMarkup:this.options.escapeMarkup,formatResult:this.options.formatResult,formatSelection:this.options.formatSelection,initSelection:this.options.initSelection,initialData:this.options.initialData};this.$el.select2(e)}else{var t=this._getValue(),e={data:this.select_data,containerCssClass:this.options.css,placeholder:this.options.placeholder,dropdownAutoWidth:!0};this.$el.select2(e),this._setValue(t)}},_getIndex:function(e){n.findIndex(this.select_data,{id:e})},_getValue:function(){return this.$el.select2("val")},_setValue:function(e){-1==this._getIndex(e)&&this.select_data.length>0&&(e=this.select_data[0].id),this.$el.select2("val",e)},_template:function(e){return''}});t.default={View:o}}).call(t,i(2),i(1))},,,,,function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=function(e){return e&&e.__esModule?e:{default:e}}(a),r=e.View.extend({optionsDefault:{with_close:!0,title:null,placement:"top",container:"body",body:null},initialize:function(e){this.setElement(this._template()),this.uid=o.default.uid(),this.options=n.defaults(e||{},this.optionsDefault),this.options.container.parent().append(this.el),this.$title=this.$(".popover-title-label"),this.$close=this.$(".popover-close"),this.$body=this.$(".popover-content"),this.options.body&&this.append(this.options.body);var t=this;s("body").on("mousedown."+this.uid,function(e){t.visible&&!s(t.options.container).is(e.target)&&!s(t.el).is(e.target)&&0===s(t.el).has(e.target).length&&t.hide()})},render:function(){this.$title.html(this.options.title),this.$el.removeClass().addClass("ui-popover popover fade in").addClass(this.options.placement),this.$el.css(this._get_placement(this.options.placement));var e=this;this.options.with_close?this.$close.on("click",function(){e.hide()}).show():this.$close.off().hide()},title:function(e){void 0!==e&&(this.options.title=e,this.$title.html(e))},show:function(){this.render(),this.$el.show(),this.visible=!0},hide:function(){this.$el.hide(),this.visible=!1},append:function(e){this.$body.append(e)},empty:function(){this.$body.empty()},remove:function(){s("body").off("mousedown."+this.uid),this.$el.remove()},_get_placement:function(e){var t,i,n=this._get_width(this.$el),s=this.$el.height(),a=this.options.container,o=this._get_width(a),r=this._get_height(a),l=a.position();if(t=i=0,-1!=["top","bottom"].indexOf(e))switch(i=l.left-n+(o+n)/2,e){case"top":t=l.top-s-5;break;case"bottom":t=l.top+r+5}else switch(t=l.top-s+(r+s)/2,e){case"right":i=l.left+o}return{top:t,left:i}},_get_width:function(e){return e.width()+parseInt(e.css("padding-left"))+parseInt(e.css("margin-left"))+parseInt(e.css("padding-right"))+parseInt(e.css("margin-right"))},_get_height:function(e){return e.height()+parseInt(e.css("padding-top"))+parseInt(e.css("padding-bottom"))},_template:function(e){return'
'}});t.default={View:r}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};n.READY_STATES=[n.OK,n.EMPTY,n.PAUSED,n.FAILED_METADATA,n.NOT_VIEWABLE,n.DISCARDED,n.ERROR],n.NOT_READY_STATES=[n.UPLOAD,n.QUEUED,n.RUNNING,n.SETTING_METADATA,n.NEW],t.default=n},,,,,function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default,o=function(t){t=t||{},t.tooltipConfig=t.tooltipConfig||{placement:"bottom"},t.classes=["icon-btn"].concat(t.classes||[]),t.disabled&&t.classes.push("disabled");var i=['','',""].join(""),n=a(i).tooltip(t.tooltipConfig);return e.isFunction(t.onclick)&&n.click(t.onclick),n};t.default=o}).call(t,i(1))},,function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function a(e,t){return this._init(e||{},t||{})}Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),r=s(o),l=i(2),d=s(l),c=i(5),u=n(c),h=i(24),f=n(h),p=i(25),m=n(p),g=i(32),_=n(g),v=i(4),y=n(v);(0,_.default)(a,"GalaxyApp");var w="galaxy:debug:namespaces",b=!1;try{b="true"==localStorage.getItem("galaxy:debug")}catch(e){console.log((0,y.default)("localStorage not available for debug flag retrieval"))}a.prototype._init=function(e,t){var i=this;return r.extend(i,d.Events),b&&(i.logger=console,console.debug("debugging galaxy:","options:",e,"bootstrapped:",t)),i._processOptions(e),i.root=e.root||"/",i.params=e.params||{},i.session_csrf_token=e.session_csrf_token||null,i._initConfig(e.config||{}),i._patchGalaxy(window.Galaxy),i._initLogger(i.options.loggerOptions||{}),i.debug("GalaxyApp.options: ",i.options),i.debug("GalaxyApp.config: ",i.config),i.debug("GalaxyApp.logger: ",i.logger),i._initLocale(),i.debug("GalaxyApp.localize: ",i.localize),i.config=e.config||{},i.debug("GalaxyApp.config: ",i.config),i._initUser(e.user||{}),i.debug("GalaxyApp.user: ",i.user),i._setUpListeners(),i.trigger("ready",i),i},a.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},a.prototype._processOptions=function(e){var t=this,i=t.defaultOptions;t.options={};for(var n in i)i.hasOwnProperty(n)&&(t.options[n]=e.hasOwnProperty(n)?e[n]:i[n]);return t},a.prototype._initConfig=function(e){var t=this;return t.config=e,t.config.debug=b||t.config.debug,t},a.prototype._patchGalaxy=function(e){var t=this;if(t.options.patchExisting&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},a.prototype._initLogger=function(e){var t=this;if(t.config.debug){e.consoleLogger=e.consoleLogger||console,e.consoleLevel=e.consoleLevel||m.default.MetricsLogger.ALL;try{e.consoleNamespaceWhitelist=localStorage.getItem(w).split(",")}catch(e){}try{e.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(e){}console.log(e.consoleFlattenMessages)}return t.logger=new m.default.MetricsLogger(e),t.emit={},["log","debug","info","warn","error","metric"].map(function(e){t.emit[e]=function(i){t.logger.emit(e,arguments[0],Array.prototype.slice.call(arguments,1))}}),t.config.debug&&(u.default.LoggableMixin.logger=t.logger),t},a.prototype._initLocale=function(e){var t=this;return t.debug("_initLocale:",e),t.localize=y.default,window._l=t.localize,t},a.prototype._initUser=function(e){var t=this;return t.debug("_initUser:",e),t.user=new f.default.User(e),t.user.logger=t.logger,t},a.prototype._setUpListeners=function(){var t=this;return t.lastAjax={},e(document).bind("ajaxSend",function(e,i,n){var s=n.data;try{s=JSON.parse(s)}catch(e){}t.lastAjax={url:location.href.slice(0,-1)+n.url,data:s}}),t},a.prototype.debugging=function(e){var t=this;try{if(void 0===e)return"true"===localStorage.getItem("galaxy:debug");if(e)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),t.debuggingNamespaces(null)}catch(e){console.log((0,y.default)("localStorage not available for debug flag retrieval"))}return!1},a.prototype.debuggingNamespaces=function(e){var t=this;try{if(void 0===e){var i=localStorage.getItem(w);return"string"==typeof i?i.split(","):[]}null===e?localStorage.removeItem(w):localStorage.setItem(w,e);var n=t.debuggingNamespaces();return t.logger&&(t.logger.options.consoleNamespaceWhitelist=n),n}catch(e){console.log((0,y.default)("localStorage not available for debug namespace retrieval"))}},a.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},t.default={GalaxyApp:a}}).call(t,i(0))},,function(e,t,i){"use strict";(function(e){function i(e){e=e||{};var t=this;return t.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,t.userId=t.userId||e.userId||null,t.consoleLogger=e.consoleLogger||null,t._init(e),t}function n(e){var t=String(e);return"[object Object]"==t&&(t=JSON.stringify(e)),t}function s(e){return this._init(e||{})}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i.ALL=0,i.LOG=0,i.DEBUG=10,i.INFO=20,i.WARN=30,i.ERROR=40,i.METRIC=50,i.NONE=100,i.defaultOptions={logLevel:i.NONE,consoleLevel:i.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},i.prototype._init=function(e){var t=this;t.options={};for(var n in i.defaultOptions)i.defaultOptions.hasOwnProperty(n)&&(t.options[n]=e.hasOwnProperty(n)?e[n]:i.defaultOptions[n]);return t.options.logLevel=t._parseLevel(t.options.logLevel),t.options.consoleLevel=t._parseLevel(t.options.consoleLevel),t._sending=!1,t._waiting=null,t._postSize=t.options.postSize,t._initCache(),t},i.prototype._initCache=function(){try{this.cache=new s({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(e){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",e]),this.options.logLevel=i.NONE}},i.prototype._parseLevel=function(e){var t=void 0===e?"undefined":a(e);if("number"===t)return e;if("string"===t){var n=e.toUpperCase();if(i.hasOwnProperty(n))return i[n]}throw new Error("Unknown log level: "+e)},i.prototype.emit=function(e,t,i){var n=this;return t=t||n.options.defaultNamespace,e&&i?(e=n._parseLevel(e),e>=n.options.logLevel&&n._addToCache(e,t,i),n.consoleLogger&&e>=n.options.consoleLevel&&n._emitToConsole(e,t,i),n):n},i.prototype._addToCache=function(e,t,i){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var n=this;try{n.cache.add(n._buildEntry(e,t,i))>=n._postSize&&n._postCache()}catch(e){n._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",t,i]),n._emitToConsole("error","MetricsLogger",[e])}return n},i.prototype._buildEntry=function(e,t,i){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var n={level:e,namespace:this.options.clientPrefix+t,args:i};return this.options.addTime&&(n.time=(new Date).toISOString()),n},i.prototype._postCache=function(t){if(t=t||{},this._emitToConsole("info","MetricsLogger",["_postCache",t,this._postSize]),!this.options.postUrl||this._sending)return e.when({});var i=this,n=t.count||i._postSize,s=i.cache.get(n),a=s.length,o="function"==typeof i.options.getPingData?i.options.getPingData():{};return o.metrics=JSON.stringify(s),i._sending=!0,e.post(i.options.postUrl,o).always(function(){i._sending=!1}).fail(function(e,t,n){i._postSize=i.options.maxCacheSize,i.emit("error","MetricsLogger",["_postCache error:",e.readyState,e.status,e.responseJSON||e.responseText])}).done(function(e){"function"==typeof i.options.onServerResponse&&i.options.onServerResponse(e),i.cache.remove(a),i._postSize=i.options.postSize})},i.prototype._delayPost=function(){var e=this;e._waiting=setTimeout(function(){e._waiting=null},e.options.delayPostInMs)},i.prototype._emitToConsole=function(e,t,s){var a=this,o=a.options.consoleNamespaceWhitelist;if(!a.consoleLogger)return a;if(o&&-1===o.indexOf(t))return a;var r=Array.prototype.slice.call(s,0);return r.unshift(t),a.options.consoleFlattenMessages&&(r=[r.map(n).join(" ")]),e>=i.METRIC&&"function"==typeof a.consoleLogger.info?a.consoleLogger.info.apply(a.consoleLogger,r):e>=i.ERROR&&"function"==typeof a.consoleLogger.error?a.consoleLogger.error.apply(a.consoleLogger,r):(e>=i.WARN&&"function"==typeof a.consoleLogger.warn?a.consoleLogger.warn.apply(a.consoleLogger,r):e>=i.INFO&&"function"==typeof a.consoleLogger.info?a.consoleLogger.info.apply(a.consoleLogger,r):e>=i.DEBUG&&"function"==typeof a.consoleLogger.debug?a.consoleLogger.debug.apply(a.consoleLogger,r):"function"==typeof a.consoleLogger.log&&a.consoleLogger.log.apply(a.consoleLogger,r),a)},i.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.debug=function(){this.emit(i.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.info=function(){this.emit(i.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.warn=function(){this.emit(i.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.error=function(){this.emit(i.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.metric=function(){this.emit(i.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},s.defaultOptions={maxSize:5e3},s.prototype._init=function(e){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!e.key)throw new Error("LoggingCache needs key for localStorage");return this.key=e.key,this._initStorage(),this.maxSize=e.maxSize||s.defaultOptions.maxSize,this},s.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},s.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},s.prototype.add=function(e){var t=this,i=t._fetchAndParse(),n=i.length+1-t.maxSize;return n>0&&i.splice(0,n),i.push(e),t._unparseAndStore(i),i.length},s.prototype._fetchAndParse=function(){var e=this;return JSON.parse(localStorage.getItem(e.key))},s.prototype._unparseAndStore=function(e){var t=this;return localStorage.setItem(t.key,JSON.stringify(e))},s.prototype.length=function(){return this._fetchAndParse().length},s.prototype.get=function(e){return this._fetchAndParse().slice(0,e)},s.prototype.remove=function(e){var t=this._fetchAndParse(),i=t.splice(0,e);return this._unparseAndStore(t),i},s.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},s.prototype.stringify=function(e){return JSON.stringify(this.get(e))},s.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},t.default={MetricsLogger:i,LoggingCache:s}}).call(t,i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(33),r=a(o),l=i(22),d=a(l),c=i(8),u=a(c),h=i(3),f=a(h),p=e.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(t){var i=this;this.config=n.defaults(t.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new u.default.View,Galaxy.display=this.display=function(e){e.title?(f.default.setWindowTitle(e.title),e.allow_title_display=!1):(f.default.setWindowTitle(),e.allow_title_display=!0),i.center.display(e)},Galaxy.router=this.router=t.Router&&new t.Router(i,t),this.masthead=new r.default.View(this.config),this.center=new d.default.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},n.each(this._panelids,function(e){var n=e.charAt(0).toUpperCase()+e.slice(1),s=t[n];if(s){var a=new s(i,t);i[a.toString()]=a,i.panels[e]=new d.default.SidePanel({id:e,el:i.$("#"+e),view:a})}}),this.render(),this.router&&e.history.start({root:Galaxy.root,pushState:!0})},render:function(){return s(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var e=this.config.message_box_content||"",t=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+t+"-message").html(e).toggle(!!e).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var e=this.config.inactivity_box_content||"",t=s("
").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(e+" ").append(t).toggle(!!e).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var e=this;return n.each(this._panelids,function(t){var i=e.panels[t];i?i.render():(e.$("#center").css(t,0),e.$("#"+t).hide())}),this},_template:function(){return['
','
','
','
','
','
','
','",'
'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var e=window.Galaxy.config.communication_server_host,t=window.Galaxy.config.communication_server_port,i=window.Galaxy.user.attributes.preferences,n=s("#show-chat-online");i&&-1!=["1","true"].indexOf(i.communication_server)?s.ajax({url:e+":"+t}).success(function(e){null!==window.Galaxy.user.id&&"hidden"===n.css("visibility")&&n.css("visibility","visible")}).error(function(e){n.css("visibility","hidden")}):n.css("visibility","hidden")}});t.default={View:p}}).call(t,i(2),i(1),i(0))},,,function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=e.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_name:"",file_mode:"",file_size:0,file_type:null,file_path:"",file_data:null,percentage:0,space_to_tab:!1,to_posix_lines:!0,enabled:!0},reset:function(e){this.clear().set(this.defaults).set(e)}}),n=e.Collection.extend({model:i});t.default={Model:i,Collection:n}}).call(t,i(2))},,,,,,,,,,function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),o=s(a),r=i(4),l=s(r),d=e.View.extend(o.default.LoggableMixin).extend(o.default.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",select_width:"100%",events:{},initialize:function(e){this.show_editor=!1,!1===e.usePrompt?this.label="":this.label='",this.workflow_mode=e.workflow_mode||!1,this.workflow_mode&&(this.events.click="showEditor",this.events.keydown="keydownHandler"),this.hiddenUntilActivated(e.$activator,e)},render:function(){var e=this;return this.workflow_mode?this.$el.html(this._workflowTemplate()):this.$el.html(this._defaultTemplate()),this.$input().select2({placeholder:"Add tags",width:this.workflow_mode?this.width:this.select_width,tags:function(){return e._getTagsUsed()}}),this._setUpBehaviors(),this},_hashToName:function(e){return e.startsWith("#")?"name:"+e.slice(1):e},_nameToHash:function(e){return e.startsWith("name:")&&(e="#"+e.slice(5)),e},_defaultTemplate:function(){return[this.label,this._renderEditor()].join("")},_workflowTemplate:function(){return[this.show_editor?this._renderEditor():this._renderTags()].join(" ")},keydownHandler:function(e){switch(e.which){case 27:this.hideEditor()}},showEditor:function(){this.show_editor=!0,this.render()},hideEditor:function(){this.show_editor=!1,this.render()},_renderEditor:function(){return''},_renderTags:function(){var e=this.model.get("tags"),t=Galaxy.root+"static/images/fugue/tag--plus.png",i=[];return n.each(e,function(e){e=0==e.indexOf("name:")?e.slice(5):e;var t=''+e+"";i.push(t)}),0===i.length&&i.push("'),i.join(" ")},tagsToCSV:function(){var e=this,t=this.model.get("tags");return!n.isArray(t)||n.isEmpty(t)?"":t.map(function(t){return n.escape(e._nameToHash(t))}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){var e=this;return n.map(Galaxy.user.get("tags_used"),e._nameToHash)},_setUpBehaviors:function(){var e=this;this.$input().on("change",function(t){t.val=n.map(t.val,e._hashToName),e.model.save({tags:t.val}),t.added&&e._addNewTagToTagsUsed(""+t.added.text)})},_addNewTagToTagsUsed:function(e){var t=Galaxy.user.get("tags_used");n.contains(t,e)||(t.push(e),t.sort(),Galaxy.user.set("tags_used",t))},remove:function(){this.$input.off(),this.stopListening(this.model),e.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",""+this.model,")"].join("")}});t.default={TagsEditor:d}}).call(t,i(2),i(1))},,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(0),a=n(s),o=i(14),r=n(o),l=i(6),d=n(l),c=a.default,u=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),c.isEmptyObject(t)||(e+=-1==e.indexOf("?")?"?":"&",e+=c.param(t,!0)),Galaxy.params=t,this.navigate(e,{trigger:!0})},execute:function(e,t,i){Galaxy.debug("router execute:",e,t,i);var n=r.default.parse(t.pop());t.push(n),e&&(this.authenticate(t,i)?e.apply(this,t):this.access_denied())},authenticate:function(e,t){return!0},access_denied:function(){this.page.display(new d.default.Message({status:"danger",message:"You must be logged in with proper credentials to make this request.",persistent:!0}))}});t.default=u}).call(t,i(2))},function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(3);!function(e){e&&e.__esModule}(a);t.default=e.View.extend({options:{class_check:"fa-check-square-o",class_uncheck:"fa-square-o",parameters:[{id:"space_to_tab",title:"Convert spaces to tabs"},{id:"to_posix_lines",title:"Use POSIX standard"}]},initialize:function(e){this.model=e.model,this.setElement(n("
").addClass("upload-settings")),this.$el.append(n("
").addClass("upload-settings-cover")),this.$el.append(n("").addClass("upload-settings-table ui-table-striped").append("")),this.$cover=this.$(".upload-settings-cover"),this.$table=this.$(".upload-settings-table > tbody"),this.listenTo(this.model,"change",this.render,this),this.model.trigger("change")},render:function(){var e=this;this.$table.empty(),s.each(this.options.parameters,function(t){var i=n("
").addClass("upload-"+t.id+" upload-icon-button fa").addClass(e.model.get(t.id)&&e.options.class_check||e.options.class_uncheck).on("click",function(){e.model.get("enabled")&&e.model.set(t.id,!e.model.get(t.id))});e.$table.append(n("
").append(n(""},_template:function(){return'
'+this.model.get("help_text")+'
Available files:   
").append(i)).append(n("").append(t.title)))}),this.$cover[this.model.get("enabled")&&"hide"||"show"]()}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=e.View.extend({initialize:function(t){this.model=new e.Model({cls:"upload-ftp",class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",help_enabled:!0,help_text:"This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at "+t.ftp_upload_site+" using your Galaxy credentials.",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}}).set(t),this.collection=this.model.get("collection"),this.setElement(this._template()),this.$content=this.$(".upload-ftp-content"),this.$wait=this.$(".upload-ftp-wait"),this.$help=this.$(".upload-ftp-help"),this.$number=this.$(".upload-ftp-number"),this.$disk=this.$(".upload-ftp-disk"),this.$body=this.$(".upload-ftp-body"),this.$warning=this.$(".upload-ftp-warning"),this.$select=this.$(".upload-ftp-select-all"),this.render()},render:function(){var e=this;this.$wait.show(),this.$content.hide(),this.$warning.hide(),this.$help.hide(),n.ajax({url:Galaxy.root+"api/remote_files",method:"GET",success:function(t){e.model.set("ftp_files",t),e._index(),e._renderTable()},error:function(){e._renderTable()}})},_renderTable:function(){var e=this,t=this.model.get("ftp_files");if(this.rows=[],t&&t.length>0){this.$body.empty();var i=0;s.each(t,function(t){e.rows.push(e._renderRow(t)),i+=t.size}),this.$number.html(t.length+" files"),this.$disk.html(o.default.bytesToString(i,!0)),this.collection&&(this.$("._has_collection").show(),this.$select.addClass(this.model.get("class_add")).off().on("click",function(){e._all()}),this._refresh()),this.$content.show()}else this.$warning.show();this.model.get("help_enabled")&&this.$help.show(),this.$wait.hide()},_renderRow:function(e){var t=this,i=this.model.attributes,s=n(this._templateRow(e)),a=s.find(".icon");if(this.$body.append(s),this.collection){var o=this.ftp_index[e.path];a.addClass(void 0===o?i.class_add:i.class_remove),s.on("click",function(){t._switch(a,e),t._refresh()})}else s.on("click",function(){i.onchange(e)});return a},_index:function(){var e=this;this.ftp_index={},this.collection&&this.collection.each(function(t){"ftp"==t.get("file_mode")&&(e.ftp_index[t.get("file_path")]=t.id)})},_all:function(){var e=this.model.attributes,t=this.model.get("ftp_files"),i=this.$select.hasClass(e.class_add);for(var n in t){var s=t[n],a=this.ftp_index[s.path];(void 0===a&&i||void 0!==a&&!i)&&this._switch(this.rows[n],s)}this._refresh()},_switch:function(e,t){e.removeClass();var i=this.model.attributes,n=this.ftp_index[t.path];if(void 0===n){var s=i.onadd(t);e.addClass(i.class_remove),this.ftp_index[t.path]=s}else i.onremove(n),e.addClass(i.class_add),this.ftp_index[t.path]=void 0},_refresh:function(){var e=s.reduce(this.ftp_index,function(e,t){return void 0!==t&&e++,e},0);this.$select.removeClass(),0==e?this.$select.addClass(this.model.get("class_add")):this.$select.addClass(e==this.rows.length?this.model.get("class_remove"):this.model.get("class_partial"))},_templateRow:function(e){return'
'+s.escape(e.path)+''+o.default.bytesToString(e.size)+''+e.ctime+"
NameSizeCreated
Your FTP directory does not contain any files.
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=(s(a),i(15)),r=s(o);t.default=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.setElement("
"),this.render()},render:function(){var e=this.model.attributes,t=n.findWhere(e.list,{id:e.extension});this.extension_popup&&this.extension_popup.remove(),this.extension_popup=new r.default.View({placement:e.placement||"bottom",container:e.$el}),this.extension_popup.title(e.title),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(t)),this.extension_popup.show()},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (read more)'),t}return"There is no description available for this file extension."}})}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e,t){!function(i){e.event.props.push("dataTransfer"),i.uploadpost=function(t){var n=i.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use a FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},t),s=n.data;if(s.error_message)return void n.error(s.error_message);var a=new FormData;for(var o in s.payload)a.append(o,s.payload[o]);var r=0;for(var o in s.files){var l=s.files[o];a.append(l.name,l.file,l.file.name),r+=l.file.size}if(r>1048576*n.maxfilesize)return void n.error(n.error_filesize);var d=new XMLHttpRequest;d.open("POST",n.url,!0),d.setRequestHeader("Accept","application/json"),d.setRequestHeader("Cache-Control","no-cache"),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.onreadystatechange=function(){if(d.readyState==d.DONE){var t=null,i="";if(d.responseText)try{t=e.parseJSON(d.responseText),i=t.err_msg}catch(e){t=d.responseText,i=t}if(d.status<200||d.status>299){var s=d.statusText;403==d.status?s=n.error_login:0==d.status?s=n.error_server:s||(s=n.error_default),n.error(s+" ("+d.status+"). "+i)}else n.success(t)}},d.upload.addEventListener("progress",function(e){e.lengthComputable&&n.progress(Math.round(100*e.loaded/e.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",n),d.send(a)},i.fn.uploadinput=function(e){var t=this,n=i.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},e),s=i('");return t.append(s.change(function(e){n.onchange(e.target.files),i(this).val("")})),t.on("drop",function(e){n.ondragleave(e),e.dataTransfer&&(n.onchange(e.dataTransfer.files),e.preventDefault())}),t.on("dragover",function(e){e.preventDefault(),n.ondragover(e)}),t.on("dragleave",function(e){e.stopPropagation(),n.ondragleave(e)}),{dialog:function(){s.trigger("click")}}},i.fn.uploadbox=function(e){function n(e){if(e&&e.length&&!g){var i=void 0;return t.each(e,function(e,i){"new"!==e.mode&&t.filter(f,function(t){return t.name===e.name&&t.size===e.size}).length&&(e.duplicate=!0)}),t.each(e,function(e){e.duplicate||(i=String(p++),f[i]=e,h.announce(i,f[i]),m++)}),i}}function s(e){f[e]&&(delete f[e],m--)}function a(){if(0==m||_)return _=!1,g=!1,void h.complete();g=!0;var e=-1;for(var t in f){e=t;break}f[e];s(e),i.uploadpost({url:h.url,data:h.initialize(e),success:function(t){h.success(e,t),a()},error:function(t){h.error(e,t),a()},progress:function(t){h.progress(e,t)}})}function o(){v.dialog()}function r(e){for(e in f)s(e)}function l(){g||(g=!0,a())}function d(){_=!0}function c(e){return h=i.extend({},h,e)}function u(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}var h=i.extend({},{dragover:function(){},dragleave:function(){},announce:function(e){},initialize:function(e){},progress:function(e,t){},success:function(e,t){},error:function(e,t){alert(t)},complete:function(){}},e),f={},p=0,m=0,g=!1,_=!1,v=i(this).uploadinput({multiple:!0,onchange:function(e){n(e)},ondragover:e.ondragover,ondragleave:e.ondragleave});return{select:o,add:n,remove:s,start:l,stop:d,reset:r,configure:c,compatible:u}}}(e)}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var i=e.toJSON();return $(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}})}Object.defineProperty(t,"__esModule",{value:!0});var l=i(59),d=o(l),c=i(16),u=o(c),h=i(5),f=o(h),p=i(108),m=o(p),g=i(8),_=o(g),v=i(109),y=(o(v),i(4)),w=o(y);i(110);var b=e.View.extend(f.default.LoggableMixin).extend({_logNamespace:"collections",tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.selected||!1},render:function(){this.dragStartHandler=n.bind(this._dragstart,this),this.dragEndHandler=n.bind(this._dragend,this);var e=this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})).get(0);return e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1),this.selected&&this.$el.addClass("selected"),this},template:n.template(['',"<%- element.name %>","",'"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([(0,w.default)("Enter a new name for the element"),":\n(",(0,w.default)("Note that changing the name here will not rename the dataset"),")"].join(""),prompt((0,w.default)("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),x=e.View.extend(f.default.LoggableMixin).extend(m.default.CollectionCreatorMixin).extend({_logNamespace:"collections",elementViewClass:b,collectionClass:d.default.HistoryDatasetCollection,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 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;n.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),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(e){e.hasOwnProperty("id")||(e.id=n.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){return"dataset"!==e.history_content_type?(0,w.default)("is not a dataset"):e.state===u.default.OK||n.contains(u.default.NOT_READY_STATES,e.state)?e.deleted||e.purged?(0,w.default)("has been deleted or purged"):null:(0,w.default)("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=1,t={};this.workingElements.forEach(function(i){for(var n=i.name;t.hasOwnProperty(n);)if(n=i.name+" ("+e+")",(e+=1)>=900)throw new Error("Safety hit in while loop - thats impressive");i.name=n,t[i.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,s=a("
"),o=i.$list();n.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);s.append(t.$el)}),i._renderClearSelected(),o.empty().append(s.children()),n.invoke(i.elementViews,"render"),o.height()>o.css("max-height")?o.css("border-width","1px 0px 1px 0px"):o.css("border-width","0px")},_createElementView:function(e){var t=new this.elementViewClass({element:e,selected:n.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=n.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=(0,w.default)("No valid elements for final list")+". ";return t+=''+(0,w.default)("Cancel")+" ",t+=(0,w.default)("or"),t+=' '+(0,w.default)("start over")+".",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:(0,w.default)("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=n.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this,i=e.message||(0,w.default)("An error occurred");if(e.xhr){var n=e.xhr,s=e.message;0===n.readyState&&0===n.status?i+=": "+(0,w.default)("Galaxy could not be reached and may be updating.")+(0,w.default)(" Try again in a few minutes."):n.responseJSON?i+=":
"+JSON.stringify(n.responseJSON)+"
":i+=": "+s}t._showAlert(i,"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","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=s('
');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=e.offset(),n=e.scrollTop(),s=t-i.top,a=i.top+e.outerHeight()-t;s>=0&&s=0&&ae&&a-o','
',(0,w.default)("More help"),"",'","
",'
','','',"
"].join("")),middle:n.template(['",'
',"
"].join("")),footer:n.template(['
','
','","
",'
','','
',(0,w.default)("Name"),":
","
","
",'
"].join("")),helpContent:n.template(["

",(0,w.default)(["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("")),"

","
    ","
  • ",(0,w.default)(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
  • ","
  • ",(0,w.default)(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
  • ","
  • ",(0,w.default)(["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("")),"
  • ","
  • ",(0,w.default)(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
  • ","
  • ",(0,w.default)(['Click the "Cancel" button to exit the interface.'].join("")),"
  • ","

","

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

"].join("")),invalidElements:n.template([(0,w.default)("The following selections could not be included due to problems:"),"
    <% _.each( problems, function( problem ){ %>","
  • <%- problem.element.name %>: <%- problem.text %>
  • ","<% }); %>
"].join("")),noElementsLeft:n.template(['
  • ',(0,w.default)("No elements left! "),(0,w.default)("Would you like to "),'',(0,w.default)("start over"),"?","
  • "].join("")),invalidInitial:n.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",(0,w.default)("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",(0,w.default)("No datasets were selected"),".","<% } %>","
    ",(0,w.default)("At least one element is needed for the collection"),". ",(0,w.default)("You may need to "),'',(0,w.default)("cancel")," ",(0,w.default)("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))}),toString:function(){return"ListCollectionCreator"}}),C=function(e,t,i){var s,o=a.Deferred(),r=Galaxy.modal||new _.default.View;return t=n.defaults(t||{},{elements:e,oncancel:function(){r.hide(),o.reject("cancelled")},oncreate:function(e,t){r.hide(),o.resolve(t)}}),s=new i(t),r.show({title:t.title||(0,w.default)("Create a collection"),body:s.$el,width:"80%",height:"100%",closing_events:!0}),s.render(),window._collectionCreator=s,o},$=function(e,t){return t=t||{},t.title=(0,w.default)("Create a collection from a list of datasets"),C(e,t,x)};t.default={DatasetCollectionElementView:b,ListCollectionCreator:x,collectionCreatorModal:C,listCollectionCreatorModal:$,createListCollection:r}}).call(t,i(2),i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(60),a=n(s),o=i(107),r=n(o),l=i(4),d=(n(l),r.default.HistoryContentMixin),c=a.default.DatasetCollection,u=c.extend(d).extend({defaults:e.extend(e.clone(c.prototype.defaults),{history_content_type:"dataset_collection",model_class:"HistoryDatasetCollectionAssociation"}),save:function(e,t){return this.isNew()&&(t=t||{},t.url=this.urlRoot+this.get("history_id")+"/contents",e=e||{},e.type="dataset_collection"),c.prototype.save.call(this,e,t)},toString:function(){return"History"+c.prototype.toString.call(this)}});t.default={HistoryDatasetCollection:u}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(106),r=a(o),l=i(5),d=a(l),c=i(4),u=(a(c),{defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(t){return e.extend(t,t.object,{element_id:t.id}),delete t.object,t},constructor:function(e,t){e=this._mergeObject(e),this.idAttribute="element_id",n.Model.apply(this,arguments)},parse:function(e,t){var i=e;return i=this._mergeObject(i)}}),h=n.Model.extend(d.default.LoggableMixin).extend(u).extend({_logNamespace:"collections"}),f=n.Collection.extend(d.default.LoggableMixin).extend({_logNamespace:"collections",model:h,toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),p=r.default.DatasetAssociation.extend(d.default.mixin(u,{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:e.extend({},r.default.DatasetAssociation.prototype.defaults,u.defaults),_downloadQueryParameters:function(){var e=this.get("file_ext"),t=this.get("element_identifier");return"?to_ext="+e+"&hdca_id="+this.get("parent_hdca_id")+"&element_identifier="+t},constructor:function(e,t){this.debug("\t DatasetDCE.constructor:",e,t),u.constructor.call(this,e,t)},hasDetails:function(){return this.elements&&this.elements.length},toString:function(){this.get("element_identifier");return"DatasetDCE({objStr})"}})),m=f.extend({model:p,toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),g=n.Model.extend(d.default.LoggableMixin).extend(d.default.SearchableModelMixin).extend({_logNamespace:"collections",defaults:{collection_type:null,deleted:!1},collectionClass:function(){return this.attributes.collection_type.indexOf(":")>0?v:m},initialize:function(e,t){this.debug(this+"(DatasetCollection).initialize:",e,t,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){var t=this.collectionClass();this.debug(this+"._createElementsModel",t,this.get("elements"),this.elements);var i=this.get("elements")||[];this.unset("elements",{silent:!0});var n=this;return e.each(i,function(t,i){e.extend(t,{parent_hdca_id:n.get("id")})}),this.elements=new t(i),this.elements},toJSON:function(){var e=n.Model.prototype.toJSON.call(this);return this.elements&&(e.elements=this.elements.toJSON()),e},inReadyState:function(){var e=this.get("populated");return this.isDeletedOrPurged()||e},hasDetails:function(){return 0!==this.elements.length},getVisibleContents:function(e){return this.elements},parse:function(e,t){var i=n.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},delete:function(e){return this.get("deleted")?s.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?s.when():this.save({deleted:!1},e)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name","tags"],toString:function(){return"DatasetCollection("+[this.get("id"),this.get("name")||this.get("element_identifier")].join(",")+")"}}),_=g.extend(d.default.mixin(u,{constructor:function(e,t){this.debug("\t NestedDCDCE.constructor:",e,t),u.constructor.call(this,e,t)},toString:function(){return["NestedDCDCE(",this.object?""+this.object:this.get("element_identifier"),")"].join("")}})),v=f.extend({model:_,toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}});t.default={DatasetCollection:g}}).call(t,i(1),i(2),i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={tool:"fa-wrench",data_input:"fa-file-o",data_collection_input:"fa-folder-o",subworkflow:"fa-sitemap fa-rotate-270",pause:"fa-pause"}},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(63),l=o(r),d=i(64),c=(o(d),i(114)),u=o(c),h=i(3),f=o(h),p=i(5),m=o(p),g=i(4),_=o(g),v=e.Model.extend(m.default.LoggableMixin).extend(m.default.mixin(m.default.SearchableModelMixin,{_logNamespace:"history",UPDATE_DELAY:4e3,defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",deleted:!1,contents_active:{},contents_states:{}},urlRoot:Galaxy.root+"api/histories",contentsClass:l.default.HistoryContents,searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},initialize:function(e,t){t=t||{},this.logger=t.logger||null,this.log(this+".initialize:",e,t),this.contents=new this.contentsClass([],{history:this,historyId:this.get("id"),order:t.order}),this._setUpListeners(),this._setUpCollectionListeners(),this.updateTimeoutId=null},_setUpListeners:function(){return this.on({error:function(e,t,i,n,s){this.clearUpdateTimeout()},"change:id":function(e,t){this.contents&&(this.contents.historyId=t)}})},_setUpCollectionListeners:function(){return this.contents?this.listenTo(this.contents,{error:function(){this.trigger.apply(this,n.makeArray(arguments))}}):this},contentsShown:function(){var e=this.get("contents_active"),t=e.active||0;return t+=this.contents.includeDeleted?e.deleted:0,t+=this.contents.includeHidden?e.hidden:0},nice_size:function(){var e=this.get("size");return e?f.default.bytesToString(e,!0,2):(0,_.default)("(empty)")},toJSON:function(){return s.extend(e.Model.prototype.toJSON.call(this),{nice_size:this.nice_size()})},get:function(t){return"nice_size"===t?this.nice_size():e.Model.prototype.get.apply(this,arguments)},ownedByCurrUser:function(){return!(!Galaxy||!Galaxy.user)&&(!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.get("user_id"))},numOfUnfinishedJobs:function(){var e=this.get("non_ready_jobs");return e?e.length:0},numOfUnfinishedShownContents:function(){return this.contents.runningAndActive().length||0},_fetchContentRelatedAttributes:function(){var e=["size","non_ready_jobs","contents_active","hid_counter"];return this.fetch({data:a.param({keys:e.join(",")})})},refresh:function(e){var t=this;e=e||{};var i=this.lastUpdateTime;return this.contents.allFetched=!1,(0!==this.contents.currentPage?function(){return t.contents.fetchPage(t.contents.currentPage)}:function(){return t.contents.fetchUpdated(i)})().done(function(i,n,s){var a;try{a=new Date(s.getResponseHeader("Date"))}catch(e){}t.lastUpdateTime=a||new Date,t.checkForUpdates(e)})},checkForUpdates:function(e){var t=this;e=e||{};var i=this.UPDATE_DELAY;if(this.id){var n=function(){t.clearUpdateTimeout(),t.updateTimeoutId=setTimeout(function(){t.refresh(e)},i)};this.numOfUnfinishedShownContents()>0?n():this._fetchContentRelatedAttributes().done(function(e){t.numOfUnfinishedJobs()>0?n():t.trigger("ready")})}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},stopPolling:function(){this.clearUpdateTimeout(),this.contents&&this.contents.stopPolling()},parse:function(t,i){var n=e.Model.prototype.parse.call(this,t,i);return n.create_time&&(n.create_time=new Date(n.create_time)),n.update_time&&(n.update_time=new Date(n.update_time)),n},fetchWithContents:function(e,t){e=e||{};var i=this;return e.view="dev-detailed",this.fetch(e).then(function(e){return i.contents.history=i,i.contents.setHistoryId(e.id),i.fetchContents(t)})},fetchContents:function(e){e=e||{};var t=this;return t.lastUpdateTime=new Date,t.contents.fetchCurrentPage(e)},_delete:function(e){return this.get("deleted")?n.when():this.save({deleted:!0},e)},purge:function(e){return this.get("purged")?n.when():this.save({deleted:!0,purged:!0},e)},undelete:function(e){return this.get("deleted")?this.save({deleted:!1},e):n.when()},copy:function(e,t,i){if(e=void 0===e||e,!this.id)throw new Error("You must set the history ID before copying it.");var s={history_id:this.id};e&&(s.current=!0),t&&(s.name=t),i||(s.all_datasets=!1),s.view="dev-detailed";var a=this,o=n.post(this.urlRoot,s);return e?o.then(function(e){return new v(e).setAsCurrent().done(function(){a.trigger("copied",a,e)})}):o.done(function(e){a.trigger("copied",a,e)})},setAsCurrent:function(){var e=this,t=n.getJSON(Galaxy.root+"history/set_as_current?id="+this.id);return t.done(function(){e.trigger("set-as-current",e)}),t},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}})),y=u.default.InfinitelyScrollingCollection,w=y.extend(m.default.LoggableMixin).extend({_logNamespace:"history",model:v,order:"update_time",limitOnFirstFetch:10,limitPerFetch:10,initialize:function(e,t){t=t||{},this.log("HistoryCollection.initialize",e,t),y.prototype.initialize.call(this,e,t),this.includeDeleted=t.includeDeleted||!1,this.currentHistoryId=t.currentHistoryId,this.setUpListeners()},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot},setUpListeners:function(){return this.on({"change:deleted":function(e){this.debug("change:deleted",this.includeDeleted,e.get("deleted")),!this.includeDeleted&&e.get("deleted")&&this.remove(e)},copied:function(e,t){this.setCurrent(new v(t,[]))},"set-as-current":function(e){var t=this.currentHistoryId;this.trigger("no-longer-current",t),this.currentHistoryId=e.id}})},_buildFetchData:function(e){return s.extend(y.prototype._buildFetchData.call(this,e),{view:"dev-detailed"})},_buildFetchFilters:function(e){var t=y.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted?i.deleted=null:(i.deleted=!1,i.purged=!1),s.defaults(t,i)},fetchFirst:function(e){var t=this,i=a.when();return this.currentHistoryId&&(i=y.prototype.fetchFirst.call(t,{silent:!0,limit:1,filters:{purged:"",deleted:"","encoded_id-in":this.currentHistoryId}})),i.then(function(){return e=e||{},e.offset=0,t.fetchMore(e)})},comparators:s.extend(s.clone(y.prototype.comparators),{name:m.default.buildComparator("name",{ascending:!0}),"name-dsc":m.default.buildComparator("name",{ascending:!1}),size:m.default.buildComparator("size",{ascending:!1}),"size-asc":m.default.buildComparator("size",{ascending:!0})}),sort:function(e){e=e||{};var t=e.silent,i=this.remove(this.get(this.currentHistoryId));return y.prototype.sort.call(this,s.defaults({silent:!0},e)),this.unshift(i,{silent:!0}),t||this.trigger("sort",this,e),this},create:function(e,t,i,s){var a=this;return n.getJSON(Galaxy.root+"history/create_new_current").done(function(e){a.setCurrent(new v(e,[],i||{}))})},setCurrent:function(e,t){return t=t||{},this.unshift(e,t),this.currentHistoryId=e.get("id"),t.silent||this.trigger("new-current",e,this),this},toString:function(){return"HistoryCollection("+this.length+",current:"+this.currentHistoryId+")"}});t.default={History:v,HistoryCollection:w}}).call(t,i(2),i(0),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(114),r=a(o),l=i(115),d=a(l),c=i(59),u=a(c),h=i(64),f=a(h),p=i(253),m=a(p),g=i(5),_=a(g),v=i(116),y=a(v),w=500;try{w=localStorage.getItem("historyContentsLimitPerPageDefault")||w}catch(e){}var b=r.default.PaginatedCollection,x=b.extend(_.default.LoggableMixin).extend({_logNamespace:"history",limitPerPage:w,limitPerProgressiveFetch:w,order:"hid",urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(e,t){this.on({"sync add":this.trackJobStates}),t=t||{},b.prototype.initialize.call(this,e,t),this.history=t.history||null,this.setHistoryId(t.historyId||null),this.includeDeleted=t.includeDeleted||this.includeDeleted,this.includeHidden=t.includeHidden||this.includeHidden,this.model.prototype.idAttribute="type_id"},trackJobStates:function(){var e=this;this.each(function(t){if(!t.has("job_states_summary")&&"dataset_collection"===t.attributes.history_content_type){var i=t.attributes.job_source_type,n=t.attributes.job_source_id;if(i){e.jobStateSummariesCollection.add({id:n,model:i,history_id:e.history_id,collection_id:t.attributes.id});var s=e.jobStateSummariesCollection.get(n);t.jobStatesSummary=s}}})},model:function(e,t){return"dataset"===e.history_content_type?new d.default.HistoryDatasetAssociation(e,t):"dataset_collection"===e.history_content_type?new u.default.HistoryDatasetCollection(e,t):{validationError:"Unknown history_content_type: "+e.history_content_type}},stopPolling:function(){this.jobStateSummariesCollection&&(this.jobStateSummariesCollection.active=!1,this.jobStateSummariesCollection.clearUpdateTimeout())},setHistoryId:function(e){this.stopPolling(),this.historyId=e,e&&(this._setUpWebStorage(),this.jobStateSummariesCollection=new m.default.JobStatesSummaryCollection,this.jobStateSummariesCollection.historyId=e,this.jobStateSummariesCollection.monitor())},_setUpWebStorage:function(e){return this.storage=new f.default.HistoryPrefs({id:f.default.HistoryPrefs.historyStorageKey(this.historyId)}),this.trigger("new-storage",this.storage,this),this.on({"include-deleted":function(e){this.storage.includeDeleted(e)},"include-hidden":function(e){this.storage.includeHidden(e)}}),this.includeDeleted=this.storage.includeDeleted()||!1,this.includeHidden=this.storage.includeHidden()||!1,this},comparators:e.extend(e.clone(b.prototype.comparators),{name:_.default.buildComparator("name",{ascending:!0}),"name-dsc":_.default.buildComparator("name",{ascending:!1}),hid:_.default.buildComparator("hid",{ascending:!1}),"hid-asc":_.default.buildComparator("hid",{ascending:!0})}),running:function(){return this.filter(function(e){return!e.inReadyState()})},runningAndActive:function(){return this.filter(function(e){return!e.inReadyState()&&e.get("visible")&&!e.get("deleted")})},getByHid:function(e){return this.findWhere({hid:e})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},hidden:function(){return this.filter(function(e){return e.hidden()})},deleted:function(){return this.filter(function(e){return e.get("deleted")})},visibleAndUndeleted:function(){return this.filter(function(e){return e.get("visible")&&!e.get("deleted")})},setIncludeDeleted:function(t,i){if(e.isBoolean(t)&&t!==this.includeDeleted){if(this.includeDeleted=t,e.result(i,"silent"))return;this.trigger("include-deleted",t,this)}},setIncludeHidden:function(t,i){if(e.isBoolean(t)&&t!==this.includeHidden){if(this.includeHidden=t,i=i||{},e.result(i,"silent"))return;this.trigger("include-hidden",t,this)}},fetch:function(t){if(t=t||{},this.historyId&&!t.details){var i=f.default.HistoryPrefs.get(this.historyId).toJSON();e.isEmpty(i.expandedIds)||(t.details=e.values(i.expandedIds).join(","))}return b.prototype.fetch.call(this,t)},_buildFetchData:function(t){return e.extend(b.prototype._buildFetchData.call(this,t),{v:"dev"})},_fetchParams:b.prototype._fetchParams.concat(["v","details"]),_buildFetchFilters:function(t){var i=b.prototype._buildFetchFilters.call(this,t)||{},n={};return this.includeDeleted||(n.deleted=!1,n.purged=!1),this.includeHidden||(n.visible=!0),e.defaults(i,n)},getTotalItemCount:function(){return this.history.contentsShown()},fetchUpdated:function(e,t){return e&&(t=t||{filters:{}},t.remove=!1,t.filters={"update_time-ge":e.toISOString(),visible:""}),this.fetch(t)},fetchDeleted:function(t){var i=this;return t=t||{},t.filters=e.extend(t.filters,{deleted:!0,purged:void 0}),t.remove=!1,this.trigger("fetching-deleted",this),this.fetch(t).always(function(){i.trigger("fetching-deleted-done",i)})},fetchHidden:function(t){t=t||{};var i=this;return t.filters=e.extend(t.filters,{visible:!1}),t.remove=!1,i.trigger("fetching-hidden",i),i.fetch(t).always(function(){i.trigger("fetching-hidden-done",i)})},fetchAllDetails:function(t){t=t||{};var i={details:"all"};return t.data=e.extend(t.data||{},i),this.fetch(t)},_filterAndUpdate:function(e,t){var i=this,n=i.model.prototype.idAttribute,s=[t];return i.fetch({filters:e,remove:!1}).then(function(e){return e=e.reduce(function(e,t,s){var a=i.get(t[n]);return a?e.concat(a):e},[]),i.ajaxQueue("save",s,e)})},ajaxQueue:function(t,i,n){return n=n||this.models,new y.default.AjaxQueue(n.slice().reverse().map(function(n,s){var a=e.isString(t)?n[t]:t;return function(){return a.apply(n,i)}})).deferred},progressivelyFetchDetails:function(t){function i(n){n=n||0;var r=e.extend(e.clone(t),{view:"summary",keys:l,limit:o,offset:n,reset:0===n,remove:!1});e.defer(function(){a.fetch.call(a,r).fail(s.reject).done(function(e){s.notify(e,o,n),e.length!==o?(a.allFetched=!0,s.resolve(e,o,n)):i(n+o)})})}t=t||{};var s=n.Deferred(),a=this,o=t.limitPerCall||a.limitPerProgressiveFetch,r=d.default.HistoryDatasetAssociation.prototype.searchAttributes,l=r.join(",");return i(),s},isCopyable:function(t){var i=["HistoryDatasetAssociation","HistoryDatasetCollectionAssociation"];return e.isObject(t)&&t.id&&e.contains(i,t.model_class)},copy:function(t){var i,s,a;e.isString(t)?(i=t,a="hda",s="dataset"):(i=t.id,a={HistoryDatasetAssociation:"hda",LibraryDatasetDatasetAssociation:"ldda",HistoryDatasetCollectionAssociation:"hdca"}[t.model_class]||"hda",s="hdca"===a?"dataset_collection":"dataset");var o=this,r=n.ajax(this.url(),{method:"POST",contentType:"application/json",data:JSON.stringify({content:i,source:a,type:s})}).done(function(e){o.add([e],{parse:!0})}).fail(function(e,t,n){o.trigger("error",o,r,{},"Error copying contents",{type:s,id:i,source:a})});return r},createHDCA:function(e,t,i,n,s){return this.model({history_content_type:"dataset_collection",collection_type:t,history_id:this.historyId,name:i,hide_source_items:n||!1,element_identifiers:e}).save(s)},haveSearchDetails:function(){return this.allFetched&&this.all(function(t){return e.has(t.attributes,"annotation")})},matches:function(e){return this.filter(function(t){return t.matches(e)})},clone:function(){var e=s.Collection.prototype.clone.call(this);return e.historyId=this.historyId,e},toString:function(){return["HistoryContents(",[this.historyId,this.length].join(),")"].join("")}});t.default={HistoryContents:x}}).call(t,i(1),i(0),i(2))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:!1,show_hidden:!1},addExpanded:function(e){var t=this.get("expandedIds");t[e.id]=e.get("id"),this.save("expandedIds",t)},removeExpanded:function(e){var t=this.get("expandedIds");delete t[e.id],this.save("expandedIds",t)},isExpanded:function(t){return e.result(this.get("expandedIds"),t,!1)},allExpanded:function(){return e.values(this.get("expandedIds"))},clearExpanded:function(){this.set("expandedIds",{})},includeDeleted:function(t){return e.isUndefined(t)||this.set("show_deleted",t),this.get("show_deleted")},includeHidden:function(t){return e.isUndefined(t)||this.set("show_hidden",t),this.get("show_hidden")},toString:function(){return"HistoryPrefs("+this.id+")"}},{storageKeyPrefix:"history:",historyStorageKey:function(e){if(!e)throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+e);return a.storageKeyPrefix+e},get:function(e){return new a({id:a.historyStorageKey(e)})},clearAll:function(e){for(var t in sessionStorage)0===t.indexOf(a.storageKeyPrefix)&&sessionStorage.removeItem(t)}});t.default={HistoryPrefs:a}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(5),l=o(r),d=i(4),c=(o(d),e.View.extend(l.default.LoggableMixin).extend({_logNamespace:"list",initialize:function(e){this.expanded=e.expanded||!1,this.log("\t expanded:",this.expanded),this.fxSpeed=void 0!==e.fxSpeed?e.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(e){var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){var e=n(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(e).replaceWith(this._renderDetails().show()),e},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;0===t?(i._swapNewRender(e),i.trigger("rendered",i)):n(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",s.isFunction(this.className)?this.className():this.className).append(e.children())},_setUpBehaviors:function(e){e=e||this.$el,e.find("[title]").tooltip({placement:"bottom"})},$details:function(e){return e=e||this.$el,e.find("> .details")},_renderDetails:function(){var e=n(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(e),e},toggleExpanded:function(e){return e=void 0===e?!this.expanded:e,e?this.expand():this.collapse(),this},expand:function(){var e=this;return e._fetchModelDetails().always(function(){e._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?a.when():this.model.fetch()},_expand:function(){var e=this,t=e._renderDetails();e.$details().replaceWith(t),e.expanded=!0,e.$details().slideDown(e.fxSpeed,function(){e.trigger("expanded",e)})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var e=this;e.expanded=!1,this.$details().slideUp(e.fxSpeed,function(){e.trigger("collapsed",e)})}})),u=c.extend(l.default.mixin(l.default.SelectableViewMixin,l.default.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(e){c.prototype.initialize.call(this,e),l.default.SelectableViewMixin.initialize.call(this,e),l.default.DraggableViewMixin.initialize.call(this,e),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(e){e?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var e=c.prototype._buildNewRender.call(this);return e.children(".warnings").replaceWith(this._renderWarnings()),e.children(".title-bar").replaceWith(this._renderTitleBar()),e.children(".primary-actions").append(this._renderPrimaryActions()),e.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),e},_swapNewRender:function(e){return c.prototype._swapNewRender.call(this,e),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var e=this,t=n('
    '),i=e.model.toJSON();return s.each(e.templates.warnings,function(s){t.append(n(s(i,e)))}),t},_renderTitleBar:function(){return n(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return n(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation(),e.altKey?(this.toggleSelect(e),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(e){return!e||"keydown"!==e.type||32!==e.keyCode&&13!==e.keyCode||(this.toggleExpanded(),e.stopPropagation(),!1)},toString:function(){return"ListItemView("+(this.model?""+this.model:"(no model)")+")"}}));u.prototype.templates=function(){return{el:l.default.wrapTemplate(['
    ','
    ','
    ','',"
    ",'
    ','
    ','
    ',"
    "]),warnings:{},titleBar:l.default.wrapTemplate(['
    ','','
    ','<%- element.name %>',"
    ",'
    ',"
    "],"element"),subtitle:l.default.wrapTemplate(['
    ']),details:l.default.wrapTemplate(['
    '])}}();var h=u.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(e){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=e.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=e.foldoutPanelClass||this.foldoutPanelClass,u.prototype.initialize.call(this,e),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return n();var e=u.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,e)},_createFoldoutPanel:function(){var e=this.model,t=this._getFoldoutPanelClass(e),i=this._getFoldoutPanelOptions(e);return new t(s.extend(i,{model:e}))},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(e,t){return t=t||this.$("> .details"),this.foldout=e.render(0),e.$("> .controls").hide(),t.append(e.$el)},expand:function(){var e=this;return e._fetchModelDetails().always(function(){"foldout"===e.foldoutStyle?e._expand():"drilldown"===e.foldoutStyle&&e._expandByDrilldown()})},_expandByDrilldown:function(){var e=this;e.listenTo(e.foldout,"close",function(){e.trigger("collapsed:drilldown",e,e.foldout)}),e.trigger("expanded:drilldown",e,e.foldout)}});h.prototype.templates=function(){var e=l.default.wrapTemplate(['
    ',"
    "],"collection");return s.extend({},u.prototype.templates,{details:e})}(),t.default={ExpandableView:c,ListItemView:u,FoldoutListItemView:h}}).call(t,i(2),i(0),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(65),l=o(r),d=i(16),c=o(d),u=i(21),h=o(u),f=i(5),p=o(f),m=i(4),g=o(m),_=l.default.ListItemView,v=_.extend({_logNamespace:"dataset",className:_.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log(this+".initialize:",e),_.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_setUpListeners:function(){_.prototype._setUpListeners.call(this);var t=this;return t.listenTo(t.model,{change:function(i){t.model.changedAttributes().state&&t.model.inReadyState()&&t.expanded&&!t.model.hasDetails()?t.model.fetch({silent:!0}).done(function(){t.render()}):e.has(i.changed,"tags")&&1===e.keys(i.changed).length?t.$(".nametags").html(t._renderNametags()):t.render()}})},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):n.when()},remove:function(e,t){var i=this;e=e||this.fxSpeed,this.$el.fadeOut(e,function(){s.View.prototype.remove.call(i),t&&t.call(i)})},_swapNewRender:function(e){return _.prototype._swapNewRender.call(this,e),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var e=this.model.get("state");if(e===c.default.NOT_VIEWABLE||e===c.default.DISCARDED||!this.model.get("accessible"))return null;var t={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))t.disabled=!0,t.title=(0,g.default)("Cannot display datasets removed from disk");else if(e===c.default.UPLOAD)t.disabled=!0,t.title=(0,g.default)("This dataset must finish uploading before it can be viewed");else if(e===c.default.NEW)t.disabled=!0,t.title=(0,g.default)("This dataset is not yet viewable");else{t.title=(0,g.default)("View data"),t.href=this.model.urls.display;var i=this;t.onclick=function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(i.model.get("id")),e.preventDefault())}}return t.faIcon="fa-eye",(0,h.default)(t)},_renderDetails:function(){if(this.model.get("state")===c.default.NOT_VIEWABLE)return a(this.templates.noAccess(this.model.toJSON(),this));var e=_.prototype._renderDetails.call(this);return e.find(".actions .left").empty().append(this._renderSecondaryActions()),e.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),e.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(e),e},_renderSummary:function(){var e=this.model.toJSON(),t=this.templates.summaries[e.state];return(t=t||this.templates.summaries.unknown)(e,this)},_renderDetailMessages:function(){var t=this,i=a('
    '),n=t.model.toJSON();return e.each(t.templates.detailMessages,function(e){i.append(a(e(n,t)))}),i},_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 c.default.NOT_VIEWABLE:return[];case c.default.OK:case c.default.FAILED_METADATA:case c.default.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return(0,h.default)({title:(0,g.default)("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle",onclick:function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Dataset details",url:this.href}),e.preventDefault(),e.stopPropagation())}})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:e.isEmpty(this.model.get("meta_files"))?a(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var t=this.model.urls;return a(['"].join("\n"))},_renderNametags:function(){return e.template(["<% _.each(_.sortBy(_.uniq(tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<%- tag.slice(5) %>',"<% } %>","<% }); %>"].join(""))({tags:this.model.get("tags")})},events:e.extend(e.clone(_.prototype.events),{"click .display-btn":function(e){this.trigger("display",this,e)},"click .params-btn":function(e){this.trigger("params",this,e)},"click .download-btn":function(e){this.trigger("download",this,e)}}),toString:function(){return"DatasetListItemView("+(this.model?""+this.model:"(no model)")+")"}});v.prototype.templates=function(){var t=e.extend({},_.prototype.templates.warnings,{failed_metadata:p.default.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','
    ',(0,g.default)("An error occurred setting the metadata for this dataset"),"
    ","<% } %>"]),error:p.default.wrapTemplate(["<% if( model.error ){ %>",'
    ',(0,g.default)("There was an error getting the data for this dataset"),": <%- model.error %>","
    ","<% } %>"]),purged:p.default.wrapTemplate(["<% if( model.purged ){ %>",'
    ',(0,g.default)("This dataset has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:p.default.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',(0,g.default)("This dataset has been deleted"),"
    ","<% } %>"])}),i=p.default.wrapTemplate(['
    ','
    ','
    ','
    ','
    ',"
    ","<% if( !dataset.deleted && !dataset.purged ){ %>",'
    ','
    ','
    ',"<% if( dataset.peek ){ %>",'
    <%= dataset.peek %>
    ',"<% } %>","<% } %>","
    "],"dataset"),n=p.default.wrapTemplate(['
    ','
    ',(0,g.default)("You do not have permission to view this dataset"),"
    ","
    "],"dataset"),s={};s[c.default.OK]=s[c.default.FAILED_METADATA]=p.default.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"),s[c.default.NEW]=p.default.wrapTemplate(["
    ",(0,g.default)("This is a new dataset and not all of its data are available yet"),"
    "],"dataset"),s[c.default.NOT_VIEWABLE]=p.default.wrapTemplate(["
    ",(0,g.default)("You do not have permission to view this dataset"),"
    "],"dataset"),s[c.default.DISCARDED]=p.default.wrapTemplate(["
    ",(0,g.default)("The job creating this dataset was cancelled before completion"),"
    "],"dataset"),s[c.default.QUEUED]=p.default.wrapTemplate(["
    ",(0,g.default)("This job is waiting to run"),"
    "],"dataset"),s[c.default.RUNNING]=p.default.wrapTemplate(["
    ",(0,g.default)("This job is currently running"),"
    "],"dataset"),s[c.default.UPLOAD]=p.default.wrapTemplate(["
    ",(0,g.default)("This dataset is currently uploading"),"
    "],"dataset"),s[c.default.SETTING_METADATA]=p.default.wrapTemplate(["
    ",(0,g.default)("Metadata is being auto-detected"),"
    "],"dataset"),s[c.default.PAUSED]=p.default.wrapTemplate(["
    ",(0,g.default)('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"
    "],"dataset"),s[c.default.ERROR]=p.default.wrapTemplate(["<% if( !dataset.purged ){ %>","
    <%- dataset.misc_blurb %>
    ","<% } %>",'',(0,g.default)("An error occurred with this dataset"),":",'
    <%- dataset.misc_info %>
    '],"dataset"),s[c.default.EMPTY]=p.default.wrapTemplate(["
    ",(0,g.default)("No data"),": <%- dataset.misc_blurb %>
    "],"dataset"),s.unknown=p.default.wrapTemplate(['
    Error: unknown dataset state: "<%- dataset.state %>"
    '],"dataset");var a={resubmitted:p.default.wrapTemplate(["<% if( model.resubmitted ){ %>",'
    ',(0,g.default)("The job creating this dataset has been resubmitted"),"
    ","<% } %>"])},o=p.default.wrapTemplate(["<% _.each( apps, function( app ){ %>",'
    ','<%- app.label %> ','',"<% _.each( app.links, function( link ){ %>",'',"<% print( _l( link.text ) ); %>"," ","<% }); %>","","
    ","<% }); %>"],"apps");return e.extend({},_.prototype.templates,{warnings:t,details:i,noAccess:n,summaries:s,detailMessages:a,displayApplications:o})}(),t.default={DatasetListItemView:v}}).call(t,i(1),i(0),i(2),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(65),r=a(o),l=i(66),d=a(l),c=i(5),u=a(c),h=i(4),f=a(h),p=r.default.FoldoutListItemView,m=r.default.ListItemView,g=p.extend({className:p.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(e){this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,p.prototype.initialize.call(this,e)},_setUpListeners:function(){p.prototype._setUpListeners.call(this),this.listenTo(this.model,"change",function(t,i){e.has(t.changed,"deleted")?this.render():e.has(t.changed,"element_count")&&this.$("> .title-bar .subtitle").replaceWith(this._renderSubtitle())})},_renderSubtitle:function(){return n(this.templates.subtitle(this.model.toJSON(),this))},_getFoldoutPanelOptions:function(){var t=p.prototype._getFoldoutPanelOptions.call(this);return e.extend(t,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){return"DCListItemView("+(this.model?""+this.model:"(no model)")+")"}});g.prototype.templates=function(){var t=e.extend({},p.prototype.templates.warnings,{error:u.default.wrapTemplate(["<% if( model.error ){ %>",'
    ',(0,f.default)("There was an error getting the data for this collection"),": <%- model.error %>","
    ","<% } %>"]),purged:u.default.wrapTemplate(["<% if( model.purged ){ %>",'
    ',(0,f.default)("This collection has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:u.default.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',(0,f.default)("This collection has been deleted"),"
    ","<% } %>"])}),i=u.default.wrapTemplate(['
    ','
    ','<%- collection.element_identifier || collection.name %>',"
    ",'
    ',"
    "],"collection"),n=u.default.wrapTemplate(['
    ','<% var countText = collection.element_count? ( collection.element_count + " " ) : ""; %>','<% if( collection.collection_type === "list" ){ %>',(0,f.default)("a list of <%- countText %>datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',(0,f.default)("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',(0,f.default)("a list of <%- countText %>dataset pairs"),'<% } else if( collection.collection_type === "list:list" ){ %>',(0,f.default)("a list of <%- countText %>dataset lists"),"<% } %>","
    "],"collection");return e.extend({},p.prototype.templates,{warnings:t,titleBar:i,subtitle:n})}();var _=m.extend({className:m.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DCEListItemView.initialize:",e),m.prototype.initialize.call(this,e)},toString:function(){return"DCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});_.prototype.templates=function(){var t=u.default.wrapTemplate(['
    ','
    ','<%- element.element_identifier %>',"
    ",'
    ',"
    "],"element");return e.extend({},m.prototype.templates,{titleBar:t})}();var v=d.default.DatasetListItemView.extend({className:d.default.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DatasetDCEListItemView.initialize:",e),d.default.DatasetListItemView.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):s.when()},toString:function(){return"DatasetDCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});v.prototype.templates=function(){var t=u.default.wrapTemplate(['
    ','','
    ','<%- element.element_identifier %>',"
    ","
    "],"element");return e.extend({},d.default.DatasetListItemView.prototype.templates,{titleBar:t})}();var y=g.extend({className:g.prototype.className+" dataset-collection-element",_swapNewRender:function(e){g.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){return"NestedDCDCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});t.default={DCListItemView:g,DCEListItemView:_,DatasetDCEListItemView:v,NestedDCDCEListItemView:y}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(11),o=s(a),r=i(6),l=s(r),d=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
    "),this.render()},render:function(){var e=this;n.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(t){var i=n.extend({},e.model.attributes,t),s=new o.default({title:i.title,message:i.message,status:i.status||"warning",icon:i.icon,initial_errors:!0,errors:i.errors,inputs:i.inputs,buttons:{submit:new l.default.Button({tooltip:i.submit_tooltip,title:i.submit_title||"Save",icon:i.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){e._submit(s)}})}});e.$el.empty().append(s.$el)}).fail(function(t){e.$el.empty().append(new l.default.Message({message:"Failed to load resource "+e.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;n.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(i){var s={};i.id?s.id=i.id:s={message:i.message,status:"success",persistent:!1},t.redirect?window.location=Galaxy.root+t.redirect+"?"+n.param(s):(e.data.matchModel(i,function(t,i){e.field_list[i].value(t.value)}),t._showMessage(e,success_message))}).fail(function(i){t._showMessage(e,{message:i.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){e.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(n(this).css("overflow"))}).first().animate({scrollTop:0},500),e.message.update(t)}});t.default={View:d}}).call(t,i(2),i(0))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(16),r=a(o),l=i(5),d=a(l),c=i(4),u=a(c),h=d.default.SearchableModelMixin,f=e.Model.extend(d.default.LoggableMixin).extend(d.default.mixin(h,{_logNamespace:"dataset",defaults:{state:r.default.NEW,deleted:!1,purged:!1,name:"(unnamed dataset)",accessible:!0,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(e,t){this.debug(this+"(Dataset).initialize",e,t), +webpackJsonp([0],[,,,,,,,,,,function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var s=i(4),a=function(e){return e&&e.__esModule?e:{default:e}}(s),o=e.View.extend({optionsDefault:{css:"",placeholder:"No data available",data:[],value:null,multiple:!1,minimumInputLength:0,initialData:""},initialize:function(e){if(this.options=a.default.merge(e,this.optionsDefault),this.setElement(this._template(this.options)),!this.options.container)return void console.log("ui-select::initialize() : container not specified.");if(this.options.container.append(this.$el),this.select_data=this.options.data,this._refresh(),!this.options.multiple){this.options.value&&this._setValue(this.options.value);var t=this;this.options.onchange&&this.$el.on("change",function(){t.options.onchange(t.value())})}},value:function(e){var t=this._getValue();void 0!==e&&this._setValue(e);var i=this._getValue();return i!=t&&this.options.onchange&&this.options.onchange(i),i},text:function(){return this.$el.select2("data").text},disabled:function(){return!this.$el.select2("enable")},enable:function(){this.$el.select2("enable",!0)},disable:function(){this.$el.select2("enable",!1)},add:function(e){this.select_data.push({id:e.id,text:e.text}),this._refresh()},del:function(e){var t=this._getIndex(e);-1!=t&&(this.select_data.splice(t,1),this._refresh())},remove:function(){this.$el.select2("destroy")},update:function(e){this.select_data=[];for(var t in e.data)this.select_data.push(e.data[t]);this._refresh()},_refresh:function(){if(this.options.multiple){var e={multiple:this.options.multiple,containerCssClass:this.options.css,placeholder:this.options.placeholder,minimumInputLength:this.options.minimumInputLength,ajax:this.options.ajax,dropdownCssClass:this.options.dropdownCssClass,escapeMarkup:this.options.escapeMarkup,formatResult:this.options.formatResult,formatSelection:this.options.formatSelection,initSelection:this.options.initSelection,initialData:this.options.initialData};this.$el.select2(e)}else{var t=this._getValue(),e={data:this.select_data,containerCssClass:this.options.css,placeholder:this.options.placeholder,dropdownAutoWidth:!0};this.$el.select2(e),this._setValue(t)}},_getIndex:function(e){n.findIndex(this.select_data,{id:e})},_getValue:function(){return this.$el.select2("val")},_setValue:function(e){-1==this._getIndex(e)&&this.select_data.length>0&&(e=this.select_data[0].id),this.$el.select2("val",e)},_template:function(e){return''}});t.default={View:o}}).call(t,i(2),i(1))},,,,,function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=e.View.extend({optionsDefault:{with_close:!0,title:null,placement:"top",container:"body",body:null},initialize:function(e){this.setElement(this._template()),this.uid=o.default.uid(),this.options=n.defaults(e||{},this.optionsDefault),this.options.container.parent().append(this.el),this.$title=this.$(".popover-title-label"),this.$close=this.$(".popover-close"),this.$body=this.$(".popover-content"),this.options.body&&this.append(this.options.body);var t=this;s("body").on("mousedown."+this.uid,function(e){t.visible&&!s(t.options.container).is(e.target)&&!s(t.el).is(e.target)&&0===s(t.el).has(e.target).length&&t.hide()})},render:function(){this.$title.html(this.options.title),this.$el.removeClass().addClass("ui-popover popover fade in").addClass(this.options.placement),this.$el.css(this._get_placement(this.options.placement));var e=this;this.options.with_close?this.$close.on("click",function(){e.hide()}).show():this.$close.off().hide()},title:function(e){void 0!==e&&(this.options.title=e,this.$title.html(e))},show:function(){this.render(),this.$el.show(),this.visible=!0},hide:function(){this.$el.hide(),this.visible=!1},append:function(e){this.$body.append(e)},empty:function(){this.$body.empty()},remove:function(){s("body").off("mousedown."+this.uid),this.$el.remove()},_get_placement:function(e){var t,i,n=this._get_width(this.$el),s=this.$el.height(),a=this.options.container,o=this._get_width(a),l=this._get_height(a),r=a.position();if(t=i=0,-1!=["top","bottom"].indexOf(e))switch(i=r.left-n+(o+n)/2,e){case"top":t=r.top-s-5;break;case"bottom":t=r.top+l+5}else switch(t=r.top-s+(l+s)/2,e){case"right":i=r.left+o}return{top:t,left:i}},_get_width:function(e){return e.width()+parseInt(e.css("padding-left"))+parseInt(e.css("margin-left"))+parseInt(e.css("padding-right"))+parseInt(e.css("margin-right"))},_get_height:function(e){return e.height()+parseInt(e.css("padding-top"))+parseInt(e.css("padding-bottom"))},_template:function(e){return'
    '}});t.default={View:l}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};n.READY_STATES=[n.OK,n.EMPTY,n.PAUSED,n.FAILED_METADATA,n.NOT_VIEWABLE,n.DISCARDED,n.ERROR],n.NOT_READY_STATES=[n.UPLOAD,n.QUEUED,n.RUNNING,n.SETTING_METADATA,n.NEW],t.default=n},,,,,function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default,o=function(t){t=t||{},t.tooltipConfig=t.tooltipConfig||{placement:"bottom"},t.classes=["icon-btn"].concat(t.classes||[]),t.disabled&&t.classes.push("disabled");var i=['','',""].join(""),n=a(i).tooltip(t.tooltipConfig);return e.isFunction(t.onclick)&&n.click(t.onclick),n};t.default=o}).call(t,i(1))},,function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function a(e,t){return this._init(e||{},t||{})}Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),l=s(o),r=i(2),d=s(r),c=i(5),u=n(c),h=i(24),f=n(h),p=i(25),m=n(p),g=i(32),_=n(g),v=i(3),y=n(v);(0,_.default)(a,"GalaxyApp");var w="galaxy:debug:namespaces",b=!1;try{b="true"==localStorage.getItem("galaxy:debug")}catch(e){console.log((0,y.default)("localStorage not available for debug flag retrieval"))}a.prototype._init=function(e,t){var i=this;return l.extend(i,d.Events),b&&(i.logger=console,console.debug("debugging galaxy:","options:",e,"bootstrapped:",t)),i._processOptions(e),i.root=e.root||"/",i.params=e.params||{},i.session_csrf_token=e.session_csrf_token||null,i._initConfig(e.config||{}),i._patchGalaxy(window.Galaxy),i._initLogger(i.options.loggerOptions||{}),i.debug("GalaxyApp.options: ",i.options),i.debug("GalaxyApp.config: ",i.config),i.debug("GalaxyApp.logger: ",i.logger),i._initLocale(),i.debug("GalaxyApp.localize: ",i.localize),i.config=e.config||{},i.debug("GalaxyApp.config: ",i.config),i._initUser(e.user||{}),i.debug("GalaxyApp.user: ",i.user),i._setUpListeners(),i.trigger("ready",i),i},a.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},a.prototype._processOptions=function(e){var t=this,i=t.defaultOptions;t.options={};for(var n in i)i.hasOwnProperty(n)&&(t.options[n]=e.hasOwnProperty(n)?e[n]:i[n]);return t},a.prototype._initConfig=function(e){var t=this;return t.config=e,t.config.debug=b||t.config.debug,t},a.prototype._patchGalaxy=function(e){var t=this;if(t.options.patchExisting&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},a.prototype._initLogger=function(e){var t=this;if(t.config.debug){e.consoleLogger=e.consoleLogger||console,e.consoleLevel=e.consoleLevel||m.default.MetricsLogger.ALL;try{e.consoleNamespaceWhitelist=localStorage.getItem(w).split(",")}catch(e){}try{e.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(e){}console.log(e.consoleFlattenMessages)}return t.logger=new m.default.MetricsLogger(e),t.emit={},["log","debug","info","warn","error","metric"].map(function(e){t.emit[e]=function(i){t.logger.emit(e,arguments[0],Array.prototype.slice.call(arguments,1))}}),t.config.debug&&(u.default.LoggableMixin.logger=t.logger),t},a.prototype._initLocale=function(e){var t=this;return t.debug("_initLocale:",e),t.localize=y.default,window._l=t.localize,t},a.prototype._initUser=function(e){var t=this;return t.debug("_initUser:",e),t.user=new f.default.User(e),t.user.logger=t.logger,t},a.prototype._setUpListeners=function(){var t=this;return t.lastAjax={},e(document).bind("ajaxSend",function(e,i,n){var s=n.data;try{s=JSON.parse(s)}catch(e){}t.lastAjax={url:location.href.slice(0,-1)+n.url,data:s}}),t},a.prototype.debugging=function(e){var t=this;try{if(void 0===e)return"true"===localStorage.getItem("galaxy:debug");if(e)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),t.debuggingNamespaces(null)}catch(e){console.log((0,y.default)("localStorage not available for debug flag retrieval"))}return!1},a.prototype.debuggingNamespaces=function(e){var t=this;try{if(void 0===e){var i=localStorage.getItem(w);return"string"==typeof i?i.split(","):[]}null===e?localStorage.removeItem(w):localStorage.setItem(w,e);var n=t.debuggingNamespaces();return t.logger&&(t.logger.options.consoleNamespaceWhitelist=n),n}catch(e){console.log((0,y.default)("localStorage not available for debug namespace retrieval"))}},a.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},t.default={GalaxyApp:a}}).call(t,i(0))},,function(e,t,i){"use strict";(function(e){function i(e){e=e||{};var t=this;return t.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,t.userId=t.userId||e.userId||null,t.consoleLogger=e.consoleLogger||null,t._init(e),t}function n(e){var t=String(e);return"[object Object]"==t&&(t=JSON.stringify(e)),t}function s(e){return this._init(e||{})}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i.ALL=0,i.LOG=0,i.DEBUG=10,i.INFO=20,i.WARN=30,i.ERROR=40,i.METRIC=50,i.NONE=100,i.defaultOptions={logLevel:i.NONE,consoleLevel:i.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},i.prototype._init=function(e){var t=this;t.options={};for(var n in i.defaultOptions)i.defaultOptions.hasOwnProperty(n)&&(t.options[n]=e.hasOwnProperty(n)?e[n]:i.defaultOptions[n]);return t.options.logLevel=t._parseLevel(t.options.logLevel),t.options.consoleLevel=t._parseLevel(t.options.consoleLevel),t._sending=!1,t._waiting=null,t._postSize=t.options.postSize,t._initCache(),t},i.prototype._initCache=function(){try{this.cache=new s({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(e){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",e]),this.options.logLevel=i.NONE}},i.prototype._parseLevel=function(e){var t=void 0===e?"undefined":a(e);if("number"===t)return e;if("string"===t){var n=e.toUpperCase();if(i.hasOwnProperty(n))return i[n]}throw new Error("Unknown log level: "+e)},i.prototype.emit=function(e,t,i){var n=this;return t=t||n.options.defaultNamespace,e&&i?(e=n._parseLevel(e),e>=n.options.logLevel&&n._addToCache(e,t,i),n.consoleLogger&&e>=n.options.consoleLevel&&n._emitToConsole(e,t,i),n):n},i.prototype._addToCache=function(e,t,i){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var n=this;try{n.cache.add(n._buildEntry(e,t,i))>=n._postSize&&n._postCache()}catch(e){n._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",t,i]),n._emitToConsole("error","MetricsLogger",[e])}return n},i.prototype._buildEntry=function(e,t,i){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var n={level:e,namespace:this.options.clientPrefix+t,args:i};return this.options.addTime&&(n.time=(new Date).toISOString()),n},i.prototype._postCache=function(t){if(t=t||{},this._emitToConsole("info","MetricsLogger",["_postCache",t,this._postSize]),!this.options.postUrl||this._sending)return e.when({});var i=this,n=t.count||i._postSize,s=i.cache.get(n),a=s.length,o="function"==typeof i.options.getPingData?i.options.getPingData():{};return o.metrics=JSON.stringify(s),i._sending=!0,e.post(i.options.postUrl,o).always(function(){i._sending=!1}).fail(function(e,t,n){i._postSize=i.options.maxCacheSize,i.emit("error","MetricsLogger",["_postCache error:",e.readyState,e.status,e.responseJSON||e.responseText])}).done(function(e){"function"==typeof i.options.onServerResponse&&i.options.onServerResponse(e),i.cache.remove(a),i._postSize=i.options.postSize})},i.prototype._delayPost=function(){var e=this;e._waiting=setTimeout(function(){e._waiting=null},e.options.delayPostInMs)},i.prototype._emitToConsole=function(e,t,s){var a=this,o=a.options.consoleNamespaceWhitelist;if(!a.consoleLogger)return a;if(o&&-1===o.indexOf(t))return a;var l=Array.prototype.slice.call(s,0);return l.unshift(t),a.options.consoleFlattenMessages&&(l=[l.map(n).join(" ")]),e>=i.METRIC&&"function"==typeof a.consoleLogger.info?a.consoleLogger.info.apply(a.consoleLogger,l):e>=i.ERROR&&"function"==typeof a.consoleLogger.error?a.consoleLogger.error.apply(a.consoleLogger,l):(e>=i.WARN&&"function"==typeof a.consoleLogger.warn?a.consoleLogger.warn.apply(a.consoleLogger,l):e>=i.INFO&&"function"==typeof a.consoleLogger.info?a.consoleLogger.info.apply(a.consoleLogger,l):e>=i.DEBUG&&"function"==typeof a.consoleLogger.debug?a.consoleLogger.debug.apply(a.consoleLogger,l):"function"==typeof a.consoleLogger.log&&a.consoleLogger.log.apply(a.consoleLogger,l),a)},i.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.debug=function(){this.emit(i.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.info=function(){this.emit(i.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.warn=function(){this.emit(i.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.error=function(){this.emit(i.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.metric=function(){this.emit(i.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},s.defaultOptions={maxSize:5e3},s.prototype._init=function(e){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!e.key)throw new Error("LoggingCache needs key for localStorage");return this.key=e.key,this._initStorage(),this.maxSize=e.maxSize||s.defaultOptions.maxSize,this},s.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},s.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},s.prototype.add=function(e){var t=this,i=t._fetchAndParse(),n=i.length+1-t.maxSize;return n>0&&i.splice(0,n),i.push(e),t._unparseAndStore(i),i.length},s.prototype._fetchAndParse=function(){var e=this;return JSON.parse(localStorage.getItem(e.key))},s.prototype._unparseAndStore=function(e){var t=this;return localStorage.setItem(t.key,JSON.stringify(e))},s.prototype.length=function(){return this._fetchAndParse().length},s.prototype.get=function(e){return this._fetchAndParse().slice(0,e)},s.prototype.remove=function(e){var t=this._fetchAndParse(),i=t.splice(0,e);return this._unparseAndStore(t),i},s.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},s.prototype.stringify=function(e){return JSON.stringify(this.get(e))},s.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},t.default={MetricsLogger:i,LoggingCache:s}}).call(t,i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(33),l=a(o),r=i(22),d=a(r),c=i(8),u=a(c),h=i(4),f=a(h),p=e.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(t){var i=this;this.config=n.defaults(t.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new u.default.View,Galaxy.display=this.display=function(e){e.title?(f.default.setWindowTitle(e.title),e.allow_title_display=!1):(f.default.setWindowTitle(),e.allow_title_display=!0),i.center.display(e)},Galaxy.router=this.router=t.Router&&new t.Router(i,t),this.masthead=new l.default.View(this.config),this.center=new d.default.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},n.each(this._panelids,function(e){var n=e.charAt(0).toUpperCase()+e.slice(1),s=t[n];if(s){var a=new s(i,t);i[a.toString()]=a,i.panels[e]=new d.default.SidePanel({id:e,el:i.$("#"+e),view:a})}}),this.render(),this.router&&e.history.start({root:Galaxy.root,pushState:!0})},render:function(){return s(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var e=this.config.message_box_content||"",t=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+t+"-message").html(e).toggle(!!e).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var e=this.config.inactivity_box_content||"",t=s("").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(e+" ").append(t).toggle(!!e).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var e=this;return n.each(this._panelids,function(t){var i=e.panels[t];i?i.render():(e.$("#center").css(t,0),e.$("#"+t).hide())}),this},_template:function(){return['
    ','
    ','
    ','
    ','
    ','
    ','
    ','",'
    '].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var e=window.Galaxy.config.communication_server_host,t=window.Galaxy.config.communication_server_port,i=window.Galaxy.user.attributes.preferences,n=s("#show-chat-online");i&&-1!=["1","true"].indexOf(i.communication_server)?s.ajax({url:e+":"+t}).success(function(e){null!==window.Galaxy.user.id&&"hidden"===n.css("visibility")&&n.css("visibility","visible")}).error(function(e){n.css("visibility","hidden")}):n.css("visibility","hidden")}});t.default={View:p}}).call(t,i(2),i(1),i(0))},,,function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=e.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_name:"",file_mode:"",file_size:0,file_type:null,file_path:"",file_data:null,percentage:0,space_to_tab:!1,to_posix_lines:!0,enabled:!0},reset:function(e){this.clear().set(this.defaults).set(e)}}),n=e.Collection.extend({model:i});t.default={Model:i,Collection:n}}).call(t,i(2))},,,,,,,,,,function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),o=s(a),l=i(3),r=s(l),d=e.View.extend(o.default.LoggableMixin).extend(o.default.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",select_width:"100%",events:{},initialize:function(e){this.show_editor=!1,!1===e.usePrompt?this.label="":this.label='",this.workflow_mode=e.workflow_mode||!1,this.workflow_mode&&(this.events.click="showEditor",this.events.keydown="keydownHandler"),this.hiddenUntilActivated(e.$activator,e)},render:function(){var e=this;return this.workflow_mode?this.$el.html(this._workflowTemplate()):this.$el.html(this._defaultTemplate()),this.$input().select2({placeholder:"Add tags",width:this.workflow_mode?this.width:this.select_width,tags:function(){return e._getTagsUsed()}}),this._setUpBehaviors(),this},_hashToName:function(e){return e.startsWith("#")?"name:"+e.slice(1):e},_nameToHash:function(e){return e.startsWith("name:")&&(e="#"+e.slice(5)),e},_defaultTemplate:function(){return[this.label,this._renderEditor()].join("")},_workflowTemplate:function(){return[this.show_editor?this._renderEditor():this._renderTags()].join(" ")},keydownHandler:function(e){switch(e.which){case 27:this.hideEditor()}},showEditor:function(){this.show_editor=!0,this.render()},hideEditor:function(){this.show_editor=!1,this.render()},_renderEditor:function(){return''},_renderTags:function(){var e=this.model.get("tags"),t=Galaxy.root+"static/images/fugue/tag--plus.png",i=[];return n.each(e,function(e){e=0==e.indexOf("name:")?e.slice(5):e;var t=''+e+"";i.push(t)}),0===i.length&&i.push("'),i.join(" ")},tagsToCSV:function(){var e=this,t=this.model.get("tags");return!n.isArray(t)||n.isEmpty(t)?"":t.map(function(t){return n.escape(e._nameToHash(t))}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){var e=this;return n.map(Galaxy.user.get("tags_used"),e._nameToHash)},_setUpBehaviors:function(){var e=this;this.$input().on("change",function(t){t.val=n.map(t.val,e._hashToName),e.model.save({tags:t.val}),t.added&&e._addNewTagToTagsUsed(""+t.added.text)})},_addNewTagToTagsUsed:function(e){var t=Galaxy.user.get("tags_used");n.contains(t,e)||(t.push(e),t.sort(),Galaxy.user.set("tags_used",t))},remove:function(){this.$input.off(),this.stopListening(this.model),e.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",""+this.model,")"].join("")}});t.default={TagsEditor:d}}).call(t,i(2),i(1))},,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(0),a=n(s),o=i(14),l=n(o),r=i(6),d=n(r),c=a.default,u=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),c.isEmptyObject(t)||(e+=-1==e.indexOf("?")?"?":"&",e+=c.param(t,!0)),Galaxy.params=t,this.navigate(e,{trigger:!0})},execute:function(e,t,i){Galaxy.debug("router execute:",e,t,i);var n=l.default.parse(t.pop());t.push(n),e&&(this.authenticate(t,i)?e.apply(this,t):this.access_denied())},authenticate:function(e,t){return!0},access_denied:function(){this.page.display(new d.default.Message({status:"danger",message:"You must be logged in with proper credentials to make this request.",persistent:!0}))}});t.default=u}).call(t,i(2))},function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(4);!function(e){e&&e.__esModule}(a);t.default=e.View.extend({options:{class_check:"fa-check-square-o",class_uncheck:"fa-square-o",parameters:[{id:"space_to_tab",title:"Convert spaces to tabs"},{id:"to_posix_lines",title:"Use POSIX standard"}]},initialize:function(e){this.model=e.model,this.setElement(n("
    ").addClass("upload-settings")),this.$el.append(n("
    ").addClass("upload-settings-cover")),this.$el.append(n("").addClass("upload-settings-table ui-table-striped").append("")),this.$cover=this.$(".upload-settings-cover"),this.$table=this.$(".upload-settings-table > tbody"),this.listenTo(this.model,"change",this.render,this),this.model.trigger("change")},render:function(){var e=this;this.$table.empty(),s.each(this.options.parameters,function(t){var i=n("
    ").addClass("upload-"+t.id+" upload-icon-button fa").addClass(e.model.get(t.id)&&e.options.class_check||e.options.class_uncheck).on("click",function(){e.model.get("enabled")&&e.model.set(t.id,!e.model.get(t.id))});e.$table.append(n("
    ").append(n(""},_template:function(){return'
    '+this.model.get("help_text")+'
    Available files:   
    ").append(i)).append(n("").append(t.title)))}),this.$cover[this.model.get("enabled")&&"hide"||"show"]()}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=e.View.extend({initialize:function(t){this.model=new e.Model({cls:"upload-ftp",class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",help_enabled:!0,help_text:"This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at "+t.ftp_upload_site+" using your Galaxy credentials.",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}}).set(t),this.collection=this.model.get("collection"),this.setElement(this._template()),this.$content=this.$(".upload-ftp-content"),this.$wait=this.$(".upload-ftp-wait"),this.$help=this.$(".upload-ftp-help"),this.$number=this.$(".upload-ftp-number"),this.$disk=this.$(".upload-ftp-disk"),this.$body=this.$(".upload-ftp-body"),this.$warning=this.$(".upload-ftp-warning"),this.$select=this.$(".upload-ftp-select-all"),this.render()},render:function(){var e=this;this.$wait.show(),this.$content.hide(),this.$warning.hide(),this.$help.hide(),n.ajax({url:Galaxy.root+"api/remote_files",method:"GET",success:function(t){e.model.set("ftp_files",t),e._index(),e._renderTable()},error:function(){e._renderTable()}})},_renderTable:function(){var e=this,t=this.model.get("ftp_files");if(this.rows=[],t&&t.length>0){this.$body.empty();var i=0;s.each(t,function(t){e.rows.push(e._renderRow(t)),i+=t.size}),this.$number.html(t.length+" files"),this.$disk.html(o.default.bytesToString(i,!0)),this.collection&&(this.$("._has_collection").show(),this.$select.addClass(this.model.get("class_add")).off().on("click",function(){e._all()}),this._refresh()),this.$content.show()}else this.$warning.show();this.model.get("help_enabled")&&this.$help.show(),this.$wait.hide()},_renderRow:function(e){var t=this,i=this.model.attributes,s=n(this._templateRow(e)),a=s.find(".icon");if(this.$body.append(s),this.collection){var o=this.ftp_index[e.path];a.addClass(void 0===o?i.class_add:i.class_remove),s.on("click",function(){t._switch(a,e),t._refresh()})}else s.on("click",function(){i.onchange(e)});return a},_index:function(){var e=this;this.ftp_index={},this.collection&&this.collection.each(function(t){"ftp"==t.get("file_mode")&&(e.ftp_index[t.get("file_path")]=t.id)})},_all:function(){var e=this.model.attributes,t=this.model.get("ftp_files"),i=this.$select.hasClass(e.class_add);for(var n in t){var s=t[n],a=this.ftp_index[s.path];(void 0===a&&i||void 0!==a&&!i)&&this._switch(this.rows[n],s)}this._refresh()},_switch:function(e,t){e.removeClass();var i=this.model.attributes,n=this.ftp_index[t.path];if(void 0===n){var s=i.onadd(t);e.addClass(i.class_remove),this.ftp_index[t.path]=s}else i.onremove(n),e.addClass(i.class_add),this.ftp_index[t.path]=void 0},_refresh:function(){var e=s.reduce(this.ftp_index,function(e,t){return void 0!==t&&e++,e},0);this.$select.removeClass(),0==e?this.$select.addClass(this.model.get("class_add")):this.$select.addClass(e==this.rows.length?this.model.get("class_remove"):this.model.get("class_partial"))},_templateRow:function(e){return'
    '+s.escape(e.path)+''+o.default.bytesToString(e.size)+''+e.ctime+"
    NameSizeCreated
    Your FTP directory does not contain any files.
    '}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),o=(s(a),i(15)),l=s(o);t.default=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.setElement("
    "),this.render()},render:function(){var e=this.model.attributes,t=n.findWhere(e.list,{id:e.extension});this.extension_popup&&this.extension_popup.remove(),this.extension_popup=new l.default.View({placement:e.placement||"bottom",container:e.$el}),this.extension_popup.title(e.title),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(t)),this.extension_popup.show()},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (read more)'),t}return"There is no description available for this file extension."}})}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e,t){!function(i){e.event.props.push("dataTransfer"),i.uploadpost=function(t){var n=i.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use a FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},t),s=n.data;if(s.error_message)return void n.error(s.error_message);var a=new FormData;for(var o in s.payload)a.append(o,s.payload[o]);var l=0;for(var o in s.files){var r=s.files[o];a.append(r.name,r.file,r.file.name),l+=r.file.size}if(l>1048576*n.maxfilesize)return void n.error(n.error_filesize);var d=new XMLHttpRequest;d.open("POST",n.url,!0),d.setRequestHeader("Accept","application/json"),d.setRequestHeader("Cache-Control","no-cache"),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.onreadystatechange=function(){if(d.readyState==d.DONE){var t=null,i="";if(d.responseText)try{t=e.parseJSON(d.responseText),i=t.err_msg}catch(e){t=d.responseText,i=t}if(d.status<200||d.status>299){var s=d.statusText;403==d.status?s=n.error_login:0==d.status?s=n.error_server:s||(s=n.error_default),n.error(s+" ("+d.status+"). "+i)}else n.success(t)}},d.upload.addEventListener("progress",function(e){e.lengthComputable&&n.progress(Math.round(100*e.loaded/e.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",n),d.send(a)},i.fn.uploadinput=function(e){var t=this,n=i.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},e),s=i('");return t.append(s.change(function(e){n.onchange(e.target.files),i(this).val("")})),t.on("drop",function(e){n.ondragleave(e),e.dataTransfer&&(n.onchange(e.dataTransfer.files),e.preventDefault())}),t.on("dragover",function(e){e.preventDefault(),n.ondragover(e)}),t.on("dragleave",function(e){e.stopPropagation(),n.ondragleave(e)}),{dialog:function(){s.trigger("click")}}},i.fn.uploadbox=function(e){function n(e){if(e&&e.length&&!g){var i=void 0;return t.each(e,function(e,i){"new"!==e.mode&&t.filter(f,function(t){return t.name===e.name&&t.size===e.size}).length&&(e.duplicate=!0)}),t.each(e,function(e){e.duplicate||(i=String(p++),f[i]=e,h.announce(i,f[i]),m++)}),i}}function s(e){f[e]&&(delete f[e],m--)}function a(){if(0==m||_)return _=!1,g=!1,void h.complete();g=!0;var e=-1;for(var t in f){e=t;break}f[e];s(e),i.uploadpost({url:h.url,data:h.initialize(e),success:function(t){h.success(e,t),a()},error:function(t){h.error(e,t),a()},progress:function(t){h.progress(e,t)}})}function o(){v.dialog()}function l(e){for(e in f)s(e)}function r(){g||(g=!0,a())}function d(){_=!0}function c(e){return h=i.extend({},h,e)}function u(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}var h=i.extend({},{dragover:function(){},dragleave:function(){},announce:function(e){},initialize:function(e){},progress:function(e,t){},success:function(e,t){},error:function(e,t){alert(t)},complete:function(){}},e),f={},p=0,m=0,g=!1,_=!1,v=i(this).uploadinput({multiple:!0,onchange:function(e){n(e)},ondragover:e.ondragover,ondragleave:e.ondragleave});return{select:o,add:n,remove:s,start:r,stop:d,reset:l,configure:c,compatible:u}}}(e)}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var i=e.toJSON();return $(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}})}Object.defineProperty(t,"__esModule",{value:!0});var r=i(59),d=o(r),c=i(16),u=o(c),h=i(5),f=o(h),p=i(108),m=o(p),g=i(8),_=o(g),v=i(109),y=(o(v),i(3)),w=o(y);i(110);var b=e.View.extend(f.default.LoggableMixin).extend({_logNamespace:"collections",tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.selected||!1},render:function(){this.dragStartHandler=n.bind(this._dragstart,this),this.dragEndHandler=n.bind(this._dragend,this);var e=this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})).get(0);return e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1),this.selected&&this.$el.addClass("selected"),this},template:n.template(['',"<%- element.name %>","",'"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([(0,w.default)("Enter a new name for the element"),":\n(",(0,w.default)("Note that changing the name here will not rename the dataset"),")"].join(""),prompt((0,w.default)("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),x=e.View.extend(f.default.LoggableMixin).extend(m.default.CollectionCreatorMixin).extend({_logNamespace:"collections",elementViewClass:b,collectionClass:d.default.HistoryDatasetCollection,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 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;n.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),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(e){e.hasOwnProperty("id")||(e.id=n.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){return"dataset"!==e.history_content_type?(0,w.default)("is not a dataset"):e.state===u.default.OK||n.contains(u.default.NOT_READY_STATES,e.state)?e.deleted||e.purged?(0,w.default)("has been deleted or purged"):null:(0,w.default)("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=1,t={};this.workingElements.forEach(function(i){for(var n=i.name;t.hasOwnProperty(n);)if(n=i.name+" ("+e+")",(e+=1)>=900)throw new Error("Safety hit in while loop - thats impressive");i.name=n,t[i.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,s=a("
    "),o=i.$list();n.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);s.append(t.$el)}),i._renderClearSelected(),o.empty().append(s.children()),n.invoke(i.elementViews,"render"),o.height()>o.css("max-height")?o.css("border-width","1px 0px 1px 0px"):o.css("border-width","0px")},_createElementView:function(e){var t=new this.elementViewClass({element:e,selected:n.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=n.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=(0,w.default)("No valid elements for final list")+". ";return t+=''+(0,w.default)("Cancel")+" ",t+=(0,w.default)("or"),t+=' '+(0,w.default)("start over")+".",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:(0,w.default)("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=n.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this,i=e.message||(0,w.default)("An error occurred");if(e.xhr){var n=e.xhr,s=e.message;0===n.readyState&&0===n.status?i+=": "+(0,w.default)("Galaxy could not be reached and may be updating.")+(0,w.default)(" Try again in a few minutes."):n.responseJSON?i+=":
    "+JSON.stringify(n.responseJSON)+"
    ":i+=": "+s}t._showAlert(i,"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","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=s('
    ');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=e.offset(),n=e.scrollTop(),s=t-i.top,a=i.top+e.outerHeight()-t;s>=0&&s=0&&ae&&a-o','',(0,w.default)("More help"),"",'","
    ",'
    ','','',"
    "].join("")),middle:n.template(['",'
    ',"
    "].join("")),footer:n.template(['
    ','
    ','","
    ",'
    ','','
    ',(0,w.default)("Name"),":
    ","
    ","
    ",'
    ','
    ','",'
    ','",'","
    ","
    ",'
    ','","
    ","
    "].join("")),helpContent:n.template(["

    ",(0,w.default)(["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("")),"

    ","
      ","
    • ",(0,w.default)(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
    • ","
    • ",(0,w.default)(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
    • ","
    • ",(0,w.default)(["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("")),"
    • ","
    • ",(0,w.default)(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
    • ","
    • ",(0,w.default)(['Click the "Cancel" button to exit the interface.'].join("")),"
    • ","

    ","

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

    "].join("")),invalidElements:n.template([(0,w.default)("The following selections could not be included due to problems:"),"
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    "].join("")),noElementsLeft:n.template(['
  • ',(0,w.default)("No elements left! "),(0,w.default)("Would you like to "),'',(0,w.default)("start over"),"?","
  • "].join("")),invalidInitial:n.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",(0,w.default)("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",(0,w.default)("No datasets were selected"),".","<% } %>","
    ",(0,w.default)("At least one element is needed for the collection"),". ",(0,w.default)("You may need to "),'',(0,w.default)("cancel")," ",(0,w.default)("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))}),toString:function(){return"ListCollectionCreator"}}),C=function(e,t,i){var s,o=a.Deferred(),l=Galaxy.modal||new _.default.View;return t=n.defaults(t||{},{elements:e,oncancel:function(){l.hide(),o.reject("cancelled")},oncreate:function(e,t){l.hide(),o.resolve(t)}}),s=new i(t),l.show({title:t.title||(0,w.default)("Create a collection"),body:s.$el,width:"80%",height:"100%",closing_events:!0}),s.render(),window._collectionCreator=s,o},$=function(e,t){return t=t||{},t.title=(0,w.default)("Create a collection from a list of datasets"),C(e,t,x)};t.default={DatasetCollectionElementView:b,ListCollectionCreator:x,collectionCreatorModal:C,listCollectionCreatorModal:$,createListCollection:l}}).call(t,i(2),i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(60),a=n(s),o=i(107),l=n(o),r=i(3),d=(n(r),l.default.HistoryContentMixin),c=a.default.DatasetCollection,u=c.extend(d).extend({defaults:e.extend(e.clone(c.prototype.defaults),{history_content_type:"dataset_collection",model_class:"HistoryDatasetCollectionAssociation"}),save:function(e,t){return this.isNew()&&(t=t||{},t.url=this.urlRoot+this.get("history_id")+"/contents",e=e||{},e.type="dataset_collection"),c.prototype.save.call(this,e,t)},toString:function(){return"History"+c.prototype.toString.call(this)}});t.default={HistoryDatasetCollection:u}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(106),l=a(o),r=i(5),d=a(r),c=i(3),u=(a(c),{defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(t){return e.extend(t,t.object,{element_id:t.id}),delete t.object,t},constructor:function(e,t){e=this._mergeObject(e),this.idAttribute="element_id",n.Model.apply(this,arguments)},parse:function(e,t){var i=e;return i=this._mergeObject(i)}}),h=n.Model.extend(d.default.LoggableMixin).extend(u).extend({_logNamespace:"collections"}),f=n.Collection.extend(d.default.LoggableMixin).extend({_logNamespace:"collections",model:h,toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),p=l.default.DatasetAssociation.extend(d.default.mixin(u,{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:e.extend({},l.default.DatasetAssociation.prototype.defaults,u.defaults),_downloadQueryParameters:function(){var e=this.get("file_ext"),t=this.get("element_identifier");return"?to_ext="+e+"&hdca_id="+this.get("parent_hdca_id")+"&element_identifier="+t},constructor:function(e,t){this.debug("\t DatasetDCE.constructor:",e,t),u.constructor.call(this,e,t)},hasDetails:function(){return this.elements&&this.elements.length},toString:function(){this.get("element_identifier");return"DatasetDCE({objStr})"}})),m=f.extend({model:p,toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),g=n.Model.extend(d.default.LoggableMixin).extend(d.default.SearchableModelMixin).extend({_logNamespace:"collections",defaults:{collection_type:null,deleted:!1},collectionClass:function(){return this.attributes.collection_type.indexOf(":")>0?v:m},initialize:function(e,t){this.debug(this+"(DatasetCollection).initialize:",e,t,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){var t=this.collectionClass();this.debug(this+"._createElementsModel",t,this.get("elements"),this.elements);var i=this.get("elements")||[];this.unset("elements",{silent:!0});var n=this;return e.each(i,function(t,i){e.extend(t,{parent_hdca_id:n.get("id")})}),this.elements=new t(i),this.elements},toJSON:function(){var e=n.Model.prototype.toJSON.call(this);return this.elements&&(e.elements=this.elements.toJSON()),e},inReadyState:function(){var e=this.get("populated");return this.isDeletedOrPurged()||e},hasDetails:function(){return 0!==this.elements.length},getVisibleContents:function(e){return this.elements},parse:function(e,t){var i=n.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},delete:function(e){return this.get("deleted")?s.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?s.when():this.save({deleted:!1},e)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name","tags"],toString:function(){return"DatasetCollection("+[this.get("id"),this.get("name")||this.get("element_identifier")].join(",")+")"}}),_=g.extend(d.default.mixin(u,{constructor:function(e,t){this.debug("\t NestedDCDCE.constructor:",e,t),u.constructor.call(this,e,t)},toString:function(){return["NestedDCDCE(",this.object?""+this.object:this.get("element_identifier"),")"].join("")}})),v=f.extend({model:_,toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}});t.default={DatasetCollection:g}}).call(t,i(1),i(2),i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={tool:"fa-wrench",data_input:"fa-file-o",data_collection_input:"fa-folder-o",subworkflow:"fa-sitemap fa-rotate-270",pause:"fa-pause"}},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var l=i(63),r=o(l),d=i(64),c=(o(d),i(114)),u=o(c),h=i(4),f=o(h),p=i(5),m=o(p),g=i(3),_=o(g),v=e.Model.extend(m.default.LoggableMixin).extend(m.default.mixin(m.default.SearchableModelMixin,{_logNamespace:"history",UPDATE_DELAY:4e3,defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",deleted:!1,contents_active:{},contents_states:{}},urlRoot:Galaxy.root+"api/histories",contentsClass:r.default.HistoryContents,searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},initialize:function(e,t){t=t||{},this.logger=t.logger||null,this.log(this+".initialize:",e,t),this.contents=new this.contentsClass([],{history:this,historyId:this.get("id"),order:t.order}),this._setUpListeners(),this._setUpCollectionListeners(),this.updateTimeoutId=null},_setUpListeners:function(){return this.on({error:function(e,t,i,n,s){this.clearUpdateTimeout()},"change:id":function(e,t){this.contents&&(this.contents.historyId=t)}})},_setUpCollectionListeners:function(){return this.contents?this.listenTo(this.contents,{error:function(){this.trigger.apply(this,n.makeArray(arguments))}}):this},contentsShown:function(){var e=this.get("contents_active"),t=e.active||0;return t+=this.contents.includeDeleted?e.deleted:0,t+=this.contents.includeHidden?e.hidden:0},nice_size:function(){var e=this.get("size");return e?f.default.bytesToString(e,!0,2):(0,_.default)("(empty)")},toJSON:function(){return s.extend(e.Model.prototype.toJSON.call(this),{nice_size:this.nice_size()})},get:function(t){return"nice_size"===t?this.nice_size():e.Model.prototype.get.apply(this,arguments)},ownedByCurrUser:function(){return!(!Galaxy||!Galaxy.user)&&(!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.get("user_id"))},numOfUnfinishedJobs:function(){var e=this.get("non_ready_jobs");return e?e.length:0},numOfUnfinishedShownContents:function(){return this.contents.runningAndActive().length||0},_fetchContentRelatedAttributes:function(){var e=["size","non_ready_jobs","contents_active","hid_counter"];return this.fetch({data:a.param({keys:e.join(",")})})},refresh:function(e){var t=this;e=e||{};var i=this.lastUpdateTime;return this.contents.allFetched=!1,(0!==this.contents.currentPage?function(){return t.contents.fetchPage(t.contents.currentPage)}:function(){return t.contents.fetchUpdated(i)})().done(function(i,n,s){var a;try{a=new Date(s.getResponseHeader("Date"))}catch(e){}t.lastUpdateTime=a||new Date,t.checkForUpdates(e)})},checkForUpdates:function(e){var t=this;e=e||{};var i=this.UPDATE_DELAY;if(this.id){var n=function(){t.clearUpdateTimeout(),t.updateTimeoutId=setTimeout(function(){t.refresh(e)},i)};this.numOfUnfinishedShownContents()>0?n():this._fetchContentRelatedAttributes().done(function(e){t.numOfUnfinishedJobs()>0?n():t.trigger("ready")})}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},stopPolling:function(){this.clearUpdateTimeout(),this.contents&&this.contents.stopPolling()},parse:function(t,i){var n=e.Model.prototype.parse.call(this,t,i);return n.create_time&&(n.create_time=new Date(n.create_time)),n.update_time&&(n.update_time=new Date(n.update_time)),n},fetchWithContents:function(e,t){e=e||{};var i=this;return e.view="dev-detailed",this.fetch(e).then(function(e){return i.contents.history=i,i.contents.setHistoryId(e.id),i.fetchContents(t)})},fetchContents:function(e){e=e||{};var t=this;return t.lastUpdateTime=new Date,t.contents.fetchCurrentPage(e)},_delete:function(e){return this.get("deleted")?n.when():this.save({deleted:!0},e)},purge:function(e){return this.get("purged")?n.when():this.save({deleted:!0,purged:!0},e)},undelete:function(e){return this.get("deleted")?this.save({deleted:!1},e):n.when()},copy:function(e,t,i){if(e=void 0===e||e,!this.id)throw new Error("You must set the history ID before copying it.");var s={history_id:this.id};e&&(s.current=!0),t&&(s.name=t),i||(s.all_datasets=!1),s.view="dev-detailed";var a=this,o=n.post(this.urlRoot,s);return e?o.then(function(e){return new v(e).setAsCurrent().done(function(){a.trigger("copied",a,e)})}):o.done(function(e){a.trigger("copied",a,e)})},setAsCurrent:function(){var e=this,t=n.getJSON(Galaxy.root+"history/set_as_current?id="+this.id);return t.done(function(){e.trigger("set-as-current",e)}),t},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}})),y=u.default.InfinitelyScrollingCollection,w=y.extend(m.default.LoggableMixin).extend({_logNamespace:"history",model:v,order:"update_time",limitOnFirstFetch:10,limitPerFetch:10,initialize:function(e,t){t=t||{},this.log("HistoryCollection.initialize",e,t),y.prototype.initialize.call(this,e,t),this.includeDeleted=t.includeDeleted||!1,this.currentHistoryId=t.currentHistoryId,this.setUpListeners()},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot},setUpListeners:function(){return this.on({"change:deleted":function(e){this.debug("change:deleted",this.includeDeleted,e.get("deleted")),!this.includeDeleted&&e.get("deleted")&&this.remove(e)},copied:function(e,t){this.setCurrent(new v(t,[]))},"set-as-current":function(e){var t=this.currentHistoryId;this.trigger("no-longer-current",t),this.currentHistoryId=e.id}})},_buildFetchData:function(e){return s.extend(y.prototype._buildFetchData.call(this,e),{view:"dev-detailed"})},_buildFetchFilters:function(e){var t=y.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted?i.deleted=null:(i.deleted=!1,i.purged=!1),s.defaults(t,i)},fetchFirst:function(e){var t=this,i=a.when();return this.currentHistoryId&&(i=y.prototype.fetchFirst.call(t,{silent:!0,limit:1,filters:{purged:"",deleted:"","encoded_id-in":this.currentHistoryId}})),i.then(function(){return e=e||{},e.offset=0,t.fetchMore(e)})},comparators:s.extend(s.clone(y.prototype.comparators),{name:m.default.buildComparator("name",{ascending:!0}),"name-dsc":m.default.buildComparator("name",{ascending:!1}),size:m.default.buildComparator("size",{ascending:!1}),"size-asc":m.default.buildComparator("size",{ascending:!0})}),sort:function(e){e=e||{};var t=e.silent,i=this.remove(this.get(this.currentHistoryId));return y.prototype.sort.call(this,s.defaults({silent:!0},e)),this.unshift(i,{silent:!0}),t||this.trigger("sort",this,e),this},create:function(e,t,i,s){var a=this;return n.getJSON(Galaxy.root+"history/create_new_current").done(function(e){a.setCurrent(new v(e,[],i||{}))})},setCurrent:function(e,t){return t=t||{},this.unshift(e,t),this.currentHistoryId=e.get("id"),t.silent||this.trigger("new-current",e,this),this},toString:function(){return"HistoryCollection("+this.length+",current:"+this.currentHistoryId+")"}});t.default={History:v,HistoryCollection:w}}).call(t,i(2),i(0),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(114),l=a(o),r=i(115),d=a(r),c=i(59),u=a(c),h=i(64),f=a(h),p=i(253),m=a(p),g=i(5),_=a(g),v=i(116),y=a(v),w=500;try{w=localStorage.getItem("historyContentsLimitPerPageDefault")||w}catch(e){}var b=l.default.PaginatedCollection,x=b.extend(_.default.LoggableMixin).extend({_logNamespace:"history",limitPerPage:w,limitPerProgressiveFetch:w,order:"hid",urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(e,t){this.on({"sync add":this.trackJobStates}),t=t||{},b.prototype.initialize.call(this,e,t),this.history=t.history||null,this.setHistoryId(t.historyId||null),this.includeDeleted=t.includeDeleted||this.includeDeleted,this.includeHidden=t.includeHidden||this.includeHidden,this.model.prototype.idAttribute="type_id"},trackJobStates:function(){var e=this;this.each(function(t){if(!t.has("job_states_summary")&&"dataset_collection"===t.attributes.history_content_type){var i=t.attributes.job_source_type,n=t.attributes.job_source_id;if(i){e.jobStateSummariesCollection.add({id:n,model:i,history_id:e.history_id,collection_id:t.attributes.id});var s=e.jobStateSummariesCollection.get(n);t.jobStatesSummary=s}}})},model:function(e,t){return"dataset"===e.history_content_type?new d.default.HistoryDatasetAssociation(e,t):"dataset_collection"===e.history_content_type?new u.default.HistoryDatasetCollection(e,t):{validationError:"Unknown history_content_type: "+e.history_content_type}},stopPolling:function(){this.jobStateSummariesCollection&&(this.jobStateSummariesCollection.active=!1,this.jobStateSummariesCollection.clearUpdateTimeout())},setHistoryId:function(e){this.stopPolling(),this.historyId=e,e&&(this._setUpWebStorage(),this.jobStateSummariesCollection=new m.default.JobStatesSummaryCollection,this.jobStateSummariesCollection.historyId=e,this.jobStateSummariesCollection.monitor())},_setUpWebStorage:function(e){return this.storage=new f.default.HistoryPrefs({id:f.default.HistoryPrefs.historyStorageKey(this.historyId)}),this.trigger("new-storage",this.storage,this),this.on({"include-deleted":function(e){this.storage.includeDeleted(e)},"include-hidden":function(e){this.storage.includeHidden(e)}}),this.includeDeleted=this.storage.includeDeleted()||!1,this.includeHidden=this.storage.includeHidden()||!1,this},comparators:e.extend(e.clone(b.prototype.comparators),{name:_.default.buildComparator("name",{ascending:!0}),"name-dsc":_.default.buildComparator("name",{ascending:!1}),hid:_.default.buildComparator("hid",{ascending:!1}),"hid-asc":_.default.buildComparator("hid",{ascending:!0})}),running:function(){return this.filter(function(e){return!e.inReadyState()})},runningAndActive:function(){return this.filter(function(e){return!e.inReadyState()&&e.get("visible")&&!e.get("deleted")})},getByHid:function(e){return this.findWhere({hid:e})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},hidden:function(){return this.filter(function(e){return e.hidden()})},deleted:function(){return this.filter(function(e){return e.get("deleted")})},visibleAndUndeleted:function(){return this.filter(function(e){return e.get("visible")&&!e.get("deleted")})},setIncludeDeleted:function(t,i){if(e.isBoolean(t)&&t!==this.includeDeleted){if(this.includeDeleted=t,e.result(i,"silent"))return;this.trigger("include-deleted",t,this)}},setIncludeHidden:function(t,i){if(e.isBoolean(t)&&t!==this.includeHidden){if(this.includeHidden=t,i=i||{},e.result(i,"silent"))return;this.trigger("include-hidden",t,this)}},fetch:function(t){if(t=t||{},this.historyId&&!t.details){var i=f.default.HistoryPrefs.get(this.historyId).toJSON();e.isEmpty(i.expandedIds)||(t.details=e.values(i.expandedIds).join(","))}return b.prototype.fetch.call(this,t)},_buildFetchData:function(t){return e.extend(b.prototype._buildFetchData.call(this,t),{v:"dev"})},_fetchParams:b.prototype._fetchParams.concat(["v","details"]),_buildFetchFilters:function(t){var i=b.prototype._buildFetchFilters.call(this,t)||{},n={};return this.includeDeleted||(n.deleted=!1,n.purged=!1),this.includeHidden||(n.visible=!0),e.defaults(i,n)},getTotalItemCount:function(){return this.history.contentsShown()},fetchUpdated:function(e,t){return e&&(t=t||{filters:{}},t.remove=!1,t.filters={"update_time-ge":e.toISOString(),visible:""}),this.fetch(t)},fetchDeleted:function(t){var i=this;return t=t||{},t.filters=e.extend(t.filters,{deleted:!0,purged:void 0}),t.remove=!1,this.trigger("fetching-deleted",this),this.fetch(t).always(function(){i.trigger("fetching-deleted-done",i)})},fetchHidden:function(t){t=t||{};var i=this;return t.filters=e.extend(t.filters,{visible:!1}),t.remove=!1,i.trigger("fetching-hidden",i),i.fetch(t).always(function(){i.trigger("fetching-hidden-done",i)})},fetchAllDetails:function(t){t=t||{};var i={details:"all"};return t.data=e.extend(t.data||{},i),this.fetch(t)},_filterAndUpdate:function(e,t){var i=this,n=i.model.prototype.idAttribute,s=[t];return i.fetch({filters:e,remove:!1}).then(function(e){return e=e.reduce(function(e,t,s){var a=i.get(t[n]);return a?e.concat(a):e},[]),i.ajaxQueue("save",s,e)})},ajaxQueue:function(t,i,n){return n=n||this.models,new y.default.AjaxQueue(n.slice().reverse().map(function(n,s){var a=e.isString(t)?n[t]:t;return function(){return a.apply(n,i)}})).deferred},progressivelyFetchDetails:function(t){function i(n){n=n||0;var l=e.extend(e.clone(t),{view:"summary",keys:r,limit:o,offset:n,reset:0===n,remove:!1});e.defer(function(){a.fetch.call(a,l).fail(s.reject).done(function(e){s.notify(e,o,n),e.length!==o?(a.allFetched=!0,s.resolve(e,o,n)):i(n+o)})})}t=t||{};var s=n.Deferred(),a=this,o=t.limitPerCall||a.limitPerProgressiveFetch,l=d.default.HistoryDatasetAssociation.prototype.searchAttributes,r=l.join(",");return i(),s},isCopyable:function(t){var i=["HistoryDatasetAssociation","HistoryDatasetCollectionAssociation"];return e.isObject(t)&&t.id&&e.contains(i,t.model_class)},copy:function(t){var i,s,a;e.isString(t)?(i=t,a="hda",s="dataset"):(i=t.id,a={HistoryDatasetAssociation:"hda",LibraryDatasetDatasetAssociation:"ldda",HistoryDatasetCollectionAssociation:"hdca"}[t.model_class]||"hda",s="hdca"===a?"dataset_collection":"dataset");var o=this,l=n.ajax(this.url(),{method:"POST",contentType:"application/json",data:JSON.stringify({content:i,source:a,type:s})}).done(function(e){o.add([e],{parse:!0})}).fail(function(e,t,n){o.trigger("error",o,l,{},"Error copying contents",{type:s,id:i,source:a})});return l},createHDCA:function(e,t,i,n,s){return this.model({history_content_type:"dataset_collection",collection_type:t,history_id:this.historyId,name:i,hide_source_items:n||!1,element_identifiers:e}).save(s)},haveSearchDetails:function(){return this.allFetched&&this.all(function(t){return e.has(t.attributes,"annotation")})},matches:function(e){return this.filter(function(t){return t.matches(e)})},clone:function(){var e=s.Collection.prototype.clone.call(this);return e.historyId=this.historyId,e},toString:function(){return["HistoryContents(",[this.historyId,this.length].join(),")"].join("")}});t.default={HistoryContents:x}}).call(t,i(1),i(0),i(2))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:!1,show_hidden:!1},addExpanded:function(e){var t=this.get("expandedIds");t[e.id]=e.get("id"),this.save("expandedIds",t)},removeExpanded:function(e){var t=this.get("expandedIds");delete t[e.id],this.save("expandedIds",t)},isExpanded:function(t){return e.result(this.get("expandedIds"),t,!1)},allExpanded:function(){return e.values(this.get("expandedIds"))},clearExpanded:function(){this.set("expandedIds",{})},includeDeleted:function(t){return e.isUndefined(t)||this.set("show_deleted",t),this.get("show_deleted")},includeHidden:function(t){return e.isUndefined(t)||this.set("show_hidden",t),this.get("show_hidden")},toString:function(){return"HistoryPrefs("+this.id+")"}},{storageKeyPrefix:"history:",historyStorageKey:function(e){if(!e)throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+e);return a.storageKeyPrefix+e},get:function(e){return new a({id:a.historyStorageKey(e)})},clearAll:function(e){for(var t in sessionStorage)0===t.indexOf(a.storageKeyPrefix)&&sessionStorage.removeItem(t)}});t.default={HistoryPrefs:a}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var l=i(5),r=o(l),d=i(3),c=(o(d),e.View.extend(r.default.LoggableMixin).extend({_logNamespace:"list",initialize:function(e){this.expanded=e.expanded||!1,this.log("\t expanded:",this.expanded),this.fxSpeed=void 0!==e.fxSpeed?e.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(e){var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){var e=n(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(e).replaceWith(this._renderDetails().show()),e},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;0===t?(i._swapNewRender(e),i.trigger("rendered",i)):n(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",s.isFunction(this.className)?this.className():this.className).append(e.children())},_setUpBehaviors:function(e){e=e||this.$el,e.find("[title]").tooltip({placement:"bottom"})},$details:function(e){return e=e||this.$el,e.find("> .details")},_renderDetails:function(){var e=n(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(e),e},toggleExpanded:function(e){return e=void 0===e?!this.expanded:e,e?this.expand():this.collapse(),this},expand:function(){var e=this;return e._fetchModelDetails().always(function(){e._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?a.when():this.model.fetch()},_expand:function(){var e=this,t=e._renderDetails();e.$details().replaceWith(t),e.expanded=!0,e.$details().slideDown(e.fxSpeed,function(){e.trigger("expanded",e)})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var e=this;e.expanded=!1,this.$details().slideUp(e.fxSpeed,function(){e.trigger("collapsed",e)})}})),u=c.extend(r.default.mixin(r.default.SelectableViewMixin,r.default.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(e){c.prototype.initialize.call(this,e),r.default.SelectableViewMixin.initialize.call(this,e),r.default.DraggableViewMixin.initialize.call(this,e),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(e){e?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var e=c.prototype._buildNewRender.call(this);return e.children(".warnings").replaceWith(this._renderWarnings()),e.children(".title-bar").replaceWith(this._renderTitleBar()),e.children(".primary-actions").append(this._renderPrimaryActions()),e.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),e},_swapNewRender:function(e){return c.prototype._swapNewRender.call(this,e),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var e=this,t=n('
    '),i=e.model.toJSON();return s.each(e.templates.warnings,function(s){t.append(n(s(i,e)))}),t},_renderTitleBar:function(){return n(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return n(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation(),e.altKey?(this.toggleSelect(e),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(e){return!e||"keydown"!==e.type||32!==e.keyCode&&13!==e.keyCode||(this.toggleExpanded(),e.stopPropagation(),!1)},toString:function(){return"ListItemView("+(this.model?""+this.model:"(no model)")+")"}}));u.prototype.templates=function(){return{el:r.default.wrapTemplate(['
    ','
    ','
    ','',"
    ",'
    ','
    ','
    ',"
    "]),warnings:{},titleBar:r.default.wrapTemplate(['
    ','','
    ','<%- element.name %>',"
    ",'
    ',"
    "],"element"),subtitle:r.default.wrapTemplate(['
    ']),details:r.default.wrapTemplate(['
    '])}}();var h=u.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(e){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=e.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=e.foldoutPanelClass||this.foldoutPanelClass,u.prototype.initialize.call(this,e),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return n();var e=u.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,e)},_createFoldoutPanel:function(){var e=this.model,t=this._getFoldoutPanelClass(e),i=this._getFoldoutPanelOptions(e);return new t(s.extend(i,{model:e}))},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(e,t){return t=t||this.$("> .details"),this.foldout=e.render(0),e.$("> .controls").hide(),t.append(e.$el)},expand:function(){var e=this;return e._fetchModelDetails().always(function(){"foldout"===e.foldoutStyle?e._expand():"drilldown"===e.foldoutStyle&&e._expandByDrilldown()})},_expandByDrilldown:function(){var e=this;e.listenTo(e.foldout,"close",function(){e.trigger("collapsed:drilldown",e,e.foldout)}),e.trigger("expanded:drilldown",e,e.foldout)}});h.prototype.templates=function(){var e=r.default.wrapTemplate(['
    ',"
    "],"collection");return s.extend({},u.prototype.templates,{details:e})}(),t.default={ExpandableView:c,ListItemView:u,FoldoutListItemView:h}}).call(t,i(2),i(0),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var l=i(65),r=o(l),d=i(16),c=o(d),u=i(21),h=o(u),f=i(5),p=o(f),m=i(3),g=o(m),_=r.default.ListItemView,v=_.extend({_logNamespace:"dataset",className:_.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log(this+".initialize:",e),_.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_setUpListeners:function(){_.prototype._setUpListeners.call(this);var t=this;return t.listenTo(t.model,{change:function(i){t.model.changedAttributes().state&&t.model.inReadyState()&&t.expanded&&!t.model.hasDetails()?t.model.fetch({silent:!0}).done(function(){t.render()}):e.has(i.changed,"tags")&&1===e.keys(i.changed).length?t.$(".nametags").html(t._renderNametags()):t.render()}})},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):n.when()},remove:function(e,t){var i=this;e=e||this.fxSpeed,this.$el.fadeOut(e,function(){s.View.prototype.remove.call(i),t&&t.call(i)})},_swapNewRender:function(e){return _.prototype._swapNewRender.call(this,e),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var e=this.model.get("state");if(e===c.default.NOT_VIEWABLE||e===c.default.DISCARDED||!this.model.get("accessible"))return null;var t={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))t.disabled=!0,t.title=(0,g.default)("Cannot display datasets removed from disk");else if(e===c.default.UPLOAD)t.disabled=!0,t.title=(0,g.default)("This dataset must finish uploading before it can be viewed");else if(e===c.default.NEW)t.disabled=!0,t.title=(0,g.default)("This dataset is not yet viewable");else{t.title=(0,g.default)("View data"),t.href=this.model.urls.display;var i=this;t.onclick=function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(i.model.get("id")),e.preventDefault())}}return t.faIcon="fa-eye",(0,h.default)(t)},_renderDetails:function(){if(this.model.get("state")===c.default.NOT_VIEWABLE)return a(this.templates.noAccess(this.model.toJSON(),this));var e=_.prototype._renderDetails.call(this);return e.find(".actions .left").empty().append(this._renderSecondaryActions()),e.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),e.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(e),e},_renderSummary:function(){var e=this.model.toJSON(),t=this.templates.summaries[e.state];return(t=t||this.templates.summaries.unknown)(e,this)},_renderDetailMessages:function(){var t=this,i=a('
    '),n=t.model.toJSON();return e.each(t.templates.detailMessages,function(e){i.append(a(e(n,t)))}),i},_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 c.default.NOT_VIEWABLE:return[];case c.default.OK:case c.default.FAILED_METADATA:case c.default.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return(0,h.default)({title:(0,g.default)("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle",onclick:function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:(0,g.default)("Dataset details"),url:this.href}),e.preventDefault(),e.stopPropagation())}})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:e.isEmpty(this.model.get("meta_files"))?a(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var t=this.model.urls;return a(['"].join("\n"))},_renderNametags:function(){return e.template(["<% _.each(_.sortBy(_.uniq(tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<%- tag.slice(5) %>',"<% } %>","<% }); %>"].join(""))({tags:this.model.get("tags")})},events:e.extend(e.clone(_.prototype.events),{"click .display-btn":function(e){this.trigger("display",this,e)},"click .params-btn":function(e){this.trigger("params",this,e)},"click .download-btn":function(e){this.trigger("download",this,e)}}),toString:function(){return"DatasetListItemView("+(this.model?""+this.model:"(no model)")+")"}});v.prototype.templates=function(){var t=e.extend({},_.prototype.templates.warnings,{failed_metadata:p.default.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','
    ',(0,g.default)("An error occurred setting the metadata for this dataset"),"
    ","<% } %>"]),error:p.default.wrapTemplate(["<% if( model.error ){ %>",'
    ',(0,g.default)("There was an error getting the data for this dataset"),": <%- model.error %>","
    ","<% } %>"]),purged:p.default.wrapTemplate(["<% if( model.purged ){ %>",'
    ',(0,g.default)("This dataset has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:p.default.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',(0,g.default)("This dataset has been deleted"),"
    ","<% } %>"])}),i=p.default.wrapTemplate(['
    ','
    ','
    ','
    ','
    ',"
    ","<% if( !dataset.deleted && !dataset.purged ){ %>",'
    ','
    ','
    ',"<% if( dataset.peek ){ %>",'
    <%= dataset.peek %>
    ',"<% } %>","<% } %>","
    "],"dataset"),n=p.default.wrapTemplate(['
    ','
    ',(0,g.default)("You do not have permission to view this dataset"),"
    ","
    "],"dataset"),s={};s[c.default.OK]=s[c.default.FAILED_METADATA]=p.default.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"),s[c.default.NEW]=p.default.wrapTemplate(["
    ",(0,g.default)("This is a new dataset and not all of its data are available yet"),"
    "],"dataset"),s[c.default.NOT_VIEWABLE]=p.default.wrapTemplate(["
    ",(0,g.default)("You do not have permission to view this dataset"),"
    "],"dataset"),s[c.default.DISCARDED]=p.default.wrapTemplate(["
    ",(0,g.default)("The job creating this dataset was cancelled before completion"),"
    "],"dataset"),s[c.default.QUEUED]=p.default.wrapTemplate(["
    ",(0,g.default)("This job is waiting to run"),"
    "],"dataset"),s[c.default.RUNNING]=p.default.wrapTemplate(["
    ",(0,g.default)("This job is currently running"),"
    "],"dataset"),s[c.default.UPLOAD]=p.default.wrapTemplate(["
    ",(0,g.default)("This dataset is currently uploading"),"
    "],"dataset"),s[c.default.SETTING_METADATA]=p.default.wrapTemplate(["
    ",(0,g.default)("Metadata is being auto-detected"),"
    "],"dataset"),s[c.default.PAUSED]=p.default.wrapTemplate(["
    ",(0,g.default)('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"
    "],"dataset"),s[c.default.ERROR]=p.default.wrapTemplate(["<% if( !dataset.purged ){ %>","
    <%- dataset.misc_blurb %>
    ","<% } %>",'',(0,g.default)("An error occurred with this dataset"),":",'
    <%- dataset.misc_info %>
    '],"dataset"),s[c.default.EMPTY]=p.default.wrapTemplate(["
    ",(0,g.default)("No data"),": <%- dataset.misc_blurb %>
    "],"dataset"),s.unknown=p.default.wrapTemplate(['
    Error: unknown dataset state: "<%- dataset.state %>"
    '],"dataset");var a={resubmitted:p.default.wrapTemplate(["<% if( model.resubmitted ){ %>",'
    ',(0,g.default)("The job creating this dataset has been resubmitted"),"
    ","<% } %>"])},o=p.default.wrapTemplate(["<% _.each( apps, function( app ){ %>",'
    ','<%- app.label %> ','',"<% _.each( app.links, function( link ){ %>",'',"<% print( _l( link.text ) ); %>"," ","<% }); %>","","
    ","<% }); %>"],"apps");return e.extend({},_.prototype.templates,{warnings:t,details:i,noAccess:n,summaries:s,detailMessages:a,displayApplications:o})}(),t.default={DatasetListItemView:v}}).call(t,i(1),i(0),i(2),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(65),l=a(o),r=i(66),d=a(r),c=i(5),u=a(c),h=i(3),f=a(h),p=l.default.FoldoutListItemView,m=l.default.ListItemView,g=p.extend({className:p.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(e){this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,p.prototype.initialize.call(this,e)},_setUpListeners:function(){p.prototype._setUpListeners.call(this),this.listenTo(this.model,"change",function(t,i){e.has(t.changed,"deleted")?this.render():e.has(t.changed,"element_count")&&this.$("> .title-bar .subtitle").replaceWith(this._renderSubtitle())})},_renderSubtitle:function(){return n(this.templates.subtitle(this.model.toJSON(),this))},_getFoldoutPanelOptions:function(){var t=p.prototype._getFoldoutPanelOptions.call(this);return e.extend(t,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){return"DCListItemView("+(this.model?""+this.model:"(no model)")+")"}});g.prototype.templates=function(){var t=e.extend({},p.prototype.templates.warnings,{error:u.default.wrapTemplate(["<% if( model.error ){ %>",'
    ',(0,f.default)("There was an error getting the data for this collection"),": <%- model.error %>","
    ","<% } %>"]),purged:u.default.wrapTemplate(["<% if( model.purged ){ %>",'
    ',(0,f.default)("This collection has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:u.default.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',(0,f.default)("This collection has been deleted"),"
    ","<% } %>"])}),i=u.default.wrapTemplate(['
    ','
    ','<%- collection.element_identifier || collection.name %>',"
    ",'
    ',"
    "],"collection"),n=u.default.wrapTemplate(['
    ','<% var countText = collection.element_count? ( collection.element_count + " " ) : ""; %>','<% if( collection.collection_type === "list" ){ %>',(0,f.default)("a list of <%- countText %>datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',(0,f.default)("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',(0,f.default)("a list of <%- countText %>dataset pairs"),'<% } else if( collection.collection_type === "list:list" ){ %>',(0,f.default)("a list of <%- countText %>dataset lists"),"<% } %>","
    "],"collection");return e.extend({},p.prototype.templates,{warnings:t,titleBar:i,subtitle:n})}();var _=m.extend({className:m.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DCEListItemView.initialize:",e),m.prototype.initialize.call(this,e)},toString:function(){return"DCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});_.prototype.templates=function(){var t=u.default.wrapTemplate(['
    ','
    ','<%- element.element_identifier %>',"
    ",'
    ',"
    "],"element");return e.extend({},m.prototype.templates,{titleBar:t})}();var v=d.default.DatasetListItemView.extend({className:d.default.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DatasetDCEListItemView.initialize:",e),d.default.DatasetListItemView.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):s.when()},toString:function(){return"DatasetDCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});v.prototype.templates=function(){var t=u.default.wrapTemplate(['
    ','','
    ','<%- element.element_identifier %>',"
    ","
    "],"element");return e.extend({},d.default.DatasetListItemView.prototype.templates,{titleBar:t})}();var y=g.extend({className:g.prototype.className+" dataset-collection-element",_swapNewRender:function(e){g.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){return"NestedDCDCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});t.default={DCListItemView:g,DCEListItemView:_,DatasetDCEListItemView:v,NestedDCDCEListItemView:y}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(11),o=s(a),l=i(6),r=s(l),d=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement("
    "),this.render()},render:function(){var e=this;n.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(t){var i=n.extend({},e.model.attributes,t),s=new o.default({title:i.title,message:i.message,status:i.status||"warning",icon:i.icon,initial_errors:!0,errors:i.errors,inputs:i.inputs,buttons:{submit:new r.default.Button({tooltip:i.submit_tooltip,title:i.submit_title||"Save",icon:i.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){e._submit(s)}})}});e.$el.empty().append(s.$el)}).fail(function(t){e.$el.empty().append(new r.default.Message({message:"Failed to load resource "+e.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;n.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(i){var s={};i.id?s.id=i.id:s={message:i.message,status:"success",persistent:!1},t.redirect?window.location=Galaxy.root+t.redirect+"?"+n.param(s):(e.data.matchModel(i,function(t,i){e.field_list[i].value(t.value)}),t._showMessage(e,success_message))}).fail(function(i){t._showMessage(e,{message:i.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){e.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(n(this).css("overflow"))}).first().animate({scrollTop:0},500),e.message.update(t)}});t.default={View:d}}).call(t,i(2),i(0))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(16),l=a(o),r=i(5),d=a(r),c=i(3),u=a(c),h=d.default.SearchableModelMixin,f=e.Model.extend(d.default.LoggableMixin).extend(d.default.mixin(h,{_logNamespace:"dataset",defaults:{state:l.default.NEW,deleted:!1,purged:!1,name:"(unnamed dataset)",accessible:!0,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(e,t){this.debug(this+"(Dataset).initialize",e,t), //!! this state is not in trans.app.model.Dataset.states - set it here - -this.get("accessible")||this.set("state",r.default.NOT_VIEWABLE),this.urls=this._generateUrls(),this._setUpListeners()},_generateUrls:function(){var e=this.get("id");if(!e)return{};var t={purge:"datasets/"+e+"/purge_async",display:"datasets/"+e+"/display/?preview=True",edit:"datasets/edit?dataset_id="+e,download:"datasets/"+e+"/display"+this._downloadQueryParameters(),report_error:"dataset/errors?id="+e,rerun:"tool_runner/rerun?id="+e,show_params:"datasets/"+e+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+e+"&metadata_name="};return n.each(t,function(e,i){t[i]=Galaxy.root+e}),this.urls=t,t},_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")},_setUpListeners:function(){this.on("change:state",function(e,t){this.log(this+" has changed state:",e,t),this.inReadyState()&&this.trigger("state:ready",e,t,this.previous("state"))}),this.on("change:id change:file_ext",function(e){this._generateUrls()})},toJSON:function(){var t=e.Model.prototype.toJSON.call(this);return n.extend(t,{urls:this.urls})},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},inReadyState:function(){var e=n.contains(r.default.READY_STATES,this.get("state"));return this.isDeletedOrPurged()||e},hasDetails:function(){return!this.get("accessible")||this.has("annotation")},hasData:function(){return this.get("file_size")>0},fetch:function(t){var i=this;return e.Model.prototype.fetch.call(this,t).always(function(){i._generateUrls()})},parse:function(t,i){var n=e.Model.prototype.parse.call(this,t,i);return n.create_time&&(n.create_time=new Date(n.create_time)),n.update_time&&(n.update_time=new Date(n.update_time)),n},save:function(t,i){return i=i||{},i.wait=!!n.isUndefined(i.wait)||i.wait,e.Model.prototype.save.call(this,t,i)},delete:function(e){return this.get("deleted")?s.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?s.when():this.save({deleted:!1},e)},purge:function(e){if(this.get("purged"))return s.when();e=e||{},e.url=this.urls.purge;var t=this,i=s.ajax(e);return i.done(function(e,i,n){t.set({deleted:!0,purged:!0})}),i.fail(function(i,n,s){var a=(0,u.default)("Unable to purge dataset");i.responseJSON&&i.responseJSON.error?a=i.responseJSON.error:-1!==i.responseText.indexOf("Removal of datasets by users is not allowed in this Galaxy instance")&&(a="Removal of datasets by users is not allowed in this Galaxy instance"),i.responseText=a,t.trigger("error",t,i,e,(0,u.default)(a),{error:a})}),i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var e=this.get("id")||"";return this.get("name")&&(e='"'+this.get("name")+'",'+e),"Dataset("+e+")"}})),p=e.Collection.extend(d.default.LoggableMixin).extend({_logNamespace:"dataset",model:f,urlRoot:Galaxy.root+"api/datasets",url:function(){return this.urlRoot},ids:function(){return this.map(function(e){return e.get("id")})},notReady:function(){return this.filter(function(e){return!e.inReadyState()})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},ajaxQueue:function(e,t){var i=s.Deferred(),n=this.length,a=[];if(!n)return i.resolve([]),i;var o=this.chain().reverse().map(function(s,r){return function(){var l=e.call(s,t);l.done(function(e){i.notify({curr:r,total:n,response:e,model:s})}),l.always(function(e){a.push(e),o.length?o.shift()():i.resolve(a)})}}).value();return o.shift()(),i},matches:function(e){return this.filter(function(t){return t.matches(e)})},toString:function(){return["DatasetAssociationCollection(",this.length,")"].join("")}});t.default={DatasetAssociation:f,DatasetAssociationCollection:p}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(16),a=(n(s),i(5)),o=(n(a),i(4)),r=(n(o),1e3);try{r=localStorage.getItem("collectionFuzzyCountDefault")||r}catch(e){}var l={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",hidden:function(){return!this.get("visible")},isVisible:function(e,t){var i=!0;return e||!this.get("deleted")&&!this.get("purged")||(i=!1),t||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var e=this.get("history_content_type"),t=this.get("history_id"),i=this.get("id"),n=""+this.urlRoot+t+"/contents/"+e+"s/"+i;return"dataset_collection"==e&&(n=n+"?view=element-reference&fuzzy_count="+r),n},hide:function(t){return this.get("visible")?this.save({visible:!1},t):e.when()},unhide:function(t){return this.get("visible")?e.when():this.save({visible:!0},t)},toString:function(){return[this.get("type_id"),this.get("hid"),this.get("name")].join(":")}};t.default={HistoryContentMixin:l}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i={_validationWarning:function(e,t){"name"===e&&(e=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),t?(e=e||this.$(".validation-warning"),e.removeClass("validation-warning")):e.addClass("validation-warning")},_changeHideOriginals:function(e){this.hideOriginals=this.$(".hide-originals").prop("checked")},_changeName:function(e){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(e){13!==e.keyCode||this.blocking||this._clickCreate()},_getName:function(){return e.escape(this.$(".collection-name").val())},_clickMoreHelp:function(e){e.stopPropagation(),this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(e){e.stopPropagation(),this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_toggleHelp:function(e){e.stopPropagation(),this.$(".main-help").toggleClass("expanded"),this.$(".more-help").toggle()},_showAlert:function(e,t){t=t||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(t).show().find(".alert-message").html(e)},_hideAlert:function(e){this.$(".main-help").show(),this.$(".header .alert").hide()},_cancelCreate:function(e){"function"==typeof this.oncancel&&this.oncancel.call(this)},_clickCreate:function(e){var t=this._getName();t?this.blocking||this.createList(t):this._validationWarning("name")},_setUpCommonSettings:function(e){this.hideOriginals=e.defaultHideSourceItems||!1},_renderFooter:function(t,i){var n=this,s=this.$(".footer").empty().html(this.templates.footer());return e.each(this.footerSettings,function(e,t){n.$(t).prop("checked",n[e])}),"function"==typeof this.oncancel&&this.$(".cancel-create.btn").show(),s},_creatorTemplates:{main:e.template(['
    ','
    ',''].join(""))}};t.default={CollectionCreatorMixin:i}}).call(t,i(1))},function(e,t,i){"use strict";function n(e,t){var i=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",s=t.toString().toLowerCase()||"",a=String.fromCharCode(0),o=n.replace(i,a+"$1"+a).split(a),r=s.replace(i,a+"$1"+a).split(a),l=new Date(n).getTime(),d=l?new Date(s).getTime():null;if(d){if(ld)return 1}for(var c,u,h=0,f=Math.max(o.length,r.length);hu)return 1}return 0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,i){"use strict";var n=i(0),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default;s.default.fn.extend({hoverhighlight:function(e,t){return e=e||"body",this.length?(a(this).each(function(){var i=a(this),n=i.data("target");n&&i.mouseover(function(i){a(n,e).css({background:t})}).mouseout(function(e){a(n).css({background:""})})}),this):this}})},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=a(o),l=i(87),d=a(l),c=i(6),u=a(c),h=i(11),f=a(h),p=i(90),m=a(p),g=i(45),_=a(g),v=i(8),y=a(v),w=i(34),b=a(w),x=i(61),C=a(x),$=e.View.extend({initialize:function(t){var i=this;this.modal=parent.Galaxy.modal||new y.default.View,this.model=t&&t.model||new e.Model(t),this.deferred=new d.default,this.setElement(n("
    ").addClass("ui-form-composite").append(this.$message=n("
    ")).append(this.$header=n("
    ")).append(this.$steps=n("
    "))),n("body").append(this.$el),this._configure(),this.render(),n(window).resize(function(){i._refresh()})},_refresh:function(e){var t=s.reduce(this.$el.children(),function(e,t){return e+n(t).outerHeight()},0)-this.$steps.height()+90;this.$steps.css("height",n(window).height()-t)},_configure:function(){function e(e,n){for(var s,a=/\$\{(.+?)\}/g;s=a.exec(String(e));){var o=s[1];n(t.wp_inputs[o]=t.wp_inputs[o]||{label:o,name:o,type:"text",color:"hsl( "+100*++i+", 70%, 30% )",style:"ui-form-wp-source",links:[]})}}var t=this;this.forms=[],this.steps=[],this.links=[],this.parms=[],s.each(this.model.get("steps"),function(e,i){Galaxy.emit.debug("tool-form-composite::initialize()",i+" : Preparing workflow step.");var n=C.default[e.step_type],a=parseInt(i+1)+": "+(e.step_label||e.step_name);e.annotation&&(a+=" - "+e.annotation),e.step_version&&(a+=" (Galaxy Version "+e.step_version+")"),e=r.default.merge({index:i,fixed_title:s.escape(a),icon:n||"",help:null,citations:null,collapsible:!0,collapsed:i>0&&!t._isDataStep(e),sustain_version:!0,sustain_repeats:!0,sustain_conditionals:!0,narrow:!0,text_enable:"Edit",text_disable:"Undo",cls_enable:"fa fa-edit",cls_disable:"fa fa-undo",errors:e.messages,initial_errors:!0,cls:"ui-portlet-narrow",hide_operations:!0,needs_refresh:!1,always_refresh:"tool"!=e.step_type},e),t.steps[i]=e,t.links[i]=[],t.parms[i]={}}),s.each(this.steps,function(e,i){m.default.visitInputs(e.inputs,function(e,n){t.parms[i][n]=e})}),s.each(this.steps,function(e,i){s.each(e.output_connections,function(e){s.each(t.steps,function(n,s){n.step_index===e.input_step_index&&t.links[i].push(n)})})}),s.each(this.steps,function(e,i){s.each(t.steps,function(n,a){var o={};s.each(e.output_connections,function(e){n.step_index===e.input_step_index&&(o[e.input_name]=e)}),s.each(t.parms[a],function(t,n){var s=o[n];s&&(t.type="hidden",t.help=t.step_linked?t.help+", ":"",t.help+="Output dataset '"+s.output_name+"' from step "+(parseInt(i)+1),t.step_linked=t.step_linked||[],t.step_linked.push(e))})})});var i=0;this.wp_inputs={},s.each(this.steps,function(i,n){s.each(t.parms[n],function(t,n){e(t.value,function(e){e.links.push(i),t.wp_linked=!0,t.type="text",t.backdrop=!0,t.style="ui-form-wp-target"})}),s.each(i.post_job_actions,function(t){s.each(t.action_arguments,function(t){e(t,function(){})})})}),s.each(this.steps,function(e,i){if("tool"==e.step_type){var n=!0;m.default.visitInputs(e.inputs,function(i,s,a){var o=i.value&&"RuntimeValue"==i.value.__class__,l=-1!=["data","data_collection"].indexOf(i.type),d=a[i.data_ref];i.step_linked&&!t._isDataStep(i.step_linked)&&(n=!1),i.options&&(0==i.options.length&&!n||i.wp_linked)&&(i.is_workflow=!0),d&&(i.is_workflow=d.step_linked&&!t._isDataStep(d.step_linked)||i.wp_linked),(l||i.value&&"RuntimeValue"==i.value.__class__&&!i.step_linked)&&(e.collapsed=!1),o&&(i.value=i.default_value),i.flavor="workflow",o||l||"hidden"===i.type||i.wp_linked||(i.optional||!r.default.isEmpty(i.value)&&""!==i.value)&&(i.collapsible_value=i.value,i.collapsible_preview=!0)})}})},render:function(){var e=this;this.deferred.reset(),this._renderHeader(),this._renderMessage(),this._renderParameters(),this._renderHistory(),s.each(this.steps,function(t){e._renderStep(t)})},_renderHeader:function(){var e=this;this.execute_btn=new u.default.Button({icon:"fa-check",title:"Run workflow",cls:"btn btn-primary",onclick:function(){e._execute()}}),this.$header.addClass("ui-form-header").empty().append(new u.default.Label({title:"Workflow: "+this.model.get("name")}).$el).append(this.execute_btn.$el)},_renderMessage:function(){this.$message.empty(),this.model.get("has_upgrade_messages")&&this.$message.append(new u.default.Message({message:"Some tools in this workflow may have changed since it was last saved or some errors were found. The workflow may still run, but any new options will have default values. Please review the messages below to make a decision about whether the changes will affect your analysis.",status:"warning",persistent:!0,fade:!1}).$el);var e=this.model.get("step_version_changes");e&&e.length>0&&this.$message.append(new u.default.Message({message:"Some tools are being executed with different versions compared to those available when this workflow was last saved because the other versions are not or no longer available on this Galaxy instance. To upgrade your workflow and dismiss this message simply edit the workflow and re-save it.",status:"warning",persistent:!0,fade:!1}).$el)},_renderParameters:function(){var e=this;this.wp_form=null,s.isEmpty(this.wp_inputs)||(this.wp_form=new f.default({title:"Workflow Parameters",inputs:this.wp_inputs,cls:"ui-portlet-narrow",onchange:function(){s.each(e.wp_form.input_list,function(t,i){s.each(t.links,function(t){e._refreshStep(t)})})}}),this._append(this.$steps.empty(),this.wp_form.$el))},_renderHistory:function(){this.history_form=new f.default({cls:"ui-portlet-narrow",title:"History Options",inputs:[{type:"conditional",name:"new_history",test_param:{name:"check",label:"Send results to a new history",type:"boolean",value:"false",help:""},cases:[{value:"true",inputs:[{name:"name",label:"History name",type:"text",value:this.model.get("name")}]}]}]}),this._append(this.$steps,this.history_form.$el)},_renderStep:function(e){var t=this,i=null;this.deferred.execute(function(a){if(t.$steps.addClass("ui-steps"),"tool"==e.step_type)e.postchange=function(t,i){var s={tool_id:e.id,tool_version:e.version,inputs:n.extend(!0,{},i.data.create())};i.wait(!0),Galaxy.emit.debug("tool-form-composite::postchange()","Sending current state.",s),r.default.request({type:"POST",url:Galaxy.root+"api/tools/"+e.id+"/build",data:s,success:function(e){i.update(e),i.wait(!1),Galaxy.emit.debug("tool-form-composite::postchange()","Received new model.",e),t.resolve()},error:function(e){Galaxy.emit.debug("tool-form-composite::postchange()","Refresh request failed.",e),t.reject()}})},i=new _.default(e),e.post_job_actions&&e.post_job_actions.length&&i.portlet.append(n("
    ").addClass("ui-form-element-disabled").append(n("
    ").addClass("ui-form-title").html("Job Post Actions")).append(n("
    ").addClass("ui-form-preview").html(s.reduce(e.post_job_actions,function(e,t){return e+" "+t.short_str},""))));else{var o=-1!=["data_input","data_collection_input"].indexOf(e.step_type);s.each(e.inputs,function(e){e.flavor="module",e.hide_label=o}),i=new f.default(r.default.merge({title:e.fixed_title,onchange:function(){s.each(t.links[e.index],function(e){t._refreshStep(e)})},inputs:e.inputs&&e.inputs.length>0?e.inputs:[{type:"hidden",name:"No options available.",ignore:null}]},e))}t.forms[e.index]=i,t._append(t.$steps,i.$el),t._refresh(),e.needs_refresh&&t._refreshStep(e),i.portlet[t.show_progress?"disable":"enable"](),t.show_progress&&t.execute_btn.model.set({wait:!0,wait_text:"Preparing...",percentage:100*(e.index+1)/t.steps.length}),Galaxy.emit.debug("tool-form-composite::initialize()",e.index+" : Workflow step state ready.",e),setTimeout(function(){a.resolve()},0)})},_refreshStep:function(e){var t=this,i=this.forms[e.index];i?(s.each(t.parms[e.index],function(e,n){if(e.step_linked||e.wp_linked){var a=i.field_list[i.data.match(n)];if(a){var o=void 0;if(e.step_linked)o={values:[]},s.each(e.step_linked,function(e){if(t._isDataStep(e)){var i=t.forms[e.index].data.create().input;i&&s.each(i.values,function(e){o.values.push(e)})}}),!e.multiple&&o.values.length>0&&(o={values:[o.values[0]]});else if(e.wp_linked){o=e.value;for(var r,l=/\$\{(.+?)\}/g;r=l.exec(e.value);){var d=t.wp_form.field_list[t.wp_form.data.match(r[1])],c=d&&d.value();c&&(o=o.split(r[0]).join(c))}}void 0!==o&&a.value(o)}}}),i.trigger("change")):e.needs_refresh=!0},_refreshHistory:function(){var e=this,t=parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.model;this._refresh_history&&clearTimeout(this._refresh_history),t&&t.refresh().success(function(){0===t.numOfUnfinishedShownContents()&&(e._refresh_history=setTimeout(function(){e._refreshHistory()},t.UPDATE_DELAY))})},_execute:function(){var e=this;this.show_progress=!0,this._enabled(!1),this.deferred.execute(function(t){setTimeout(function(){t.resolve(),e._submit()},0)})},_submit:function(){var e=this,t=this.history_form.data.create(),i={new_history_name:t["new_history|name"]?t["new_history|name"]:null,history_id:t["new_history|name"]?null:this.model.get("history_id"),replacement_params:this.wp_form?this.wp_form.data.create():{},parameters:{},parameters_normalized:!0,batch:!0},s=!0;for(var a in this.forms){var o=this.forms[a],l=o.data.create(),d=e.steps[a],c=d.step_index;o.trigger("reset");for(var u in l){var h=l[u],f=o.data.match(u),p=(o.field_list[f],o.input_list[f]);if(!p.step_linked){if(!(s=this._isDataStep(d)?h&&h.values&&h.values.length>0:p.optional||p.is_workflow&&""!==h||!p.is_workflow&&null!==h)){o.highlight(f);break}i.parameters[c]=i.parameters[c]||{},i.parameters[c][u]=l[u]}}if(!s)break}s?(Galaxy.emit.debug("tool-form-composite::submit()","Validation complete.",i),r.default.request({type:"POST",url:Galaxy.root+"api/workflows/"+this.model.id+"/invocations",data:i,success:function(t){if(Galaxy.emit.debug("tool-form-composite::submit","Submission successful.",t),e.$el.children().hide(),e.$el.append(e._templateSuccess(t)),n.isArray(t)&&t.length>0){e.$el.append(n("
    ",{id:"webhook-view"}));new b.default.WebhookView({urlRoot:Galaxy.root+"api/webhooks/workflow",toolId:i.tool_id,toolVersion:i.tool_version})}e._refreshHistory()},error:function(t){Galaxy.emit.debug("tool-form-composite::submit","Submission failed.",t);var n=!1;if(t&&t.err_data)for(var s in e.forms){var a=e.forms[s],o=t.err_data[a.model.get("step_index")];if(o){var r=a.data.matchResponse(o);for(var l in r){a.highlight(l,r[l]),n=!0;break}}}n||e.modal.show({title:"Workflow submission failed",body:e._templateError(i,t&&t.err_msg),buttons:{Close:function(){e.modal.hide()}}})},complete:function(){e._enabled(!0)}})):(e._enabled(!0),Galaxy.emit.debug("tool-form-composite::submit()","Validation failed.",i))},_append:function(e,t){e.append("

    ").append(t)},_enabled:function(e){this.execute_btn.model.set({wait:!e,wait_text:"Sending...",percentage:-1}),this.wp_form&&this.wp_form.portlet[e?"enable":"disable"](),this.history_form&&this.history_form.portlet[e?"enable":"disable"](),s.each(this.forms,function(t){t&&t.portlet[e?"enable":"disable"]()})},_isDataStep:function(e){for(var t=n.isArray(e)?e:[e],i=0;i0?n("

    ").addClass("donemessagelarge").append(n("

    ").html("Successfully invoked workflow "+r.default.sanitize(this.model.get("name"))+""+(e.length>1?" "+e.length+" times":"")+".")).append(n("

    ").append("").text("You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.")):this._templateError(e,"Invalid success response. No invocations found.")},_templateError:function(e,t){return n("

    ").addClass("errormessagelarge").append(n("

    ").text("The server could not complete the request. Please contact the Galaxy Team if this error persists. "+(JSON.stringify(t)||""))).append(n("

    ").text(JSON.stringify(e,null,4)))}});t.default={View:$}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(8),r=a(o),l=i(113),d=a(l),c=i(4),u=a(c),h={defaultName:e.template("Copy of '<%- name %>'"),title:e.template((0,u.default)("Copying history")+' "<%- name %>"'),submitLabel:(0,u.default)("Copy"),errorMessage:(0,u.default)("History could not be copied."),progressive:(0,u.default)("Copying history"),activeLabel:(0,u.default)("Copy only the active, non-deleted datasets"),allLabel:(0,u.default)("Copy all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after copying this history. "),_template:e.template(["<% if( isAnon ){ %>",'
    ',"<%- anonWarning %>",(0,u.default)("You can"),' ',(0,u.default)("login here")," ",(0,u.default)("or")," ",' ',(0,u.default)("register here"),".","
    ","<% } %>","
    ",'
    ",'','","<% if( allowAll ){ %>","
    ","

    ",(0,u.default)("Choose which datasets from the original history to include:"),"

    ",'/>','',"
    ",'/>','',"<% } %>","
    "].join("")),_showAjaxIndicator:function(){var e='

    '+this.progressive+"...

    ";this.modal.$(".modal-body").empty().append(e).css({"margin-top":"8px"})},dialog:function(t,i,a){function o(){var e=t.$("#copy-modal-title").val();if(!e)return void t.$(".invalid-title").show();var n="copy-all"===t.$('input[name="copy-what"]:checked').val();t.$("button").prop("disabled",!0),r._showAjaxIndicator(),i.copy(!0,e,n).done(function(e){l.resolve(e)}).fail(function(t,s,a){var o={name:e,copyAllDatasets:n};d.default.ajaxErrorModal(i,t,o,r.errorMessage),l.rejectWith(l,arguments)}).done(function(){m&&t.hide()})}a=a||{};var r=this,l=n.Deferred(),c=a.nameFn||this.defaultName,h=c({name:i.get("name")}),f=a.allDatasets?"copy-all":"copy-non-deleted",p=!!e.isUndefined(a.allowAll)||a.allowAll,m=!!e.isUndefined(a.autoClose)||a.autoClose;this.modal=t;var g=a.closing_callback;return t.show(e.extend(a,{title:this.title({name:i.get("name")}),body:s(r._template({name:h,isAnon:Galaxy.user.isAnonymous(),allowAll:p,copyWhat:f,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:e.object([[(0,u.default)("Cancel"),function(){t.hide()}],[this.submitLabel,o]]),height:"auto",closing_events:!0,closing_callback:function(e){e&&l.reject({cancelled:!0}),g&&g(e)}})),t.$("#copy-modal-title").focus().select(),t.$("#copy-modal-title").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),o())}),l}},f=e.extend({},h,{defaultName:e.template("imported: <%- name %>"),title:e.template((0,u.default)("Importing history")+' "<%- name %>"'),submitLabel:(0,u.default)("Import"),errorMessage:(0,u.default)("History could not be imported."),progressive:(0,u.default)("Importing history"),activeLabel:(0,u.default)("Import only the active, non-deleted datasets"),allLabel:(0,u.default)("Import all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after importing this history. ")}),p=function(e,t){t=t||{};var i=window.parent.Galaxy.modal||new r.default.View({});return t.useImport?f.dialog(i,e,t):h.dialog(i,e,t)};t.default=p}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function s(t,i,n){return Galaxy.modal.show({title:i,body:t,closing_events:!0,buttons:{Ok:function(){Galaxy.modal.hide()}}}),Galaxy.modal.$el.addClass("error-modal"),n&&(Galaxy.modal.$(".error-details").add(Galaxy.modal.$('button:contains("Details")')).remove(),e("
    ").addClass("error-details").hide().appendTo(Galaxy.modal.$(".modal-content")).append([e("

    ").text(p),e("

    ").text(JSON.stringify(n,null,"  "))]),e('").appendTo(Galaxy.modal.$(".buttons")).click(function(){Galaxy.modal.$(".error-details").toggle()})),Galaxy.modal}function a(e,t,i){if(e){if(e=(0,u.default)(e),t=(0,u.default)(t)||(0,u.default)("Error:"),window.Galaxy&&Galaxy.modal)return s(e,t,i);alert(t+"\n\n"+e),console.log("error details:",JSON.stringify(i))}}function o(){return a((0,u.default)("You appear to be offline. Please check your connection and try again."),(0,u.default)("Offline?"))}function r(){return a((0,u.default)("Galaxy is currently unreachable. Please try again in a few minutes.")+" "+h,(0,u.default)("Cannot connect to Galaxy"))}function l(e,t,i,n,s){return n=n||f,n+=" "+h,s=s||(0,u.default)("An error occurred"),a(n,s,d(e,t,i))}function d(e,t,i){return{raven:n.result(window.Raven,"lastEventId"),userAgent:navigator.userAgent,onLine:navigator.onLine,version:n.result(Galaxy.config,"version_major"),xhr:n.omit(t,n.functions(t)),options:n.omit(i,"xhr"),url:n.result(Galaxy.lastAjax,"url"),data:n.result(Galaxy.lastAjax,"data"),model:n.result(e,"toJSON",""+e),user:n.omit(n.result(Galaxy.user,"toJSON"),"email")}}Object.defineProperty(t,"__esModule",{value:!0});var c=i(4),u=function(e){return e&&e.__esModule?e:{default:e}}(c),h=(0,u.default)("Please contact a Galaxy administrator if the problem persists."),f=(0,u.default)("An error occurred while updating information with the server."),p=(0,u.default)("The following information can assist the developers in finding the source of the error:");t.default={errorModal:a,offlineErrorModal:o,badGatewayErrorModal:r,ajaxErrorModal:l}}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(1),a=n(s),o=i(2),r=n(o),l=i(5),d=function(e){return e&&e.__esModule?e:{default:e}}(l),c=r.Collection.extend({initialize:function(e,t){r.Collection.prototype.initialize.call(this,e,t),this.setOrder(t.order||this.order,{silent:!0})},_setUpListeners:function(){return this.on({"changed-order":this.sort})},fetch:function(e){return e=this._buildFetchOptions(e),Galaxy.debug("fetch options:",e),r.Collection.prototype.fetch.call(this,e)},_buildFetchOptions:function(e){e=a.clone(e)||{};var t=this;e.traditional=!0,e.data=e.data||t._buildFetchData(e),Galaxy.debug("data:",e.data);var i=this._buildFetchFilters(e);return Galaxy.debug("filters:",i),a.isEmpty(i)||a.extend(e.data,this._fetchFiltersToAjaxData(i)),Galaxy.debug("data:",e.data),e},_buildFetchData:function(e){var t={};return this.order&&(t.order=this.order),a.defaults(a.pick(e,this._fetchParams),t)},_fetchParams:["order","limit","offset","view","keys"],_buildFetchFilters:function(e){return a.clone(e.filters||{})},_fetchFiltersToAjaxData:function(e){var t={q:[],qv:[]};return a.each(e,function(e,i){void 0!==e&&""!==e&&(!0===e&&(e="True"),!1===e&&(e="False"),null===e&&(e="None"),t.q.push(i),t.qv.push(e))}),t},reset:function(e,t){return this.allFetched=!1,r.Collection.prototype.reset.call(this,e,t)},order:null,comparators:{update_time:d.default.buildComparator("update_time",{ascending:!1}),"update_time-asc":d.default.buildComparator("update_time",{ascending:!0}),create_time:d.default.buildComparator("create_time",{ascending:!1}),"create_time-asc":d.default.buildComparator("create_time",{ascending:!0})},setOrder:function(e,t){t=t||{};var i=this,n=i.comparators[e];if(a.isUndefined(n))throw new Error("unknown order: "+e);if(n!==i.comparator)return i.order=e,i.comparator=n,t.silent||i.trigger("changed-order",t),i}}),u=c.extend({limitPerPage:500,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.currentPage=t.currentPage||0},getTotalItemCount:function(){return this.length},shouldPaginate:function(){return this.getTotalItemCount()>=this.limitPerPage},getLastPage:function(){return Math.floor(this.getTotalItemCount()/this.limitPerPage)},getPageCount:function(){return this.getLastPage()+1},getPageLimitOffset:function(e){return e=this.constrainPageNum(e),{limit:this.limitPerPage,offset:e*this.limitPerPage}},constrainPageNum:function(e){return Math.max(0,Math.min(e,this.getLastPage()))},fetchPage:function(e,t){var i=this;return e=i.constrainPageNum(e),i.currentPage=e,t=a.defaults(t||{},i.getPageLimitOffset(e)),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")})},fetchCurrentPage:function(e){return this.fetchPage(this.currentPage,e)},fetchPrevPage:function(e){return this.fetchPage(this.currentPage-1,e)},fetchNextPage:function(e){return this.fetchPage(this.currentPage+1,e)}}),h=c.extend({limitOnFirstFetch:null,limitPerFetch:100,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.limitOnFirstFetch=t.limitOnFirstFetch||this.limitOnFirstFetch,this.limitPerFetch=t.limitPerFetch||this.limitPerFetch,this.allFetched=!1,this.lastFetched=t.lastFetched||0},_buildFetchOptions:function(e){return e.remove=e.remove||!1,c.prototype._buildFetchOptions.call(this,e)},fetchFirst:function(e){return Galaxy.debug("ControlledFetchCollection.fetchFirst:",e),e=e?a.clone(e):{},this.allFetched=!1,this.lastFetched=0,this.fetchMore(a.defaults(e,{reset:!0,limit:this.limitOnFirstFetch}))},fetchMore:function(t){Galaxy.debug("ControlledFetchCollection.fetchMore:",t),t=a.clone(t||{});var i=this;if(Galaxy.debug("fetchMore, options.reset:",t.reset),!t.reset&&i.allFetched)return e.when();t.reset?t.offset=0:void 0===t.offset&&(t.offset=i.lastFetched);var n=t.limit=t.limit||i.limitPerFetch||null;return Galaxy.debug("fetchMore, limit:",n,"offset:",t.offset),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")}).done(function(e){var t=a.isArray(e)?e.length:0;i.lastFetched+=t,Galaxy.debug("fetchMore, lastFetched:",i.lastFetched),(!n||t1?this.renderItems():1===i.added.length?this.addItemView(n.first(i.added),e,t):1===i.removed.length?this.removeItemView(n.first(i.removed),e,t):void 0}}),this},_setUpViewListeners:function(){this.log(this+"._setUpViewListeners"),this.on({"view:selected":function(e,t){if(t&&t.shiftKey&&this.lastSelected){var i=this.viewFromModelId(this.lastSelected);i&&this.selectRange(e,i)}else t&&t.altKey&&!this.selecting&&this.showSelectors();this.selected.push(e.model.id),this.lastSelected=e.model.id},"view:de-selected":function(e,t){this.selected=n.without(this.selected,e.model.id)}})},render:function(e){this.log(this+".render",e);var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){this.debug(this+"(ListPanel)._buildNewRender");var e=s(this.templates.el({},this));return this._renderControls(e),this._renderTitle(e),this._renderSubtitle(e),this._renderSearch(e),this.renderItems(e),e},_renderControls:function(e){this.debug(this+"(ListPanel)._renderControls");var t=s(this.templates.controls({},this));return e.find(".controls").replaceWith(t),t},_renderTitle:function(e){},_renderSubtitle:function(e){},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;i.log("_queueNewRender:",e,t),s(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",this.className).append(e.children()),this.selecting&&this.showSelectors(0),this},_setUpBehaviors:function(e){return e=e||this.$el,this.$controls(e).find("[title]").tooltip(),this._renderMultiselectActionMenu(e),this},_renderMultiselectActionMenu:function(e){e=e||this.$el;var t=e.find(".list-action-menu"),i=this.multiselectActions();if(!i.length)return t.empty();var n=s(['
    ','",'","
    "].join("")),a=i.map(function(e){var t=['
  • ',e.html,"
  • "].join("");return s(t).click(function(t){return t.preventDefault(),e.func(t)})});return n.find("ul").append(a),t.replaceWith(n),n},multiselectActions:function(){return[]},$scrollContainer:function(e){return(e||this.$el).parent().parent()},$controls:function(e){return(e||this.$el).find("> .controls")},$list:function(e){return(e||this.$el).find("> .list-items")},$messages:function(e){return(e||this.$el).find("> .controls .messages")},$emptyMessage:function(e){return(e||this.$el).find("> .empty-message")},renderItems:function(e){e=e||this.$el;var t=this;t.log(this+".renderItems",e);var i=t.$list(e);t.freeViews();var n=t._filterCollection();return t.views=n.map(function(e){return t._createItemView(e)}),i.empty(),t.views.length&&t._attachItems(e),t._renderEmptyMessage(e).toggle(!t.views.length),t.trigger("views:ready",t.views),t.views},_filterCollection:function(){var e=this;return e.collection.filter(n.bind(e._filterItem,e))},_filterItem:function(e){var t=this;return n.every(t.filters.map(function(t){return t.call(e)}))&&(!t.searchFor||e.matchesAll(t.searchFor))},_createItemView:function(e){var t=this._getItemViewClass(e),i=n.extend(this._getItemViewOptions(e),{model:e}),s=new t(i);return this._setUpItemViewListeners(s),s},_destroyItemView:function(e){this.stopListening(e),this.views=n.without(this.views,e)},_destroyItemViews:function(e){var t=this;return t.views.forEach(function(e){t.stopListening(e)}),t.views=[],t},freeViews:function(){return this._destroyItemViews()},_getItemViewClass:function(e){return this.viewClass},_getItemViewOptions:function(e){return{fxSpeed:this.fxSpeed,expanded:!1,selectable:this.selecting,selected:n.contains(this.selected,e.id),draggable:this.dragItems}},_setUpItemViewListeners:function(e){var t=this;return this.listenTo(e,"all",function(){var e=Array.prototype.slice.call(arguments,0);e[0]="view:"+e[0],t.trigger.apply(t,e)}),this.listenTo(e,"draggable:dragstart",function(e,t){var i={},n=this.getSelectedModels();i=n.length?n.toJSON():[t.model.toJSON()],e.dataTransfer.setData("text",JSON.stringify(i))},this),t},_attachItems:function(e){var t=this;return this.$list(e).append(this.views.map(function(e){return t._renderItemView$el(e)})),this},_renderItemView$el:function(e){return e.render(0).$el},_renderEmptyMessage:function(e){this.debug("_renderEmptyMessage",e,this.searchFor);var t=this.searchFor?this.noneFoundMsg:this.emptyMsg;return this.$emptyMessage(e).text(t)},expandAll:function(){n.each(this.views,function(e){e.expand()})},collapseAll:function(){n.each(this.views,function(e){e.collapse()})},addItemView:function(e,t,i){var n=this,a=n._filterCollection().indexOf(e);if(-1!==a){var o=n._createItemView(e);return s(o).queue("fx",[function(e){n.$emptyMessage().is(":visible")?n.$emptyMessage().fadeOut(n.fxSpeed,e):e()},function(e){n._attachView(o,a),e()}]),o}},_attachView:function(e,t,i){i=!!n.isUndefined(i)||i,t=t||0;var s=this;return s.views.splice(t,0,e),s._insertIntoListAt(t,s._renderItemView$el(e).hide()),s.trigger("view:attached",e),i?e.$el.slideDown(s.fxSpeed,function(){s.trigger("view:attached:rendered")}):(e.$el.show(),s.trigger("view:attached:rendered")),e},_insertIntoListAt:function(e,t){var i=this.$list();return 0===e?i.prepend(t):i.children().eq(e-1).after(t),t},removeItemView:function(e,t,i){var a=this,o=n.find(a.views,function(t){return t.model===e});if(o)return a.views=n.without(a.views,o),a.trigger("view:removed",o),s({}).queue("fx",[function(e){o.$el.fadeOut(a.fxSpeed,e)},function(e){o.remove(),a.trigger("view:removed:rendered"),a.views.length?e():a._renderEmptyMessage().fadeIn(a.fxSpeed,e)}]),o},viewFromModelId:function(e){return n.find(this.views,function(t){return t.model.id===e})},viewFromModel:function(e){return e?this.viewFromModelId(e.id):void 0},viewsWhereModel:function(e){return this.views.filter(function(t){return n.isMatch(t.model.attributes,e)})},viewRange:function(e,t){if(e===t)return e?[e]:[];var i=this.views.indexOf(e),n=this.views.indexOf(t);return-1===i||-1===n?i===n?[]:-1===i?[t]:[e]:i .controls .search-query");return i.val()!==e&&i.val(e),this},clearSearch:function(e){return this.searchFor="",this.trigger("search:clear",this),this.$("> .controls .search-query").val(""),this.renderItems(),this},THROTTLE_SELECTOR_FX_AT:20,showSelectors:function(e){e=void 0!==e?e:this.fxSpeed,this.selecting=!0,this.$(".list-actions").slideDown(e),e=this.views.length>=this.THROTTLE_SELECTOR_FX_AT?0:e,n.each(this.views,function(t){t.showSelector(e)})},hideSelectors:function(e){e=void 0!==e?e:this.fxSpeed,this.selecting=!1,this.$(".list-actions").slideUp(e),e=this.views.length>=this.THROTTLE_SELECTOR_FX_AT?0:e,n.each(this.views,function(t){t.hideSelector(e)}),this.selected=[],this.lastSelected=null},toggleSelectors:function(){this.selecting?this.hideSelectors():this.showSelectors()},selectAll:function(e){n.each(this.views,function(t){t.select(e)})},deselectAll:function(e){this.lastSelected=null,n.each(this.views,function(t){t.deselect(e)})},selectRange:function(e,t){var i=this.viewRange(e,t);return n.each(i,function(e){e.select()}),i},getSelectedViews:function(){return n.filter(this.views,function(e){return e.selected})},getSelectedModels:function(){return new this.collection.constructor(n.map(this.getSelectedViews(),function(e){return e.model}))},_showLoadingIndicator:function(e,t,i){this.debug("_showLoadingIndicator",this.indicator,e,t,i),t=void 0!==t?t:this.fxSpeed,this.indicator||(this.indicator=new d.default(this.$el),this.debug("\t created",this.indicator)),this.$el.is(":visible")?(this.$el.fadeOut(t),this.indicator.show(e,t,i)):this.indicator.show(0,i)},_hideLoadingIndicator:function(e,t){this.debug("_hideLoadingIndicator",this.indicator,e,t),e=void 0!==e?e:this.fxSpeed,this.indicator&&this.indicator.hide(e,t)},scrollPosition:function(){return this.$scrollContainer().scrollTop()},scrollTo:function(e,t){return t=t||0,this.$scrollContainer().animate({scrollTop:e},t),this},scrollToTop:function(e){return this.scrollTo(0,e)},scrollToItem:function(e,t){return this},scrollToId:function(e,t){return this.scrollToItem(this.viewFromModelId(e),t)},events:{"click .select-all":"selectAll","click .deselect-all":"deselectAll"},toString:function(){return"ListPanel("+this.collection+")"}});p.prototype.templates=function(){return{el:u.default.wrapTemplate(["
    ",'
    ','
    ','
    ',"
    "]),controls:u.default.wrapTemplate(['
    ','
    ','
    <%- view.title %>
    ',"
    ",'
    <%- view.subtitle %>
    ','
    ','
    ','",'
    ','
    ','",'","
    ",'
    ',"
    ","
    ","
    "])}}();var m=p.extend({modelCollectionKey:"contents",initialize:function(e){p.prototype.initialize.call(this,e),this.selecting=void 0!==e.selecting&&e.selecting,this.setModel(this.model,e)},setModel:function(e,t){if(t=t||{},this.debug(this+".setModel:",e,t),this.freeModel(),this.freeViews(),e){var i=this.model?this.model.get("id"):null;this.model=e,this.logger&&(this.model.logger=this.logger),this._setUpModelListeners(),this.stopListening(this.collection),this.collection=this.model[this.modelCollectionKey]||t.collection||this._createDefaultCollection(),this._setUpCollectionListeners(),i&&e.get("id")!==i&&this.trigger("new-model",this)}return this},freeModel:function(){return this.model&&this.stopListening(this.model),this},_setUpModelListeners:function(){return this.log(this+"._setUpModelListeners",this.model),this.listenTo(this.model,"error",function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("error"),this.trigger.apply(this,e)},this),this.logger&&this.listenTo(this.model,"all",function(e){this.info(this+"(model)",e,arguments)}),this},_renderControls:function(e){this.debug(this+"(ModelListPanel)._renderControls");var t=this.model?this.model.toJSON():{},i=s(this.templates.controls(t,this));return e.find(".controls").replaceWith(i),i},toString:function(){return"ModelListPanel("+this.model+")"}});m.prototype.templates=function(){var e=u.default.wrapTemplate(['
    ','
    ','
    <%- model.name %>
    ',"
    ",'
    <%- view.subtitle %>
    ','
    ','
    ','",'
    ','
    ','",'","
    ",'
    ',"
    ","
    ","
    "]);return n.extend(n.clone(p.prototype.templates),{controls:e})}(),t.default={ListPanel:p,ModelListPanel:m}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";function n(e,t){function i(e){o(this).parent().children("input").val("").trigger("searchInput.clear").blur(),t.onclear()}function n(e,n){if(!n)return i();o(this).trigger("search.search",n),"function"==typeof t.onfirstsearch&&u?(u=!1,t.onfirstsearch(n)):t.onsearch(n)}function s(){return['"].join("")}var l=27,d=13,c=o(e),u=!0,h={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(e){},minSearchLen:0,escWillClear:!0,oninit:function(){}};return"string"===a.default.type(t)?("toggle-loading"===t&&function(){c.find(".search-loading").toggle(),c.find(".search-clear").toggle()}(),c):("object"===a.default.type(t)&&(t=a.default.extend(!0,{},h,t)),c.addClass("search-input").prepend([function(){return o(s()).focus(function(e){o(this).select()}).keyup(function(e){if(e.preventDefault(),e.stopPropagation(),e.which===l&&t.escWillClear)i.call(this,e);else{var s=o(this).val();(e.which===d||t.minSearchLen&&s.length>=t.minSearchLen)&&n.call(this,e,s)}}).val(t.initialVal)}(),function(){return o([''].join("")).tooltip({placement:"bottom"}).click(function(e){i.call(this,e)})}(),function(){return o([''].join("")).hide().tooltip({placement:"bottom"})}()]))}var s=i(0),a=function(e){return e&&e.__esModule?e:{default:e}}(s),o=a.default,r=window._l||function(e){return e};a.default.fn.extend({searchInput:function(e){return this.each(function(){return n(this,e)})}})},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(66),a=n(s),o=i(5),r=n(o),l=i(120),d=n(l),c=i(4),u=n(c),h=a.default.DatasetListItemView,f=h.extend({className:h.prototype.className+" history-content",initialize:function(e,t){h.prototype.initialize.call(this,e,t)},toString:function(){return"HDAListItemView("+(this.model?""+this.model:"(no model)")+")"}});f.prototype.templates=function(){var t=function(t){return'\n
    \n \n
    \n '+t.hid+'\n '+e.escape(t.name)+"\n
    \n
    \n "+d.default.nametagTemplate(t)+"\n
    \n "},i=e.extend({},h.prototype.templates.warnings,{hidden:r.default.wrapTemplate(["<% if( !dataset.visible ){ %>",'
    ',(0,u.default)("This dataset has been hidden"),"
    ","<% } %>"],"dataset")});return e.extend({},h.prototype.templates,{titleBar:t,warnings:i})}(),t.default={HDAListItemView:f}}).call(t,i(1))},function(e,t,i){"use strict";(function(e){function i(t){return 0==t.indexOf("name:")?''+e.escape(t.slice(5))+"":""}function n(t){return''+e.sortBy(e.uniq(t.tags)).map(i).join("")+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default={nametagTemplate:n}}).call(t,i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(16),a=n(s),o=i(67),r=n(o),l=i(122),d=n(l),c=i(5),u=(n(c),i(120)),h=n(u),f=i(4),p=n(f),m=r.default.DCListItemView,g=m.extend({className:m.prototype.className+" history-content",_setUpListeners:function(){var e=this;m.prototype._setUpListeners.call(this);var t=function(t,i){e.render()};this.model.jobStatesSummary&&this.listenTo(this.model.jobStatesSummary,"change",t),this.listenTo(this.model,{"change:tags change:visible change:state":t})},_getFoldoutPanelClass:function(){return d.default.CollectionView},_swapNewRender:function(e){m.prototype._swapNewRender.call(this,e);var t,i=this.model.jobStatesSummary;t=i?i.new()?"loading":i.errored()?"error":i.terminal()?"ok":i.running()?"running":"queued":this.model.get("job_source_id")?"loading":this.model.get("populated_state")?a.default.OK:a.default.RUNNING,this.$el.addClass("state-"+t);var n=this.stateDescription();return this.$(".state-description").html(n),this.$el},stateDescription:function(){var e=this.model,t=(e.get("element_count"),e.get("job_source_type")),i=(this.model.get("collection_type"),d.default.collectionTypeDescription(e)),n=d.default.collectionDescription(e),s=e.jobStatesSummary;if(t&&"Job"!=t){if(s&&s.hasDetails()){var a=s.new(),o=a?null:s.jobCount();if(a)return'\n
    \n Creating jobs...\n
    \n
    ';if(s.errored()){return"a "+i+" with "+s.numInError()+" / "+o+" jobs in error"}if(s.terminal())return n;var r=s.states().running||0,l=s.states().ok||0,c=l/(1*o),u=r/(1*o),h=1-c-u;return'\n
    \n '+(o&&o>1?o+" jobs":"a job")+" generating a "+i+'\n
    \n
    \n
    \n
    '}return'\n
    \n Loading job data for '+i+'...\n
    \n
    '}return n},toString:function(){return"HDCAListItemView("+(this.model?""+this.model:"(no model)")+")"}});g.prototype.templates=function(){var t=e.extend({},m.prototype.templates.warnings,{hidden:function(e){e.visible||(0,p.default)("This collection has been hidden")}}),i=function(t){return'\n
    \n \n
    \n '+t.hid+'\n '+e.escape(t.name)+'\n
    \n
    \n
    \n '+h.default.nametagTemplate(t)+"\n
    \n "};return e.extend({},m.prototype.templates,{warnings:t,titleBar:i})}(),t.default={HDCAListItemView:g}}).call(t,i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=e.get("collection_type");return"list"==t?(0,f.default)("list"):"paired"==t?(0,f.default)("dataset pair"):"list:paired"==t?(0,f.default)("list of pairs"):(0,f.default)("nested list")}function a(e){var t=e.get("element_count"),i="a "+s(e);if(t){var n;1==t?n="with 1 item":t&&(n="with "+t+" items"),i=i+" "+(0,f.default)(n)}return i}Object.defineProperty(t,"__esModule",{value:!0});var o=i(117),r=n(o),l=i(60),d=(n(l),i(67)),c=n(d),u=i(5),h=(n(u),i(4)),f=n(h),p=r.default.ModelListPanel,m=p.extend({_logNamespace:"collections",className:p.prototype.className+" dataset-collection-panel",DatasetDCEViewClass:c.default.DatasetDCEListItemView,modelCollectionKey:"elements",initialize:function(e){p.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,this.panelStack=[],this.parentName=e.parentName,this.foldoutStyle=e.foldoutStyle||"foldout",this.downloadUrl=Galaxy.root+"api/dataset_collections/"+this.model.attributes.id+"/download"},getNestedDCDCEViewClass:function(){return c.default.NestedDCDCEListItemView.extend({foldoutPanelClass:m})},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;this.handleWarning(e),i.log("_queueNewRender:",e,t),i._swapNewRender(e),i.trigger("rendered",i)},handleWarning:function(e){var t=this.views.length,i=this.model.get("element_count");if(i&&i!==t){var n=(0,f.default)("displaying only "+t+" of "+i+" items");e.find(".elements-warning").html('
    '+n+"
    ")}},_filterCollection:function(){return this.model.getVisibleContents()},_getItemViewClass:function(e){switch(e.get("element_type")){case"hda":return this.DatasetDCEViewClass;case"dataset_collection":return this.getNestedDCDCEViewClass()}throw new TypeError("Unknown element type:",e.get("element_type"))},_getItemViewOptions:function(t){var i=p.prototype._getItemViewOptions.call(this,t);return e.extend(i,{linkTarget:this.linkTarget,hasUser:this.hasUser,foldoutStyle:this.foldoutStyle})},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}}),this},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$("> .controls").add(this.$list()).hide(),e.parentName=this.model.get("name"),this.$el.append(e.render().$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.render()},events:{"click .navigation .back":"close"},close:function(e){this.remove(),this.trigger("close")},toString:function(){return"CollectionView("+(this.model?this.model.get("name"):"")+")"}});m.prototype.templates=function(){var t=function(t,i){var n=a(i.model);return'\n
    \n \n
    \n
    '+(e.escape(t.name)||e.escape(t.element_identifier))+'
    \n
    \n '+n+'\n
    \n
    \n
    \n
    \n
    \n
    \n \n \n \n
    \n
    '};return e.extend(e.clone(p.prototype.templates),{controls:t})}(),t.default={collectionTypeDescription:s,collectionDescription:a,CollectionView:m}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(16),o=s(a),r=i(66),l=s(r),d=i(39),c=s(d),u=i(124),h=s(u),f=i(21),p=s(f),m=i(5),g=s(m),_=i(4),v=s(_),y=l.default.DatasetListItemView,w=y.extend({initialize:function(e){y.prototype.initialize.call(this,e),this.hasUser=e.hasUser,this.purgeAllowed=e.purgeAllowed||!1,this.tagsEditorShown=e.tagsEditorShown||!1,this.annotationEditorShown=e.annotationEditorShown||!1},_renderPrimaryActions:function(){var e=y.prototype._renderPrimaryActions.call(this);return this.model.get("state")===o.default.NOT_VIEWABLE?e:y.prototype._renderPrimaryActions.call(this).concat([this._renderEditButton(),this._renderDeleteButton()])},_renderEditButton:function(){var t=this;if(this.model.get("state")===o.default.DISCARDED||!this.model.get("accessible"))return null;var i=this.model.get("purged"),n=this.model.get("deleted"),s={title:(0,v.default)("Edit attributes"),href:Galaxy.root+"datasets/edit?dataset_id="+this.model.attributes.id,faIcon:"fa-pencil",classes:"edit-btn",onclick:function(e){Galaxy.router&&(e.preventDefault(),Galaxy.router.push("datasets/edit",{dataset_id:t.model.attributes.id}))}};return n||i?(s.disabled=!0,i?s.title=(0,v.default)("Cannot edit attributes of datasets removed from disk"):n&&(s.title=(0,v.default)("Undelete dataset to edit attributes"))):e.contains([o.default.UPLOAD,o.default.NEW],this.model.get("state"))&&(s.disabled=!0,s.title=(0,v.default)("This dataset is not yet editable")),(0,p.default)(s)},_renderDeleteButton:function(){if(!this.model.get("accessible"))return null;var e=this,t=this.model.isDeletedOrPurged();return(0,p.default)({title:t?(0,v.default)("Dataset is already deleted"):(0,v.default)("Delete"),disabled:t,faIcon:"fa-times",classes:"delete-btn",onclick:function(){e.$el.find(".icon-btn.delete-btn").trigger("mouseout"),e.model.delete()}})},_renderDetails:function(){var t=y.prototype._renderDetails.call(this),i=this.model.get("state");return!this.model.isDeletedOrPurged()&&e.contains([o.default.OK,o.default.FAILED_METADATA],i)&&(this._renderTags(t),this._renderAnnotation(t),this._makeDbkeyEditLink(t)),this._setUpBehaviors(t),t},_renderToolHelpButton:function(){var e=this.model.attributes.dataset_id,t=this.model.attributes.creating_job,i=this,s=function(t){var s='
    ';t.name&&t.help?(s+="Tool help for "+t.name+"
    ",s+=t.help):s+="Tool help is unavailable for this dataset.
    ",s+="
    ",i.$el.find(".details").append(n.parseHTML(s))},a=function(e){n.ajax({url:Galaxy.root+"api/tools/"+e.tool_id+"/build"}).done(function(e){s(e)}).fail(function(){s({})})};return null===Galaxy.user.id?null:(0,p.default)({title:(0,v.default)("Tool Help"),classes:"icon-btn",href:"#",faIcon:"fa-question",onclick:function(){i.$el.find(".toolhelp").length>0?i.$el.find(".toolhelp").toggle():n.ajax({url:Galaxy.root+"api/jobs/"+t}).done(function(e){a(e)}).fail(function(){console.log('Failed at recovering job information from the Galaxy API for job id "'+t+'".')})}})},_renderSecondaryActions:function(){var e=y.prototype._renderSecondaryActions.call(this);switch(this.model.get("state")){case o.default.UPLOAD:case o.default.NOT_VIEWABLE:return e;case o.default.ERROR:return e.unshift(this._renderErrButton()),e.concat([this._renderRerunButton(),this._renderToolHelpButton()]);case o.default.OK:case o.default.FAILED_METADATA:return e.concat([this._renderRerunButton(),this._renderVisualizationsButton(),this._renderToolHelpButton()])}return e.concat([this._renderRerunButton(),this._renderToolHelpButton()])},_renderErrButton:function(){var e=this;return(0,p.default)({title:(0,v.default)("View or report this error"),href:Galaxy.root+"datasets/error?dataset_id="+this.model.attributes.id,classes:"report-error-btn",faIcon:"fa-bug",onclick:function(t){Galaxy.router&&(t.preventDefault(),Galaxy.router.push("datasets/error",{dataset_id:e.model.attributes.id}))}})},_renderRerunButton:function(){var e=this.model.get("creating_job");if(this.model.get("rerunnable"))return(0,p.default)({title:(0,v.default)("Run this job again"),href:this.model.urls.rerun,classes:"rerun-btn",target:this.linkTarget,faIcon:"fa-refresh",onclick:function(t){Galaxy.router&&(t.preventDefault(),Galaxy.router.push("/",{job_id:e}))}})},_renderVisualizationsButton:function(){var t=this.model.get("visualizations");if(this.model.isDeletedOrPurged()||!this.hasUser||!this.model.hasData()||e.isEmpty(t))return null;if(!e.isObject(t[0]))return this.warn("Visualizations have been switched off"),null;var i=n(this.templates.visualizations(t,this));return i.find('[target="galaxy_main"]').attr("target",this.linkTarget),this._addScratchBookFn(i.find(".visualization-link").addBack(".visualization-link")),i},_addScratchBookFn:function(e){e.click(function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Visualization",url:n(this).attr("href")}),e.preventDefault(),e.stopPropagation())})},_renderTags:function(e){if(this.hasUser){var t=this;this.tagsEditor=new c.default.TagsEditor({model:this.model,el:e.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.tagsEditorShown=!0},onhide:function(){t.tagsEditorShown=!1},$activator:(0,p.default)({title:(0,v.default)("Edit dataset tags"),classes:"tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".actions .right"))}),this.tagsEditorShown&&this.tagsEditor.toggle(!0)}},_renderAnnotation:function(e){if(this.hasUser){var t=this;this.annotationEditor=new h.default.AnnotationEditor({model:this.model,el:e.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.annotationEditorShown=!0},onhide:function(){t.annotationEditorShown=!1},$activator:(0,p.default)({title:(0,v.default)("Edit dataset annotation"),classes:"annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".actions .right"))}),this.annotationEditorShown&&this.annotationEditor.toggle(!0)}},_makeDbkeyEditLink:function(e){if("?"===this.model.get("metadata_dbkey")&&!this.model.isDeletedOrPurged()){var t=n('?').attr("href",this.model.urls.edit).attr("target","_top");e.find(".dbkey .value").replaceWith(t)}},events:e.extend(e.clone(y.prototype.events),{"click .undelete-link":"_clickUndeleteLink","click .purge-link":"_clickPurgeLink","click .edit-btn":function(e){this.trigger("edit",this,e)},"click .delete-btn":function(e){this.trigger("delete",this,e)},"click .rerun-btn":function(e){this.trigger("rerun",this,e)},"click .report-err-btn":function(e){this.trigger("report-err",this,e)},"click .visualization-btn":function(e){this.trigger("visualize",this,e)},"click .dbkey a":function(e){this.trigger("edit",this,e)}}),_clickUndeleteLink:function(e){return this.model.undelete(),!1},_clickPurgeLink:function(e){return confirm((0,v.default)("This will permanently remove the data in your dataset. Are you sure?"))&&this.model.purge(),!1},toString:function(){return"HDAEditView("+(this.model?""+this.model:"(no model)")+")"}});w.prototype.templates=function(){var t=e.extend({},y.prototype.templates.warnings,{failed_metadata:g.default.wrapTemplate(['<% if( dataset.state === "failed_metadata" ){ %>','","<% } %>"],"dataset"),deleted:g.default.wrapTemplate(["<% if( dataset.deleted && !dataset.purged ){ %>",'
    ',(0,v.default)("This dataset has been deleted"),'
    ',(0,v.default)("Undelete it"),"","<% if( view.purgeAllowed ){ %>",'
    ',(0,v.default)("Permanently remove it from disk"),"","<% } %>","
    ","<% } %>"],"dataset")}),i=g.default.wrapTemplate(["<% if( visualizations.length === 1 ){ %>",'">','',"","<% } else { %>",'","<% } %>"],"visualizations");return e.extend({},y.prototype.templates,{warnings:t,visualizations:i})}(),t.default={DatasetListItemEdit:w}}).call(t,i(1),i(0))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),o=s(a),r=i(4),l=s(r);i(20);var d=e.View.extend(o.default.LoggableMixin).extend(o.default.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(e){e=e||{},this.tooltipConfig=e.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(e.$activator,e)},render:function(){var e=this;return this.$el.html(this._template()),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(t){e.$annotation().text(t),e.model.save({annotation:t},{silent:!0}).fail(function(){e.$annotation().text(e.model.previous("annotation"))})}}),this},_template:function(){var e=this.model.get("annotation");return['",'
    ',n.escape(e),"
    "].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off(),this.stopListening(this.model),e.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",""+this.model,")"].join("")}});t.default={AnnotationEditor:d}}).call(t,i(2),i(1))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){function t(e){return e&&e.__esModule?e:{default:e}}var n=i(0),s=t(n),a=i(23),o=t(a),r=i(53),l=t(r),d=i(240),c=t(d),u=i(250),h=t(u),f=i(26),p=t(f),m=i(86),g=t(m),_=i(68),v=t(_),y=i(264),w=t(y),b=i(265),x=t(b),C=i(80),$=t(C),k=i(19),S=t(k),T=i(266),P=t(T),E=i(267),D=t(E),A=i(269),M=t(A),I=i(274),L=t(I),O=i(111),N=t(O),j=i(14),G=t(j),V=i(3),H=t(V),z=i(6),U=t(z),F=i(275),R=t(F),B=i(276),W=t(B),J=i(91),q=t(J),Y=i(31),Q=t(Y),K=s.default;window.app=function(t,i){window.Galaxy=new o.default.GalaxyApp(t,i),Galaxy.debug("analysis app");var n=l.default.extend({routes:{"(/)":"home","(/)root*":"home","(/)tours(/)(:tour_id)":"show_tours","(/)user(/)":"show_user","(/)user(/)(:form_id)":"show_user_form","(/)pages(/)create(/)":"show_pages_create","(/)pages(/)edit(/)":"show_pages_edit","(/)pages(/)(:action_id)":"show_pages","(/)visualizations(/)edit(/)":"show_visualizations_edit","(/)visualizations/(:action_id)":"show_visualizations","(/)workflows/import_workflow":"show_import_workflow","(/)workflows/run(/)":"show_run","(/)workflows(/)list":"show_workflows","(/)workflows/list_published(/)":"show_workflows_published","(/)workflows/create(/)":"show_workflows_create","(/)histories(/)citations(/)":"show_history_citations","(/)histories(/)rename(/)":"show_histories_rename","(/)histories(/)import(/)":"show_histories_import","(/)histories(/)permissions(/)":"show_histories_permissions","(/)histories(/)(:action_id)":"show_histories","(/)datasets(/)list(/)":"show_datasets","(/)custom_builds":"show_custom_builds","(/)datasets/edit":"show_dataset_edit_attributes","(/)datasets/error":"show_dataset_error"},require_login:["show_user","show_user_form","show_workflows"],authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id||-1==this.require_login.indexOf(t)},show_tours:function(e){e?$.default.giveTour(e):this.page.display(new $.default.ToursView)},show_user:function(){this.page.display(new w.default.View)},show_user_form:function(e){var t=new w.default.Model({user_id:Galaxy.params.id});this.page.display(new v.default.View(t.get(e)))},show_visualizations:function(e){this.page.display(new P.default.View({action_id:e,plural:"Visualizations",item:"visualization"}))},show_visualizations_edit:function(){this.page.display(new v.default.View({url:"visualization/edit?id="+G.default.get("id"),redirect:"visualizations/list"}))},show_workflows_published:function(){this.page.display(new S.default({url_base:Galaxy.root+"workflow/list_published",dict_format:!0}))},show_histories:function(e){this.page.display(new L.default.View({action_id:e}))},show_history_citations:function(){var e=Q.default.extend(q.default),t=document.createElement("div");this.page.display(t),new e({propsData:{id:G.default.get("id"),source:"histories"}}).$mount(t)},show_histories_rename:function(){this.page.display(new v.default.View({url:"history/rename?id="+G.default.get("id"),redirect:"histories/list"}))},show_histories_import:function(){var e=Q.default.extend(M.default),t=document.createElement("div");this.page.display(t),(new e).$mount(t)},show_histories_permissions:function(){this.page.display(new v.default.View({url:"history/permissions?id="+G.default.get("id"),redirect:"histories/list"}))},show_datasets:function(){this.page.display(new S.default({url_base:Galaxy.root+"dataset/list",dict_format:!0}))},show_pages:function(e){this.page.display(new P.default.View({action_id:e,plural:"Pages",item:"page"}))},show_pages_create:function(){this.page.display(new v.default.View({url:"page/create",redirect:"pages/list"}))},show_pages_edit:function(){this.page.display(new v.default.View({url:"page/edit?id="+G.default.get("id"),redirect:"pages/list"}))},show_workflows:function(){this.page.display(new D.default.View)},show_workflows_create:function(){this.page.display(new v.default.View({url:"workflow/create",redirect:"workflow/editor"}))},show_run:function(){this._loadWorkflow()},show_import_workflow:function(){this.page.display(new D.default.ImportWorkflowView)},show_custom_builds:function(){var e=this,t=this.page.historyPanel.historyView;if(!t||!t.model||!t.model.id)return void window.setTimeout(function(){e.show_custom_builds()},500);this.page.display(new x.default.View)},show_dataset_edit_attributes:function(){this.page.display(new W.default.View)},show_dataset_error:function(){this.page.display(new R.default.View)},home:function(e){e.tool_id||e.job_id?"upload1"===e.tool_id?(this.page.toolPanel.upload.show(),this._loadCenterIframe("welcome")):this._loadToolForm(e):e.workflow_id?this._loadWorkflow():e.m_c?this._loadCenterIframe(e.m_c+"/"+e.m_a):this._loadCenterIframe("welcome")},_loadToolForm:function(e){e.id=decodeURIComponent(e.tool_id),this.page.display(new g.default.View(e))},_loadCenterIframe:function(e,t){t=t||Galaxy.root,e=t+e,this.page.$("#galaxy_main").prop("src",e)},_loadWorkflow:function(){var e=this;H.default.get({url:Galaxy.root+"api/workflows/"+H.default.getQueryString("id")+"/download?style=run",success:function(t){e.page.display(new N.default.View(t))},error:function(t){var i=t.err_msg||"Error occurred while loading the resource.",n={message:i,status:"danger",persistent:!0};e.page.display(new U.default.Message(n))}})}});K(function(){Galaxy.page=new p.default.View(e.extend(t,{Left:c.default,Right:h.default,Router:n}))})}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(85),o=s(a),r=i(241),l=s(r),d=i(4),c=s(d),u=i(111),h=(s(u),e.View.extend({initialize:function(t,i){var n=i.config;this.root=i.root,this.stored_workflow_menu_entries=n.stored_workflow_menu_entries||[];var s=new o.default.ToolSearch({hidden:!1}),a=new o.default.ToolCollection(n.toolbox);this.tool_panel=new o.default.ToolPanel({tool_search:s,tools:a,layout:n.toolbox_in_panel}),this.tool_panel_view=new o.default.ToolPanelView({model:this.tool_panel}),this.upload_button=new l.default({nginx_upload_path:n.nginx_upload_path,ftp_upload_site:n.ftp_upload_site,default_genome:n.default_genome,default_extension:n.default_extension}),Galaxy.upload=this.upload_button,this.model=new e.Model({title:(0,c.default)("Tools"),buttons:[this.upload_button]}),this.setElement(this._template())},render:function(){var e=this;this.tool_panel.get("layout").size()>0&&(this.$el.prepend(this.tool_panel_view.$el),this.tool_panel_view.render()),e.$("#internal-workflows").append(e._templateAllWorkflow({title:(0,c.default)("All workflows"),href:"workflow"})),n.each(this.stored_workflow_menu_entries,function(t){e.$("#internal-workflows").append(e._templateWorkflowLink({title:t.stored_workflow.name,href:"workflows/run?id="+t.encoded_stored_workflow_id}))})},_templateTool:function(e){return['"].join("")},_templateAllWorkflow:function(e){return['"].join("")},_templateWorkflowLink:function(e){return['"].join("")},_template:function(){return['
    ','",'
    ','
    ','
    ',"",(0,c.default)("Workflows"),"","
    ",'
    ','
    ',"
    ","
    "].join("")},toString:function(){return"toolPanel"}}));t.default=h}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=n(s),o=i(8),r=n(o),l=i(43),d=n(l),c=i(242),u=n(c),h=i(243),f=n(h),p=i(246),m=n(p),g=i(248),_=n(g);t.default=e.View.extend({options:{nginx_upload_path:"",ftp_upload_site:"n/a",default_genome:"?",default_extension:"auto",height:500,width:900,auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}},list_extensions:[],list_genomes:[],initialize:function(e){var t=this;this.options=a.default.merge(e,this.options),this.ui_button=new u.default.View({onclick:function(e){e.preventDefault(),t.show()},onunload:function(){var e=t.ui_button.model.get("percentage",0);if(e>0&&e<100)return"Several uploads are queued."}}),this.setElement(this.ui_button.$el);var t=this;a.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){for(var i in e)t.list_extensions.push({id:e[i].extension,text:e[i].extension,description:e[i].description,description_url:e[i].description_url,composite_files:e[i].composite_files});t.list_extensions.sort(function(e,t){var i=e.text&&e.text.toLowerCase(),n=t.text&&t.text.toLowerCase();return i>n?1:ii.text?1:e.text0){var n={file_count:e.length,dbkey:e[0].get("genome","?"),file_type:e[0].get("extension","auto")};for(var s in e){var a=e[s];if(a.set("status","running"),!(a.get("file_size")>0)){i.error_message="Upload content incomplete.",a.set("status","error"),a.set("info",i.error_message);break}var o="files_"+s+"|";switch(n[o+"type"]="upload_dataset",n[o+"space_to_tab"]=a.get("space_to_tab")&&"Yes"||null,n[o+"to_posix_lines"]=a.get("to_posix_lines")&&"Yes"||null,n[o+"dbkey"]=a.get("genome",null),n[o+"file_type"]=a.get("extension",null),a.get("file_mode")){case"new":n[o+"url_paste"]=a.get("url_paste");break;case"ftp":n[o+"ftp_files"]=a.get("file_path");break;case"local":i.files.push({name:o+"file_data",file:a.get("file_data")})}}i.payload.inputs=JSON.stringify(n)}return i}})}).call(t,i(2))},function(e,t,i){"use strict";(function(e,i){Object.defineProperty(t,"__esModule",{value:!0});var n=e.View.extend({initialize:function(t){var n=this;this.model=t&&t.model||new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",percentage:0,status:"",onunload:function(){},onclick:function(){}}).set(t),this.setElement(this._template()),this.$progress=this.$(".progress-bar"),this.listenTo(this.model,"change",this.render,this),this.render(),i(window).on("beforeunload",function(){return n.model.get("onunload")()})},render:function(){var e=this.model.attributes;this.$el.off("click").on("click",function(t){e.onclick(t)}).tooltip({title:this.model.get("tooltip"),placement:"bottom"}),this.$progress.removeClass().addClass("progress-bar").addClass("progress-bar-notransition").addClass(""!=e.status&&"progress-bar-"+e.status).css({width:e.percentage+"%"})},_template:function(){return'
    '}});t.default={View:n}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=(a(o),i(29)),l=a(r),d=i(244),c=a(d),u=i(55),h=a(u),f=i(56),p=a(f),m=i(15),g=a(m),_=i(10),v=a(_),y=i(6),w=a(y),b=i(245),x=a(b);i(57),t.default=e.View.extend({upload_size:0,collection:new l.default.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.$uploadbox=this.$(".upload-box"),this.$uploadtable=this.$(".upload-table"),this.btnLocal=new w.default.Button({id:"btn-local",title:"Choose local file",onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new w.default.Button({id:"btn-ftp",title:"Choose FTP file",onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new w.default.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new w.default.Button({id:"btn-start",title:"Start",onclick:function(){t._eventStart()}}),this.btnStop=new w.default.Button({id:"btn-stop",title:"Pause",onclick:function(){t._eventStop()}}),this.btnReset=new w.default.Button({id:"btn-reset",title:"Reset",onclick:function(){t._eventReset()}}),this.btnClose=new w.default.Button({id:"btn-close",title:"Close",onclick:function(){t.app.modal.hide()}}),n.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$uploadbox.uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$uploadbox.addClass("highlight")},ondragleave:function(){t.$uploadbox.removeClass("highlight")}}),this.ftp=new g.default.View({title:"FTP files",container:this.btnFtp.$el}),this.select_extension=new v.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t._changeExtension(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new p.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new v.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t._changeGenome(e)}}),this.loader=new x.default({$container:this.$uploadbox,collection:this.collection,new_content:function(e){var i=new c.default(t,{model:e});return t.$uploadtable.find("> tbody:first").append(i.$el),i.render(),i}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this.render()},render:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[n?"enable":"disable"](),this.btnFtp[n?"enable":"disable"](),this.btnCreate[n?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_eventAnnounce:function(e,t){this.counter.announce++;var i=new l.default.Model({id:e,file_name:t.name,file_size:t.size,file_mode:t.mode||"local",file_path:t.path,file_data:t});this.render(),this.collection.add(i)},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"success"}),this.ui_button.model.set("percentage",this._uploadPercentage(100,i.get("file_size"))),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.success++,this.render(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this.render()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this.render()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this.render()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new h.default({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(0!=this.counter.announce&&0==this.counter.running){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this._uploadFtp(),this.uploadbox.start(),this.render()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),s(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){if(0==this.counter.running){this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this.render()}},_changeExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},_changeGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_uploadFtp:function(){var e=this,t=[];this.collection.each(function(i){"queued"==i.get("status")&&"ftp"==i.get("file_mode")&&(e.uploadbox.remove(i.id),t.push(i))}),t.length>0&&s.uploadpost({data:this.app.toData(t),url:this.app.options.nginx_upload_path,success:function(i){n.each(t,function(t){e._eventSuccess(t.id)})},error:function(i){n.each(t,function(t){e._eventError(t.id,i)})}})},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
    Drop files here
    '}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=a(o),l=i(29),d=(a(l),i(54)),c=a(d),u=i(15),h=a(u),f=i(10),p=a(f);t.default=e.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$settings=this.$(".upload-settings"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new h.default.View({title:"Upload configuration",container:this.$(".upload-settings"),placement:"bottom"});var s=this.app.select_genome.value(),a=this.app.select_extension.value();this.select_genome=new p.default.View({css:"upload-genome",data:i.app.list_genomes,container:this.$(".upload-genome"),value:s,onchange:function(e){i.model.set("genome",e)}}),this.select_extension=new p.default.View({css:"upload-extension",data:i.app.list_extensions,container:this.$(".upload-extension"),value:a,onchange:function(e){i.model.set("extension",e)}}),this.model.set({genome:s,extension:a}),this.$symbol.on("click",function(){i._removeRow()}),this.$(".upload-extension-info").on("click",function(e){i.app.showExtensionInfo({$el:n(e.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(e){e.preventDefault()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:genome",function(){i._refreshGenome()}),this.listenTo(this.model,"change:extension",function(){i._refreshExtension()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()})},render:function(){this._refreshType(),this._refreshPercentage(),this._refreshStatus(),this._refreshInfo(),this._refreshGenome(),this._refreshExtension(),this._refreshFileSize()},remove:function(){this.select_genome.remove(),this.select_extension.remove(),e.View.prototype.remove.apply(this)},_refreshType:function(){var e=this.model.attributes;this.$title.html(s.escape(e.file_name)),this.$size.html(r.default.bytesToString(e.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==e.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==e.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==e.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),t?(this.select_genome.enable(),this.select_extension.enable()):(this.select_genome.disable(),this.select_extension.disable()),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(r.default.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new c.default(this).$el),this.settings.show())},_template:function(e){return'
    You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
    ','',"<% } %>","folder","","",'<%= _.escape(content_item.get("update_time")) %>',"","","","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","",""].join(""))},templateRowFile:function(){return i.template(['',"",'',"",'','',"","",'/datasets/<%- content_item.id %>" class="library-dataset">','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>','<%= _.escape(content_item.get("file_ext")) %>','<%= _.escape(content_item.get("file_size")) %>','<%= _.escape(content_item.get("update_time")) %>',"",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'<% if (content_item.get("is_unrestricted")) { %>','',"<% } %>",'<% if (content_item.get("is_private")) { %>','',"<% } %>",'<% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %>','',"<% } %>",'<% if (content_item.get("can_manage")) { %>','/datasets/<%- content_item.id %>/permissions">','","","<% } %>","",""].join(""))},templateRowDeletedFile:function(){return i.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>',"","",'<%= _.escape(content_item.get("file_ext")) %>',"","",'<%= _.escape(content_item.get("file_size")) %>',"","",'<%= _.escape(content_item.get("update_time")) %>',"","",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'','","",""].join(""))},templateRowDeletedFolder:function(){return i.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","","folder","","","",'<%= _.escape(content_item.get("update_time")) %>',"","","",'','","",""].join(""))}});t.default={FolderRowView:h}}).call(t,n(2),n(1),n(0))},300:function(e,t,n){"use strict";(function(e,i){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),o=r(a),s=n(13),l=r(s),c=n(301),d=r(c),u=n(1),h=r(u),f=e.View.extend({el:"#libraries_element",events:{"click .sort-libraries-link":"sort_clicked"},defaults:{page_count:null,show_page:null,all_fetched:!1},initialize:function(e){this.options=h.default.defaults(this.options||{},e,this.defaults);var t=this;this.modal=null,this.collection=new l.default.Libraries,this.collection.url=this.collection.urlRoot+"?deleted=false",this.collection.fetch({success:function(){t.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})},render:function(e){this.options=h.default.extend(this.options,e),this.setElement("#libraries_element");var t=this.templateLibraryList(),n=null,r=null,a=function(e){return!0===e.get("public")};if(i(".tooltip").hide(),void 0!==e&&(r=void 0!==e.models?e.models:null),null!==this.collection&&null===r)this.sortLibraries(),n=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a));else if(null!==r){if(Galaxy.libraries.preferences.get("with_deleted"))n=r;else{var o=function(e){return!1===e.get("deleted")};n=h.default.filter(r,o)}Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a))}else n=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=n.length;var s=Galaxy.libraries.preferences.get("library_page_size")*(this.options.show_page-1);this.options.page_count=Math.ceil(this.options.total_libraries_count/Galaxy.libraries.preferences.get("library_page_size")),this.options.total_libraries_count>0&&sthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(n=[]),this.$el.html(t({length:1,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options),this.renderRows(n)):(this.$el.html(t({length:0,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options)),i("#center [data-toggle]").tooltip(),i("#center").css("overflow","auto")},fetchDeleted:function(){if(this.options.all_fetched)this.render();else{var e=this;this.collection.url=this.collection.urlRoot+"?deleted=true",this.collection.fetch({remove:!1,success:function(){e.options.all_fetched=!0,e.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})}},renderRows:function(e){for(var t=0;t',"<% if(length === 0) { %>","<% if(search_term.length > 0) { %>","
    ","There are no libraries matching your search. Try different keyword.","
    ","<% } else{ %>","
    ","There are no libraries visible to you here. If you expected some to show up please consult the",' library security wikipage',' or visit the Galaxy support site.',"
    ","<% }%>","<% } else{ %>",'',"",'",'',' ','',"",'',"","
    ','',"name","",'',"descriptionsynopsis
    ","<% }%>","
    "].join(""))}});t.default={LibraryListView:f}}).call(t,n(2),n(0))},301:function(e,t,n){"use strict";(function(e,i,r){Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=e.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library"},edit_mode:!1,element_visibility_config:{upload_library_btn:!1,edit_library_btn:!1,permission_library_btn:!1,save_library_btn:!1,cancel_library_btn:!1,delete_library_btn:!1,undelete_library_btn:!1},initialize:function(e){this.render(e)},render:function(e){void 0===e&&(e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))),this.prepareButtons(e);var t=this.templateRow();return this.setElement(t({library:e,button_config:this.element_visibility_config,edit_mode:this.edit_mode})),this.$el.show(),this},repaint:function(e){i(".tooltip").hide();var t=this.$el;this.render(),t.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){var t=this.element_visibility_config;!1===this.edit_mode?(t.save_library_btn=!1,t.cancel_library_btn=!1,t.delete_library_btn=!1,!0===e.get("deleted")?(t.undelete_library_btn=!0,t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1):!1===e.get("deleted")&&(t.save_library_btn=!1,t.cancel_library_btn=!1,t.undelete_library_btn=!1,!0===e.get("can_user_add")&&(t.upload_library_btn=!0),!0===e.get("can_user_modify")&&(t.edit_library_btn=!0),!0===e.get("can_user_manage")&&(t.permission_library_btn=!0))):!0===this.edit_mode&&(t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1,t.save_library_btn=!0,t.cancel_library_btn=!0,t.delete_library_btn=!0,t.undelete_library_btn=!1),this.element_visibility_config=t},edit_button_clicked:function(){this.edit_mode=!0,this.repaint()},cancel_library_modification:function(){this.edit_mode=!1,this.repaint()},save_library_modification:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=!1,n=this.$el.find(".input_library_name").val();if(void 0!==n&&n!==e.get("name")){if(!(n.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");e.set("name",n),t=!0}var i=this.$el.find(".input_library_description").val();void 0!==i&&i!==e.get("description")&&(e.set("description",i),t=!0);var r=this.$el.find(".input_library_synopsis").val();if(void 0!==r&&r!==e.get("synopsis")&&(e.set("synopsis",r),t=!0),t){var a=this;e.save(null,{patch:!0,success:function(e){a.edit_mode=!1,a.repaint(e),o.default.success("Changes to library saved.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while attempting to update the library.")}})}else this.edit_mode=!1,this.repaint(e),o.default.info("Nothing has changed.")},delete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.destroy({success:function(e){e.set("deleted",!0),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,!1===Galaxy.libraries.preferences.get("with_deleted")?(i(".tooltip").hide(),t.repaint(e),t.$el.remove()):!0===Galaxy.libraries.preferences.get("with_deleted")&&t.repaint(e),o.default.success("Library has been marked deleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured during deleting the library.")}})},undelete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.url=e.urlRoot+e.id+"?undelete=true",e.destroy({success:function(e){e.set("deleted",!1),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,t.repaint(e),o.default.success("Library has been undeleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while undeleting the library.")}})},templateRow:function(){return r.template(['" style="display:none;" data-id="<%- library.get("id") %>">',"<% if(!edit_mode) { %>",'<% if(library.get("deleted")) { %>','<%- library.get("name") %>',"<% } else { %>",'"><%- library.get("name") %>',"<% } %>",'<% if(library.get("description")) { %>','<% if( (library.get("description")).length> 80 ) { %>','"><%= _.escape(library.get("description")).substring(0, 80) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("description"))%>',"<% } %>","<% } else { %>","","<% } %>",'<% if(library.get("synopsis")) { %>','<% if( (library.get("synopsis")).length> 120 ) { %>','"><%= _.escape(library.get("synopsis")).substring(0, 120) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("synopsis"))%>',"<% } %>","<% } else { %>","","<% } %>","<% } else if(edit_mode){ %>",'','','',"<% } %>",'','<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',' ',"<% }%>",'','/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});t.default={LibraryRowView:s}}).call(t,n(2),n(0),n(1))},302:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=e.View.extend({el:"#center",defaults:{search_term:""},events:{"click #create_new_library_btn":"createLibraryFromModal","click #include_deleted_chk":"includeDeletedChecked","click #exclude_restricted_chk":"excludeRestrictedChecked","click .page_size_prompt":"showPageSizePrompt","keyup .library-search-input":"searchLibraries"},initialize:function(e){this.options=i.defaults(this.options||{},e,this.defaults),this.render()},render:function(){var e=this.templateToolBar(),t=!1,n=!0;Galaxy.user&&(t=Galaxy.user.isAdmin(),n=Galaxy.user.isAnonymous()),this.$el.html(e({admin_user:t,anon_user:n})),t&&(this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted"),this.$el.find("#exclude_restricted_chk")[0].checked=Galaxy.libraries.preferences.get("without_restricted"))},renderPaginator:function(e){this.options=i.extend(this.options,e);var t=this.templatePaginator();this.$el.find("#library_paginator").html(t({show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_libraries_count:this.options.total_libraries_count,libraries_shown:this.options.libraries_shown,library_page_size:Galaxy.libraries.preferences.get("library_page_size")}))},createLibraryFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this;this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){t.createNewLibrary()},Close:function(){t.modal.hide()}}})},createNewLibrary:function(){var e=this.serializeNewLibrary();if(this.validateNewLibrary(e)){var t=new c.default.Library,n=this;t.save(e,{success:function(e){Galaxy.libraries.libraryListView.collection.add(e),n.modal.hide(),n.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),s.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg):s.default.error("An error occured.")}})}else s.default.error("Library's name is missing.");return!1},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many libraries per page do you want to see?",Galaxy.libraries.preferences.get("library_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({library_page_size:parseInt(t)}),Galaxy.libraries.libraryListView.render({show_page:1}))},clearLibraryModal:function(){r("input[name='Name']").val(""),r("input[name='Description']").val(""),r("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val(),synopsis:r("input[name='Synopsis']").val()}},validateNewLibrary:function(e){return""!==e.name},includeDeletedChecked:function(e){e.target.checked?(Galaxy.libraries.preferences.set({with_deleted:!0}),Galaxy.libraries.libraryListView.fetchDeleted()):(Galaxy.libraries.preferences.set({with_deleted:!1}),Galaxy.libraries.libraryListView.render())},excludeRestrictedChecked:function(e){e.target.checked?Galaxy.libraries.preferences.set({without_restricted:!0}):Galaxy.libraries.preferences.set({without_restricted:!1}),Galaxy.libraries.libraryListView.render()},searchLibraries:function(e){var t=r(".library-search-input").val();this.options.search_term=t,Galaxy.libraries.libraryListView.searchLibraries(t)},templateToolBar:function(){return i.template(['
    ','
    ','
    ','
    ','DATA LIBRARIES','',"",'
    ','',"
    ","<% if(admin_user === true) { %>",'
    ',"","","
    ",'','',"","<% } %>",'','','',"","","
    ","
    ","
    ",'
    ',"
    ","
    "].join(""))},templatePaginator:function(){return i.template(['","",' <%- libraries_shown %> libraries shown (change)',"",""," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return i.template(['
    ',"
    ",'','','',"
    ","
    "].join(""))}});t.default={LibraryToolbarView:d}}).call(t,n(2),n(1),n(0))},303:function(e,t,n){"use strict";(function(e,i,r,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),l=o(s),c=n(7),d=o(c),u=n(13),h=o(u),f=n(10),p=o(f);n(127);var _=e.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page_size_prompt":"showPageSizePrompt"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=i.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=i.extend(this.options,e);var t=this.templateToolBar(),n={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(n.is_admin=Galaxy.user.isAdmin(),n.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(n.mutiple_add_dataset_options=!0)),this.$el.html(t(n))},renderPaginator:function(e){this.options=i.extend(this.options,e);var t=this.templatePaginator();r("body").find(".folder-paginator").html(t({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(e){this.options=i.extend(this.options,e),!0===this.options.can_add_library_item?r(".add-library-items").show():r(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(r(".dataset-manipulation").show(),r(".logged-dataset-manipulation").hide()):(r(".logged-dataset-manipulation").show(),r(".dataset-manipulation").show()):(r(".logged-dataset-manipulation").hide(),r(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,n=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create New Folder",body:n(),buttons:{Create:function(){t.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var t=this.serialize_new_folder();if(this.validate_new_folder(t)){var n,i=new h.default.FolderAsModel,r=e.history.fragment.split("/");n=r.indexOf("page")>-1?r[r.length-3]:r[r.length-1],i.url=i.urlRoot+n,i.save(t,{success:function(e){Galaxy.modal.hide(),d.default.success("Folder created."),e.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(e)},error:function(e,t){Galaxy.modal.hide(),void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")}})}else d.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)d.default.info("You must select some datasets first.");else{var e=this;this.histories=new h.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:"Import into History",body:t({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)r.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.options.last_used_history_id=e.id,t.processImportToHistory(e.id,e.name)}).fail(function(e,t,n){d.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var n=r("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=n;var i=r("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(n,i),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var n=[],i=[];this.findCheckedRows().each(function(){var e=r(this).closest("tr").data("id");"F"==e.substring(0,1)?i.push(e):n.push(e)});for(var o=[],s=n.length-1;s>=0;s--){var l=n[s],c=new h.default.HistoryItem;c.url=c.urlRoot+e+"/contents",c.content=l,c.source="library",o.push(c)}for(var s=i.length-1;s>=0;s--){var d=i[s],c=new h.default.HistoryItem;c.url=c.urlRoot+e+"/contents",c.content=d,c.source="library_folder",o.push(c)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),a.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,r(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";r(".completion_span").text(e)},download:function(e,t){var n=[],i=[];this.findCheckedRows().each(function(){var e=r(this).closest("tr").data("id");"F"==e.substring(0,1)?i.push(e):n.push(e)});var a=Galaxy.root+"api/libraries/datasets/download/"+t,o={ld_ids:n,folder_ids:i};this.processDownload(a,o,"get")},processDownload:function(e,t,n){if(e&&t){t="string"==typeof t?t:r.param(t);var i="";r.each(t.split("&"),function(){var e=this.split("=");i+=''}),r('
    '+i+"
    ").appendTo("body").submit().remove(),d.default.info("Your download will begin soon.")}else d.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new h.default.GalaxyHistories;var e=this;this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:"Adding datasets from your history",body:t({histories:e.histories.models}),buttons:{Add:function(){e.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),e.fetchAndDisplayHistoryContents(e.histories.models[0].id),r("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")})},importFilesFromPathModal:function(){var e=this;this.modal=Galaxy.modal;var t=this.templateImportPathModal();this.modal.show({closing_events:!0,title:"Please enter paths to import",body:t({}),buttons:{Import:function(){e.importFromPathsClicked(e)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var e=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){e.list_extensions=[];for(var n in t)e.list_extensions.push({id:t[n].extension,text:t[n].extension,description:t[n].description,description_url:t[n].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;u--){var h=l[u].trim();0!==h.length&&c.push(h)}this.initChainCallControl({length:c.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:c,preserve_dirs:e,link_data:t,space_to_tab:n,to_posix_lines:i,source:"admin_path",file_type:o,tag_using_filenames:a,dbkey:s})}else d.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(e){var t;switch(e.action){case"adding_datasets":t=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(t({folder_name:this.options.folder_name}));break;case"deleting_datasets":t=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(t());break;case"to_history":t=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(t({history_name:e.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/e.length,this.options.chain_call_control.total_number=e.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(e,t){var n=r("#jstree_browser").jstree().get_selected(!0),a=i.filter(n,function(e){return 0==e.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),s=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),c=this.modal.$el.find(".posix-checkbox").is(":checked"),u=this.select_extension.value(),h=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,_=[];if(a.length<1)d.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=a.length-1;g>=0;g--)void 0!==a[g].li_attr.full_path&&_.push(a[g].li_attr.full_path);if(this.initChainCallControl({length:_.length,action:"adding_datasets"}),"folder"===p){var m=t.source+"_folder";this.chainCallImportingFolders({paths:_,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,file_type:u,dbkey:h,tag_using_filenames:f})}else if("file"===p){var m=t.source+"_file";this.chainCallImportingUserdirFiles({paths:_,file_type:u,dbkey:h,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(e){var t=new h.default.HistoryContents({id:e}),n=this;t.fetch({success:function(t){var i=n.templateHistoryContents();n.histories.get(e).set({contents:t}),n.modal.$el.find("#selected_history_content").html(i({history_contents:t.models.reverse()})),n.modal.$el.find(".history-import-select-all").bind("click",function(){r("#selected_history_content [type=checkbox]").prop("checked",!0)}),n.modal.$el.find(".history-import-unselect-all").bind("click",function(){r("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],n=[],i=[];if(e.length<1)d.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=r(this).closest("li").data("id");if(e){var i=r(this).closest("li").data("name");t.push(e),n.push(i)}});for(var a=t.length-1;a>=0;a--){var o=t[a],s=new h.default.Item;s.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===n[a]?s.set({from_hdca_id:o}):s.set({from_hda_id:o}),i.push(s)}this.initChainCallControl({length:i.length,action:"adding_datasets"}),this.chainCallAddingHdas(i)}},chainCallImportingIntoHistory:function(e,t){var n=this,i=e.pop();if(void 0===i)return 0===this.options.chain_call_control.failed_number?d.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?d.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var l=new h.default.Item({id:e[s]});o.push(l)}for(var s=t.length-1;s>=0;s--){var c=new h.default.FolderAsModel({id:t[s]});o.push(c)}this.options.chain_call_control.total_number=a,this.chainCallDeletingItems(o)}},showLocInfo:function(){var e=null,t=this;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new h.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?d.default.error(t.responseJSON.err_msg):d.default.error("An error occurred.")}}))},showLocInfoModal:function(e){var t=this,n=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Location Details",body:n({library:e,options:t.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(e){switch(e.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),d.default.error("Invalid import source.")}},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(t)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return r("#folder_list_body").find(":checked")},templateToolBar:function(){return i.template(['
    ','
    ','
    ',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
    ","",'
    ',"
    ",'
    ',"
    "].join(""))},templateLocInfoInModal:function(){return i.template(["
    ",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
    library
    name<%- library.get("name") %>
    description<%- library.get("description") %>
    synopsis<%- library.get("synopsis") %>
    created"><%- library.get("create_time_pretty") %>
    id<%- library.get("id") %>
    ",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
    folder
    name<%- options.folder_name %>
    description<%- options.folder_description %>
    id<%- options.id %>
    ","
    "].join(""))},templateNewFolderInModal:function(){return i.template(['
    ',"
    ",'','',"
    ","
    "].join(""))},templateBulkImportInModal:function(){return i.template(["
    ",'
    ',"Select history: ",'","
    ",'
    ',"or create new: ",'',"","
    ","
    "].join(""))},templateImportIntoHistoryProgressBar:function(){return i.template(['
    ',"Importing selected items to history <%= _.escape(history_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateAddingDatasetsProgressBar:function(){return i.template(['
    ',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateDeletingItemsProgressBar:function(){return i.template(['
    ',"
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateBrowserModal:function(){return i.template(['
    ','
    All files you select will be imported into the current folder ignoring their folder structure.
    ','','
    ','",'","
    ",'
    ','",'",'",'","
    ",'",'","
    ",'
    ',"
    ","
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ","
    ",'","
    ","
    "].join(""))},templateImportPathModal:function(){return i.template(['
    ','
    All files within the given folders and their subfolders will be imported into the current folder.
    ','
    ','",'","
    ",'",'","
    ",'',"
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ",'","
    ","
    "].join(""))},templateAddFilesFromHistory:function(){return i.template(['
    ',"
    ","1. Select history: ",'","
    ","
    ",'
    ',"
    ","
    "].join(""))},templateHistoryContents:function(){return i.template(["

    2. Choose the datasets to import:

    ","
    ",'",'","
    ","
    ","
      ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">',"
    • ","<% } else { %>",'
    • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
    • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">','","
    • ","<% } %>","<% } %>","<% }); %>","
    "].join(""))},templatePaginator:function(){return i.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});t.default={FolderToolbarView:_}}).call(t,n(2),n(1),n(0),n(0))},304:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(10),u=a(d),h=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=i.extend(this.options,e),this.options.id&&this.fetchLibrary()},fetchLibrary:function(e){this.options=i.extend(this.options,e),this.model=new c.default.Library({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=i.extend(this.options,e),r(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_library_role_list.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1}));var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var n=this.templateLibraryPermissions();this.$el.html(n({library:this.model,is_admin:t}));var a=this;r.get(Galaxy.root+"api/libraries/"+a.id+"/permissions?scope=current").done(function(e){a.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){s.default.error("An error occurred while attempting to fetch library permissions.")}),r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],n=0;n=0;n--)t.push(e[n].id);return t},savePermissions:function(e){var t=this,n=this._extractIds(this.accessSelectObject.$el.select2("data")),i=this._extractIds(this.addSelectObject.$el.select2("data")),a=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/libraries/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":n,"add_ids[]":i,"manage_ids[]":a,"modify_ids[]":o}).done(function(e){t.showPermissions({fetched_permissions:e}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return i.template(['
    ','","

    ",'Library: <%= _.escape(library.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any library on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Library permissions

    ","

    Roles that can access the library

    ",'
    ','
    ',"User with any of these roles can access this library. If there are no access roles set on the library it is considered unrestricted.","
    ","

    Roles that can manage permissions on this library

    ",'
    ','
    ',"User with any of these roles can manage permissions on this library (includes giving access).","
    ","

    Roles that can add items to this library

    ",'
    ','
    ',"User with any of these roles can add items to this library (folders and datasets).","
    ","

    Roles that can modify this library

    ",'
    ','
    ',"User with any of these roles can modify this library (name, synopsis, etc.).","
    ",'","
    ","
    "].join(""))}});t.default={LibraryView:h}}).call(t,n(2),n(1),n(0))},305:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(10),u=a(d),h=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=i.extend(this.options,e),this.options.id&&this.fetchFolder()},fetchFolder:function(e){this.options=i.extend(this.options,e),this.model=new c.default.FolderAsModel({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=i.extend(this.options,e),r(".tooltip").remove();var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var n=this.templateFolderPermissions();this.$el.html(n({folder:this.model,is_admin:t}));var a=this;r.get(Galaxy.root+"api/folders/"+a.id+"/permissions?scope=current").done(function(e){a.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){s.default.error("An error occurred while attempting to fetch folder permissions.")}),r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],n=0;n=0;n--)t.push(e[n].id);return t},savePermissions:function(e){var t=this,n=this._extractIds(this.addSelectObject.$el.select2("data")),i=this._extractIds(this.manageSelectObject.$el.select2("data")),a=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/folders/"+t.id+"/permissions?action=set_permissions",{"add_ids[]":n,"manage_ids[]":i,"modify_ids[]":a}).done(function(e){t.showPermissions({fetched_permissions:e}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return i.template(['
    ','","

    ",'Folder: <%= _.escape(folder.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any folder on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Folder permissions

    ","

    ","Roles that can manage permissions on this folder","

    ",'
    ','
    ',"User with any of these roles can manage permissions on this folder.","
    ","

    ","Roles that can add items to this folder","

    ",'
    ','
    ',"User with any of these roles can add items to this folder (folders and datasets).","
    ","

    ","Roles that can modify this folder","

    ",'
    ','
    ',"User with any of these roles can modify this folder (name, etc.).","
    ",'","
    ","
    "].join(""))}});t.default={FolderView:h}}).call(t,n(2),n(1),n(0))},306:function(e,t,n){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(307),a=i(r),o=n(308),s=i(o),l=n(309),c=i(l),d=n(310),u=i(d),h=n(311),f=i(h),p=n(312),_=i(p),g=n(313),m=i(g),v=e.Router.extend({initialize:function(){this.routesHit=0,e.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),y=e.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new v,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new f.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new a.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(e){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:e.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new s.default.CategoryView({tool_shed:e.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(e,t){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),category_id:t}):Galaxy.admintoolshedapp.adminShedCategoryView=new c.default.Category({tool_shed:e.replace(/\//g,"%2f"),category_id:t})}),this.admin_toolshed_router.on("route:repository",function(e,t){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),repository_id:t}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:e.replace(/\//g,"%2f"),repository_id:t})}),this.admin_toolshed_router.on("route:status",function(e){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:e.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new _.default.RepoStatus({repositories:e.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new m.default.Workflows}),e.history.start({pushState:!1})}});t.default={GalaxyApp:y}}).call(t,n(2))},307:function(e,t,n){"use strict";(function(e,i){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),o=r(a),s=n(18),l=r(s),c=e.View.extend({defaults:{tool_sheds:[{url:"https://toolshed.g2.bx.psu.edu/",name:"Galaxy Main Tool Shed"}]},initialize:function(e){this.options=i.defaults(this.options||{},this.defaults),this.model=new o.default.ShedsCollection,this.listenTo(this.model,"sync",this.render),this.model.fetch()},el:"#center",render:function(e){this.options=i.defaults(this.options||{},e,this.defaults);var t=this.templateToolshedList;this.$el.html(t({title:"Configured Galaxy Tool Sheds",tool_sheds:this.model.models,queue:l.default.queueLength()}))},reDraw:function(e){this.$el.empty(),this.render(e)},templateToolshedList:i.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','
    ','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
    ",'","
    ","
    ",'
    ',"
    "].join(""))});t.default={ShedListView:c}}).call(t,n(2),n(1))},308:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l);n(30);var d=e.View.extend({el:"#center",defaults:{tool_shed:"https://toolshed.g2.bx.psu.edu/"},initialize:function(e){var t=e.tool_shed.replace(/\//g,"%2f");this.options=i.defaults(this.options||e,this.defaults),this.model=new s.default.Categories,this.listenTo(this.model,"sync",this.render),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.model.tool_shed=t,this.model.fetch()},render:function(e){this.options=i.extend(this.options,e),this.options.categories=this.model.models,this.options.queue=c.default.queueLength();var t=this.templateCategoryList;this.$el.html(t(this.options)),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;r("#search_box").autocomplete({source:function(e,n){var i=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:i};r.post(a,o,function(e){console.log(e);var t=c.default.shedParser(e);n(t)})},minLength:3,select:function(n,i){var r=i.item.value,a=(Galaxy.root,t.model.tool_shed,"repository/s/"+t.model.tool_shed+"/r/"+r);e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.initialize(e)},templateCategoryList:i.template(['",'
    ','
    Categories in <%= tool_shed.replace(/%2f/g, "/") %>
    ','',"
    ",'
    ','",'
    ','','',"","","","","","","<% _.each(categories, function(category) { %>","","",'','',"","<% }); %>","
    NameDescriptionRepositories
    ",'"><%= category.get("name") %>',"<%= category.get("description") %><%= category.get("repositories") %>
    ","
    ","
    "].join(""))});t.default={CategoryView:d}}).call(t,n(2),n(1),n(0))},309:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l);n(30);var d=e.View.extend({el:"#center",initialize:function(e){this.model=new s.default.CategoryCollection,this.listenTo(this.model,"sync",this.render);var t=e.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+t+"&category_id="+e.category_id,this.model.tool_shed=t,this.model.category=e.category_id,this.model.fetch()},render:function(e){this.options=i.extend(this.options,e);var t=this.templateCategoryContents;this.$el.html(t({category:this.model.models[0],tool_shed:this.model.tool_shed,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;r("#search_box").autocomplete({source:function(e,n){var i=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:i};r.post(a,o,function(e){var t=c.default.shedParser(e);n(t)})},minLength:3,select:function(n,i){var r=i.item.value,a="repository/s/"+t.model.tool_shed+"/r/"+r;e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateCategoryContents:i.template(['",'
    ','
    Repositories in <%= category.get("name") %>
    ','',"
    ",'
    ','",'
    ','','',"",'','',"",'',"","",'<% _.each(category.get("repositories"), function(repository) { %>',"","","","","","","<% }); %>","
    OwnerNameSynopsisType
    <%= repository.owner %>",'","<%= repository.description %><%= repository.type %>
    ","
    ","
    "].join(""))});t.default={Category:d}}).call(t,n(2),n(1),n(0))},310:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(127),c=(a(l),n(3)),d=a(c),u=n(8),h=a(u),f=n(11),p=a(f),_=n(18),g=a(_),m=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||{},this.defaults),this.model=new s.default.RepositoryCollection,this.listenTo(this.model,"sync",this.render);var t=e.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+t+"&repository_id="+e.repository_id,this.model.tool_shed_url=e.tool_shed.replace(/%2f/g,"/"),this.model.tool_shed=t,this.model.category=e.repository_id,this.model.fetch()},render:function(e){var t=this.templateRepoDetails,n=this.model.models[0];this.options={repository:n.get("repository"),tool_shed:this.model.tool_shed,queue:g.default.queueLength()};var a=Object.keys(this.options.repository.metadata).sort(function(e,t){return parseInt(e.split(":")[0]-t.split(":")[0])}),o={},s=this.options.repository.metadata;a.forEach(function(e){o[e]=s[e]}),this.options.repository.metadata=o,this.options.current_changeset=this.options.current_changeset||a[a.length-1],this.options.current_metadata=this.options.repository.metadata[this.options.current_changeset],this.options.current_metadata.tool_shed_url=this.model.tool_shed_url,this.options.tools=this.options.current_metadata.tools,this.options.repository_dependencies_template=this.templateRepoDependencies,this.options.repository_dependency_template=this.templateRepoDependency,this.options.tps_template_global_select=this.templateGlobalSectionSelect,this.options.tps_template_tool_select=this.templateToolSectionSelect,this.options.tps_select_options=this.templatePanelSelectOptions,this.options.tool_dependencies=n.get("tool_dependencies"),this.options.shed_tool_conf=this.templateShedToolConf({stc_html:n.get("shed_conf")}),this.options.panel_section_dict=n.get("panel_section_dict"),this.options.api_url=Galaxy.root+"api/tool_shed_repositories/install?async=True",this.options=i.extend(this.options,e),this.$el.html(t(this.options)),this.checkInstalled(this.options.current_metadata),this.bindEvents(),r("#center").css("overflow","auto")},bindEvents:function(){var e=this;r("#changeset").on("change",function(){e.options.current_changeset=r("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset],e.checkInstalled(e.options.current_metadata),e.reDraw(e.options)}),r("#tool_panel_section_select").on("change",function(){e.tpsSelection()}),r("#install_repository").on("click",function(t){r("#repository_installation");t.preventDefault();var n={};n.repositories=JSON.stringify([[r("#install_repository").attr("data-tsrid"),r("#changeset").find("option:selected").val()]]),n.tool_shed_repository_ids=JSON.stringify([r("#install_repository").attr("data-tsrid")]),n.tool_shed_url=e.model.tool_shed_url,n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val();e.panelSelect(n);n.tool_panel_section=JSON.stringify(e.panelSelect(n)),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.changeset=r("#changeset").find("option:selected").val();var i=r("#repository_installation").attr("action");e.prepareInstall(n,i)}),r("#queue_install").on("click",function(t){e.options.current_changeset=r("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset];var n=(e.options.current_changeset,{});i.each(Object.keys(e.options.current_metadata),function(t){n[t]||(n[t]=e.options.current_metadata[t])}),n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val(),n.tool_panel_section=JSON.stringify(e.panelSelect({})),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.tool_shed_url=e.model.tool_shed_url,"/"==n.tool_shed_url.substr(-1)&&(n.tool_shed_url=n.tool_shed_url.substr(0,n.tool_shed_url.length-1)),g.default.addToQueue(n),e.checkInstalled(n)}),r(".tool_panel_section_picker").on("change",function(){r(this).find("option:selected").val()==r("#tool_panel_section_select").find("option:selected").val()?r(this).attr("default","active"):r(this).removeAttr("default")}),r(function(){r("#repository_dependencies").jstree()}),r(".tool_form").on("click",function(){var t=r(this).attr("data-guid"),n=(r(this).attr("data-clean"),r(this).attr("data-name")),i=r(this).attr("data-desc"),a=e.model.tool_shed_url,o=r("#repository_details").attr("data-tsrid"),s=r("#changeset").find("option:selected").val(),l=Galaxy.root+"api/tool_shed/tool_json",c={guid:t,tool_shed_url:a,tsr_id:o,changeset:s};r.get(l,c,function(e){e.cls="ui-portlet-plain";var t=new p.default(e);d.default.deepeach(e.inputs,function(e){e.type&&-1!=["data","data_collection"].indexOf(e.type)&&(e.type="hidden",e.info="Data input '"+e.name+"' ("+d.default.textify(e.extensions)+")")});var r=new h.default.View,a=""+n+" "+i;r.show({closing_events:!0,title:a,body:t.$el,buttons:{Close:function(){r.hide()}}})})})},checkInstalled:function(e){var t=this,n={name:e.name,owner:e.owner},i=!1;t.repoQueued(e);r.get(Galaxy.root+"api/tool_shed_repositories",n,function(n){for(var a=0;a','
    Repository information for <%= repository.name %> from <%= repository.owner %>
    ','',"
    ",'
    ','
    ','','','
    ','
    Changeset
    ','
    ','",'','','
    Please select a revision and review the settings below before installing.
    ',"
    ","
    ","<%= shed_tool_conf %>","<% if (current_metadata.has_repository_dependencies) { %>",'
    Repository dependencies for <%= current_changeset %>
    ','
    ','

    ','','',"

    ","<% current_metadata.repository_dependency_template = repository_dependency_template; %>",'
    ','","<%= repository_dependencies_template(current_metadata) %>","
    ","
    ","<% } %>","<% if (current_metadata.includes_tool_dependencies) { %>",'
    Tool dependencies
    ','
    ','

    ','','',"

    ",'

    ','','',"

    ",'
    ','",'',"",'','',"","","","",'',"<% _.each(tool_dependencies[current_changeset], function(dependency) { %>",'','","","","","<% }); %>","","
    NameVersionType
    ',"<%= dependency.name %><%= dependency.version %><%= dependency.type %>
    ","
    ","
    ","<% } %>","<% if (current_metadata.includes_tools_for_display_in_tool_panel) { %>",'
    Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
    ','
    ','
    ','',"",'','',"","","","",'',"<% _.each(current_metadata.tools, function(tool) { %>",'','","",'','","","<% }); %>","","
    NameDescriptionVersion<%= tps_template_global_select({tps: panel_section_dict, tps_select_options: tps_select_options}) %>
    ','","<%= tool.description %><%= tool.version %>',"<%= tps_template_tool_select({tool: tool, tps: panel_section_dict, tps_select_options: tps_select_options}) %>","
    ","
    ","
    ","<% } %>","
    ","
    "].join("")),templateRepoDependencies:i.template(['
    Repository Dependencies
    ','
    ',"
      ","
    • Repository installation requires the following","<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","<% } %>","
    • ","
    ","
    "].join("")),templateRepoDependency:i.template(['
  • ',"Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %>","<% if (has_repository_dependencies) { %>",'
      ',"<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","
    ","<% } %>","
  • "].join("")),templateShedToolConf:i.template(['
    Shed tool configuration file:
    ','
    ','
    ',"<%= stc_html %>",'
    Select the file whose tool_path setting you want used for installing repositories.
    ',"
    ","
    "].join("")),templateToolDependency:i.template(["<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% if (dependency.includes_tool_dependencies) { %>","<% dependency.tool_dependency_template = tool_dependency_template %>","<%= tool_dependency_template(dependency) %>","<% } %>","<% }); %>","<% } %>"].join("")),templateGlobalSectionCreate:i.template(['
    ','
    ','','','
    ',"Add a new tool panel section to contain the installed tools (optional).","
    ","
    ","
    "].join("")),templateGlobalSectionSelect:i.template(['
    ','
    Tool Panel Section
    ','
    ','
    ','",'','
    ',"Select an existing tool panel section to contain the installed tools (optional).","
    ","
    ","
    ","
    "].join("")),templateToolSectionCreate:i.template(['
    ','','',"
    "].join("")),templateToolSectionSelect:i.template(['
    ','",'','
    ',"
    "].join("")),templatePanelSelectOptions:i.template(["<% _.each(sections, function(section) { %>",'',"<% }); %>"].join(""))});t.default={RepoDetails:m}}).call(t,n(2),n(1),n(0))},311:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l),d=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new s.default.RepoQueue,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,n=t.templateRepoQueue,r=t.model.models;t.$el.html(n({title:"Repository Installation Queue",repositories:r,queue:c.default.queueLength()})),i("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t=this;i(".install_one").on("click",function(){var e=t.loadFromQueue(i(this).attr("data-repokey"));t.installFromQueue(e,i(this).attr("data-repokey"))}),i(".remove_one").on("click",function(){var e=i(this).attr("data-repokey"),t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e)){var n=t[e].repository.id;delete t[e],i("#queued_repository_"+n).remove()}localStorage.repositories=JSON.stringify(t)}),i("#clear_queue").on("click",function(){localStorage.repositories="{}"}),i("#from_workflow").on("click",function(){e.history.navigate("workflows",{trigger:!0,replace:!0})})},installFromQueue:function(t,n){var r=Object();r.install_tool_dependencies=t.install_tool_dependencies,r.install_repository_dependencies=t.install_repository_dependencies,r.install_resolver_dependencies=t.install_resolver_dependencies,r.tool_panel_section=t.tool_panel_section,r.shed_tool_conf=t.shed_tool_conf,r.repositories=JSON.stringify([[t.repository.id,t.changeset_revision]]),r.tool_shed_repository_ids=JSON.stringify([t.repository.id]),r.tool_shed_url=n.split("|")[0],r.changeset=t.changeset_revision;var a=Galaxy.root+"api/tool_shed_repositories/install?async=True";if(i("#queued_repository_"+t.repository.id).remove(),localStorage.repositories){void 0===n&&(n=c.default.queueKey(t));var o=JSON.parse(localStorage.repositories);o.hasOwnProperty(n)&&(delete o[n],localStorage.repositories=JSON.stringify(o))}i.post(a,r,function(t){var n=JSON.parse(t),r=n.repositories,a="status/r/"+r.join("|");i.post(Galaxy.root+"admin_toolshed/install_repositories",n,function(e){console.log("Initializing repository installation succeeded")}),e.history.navigate(a,{trigger:!0,replace:!0})})},loadFromQueue:function(e){var t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e))return t[e]},reDraw:function(e){this.$el.empty(),this.initialize(e),this.model.fetch(),this.render(e)},templateRepoQueue:r.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','','',"",'','','','','','',"","","","<% _.each(repositories, function(repository) { %>",'">','','','','','",'","","<% }); %>","","
    NameOwnerRevisionToolShedInstall
    <%= repository.get("repository").name %><%= repository.get("repository").owner %><%= repository.get("changeset_revision") %><%= repository.get("tool_shed_url") %>','" type="submit" id="install_repository_<%= repository.get("id") %>" name="install_repository" value="Install now" />',"','" type="submit" id="unqueue_repository_<%= repository.get("id") %>" name="unqueue_repository" value="Remove from queue" />',"
    ",'',"
    "].join(""))});t.default={RepoQueueView:d}}).call(t,n(2),n(0),n(1))},312:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l),d=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||[{}],e,this.defaults),this.model=new s.default.RepoStatus,this.listenTo(this.model,"sync",this.render),this.model.url+="?repositories="+this.options.repositories.join("|"),this.model.fetch(),this.timer=setInterval(function(e){var t=["installed","error"],n=!0;i.some(e.model.models,function(e){repo_id=e.get("id");var i=e.get("status").toLowerCase();if(-1===t.indexOf(i))return n=!1,!0}),n?clearInterval(e.timer):e.model.fetch()},2e3,this)},close:function(){clearInterval(this.timer)},render:function(e){this.options=i.extend(this.options,e);var t=this.templateRepoStatus;this.$el.html(t({title:"Repository Status",repositories:this.model.models,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateRepoStatus:i.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','',"","",'',"<% _.each(repositories, function(repository) { %>","","","","","","","","<% }); %>","",'',"
    NameDescriptionOwnerRevisionInstallation Status
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    "].join(""))});t.default={RepoStatus:d}}).call(t,n(2),n(1),n(0))},313:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l),d=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new s.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,n=t.templateWorkflows,r=t.model.models;t.$el.html(n({title:"Workflows Missing Tools",workflows:r,queue:c.default.queueLength()})),i("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t,n=this;i(".show_wf_repo").on("click",function(){var n=i(this).attr("data-toolids"),r=i(this).attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){t=n.repository.id;var i="repository/s/"+r.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+n.repository.id;e.history.navigate(i,{trigger:!0,replace:!0})})}),i(".queue_wf_repo").on("click",function(){var e=i(this),n=e.attr("data-toolids"),r=e.attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){t=n.repository.id,o={tool_shed_url:r,repository_id:t},i.get(a,o,function(t){var n=Object.keys(t.repository.metadata),i=n[0],a=t.repository.metadata[i];a.tool_shed_url=r,c.default.addToQueue(a),e.remove()})})}),i("#from_workflow").on("click",n.loadWorkflows)},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateWorkflows:r.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});t.default={Workflows:d}}).call(t,n(2),n(0),n(1))},61:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={tool:"fa-wrench",data_input:"fa-file-o",data_collection_input:"fa-folder-o",subworkflow:"fa-sitemap fa-rotate-270",pause:"fa-pause"}}},[284]); \ No newline at end of file +f=!0,p=0,_=o.data.nodes.length;p<_;p++)if(g=o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",m=u,"move_node"===g&&"a"===j&&o.data.origin&&o.data.origin===w&&d===w.get_parent(o.data.nodes[p])&&(v=w.get_node(d),m>e.inArray(o.data.nodes[p],v.children)&&(m-=1)),!(f=f&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(g,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],d,m,{dnd:!0,ref:w.get_node(x.parent()),pos:j,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(n=w.last_error());break}if(f)return"i"===j&&x.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(i=setTimeout(function(e,t){return function(){e.open_node(t)}}(w,x),w.settings.dnd.open_timeout)),t={ins:w,par:d,pos:"i"!==j||"last"!==y||0!==u||w.is_loaded(b)?u:"last"},r.css({left:s+"px",top:l+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),n={},h=!0,!1}),!0===h))return}else{for(f=!0,p=0,_=o.data.nodes.length;p<_&&(f=f&&w.check(o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],"#","last",{dnd:!0,ref:w.get_node("#"),pos:"i",is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin}));p++);if(f)return t={ins:w,par:"#",pos:"last"},r.hide(),void o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok")}t=!1,o.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),r.hide()}}).bind("dnd_scroll.vakata",function(e,n){n&&n.data&&n.data.jstree&&(r.hide(),t=!1,n.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(a,o){if(i&&clearTimeout(i),o&&o.data&&o.data.jstree){r.hide();var s,l,c=[];if(t){for(s=0,l=o.data.nodes.length;s").html(r).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove touchmove",e.vakata.dnd.drag),e(document).bind("mouseup touchend",e.vakata.dnd.stop),!1},drag:function(n){if("touchmove"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_down){if(!t.is_drag){if(!(Math.abs(n.pageX-t.init_x)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)||Math.abs(n.pageY-t.init_y)>(t.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",n)}var i=!1,r=!1,a=!1,o=!1,s=!1,l=!1,c=!1,d=!1,u=!1,h=!1;return t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,e(e(n.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var i=e(this),r=i.offset();if(this.scrollHeight>this.offsetHeight&&(r.top+i.height()-n.pageYthis.offsetWidth&&(r.left+i.width()-n.pageXo&&n.pageY-co&&o-(n.pageY-c)l&&n.pageX-dl&&l-(n.pageX-d)a&&(u=a-50),s&&h+t.helper_w>s&&(h=s-(t.helper_w+2)),t.helper.css({left:h+"px",top:u+"px"})),e.vakata.dnd._trigger("move",n),!1}},stop:function(n){if("touchend"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),t.is_drag)e.vakata.dnd._trigger("stop",n);else if("touchend"===n.type&&n.target===t.target){var i=setTimeout(function(){e(n.target).click()},100);e(n.target).one("click",function(){i&&clearTimeout(i)})}return e.vakata.dnd._clean(),!1}}}(e),e.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},e.jstree.plugins.search=function(t,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],this.element.on("before_open.jstree",e.proxy(function(t,n){var i,r,a=this._data.search.res,o=[],s=e();if(a&&a.length&&(this._data.search.dom=e(this.element[0].querySelectorAll("#"+e.map(a,function(t){return-1!=="0123456789".indexOf(t[0])?"\\3"+t[0]+" "+t.substr(1).replace(e.jstree.idregex,"\\$&"):t.replace(e.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this.settings.search.show_only_matches&&this._data.search.res.length)){for(i=0,r=a.length;i32&&(n.fuzzy=!1),n.fuzzy&&(i=1<=p;l--)if(m=r[t.charAt(l-1)],g[l]=0===o?(g[l+1]<<1|1)&m:(g[l+1]<<1|1)&m|(f[l+1]|f[l])<<1|1|f[l+1],g[l]&i&&(x=a(o,l-1))<=y){if(y=x,b=l-1,k.push(b),!(b>s))break;p=Math.max(1,2*s-b)}if(a(o+1,s)>y)break;f=g}return{isMatch:b>=0,score:x}},!0===t?{search:o}:o(t)}}(e),e.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},e.jstree.plugins.sort=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("model.jstree",e.proxy(function(e,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",e.proxy(function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)},this))},this.sort=function(t,n){var i,r;if((t=this.get_node(t))&&t.children&&t.children.length&&(t.children.sort(e.proxy(this.settings.sort,this)),n))for(i=0,r=t.children_d.length;it.ttl)&&(t&&t.state&&(t=t.state),t&&e.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),!!t&&(this.element.one("set_state.jstree",function(n,i){i.instance.trigger("restore_state",{state:e.extend(!0,{},t)})}),this.set_state(t),!0))},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}},function(e,t){e.vakata.storage={set:function(e,t){return window.localStorage.setItem(e,t)},get:function(e){return window.localStorage.getItem(e)},del:function(e){return window.localStorage.removeItem(e)}}}(e),e.jstree.defaults.types={"#":{},default:{}},e.jstree.plugins.types=function(n,i){this.init=function(e,n){var r,a;if(n&&n.types&&n.types.default)for(r in n.types)if("default"!==r&&"#"!==r&&n.types.hasOwnProperty(r))for(a in n.types.default)n.types.default.hasOwnProperty(a)&&n.types[r][a]===t&&(n.types[r][a]=n.types.default[a]);i.init.call(this,e,n),this._model.data["#"].type="#"},this.refresh=function(e,t){i.refresh.call(this,e,t),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",e.proxy(function(e,n){var i,r,a=this._model.data,o=n.nodes,s=this.settings.types,l="default";for(i=0,r=o.length;i .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation();var n=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor:eq(0)").trigger(n).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",e.proxy(function(e){return e.stopImmediatePropagation(),this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),n.teardown.call(this)},this.redraw_node=function(t,i,r){if(t=n.redraw_node.call(this,t,i,r)){var a=p.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(a.className+=" jstree-wholerow-clicked"),t.insertBefore(a,t.childNodes[0])}return t}}}})},13:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=n(297),r=function(e){return e&&e.__esModule?e:{default:e}}(i),a=e.Model.extend({urlRoot:Galaxy.root+"api/libraries/",isVisible:function(e){var t=!0;return!e&&this.get("deleted")&&(t=!1),t}}),o=e.Collection.extend({urlRoot:Galaxy.root+"api/libraries",model:a,initialize:function(e){e=e||{}},search:function(e){if(""==e)return this;var t=e.toLowerCase();return this.filter(function(e){return-1!==e.get("name").toLowerCase().indexOf(t)})},getVisible:function(e,t){return t=t||[],new o(this.filter(function(t){return t.isVisible(e)}))},sortLibraries:function(e,t){this.comparator=r.default.generateLibraryComparator(e,t),this.sort()}}),s=e.Model.extend({}),l=s.extend({urlRoot:Galaxy.root+"api/libraries/datasets/"}),c=s.extend({urlRoot:Galaxy.root+"api/folders/"}),d=e.Collection.extend({model:s,sortFolder:function(e,t){this.comparator=r.default.generateFolderComparator(e,t),this.sort()}}),u=e.Model.extend({defaults:{folder:new d,urlRoot:Galaxy.root+"api/folders/",id:"unknown"},parse:function(e){this.get("folder").reset();for(var t=0;t ').addClass(i);t.before(r)}}Object.defineProperty(t,"__esModule",{value:!0});var l=n(3),c=a(l),d=n(4),u=a(d),h=n(286),f=a(h),p=n(287),_=a(p),g=n(288),m=a(g),v=n(61),y=a(v),b=n(293),w=a(b),x=n(6),k=a(x),j=n(79),M=a(j),C=n(7);!function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e}(C);n(20),window.workflow_globals=window.workflow_globals||{},t.default=i.View.extend({initialize:function(t){function n(){var t=e('

    ');window.show_modal("Save As a New Workflow",t,{OK:function(){var t=e("#workflow_rename").val().length>0?e("#workflow_rename").val():"SavedAs_"+l.workflow.name,n=e("#wf_annotation").val().length>0?e("#wf_annotation").val():"";e.ajax({url:l.urls.workflow_save_as,type:"POST",data:{workflow_name:t,workflow_annotation:n,workflow_data:function(){return JSON.stringify(l.workflow.to_simple())}}}).done(function(e){window.onbeforeunload=void 0,window.location=Galaxy.root+"workflow/editor?id="+e,hide_modal()}).fail(function(){hide_modal(),alert("Saving this workflow failed. Please contact this site's administrator.")})},Cancel:hide_modal})}function i(){l.workflow.layout(),l.workflow.fit_canvas_to_nodes(),l.scroll_to_nodes(),l.canvas_manager.draw_overview()}function a(){e.jStorage.set("overview-off",!1),e("#overview-border").css("right","0px"),e("#close-viewport").css("background-position","0px 0px")}function s(){e.jStorage.set("overview-off",!0),e("#overview-border").css("right","20000px"),e("#close-viewport").css("background-position","12px 0px")}var l=window.workflow_globals.app=this;this.options=t,this.urls=t&&t.urls||{};var c=function(){if(l.workflow.check_changes_in_active_form(),workflow&&l.workflow.has_changes){var e=function(){window.onbeforeunload=void 0,window.document.location=l.urls.workflow_index};window.show_modal("Close workflow editor","There are unsaved changes to your workflow which will be lost.",{Cancel:hide_modal,"Save Changes":function(){d(null,e)}},{"Don't Save":e})}else window.document.location=l.urls.workflow_index},d=function(t,n){if(show_message("Saving workflow","progress"),l.workflow.check_changes_in_active_form(),!l.workflow.has_changes)return hide_modal(),void(n&&n());l.workflow.rectify_workflow_outputs(),u.default.request({url:Galaxy.root+"api/workflows/"+l.options.id,type:"PUT",data:{workflow:l.workflow.to_simple()},success:function(t){var i=e("
    ").text(t.message);if(t.errors){i.addClass("warningmark");var r=e("
    WorkflowsTool IDsShedNameOwnerActions
    ','
      ','<% _.each(workflow.get("workflows"), function(name) { %>','
    • <%= name %>
    • ',"<% }); %>","
    ","
    ','
      ','<% _.each(workflow.get("tools"), function(tool) { %>','
    • <%= tool %>
    • ',"<% }); %>","
    ","
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>','
      ','
    • ','" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • ',"
    ","
    ',"",'','','','','','','','',' ',"",'','',"","","","","","","","","","","","
    name description data type sizetime updated (UTC)state
    ",'" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..',"
    ",'"].join(""))}});t.default={FolderListView:h}}).call(t,n(2),n(1),n(0))},299:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(126),u=a(d),h=e.View.extend({events:{"click .undelete_dataset_btn":"undeleteDataset","click .undelete_folder_btn":"undeleteFolder","click .edit_folder_btn":"startModifications","click .cancel_folder_btn":"cancelModifications","click .save_folder_btn":"saveModifications"},defaults:{type:null,visibility_config:{edit_folder_btn:!1,save_folder_btn:!1,cancel_folder_btn:!1,permission_folder_btn:!1},edit_mode:!1},initialize:function(e){this.options=i.defaults(e||{},this.defaults),this.render(this.options)},render:function(e){this.options=i.extend(this.options,e);var t=this.options.model,n=null;return"folder"===t.get("type")||"LibraryFolder"===t.get("model_class")?(this.options.type="folder",this.prepareButtons(t),n=t.get("deleted")?this.templateRowDeletedFolder():this.templateRowFolder()):"file"===t.get("type")||"LibraryDatasetDatasetAssociation"===t.get("model_class")||"LibraryDataset"===t.get("model_class")?(this.options.type="file",n=t.get("deleted")?this.templateRowDeletedFile():this.templateRowFile()):(Galaxy.emit.error("Unknown library item type found."),Galaxy.emit.error(t.get("type")||t.get("model_class"))),this.setElement(n({content_item:t,edit_mode:this.options.edit_mode,button_config:this.options.visibility_config})),this.$el.show(),this},prepareButtons:function(e){var t=this.options.visibility_config;!1===this.options.edit_mode?(t.save_folder_btn=!1,t.cancel_folder_btn=!1,!0===e.get("deleted")?(t.edit_folder_btn=!1,t.permission_folder_btn=!1):!1===e.get("deleted")&&(t.save_folder_btn=!1,t.cancel_folder_btn=!1,!0===e.get("can_modify")&&(t.edit_folder_btn=!0),!0===e.get("can_manage")&&(t.permission_folder_btn=!0))):!0===this.options.edit_mode&&(t.edit_folder_btn=!1,t.permission_folder_btn=!1,t.save_folder_btn=!0,t.cancel_folder_btn=!0),this.options.visibility_config=t},showDatasetDetails:function(){Galaxy.libraries.datasetView=new u.default.LibraryDatasetView({id:this.id})},undeleteDataset:function(e){r(".tooltip").hide();var t=this,n=r(e.target).closest("tr").data("id"),i=Galaxy.libraries.folderListView.collection.get(n);i.url=i.urlRoot+i.id+"?undelete=true",i.destroy({success:function(e,i){Galaxy.libraries.folderListView.collection.remove(n);var r=new c.default.Item(i);Galaxy.libraries.folderListView.collection.add(r),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),s.default.success("Dataset undeleted. Click this to see it.","",{onclick:function(){var e=t.model.get("folder_id");window.location=Galaxy.root+"library/list#folders/"+e+"/datasets/"+t.id}})},error:function(e,t){void 0!==t.responseJSON?s.default.error("Dataset was not undeleted. "+t.responseJSON.err_msg):s.default.error("An error occured! Dataset was not undeleted. Please try again.")}})},undeleteFolder:function(e){r(".tooltip").hide();var t=r(e.target).closest("tr").data("id"),n=Galaxy.libraries.folderListView.collection.get(t);n.url=n.urlRoot+n.id+"?undelete=true",n.destroy({success:function(e,n){Galaxy.libraries.folderListView.collection.remove(t);var i=new c.default.FolderAsModel(n);Galaxy.libraries.folderListView.collection.add(i),Galaxy.libraries.folderListView.collection.sortFolder("name","asc"),s.default.success("Folder undeleted.")},error:function(e,t){void 0!==t.responseJSON?s.default.error("Folder was not undeleted. "+t.responseJSON.err_msg):s.default.error("An error occured! Folder was not undeleted. Please try again.")}})},startModifications:function(){this.options.edit_mode=!0,this.repaint()},cancelModifications:function(){this.options.edit_mode=!1,this.repaint()},saveModifications:function(){var e=Galaxy.libraries.folderListView.collection.get(this.$el.data("id")),t=!1,n=this.$el.find(".input_folder_name").val();if(void 0!==n&&n!==e.get("name")){if(!(n.length>2))return void s.default.warning("Folder name has to be at least 3 characters long.");e.set("name",n),t=!0}var i=this.$el.find(".input_folder_description").val();if(void 0!==i&&i!==e.get("description")&&(e.set("description",i),t=!0),t){var r=this;e.save(null,{patch:!0,success:function(e){r.options.edit_mode=!1,r.repaint(e),s.default.success("Changes to folder saved.")},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg):s.default.error("An error occured while attempting to update the folder.")}})}else this.options.edit_mode=!1,this.repaint(e),s.default.info("Nothing has changed.")},repaint:function(){r(".tooltip").hide();var e=this.$el;this.render(),e.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},templateRowFolder:function(){return i.template(['',"",'',"",'',"<% if(!edit_mode) { %>","",'<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","<% } else if(edit_mode){ %>",'','',"<% } %>","folder","","",'<%= _.escape(content_item.get("update_time")) %>',"","","","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","",""].join(""))},templateRowFile:function(){return i.template(['',"",'',"",'','',"","",'/datasets/<%- content_item.id %>" class="library-dataset">','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>','<%= _.escape(content_item.get("file_ext")) %>','<%= _.escape(content_item.get("file_size")) %>','<%= _.escape(content_item.get("update_time")) %>',"",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'<% if (content_item.get("is_unrestricted")) { %>','',"<% } %>",'<% if (content_item.get("is_private")) { %>','',"<% } %>",'<% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %>','',"<% } %>",'<% if (content_item.get("can_manage")) { %>','/datasets/<%- content_item.id %>/permissions">','","","<% } %>","",""].join(""))},templateRowDeletedFile:function(){return i.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("message") %>',"","",'<%= _.escape(content_item.get("file_ext")) %>',"","",'<%= _.escape(content_item.get("file_size")) %>',"","",'<%= _.escape(content_item.get("update_time")) %>',"","",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","","",'','","",""].join(""))},templateRowDeletedFolder:function(){return i.template(['',"",'',"","",'','<%- content_item.get("name") %>',"","",'<%- content_item.get("description") %>',"","","folder","","","",'<%= _.escape(content_item.get("update_time")) %>',"","","",'','","",""].join(""))}});t.default={FolderRowView:h}}).call(t,n(2),n(1),n(0))},300:function(e,t,n){"use strict";(function(e,i){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),o=r(a),s=n(13),l=r(s),c=n(301),d=r(c),u=n(1),h=r(u),f=e.View.extend({el:"#libraries_element",events:{"click .sort-libraries-link":"sort_clicked"},defaults:{page_count:null,show_page:null,all_fetched:!1},initialize:function(e){this.options=h.default.defaults(this.options||{},e,this.defaults);var t=this;this.modal=null,this.collection=new l.default.Libraries,this.collection.url=this.collection.urlRoot+"?deleted=false",this.collection.fetch({success:function(){t.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})},render:function(e){this.options=h.default.extend(this.options,e),this.setElement("#libraries_element");var t=this.templateLibraryList(),n=null,r=null,a=function(e){return!0===e.get("public")};if(i(".tooltip").hide(),void 0!==e&&(r=void 0!==e.models?e.models:null),null!==this.collection&&null===r)this.sortLibraries(),n=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a));else if(null!==r){if(Galaxy.libraries.preferences.get("with_deleted"))n=r;else{var o=function(e){return!1===e.get("deleted")};n=h.default.filter(r,o)}Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a))}else n=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=n.length;var s=Galaxy.libraries.preferences.get("library_page_size")*(this.options.show_page-1);this.options.page_count=Math.ceil(this.options.total_libraries_count/Galaxy.libraries.preferences.get("library_page_size")),this.options.total_libraries_count>0&&sthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(n=[]),this.$el.html(t({length:1,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options),this.renderRows(n)):(this.$el.html(t({length:0,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options)),i("#center [data-toggle]").tooltip(),i("#center").css("overflow","auto")},fetchDeleted:function(){if(this.options.all_fetched)this.render();else{var e=this;this.collection.url=this.collection.urlRoot+"?deleted=true",this.collection.fetch({remove:!1,success:function(){e.options.all_fetched=!0,e.render()},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occurred.")}})}},renderRows:function(e){for(var t=0;t',"<% if(length === 0) { %>","<% if(search_term.length > 0) { %>","
    ","There are no libraries matching your search. Try different keyword.","
    ","<% } else{ %>","
    ","There are no libraries visible to you here. If you expected some to show up please consult the",' library security wikipage',' or visit the Galaxy support site.',"
    ","<% }%>","<% } else{ %>",'',"",'",'',' ','',"",'',"","
    ','',"name","",'',"descriptionsynopsis
    ","<% }%>","
    "].join(""))}});t.default={LibraryListView:f}}).call(t,n(2),n(0))},301:function(e,t,n){"use strict";(function(e,i,r){Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=e.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library"},edit_mode:!1,element_visibility_config:{upload_library_btn:!1,edit_library_btn:!1,permission_library_btn:!1,save_library_btn:!1,cancel_library_btn:!1,delete_library_btn:!1,undelete_library_btn:!1},initialize:function(e){this.render(e)},render:function(e){void 0===e&&(e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))),this.prepareButtons(e);var t=this.templateRow();return this.setElement(t({library:e,button_config:this.element_visibility_config,edit_mode:this.edit_mode})),this.$el.show(),this},repaint:function(e){i(".tooltip").hide();var t=this.$el;this.render(),t.replaceWith(this.$el),this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){var t=this.element_visibility_config;!1===this.edit_mode?(t.save_library_btn=!1,t.cancel_library_btn=!1,t.delete_library_btn=!1,!0===e.get("deleted")?(t.undelete_library_btn=!0,t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1):!1===e.get("deleted")&&(t.save_library_btn=!1,t.cancel_library_btn=!1,t.undelete_library_btn=!1,!0===e.get("can_user_add")&&(t.upload_library_btn=!0),!0===e.get("can_user_modify")&&(t.edit_library_btn=!0),!0===e.get("can_user_manage")&&(t.permission_library_btn=!0))):!0===this.edit_mode&&(t.upload_library_btn=!1,t.edit_library_btn=!1,t.permission_library_btn=!1,t.save_library_btn=!0,t.cancel_library_btn=!0,t.delete_library_btn=!0,t.undelete_library_btn=!1),this.element_visibility_config=t},edit_button_clicked:function(){this.edit_mode=!0,this.repaint()},cancel_library_modification:function(){this.edit_mode=!1,this.repaint()},save_library_modification:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=!1,n=this.$el.find(".input_library_name").val();if(void 0!==n&&n!==e.get("name")){if(!(n.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");e.set("name",n),t=!0}var i=this.$el.find(".input_library_description").val();void 0!==i&&i!==e.get("description")&&(e.set("description",i),t=!0);var r=this.$el.find(".input_library_synopsis").val();if(void 0!==r&&r!==e.get("synopsis")&&(e.set("synopsis",r),t=!0),t){var a=this;e.save(null,{patch:!0,success:function(e){a.edit_mode=!1,a.repaint(e),o.default.success("Changes to library saved.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while attempting to update the library.")}})}else this.edit_mode=!1,this.repaint(e),o.default.info("Nothing has changed.")},delete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.destroy({success:function(e){e.set("deleted",!0),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,!1===Galaxy.libraries.preferences.get("with_deleted")?(i(".tooltip").hide(),t.repaint(e),t.$el.remove()):!0===Galaxy.libraries.preferences.get("with_deleted")&&t.repaint(e),o.default.success("Library has been marked deleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured during deleting the library.")}})},undelete_library:function(){var e=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),t=this;e.url=e.urlRoot+e.id+"?undelete=true",e.destroy({success:function(e){e.set("deleted",!1),Galaxy.libraries.libraryListView.collection.add(e),t.edit_mode=!1,t.repaint(e),o.default.success("Library has been undeleted.")},error:function(e,t){void 0!==t.responseJSON?o.default.error(t.responseJSON.err_msg):o.default.error("An error occured while undeleting the library.")}})},templateRow:function(){return r.template(['" style="display:none;" data-id="<%- library.get("id") %>">',"<% if(!edit_mode) { %>",'<% if(library.get("deleted")) { %>','<%- library.get("name") %>',"<% } else { %>",'"><%- library.get("name") %>',"<% } %>",'<% if(library.get("description")) { %>','<% if( (library.get("description")).length> 80 ) { %>','"><%= _.escape(library.get("description")).substring(0, 80) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("description"))%>',"<% } %>","<% } else { %>","","<% } %>",'<% if(library.get("synopsis")) { %>','<% if( (library.get("synopsis")).length> 120 ) { %>','"><%= _.escape(library.get("synopsis")).substring(0, 120) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("synopsis"))%>',"<% } %>","<% } else { %>","","<% } %>","<% } else if(edit_mode){ %>",'','','',"<% } %>",'','<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',' ',"<% }%>",'','/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});t.default={LibraryRowView:s}}).call(t,n(2),n(0),n(1))},302:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(7),c=a(l),d=n(13),u=a(d),h=e.View.extend({el:"#center",defaults:{search_term:""},events:{"click #create_new_library_btn":"createLibraryFromModal","click #include_deleted_chk":"includeDeletedChecked","click #exclude_restricted_chk":"excludeRestrictedChecked","click .page_size_prompt":"showPageSizePrompt","keyup .library-search-input":"searchLibraries"},initialize:function(e){this.options=i.defaults(this.options||{},e,this.defaults),this.render()},render:function(){var e=this.templateToolBar(),t=!1,n=!0;Galaxy.user&&(t=Galaxy.user.isAdmin(),n=Galaxy.user.isAnonymous()),this.$el.html(e({admin_user:t,anon_user:n})),t&&(this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted"),this.$el.find("#exclude_restricted_chk")[0].checked=Galaxy.libraries.preferences.get("without_restricted"))},renderPaginator:function(e){this.options=i.extend(this.options,e);var t=this.templatePaginator();this.$el.find("#library_paginator").html(t({show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_libraries_count:this.options.total_libraries_count,libraries_shown:this.options.libraries_shown,library_page_size:Galaxy.libraries.preferences.get("library_page_size")}))},createLibraryFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this;this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,s.default)("Create New Library"),body:this.templateNewLibraryInModal(),buttons:{Create:function(){t.createNewLibrary()},Close:function(){t.modal.hide()}}})},createNewLibrary:function(){var e=this.serializeNewLibrary();if(this.validateNewLibrary(e)){var t=new u.default.Library,n=this;t.save(e,{success:function(e){Galaxy.libraries.libraryListView.collection.add(e),n.modal.hide(),n.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),c.default.success("Library created.")},error:function(e,t){void 0!==t.responseJSON?c.default.error(t.responseJSON.err_msg):c.default.error("An error occured.")}})}else c.default.error("Library's name is missing.");return!1},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many libraries per page do you want to see?",Galaxy.libraries.preferences.get("library_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({library_page_size:parseInt(t)}),Galaxy.libraries.libraryListView.render({show_page:1}))},clearLibraryModal:function(){r("input[name='Name']").val(""),r("input[name='Description']").val(""),r("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val(),synopsis:r("input[name='Synopsis']").val()}},validateNewLibrary:function(e){return""!==e.name},includeDeletedChecked:function(e){e.target.checked?(Galaxy.libraries.preferences.set({with_deleted:!0}),Galaxy.libraries.libraryListView.fetchDeleted()):(Galaxy.libraries.preferences.set({with_deleted:!1}),Galaxy.libraries.libraryListView.render())},excludeRestrictedChecked:function(e){e.target.checked?Galaxy.libraries.preferences.set({without_restricted:!0}):Galaxy.libraries.preferences.set({without_restricted:!1}),Galaxy.libraries.libraryListView.render()},searchLibraries:function(e){var t=r(".library-search-input").val();this.options.search_term=t,Galaxy.libraries.libraryListView.searchLibraries(t)},templateToolBar:function(){return i.template(['
    ','
    ','
    ','
    ','DATA LIBRARIES','',"",'
    ','',"
    ","<% if(admin_user === true) { %>",'
    ',"","","
    ",'','',"","<% } %>",'','','',"","","
    ","
    ","
    ",'
    ',"
    ","
    "].join(""))},templatePaginator:function(){return i.template(['","",' <%- libraries_shown %> libraries shown (change)',"",""," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return i.template(['
    ',"
    ",'','','',"
    ","
    "].join(""))}});t.default={LibraryToolbarView:h}}).call(t,n(2),n(1),n(0))},303:function(e,t,n){"use strict";(function(e,i,r,a){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),l=o(s),c=n(4),d=o(c),u=n(7),h=o(u),f=n(13),p=o(f),_=n(10),g=o(_);n(127);var m=e.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click #include_deleted_datasets_chk":"checkIncludeDeleted","click #toolbtn_bulk_delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page_size_prompt":"showPageSizePrompt"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(e){this.options=i.defaults(e||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(e){this.options=i.extend(this.options,e);var t=this.templateToolBar(),n={id:this.options.id,is_admin:!1,is_anonym:!0,mutiple_add_dataset_options:!1};Galaxy.user&&(n.is_admin=Galaxy.user.isAdmin(),n.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(n.mutiple_add_dataset_options=!0)),this.$el.html(t(n))},renderPaginator:function(e){this.options=i.extend(this.options,e);var t=this.templatePaginator();r("body").find(".folder-paginator").html(t({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(e){this.options=i.extend(this.options,e),!0===this.options.can_add_library_item?r(".add-library-items").show():r(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(r(".dataset-manipulation").show(),r(".logged-dataset-manipulation").hide()):(r(".logged-dataset-manipulation").show(),r(".dataset-manipulation").show()):(r(".logged-dataset-manipulation").hide(),r(".dataset-manipulation").hide()),this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(e){e.preventDefault(),e.stopPropagation();var t=this,n=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Create New Folder"),body:n(),buttons:{Create:function(){t.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var t=this.serialize_new_folder();if(this.validate_new_folder(t)){var n,i=new p.default.FolderAsModel,r=e.history.fragment.split("/");n=r.indexOf("page")>-1?r[r.length-3]:r[r.length-1],i.url=i.urlRoot+n,i.save(t,{success:function(e){Galaxy.modal.hide(),h.default.success("Folder created."),e.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(e)},error:function(e,t){Galaxy.modal.hide(),void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}})}else h.default.error("Folder's name is missing.");return!1},serialize_new_folder:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val()}},validate_new_folder:function(e){return""!==e.name},modalBulkImport:function(){if(0===this.findCheckedRows().length)h.default.info("You must select some datasets first.");else{var e=this;this.histories=new p.default.GalaxyHistories,this.histories.fetch().done(function(){var t=e.templateBulkImportInModal();e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:(0,l.default)("Import into History"),body:t({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")})}},importAllIntoHistory:function(){this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val(),t=this;if(""!==e)r.post(Galaxy.root+"api/histories",{name:e}).done(function(e){t.options.last_used_history_id=e.id,t.processImportToHistory(e.id,e.name)}).fail(function(e,t,n){h.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var n=r("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=n;var i=r("select[name=dataset_import_bulk] option:selected").text();this.processImportToHistory(n,i),this.modal.enableButton("Import")}},processImportToHistory:function(e,t){var n=[],i=[];this.findCheckedRows().each(function(){var e=r(this).closest("tr").data("id");"F"==e.substring(0,1)?i.push(e):n.push(e)});for(var o=[],s=n.length-1;s>=0;s--){var l=n[s],c=new p.default.HistoryItem;c.url=c.urlRoot+e+"/contents",c.content=l,c.source="library",o.push(c)}for(var s=i.length-1;s>=0;s--){var d=i[s],c=new p.default.HistoryItem;c.url=c.urlRoot+e+"/contents",c.content=d,c.source="library_folder",o.push(c)}this.initChainCallControl({length:o.length,action:"to_history",history_name:t}),a.getJSON(Galaxy.root+"history/set_as_current?id="+e),this.chainCallImportingIntoHistory(o,t)},updateProgress:function(){this.progress+=this.progressStep,r(".progress-bar-import").width(Math.round(this.progress)+"%");var e=Math.round(this.progress)+"% Complete";r(".completion_span").text(e)},download:function(e,t){var n=[],i=[];this.findCheckedRows().each(function(){var e=r(this).closest("tr").data("id");"F"==e.substring(0,1)?i.push(e):n.push(e)});var a=Galaxy.root+"api/libraries/datasets/download/"+t,o={ld_ids:n,folder_ids:i};this.processDownload(a,o,"get")},processDownload:function(e,t,n){if(e&&t){t="string"==typeof t?t:r.param(t);var i="";r.each(t.split("&"),function(){var e=this.split("=");i+=''}),r('
    '+i+"
    ").appendTo("body").submit().remove(),h.default.info("Your download will begin soon.")}else h.default.error("An error occurred.")},addFilesFromHistoryModal:function(){this.histories=new p.default.GalaxyHistories;var e=this;this.histories.fetch().done(function(){e.modal=Galaxy.modal;var t=e.templateAddFilesFromHistory();e.modal.show({closing_events:!0,title:(0,l.default)("Adding datasets from your history"),body:t({histories:e.histories.models}),buttons:{Add:function(){e.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),e.fetchAndDisplayHistoryContents(e.histories.models[0].id),r("#dataset_add_bulk").change(function(t){e.fetchAndDisplayHistoryContents(t.target.value)})}).fail(function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")})},importFilesFromPathModal:function(){var e=this;this.modal=Galaxy.modal;var t=this.templateImportPathModal();this.modal.show({closing_events:!0,title:(0,l.default)("Please enter paths to import"),body:t({}),buttons:{Import:function(){e.importFromPathsClicked(e)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+e.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var e=this;d.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(t){e.list_extensions=[];for(var n in t)e.list_extensions.push({id:t[n].extension,text:t[n].extension,description:t[n].description,description_url:t[n].description_url});e.list_extensions.sort(function(e,t){return e.id>t.id?1:e.idt.id?1:e.id=0;d--){var u=l[d].trim();0!==u.length&&c.push(u)}this.initChainCallControl({length:c.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:c,preserve_dirs:e,link_data:t,space_to_tab:n,to_posix_lines:i,source:"admin_path",file_type:o,tag_using_filenames:a,dbkey:s})}else h.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(e){var t;switch(e.action){case"adding_datasets":t=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(t({folder_name:this.options.folder_name}));break;case"deleting_datasets":t=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(t());break;case"to_history":t=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(t({history_name:e.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/e.length,this.options.chain_call_control.total_number=e.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(e,t){var n=r("#jstree_browser").jstree().get_selected(!0),a=i.filter(n,function(e){return 0==e.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),s=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),c=this.modal.$el.find(".posix-checkbox").is(":checked"),d=this.select_extension.value(),u=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,_=[];if(a.length<1)h.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=a.length-1;g>=0;g--)void 0!==a[g].li_attr.full_path&&_.push(a[g].li_attr.full_path);if(this.initChainCallControl({length:_.length,action:"adding_datasets"}),"folder"===p){var m=t.source+"_folder";this.chainCallImportingFolders({paths:_,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,file_type:d,dbkey:u,tag_using_filenames:f})}else if("file"===p){var m=t.source+"_file";this.chainCallImportingUserdirFiles({paths:_,file_type:d,dbkey:u,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(e){var t=new p.default.HistoryContents({id:e}),n=this;t.fetch({success:function(t){var i=n.templateHistoryContents();n.histories.get(e).set({contents:t}),n.modal.$el.find("#selected_history_content").html(i({history_contents:t.models.reverse()})),n.modal.$el.find(".history-import-select-all").bind("click",function(){r("#selected_history_content [type=checkbox]").prop("checked",!0)}),n.modal.$el.find(".history-import-unselect-all").bind("click",function(){r("#selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var e=this.modal.$el.find("#selected_history_content").find(":checked"),t=[],n=[],i=[];if(e.length<1)h.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),e.each(function(){var e=r(this).closest("li").data("id");if(e){var i=r(this).closest("li").data("name");t.push(e),n.push(i)}});for(var a=t.length-1;a>=0;a--){var o=t[a],s=new p.default.Item;s.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===n[a]?s.set({from_hdca_id:o}):s.set({from_hda_id:o}),i.push(s)}this.initChainCallControl({length:i.length,action:"adding_datasets"}),this.chainCallAddingHdas(i)}},chainCallImportingIntoHistory:function(e,t){var n=this,i=e.pop();if(void 0===i)return 0===this.options.chain_call_control.failed_number?h.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?h.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var c=new p.default.Item({id:e[s]});o.push(c)}for(var s=t.length-1;s>=0;s--){var d=new p.default.FolderAsModel({id:t[s]});o.push(d)}this.options.chain_call_control.total_number=a,this.chainCallDeletingItems(o)}},showLocInfo:function(){var e=null,t=this;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new p.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(e,t){void 0!==t.responseJSON?h.default.error(t.responseJSON.err_msg):h.default.error("An error occurred.")}}))},showLocInfoModal:function(e){var t=this,n=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Location Details"),body:n({library:e,options:t.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(e){switch(e.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),h.default.error("Invalid import source.")}},showPageSizePrompt:function(e){e.preventDefault();var t=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=t&&t==parseInt(t)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(t)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return r("#folder_list_body").find(":checked")},templateToolBar:function(){return i.template(['
    ','
    ','
    ',"DATA LIBRARIES",'','",'","<% if(mutiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'','",'','','","","","
    ","",'
    ',"
    ",'
    ',"
    "].join(""))},templateLocInfoInModal:function(){return i.template(["
    ",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
    library
    name<%- library.get("name") %>
    description<%- library.get("description") %>
    synopsis<%- library.get("synopsis") %>
    created"><%- library.get("create_time_pretty") %>
    id<%- library.get("id") %>
    ",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
    folder
    name<%- options.folder_name %>
    description<%- options.folder_description %>
    id<%- options.id %>
    ","
    "].join(""))},templateNewFolderInModal:function(){return i.template(['
    ',"
    ",'','',"
    ","
    "].join(""))},templateBulkImportInModal:function(){return i.template(["
    ",'
    ',"Select history: ",'","
    ",'
    ',"or create new: ",'',"","
    ","
    "].join(""))},templateImportIntoHistoryProgressBar:function(){return i.template(['
    ',"Importing selected items to history <%= _.escape(history_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateAddingDatasetsProgressBar:function(){return i.template(['
    ',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateDeletingItemsProgressBar:function(){return i.template(['
    ',"
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateBrowserModal:function(){return i.template(['
    ','
    All files you select will be imported into the current folder ignoring their folder structure.
    ','','
    ','",'","
    ",'
    ','",'",'",'","
    ",'",'","
    ",'
    ',"
    ","
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ","
    ",'","
    ","
    "].join(""))},templateImportPathModal:function(){return i.template(['
    ','
    All files within the given folders and their subfolders will be imported into the current folder.
    ','
    ','",'","
    ",'",'","
    ",'',"
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ",'","
    ","
    "].join(""))},templateAddFilesFromHistory:function(){return i.template(['
    ',"
    ","1. Select history: ",'","
    ","
    ",'
    ',"
    ","
    "].join(""))},templateHistoryContents:function(){return i.template(["

    2. Choose the datasets to import:

    ","
    ",'",'","
    ","
    ","
      ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">',"
    • ","<% } else { %>",'
    • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
    • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">','","
    • ","<% } %>","<% } %>","<% }); %>","
    "].join(""))},templatePaginator:function(){return i.template(['","",' <%- items_shown %> items shown (change)',"",""," <%- total_items_count %> total",""].join(""))}});t.default={FolderToolbarView:m}}).call(t,n(2),n(1),n(0),n(0))},304:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(10),u=a(d),h=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=i.extend(this.options,e),this.options.id&&this.fetchLibrary()},fetchLibrary:function(e){this.options=i.extend(this.options,e),this.model=new c.default.Library({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=i.extend(this.options,e),r(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_library_role_list.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1}));var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var n=this.templateLibraryPermissions();this.$el.html(n({library:this.model,is_admin:t}));var a=this;r.get(Galaxy.root+"api/libraries/"+a.id+"/permissions?scope=current").done(function(e){a.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){s.default.error("An error occurred while attempting to fetch library permissions.")}),r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],n=0;n=0;n--)t.push(e[n].id);return t},savePermissions:function(e){var t=this,n=this._extractIds(this.accessSelectObject.$el.select2("data")),i=this._extractIds(this.addSelectObject.$el.select2("data")),a=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/libraries/"+t.id+"/permissions?action=set_permissions",{"access_ids[]":n,"add_ids[]":i,"manage_ids[]":a,"modify_ids[]":o}).done(function(e){t.showPermissions({fetched_permissions:e}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return i.template(['
    ','","

    ",'Library: <%= _.escape(library.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any library on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Library permissions

    ","

    Roles that can access the library

    ",'
    ','
    ',"User with any of these roles can access this library. If there are no access roles set on the library it is considered unrestricted.","
    ","

    Roles that can manage permissions on this library

    ",'
    ','
    ',"User with any of these roles can manage permissions on this library (includes giving access).","
    ","

    Roles that can add items to this library

    ",'
    ','
    ',"User with any of these roles can add items to this library (folders and datasets).","
    ","

    Roles that can modify this library

    ",'
    ','
    ',"User with any of these roles can modify this library (name, synopsis, etc.).","
    ",'","
    ","
    "].join(""))}});t.default={LibraryView:h}}).call(t,n(2),n(1),n(0))},305:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=a(o),l=n(13),c=a(l),d=n(10),u=a(d),h=e.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(e){this.options=i.extend(this.options,e),this.options.id&&this.fetchFolder()},fetchFolder:function(e){this.options=i.extend(this.options,e),this.model=new c.default.FolderAsModel({id:this.options.id});var t=this;this.model.fetch({success:function(){t.options.show_permissions&&t.showPermissions()},error:function(e,t){void 0!==t.responseJSON?s.default.error(t.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(e){this.options=i.extend(this.options,e),r(".tooltip").remove();var t=!1;Galaxy.user&&(t=Galaxy.user.isAdmin());var n=this.templateFolderPermissions();this.$el.html(n({folder:this.model,is_admin:t}));var a=this;r.get(Galaxy.root+"api/folders/"+a.id+"/permissions?scope=current").done(function(e){a.prepareSelectBoxes({fetched_permissions:e})}).fail(function(){s.default.error("An error occurred while attempting to fetch folder permissions.")}),r("#center [data-toggle]").tooltip(),r("#center").css("overflow","auto")},_serializeRoles:function(e){for(var t=[],n=0;n=0;n--)t.push(e[n].id);return t},savePermissions:function(e){var t=this,n=this._extractIds(this.addSelectObject.$el.select2("data")),i=this._extractIds(this.manageSelectObject.$el.select2("data")),a=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/folders/"+t.id+"/permissions?action=set_permissions",{"add_ids[]":n,"manage_ids[]":i,"modify_ids[]":a}).done(function(e){t.showPermissions({fetched_permissions:e}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return i.template(['
    ','","

    ",'Folder: <%= _.escape(folder.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any folder on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Folder permissions

    ","

    ","Roles that can manage permissions on this folder","

    ",'
    ','
    ',"User with any of these roles can manage permissions on this folder.","
    ","

    ","Roles that can add items to this folder","

    ",'
    ','
    ',"User with any of these roles can add items to this folder (folders and datasets).","
    ","

    ","Roles that can modify this folder","

    ",'
    ','
    ',"User with any of these roles can modify this folder (name, etc.).","
    ",'","
    ","
    "].join(""))}});t.default={FolderView:h}}).call(t,n(2),n(1),n(0))},306:function(e,t,n){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(307),a=i(r),o=n(308),s=i(o),l=n(309),c=i(l),d=n(310),u=i(d),h=n(311),f=i(h),p=n(312),_=i(p),g=n(313),m=i(g),v=e.Router.extend({initialize:function(){this.routesHit=0,e.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),y=e.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new v,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new f.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new a.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(e){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:e.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new s.default.CategoryView({tool_shed:e.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(e,t){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),category_id:t}):Galaxy.admintoolshedapp.adminShedCategoryView=new c.default.Category({tool_shed:e.replace(/\//g,"%2f"),category_id:t})}),this.admin_toolshed_router.on("route:repository",function(e,t){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),repository_id:t}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:e.replace(/\//g,"%2f"),repository_id:t})}),this.admin_toolshed_router.on("route:status",function(e){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:e.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new _.default.RepoStatus({repositories:e.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new m.default.Workflows}),e.history.start({pushState:!1})}});t.default={GalaxyApp:y}}).call(t,n(2))},307:function(e,t,n){"use strict";(function(e,i){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),o=r(a),s=n(17),l=r(s),c=n(18),d=r(c),u=e.View.extend({defaults:{tool_sheds:[{url:"https://toolshed.g2.bx.psu.edu/",name:"Galaxy Main Tool Shed"}]},initialize:function(e){this.options=i.defaults(this.options||{},this.defaults),this.model=new l.default.ShedsCollection,this.listenTo(this.model,"sync",this.render),this.model.fetch()},el:"#center",render:function(e){this.options=i.defaults(this.options||{},e,this.defaults);var t=this.templateToolshedList;this.$el.html(t({title:(0,o.default)("Configured Galaxy Tool Sheds"),tool_sheds:this.model.models,queue:d.default.queueLength()}))},reDraw:function(e){this.$el.empty(),this.render(e)},templateToolshedList:i.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','
    ','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
    ",'","
    ","
    ",'
    ',"
    "].join(""))});t.default={ShedListView:u}}).call(t,n(2),n(1))},308:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l);n(30);var d=e.View.extend({el:"#center",defaults:{tool_shed:"https://toolshed.g2.bx.psu.edu/"},initialize:function(e){var t=e.tool_shed.replace(/\//g,"%2f");this.options=i.defaults(this.options||e,this.defaults),this.model=new s.default.Categories,this.listenTo(this.model,"sync",this.render),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.model.tool_shed=t,this.model.fetch()},render:function(e){this.options=i.extend(this.options,e),this.options.categories=this.model.models,this.options.queue=c.default.queueLength();var t=this.templateCategoryList;this.$el.html(t(this.options)),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;r("#search_box").autocomplete({source:function(e,n){var i=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:i};r.post(a,o,function(e){console.log(e);var t=c.default.shedParser(e);n(t)})},minLength:3,select:function(n,i){var r=i.item.value,a=(Galaxy.root,t.model.tool_shed,"repository/s/"+t.model.tool_shed+"/r/"+r);e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.initialize(e)},templateCategoryList:i.template(['",'
    ','
    Categories in <%= tool_shed.replace(/%2f/g, "/") %>
    ','',"
    ",'
    ','",'
    ','','',"","","","","","","<% _.each(categories, function(category) { %>","","",'','',"","<% }); %>","
    NameDescriptionRepositories
    ",'"><%= category.get("name") %>',"<%= category.get("description") %><%= category.get("repositories") %>
    ","
    ","
    "].join(""))});t.default={CategoryView:d}}).call(t,n(2),n(1),n(0))},309:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(18),c=a(l);n(30);var d=e.View.extend({el:"#center",initialize:function(e){this.model=new s.default.CategoryCollection,this.listenTo(this.model,"sync",this.render);var t=e.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+t+"&category_id="+e.category_id,this.model.tool_shed=t,this.model.category=e.category_id,this.model.fetch()},render:function(e){this.options=i.extend(this.options,e);var t=this.templateCategoryContents;this.$el.html(t({category:this.model.models[0],tool_shed:this.model.tool_shed,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var t=this;r("#search_box").autocomplete({source:function(e,n){var i=t.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:e.term,tool_shed_url:i};r.post(a,o,function(e){var t=c.default.shedParser(e);n(t)})},minLength:3,select:function(n,i){var r=i.item.value,a="repository/s/"+t.model.tool_shed+"/r/"+r;e.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateCategoryContents:i.template(['",'
    ','
    Repositories in <%= category.get("name") %>
    ','',"
    ",'
    ','",'
    ','','',"",'','',"",'',"","",'<% _.each(category.get("repositories"), function(repository) { %>',"","","","","","","<% }); %>","
    OwnerNameSynopsisType
    <%= repository.owner %>",'","<%= repository.description %><%= repository.type %>
    ","
    ","
    "].join(""))});t.default={Category:d}}).call(t,n(2),n(1),n(0))},310:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),s=a(o),l=n(127),c=(a(l),n(4)),d=a(c),u=n(8),h=a(u),f=n(11),p=a(f),_=n(18),g=a(_),m=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||{},this.defaults),this.model=new s.default.RepositoryCollection,this.listenTo(this.model,"sync",this.render);var t=e.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+t+"&repository_id="+e.repository_id,this.model.tool_shed_url=e.tool_shed.replace(/%2f/g,"/"),this.model.tool_shed=t,this.model.category=e.repository_id,this.model.fetch()},render:function(e){var t=this.templateRepoDetails,n=this.model.models[0];this.options={repository:n.get("repository"),tool_shed:this.model.tool_shed,queue:g.default.queueLength()};var a=Object.keys(this.options.repository.metadata).sort(function(e,t){return parseInt(e.split(":")[0]-t.split(":")[0])}),o={},s=this.options.repository.metadata;a.forEach(function(e){o[e]=s[e]}),this.options.repository.metadata=o,this.options.current_changeset=this.options.current_changeset||a[a.length-1],this.options.current_metadata=this.options.repository.metadata[this.options.current_changeset],this.options.current_metadata.tool_shed_url=this.model.tool_shed_url,this.options.tools=this.options.current_metadata.tools,this.options.repository_dependencies_template=this.templateRepoDependencies,this.options.repository_dependency_template=this.templateRepoDependency,this.options.tps_template_global_select=this.templateGlobalSectionSelect,this.options.tps_template_tool_select=this.templateToolSectionSelect,this.options.tps_select_options=this.templatePanelSelectOptions,this.options.tool_dependencies=n.get("tool_dependencies"),this.options.shed_tool_conf=this.templateShedToolConf({stc_html:n.get("shed_conf")}),this.options.panel_section_dict=n.get("panel_section_dict"),this.options.api_url=Galaxy.root+"api/tool_shed_repositories/install?async=True",this.options=i.extend(this.options,e),this.$el.html(t(this.options)),this.checkInstalled(this.options.current_metadata),this.bindEvents(),r("#center").css("overflow","auto")},bindEvents:function(){var e=this;r("#changeset").on("change",function(){e.options.current_changeset=r("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset],e.checkInstalled(e.options.current_metadata),e.reDraw(e.options)}),r("#tool_panel_section_select").on("change",function(){e.tpsSelection()}),r("#install_repository").on("click",function(t){r("#repository_installation");t.preventDefault();var n={};n.repositories=JSON.stringify([[r("#install_repository").attr("data-tsrid"),r("#changeset").find("option:selected").val()]]),n.tool_shed_repository_ids=JSON.stringify([r("#install_repository").attr("data-tsrid")]),n.tool_shed_url=e.model.tool_shed_url,n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val();e.panelSelect(n);n.tool_panel_section=JSON.stringify(e.panelSelect(n)),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.changeset=r("#changeset").find("option:selected").val();var i=r("#repository_installation").attr("action");e.prepareInstall(n,i)}),r("#queue_install").on("click",function(t){e.options.current_changeset=r("#changeset").find("option:selected").text(),e.options.current_metadata=e.options.repository.metadata[e.options.current_changeset];var n=(e.options.current_changeset,{});i.each(Object.keys(e.options.current_metadata),function(t){n[t]||(n[t]=e.options.current_metadata[t])}),n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val(),n.tool_panel_section=JSON.stringify(e.panelSelect({})),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.tool_shed_url=e.model.tool_shed_url,"/"==n.tool_shed_url.substr(-1)&&(n.tool_shed_url=n.tool_shed_url.substr(0,n.tool_shed_url.length-1)),g.default.addToQueue(n),e.checkInstalled(n)}),r(".tool_panel_section_picker").on("change",function(){r(this).find("option:selected").val()==r("#tool_panel_section_select").find("option:selected").val()?r(this).attr("default","active"):r(this).removeAttr("default")}),r(function(){r("#repository_dependencies").jstree()}),r(".tool_form").on("click",function(){var t=r(this).attr("data-guid"),n=(r(this).attr("data-clean"),r(this).attr("data-name")),i=r(this).attr("data-desc"),a=e.model.tool_shed_url,o=r("#repository_details").attr("data-tsrid"),s=r("#changeset").find("option:selected").val(),l=Galaxy.root+"api/tool_shed/tool_json",c={guid:t,tool_shed_url:a,tsr_id:o,changeset:s};r.get(l,c,function(e){e.cls="ui-portlet-plain";var t=new p.default(e);d.default.deepeach(e.inputs,function(e){e.type&&-1!=["data","data_collection"].indexOf(e.type)&&(e.type="hidden",e.info="Data input '"+e.name+"' ("+d.default.textify(e.extensions)+")")});var r=new h.default.View,a=""+n+" "+i;r.show({closing_events:!0,title:a,body:t.$el,buttons:{Close:function(){r.hide()}}})})})},checkInstalled:function(e){var t=this,n={name:e.name,owner:e.owner},i=!1;t.repoQueued(e);r.get(Galaxy.root+"api/tool_shed_repositories",n,function(n){for(var a=0;a','
    Repository information for <%= repository.name %> from <%= repository.owner %>
    ','',"
    ",'
    ','
    ','','','
    ','
    Changeset
    ','
    ','",'','','
    Please select a revision and review the settings below before installing.
    ',"
    ","
    ","<%= shed_tool_conf %>","<% if (current_metadata.has_repository_dependencies) { %>",'
    Repository dependencies for <%= current_changeset %>
    ','
    ','

    ','','',"

    ","<% current_metadata.repository_dependency_template = repository_dependency_template; %>",'
    ','","<%= repository_dependencies_template(current_metadata) %>","
    ","
    ","<% } %>","<% if (current_metadata.includes_tool_dependencies) { %>",'
    Tool dependencies
    ','
    ','

    ','','',"

    ",'

    ','','',"

    ",'
    ','",'',"",'','',"","","","",'',"<% _.each(tool_dependencies[current_changeset], function(dependency) { %>",'','","","","","<% }); %>","","
    NameVersionType
    ',"<%= dependency.name %><%= dependency.version %><%= dependency.type %>
    ","
    ","
    ","<% } %>","<% if (current_metadata.includes_tools_for_display_in_tool_panel) { %>",'
    Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
    ','
    ','
    ','',"",'','',"","","","",'',"<% _.each(current_metadata.tools, function(tool) { %>",'','","",'','","","<% }); %>","","
    NameDescriptionVersion<%= tps_template_global_select({tps: panel_section_dict, tps_select_options: tps_select_options}) %>
    ','","<%= tool.description %><%= tool.version %>',"<%= tps_template_tool_select({tool: tool, tps: panel_section_dict, tps_select_options: tps_select_options}) %>","
    ","
    ","
    ","<% } %>","
    ","
    "].join("")),templateRepoDependencies:i.template(['
    Repository Dependencies
    ','
    ',"
      ","
    • Repository installation requires the following","<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","<% } %>","
    • ","
    ","
    "].join("")),templateRepoDependency:i.template(['
  • ',"Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %>","<% if (has_repository_dependencies) { %>",'
      ',"<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","
    ","<% } %>","
  • "].join("")),templateShedToolConf:i.template(['
    Shed tool configuration file:
    ','
    ','
    ',"<%= stc_html %>",'
    Select the file whose tool_path setting you want used for installing repositories.
    ',"
    ","
    "].join("")),templateToolDependency:i.template(["<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% if (dependency.includes_tool_dependencies) { %>","<% dependency.tool_dependency_template = tool_dependency_template %>","<%= tool_dependency_template(dependency) %>","<% } %>","<% }); %>","<% } %>"].join("")),templateGlobalSectionCreate:i.template(['
    ','
    ','','','
    ',"Add a new tool panel section to contain the installed tools (optional).","
    ","
    ","
    "].join("")),templateGlobalSectionSelect:i.template(['
    ','
    Tool Panel Section
    ','
    ','
    ','",'','
    ',"Select an existing tool panel section to contain the installed tools (optional).","
    ","
    ","
    ","
    "].join("")),templateToolSectionCreate:i.template(['
    ','','',"
    "].join("")),templateToolSectionSelect:i.template(['
    ','",'','
    ',"
    "].join("")),templatePanelSelectOptions:i.template(["<% _.each(sections, function(section) { %>",'',"<% }); %>"].join(""))});t.default={RepoDetails:m}}).call(t,n(2),n(1),n(0))},311:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(17),c=a(l),d=n(18),u=a(d),h=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new c.default.RepoQueue,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,n=t.templateRepoQueue,r=t.model.models;t.$el.html(n({title:(0,s.default)("Repository Installation Queue"),repositories:r,queue:u.default.queueLength()})),i("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t=this;i(".install_one").on("click",function(){var e=t.loadFromQueue(i(this).attr("data-repokey"));t.installFromQueue(e,i(this).attr("data-repokey"))}),i(".remove_one").on("click",function(){var e=i(this).attr("data-repokey"),t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e)){var n=t[e].repository.id;delete t[e],i("#queued_repository_"+n).remove()}localStorage.repositories=JSON.stringify(t)}),i("#clear_queue").on("click",function(){localStorage.repositories="{}"}),i("#from_workflow").on("click",function(){e.history.navigate("workflows",{trigger:!0,replace:!0})})},installFromQueue:function(t,n){var r=Object();r.install_tool_dependencies=t.install_tool_dependencies,r.install_repository_dependencies=t.install_repository_dependencies,r.install_resolver_dependencies=t.install_resolver_dependencies,r.tool_panel_section=t.tool_panel_section,r.shed_tool_conf=t.shed_tool_conf,r.repositories=JSON.stringify([[t.repository.id,t.changeset_revision]]),r.tool_shed_repository_ids=JSON.stringify([t.repository.id]),r.tool_shed_url=n.split("|")[0],r.changeset=t.changeset_revision;var a=Galaxy.root+"api/tool_shed_repositories/install?async=True";if(i("#queued_repository_"+t.repository.id).remove(),localStorage.repositories){void 0===n&&(n=u.default.queueKey(t));var o=JSON.parse(localStorage.repositories);o.hasOwnProperty(n)&&(delete o[n],localStorage.repositories=JSON.stringify(o))}i.post(a,r,function(t){var n=JSON.parse(t),r=n.repositories,a="status/r/"+r.join("|");i.post(Galaxy.root+"admin_toolshed/install_repositories",n,function(e){console.log("Initializing repository installation succeeded")}),e.history.navigate(a,{trigger:!0,replace:!0})})},loadFromQueue:function(e){var t=JSON.parse(localStorage.repositories);if(t.hasOwnProperty(e))return t[e]},reDraw:function(e){this.$el.empty(),this.initialize(e),this.model.fetch(),this.render(e)},templateRepoQueue:r.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','','',"",'','','','','','',"","","","<% _.each(repositories, function(repository) { %>",'">','','','','','",'","","<% }); %>","","
    NameOwnerRevisionToolShedInstall
    <%= repository.get("repository").name %><%= repository.get("repository").owner %><%= repository.get("changeset_revision") %><%= repository.get("tool_shed_url") %>','" type="submit" id="install_repository_<%= repository.get("id") %>" name="install_repository" value="Install now" />',"','" type="submit" id="unqueue_repository_<%= repository.get("id") %>" name="unqueue_repository" value="Remove from queue" />',"
    ",'',"
    "].join(""))});t.default={RepoQueueView:h}}).call(t,n(2),n(0),n(1))},312:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(17),c=a(l),d=n(18),u=a(d),h=e.View.extend({el:"#center",initialize:function(e){this.options=i.defaults(this.options||[{}],e,this.defaults),this.model=new c.default.RepoStatus,this.listenTo(this.model,"sync",this.render),this.model.url+="?repositories="+this.options.repositories.join("|"),this.model.fetch(),this.timer=setInterval(function(e){var t=["installed","error"],n=!0;i.some(e.model.models,function(e){repo_id=e.get("id");var i=e.get("status").toLowerCase();if(-1===t.indexOf(i))return n=!1,!0}),n?clearInterval(e.timer):e.model.fetch()},2e3,this)},close:function(){clearInterval(this.timer)},render:function(e){this.options=i.extend(this.options,e);var t=this.templateRepoStatus;this.$el.html(t({title:(0,s.default)("Repository Status"),repositories:this.model.models,queue:u.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateRepoStatus:i.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','',"","",'',"<% _.each(repositories, function(repository) { %>","","","","","","","","<% }); %>","",'',"
    NameDescriptionOwnerRevisionInstallation Status
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    "].join(""))});t.default={RepoStatus:h}}).call(t,n(2),n(1),n(0))},313:function(e,t,n){"use strict";(function(e,i,r){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(17),c=a(l),d=n(18),u=a(d),h=e.View.extend({el:"#center",defaults:[{}],initialize:function(e){var t=this;this.model=new c.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),t.render()},render:function(e){var t=this,n=t.templateWorkflows,r=t.model.models;t.$el.html(n({title:(0,s.default)("Workflows Missing Tools"),workflows:r,queue:u.default.queueLength()})),i("#center").css("overflow","auto"),t.bindEvents()},bindEvents:function(){var t,n=this;i(".show_wf_repo").on("click",function(){var n=i(this).attr("data-toolids"),r=i(this).attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){t=n.repository.id;var i="repository/s/"+r.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+n.repository.id;e.history.navigate(i,{trigger:!0,replace:!0})})}),i(".queue_wf_repo").on("click",function(){var e=i(this),n=e.attr("data-toolids"),r=e.attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){t=n.repository.id,o={tool_shed_url:r,repository_id:t},i.get(a,o,function(t){var n=Object.keys(t.repository.metadata),i=n[0],a=t.repository.metadata[i];a.tool_shed_url=r,u.default.addToQueue(a),e.remove()})})}),i("#from_workflow").on("click",n.loadWorkflows)},reDraw:function(e){this.$el.empty(),this.initialize(e)},templateWorkflows:r.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});t.default={Workflows:h}}).call(t,n(2),n(0),n(1))},61:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={tool:"fa-wrench",data_input:"fa-file-o",data_collection_input:"fa-folder-o",subworkflow:"fa-sitemap fa-rotate-270",pause:"fa-pause"}}},[284]); \ No newline at end of file diff --git a/static/scripts/bundled/libs.bundled.js b/static/scripts/bundled/libs.bundled.js index d884525b837..7b4488429f5 100644 --- a/static/scripts/bundled/libs.bundled.js +++ b/static/scripts/bundled/libs.bundled.js @@ -1,4 +1,4 @@ -!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i=window.webpackJsonp;window.webpackJsonp=function(n,a,o){for(var s,l,c,u=0,h=[];u0&&e-1 in t)}function s(t,e,i){if(lt.isFunction(e))return lt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return lt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(_t.test(e))return lt.filter(e,t,i);e=lt.filter(e,t)}return lt.grep(t,function(t){return nt.call(e,t)>-1!==i})}function l(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function c(t){var e={};return lt.each(t.match(kt)||[],function(t,i){e[i]=!0}),e}function u(){Z.removeEventListener("DOMContentLoaded",u),i.removeEventListener("load",u),lt.ready()}function h(){this.expando=lt.expando+h.uid++}function d(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(Ot,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Et.test(i)?lt.parseJSON(i):i)}catch(t){}Mt.set(t,e,i)}else i=void 0;return i}function f(t,e,i,n){var r,a=1,o=20,s=n?function(){return n.cur()}:function(){return lt.css(t,e,"")},l=s(),c=i&&i[3]||(lt.cssNumber[e]?"":"px"),u=(lt.cssNumber[e]||"px"!==c&&+l)&&jt.exec(lt.css(t,e));if(u&&u[3]!==c){c=c||u[3],i=i||[],u=+l||1;do{a=a||".5",u/=a,lt.style(t,e,u+c)}while(a!==(a=s()/l)&&1!==a&&--o)}return i&&(u=+u||+l||0,r=i[1]?u+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=u,n.end=r)),r}function p(t,e){var i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&<.nodeName(t,e)?lt.merge([t],i):i}function m(t,e){for(var i=0,n=t.length;i-1)r&&r.push(a);else if(c=lt.contains(a.ownerDocument,a),o=p(h.appendChild(a),"script"),c&&m(o),i)for(u=0;a=o[u++];)It.test(a.type||"")&&i.push(a);return h}function g(){return!0}function _(){return!1}function y(){try{return Z.activeElement}catch(t){}}function b(t,e,i,n,r,a){var o,s;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=void 0);for(s in e)b(t,s,i,n,e[s],a);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=_;else if(!r)return t;return 1===a&&(o=r,r=function(t){return lt().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=lt.guid++)),t.each(function(){lt.event.add(this,e,r,n,i)})}function w(t,e){return lt.nodeName(t,"table")&<.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function x(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function k(t){var e=Wt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function C(t,e){var i,n,r,a,o,s,l,c;if(1===e.nodeType){if(At.hasData(t)&&(a=At.access(t),o=At.set(e,a),c=a.events)){delete o.handle,o.events={};for(r in c)for(i=0,n=c[r].length;i1&&"string"==typeof f&&!st.checkClone&&Ut.test(f))return t.each(function(r){var a=t.eq(r);m&&(e[0]=f.call(this,r,a.html())),T(a,e,i,n)});if(h&&(r=v(e,t[0].ownerDocument,!1,t,n),a=r.firstChild,1===r.childNodes.length&&(r=a),a||n)){for(o=lt.map(p(r,"script"),x),s=o.length;u")).appendTo(e.documentElement),e=Xt[0].contentDocument,e.write(),e.close(),i=M(t,e),Xt.detach()),Yt[t]=i),i}function O(t,e,i){var n,r,a,o,s=t.style;return i=i||Qt(t),o=i?i.getPropertyValue(e)||i[e]:void 0,""!==o&&void 0!==o||lt.contains(t.ownerDocument,t)||(o=lt.style(t,e)),i&&!st.pixelMarginRight()&&Kt.test(o)&&Jt.test(e)&&(n=s.width,r=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=i.width,s.width=n,s.minWidth=r,s.maxWidth=a),void 0!==o?o+"":o}function $(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function j(t){if(t in ae)return t;for(var e=t[0].toUpperCase()+t.slice(1),i=re.length;i--;)if((t=re[i]+e)in ae)return t}function D(t,e,i){var n=jt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function P(t,e,i,n,r){for(var a=i===(n?"border":"content")?4:"width"===e?1:0,o=0;a<4;a+=2)"margin"===i&&(o+=lt.css(t,i+Dt[a],!0,r)),n?("content"===i&&(o-=lt.css(t,"padding"+Dt[a],!0,r)),"margin"!==i&&(o-=lt.css(t,"border"+Dt[a]+"Width",!0,r))):(o+=lt.css(t,"padding"+Dt[a],!0,r),"padding"!==i&&(o+=lt.css(t,"border"+Dt[a]+"Width",!0,r)));return o}function R(t,e,i){var n=!0,r="width"===e?t.offsetWidth:t.offsetHeight,a=Qt(t),o="border-box"===lt.css(t,"boxSizing",!1,a);if(r<=0||null==r){if(r=O(t,e,a),(r<0||null==r)&&(r=t.style[e]),Kt.test(r))return r;n=o&&(st.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+P(t,e,i||(o?"border":"content"),n,a)+"px"}function N(t,e){for(var i,n,r,a=[],o=0,s=t.length;o=0&&i=0},isPlainObject:function(t){var e;if("object"!==lt.type(t)||t.nodeType||lt.isWindow(t))return!1;if(t.constructor&&!ot.call(t,"constructor")&&!ot.call(t.constructor.prototype||{},"isPrototypeOf"))return!1;for(e in t);return void 0===e||ot.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?rt[at.call(t)]||"object":typeof t},globalEval:function(t){var e,i=eval;(t=lt.trim(t))&&(1===t.indexOf("use strict")?(e=Z.createElement("script"),e.text=t,Z.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(ut,"ms-").replace(ht,dt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var i,n=0;if(o(t))for(i=t.length;n0&&e-1 in t)}function s(t,e,i){if(lt.isFunction(e))return lt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return lt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(_t.test(e))return lt.filter(e,t,i);e=lt.filter(e,t)}return lt.grep(t,function(t){return nt.call(e,t)>-1!==i})}function l(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function u(t){var e={};return lt.each(t.match(kt)||[],function(t,i){e[i]=!0}),e}function c(){Z.removeEventListener("DOMContentLoaded",c),i.removeEventListener("load",c),lt.ready()}function h(){this.expando=lt.expando+h.uid++}function d(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(Ot,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Et.test(i)?lt.parseJSON(i):i)}catch(t){}At.set(t,e,i)}else i=void 0;return i}function f(t,e,i,n){var r,a=1,o=20,s=n?function(){return n.cur()}:function(){return lt.css(t,e,"")},l=s(),u=i&&i[3]||(lt.cssNumber[e]?"":"px"),c=(lt.cssNumber[e]||"px"!==u&&+l)&&Dt.exec(lt.css(t,e));if(c&&c[3]!==u){u=u||c[3],i=i||[],c=+l||1;do{a=a||".5",c/=a,lt.style(t,e,c+u)}while(a!==(a=s()/l)&&1!==a&&--o)}return i&&(c=+c||+l||0,r=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=u,n.start=c,n.end=r)),r}function p(t,e){var i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&<.nodeName(t,e)?lt.merge([t],i):i}function m(t,e){for(var i=0,n=t.length;i-1)r&&r.push(a);else if(u=lt.contains(a.ownerDocument,a),o=p(h.appendChild(a),"script"),u&&m(o),i)for(c=0;a=o[c++];)It.test(a.type||"")&&i.push(a);return h}function g(){return!0}function _(){return!1}function y(){try{return Z.activeElement}catch(t){}}function b(t,e,i,n,r,a){var o,s;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=void 0);for(s in e)b(t,s,i,n,e[s],a);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=_;else if(!r)return t;return 1===a&&(o=r,r=function(t){return lt().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=lt.guid++)),t.each(function(){lt.event.add(this,e,r,n,i)})}function w(t,e){return lt.nodeName(t,"table")&<.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function x(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function k(t){var e=Wt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function C(t,e){var i,n,r,a,o,s,l,u;if(1===e.nodeType){if(Mt.hasData(t)&&(a=Mt.access(t),o=Mt.set(e,a),u=a.events)){delete o.handle,o.events={};for(r in u)for(i=0,n=u[r].length;i1&&"string"==typeof f&&!st.checkClone&&Ut.test(f))return t.each(function(r){var a=t.eq(r);m&&(e[0]=f.call(this,r,a.html())),T(a,e,i,n)});if(h&&(r=v(e,t[0].ownerDocument,!1,t,n),a=r.firstChild,1===r.childNodes.length&&(r=a),a||n)){for(o=lt.map(p(r,"script"),x),s=o.length;c")).appendTo(e.documentElement),e=Xt[0].contentDocument,e.write(),e.close(),i=A(t,e),Xt.detach()),Yt[t]=i),i}function O(t,e,i){var n,r,a,o,s=t.style;return i=i||Qt(t),o=i?i.getPropertyValue(e)||i[e]:void 0,""!==o&&void 0!==o||lt.contains(t.ownerDocument,t)||(o=lt.style(t,e)),i&&!st.pixelMarginRight()&&Kt.test(o)&&Jt.test(e)&&(n=s.width,r=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=i.width,s.width=n,s.minWidth=r,s.maxWidth=a),void 0!==o?o+"":o}function $(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function D(t){if(t in ae)return t;for(var e=t[0].toUpperCase()+t.slice(1),i=re.length;i--;)if((t=re[i]+e)in ae)return t}function j(t,e,i){var n=Dt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function P(t,e,i,n,r){for(var a=i===(n?"border":"content")?4:"width"===e?1:0,o=0;a<4;a+=2)"margin"===i&&(o+=lt.css(t,i+jt[a],!0,r)),n?("content"===i&&(o-=lt.css(t,"padding"+jt[a],!0,r)),"margin"!==i&&(o-=lt.css(t,"border"+jt[a]+"Width",!0,r))):(o+=lt.css(t,"padding"+jt[a],!0,r),"padding"!==i&&(o+=lt.css(t,"border"+jt[a]+"Width",!0,r)));return o}function R(t,e,i){var n=!0,r="width"===e?t.offsetWidth:t.offsetHeight,a=Qt(t),o="border-box"===lt.css(t,"boxSizing",!1,a);if(r<=0||null==r){if(r=O(t,e,a),(r<0||null==r)&&(r=t.style[e]),Kt.test(r))return r;n=o&&(st.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+P(t,e,i||(o?"border":"content"),n,a)+"px"}function N(t,e){for(var i,n,r,a=[],o=0,s=t.length;o=0&&i=0},isPlainObject:function(t){var e;if("object"!==lt.type(t)||t.nodeType||lt.isWindow(t))return!1;if(t.constructor&&!ot.call(t,"constructor")&&!ot.call(t.constructor.prototype||{},"isPrototypeOf"))return!1;for(e in t);return void 0===e||ot.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?rt[at.call(t)]||"object":typeof t},globalEval:function(t){var e,i=eval;(t=lt.trim(t))&&(1===t.indexOf("use strict")?(e=Z.createElement("script"),e.text=t,Z.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(ct,"ms-").replace(ht,dt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var i,n=0;if(o(t))for(i=t.length;nb.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[I]=!0,t}function r(t){var e=O.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function a(t,e){for(var i=t.split("|"),n=i.length;n--;)b.attrHandle[i[n]]=e}function o(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||U)-(~t.sourceIndex||U);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function s(t){return n(function(e){return e=+e,n(function(i,n){for(var r,a=t([],i.length,e),o=a.length;o--;)i[r=a[o]]&&(i[r]=!(n[r]=i[r]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function u(t){for(var e=0,i=t.length,n="";e1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function f(t,i,n){for(var r=0,a=i.length;r-1&&(n[c]=!(o[c]=h))}}else y=p(y===o?y.splice(v,y.length):y),a?a(null,o,y,l):J.apply(o,y)})}function v(t){for(var e,i,n,r=t.length,a=b.relative[t[0].type],o=a||b.relative[" "],s=a?1:0,l=h(function(t){return t===e},o,!0),c=h(function(t){return Q(e,t)>-1},o,!0),f=[function(t,i,n){var r=!a&&(n||i!==T)||((e=i).nodeType?l(t,i,n):c(t,i,n));return e=null,r}];s1&&d(f),s>1&&u(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(at,"$1"),i,s0,a=t.length>0,o=function(n,o,s,l,c){var u,h,d,f=0,m="0",v=n&&[],g=[],_=T,y=n||a&&b.find.TAG("*",c),w=H+=null==_?1:Math.random()||.1,x=y.length;for(c&&(T=o===O||o||c);m!==x&&null!=(u=y[m]);m++){if(a&&u){for(h=0,o||u.ownerDocument===O||(E(u),s=!j);d=t[h++];)if(d(u,o||O,s)){l.push(u);break}c&&(H=w)}r&&((u=!d&&u)&&f--,n&&v.push(u))}if(f+=m,r&&m!==f){for(h=0;d=i[h++];)d(v,g,o,s);if(n){if(f>0)for(;m--;)v[m]||g[m]||(g[m]=X.call(l));g=p(g)}J.apply(l,g),c&&!n&&g.length>0&&f+i.length>1&&e.uniqueSort(l)}return c&&(H=w,T=_),v};return r?n(o):o}var _,y,b,w,x,k,C,S,T,A,M,E,O,$,j,D,P,R,N,I="sizzle"+1*new Date,L=t.document,H=0,q=0,z=i(),F=i(),B=i(),V=function(t,e){return t===e&&(M=!0),0},U=1<<31,W={}.hasOwnProperty,G=[],X=G.pop,Y=G.push,J=G.push,K=G.slice,Q=function(t,e){for(var i=0,n=t.length;i+~]|"+tt+")"+tt+"*"),lt=new RegExp("="+tt+"*([^\\]'\"]*?)"+tt+"*\\]","g"),ct=new RegExp(nt),ut=new RegExp("^"+et+"$"),ht={ID:new RegExp("^#("+et+")"),CLASS:new RegExp("^\\.("+et+")"),TAG:new RegExp("^("+et+"|[*])"),ATTR:new RegExp("^"+it),PSEUDO:new RegExp("^"+nt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+tt+"*(even|odd|(([+-]|)(\\d*)n|)"+tt+"*(?:([+-]|)"+tt+"*(\\d+)|))"+tt+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+tt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+tt+"*((?:-\\d)?\\d*)"+tt+"*\\)|)(?=[^-]|$)","i")},dt=/^(?:input|select|textarea|button)$/i,ft=/^h\d$/i,pt=/^[^{]+\{\s*\[native \w/,mt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,vt=/[+~]/,gt=/'|\\/g,_t=new RegExp("\\\\([\\da-f]{1,6}"+tt+"?|("+tt+")|.)","ig"),yt=function(t,e,i){var n="0x"+e-65536;return n!==n||i?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},bt=function(){E()};try{J.apply(G=K.call(L.childNodes),L.childNodes),G[L.childNodes.length].nodeType}catch(t){J={apply:G.length?function(t,e){Y.apply(t,K.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}y=e.support={},x=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},E=e.setDocument=function(t){var e,i,n=t?t.ownerDocument||t:L;return n!==O&&9===n.nodeType&&n.documentElement?(O=n,$=O.documentElement,j=!x(O),(i=O.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",bt,!1):i.attachEvent&&i.attachEvent("onunload",bt)),y.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),y.getElementsByTagName=r(function(t){return t.appendChild(O.createComment("")),!t.getElementsByTagName("*").length}),y.getElementsByClassName=pt.test(O.getElementsByClassName),y.getById=r(function(t){return $.appendChild(t).id=I,!O.getElementsByName||!O.getElementsByName(I).length}),y.getById?(b.find.ID=function(t,e){if(void 0!==e.getElementById&&j){var i=e.getElementById(t);return i?[i]:[]}},b.filter.ID=function(t){var e=t.replace(_t,yt);return function(t){return t.getAttribute("id")===e}}):(delete b.find.ID,b.filter.ID=function(t){var e=t.replace(_t,yt);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}}),b.find.TAG=y.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):y.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],r=0,a=e.getElementsByTagName(t);if("*"===t){for(;i=a[r++];)1===i.nodeType&&n.push(i);return n}return a},b.find.CLASS=y.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&j)return e.getElementsByClassName(t)},P=[],D=[],(y.qsa=pt.test(O.querySelectorAll))&&(r(function(t){$.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&D.push("[*^$]="+tt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||D.push("\\["+tt+"*(?:value|"+Z+")"),t.querySelectorAll("[id~="+I+"-]").length||D.push("~="),t.querySelectorAll(":checked").length||D.push(":checked"),t.querySelectorAll("a#"+I+"+*").length||D.push(".#.+[+~]")}),r(function(t){var e=O.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&D.push("name"+tt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),D.push(",.*:")})),(y.matchesSelector=pt.test(R=$.matches||$.webkitMatchesSelector||$.mozMatchesSelector||$.oMatchesSelector||$.msMatchesSelector))&&r(function(t){y.disconnectedMatch=R.call(t,"div"),R.call(t,"[s!='']:x"),P.push("!=",nt)}),D=D.length&&new RegExp(D.join("|")),P=P.length&&new RegExp(P.join("|")),e=pt.test($.compareDocumentPosition),N=e||pt.test($.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},V=e?function(t,e){if(t===e)return M=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!y.sortDetached&&e.compareDocumentPosition(t)===i?t===O||t.ownerDocument===L&&N(L,t)?-1:e===O||e.ownerDocument===L&&N(L,e)?1:A?Q(A,t)-Q(A,e):0:4&i?-1:1)}:function(t,e){if(t===e)return M=!0,0;var i,n=0,r=t.parentNode,a=e.parentNode,s=[t],l=[e];if(!r||!a)return t===O?-1:e===O?1:r?-1:a?1:A?Q(A,t)-Q(A,e):0;if(r===a)return o(t,e);for(i=t;i=i.parentNode;)s.unshift(i);for(i=e;i=i.parentNode;)l.unshift(i);for(;s[n]===l[n];)n++;return n?o(s[n],l[n]):s[n]===L?-1:l[n]===L?1:0},O):O},e.matches=function(t,i){return e(t,null,null,i)},e.matchesSelector=function(t,i){if((t.ownerDocument||t)!==O&&E(t),i=i.replace(lt,"='$1']"),y.matchesSelector&&j&&!B[i+" "]&&(!P||!P.test(i))&&(!D||!D.test(i)))try{var n=R.call(t,i);if(n||y.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return e(i,O,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==O&&E(t),N(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==O&&E(t);var i=b.attrHandle[e.toLowerCase()],n=i&&W.call(b.attrHandle,e.toLowerCase())?i(t,e,!j):void 0;return void 0!==n?n:y.attributes||!j?t.getAttribute(e):(n=t.getAttributeNode(e))&&n.specified?n.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,i=[],n=0,r=0;if(M=!y.detectDuplicates,A=!y.sortStable&&t.slice(0),t.sort(V),M){for(;e=t[r++];)e===t[r]&&(n=i.push(r));for(;n--;)t.splice(i[n],1)}return A=null,t},w=e.getText=function(t){var e,i="",n=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=w(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[n++];)i+=w(e);return i},b=e.selectors={cacheLength:50,createPseudo:n,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(_t,yt),t[3]=(t[3]||t[4]||t[5]||"").replace(_t,yt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return ht.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&ct.test(i)&&(e=k(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(_t,yt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=z[t+" "];return e||(e=new RegExp("(^|"+tt+")"+t+"("+tt+"|$)"))&&z(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,i,n){return function(r){var a=e.attr(r,t);return null==a?"!="===i:!i||(a+="","="===i?a===n:"!="===i?a!==n:"^="===i?n&&0===a.indexOf(n):"*="===i?n&&a.indexOf(n)>-1:"$="===i?n&&a.slice(-n.length)===n:"~="===i?(" "+a.replace(rt," ")+" ").indexOf(n)>-1:"|="===i&&(a===n||a.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,i,n,r){var a="nth"!==t.slice(0,3),o="last"!==t.slice(-4),s="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var c,u,h,d,f,p,m=a!==o?"nextSibling":"previousSibling",v=e.parentNode,g=s&&e.nodeName.toLowerCase(),_=!l&&!s,y=!1;if(v){if(a){for(;m;){for(d=e;d=d[m];)if(s?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[o?v.firstChild:v.lastChild],o&&_){for(d=v,h=d[I]||(d[I]={}),u=h[d.uniqueID]||(h[d.uniqueID]={}),c=u[t]||[],f=c[0]===H&&c[1],y=f&&c[2],d=f&&v.childNodes[f];d=++f&&d&&d[m]||(y=f=0)||p.pop();)if(1===d.nodeType&&++y&&d===e){u[t]=[H,f,y];break}}else if(_&&(d=e,h=d[I]||(d[I]={}),u=h[d.uniqueID]||(h[d.uniqueID]={}),c=u[t]||[],f=c[0]===H&&c[1],y=f),!1===y)for(;(d=++f&&d&&d[m]||(y=f=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++y||(_&&(h=d[I]||(d[I]={}),u=h[d.uniqueID]||(h[d.uniqueID]={}),u[t]=[H,y]),d!==e)););return(y-=r)===n||y%n==0&&y/n>=0}}},PSEUDO:function(t,i){var r,a=b.pseudos[t]||b.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return a[I]?a(i):a.length>1?(r=[t,t,"",i],b.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,e){for(var n,r=a(t,i),o=r.length;o--;)n=Q(t,r[o]),t[n]=!(e[n]=r[o])}):function(t){return a(t,0,r)}):a}},pseudos:{not:n(function(t){var e=[],i=[],r=C(t.replace(at,"$1"));return r[I]?n(function(t,e,i,n){for(var a,o=r(t,null,n,[]),s=t.length;s--;)(a=o[s])&&(t[s]=!(e[s]=a))}):function(t,n,a){return e[0]=t,r(e,null,a,i),e[0]=null,!i.pop()}}),has:n(function(t){return function(i){return e(t,i).length>0}}),contains:n(function(t){return t=t.replace(_t,yt),function(e){return(e.textContent||e.innerText||w(e)).indexOf(t)>-1}}),lang:n(function(t){return ut.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(_t,yt).toLowerCase(),function(e){var i;do{if(i=j?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===$},focus:function(t){return t===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!b.pseudos.empty(t)},header:function(t){return ft.test(t.nodeName)},input:function(t){return dt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:s(function(){return[0]}),last:s(function(t,e){return[e-1]}),eq:s(function(t,e,i){return[i<0?i+e:i]}),even:s(function(t,e){for(var i=0;i=0;)t.push(n);return t}),gt:s(function(t,e,i){for(var n=i<0?i+e:i;++n2&&"ID"===(o=a[0]).type&&y.getById&&9===e.nodeType&&j&&b.relative[a[1].type]){if(!(e=(b.find.ID(o.matches[0].replace(_t,yt),e)||[])[0]))return i;h&&(e=e.parentNode),t=t.slice(a.shift().value.length)}for(r=ht.needsContext.test(t)?0:a.length;r--&&(o=a[r],!b.relative[s=o.type]);)if((c=b.find[s])&&(n=c(o.matches[0].replace(_t,yt),vt.test(a[0].type)&&l(e.parentNode)||e))){if(a.splice(r,1),!(t=n.length&&u(a)))return J.apply(i,n),i;break}}return(h||C(t,d))(n,e,!j,i,!e||vt.test(t)&&l(e.parentNode)||e),i},y.sortStable=I.split("").sort(V).join("")===I,y.detectDuplicates=!!M,E(),y.sortDetached=r(function(t){return 1&t.compareDocumentPosition(O.createElement("div"))}),r(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||a("type|href|height|width",function(t,e,i){if(!i)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),y.attributes&&r(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||a("value",function(t,e,i){if(!i&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||a(Z,function(t,e,i){var n;if(!i)return!0===t[e]?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(i);lt.find=ft,lt.expr=ft.selectors,lt.expr[":"]=lt.expr.pseudos,lt.uniqueSort=lt.unique=ft.uniqueSort,lt.text=ft.getText,lt.isXMLDoc=ft.isXML,lt.contains=ft.contains;var pt=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&<(t).is(i))break;n.push(t)}return n},mt=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},vt=lt.expr.match.needsContext,gt=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,_t=/^.[^:#\[\.,]*$/;lt.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?lt.find.matchesSelector(n,t)?[n]:[]:lt.find.matches(t,lt.grep(e,function(t){return 1===t.nodeType}))},lt.fn.extend({find:function(t){var e,i=this.length,n=[],r=this;if("string"!=typeof t)return this.pushStack(lt(t).filter(function(){for(e=0;e1?lt.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(s(this,t||[],!1))},not:function(t){return this.pushStack(s(this,t||[],!0))},is:function(t){return!!s(this,"string"==typeof t&&vt.test(t)?lt(t):t||[],!1).length}});var yt,bt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(lt.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||yt,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:bt.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof lt?e[0]:e,lt.merge(this,lt.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:Z,!0)),gt.test(n[1])&<.isPlainObject(e))for(n in e)lt.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=Z.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=Z,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):lt.isFunction(t)?void 0!==i.ready?i.ready(t):t(lt):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),lt.makeArray(t,this))}).prototype=lt.fn,yt=lt(Z);var wt=/^(?:parents|prev(?:Until|All))/,xt={children:!0,contents:!0,next:!0,prev:!0};lt.fn.extend({has:function(t){var e=lt(t,this),i=e.length;return this.filter(function(){for(var t=0;t-1:1===i.nodeType&<.find.matchesSelector(i,t))){a.push(i);break}return this.pushStack(a.length>1?lt.uniqueSort(a):a)},index:function(t){return t?"string"==typeof t?nt.call(lt(t),this[0]):nt.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(lt.uniqueSort(lt.merge(this.get(),lt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),lt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return pt(t,"parentNode")},parentsUntil:function(t,e,i){return pt(t,"parentNode",i)},next:function(t){return l(t,"nextSibling")},prev:function(t){return l(t,"previousSibling")},nextAll:function(t){return pt(t,"nextSibling")},prevAll:function(t){return pt(t,"previousSibling")},nextUntil:function(t,e,i){return pt(t,"nextSibling",i)},prevUntil:function(t,e,i){return pt(t,"previousSibling",i)},siblings:function(t){return mt((t.parentNode||{}).firstChild,t)},children:function(t){return mt(t.firstChild)},contents:function(t){return t.contentDocument||lt.merge([],t.childNodes)}},function(t,e){lt.fn[t]=function(i,n){var r=lt.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=lt.filter(n,r)),this.length>1&&(xt[t]||lt.uniqueSort(r),wt.test(t)&&r.reverse()),this.pushStack(r)}});var kt=/\S+/g;lt.Callbacks=function(t){t="string"==typeof t?c(t):lt.extend({},t);var e,i,n,r,a=[],o=[],s=-1,l=function(){for(r=t.once,n=e=!0;o.length;s=-1)for(i=o.shift();++s-1;)a.splice(i,1),i<=s&&s--}),this},has:function(t){return t?lt.inArray(t,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return r=o=[],a=i="",this},disabled:function(){return!a},lock:function(){return r=o=[],i||(a=i=""),this},locked:function(){return!!r},fireWith:function(t,i){return r||(i=i||[],i=[t,i.slice?i.slice():i],o.push(i),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},lt.extend({Deferred:function(t){var e=[["resolve","done",lt.Callbacks("once memory"),"resolved"],["reject","fail",lt.Callbacks("once memory"),"rejected"],["notify","progress",lt.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return lt.Deferred(function(i){lt.each(e,function(e,a){var o=lt.isFunction(t[e])&&t[e];r[a[1]](function(){var t=o&&o.apply(this,arguments);t&<.isFunction(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[a[0]+"With"](this===n?i.promise():this,o?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?lt.extend(t,n):n}},r={};return n.pipe=n.then,lt.each(e,function(t,a){var o=a[2],s=a[3];n[a[1]]=o.add,s&&o.add(function(){i=s},e[1^t][2].disable,e[2][2].lock),r[a[0]]=function(){return r[a[0]+"With"](this===r?n:this,arguments),this},r[a[0]+"With"]=o.fireWith}),n.promise(r),t&&t.call(r,r),r},when:function(t){var e,i,n,r=0,a=tt.call(arguments),o=a.length,s=1!==o||t&<.isFunction(t.promise)?o:0,l=1===s?t:lt.Deferred(),c=function(t,i,n){return function(r){i[t]=this,n[t]=arguments.length>1?tt.call(arguments):r,n===e?l.notifyWith(i,n):--s||l.resolveWith(i,n)}};if(o>1)for(e=new Array(o),i=new Array(o),n=new Array(o);r0||(Ct.resolveWith(Z,[lt]),lt.fn.triggerHandler&&(lt(Z).triggerHandler("ready"),lt(Z).off("ready"))))}}),lt.ready.promise=function(t){return Ct||(Ct=lt.Deferred(),"complete"===Z.readyState||"loading"!==Z.readyState&&!Z.documentElement.doScroll?i.setTimeout(lt.ready):(Z.addEventListener("DOMContentLoaded",u),i.addEventListener("load",u))),Ct.promise(t)},lt.ready.promise();var St=function(t,e,i,n,r,a,o){var s=0,l=t.length,c=null==i;if("object"===lt.type(i)){r=!0;for(s in i)St(t,e,s,i[s],!0,a,o)}else if(void 0!==n&&(r=!0,lt.isFunction(n)||(o=!0),c&&(o?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(lt(t),i)})),e))for(;s-1&&void 0!==i&&Mt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Mt.remove(this,t)})}}),lt.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=At.get(t,e),i&&(!n||lt.isArray(i)?n=At.access(t,e,lt.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=lt.queue(t,e),n=i.length,r=i.shift(),a=lt._queueHooks(t,e),o=function(){lt.dequeue(t,e)};"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete a.stop,r.call(t,o,a)),!n&&a&&a.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return At.get(t,i)||At.access(t,i,{empty:lt.Callbacks("once memory").add(function(){At.remove(t,[e+"queue",i])})})}}),lt.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length",""],thead:[1,"
    WorkflowsTool IDsShedNameOwnerActions
    ','
      ','<% _.each(workflow.get("workflows"), function(name) { %>','
    • <%= name %>
    • ',"<% }); %>","
    ","
    ','
      ','<% _.each(workflow.get("tools"), function(tool) { %>','
    • <%= tool %>
    • ',"<% }); %>","
    ","
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>','
      ','
    • ','" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • ',"
    ","
    ","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td;var Ht=/<|&#?\w+;/;!function(){var t=Z.createDocumentFragment(),e=t.appendChild(Z.createElement("div")),i=Z.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),e.appendChild(i),st.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",st.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var qt=/^key/,zt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ft=/^([^.]*)(?:\.(.+)|)/;lt.event={global:{},add:function(t,e,i,n,r){var a,o,s,l,c,u,h,d,f,p,m,v=At.get(t);if(v)for(i.handler&&(a=i,i=a.handler,r=a.selector),i.guid||(i.guid=lt.guid++),(l=v.events)||(l=v.events={}),(o=v.handle)||(o=v.handle=function(e){return void 0!==lt&<.event.triggered!==e.type?lt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(kt)||[""],c=e.length;c--;)s=Ft.exec(e[c])||[],f=m=s[1],p=(s[2]||"").split(".").sort(),f&&(h=lt.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=lt.event.special[f]||{},u=lt.extend({type:f,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&<.expr.match.needsContext.test(r),namespace:p.join(".")},a),(d=l[f])||(d=l[f]=[],d.delegateCount=0,h.setup&&!1!==h.setup.call(t,n,p,o)||t.addEventListener&&t.addEventListener(f,o)),h.add&&(h.add.call(t,u),u.handler.guid||(u.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),lt.event.global[f]=!0)},remove:function(t,e,i,n,r){var a,o,s,l,c,u,h,d,f,p,m,v=At.hasData(t)&&At.get(t);if(v&&(l=v.events)){for(e=(e||"").match(kt)||[""],c=e.length;c--;)if(s=Ft.exec(e[c])||[],f=m=s[1],p=(s[2]||"").split(".").sort(),f){for(h=lt.event.special[f]||{},f=(n?h.delegateType:h.bindType)||f,d=l[f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=d.length;a--;)u=d[a],!r&&m!==u.origType||i&&i.guid!==u.guid||s&&!s.test(u.namespace)||n&&n!==u.selector&&("**"!==n||!u.selector)||(d.splice(a,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(t,u));o&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,p,v.handle)||lt.removeEvent(t,f,v.handle),delete l[f])}else for(f in l)lt.event.remove(t,f+e[c],i,n,!0);lt.isEmptyObject(l)&&At.remove(t,"handle events")}},dispatch:function(t){t=lt.event.fix(t);var e,i,n,r,a,o=[],s=tt.call(arguments),l=(At.get(this,"events")||{})[t.type]||[],c=lt.event.special[t.type]||{};if(s[0]=t,t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){for(o=lt.event.handlers.call(this,t,l),e=0;(r=o[e++])&&!t.isPropagationStopped();)for(t.currentTarget=r.elem,i=0;(a=r.handlers[i++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(n=((lt.event.special[a.origType]||{}).handle||a.handler).apply(r.elem,s))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,r,a,o=[],s=e.delegateCount,l=t.target;if(s&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(n=[],i=0;i-1:lt.find(r,this,null,[l]).length),n[r]&&n.push(a);n.length&&o.push({elem:l,handlers:n})}return s]*)\/>/gi,Vt=/\s*$/g;lt.extend({htmlPrefilter:function(t){return t.replace(Bt,"<$1>")},clone:function(t,e,i){var n,r,a,o,s=t.cloneNode(!0),l=lt.contains(t.ownerDocument,t);if(!(st.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||lt.isXMLDoc(t)))for(o=p(s),a=p(t),n=0,r=a.length;n0&&m(o,!l&&p(t,"script")),s},cleanData:function(t){for(var e,i,n,r=lt.event.special,a=0;void 0!==(i=t[a]);a++)if(Tt(i)){if(e=i[At.expando]){if(e.events)for(n in e.events)r[n]?lt.event.remove(i,n):lt.removeEvent(i,n,e.handle);i[At.expando]=void 0}i[Mt.expando]&&(i[Mt.expando]=void 0)}}}),lt.fn.extend({domManip:T,detach:function(t){return A(this,t,!0)},remove:function(t){return A(this,t)},text:function(t){return St(this,function(t){return void 0===t?lt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return T(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){w(this,t).appendChild(t)}})},prepend:function(){return T(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=w(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return T(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return T(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(lt.cleanData(p(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return lt.clone(this,t,e)})},html:function(t){return St(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Vt.test(t)&&!Lt[(Nt.exec(t)||["",""])[1].toLowerCase()]){t=lt.htmlPrefilter(t);try{for(;i1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Pt(this)?lt(this).show():lt(this).hide()})}}),lt.Tween=I,I.prototype={constructor:I,init:function(t,e,i,n,r,a){this.elem=t,this.prop=i,this.easing=r||lt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=a||(lt.cssNumber[i]?"":"px")},cur:function(){var t=I.propHooks[this.prop];return t&&t.get?t.get(this):I.propHooks._default.get(this)},run:function(t){var e,i=I.propHooks[this.prop];return this.options.duration?this.pos=e=lt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=lt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){lt.fx.step[t.prop]?lt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[lt.cssProps[t.prop]]&&!lt.cssHooks[t.prop]?t.elem[t.prop]=t.now:lt.style(t.elem,t.prop,t.now+t.unit)}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},lt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},lt.fx=I.prototype.init,lt.fx.step={};var oe,se,le=/^(?:toggle|show|hide)$/,ce=/queueHooks$/;lt.Animation=lt.extend(B,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return f(i.elem,t,jt.exec(e),i),i}]},tweener:function(t,e){lt.isFunction(t)?(e=t,t=["*"]):t=t.match(kt);for(var i,n=0,r=t.length;n1)},removeAttr:function(t){return this.each(function(){lt.removeAttr(this,t)})}}),lt.extend({attr:function(t,e,i){var n,r,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===t.getAttribute?lt.prop(t,e,i):(1===a&<.isXMLDoc(t)||(e=e.toLowerCase(),r=lt.attrHooks[e]||(lt.expr.match.bool.test(e)?ue:void 0)),void 0!==i?null===i?void lt.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:(n=lt.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!st.radioValue&&"radio"===e&<.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n,r=0,a=e&&e.match(kt);if(a&&1===t.nodeType)for(;i=a[r++];)n=lt.propFix[i]||i,lt.expr.match.bool.test(i)&&(t[n]=!1),t.removeAttribute(i)}}),ue={set:function(t,e,i){return!1===e?lt.removeAttr(t,i):t.setAttribute(i,i),i}},lt.each(lt.expr.match.bool.source.match(/\w+/g),function(t,e){var i=he[e]||lt.find.attr;he[e]=function(t,e,n){var r,a;return n||(a=he[e],he[e]=r,r=null!=i(t,e,n)?e.toLowerCase():null,he[e]=a),r}});var de=/^(?:input|select|textarea|button)$/i,fe=/^(?:a|area)$/i;lt.fn.extend({prop:function(t,e){return St(this,lt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[lt.propFix[t]||t]})}}),lt.extend({prop:function(t,e,i){var n,r,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&<.isXMLDoc(t)||(e=lt.propFix[e]||e,r=lt.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=lt.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||fe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),st.optSelected||(lt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),lt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){lt.propFix[this.toLowerCase()]=this});var pe=/[\t\r\n\f]/g;lt.fn.extend({addClass:function(t){var e,i,n,r,a,o,s,l=0;if(lt.isFunction(t))return this.each(function(e){lt(this).addClass(t.call(this,e,V(this)))});if("string"==typeof t&&t)for(e=t.match(kt)||[];i=this[l++];)if(r=V(i),n=1===i.nodeType&&(" "+r+" ").replace(pe," ")){for(o=0;a=e[o++];)n.indexOf(" "+a+" ")<0&&(n+=a+" ");s=lt.trim(n),r!==s&&i.setAttribute("class",s)}return this},removeClass:function(t){var e,i,n,r,a,o,s,l=0;if(lt.isFunction(t))return this.each(function(e){lt(this).removeClass(t.call(this,e,V(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(kt)||[];i=this[l++];)if(r=V(i),n=1===i.nodeType&&(" "+r+" ").replace(pe," ")){for(o=0;a=e[o++];)for(;n.indexOf(" "+a+" ")>-1;)n=n.replace(" "+a+" "," ");s=lt.trim(n),r!==s&&i.setAttribute("class",s)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):lt.isFunction(t)?this.each(function(i){lt(this).toggleClass(t.call(this,i,V(this),e),e)}):this.each(function(){var e,n,r,a;if("string"===i)for(n=0,r=lt(this),a=t.match(kt)||[];e=a[n++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==i||(e=V(this),e&&At.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":At.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+V(i)+" ").replace(pe," ").indexOf(e)>-1)return!0;return!1}});var me=/\r/g,ve=/[\x20\t\r\n\f]+/g;lt.fn.extend({val:function(t){var e,i,n,r=this[0];{if(arguments.length)return n=lt.isFunction(t),this.each(function(i){var r;1===this.nodeType&&(r=n?t.call(this,i,lt(this).val()):t,null==r?r="":"number"==typeof r?r+="":lt.isArray(r)&&(r=lt.map(r,function(t){return null==t?"":t+""})),(e=lt.valHooks[this.type]||lt.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))});if(r)return(e=lt.valHooks[r.type]||lt.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:(i=r.value,"string"==typeof i?i.replace(me,""):null==i?"":i)}}}),lt.extend({valHooks:{option:{get:function(t){var e=lt.find.attr(t,"value");return null!=e?e:lt.trim(lt.text(t)).replace(ve," ")}},select:{get:function(t){for(var e,i,n=t.options,r=t.selectedIndex,a="select-one"===t.type||r<0,o=a?null:[],s=a?r+1:n.length,l=r<0?s:a?r:0;l-1)&&(i=!0);return i||(t.selectedIndex=-1),a}}}}),lt.each(["radio","checkbox"],function(){lt.valHooks[this]={set:function(t,e){if(lt.isArray(e))return t.checked=lt.inArray(lt(t).val(),e)>-1}},st.checkOn||(lt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var ge=/^(?:focusinfocus|focusoutblur)$/;lt.extend(lt.event,{trigger:function(t,e,n,r){var a,o,s,l,c,u,h,d=[n||Z],f=ot.call(t,"type")?t.type:t,p=ot.call(t,"namespace")?t.namespace.split("."):[];if(o=s=n=n||Z,3!==n.nodeType&&8!==n.nodeType&&!ge.test(f+lt.event.triggered)&&(f.indexOf(".")>-1&&(p=f.split("."),f=p.shift(),p.sort()),c=f.indexOf(":")<0&&"on"+f,t=t[lt.expando]?t:new lt.Event(f,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=p.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:lt.makeArray(e,[t]),h=lt.event.special[f]||{},r||!h.trigger||!1!==h.trigger.apply(n,e))){if(!r&&!h.noBubble&&!lt.isWindow(n)){for(l=h.delegateType||f,ge.test(l+f)||(o=o.parentNode);o;o=o.parentNode)d.push(o),s=o;s===(n.ownerDocument||Z)&&d.push(s.defaultView||s.parentWindow||i)}for(a=0;(o=d[a++])&&!t.isPropagationStopped();)t.type=a>1?l:h.bindType||f,u=(At.get(o,"events")||{})[t.type]&&At.get(o,"handle"),u&&u.apply(o,e),(u=c&&o[c])&&u.apply&&Tt(o)&&(t.result=u.apply(o,e),!1===t.result&&t.preventDefault());return t.type=f,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(d.pop(),e)||!Tt(n)||c&<.isFunction(n[f])&&!lt.isWindow(n)&&(s=n[c],s&&(n[c]=null),lt.event.triggered=f,n[f](),lt.event.triggered=void 0,s&&(n[c]=s)),t.result}},simulate:function(t,e,i){var n=lt.extend(new lt.Event,i,{type:t,isSimulated:!0});lt.event.trigger(n,null,e)}}),lt.fn.extend({trigger:function(t,e){return this.each(function(){lt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return lt.event.trigger(t,e,i,!0)}}),lt.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){lt.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),lt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),st.focusin="onfocusin"in i,st.focusin||lt.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){lt.event.simulate(e,t.target,lt.event.fix(t))};lt.event.special[e]={setup:function(){var n=this.ownerDocument||this,r=At.access(n,e);r||n.addEventListener(t,i,!0),At.access(n,e,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this,r=At.access(n,e)-1;r?At.access(n,e,r):(n.removeEventListener(t,i,!0),At.remove(n,e))}}});var _e=i.location,ye=lt.now(),be=/\?/;lt.parseJSON=function(t){return JSON.parse(t+"")},lt.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||lt.error("Invalid XML: "+t),e};var we=/#.*$/,xe=/([?&])_=[^&]*/,ke=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ce=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Se=/^(?:GET|HEAD)$/,Te=/^\/\//,Ae={},Me={},Ee="*/".concat("*"),Oe=Z.createElement("a");Oe.href=_e.href,lt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_e.href,type:"GET",isLocal:Ce.test(_e.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ee,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":lt.parseJSON,"text xml":lt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?G(G(t,lt.ajaxSettings),e):G(lt.ajaxSettings,t)},ajaxPrefilter:U(Ae),ajaxTransport:U(Me),ajax:function(t,e){function n(t,e,n,s){var c,h,_,y,w,k=e;2!==b&&(b=2,l&&i.clearTimeout(l),r=void 0,o=s||"",x.readyState=t>0?4:0,c=t>=200&&t<300||304===t,n&&(y=X(d,x,n)),y=Y(d,y,x,c),c?(d.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(lt.lastModified[a]=w),(w=x.getResponseHeader("etag"))&&(lt.etag[a]=w)),204===t||"HEAD"===d.type?k="nocontent":304===t?k="notmodified":(k=y.state,h=y.data,_=y.error,c=!_)):(_=k,!t&&k||(k="error",t<0&&(t=0))),x.status=t,x.statusText=(e||k)+"",c?m.resolveWith(f,[h,k,x]):m.rejectWith(f,[x,k,_]),x.statusCode(g),g=void 0,u&&p.trigger(c?"ajaxSuccess":"ajaxError",[x,d,c?h:_]),v.fireWith(f,[x,k]),u&&(p.trigger("ajaxComplete",[x,d]),--lt.active||lt.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,a,o,s,l,c,u,h,d=lt.ajaxSetup({},e),f=d.context||d,p=d.context&&(f.nodeType||f.jquery)?lt(f):lt.event,m=lt.Deferred(),v=lt.Callbacks("once memory"),g=d.statusCode||{},_={},y={},b=0,w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!s)for(s={};e=ke.exec(o);)s[e[1].toLowerCase()]=e[2];e=s[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return b||(t=y[i]=y[i]||t,_[t]=e),this},overrideMimeType:function(t){return b||(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(b<2)for(e in t)g[e]=[g[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||w;return r&&r.abort(e),n(0,e),this}};if(m.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,d.url=((t||d.url||_e.href)+"").replace(we,"").replace(Te,_e.protocol+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=lt.trim(d.dataType||"*").toLowerCase().match(kt)||[""],null==d.crossDomain){c=Z.createElement("a");try{c.href=d.url,c.href=c.href,d.crossDomain=Oe.protocol+"//"+Oe.host!=c.protocol+"//"+c.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=lt.param(d.data,d.traditional)),W(Ae,d,e,x),2===b)return x;u=lt.event&&d.global,u&&0==lt.active++&<.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Se.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(be.test(a)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=xe.test(a)?a.replace(xe,"$1_="+ye++):a+(be.test(a)?"&":"?")+"_="+ye++)),d.ifModified&&(lt.lastModified[a]&&x.setRequestHeader("If-Modified-Since",lt.lastModified[a]),lt.etag[a]&&x.setRequestHeader("If-None-Match",lt.etag[a])),(d.data&&d.hasContent&&!1!==d.contentType||e.contentType)&&x.setRequestHeader("Content-Type",d.contentType),x.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ee+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)x.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(f,x,d)||2===b))return x.abort();w="abort";for(h in{success:1,error:1,complete:1})x[h](d[h]);if(r=W(Me,d,e,x)){if(x.readyState=1,u&&p.trigger("ajaxSend",[x,d]),2===b)return x;d.async&&d.timeout>0&&(l=i.setTimeout(function(){x.abort("timeout")},d.timeout));try{b=1,r.send(_,n)}catch(t){if(!(b<2))throw t;n(-1,t)}}else n(-1,"No Transport");return x},getJSON:function(t,e,i){return lt.get(t,e,i,"json")},getScript:function(t,e){return lt.get(t,void 0,e,"script")}}),lt.each(["get","post"],function(t,e){lt[e]=function(t,i,n,r){return lt.isFunction(i)&&(r=r||n,n=i,i=void 0),lt.ajax(lt.extend({url:t,type:e,dataType:r,data:i,success:n},lt.isPlainObject(t)&&t))}}),lt._evalUrl=function(t){return lt.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},lt.fn.extend({wrapAll:function(t){var e;return lt.isFunction(t)?this.each(function(e){lt(this).wrapAll(t.call(this,e))}):(this[0]&&(e=lt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return lt.isFunction(t)?this.each(function(e){lt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=lt(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=lt.isFunction(t);return this.each(function(i){lt(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){lt.nodeName(this,"body")||lt(this).replaceWith(this.childNodes)}).end()}}),lt.expr.filters.hidden=function(t){return!lt.expr.filters.visible(t)},lt.expr.filters.visible=function(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0};var $e=/%20/g,je=/\[\]$/,De=/\r?\n/g,Pe=/^(?:submit|button|image|reset|file)$/i,Re=/^(?:input|select|textarea|keygen)/i;lt.param=function(t,e){var i,n=[],r=function(t,e){e=lt.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=lt.ajaxSettings&<.ajaxSettings.traditional),lt.isArray(t)||t.jquery&&!lt.isPlainObject(t))lt.each(t,function(){r(this.name,this.value)});else for(i in t)J(i,t[i],e,r);return n.join("&").replace($e,"+")},lt.fn.extend({serialize:function(){return lt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=lt.prop(this,"elements");return t?lt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!lt(this).is(":disabled")&&Re.test(this.nodeName)&&!Pe.test(t)&&(this.checked||!Rt.test(t))}).map(function(t,e){var i=lt(this).val();return null==i?null:lt.isArray(i)?lt.map(i,function(t){return{name:e.name,value:t.replace(De,"\r\n")}}):{name:e.name,value:i.replace(De,"\r\n")}}).get()}}),lt.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Ne={0:200,1223:204},Ie=lt.ajaxSettings.xhr();st.cors=!!Ie&&"withCredentials"in Ie,st.ajax=Ie=!!Ie,lt.ajaxTransport(function(t){var e,n;if(st.cors||Ie&&!t.crossDomain)return{send:function(r,a){var o,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)s[o]=t.xhrFields[o];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)s.setRequestHeader(o,r[o]);e=function(t){return function(){e&&(e=n=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Ne[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),n=s.onerror=e("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&i.setTimeout(function(){e&&n()})},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),lt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return lt.globalEval(t),t}}}),lt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),lt.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,r){e=lt("