-"bundle";System.register("main.js",[],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging(),a.start().then(function(){return a.setRoot("shell")})}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("shell.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return"<template><router-view></router-view></template>"})}(),System.register("common/i2b2.pub-sub.js",["aurelia-framework","./i2b2.service","./tabs.model"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.I2B2Service},function(a){f=a.TabsModel}],execute:function(){a("I2B2PubSub",(g=d(e,f),i=g(h=function b(a,d){c(this,b),this.listen=function(){var b=function(a,b){return b.find(function(a){return"ADD"===a.action})?d.setMax():d.setMin()};a.onResize(b)}})||h)),a("I2B2PubSub",i)}}}),System.register("shell.js",["aurelia-framework","common/i2b2.pub-sub"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.inject},function(a){e=a.I2B2PubSub}],execute:function(){a("Shell",(f=d(e),h=f(g=function(){function a(b){c(this,a),b.listen()}return a.prototype.configureRouter=function(a,b){a.title="SHRINE Webclient Plugin",a.map([{route:"mailto",moduleId:"views/mailto/mailto"},{route:["","query-viewer"],moduleId:"views/query-viewer/query-viewer"}]),this.router=b},a}())||g)),a("Shell",h)}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><div class="mailto"><div class="content"><p>If you have questions about your query results or this SHRINE network, contact the Data Steward at your site.</p><div class="email js-email"><button class="button button--large js-button" click.delegate="openEmail()">Email Data Steward</button></div></div></div></template>'})}(),System.register("views/mailto/mailto.service.js",["aurelia-framework","repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.inject},function(a){e=a.QEPRepository}],execute:function(){a("MailToService",(f=d(e),h=f(g=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}())||g)),a("MailToService",h)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["aurelia-framework","views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.MailToService},function(a){f=a.MailConfig}],execute:function(){a("MailTo",(g=d(e,f),i=g(h=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}())||h)),a("MailTo",i)}}}),System.register("views/query-viewer/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),function(){var a=System.amdDefine;a("views/query-viewer/context-menu/context-menu.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><ul class="context-menu ${context.class || \'hide\'}" mouseleave.trigger="context.class=\'hide\'" css="top: ${context.y - 40}; left: ${context.x - 50};"><li click.delegate="loadQuery(context.id)"><a href="#"><i class="fa fa-files-o"></i> Clone</a></li><li><a click.delegate="loadHistory()" href="#"><i class="fa fa-history"></i> Refresh All</a></li></ul></template>'})}(),System.register("views/query-viewer/context-menu/context-menu.js",["aurelia-framework","common/i2b2.service.js"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m;return{setters:[function(a){f=a.inject,g=a.bindable},function(a){h=a.I2B2Service}],execute:function(){a("ContextMenu",(i=f(h),m=i((k=function b(a){var e=this;d(this,b),c(this,"context",l,this),this.loadQuery=function(b){a.loadQuery(b),e.context["class"]="hide"},this.loadHistory=function(){a.loadHistory(),e.context["class"]="hide"}},l=e(k.prototype,"context",[g],{enumerable:!0,initializer:null}),j=k))||j)),a("ContextMenu",m)}}}),function(){var a=System.amdDefine;a("views/query-viewer/loading-bar/loading-bar.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><div class="loader"><h1>${status}</h1><div class="slider"><div class="line"></div><div class="break dot1"></div><div class="break dot2"></div><div class="break dot3"></div></div></div></template>'})}(),System.register("views/query-viewer/loading-bar/loading-bar.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i;return{setters:[function(a){f=a.bindable}],execute:function(){a("LoadingBar",(g=function b(){d(this,b),c(this,"status",h,this)},h=e(g.prototype,"status",[f],{enumerable:!0,initializer:null}),i=g)),a("LoadingBar",i)}}}),function(){var a=System.amdDefine;a("views/query-viewer/loading-bar/row-loader.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return""})}(),function(){var a=System.amdDefine;a("views/query-viewer/query-viewer.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><require from="views/query-viewer/result-style.converter"></require><require from="views/query-viewer/result-value.converter"></require><require from="views/query-viewer/box-style.converter"></require><require from="views/query-viewer/context-menu/context-menu"></require><require from="views/query-viewer/loading-bar/loading-bar"></require><loading-bar status.bind="\'Loading...\'" if.bind="showLoader"></loading-bar><div style="width: 100%; text-align: center"><ul class="circle-pagination" if.bind="showCircles"><li repeat.for="screen of screens" class="${screenIndex === $index? \'active\' : \'\'}" click.delegate="screenIndex = $index"><div>${screen.id}</div></li></ul></div><div class="box-wrapper"><div class="box" repeat.for="screen of screens" css.bind="screenIndex | boxStyle"><section><div><table cellpadding="0" cellspacing="0" border="0"><thead><tr><th class="tbl-header"></th><th repeat.for="node of screen.nodes" class="tbl-header"><div class="hideextra">${node}</div></th></tr></thead></table></div><context-menu context.bind="context"></context-menu><div class="tbl-content ${vertStyle}" scroll.trigger="onScroll($event)"><table cellpadding="0" cellspacing="0" border="0"><tbody><tr if.bind="runningQuery"><th><div class="hideextra">${runningQuery}</div></th><td repeat.for="node of screen.nodes" style="color: #00FF00">RUNNING</td></tr><tr repeat.for="result of screen.results" contextmenu.trigger="context = getContext($event, result)"><th><div class="hideextra">${result.name}</div></th><td repeat.for="nodeResult of result.nodeResults" css="${nodeResult | resultStyle}"><a if.bind="nodeResult.status !== \'FINISHED\'" click.delegate="errorDetail(nodeResult)" style="text-decoration: underline">${nodeResult.status} </a>${nodeResult | result}</td></tr><tr if.bind="loadingInfiniteScroll"><td colspan="${screen.nodes.length + 1}" style="background:rgba(217, 236, 240, .05); text-align:center; color: rgba(0, 0, 0, .20)"><div style="font-size: 1.5rem"><i class="fa fa-spinner fa-spin" style="color: inherit"></i> Loading...</div></td></tr></tbody></table></div></section></div></div></template>'})}(),System.register("repository/qep.repository.js",["aurelia-framework","aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.HttpClient},function(a){}],execute:function(){f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("QEPRepository",(g=d(e),i=g(h=function(){function a(b){var d=this;c(this,a),b.configure(function(a){a.useStandardConfiguration().withBaseUrl(d.url).withDefaults({headers:{Authorization:"Basic "+d.auth}})}),this.http=b}return a.prototype.fetchPreviousQueries=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail").then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},f(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}())||h)),a("QEPRepository",i)}}}),System.register("views/query-viewer/query-viewer.service.js",["aurelia-framework","repository/qep.repository","./query-viewer.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.QEPRepository},function(a){f=a.QueryViewerConfig}],execute:function(){a("QueryViewerService",(g=d(e,f),i=g(h=function(){function a(b,d,e){c(this,a),this.repository=b,this.config=d}return a.prototype.fetchPreviousQueries=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.maxQueriesPerScroll;return this.repository.fetchPreviousQueries(a)},a.prototype.getScreens=function(a,b){var c=this;return new Promise(function(d,e){for(var f=a.sort().length,g=[],h=0;h<f;h+=c.config.maxNodesPerScreen){var i=c.getNumberOfNodesOnScreen(a,h,c.config.maxNodesPerScreen),j=i-1,k=c.getScreenId(a,h,j),l=a.slice(h,i),m=c.mapQueriesToScreenNodes(l,b,c.findQueriesForNode);g.push({id:k,nodes:l,results:m})}d(g)})},a.prototype.mapQueriesToScreenNodes=function(a,b){var c=[];return b.forEach(function(b,d){var e={name:b.query.queryName,id:b.query.networkId,nodeResults:[]};a.forEach(function(a){e.nodeResults.push(b.adaptersToResults.find(function(b){return b.adapterNode===a}))}),c.push(e)}),c},a.prototype.getNumberOfNodesOnScreen=function(a,b){var c=b+this.config.maxNodesPerScreen;return c<a.length?c:a.length},a.prototype.getScreenId=function(a,b,c){var d=a[b],e=a[c];return String(d).substr(0,1)+"-"+String(e).substr(0,1)},a}())||h)),a("QueryViewerService",i)}}}),System.register("common/i2b2.service.js",["ramda","./container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("I2B2Service",f=function b(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;c(this,b);var f=e.of(a),g=d.curry(function(a,b){return b.value?e.of(d.prop(a,b.value)):e.of(null)}),h=d.compose(g("i2b2"),g("window"),g("parent")),i=d.compose(g("CRC"),h),j=d.compose(g("events"),h),k=d.compose(g("SHRINE"),h);this.onResize=function(a){return j(f).map(function(b){return b.changedZoomWindows.subscribe(a)})},this.onHistory=function(a){return i(f).map(function(b){return b.ctrlr.history.events.onDataUpdate.subscribe(a)})},this.onQuery=function(a){return j(f).map(function(b){return b.afterQueryInit.subscribe(a)})},this.loadHistory=function(){return i(f).map(function(a){return a.view.history.doRefreshAll()})},this.loadQuery=function(a){return i(f).map(function(b){return b.ctrlr.QT.doQueryLoad(a)})},this.errorDetail=function(a){return k(f).map(function(b){return b.plugin.errorDetail(a)})}}),a("I2B2Service",f)}}}),System.register("common/tabs.model.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[],execute:function(){d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("TabsModel",e=function(){function a(){c(this,a);var b=a.min;a.prototype.setMax=function(){return b=a.full},a.prototype.setMin=function(){return b=a.min},a.prototype.mode=function(){return b}}return d(a,null,[{key:"full",get:function(){return"v-full"}},{key:"min",get:function(){return"v-min"}}]),a}()),a("TabsModel",e)}}}),System.register("views/query-viewer/query-viewer.model.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[],execute:function(){d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("QueryViewerModel",e=function(){function a(){c(this,a),this.processing=!1,this.loadedCount=0,this.totalQueries=0,this.screens=[]}return d(a,[{key:"moreToLoad",get:function(){return this.loadedCount<this.totalQueries}},{key:"hasData",get:function(){return this.screens.length>0}}]),a}()),a("QueryViewerModel",e)}}}),System.register("common/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("Container",f=function(){function a(b){c(this,a),this.__value=b}return a.of=function(b){return new a(function(){return b})},a.prototype.map=function(b){return this.hasNothing()?a.of(null):a.of(b(this.value))},a.prototype.join=function(){return this.hasNothing()?a.of(null):this.value},a.prototype.chain=function(a){return this.map(a).join()},a.prototype.hasNothing=function(){return null===this.value||void 0===this.value},a.prototype.ap=function(a){a.map(this.value)},e(a,[{key:"value",get:function(){return this.__value()}}]),a}()),a("Container",f)}}}),System.register("views/query-viewer/scroll.service.js",["ramda","common/container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("ScrollService",(g=f=function b(){c(this,b)},f.either=d.curry(function(a,b,c){return e.of(d.prop(a,c)||b)}),f.target=function(a,b){return h.either("target",b,b).chain(function(b){return h.either(a,0,b)})},f.clientHeight=function(a){return h.target("clientHeight",a)},f.scrollHeight=function(a){return h.target("scrollHeight",a)},f.scrollTop=function(a){return h.target("scrollTop",a)},f.userScroll=function(a){return h.clientHeight(a).map(function(b){return b+h.scrollTop(a).value})},f.scrollRatio=function(a){return h.userScroll(a).map(function(b){return b/h.scrollHeight(a).value})},h=g)),a("ScrollService",h)}}}),System.register("views/query-viewer/query-viewer.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("QueryViewerConfig",c={maxNodesPerScreen:10,maxQueriesPerScroll:40}),a("QueryViewerConfig",c)}}}),System.register("views/query-viewer/query-viewer.js",["aurelia-framework","views/query-viewer/query-viewer.service","common/i2b2.service.js","common/tabs.model","./query-viewer.model","./scroll.service","./query-viewer.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k,l,m,n;return{setters:[function(a){d=a.inject,e=a.computedFrom},function(a){f=a.QueryViewerService},function(a){g=a.I2B2Service},function(a){h=a.TabsModel},function(a){i=a.QueryViewerModel},function(a){j=a.ScrollService},function(a){k=a.QueryViewerConfig}],execute:function(){a("QueryViewer",(l=d(f,g,i,h),n=l(m=function(){function a(b,d,e,f){var g=this;c(this,a),this.screenIndex=0,this.showCircles=!1,this.showLoader=!0,this.runningQuery=null,this.service=b,this.vertStyle=f.mode(),this.scrollRatio=0,this.queriesToLoad=e.moreToLoad,this.loadingInfiniteScroll=!1;var h=function(a){return e.totalQueries=a.rowCount,e.loadedCount=a.queryResults.length,g.queriesToLoad=e.moreToLoad,g.service.getScreens(a.adapters,a.queryResults)},i=function(a){g.showLoader=!1,g.runningQuery=null,g.screens=a,g.showCircles=g.screens.length>1,e.screens=a,e.processing=!1,g.loadingInfiniteScroll=e.processing},l=function(){return g.service.fetchPreviousQueries(e.loadedCount+k.maxQueriesPerScroll).then(h).then(i)["catch"](function(a){return console.log(a)})},m=function(a,b){g.runningQuery=b[0].name},n=function(){return e.hasData?i(e.screens):l()},o=function(a){return 1===j.scrollRatio(a).value&&e.moreToLoad&&!e.processing};this.onScroll=function(a){o(a)&&(l(),e.processing=!0,g.loadingInfiniteScroll=e.processing)};var p=function(a){return"ADD"!==a.action},q=function(a,b){return g.vertStyle=b.find(p)?"v-min":"v-full"};this.errorDetail=d.errorDetail,d.onResize(q),d.onHistory(l),d.onQuery(m),n()}return a.prototype.getContext=function(a,b){return{x:a.pageX,y:a.pageY,id:b.id,"class":"show"}},a}())||m)),a("QueryViewer",n)}}}),System.register("views/query-viewer/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("views/query-viewer/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}});
-"bundle";System.register("main.js",[],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging(),a.start().then(function(){return a.setRoot("shell")})}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("shell.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return"<template><router-view></router-view></template>"})}(),System.register("common/i2b2.pub-sub.js",["aurelia-framework","./i2b2.service","./tabs.model"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.I2B2Service},function(a){f=a.TabsModel}],execute:function(){a("I2B2PubSub",(g=d(e,f),i=g(h=function b(a,d){c(this,b),this.listen=function(){var b=function(a,b){return b.find(function(a){return"ADD"===a.action})?d.setMax():d.setMin()};a.onResize(b)}})||h)),a("I2B2PubSub",i)}}}),System.register("shell.js",["aurelia-framework","common/i2b2.pub-sub"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.inject},function(a){e=a.I2B2PubSub}],execute:function(){a("Shell",(f=d(e),h=f(g=function(){function a(b){c(this,a),b.listen()}return a.prototype.configureRouter=function(a,b){a.title="SHRINE Webclient Plugin",a.map([{route:"mailto",moduleId:"views/mailto/mailto"},{route:["","query-viewer"],moduleId:"views/query-viewer/query-viewer"}]),this.router=b},a}())||g)),a("Shell",h)}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><div class="mailto"><div class="content"><p>If you have questions about your query results or this SHRINE network, contact the Data Steward at your site.</p><div class="email js-email"><button class="button button--large js-button" click.delegate="openEmail()">Email Data Steward</button></div></div></div></template>'})}(),System.register("views/mailto/mailto.service.js",["aurelia-framework","repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.inject},function(a){e=a.QEPRepository}],execute:function(){a("MailToService",(f=d(e),h=f(g=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}())||g)),a("MailToService",h)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["aurelia-framework","views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.MailToService},function(a){f=a.MailConfig}],execute:function(){a("MailTo",(g=d(e,f),i=g(h=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}())||h)),a("MailTo",i)}}}),System.register("views/query-viewer/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),function(){var a=System.amdDefine;a("views/query-viewer/context-menu/context-menu.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><ul class="context-menu ${context.class || \'hide\'}" mouseleave.trigger="context.class=\'hide\'" css="top: ${context.y - 40}; left: ${context.x - 50};"><li click.delegate="loadQuery(context.id)"><a href="#"><i class="fa fa-files-o"></i> Clone</a></li><li><a click.delegate="loadHistory()" href="#"><i class="fa fa-history"></i> Refresh All</a></li></ul></template>'})}(),System.register("views/query-viewer/context-menu/context-menu.js",["aurelia-framework","common/i2b2.service.js"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m;return{setters:[function(a){f=a.inject,g=a.bindable},function(a){h=a.I2B2Service}],execute:function(){a("ContextMenu",(i=f(h),m=i((k=function b(a){var e=this;d(this,b),c(this,"context",l,this),this.loadQuery=function(b){a.loadQuery(b),e.context["class"]="hide"},this.loadHistory=function(){a.loadHistory(),e.context["class"]="hide"}},l=e(k.prototype,"context",[g],{enumerable:!0,initializer:null}),j=k))||j)),a("ContextMenu",m)}}}),function(){var a=System.amdDefine;a("views/query-viewer/loading-bar/loading-bar.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><div class="loader"><h1>${status}</h1><div class="slider"><div class="line"></div><div class="break dot1"></div><div class="break dot2"></div><div class="break dot3"></div></div></div></template>'})}(),System.register("views/query-viewer/loading-bar/loading-bar.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i;return{setters:[function(a){f=a.bindable}],execute:function(){a("LoadingBar",(g=function b(){d(this,b),c(this,"status",h,this)},h=e(g.prototype,"status",[f],{enumerable:!0,initializer:null}),i=g)),a("LoadingBar",i)}}}),function(){var a=System.amdDefine;a("views/query-viewer/loading-bar/row-loader.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return""})}(),function(){var a=System.amdDefine;a("views/query-viewer/query-viewer.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><require from="views/query-viewer/result-style.converter"></require><require from="views/query-viewer/result-value.converter"></require><require from="views/query-viewer/box-style.converter"></require><require from="views/query-viewer/context-menu/context-menu"></require><require from="views/query-viewer/loading-bar/loading-bar"></require><loading-bar status.bind="\'Loading...\'" if.bind="showLoader"></loading-bar><div style="width: 100%; text-align: center"><ul class="circle-pagination" if.bind="showCircles"><li repeat.for="screen of screens" class="${screenIndex === $index? \'active\' : \'\'}" click.delegate="screenIndex = $index"><div>${screen.id}</div></li></ul></div><div class="box-wrapper"><div class="box" repeat.for="screen of screens" css.bind="screenIndex | boxStyle"><section><div><table cellpadding="0" cellspacing="0" border="0"><thead><tr><th class="tbl-header"></th><th repeat.for="node of screen.nodes" class="tbl-header"><div class="hideextra">${node}</div></th></tr></thead></table></div><context-menu context.bind="context"></context-menu><div class="tbl-content ${vertStyle}" scroll.trigger="onScroll($event)"><table cellpadding="0" cellspacing="0" border="0"><tbody><tr if.bind="runningQuery"><th><div class="hideextra">${runningQuery}</div></th><td repeat.for="node of screen.nodes" style="color: #00FF00">RUNNING</td></tr><tr repeat.for="result of screen.results" contextmenu.trigger="context = getContext($event, result)"><th><div class="hideextra">${result.name}</div></th><td repeat.for="nodeResult of result.nodeResults" css="${nodeResult | resultStyle}"><a if.bind="nodeResult.status !== \'FINISHED\'" click.delegate="errorDetail(nodeResult)" style="text-decoration: underline">${nodeResult.status} </a>${nodeResult | result}</td></tr><tr if.bind="loadingInfiniteScroll"><td colspan="${screen.nodes.length + 1}" style="background:rgba(217, 236, 240, .05); text-align:center; color: rgba(0, 0, 0, .20)"><div style="font-size: 1.5rem"><i class="fa fa-spinner fa-spin" style="color: inherit"></i> Loading...</div></td></tr></tbody></table></div></section></div></div></template>'})}(),System.register("repository/qep.repository.js",["aurelia-framework","aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.HttpClient},function(a){}],execute:function(){f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("QEPRepository",(g=d(e),i=g(h=function(){function a(b){var d=this;c(this,a),b.configure(function(a){a.useStandardConfiguration().withBaseUrl(d.url).withDefaults({headers:{Authorization:"Basic "+d.auth}})}),this.http=b}return a.prototype.fetchPreviousQueries=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail").then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},f(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}())||h)),a("QEPRepository",i)}}}),System.register("views/query-viewer/query-viewer.service.js",["aurelia-framework","repository/qep.repository","./query-viewer.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.QEPRepository},function(a){f=a.QueryViewerConfig}],execute:function(){a("QueryViewerService",(g=d(e,f),i=g(h=function(){function a(b,d,e){c(this,a),this.repository=b,this.config=d}return a.prototype.fetchPreviousQueries=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.maxQueriesPerScroll;return this.repository.fetchPreviousQueries(a)},a.prototype.getScreens=function(a,b){var c=this;return new Promise(function(d,e){for(var f=a.sort().length,g=[],h=0;h<f;h+=c.config.maxNodesPerScreen){var i=c.getNumberOfNodesOnScreen(a,h,c.config.maxNodesPerScreen),j=i-1,k=c.getScreenId(a,h,j),l=a.slice(h,i),m=c.mapQueriesToScreenNodes(l,b,c.findQueriesForNode);g.push({id:k,nodes:l,results:m})}d(g)})},a.prototype.mapQueriesToScreenNodes=function(a,b){var c=[];return b.forEach(function(b,d){var e={name:b.query.queryName,id:b.query.networkId,nodeResults:[]};a.forEach(function(a){e.nodeResults.push(b.adaptersToResults.find(function(b){return b.adapterNode===a}))}),c.push(e)}),c},a.prototype.getNumberOfNodesOnScreen=function(a,b){var c=b+this.config.maxNodesPerScreen;return c<a.length?c:a.length},a.prototype.getScreenId=function(a,b,c){var d=a[b],e=a[c];return String(d).substr(0,1)+"-"+String(e).substr(0,1)},a}())||h)),a("QueryViewerService",i)}}}),System.register("common/i2b2.service.js",["ramda","./container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("I2B2Service",f=function b(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;c(this,b);var f=e.of(a),g=d.curry(function(a,b){return b.value?e.of(d.prop(a,b.value)):e.of(null)}),h=d.compose(g("i2b2"),g("window"),g("parent")),i=d.compose(g("CRC"),h),j=d.compose(g("events"),h),k=d.compose(g("SHRINE"),h);this.onResize=function(a){return j(f).map(function(b){return b.changedZoomWindows.subscribe(a)})},this.onHistory=function(a){return i(f).map(function(b){return b.ctrlr.history.events.onDataUpdate.subscribe(a)})},this.onQuery=function(a){return j(f).map(function(b){return b.afterQueryInit.subscribe(a)})},this.loadHistory=function(){return i(f).map(function(a){return a.view.history.doRefreshAll()})},this.loadQuery=function(a){return i(f).map(function(b){return b.ctrlr.QT.doQueryLoad(a)})},this.errorDetail=function(a){return k(f).map(function(b){return b.plugin.errorDetail(a)})}}),a("I2B2Service",f)}}}),System.register("common/tabs.model.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[],execute:function(){d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("TabsModel",e=function(){function a(){c(this,a);var b=a.min;a.prototype.setMax=function(){return b=a.full},a.prototype.setMin=function(){return b=a.min},a.prototype.mode=function(){return b}}return d(a,null,[{key:"full",get:function(){return"v-full"}},{key:"min",get:function(){return"v-min"}}]),a}()),a("TabsModel",e)}}}),System.register("views/query-viewer/query-viewer.model.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[],execute:function(){d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("QueryViewerModel",e=function(){function a(){c(this,a),this.processing=!1,this.loadedCount=0,this.totalQueries=0,this.screens=[]}return d(a,[{key:"moreToLoad",get:function(){return this.loadedCount<this.totalQueries}},{key:"hasData",get:function(){return this.screens.length>0}}]),a}()),a("QueryViewerModel",e)}}}),System.register("common/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("Container",f=function(){function a(b){c(this,a),this.__value=b}return a.of=function(b){return new a(function(){return b})},a.prototype.map=function(b){return this.hasNothing()?a.of(null):a.of(b(this.value))},a.prototype.join=function(){return this.hasNothing()?a.of(null):this.value},a.prototype.chain=function(a){return this.map(a).join()},a.prototype.hasNothing=function(){return null===this.value||void 0===this.value},a.prototype.ap=function(a){a.map(this.value)},e(a,[{key:"value",get:function(){return this.__value()}}]),a}()),a("Container",f)}}}),System.register("views/query-viewer/scroll.service.js",["ramda","common/container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("ScrollService",(g=f=function b(){c(this,b)},f.either=d.curry(function(a,b,c){return e.of(d.prop(a,c)||b)}),f.target=function(a,b){return h.either("target",b,b).chain(function(b){return h.either(a,0,b)})},f.clientHeight=function(a){return h.target("clientHeight",a)},f.scrollHeight=function(a){return h.target("scrollHeight",a)},f.scrollTop=function(a){return h.target("scrollTop",a)},f.userScroll=function(a){return h.clientHeight(a).map(function(b){return b+h.scrollTop(a).value})},f.scrollRatio=function(a){return h.userScroll(a).map(function(b){return b/h.scrollHeight(a).value})},h=g)),a("ScrollService",h)}}}),System.register("views/query-viewer/query-viewer.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("QueryViewerConfig",c={maxNodesPerScreen:10,maxQueriesPerScroll:40}),a("QueryViewerConfig",c)}}}),System.register("views/query-viewer/query-viewer.js",["aurelia-framework","views/query-viewer/query-viewer.service","common/i2b2.service.js","common/tabs.model","./query-viewer.model","./scroll.service","./query-viewer.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k,l,m,n;return{setters:[function(a){d=a.inject,e=a.computedFrom},function(a){f=a.QueryViewerService},function(a){g=a.I2B2Service},function(a){h=a.TabsModel},function(a){i=a.QueryViewerModel},function(a){j=a.ScrollService},function(a){k=a.QueryViewerConfig}],execute:function(){a("QueryViewer",(l=d(f,g,i,h),n=l(m=function(){function a(b,d,e,f){var g=this;c(this,a),this.screenIndex=0,this.showCircles=!1,this.showLoader=!0,this.runningQuery=null,this.service=b,this.vertStyle=f.mode(),this.scrollRatio=0,this.queriesToLoad=e.moreToLoad,this.loadingInfiniteScroll=!1;var h=function(a){return e.totalQueries=a.rowCount,e.loadedCount=a.queryResults.length,g.queriesToLoad=e.moreToLoad,g.service.getScreens(a.adapters,a.queryResults)},i=function(a){g.showLoader=!1,g.runningQuery=null,g.screens=a,g.showCircles=g.screens.length>1,e.screens=a,e.processing=!1,g.loadingInfiniteScroll=e.processing},l=function(){return g.service.fetchPreviousQueries(e.loadedCount+k.maxQueriesPerScroll).then(h).then(i)["catch"](function(a){return console.log(a)})},m=function(a,b){g.runningQuery=b[0].name},n=function(){return e.hasData?i(e.screens):l()},o=function(a){return 1===j.scrollRatio(a).value&&e.moreToLoad&&!e.processing};this.onScroll=function(a){o(a)&&(l(),e.processing=!0,g.loadingInfiniteScroll=e.processing)};var p=function(a){return"ADD"!==a.action},q=function(a,b){return g.vertStyle=b.find(p)?"v-min":"v-full"};this.errorDetail=d.errorDetail,d.onResize(q),d.onHistory(l),d.onQuery(m),n()}return a.prototype.getContext=function(a,b){return{x:a.pageX,y:a.pageY,id:b.id,"class":"show"}},a}())||m)),a("QueryViewer",n)}}}),System.register("views/query-viewer/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("views/query-viewer/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}});
\ No newline at end of file
+"bundle";System.register("main.js",[],function(a,b){"use strict";function c(a){a.use.standardConfiguration().developmentLogging(),a.start().then(function(){return a.setRoot("shell")})}return a("configure",c),{setters:[],execute:function(){}}}),function(){var a=System.amdDefine;a("shell.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><!--router-view>\n\t\t\n\t</router-view--><!--compose view-model="views/mailto/mailto">\n\t</compose--><compose view-model="views/query-viewer/query-viewer"></compose></template>'})}(),System.register("common/i2b2.pub-sub.js",["aurelia-framework","aurelia-event-aggregator","./i2b2.service","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.inject},function(a){e=a.EventAggregator},function(a){f=a.I2B2Service},function(a){g=a.notifications,h=a.commands}],execute:function(){a("I2B2PubSub",(i=d(e,f,g,h),k=i(j=function b(a,d,e){c(this,b),this.listen=function(){d.onResize(function(a,b){return b.find(function(a){return"ADD"===a.action})?f():g()}),d.onHistory(function(){return i()}),d.onQuery(function(a,b){return j(b[0].name)}),d.onViewSelected(function(a){return k(a.data)}),a.subscribe(h.i2b2.refreshHistory,l),a.subscribe(h.i2b2.cloneQuery,m),a.subscribe(h.i2b2.showError,n)};var f=function(){return a.publish(e.i2b2.tabMax)},g=function(){return a.publish(e.i2b2.tabMin)},i=function(){return a.publish(e.i2b2.historyRefreshed)},j=function(b){return a.publish(e.i2b2.queryStarted,b)},k=function(b){return a.publish(e.i2b2.viewSelected,b)},l=function(){return d.loadHistory()},m=function(a){return d.loadQuery(a)},n=function(a){return d.errorDetail(a)}})||j)),a("I2B2PubSub",k)}}}),System.register("shell.js",["aurelia-framework","aurelia-event-aggregator","common/i2b2.pub-sub","common/queries.model","common/shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k;return{setters:[function(a){d=a.inject},function(a){e=a.EventAggregator},function(a){f=a.I2B2PubSub},function(a){g=a.QueriesModel},function(a){h=a.notifications}],execute:function(){a("Shell",(i=d(e,f,g,h),k=i(j=function b(a,d,e,f){c(this,b),d.listen(),e.load()})||j)),a("Shell",k)}}}),function(){var a=System.amdDefine;a("views/mailto/mailto.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><div class="mailto"><div class="content"><p>If you have questions about your query results or this SHRINE network, contact the Data Steward at your site.</p><div class="email js-email"><button class="button button--large js-button" click.delegate="openEmail()">Email Data Steward</button></div></div></div></template>'})}(),System.register("views/mailto/mailto.service.js",["aurelia-framework","repository/qep.repository"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a.inject},function(a){e=a.QEPRepository}],execute:function(){a("MailToService",(f=d(e),h=f(g=function(){function a(b){c(this,a),this.repository=b}return a.prototype.fetchStewardEmail=function(){return this.repository.fetchStewardEmail()},a}())||g)),a("MailToService",h)}}}),System.register("views/mailto/mailto.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("MailConfig",c={mailto:"mailto:",subject:encodeURIComponent("Question from a SHRINE User"),body:encodeURIComponent("Please enter the suggested information and your question. Your data steward will reply to this email.\n \n\n***Never send patient information, passwords, or other sensitive information by email****\n \nName:\n \nTitle:\n \nUser name (to log into SHRINE):\n \nTelephone Number (optional):\n \nPreferred email address (optional):\n \n\nQuestion or Comment:")}),a("MailConfig",c)}}}),System.register("views/mailto/mailto.js",["aurelia-framework","views/mailto/mailto.service","views/mailto/mailto.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.MailToService},function(a){f=a.MailConfig}],execute:function(){a("MailTo",(g=d(e,f),i=g(h=function(){function a(b,d){c(this,a),this.service=b,this.config=d}return a.prototype.openEmail=function(){var a=this;this.service.fetchStewardEmail().then(function(b){window.top.location="mailto:"+b+"?subject="+a.config.subject+"&body="+a.config.body})},a}())||h)),a("MailTo",i)}}}),System.register("views/query-viewer/box-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("BoxStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return"transform: translate("+String(-100*a)+"%);"},a}()),a("BoxStyleValueConverter",d)}}}),function(){var a=System.amdDefine;a("views/query-viewer/context-menu/context-menu.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><ul class="context-menu ${context.class || \'hide\'}" mouseleave.trigger="context.class=\'hide\'" css="top: ${context.y - 40}; left: ${context.x - 50};"><li click.delegate="cloneQuery(context.id)"><a href="#"><i class="fa fa-files-o"></i> Clone</a></li><li><a click.delegate="refreshHistory()" href="#"><i class="fa fa-history"></i> Refresh All</a></li></ul></template>'})}(),System.register("views/query-viewer/context-menu/context-menu.js",["aurelia-framework","aurelia-event-aggregator","common/shrine.messages"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i,j,k,l,m,n;return{setters:[function(a){f=a.inject,g=a.bindable},function(a){h=a.EventAggregator},function(a){i=a.commands}],execute:function(){a("ContextMenu",(j=f(h,i),n=j((l=function b(a,e){var f=this;d(this,b),c(this,"context",m,this),b.prototype.cloneQuery=function(b){a.publish(e.i2b2.cloneQuery,b),f.context["class"]="hide"},b.prototype.refreshHistory=function(){a.publish(e.i2b2.refreshHistory),f.context["class"]="hide"}},m=e(l.prototype,"context",[g],{enumerable:!0,initializer:null}),k=l))||k)),a("ContextMenu",n)}}}),function(){var a=System.amdDefine;a("views/query-viewer/loading-bar/loading-bar.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><div class="loader"><h1>${status}</h1><div class="slider"><div class="line"></div><div class="break dot1"></div><div class="break dot2"></div><div class="break dot3"></div></div></div></template>'})}(),System.register("views/query-viewer/loading-bar/loading-bar.js",["aurelia-framework"],function(a,b){"use strict";function c(a,b,c,d){c&&Object.defineProperty(a,b,{enumerable:c.enumerable,configurable:c.configurable,writable:c.writable,value:c.initializer?c.initializer.call(d):void 0})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var f,g,h,i;return{setters:[function(a){f=a.bindable}],execute:function(){a("LoadingBar",(g=function b(){d(this,b),c(this,"status",h,this)},h=e(g.prototype,"status",[f],{enumerable:!0,initializer:null}),i=g)),a("LoadingBar",i)}}}),function(){var a=System.amdDefine;a("views/query-viewer/loading-bar/row-loader.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return""})}(),function(){var a=System.amdDefine;a("views/query-viewer/query-viewer.html!github:systemjs/plugin-text@0.0.8.js",[],function(){return'<template><require from="views/query-viewer/result-style.converter"></require><require from="views/query-viewer/result-value.converter"></require><require from="views/query-viewer/box-style.converter"></require><require from="views/query-viewer/context-menu/context-menu"></require><require from="views/query-viewer/loading-bar/loading-bar"></require><loading-bar status.bind="\'Loading...\'" if.bind="showLoader"></loading-bar><div style="width: 100%; text-align: center"><ul class="circle-pagination" if.bind="showCircles"><li repeat.for="page of pages" class="${pageIndex === $index? \'active\' : \'\'}" click.delegate="setToPage($index)"><div>${$index + 1}</div></li></ul></div><div class="box-wrapper"><div class="box"><section><table cellpadding="0" cellspacing="0" border="0"><thead><tr><th class="tbl-header"></th><th repeat.for="node of page.nodes" class="tbl-header"><div class="hideextra">${node}</div></th></tr></thead></table><!-- context menu --><context-menu context.bind="context"></context-menu><!-- main table --><div class="tbl-content ${vertStyle}" scroll.trigger="onScroll($event)"><table cellpadding="0" cellspacing="0" border="0"><tbody><!-- @todo: create running query component --><tr if.bind="runningQueryName"><th><div class="hideextra">${runningQueryName}</div></th><td repeat.for="node of page.nodes" style="color: #00FF00">RUNNING</td></tr><tr repeat.for="result of page.results" contextmenu.trigger="context = getContext($event, result)"><th><div class="hideextra">${result.name}</div></th><td repeat.for="nodeResult of result.nodeResults" css="${nodeResult | resultStyle}"><a if.bind="nodeResult.status === \'ERROR\'" style="text-decoration: underline" click.delegate="publishError(nodeResult)">${nodeResult.status} </a>${nodeResult | result}</td></tr></tbody></table></div></section></div></div><!--\n <div class="box-wrapper">\n <div class="box" repeat.for="screen of screens" css.bind="screenIndex | boxStyle">\n <section>\n <div>\n <table cellpadding="0" cellspacing="0" border="0">\n <thead>\n <tr>\n <th class="tbl-header">\n </th>\n <th repeat.for="node of screen.nodes" class="tbl-header">\n <div class="hideextra">${node}</div>\n </th>\n </tr>\n </thead>\n </table>\n </div>\n <context-menu context.bind="context"></context-menu>\n <div class="tbl-content ${vertStyle}" scroll.trigger="onScroll($event)">\n <table cellpadding="0" cellspacing="0" border="0">\n <tbody>\n <tr if.bind="runningQuery">\n <th>\n <div class="hideextra">${runningQuery}</div>\n </th>\n <td repeat.for="node of screen.nodes" style="color: #00FF00">\n RUNNING\n </td>\n </tr>\n <tr repeat.for="result of screen.results" contextmenu.trigger="context = getContext($event, result)">\n <th>\n <div class="hideextra">${result.name}</div>\n </th>\n <td repeat.for="nodeResult of result.nodeResults" css="${nodeResult | resultStyle}">\n <a if.bind="nodeResult.status !== \'FINISHED\'" click.delegate="errorDetail(nodeResult)" style="text-decoration: underline">\n ${nodeResult.status}\n </a> ${nodeResult | result}\n </td>\n </tr>\n <tr if.bind="loadingInfiniteScroll">\n <td colspan="${screen.nodes.length + 1}" style="background:rgba(217, 236, 240, .05); text-align:center; color: rgba(0, 0, 0, .20);">\n <div style="font-size: 1.5rem">\n <i class="fa fa-spinner fa-spin" style="color: inherit;"></i>\n Loading... \n </div>\n </td>\n </tr>\n </tbody>\n </table>\n \n </div>\n </section>\n </div>\n </div--></template>'})}(),System.register("views/query-viewer/query-viewer.service.js",["aurelia-framework","repository/qep.repository","./query-viewer.config"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.QEPRepository},function(a){f=a.QueryViewerConfig}],execute:function(){a("QueryViewerService",(g=d(e,f),i=g(h=function(){function a(b,d,e){c(this,a),this.repository=b,this.config=d}return a.prototype.fetchPreviousQueries=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.maxQueriesPerScroll;return this.repository.fetchPreviousQueries(a)},a.prototype.getScreens=function(a,b){var c=this;return new Promise(function(d,e){for(var f=a.sort().length,g=[],h=0;h<f;h+=c.config.maxNodesPerScreen){var i=c.getNumberOfNodesOnScreen(a,h,c.config.maxNodesPerScreen),j=i-1,k=c.getScreenId(a,h,j),l=a.slice(h,i),m=c.mapQueriesToScreenNodes(l,b,c.findQueriesForNode);g.push({id:k,nodes:l,results:m})}d(g)})},a.prototype.mapQueriesToScreenNodes=function(a,b){var c=[];return b.forEach(function(b,d){var e={name:b.query.queryName,id:b.query.networkId,nodeResults:[]};a.forEach(function(a){e.nodeResults.push(b.adaptersToResults.find(function(b){return b.adapterNode===a}))}),c.push(e)}),c},a.prototype.getNumberOfNodesOnScreen=function(a,b){var c=b+this.config.maxNodesPerScreen;return c<a.length?c:a.length},a.prototype.getScreenId=function(a,b,c){var d=a[b],e=a[c];return String(d).substr(0,1)+"-"+String(e).substr(0,1)},a}())||h)),a("QueryViewerService",i)}}}),System.register("common/i2b2.service.js",["ramda","./container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("I2B2Service",f=function b(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;c(this,b);var f=a?e.of(a):e.of(null),g=d.curry(function(a,b){return b.value?e.of(d.prop(a,b.value)):e.of(null)}),h=d.compose(g("i2b2"),g("window"),g("parent")),i=d.compose(g("CRC"),h),j=d.compose(g("events"),h),k=d.compose(g("SHRINE"),h);b.prototype.onResize=function(a){return j(f).map(function(b){return b.changedZoomWindows.subscribe(a)})},b.prototype.onHistory=function(a){return i(f).map(function(b){return b.ctrlr.history.events.onDataUpdate.subscribe(a)})},b.prototype.onQuery=function(a){return j(f).map(function(b){return b.afterQueryInit.subscribe(a)})},b.prototype.onViewSelected=function(a){return g("addEventListener",f).value?e.of(f.value.addEventListener("message",a,!1)):e.of(null)},b.prototype.loadHistory=function(){return i(f).map(function(a){return a.view.history.doRefreshAll()})},b.prototype.loadQuery=function(a){return i(f).map(function(b){return b.ctrlr.QT.doQueryLoad(a)})},b.prototype.errorDetail=function(a){return k(f).map(function(b){return b.plugin.errorDetail(a)})}}),a("I2B2Service",f)}}}),System.register("views/query-viewer/query-viewer.model.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[],execute:function(){d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("QueryViewerModel",e=function(){function a(){c(this,a),this.processing=!1,this.loadedCount=0,this.totalQueries=0,this.screens=[]}return d(a,[{key:"moreToLoad",get:function(){return this.loadedCount<this.totalQueries}},{key:"hasData",get:function(){return this.screens.length>0}}]),a}()),a("QueryViewerModel",e)}}}),System.register("common/tabs.model.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e;return{setters:[],execute:function(){d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("TabsModel",e=function(){function a(){c(this,a);var b=a.min;a.prototype.setMax=function(){return b=a.full},a.prototype.setMin=function(){return b=a.min},a.prototype.mode=function(){return b}}return d(a,null,[{key:"full",get:function(){return"v-full"}},{key:"min",get:function(){return"v-min"}}]),a}()),a("TabsModel",e)}}}),System.register("repository/qep.repository.js",["aurelia-framework","aurelia-fetch-client","fetch"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i;return{setters:[function(a){d=a.inject},function(a){e=a.HttpClient},function(a){}],execute:function(){f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("QEPRepository",(g=d(e),i=g(h=function(){function a(b){var d=this;c(this,a),b.configure(function(a){a.useStandardConfiguration().withBaseUrl(d.url).withDefaults({headers:{Authorization:"Basic "+d.auth}})}),this.http=b}return a.prototype.fetchPreviousQueries=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.http.fetch("qep/queryResults?limit="+a+"&skip="+b).then(function(a){return a.json()})["catch"](function(a){return a})},a.prototype.fetchStewardEmail=function(){return this.http.fetch("data?key=stewardEmail").then(function(a){return a.json()}).then(function(a){return a.indexOf('"')>0?a.split('"')[1]:a})["catch"](function(){return""})},f(a,[{key:"url",get:function(){var a=document.URL,b=":6443/shrine-metadata/";return a.substring(0,a.lastIndexOf(":"))+b}},{key:"auth",get:function(){var a=sessionStorage.getItem("shrine.auth");return sessionStorage.removeItem("shrine.auth"),a}}]),a}())||h)),a("QEPRepository",i)}}}),System.register("common/queries.model.js",["aurelia-framework","aurelia-event-aggregator","repository/qep.repository","./shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j;return{setters:[function(a){d=a.inject},function(a){e=a.EventAggregator},function(a){f=a.QEPRepository},function(a){g=a.notifications}],execute:function(){a("QueriesModel",(h=d(e,f,g),j=h(i=function b(a,d,e){var f=this;c(this,b);var g=d,h=40,i=0,j=0,k=null;b.prototype.load=function(){return g.fetchPreviousQueries(f.maxQueriesPerFetch()+f.loadedCount()).then(function(a){return j=a.rowCount,i=a.queryResults.length,a})["catch"](function(a){return console.log(a)}).then(l).then(function(b){k=b,a.publish(e.shrine.queriesPollReceived,k)})},b.prototype.totalQueries=function(){return j},b.prototype.loadedCount=function(){return i},b.prototype.maxQueriesPerFetch=function(){return h},b.prototype.moreToLoad=function(){return i<j},b.prototype.hasData=function(){return null!==k&&void 0!==k};var l=function(a){arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new Promise(function(b,c){for(var d=[],e=6,f=a.adapters,g=f.length,h=a.queryResults,i=0;i<g;i+=e){var j=m(f,i,e),k=f.slice(i,j),l=n(k,h);d.push({nodes:k,results:l})}b(d)})},m=function(a,b,c){var d=b+c;return d<a.length?d:a.length},n=function(a,b){var c=[];return b.forEach(function(b,d){var e={name:b.query.queryName,id:b.query.networkId,nodeResults:[]};a.forEach(function(a){e.nodeResults.push(b.adaptersToResults.find(function(b){return b.adapterNode===a}))}),c.push(e)}),c}})||i)),a("QueriesModel",j)}}}),System.register("common/container.js",["ramda"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f;return{setters:[function(a){d=a}],execute:function(){e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),a("Container",f=function(){function a(b){c(this,a),this.__value=b}return a.of=function(b){return new a(function(){return b})},a.prototype.map=function(b){return this.hasNothing()?a.of(null):a.of(b(this.value))},a.prototype.join=function(){return this.hasNothing()?a.of(null):this.value},a.prototype.chain=function(a){return this.map(a).join()},a.prototype.hasNothing=function(){return null===this.value||void 0===this.value},a.prototype.ap=function(a){a.map(this.value)},e(a,[{key:"value",get:function(){return this.__value()}}]),a}()),a("Container",f)}}}),System.register("views/query-viewer/scroll.service.js",["ramda","common/container"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h;return{setters:[function(a){d=a},function(a){e=a.Container}],execute:function(){a("ScrollService",(g=f=function b(){c(this,b)},f.either=d.curry(function(a,b,c){return e.of(d.prop(a,c)||b)}),f.target=function(a,b){return h.either("target",b,b).chain(function(b){return h.either(a,0,b)})},f.clientHeight=function(a){return h.target("clientHeight",a)},f.scrollHeight=function(a){return h.target("scrollHeight",a)},f.scrollTop=function(a){return h.target("scrollTop",a)},f.userScroll=function(a){return h.clientHeight(a).map(function(b){return b+h.scrollTop(a).value})},f.scrollRatio=function(a){return h.userScroll(a).map(function(b){return b/h.scrollHeight(a).value})},h=g)),a("ScrollService",h)}}}),System.register("views/query-viewer/query-viewer.config.js",[],function(a,b){"use strict";var c;return{setters:[],execute:function(){a("QueryViewerConfig",c={maxNodesPerScreen:10,maxQueriesPerScroll:40}),a("QueryViewerConfig",c)}}}),System.register("common/shrine.messages.js",[],function(a,b){"use strict";var c,d;return{setters:[],execute:function(){a("notifications",c={i2b2:{tabMax:"notification.from.i2b2.tab.max",tabMin:"notification.from.i2b2.tab.min",viewSelected:"notification.from.i2b2.tab.selected",historyRefreshed:"notification.from.i2b2.history.refreshed",queryStarted:"notification.from.i2b2.query.started",messageReceived:"notification.from.i2b2.message.received"},shrine:{queriesPollReceived:"notification.from.shrine.history.received"}}),a("notifications",c),a("commands",d={i2b2:{refreshHistory:"command.to.i2b2.refresh.history",cloneQuery:"command.to.i2b2.clone.query",showError:"command.to.i2b2.show.error"}}),a("commands",d)}}}),System.register("views/query-viewer/query-viewer.js",["aurelia-framework","aurelia-event-aggregator","views/query-viewer/query-viewer.service","common/i2b2.service.js","./query-viewer.model","common/tabs.model","common/queries.model","./scroll.service","./query-viewer.config","common/shrine.messages"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d,e,f,g,h,i,j,k,l,m,n,o,p,q;return{setters:[function(a){d=a.inject},function(a){e=a.EventAggregator},function(a){f=a.QueryViewerService},function(a){g=a.I2B2Service},function(a){h=a.QueryViewerModel},function(a){i=a.TabsModel},function(a){j=a.QueriesModel},function(a){k=a.ScrollService},function(a){l=a.QueryViewerConfig},function(a){m=a.notifications,n=a.commands}],execute:function(){a("QueryViewer",(o=d(e,f,g,h,i,j,m,n),q=o(p=function(){function a(b,d,e,f,g,h,i,j){var l=this;c(this,a),this.pageIndex=0,this.showCircles=!0,this.showLoader=!0,this.vertStyle="v-min",this.runningQueryName=null,a.prototype.setToPage=function(a){l.pageIndex=a,l.page=l.pages[l.pageIndex]},a.prototype.publishError=function(a){return b.publish(j.i2b2.showError,a)};var m=function(a){return 1===k.scrollRatio(a).value&&h.moreToLoad()&&!l.loadingInfiniteScroll};a.prototype.onScroll=function(a){m&&(l.loadingInfiniteScroll=!0,h.load())},evt.subscribe(i.shrine.l),b.subscribe(i.i2b2.historyRefreshed,function(){return h.load()}),b.subscribe(i.i2b2.tabMax,function(){return l.vertStyle="v-full"}),b.subscribe(i.i2b2.tabMin,function(){return l.vertStyle="v-min"}),b.subscribe(i.i2b2.queryStarted,function(a){return l.runningQueryName=a}),b.subscribe(i.shrine.queriesPollReceived,function(a){l.pages=a,l.page=l.pages[0],l.runningQueryName=null,l.loadingInfiniteScroll=!1}),b.subscribe(i.i2b2.viewSelected,function(a){console.log(i.i2b2.viewSelected+" "+a)})}return a.prototype.attached=function(){this.showLoader=!1},a.prototype.detatched=function(){this.showLoader=!0},a.prototype.getContext=function(a,b){return{x:a.pageX,y:a.pageY,id:b.id,"class":"show"}},a}())||p)),a("QueryViewer",q)}}}),System.register("views/query-viewer/result-style.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultStyleValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){var b=this.isUnresolved(a)?"color:"+this.getColorValue(a):"";return b},a.prototype.isUnresolved=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FINISHED";return!a||a.status!==b},a.prototype.getColorValue=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ERROR",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FF0000",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#00FF00";return a&&a.status!==b?d:c},a}()),a("ResultStyleValueConverter",d)}}}),System.register("views/query-viewer/result-value.converter.js",[],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var d;return{setters:[],execute:function(){a("ResultValueConverter",d=function(){function a(){c(this,a)}return a.prototype.toView=function(a){return a?"FINISHED"!==a.status?"":a.count<0?"<=10":a.count:"not available"},a}()),a("ResultValueConverter",d)}}});