diff --git a/build.sbt b/build.sbt index f1be9773d718a849bf04bf5ff22a40149d2d2da4..95d9a3c98e0630374044b34d80166578d3900cbc 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ scalaVersion := "2.12.12" -val VIZIER_VERSION = "1.0.0" +val VIZIER_VERSION = "1.0.1" val MIMIR_VERSION = "1.0.0" val CAVEATS_VERSION = "0.3.1" diff --git a/scripts/build_ui.py b/scripts/build_ui.py old mode 100644 new mode 100755 index a1a314b2238ffb0d2a396cfa12530202ae766933..580380d049e041f5d11170221e5864299d096b88 --- a/scripts/build_ui.py +++ b/scripts/build_ui.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 from subprocess import Popen from os.path import exists as path_exists import re diff --git a/src/main/resources/ui/asset-manifest.json b/src/main/resources/ui/asset-manifest.json index c4c06a034de834594b2d40e7eae0d2c9b58615cf..cbb563395b9cd596780b8906f0a88657a298dd4b 100644 --- a/src/main/resources/ui/asset-manifest.json +++ b/src/main/resources/ui/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "/static/css/main.b41ff8bb.chunk.css", - "main.js": "/static/js/main.9d650f1f.chunk.js", - "main.js.map": "/static/js/main.9d650f1f.chunk.js.map", + "main.js": "/static/js/main.da194200.chunk.js", + "main.js.map": "/static/js/main.da194200.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.fa46e1cc.js", "runtime-main.js.map": "/static/js/runtime-main.fa46e1cc.js.map", "static/css/2.5fff324c.chunk.css": "/static/css/2.5fff324c.chunk.css", @@ -21,6 +21,6 @@ "static/css/2.5fff324c.chunk.css", "static/js/2.e34dcee7.chunk.js", "static/css/main.b41ff8bb.chunk.css", - "static/js/main.9d650f1f.chunk.js" + "static/js/main.da194200.chunk.js" ] } \ No newline at end of file diff --git a/src/main/resources/ui/index.html b/src/main/resources/ui/index.html index c44dc79c3c3d73249db162caf5f8bdb2e9105f79..b343dd40a372c27cdab3952b2018efedd7d6a595 100644 --- a/src/main/resources/ui/index.html +++ b/src/main/resources/ui/index.html @@ -1 +1 @@ -Vizier
\ No newline at end of file +Vizier
\ No newline at end of file diff --git a/src/main/resources/ui/static/js/main.9d650f1f.chunk.js b/src/main/resources/ui/static/js/main.9d650f1f.chunk.js deleted file mode 100644 index a8ed22621192c58f41339addb9eb3cc63f160fd1..0000000000000000000000000000000000000000 --- a/src/main/resources/ui/static/js/main.9d650f1f.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this.webpackJsonpplayground=this.webpackJsonpplayground||[]).push([[0],{126:function(e,t,n){},1275:function(e,t,n){},1361:function(e,t,n){},1363:function(e,t,n){},1367:function(e,t,n){"use strict";n.r(t),n.d(t,"history",(function(){return tl})),n.d(t,"store",(function(){return il}));var a=n(1),r=n(3),i=n.n(r),s=n(63),o=n.n(s),l=n(113),c=n(45),u=n(188),d=(n(598),n(518)),h=n(560),p=n.n(h),j=n(16),m=n(6),b=n(7),f={vizual:["deleteColumn","deleteRow","insertColumn","insertRow","moveColumn","moveRow","renameColumn","updateCell"]},v="ADD_FILTERED_COMMAND",O="COPY_CELL",g="HIDE_CELLS",x="NO_OP",C="REMOVE_FILTERED_COMMAND",w="REVERSE_ORDER",k="SET_FILTERED_MODULES",y=function(e){return{type:k,filter:e}},S=function(){return{type:g}},N=function(){return{type:w}},E={userSettings:new(function(){function e(t,n,a,r,i){Object(m.a)(this,e),this.filteredCommands=null!=t?t:f,this.cellDatasetRowLimit=null!=n?n:10,this.reversedOrder=null!=a&&a,this.hideCommands=null!=r&&r,this.clipboard=i}return Object(b.a)(e,[{key:"addCommandToHiddenList",value:function(t){var n={},a=this.filteredCommands[t.packageId];if(null!=a){for(var r=[],i=!1,s=0;s0&&(n[a]=i)}else n[a]=this.filteredCommands[a];return new e(n,this.cellRowLimitValue,this.reversedOrder,this.hideCommands)}},{key:"setFilter",value:function(t){return new e(null!=t?t:{},this.cellRowLimitValue,this.reversedOrder,this.hideCommands)}},{key:"showNotebookReversed",value:function(){return this.reversedOrder}},{key:"toggleHideCells",value:function(){return new e(this.filteredCommands,this.cellRowLimitValue,this.reversedOrder,!this.hideCommands)}}]),e}())},A=n(190),I=n.n(A),D="REQUEST_SERVICE",P="RECEIVE_SERVICE",R="SERVICE_ERROR",T="REQUEST_AUTH",_="RECEIVE_AUTH",L="AUTH",M=function(e){return{type:R,error:e}},F=function(){return{type:T}},U=function(e){var t=JSON.parse(localStorage.getItem("user"));return t?t&&t.authdata?{Authorization:"Basic "+t.authdata}:(localStorage.removeItem("user"),null):(e(F()),null)},V=function(e,t){return function(n){if(window.env.API_BASIC_AUTH){var a=U(n);if(a){var r=t;return t&&t.headers?Object.assign(r.headers,a):t?r.headers=a:r={method:"GET",headers:a},fetch(e,r)}return new Promise((function(e,t){t({message:"No saved credentials. Please enter credentials."})}))}return fetch(e,t)}},B=function(e,t){return null==t||t?e.text().then((function(e){try{var t=JSON.parse(e);return Promise.resolve(t)}catch(r){if(!(e&&e.startsWith("")&&e.includes("SAMLRequest")))return Promise.resolve(JSON.parse("{}"));if(!0!==window.confirm("Your session has timed out. Do you want to renew your session?"))return Promise.resolve(JSON.parse("{}"));var n=JSON.parse(localStorage.getItem("profile")),a="default";n&&n.client&&(a=n.client),window.open("/reauth?client="+a)}})):Promise.resolve(e.data)},H=function(){return function(e,t){var n=t().serviceApi.serviceUrl;return e({type:D}),V(n)(e).then((function(t){t.status>=200&&t.status<400?B(t).then((function(t){return e(function(e){return e.defaults&&e.defaults.profile&&localStorage.setItem("profile",JSON.stringify(e.defaults.profile)),{type:P,name:e.name,properties:e.defaults,environment:e.environment,links:e.links}}(t))})):401===t.status?e(F()):B(t).then((function(t){return e(M(t.message))}))})).catch((function(t){return e(M(t.message))}))}},z={homePageContent:null,projects:[]},q=function(e,t,n,a,r){return function(i){i(W(e,t,n,a,r))}},J=function(e,t,n,a){return function(r){return a&&r(a()),V(e,{method:"DELETE"})(r).then((function(e){204===e.status?r(t()):401===e.status?r(F()):404===e.status?r(n("Resource not found")):B(e).then((function(e){return r(n(e.message))}))})).catch((function(e){return r(n(e.message))}))}},K=function(e,t,n,a){return function(r){return a&&r(a()),V(e)(r).then((function(e){e.status>=200&&e.status<400?B(e).then((function(e){return r(t(e))})):401===e.status?r(F()):B(e).then((function(e){return r(n(e.message))}))})).catch((function(e){return r(n(e.message))}))}},G=function(e,t,n){var a=e.properties.find((function(e){return e.key===t}));return a?a.value:n},W=function(e,t,n,a,r){return function(i){return r&&i(r()),V(e,{method:"POST",body:JSON.stringify(t),headers:{Accept:"application/json","Content-Type":"application/json"}})(i).then((function(e){e.status>=200&&e.status<400?B(e).then((function(e){return i(n(e))})):401===e.status?i(F()):B(e).then((function(e){return i(a(e.message))}))})).catch((function(e){return i(a(e.message))}))}},Y=function(e,t,n,a,r,i){return function(s){var o={key:t};return null!==n&&(o.value=n),function(e,t,n,a,r,i){return i&&e(i()),V(t,{method:"PUT",body:JSON.stringify(n),headers:{Accept:"application/json","Content-Type":"application/json"}})(e).then((function(t){t.status>=200&&t.status<400?B(t).then((function(t){return e(a(t))})):401===t.status?e(F()):B(t).then((function(t){return e(r(t.message))}))})).catch((function(t){return e(r(t.message))}))}(s,e,{properties:[o]},a,r,i)}},Q="self",Z="branch.head",X="dataset.download",$="project.create",ee="project.import",te="project.list",ne="file.upload",ae="workflow.append",re="module.freeze",ie="module.thaw",se=function(){function e(t){var n=this;Object(m.a)(this,e),this.getSelf=function(){return n.get(Q)},this.links=t}return Object(b.a)(e,[{key:"get",value:function(e){var t=this.links.find((function(t){return t.rel===e}));return null!=t?t.href:(console.log("NOT FOUND IN"),console.log(this.links),null)}},{key:"getAnnotations",value:function(e,t){var n=this.get("annotations.get");return n+="?column="+e+"&row="+t}},{key:"getDatasetUrl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.get(Q);return a+="?offset="+e+"&limit="+t,n&&(a+="&profile="+n),a}},{key:"getNotebookUrl",value:function(e,t,n){var a=this.get(te);return null!=a?(a+="/"+e+"/branches/"+t,a+=null!=n?"/workflows/"+n:"/head"):null}},{key:"getProjectUrl",value:function(e){var t=this.get(te);return null!=t?t+"/"+e:null}},{key:"has",value:function(e){return null!=this.links.find((function(t){return t.rel===e}))}}]),e}(),oe=function(){function e(t,n,a,r){Object(m.a)(this,e),this.id=t,this.name=n,this.isDefault=a,this.links=r}return Object(b.a)(e,[{key:"fromJson",value:function(e){return this.id=e.id,this.name=G(e,"name","undefined"),this.isDefault=e.isDefault,this.links=new se(e.links),this}},{key:"updateName",value:function(t){return new e(this.id,t,this.isDefault,this.links)}}]),e}(),le=function(e){return e.sort((function(e,t){return e.name.localeCompare(t.name)}))},ce=n(615),ue=function(e){return ce.tz(e,"UTC").tz(ce.tz.guess()).format("DD-MMM-YYYY HH:mm:ss")},de="deleteColumn",he="deleteRow",pe="dropDataset",je="insertColumn",me="insertRow",be="load",fe="moveColumn",ve="moveRow",Oe="renameColumn",ge="renameDataset",xe="sortDataset",Ce="updateCell",we="vizual",ke="asc",ye="desc",Se=function(e,t,n){return{packageId:we,commandId:fe,arguments:[{id:"dataset",value:e},{id:"column",value:t},{id:"position",value:n}]}},Ne=function(e,t,n){return{packageId:we,commandId:ve,arguments:[{id:"dataset",value:e},{id:"row",value:t},{id:"position",value:n}]}},Ee=function(){function e(){Object(m.a)(this,e)}return Object(b.a)(e,[{key:"fromJson",value:function(e){return this.id=e.id,this.name=G(e,"name","undefined"),this.createdAt=ue(e.createdAt),this.lastModifiedAt=ue(e.lastModifiedAt),this.defaultBranch=e.defaultBranch,this.links=new se(e.links),this}}]),e}(),Ae=function(){function e(t,n,a,r){Object(m.a)(this,e),this.id=t,this.name=n,this.links=a,this.branches=r}return Object(b.a)(e,[{key:"addBranch",value:function(t){for(var n=[t],a=0;a=200&&e.status<400?B(e).then((function(e){var r=(new Ae).fromJson(e),i=null;null!=(i=null!=t?r.branches.find((function(e){return e.id===t})):r.branches.find((function(e){return e.isDefault})))?(a({type:Pe,project:r,branch:i}),a(n(r,i))):a(Ge("Unknown branch "+t,404))})):401===e.status?a(F()):404===e.status?B(e).then((function(e){return a(Ge(e.message,404))})):B(e).then((function(t){return a(Ge(t.message,e.status))}))})).catch((function(e){return a(Ge(e.message))}))}}},Be=function(e){return{type:_e,resource:e}},He=function(e){return{type:Me,project:e}},ze=function(e,t,n){return function(a){var r=e.findBranch(t);null!=r?(a({type:Pe,project:e,branch:r}),n&&a(n(e,r))):a(Ge("Unknown branch "+t,404))}},qe=function(e,t){return function(n){n(Y(e.links.get("project.update"),"name",t,(function(t){return function(n){return n({type:Me,project:e.updateName(G(t,"name"))})}}),(function(e){return Ke("Error updating project",e)}),Ye))}},Je=function(e,t){return{type:Te,error:null}},Ke=function(e,t){return{type:Te,error:new Ie(e,t)}},Ge=function(e,t,n){return null==n&&(n="Error fetching project"),{type:De,error:new Ie(n,e,t)}},We=function(){return{type:Re}},Ye=function(){return{type:Le}},Qe=function(){function e(t,n,a,r){Object(m.a)(this,e),this.id=t,this.name=n,this.columns=a,this.links=r}return Object(b.a)(e,[{key:"fromJson",value:function(e){return this.id=e.id,this.name=e.name,this.columns=e.columns,this.rowCount=e.rowCount,this.links=new se(e.links),this}}]),e}(),Ze=function(){function e(t,n,a,r,i,s,o){var l=this,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;Object(m.a)(this,e),this.isProfiled=function(){return null!=l.properties&&Object.keys(l.properties).length>0&&null!=l.properties.is_profiled},this.id=t,this.name=n,this.columns=a,this.rows=r,this.rowCount=i,this.offset=s,this.links=o,this.moduleId=c,this.properties=u}return Object(b.a)(e,[{key:"fromJson",value:function(e){return this.id=e.id,this.name=e.name,this.columns=e.columns,this.rows=e.rows,this.rowCount=e.rowCount,this.offset=e.offset,this.links=new se(e.links),this.moduleId=e.moduleId,this.properties=e.properties,this}},{key:"hasAnnotations",value:function(e,t){var n=this.rows.find((function(e){return e.id===t}));return n&&n.rowAnnotationFlags&&!1===n.rowAnnotationFlags[e]}},{key:"rowAtIndex",value:function(e){return this.rows[e]}},{key:"updateAnnotations",value:function(t,n,a){var r=this.hasAnnotations(t,n),i=null;if(a&&r)return this;if(!a&&!r)return this;if(a&&!r)(i=this.annotatedCells.slice()).push({column:t,row:n});else if(!a&&r){i=[];for(var s=0;s0?this.cells[this.cells.length-1]:null}},{key:"replaceOutput",value:function(t,n){for(var a=[],r=0;r2&&void 0!==arguments[2]&&arguments[2],r=[],i=Math.min(this.cells.length,t.modules.length),s=0;s1?new xt(n):new gt([]);return t},yn="RECEIVE_WORKFLOW",Sn="REQUEST_WORKFLOW",Nn="SET_ACTIVE_NOTEBOOK_CELL",En="UPDATE_NOTEBOOK",An=function(e,t,n){return function(a,r){var i=r().serviceApi;if(i.links){var s=r().serviceApi.links.getNotebookUrl(e.id,t.id,n);return a({type:Sn}),V(s)(a).then((function(e){e.status>=200&&e.status<400?B(e).then((function(e){return a({type:yn,workflow:new $e(i.engine).fromJson(e)})})):401===e.status?a(F()):404===e.status?B(e).then((function(e){return a(In(e.message,404))})):B(e).then((function(t){return a(In(t.message,e.status))}))})).catch((function(e){return a(In(e.message))}))}}},In=function(e,t){return Ge(e,t,"Error fetching notebook")},Dn=function(e,t){return e.status===t?B(e):B(e).then((function(e){throw e}))},Pn=function(e,t){return function(n){return V(t.module.links.getSelf())(n).then((function(e){return Dn(e,200)}),(function(e){return n(M(e.message))})).then((function(a){if(a.state!==t.module.state)return V(e.workflow.links.get(Z))(n).then((function(e){return Dn(e,200)}),(function(e){return n(M(e.message))})).then((function(a){return n(zn(e,a,t.id))}),(function(e){return n(In(e.message))}))}),(function(a){return n(Tn(e,t.module,"module status",a.message))}))}},Rn=function(){return new URLSearchParams(window.location.search).get("cell-output")},Tn=function(e,t,n,a){return function(r){var i=new Ie("Error loading "+n,a),s=e.replaceOutput(t.id,new bt(i));return r(zn(s))}},_n=function(e,t,n){return function(a){var r=!1;if(1===t.outputs.stdout.length&&"chart/view"===t.outputs.stdout[0].type&&(r=t.outputs.stdout[0].value.data.name===n),r){var i=t.outputs.stdout[0].value,s=new jt(i.data.name,i.result);a(zn(e.replaceOutput(t.id,s)))}else{for(var o=null,l=0;l1&&(n=new xt(t));return null===n&&(n=new gt([])),n}(t);n(zn(e.replaceOutput(t.id,a)))}},Fn=function(e,t,n,a){return function(r){return r(Bn(e,t,"POST",n,a))}},Un=function(e,t,n,a){return function(r){return r(Bn(e,t,"PUT",n,a))}},Vn=function(e,t,n){return function(a){a(Bn(e,t,"POST",{},n))}},Bn=function(e,t,n,a,r){return function(i){return i(Ye()),V(t,{method:n,body:JSON.stringify(a),headers:{Accept:"application/json","Content-Type":"application/json"}})(i).then((function(t){200===t.status?B(t).then((function(t){return i(zn(e,t,r))})):401===t.status?i(F()):B(t).then((function(e){return i(Ke("Error updating notebook",e.message))}))})).catch((function(e){return i(Ke("Error updating notebook",e.message))}))}},Hn=function(e,t,n,a,r,i,s,o){return function(l){var c=s.value.file,u=new FormData;return u.append("file",c),function(e,t,n){return function(a){if(window.env.API_BASIC_AUTH){var r=U(a);if(r){var i=t;t&&t.headers?Object.assign(i.headers,r):t?i.headers=r:i={method:"GET",headers:r},n=Object(j.a)(Object(j.a)({},n),{},{headers:i.headers});var s=i.body?i.body:null;return"POST"===i.method?I.a.post(e,s,n):I.a.get(e,n)}return new Promise((function(e,t){t({message:"No saved credentials. Please enter credentials."})}))}return("POST"===t.method?I.a.post(e,t.body,n):I.a.get(e,n)).then((function(e){return e}))}}(i,{method:"POST",body:u},{onUploadProgress:function(e){o&&o(Math.round(100*e.loaded/e.total))}})(l).then((function(i){i.status>=200&&i.status<400?B(i,!1).then((function(i){return console.log("FILE RESPONSE"),console.log(i),s.value.fileid=i.id,console.log("REQ"),console.log(n),l(a(e,t,n,r))})):401===i.status?l(F()):B(i,!1).then((function(e){return l(Ke("Error updating workflow",e.message))}))})).catch((function(e){var t=e.message;"NetworkError when attempting to fetch resource."===t&&(t="Connection closed by server. The file size may exceed the server's upload limit."),l(Ke("Error updating workflow",t))}))}},zn=function(e,t,n){if(null!=t){var a=new $e(e.workflow.engine).fromJson(t);e=e.updateWorkflow(a,n)}return{type:En,notebook:e}},qn={activeCell:null,fetchError:null,isFetching:!1,notebook:null,reversed:!1},Jn=function(){function e(t,n,a){Object(m.a)(this,e),this.column=t,this.row=n,this.content=a}return Object(b.a)(e,[{key:"isActive",value:function(e,t){return this.column===e&&this.row===t}}]),e}(),Kn=function(){function e(t,n,a){Object(m.a)(this,e),this.column=-1,this.row=-1}return Object(b.a)(e,[{key:"isActive",value:function(e,t){return!1}}]),e}(),Gn=function(){function e(){Object(m.a)(this,e)}return Object(b.a)(e,[{key:"isFetching",value:function(){return!0}},{key:"isError",value:function(){return!1}}]),e}(),Wn=function(){function e(t,n){Object(m.a)(this,e),this.title=t,this.message=n}return Object(b.a)(e,[{key:"isFetching",value:function(){return!1}},{key:"isError",value:function(){return!0}}]),e}(),Yn=function(){function e(t){Object(m.a)(this,e),this.items=t}return Object(b.a)(e,[{key:"isFetching",value:function(){return!1}},{key:"isError",value:function(){return!1}}]),e}(),Qn="SUBMIT_UPDATE_REQUEST",Zn="REQUEST_CAVEATS",Xn="SET_ANNOTATIONS",$n="UPDATE_DATASET_ANNOTATIONS",ea=function(e,t){return function(n){var a=e.id,r=e.name,i=e.offset,s=null,o=0;i&&(o=i),s=t||e.links.getDatasetUrl(o,25),n(K(s,(function(e){return function(t){return t(Be(new on(new Ze(a,r).fromJson(e))))}}),(function(e){return Ke("Error loading spreadsheet",e)}),Ye))}},ta=function(e,t){return function(n){var a=null;a=t||e.links.self+"/annotations",n(ia()),n(K(a,(function(t){return function(n){return n(Be(new sn(new Ze(e.id,e.name),new Yn(t))))}}),(function(e){return Ke("Error loading dataset errors",e)}),Ye))}},na=function(e,t,n,a,r){return function(i){return W(i,t,{reason:n,repair:a,acknowledge:r},(function(t){return function(n){return n(Be(new sn(new Ze(e.id,e.name),new Yn(t.annotations))))}}),(function(e){var t=new Wn("Error loading annotations",e),n=new Jn(-1,"-1",t);return ca(n)}),Ye)}},aa=function(e,t,n,a){return function(r){var i=n;r(ra());var s={method:"POST",body:JSON.stringify(Object(j.a)({},n)),headers:{Accept:"application/json","Content-Type":"application/json"}},o=null;if(a){var l=e.workflow.modules[a].links[0].href;o=V(l,s)}else o=V(e.workflow.links.get(ae),s);return o(r).then((function(n){n.status>=200&&n.status<400?B(n).then((function(n){var s=t,o="__0__";if(a){var l=a,c=n.modules[l].id;o=n.modules[a-1].id,s.moduleId=c,s.moduleIndex=l}if(i.packageId===we&&i.commandId===Ce&&(s.rows.find((function(e){return e.id===i.arguments[2].value})).values[i.arguments[1].value]=i.arguments[3].value),i.packageId===we&&i.commandId===Oe)s.columns.find((function(e){return e.id===i.arguments[1].value})).name=i.arguments[2].value;else if("mimir"===i.packageId&&"comment"===i.commandId){var u=i.arguments[1].value[0][0].value,d=s.columns.findIndex((function(e){return e.name===u}));s.rows.find((function(e){return e.id===i.arguments[1].value[0][2].value})).rowAnnotationFlags[d]=!1}r(zn(e,n,o)),r(Be(new on(s)))})):401===n.status?r(F()):B(n).then((function(e){return r(Ke("Error updating spreadsheet",e.message))}))})).catch((function(e){return r(Ke("Error updating spreadsheet",e.message))}))}},ra=function(){return{type:Qn}},ia=function(){return{type:Zn}},sa=function(){return ca(new Kn)},oa=function(e,t,n){return function(a){var r="?column="+t+"&row="+n,i="";return i=e.links.annotations?e.links.annotations+r:e.links.links[3].href+r,a(t<0?sa():K(i,(function(e){var a=new Yn(e),r=new Jn(t,n,a);return ca(r)}),(function(e){var a=new Wn("Error loading annotations",e),r=new Jn(t,n,a);return ca(r)}),(function(){return ca(new Jn(t,n,new Gn))})))}},la=function(e,t,n,a,r,i){return e(W(t,n,(function(t){var n=new Yn(t.annotations),s=new Jn(r,i,n),o=t.annotations.length>0;return e({type:$n,dataset:a.updateAnnotations(r,i,o)}),ca(s)}),(function(e){var t=new Wn("Error loading annotations",e),n=new Jn(r,i,t);return ca(n)}),(function(){return ca(new Jn(r,i,new Gn))})))},ca=function(e){return{type:Xn,annotations:e}},ua={fetchError:null,isFetching:!1,workflows:null},da={activeCell:null,fetchError:null,isFetching:!1,notebook:null,reversed:!1},ha="CLEAR_PROJECT_ACTION_ERROR",pa="REQUEST_PROJECTS",ja="RECEIVE_PROJECTS",ma="SET_PROJECT_CREATE_ERROR",ba="SET_PROJECT_DELETE_ERROR",fa="SET_PROJECTS_FETCH_ERROR",va=function(e,t,n){return function(a){var r=t.trim();""===r&&(r="New Project"),a(Sa("Create Project ..."));var i={properties:[]};""!==t.trim()&&i.properties.push({key:"name",value:r}),a(q(e,i,(function(e){return a(ga()),n.push(Wt(e.id,e.defaultBranch)),{type:x}}),Ca))}},Oa=function(e){return function(t){t(J(e.links.get("project.delete"),ga,wa,(function(){return Sa("Delete Project ...")})))}},ga=function(){return function(e,t){if(t().serviceApi.links){var n=t().serviceApi.links.get(te);return e(Sa()),V(n)(e).then((function(t){t.status>=200&&t.status<400?B(t).then((function(t){return e(Na(t))})):401===t.status?e(F()):B(t).then((function(t){return e(ya(t.message))}))})).catch((function(t){return e(ya(t.message))}))}}},xa=function(e,t,n){return function(a){var r=t,i=new FormData;return i.append("file",r),V(e,{method:"POST",body:i})(a).then((function(e){e.status>=200&&e.status<400?B(e).then((function(e){console.log("FILE RESPONSE"),console.log(e);var t=e.defaultBranch;return t||(t=e.branches[0].id),n.push(Wt(e.id,t)),{type:x}})):401===e.status?a(F()):B(e).then((function(e){return a(ka("Error updating workflow",e.message))}))})).catch((function(e){var t=e.message;"NetworkError when attempting to fetch resource."===t&&(t="Connection closed by server. The file size may exceed the server's upload limit."),a(ka("Error updating workflow",t))}))}},Ca=function(e){return{type:ma,error:e}},wa=function(e){return{type:ba,error:e}},ka=function(e){return{type:"SET_PROJECTS_UPLOAD_ERROR",error:e}},ya=function(e){return{type:fa,error:e}},Sa=function(e){return{type:pa,message:e}},Na=function(e){for(var t=[],n=0;n0){for(var c=[],u=0;u0?n[0].name:"":s.datatype===La&&(l={fileid:null,filename:null,url:null});r[s.id]=l},s=0;sa.maxFileSize&&n.push("Filesize exceeds maximum limit: "+qt(a.maxFileSize,2)):null!=s&&null!=o||null!=l||n.push("No file selected for "+r)}else if(null!=e)if(""===e&&t.required)n.push("Missing value for "+r);else{var c=t.datatype;c===Ma||c===Va?isNaN(e)&&n.push("Expected integer value for "+r):c===_a&&isNaN(e)&&n.push("Expected decimal value for "+r)}},Qa={error:null,engine:null,isFetchig:!0,links:null,name:null,properties:null,refetch:!1},Za={annotations:new Kn,dataset:null,isUpdating:!1},Xa=Object(l.c)({app:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v:return Object(j.a)(Object(j.a)({},e),{},{userSettings:e.userSettings.addCommandToHiddenList(t.command)});case O:return Object(j.a)(Object(j.a)({},e),{},{userSettings:e.userSettings.copyCell(t.cell)});case g:return Object(j.a)(Object(j.a)({},e),{},{userSettings:e.userSettings.toggleHideCells()});case C:return Object(j.a)(Object(j.a)({},e),{},{userSettings:e.userSettings.removeCommandFromHiddenList(t.command)});case w:return Object(j.a)(Object(j.a)({},e),{},{userSettings:e.userSettings.reverseOrder()});case k:return Object(j.a)(Object(j.a)({},e),{},{userSettings:e.userSettings.setFilter(t.filter)});default:return e}},branchPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case De:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,fetchError:t.error});case cn:return Object(j.a)(Object(j.a)({},e),{},{workflows:t.workflows,isFetching:!1,fetchError:null});case Pe:return Object(j.a)(Object(j.a)({},e),{},{workflows:null});case Re:case un:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!0});default:return e}},mainPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case P:return Object(j.a)(Object(j.a)({},e),{},{homePageContent:t.welcome});default:return e}},notebookPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:da,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case De:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,fetchError:t.error});case yn:return Object(j.a)(Object(j.a)({},e),{},{activeCell:null,isFetching:!1,fetchError:null,notebook:new xn(t.workflow).fromWorkflow(t.workflow)});case Pe:return Object(j.a)(Object(j.a)({},e),{},{activeCell:null,notebook:null});case Re:case Sn:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!0});case Nn:return Object(j.a)(Object(j.a)({},e),{},{activeCell:t.cellId});case En:return Object(j.a)(Object(j.a)({},e),{},{notebook:t.notebook});default:return e}},spreadsheetPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case De:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,fetchError:t.error});case yn:return Object(j.a)(Object(j.a)({},e),{},{activeCell:null,isFetching:!1,fetchError:null,notebook:new xn(t.workflow).fromWorkflow(t.workflow)});case Pe:return Object(j.a)(Object(j.a)({},e),{},{activeCell:null,notebook:null});case Re:case Sn:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!0});case Nn:return Object(j.a)(Object(j.a)({},e),{},{activeCell:t.cellId});case En:return Object(j.a)(Object(j.a)({},e),{},{notebook:t.notebook});default:return e}},datasetErrorsPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ua,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case De:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,fetchError:t.error});case Pe:return Object(j.a)(Object(j.a)({},e),{},{workflows:null});case Re:case Zn:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!0});case _e:switch(t.resource.type){case tn:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,resource:t.resource});case it:return Object(j.a)(Object(j.a)({},e),{},{dataset:t.resource});default:return e}default:return e}},projectListing:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Aa,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ha:return Object(j.a)(Object(j.a)({},e),{},{actionError:null});case pa:var n=Ea;return null!=t.message&&(n=t.message),Object(j.a)(Object(j.a)({},e),{},{isFetching:!0,fetchMessage:n});case ja:return Object(j.a)(Object(j.a)({},e),{},{fetchError:null,isFetching:!1,projects:t.projects,links:t.links});case ma:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,actionError:new Ie("Error creating project",t.error)});case ba:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,actionError:new Ie("Error deleting project",t.error)});case fa:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,fetchError:t.error,projects:[]});default:return e}},projectPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ia,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Re:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!0});case Le:return Object(j.a)(Object(j.a)({},e),{},{isActive:!0});case De:return Object(j.a)(Object(j.a)({},e),{},{branch:null,fetchError:t.error,isFetching:!1,project:null});case Te:return Object(j.a)(Object(j.a)({},e),{},{isActive:!1,isFetching:!1,actionError:t.error});case Pe:return Object(j.a)(Object(j.a)({},e),{},{actionError:null,branch:t.branch,fetchError:null,isActive:!1,isFetching:!1,project:t.project,resource:null,workflow:t.workflow});case _e:return Object(j.a)(Object(j.a)({},e),{},{actionError:null,isActive:!1,resource:t.resource});case ln:return Object(j.a)(Object(j.a)({},e),{},{branch:t.branch,isActive:!1,project:t.project});case En:return Object(j.a)(Object(j.a)({},e),{},{actionError:null,isActive:!1});case Me:return Object(j.a)(Object(j.a)({},e),{},{actionError:null,isActive:!1,project:t.project});case Fe:return Object(j.a)(Object(j.a)({},e),{},{actionError:null,isActive:!1,resource:t.resource});case Ue:return Object(j.a)(Object(j.a)({},e),{},{actionError:null,isActive:!1,resource:t.resource,workflow:t.workflow});default:return e}},serviceApi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qa,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case D:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!0});case P:return Object(j.a)(Object(j.a)({},e),{},{engine:{backend:t.environment.backend,name:t.environment.name,packages:(new qa).fromJson(t.environment.packages),serviceProperties:t.properties},error:null,isFetching:!1,links:new se(t.links),name:t.name,properties:t.properties,refetch:!1});case R:return Object(j.a)(Object(j.a)({},e),{},{isFetching:!1,error:t.error});case T:return Object(j.a)(Object(j.a)({},e),{},{showModal:L});case _:return Object(j.a)(Object(j.a)({},e),{},{showModal:null,isFetching:!1,error:null,refetch:!0});default:return e}},spreadsheet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Za,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _e:case Ue:var n=t.resource;return null!=n&&n.isDataset()?Object(j.a)(Object(j.a)({},e),{},{dataset:n.content,annotations:new Kn,isUpdating:!1}):e;case Te:return Object(j.a)(Object(j.a)({},e),{},{isUpdating:!1});case Xn:return Object(j.a)(Object(j.a)({},e),{},{annotations:t.annotations});case Qn:return Object(j.a)(Object(j.a)({},e),{},{isUpdating:!0});case $n:return Object(j.a)(Object(j.a)({},e),{},{dataset:t.dataset});default:return e}},router:u.c}),$a=n(1406),er=n(1409),tr=n(1395),nr=n(1393),ar=n(519),rr=n.n(ar),ir=n(1368),sr=n(1388),or=(n(35),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.size,n=e.text,r="spinner-padding-ms",i="massive";return"medium"===t?(r="spinner-padding-lg",i="medium"):"small"===t&&(r="spinner-padding-md",i="small"),Object(a.jsx)("div",{className:r,children:Object(a.jsx)(sr.a,{inline:!0,active:!0,size:i,children:n})})}}]),n}(i.a.Component)),lr=(n(420),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.interval,n=e.onFetch,a=e.resource;this.timer=setInterval((function(){return n(a)}),t)}},{key:"componentWillUnmount",value:function(){clearInterval(this.timer),this.timer=null}},{key:"render",value:function(){var e=this.props,t=e.onCancel,n=e.text;return Object(a.jsxs)("div",{children:[Object(a.jsx)(or,{text:n,size:"small"}),Object(a.jsx)("div",{className:"centered",children:Object(a.jsx)(ir.a,{content:"Cancel",negative:!0,title:"Cancel active task",onClick:t})})]})}}]),n}(i.a.Component)),cr=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.links,r=n.getSelf();return Object(a.jsx)("div",{className:"connection-info",children:Object(a.jsxs)("pre",{className:"connection-info",children:["Connected to ",t," @ ",Object(a.jsx)("a",{className:"connection-link",target:"_blank",href:r,children:r}),Object(a.jsx)("span",{className:"docu-icon",children:Object(a.jsx)("a",{href:n.get("api.doc"),className:"docu-icon",target:"_blank",children:Object(a.jsx)("i",{className:"fa fa-book"})})})]})})}}]),n}(i.a.Component),ur=n(1404),dr=function(e){var t=e.title,n=e.message,r=e.onDismiss;return Object(a.jsx)(ur.a,{negative:!0,icon:"warning sign",header:t,onDismiss:r,content:n.charAt(0).toUpperCase()+n.slice(1)})},hr=function(e){var t=e.title,n=e.errors,r=e.onDismiss;return Object(a.jsx)(ur.a,{negative:!0,icon:"warning sign",header:t,list:n,onDismiss:r})},pr=function(e){var t=e.error;return t.is404()?Object(a.jsx)("div",{className:"not-found",children:Object(a.jsx)(jr,{message:t.message})}):Object(a.jsx)(dr,{title:t.title,message:t.message})},jr=function(e){var t=e.message;return Object(a.jsx)(ur.a,{floating:!0,icon:"frown",header:"Ooops ... 404",size:"massive",content:null!=t?t.charAt(0).toUpperCase()+t.slice(1):"Unknown Error"})},mr=n(98),br=n(1398),fr=n(1389),vr=(n(126),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.onKeyDown,r=e.onChange;return Object(a.jsx)(fr.a,{autoFocus:!0,className:"resource-name-input",value:t,onChange:r,onKeyDown:n})}}]),n}(i.a.Component)),Or=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var a;Object(m.a)(this,n),(a=t.call(this,e)).handleCancel=function(){var e=a.props.onCancel;a.setState({value:""}),e()},a.handleChange=function(e){var t=e.target.value;a.setState({value:t})},a.handleKeyDown=function(e){var t=a.props.onCancel;13===e.keyCode?a.handleSubmit():27===e.keyCode&&t()},a.handleSubmit=function(e){var t=a.props,n=t.isValid,r=t.onSubmit,i=a.state.value;!i&&a.props.value&&(i=a.props.value),(null==n||n(i))&&r(i)};var r=e.value;return null==r&&(r=""),a.state={value:r},a}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.isValid,n=e.prompt,r=e.open,i=e.title,s=e.inputComponent,o=this.state.value,l=null;!o&&this.props.value&&(o=this.props.value),null!=n&&(l=Object(a.jsx)("p",{children:n}));var c=!0;null!=t&&(c=t(o));var u="TextInput",d={};if(s)u=s.type,d=Object.assign(d,s.props),delete this.props.inputComponent;else{var h=Object(a.jsx)(vr,{id:"EditResourceNameModal",value:o,onChange:this.handleChange,onKeyDown:this.handleKeyDown});u=h.type,d=Object.assign(d,h.props)}return Object(a.jsxs)(br.a,{open:r,size:"small",children:[Object(a.jsx)(br.a.Header,{children:i}),Object(a.jsx)(br.a.Content,{children:Object(a.jsxs)("div",{className:"resource-name",children:[l,Object(a.jsx)(u,Object(j.a)({},d))]})}),Object(a.jsxs)(br.a.Actions,{children:[Object(a.jsx)(ir.a,{onClick:this.handleCancel,children:"Cancel"}),Object(a.jsx)(ir.a,{primary:!0,icon:"checkmark",labelPosition:"right",content:"Submit",disabled:!c,onClick:this.handleSubmit})]})]})}}]),n}(i.a.Component),gr=n(343),xr=n.n(gr),Cr=(n(821),n(822),n(1392)),wr=function(e){var t=e.name,n=e.onClick,r=e.title;return Object(a.jsx)(xr.a,{className:"icon-button",name:t,onClick:n,title:r})},kr=function(e){var t=e.name,n=e.onClick;return Object(a.jsx)(xr.a,{className:"close-button",name:t,onClick:n})},yr=function(e){var t=e.message,n=e.icon,r=e.css,i=e.onClick,s=e.title,o=e.caption,l=e.captionIcon,c=Object(a.jsxs)("div",{children:[Object(a.jsx)("p",{className:"lg-message",children:t}),Object(a.jsx)("p",{className:"lg-button",children:Object(a.jsx)(wr,{name:n+" fa-4x",title:s,onClick:i})})]}),u=null!==o?Object(a.jsxs)("div",{children:[Object(a.jsx)(Cr.a,{horizontal:!0,children:Object(a.jsx)("p",{className:"lg-button",children:Object(a.jsx)(mr.a,{size:"big",name:l,style:{margin:0}})})}),Object(a.jsx)("p",{className:"lg-message",children:o})]}):null;return Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:r,children:c}),u]})},Sr=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.css,n=e.text,r=e.title,i=e.onClick,s=null;return s=null!=t?t:"icon-button",Object(a.jsx)("a",{className:s,title:r,onClick:i,children:n})}}]),n}(i.a.Component),Nr=n(1400),Er=n(1408),Ar=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i0){for(var t=Object(Pr.a)(e),n=0;n1){h.push(Object(a.jsx)(Br.a.Divider,{},"divider")),h.push(Object(a.jsx)(Br.a.Header,{content:"Switch Branch"},"header"));for(var p=function(e){var n=t[e],r=void 0;r=n.id===d.id?"checkmark box":"square outline",h.push(Object(a.jsx)(Br.a.Item,{icon:r,active:n.id===d.id,text:n.name,value:n.id,onClick:function(){return l(n)}},n.id))},j=0;j0&&o.push(Object(a.jsx)(Br.a.Divider,{},"div2")),o.push(Object(a.jsx)(Br.a.Item,{icon:"plus",text:"New Project ...",title:"Create a new project",onClick:t},"create")),o.push(Object(a.jsx)(Br.a.Item,{icon:"plus",text:"Import Project ...",title:"Import a project from a export file",onClick:n},"import")),null!=s&&o.push(Object(a.jsx)(Br.a.Item,{disabled:null==s,icon:"database",text:"Export Project",title:"Export current project",onClick:this.handleExportProject(s)},"export")),Object(a.jsx)(Br.a,{item:!0,text:"Projects",children:Object(a.jsx)(Br.a.Menu,{children:o})})}}]),n}(i.a.Component),Gr=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var a;return Object(m.a)(this,n),(a=t.call(this,e)).handleCancel=function(){var e=a.props.onCancel;a.setState({file:null}),e()},a.onChange=function(e){a.setState({file:e.target.files[0]})},a.handleSubmit=function(e){var t=a.props.onSubmit,n=a.state.file;null!=n&&t(n)},a.state={file:null},a}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.prompt,n=e.open,r=e.title,i=this.state.file,s=null;null!=t&&(s=Object(a.jsx)("p",{children:t}));var o=null!=i;return Object(a.jsxs)(br.a,{open:n,size:"small",children:[Object(a.jsx)(br.a.Header,{children:r}),Object(a.jsx)(br.a.Content,{children:Object(a.jsxs)("div",{className:"resource-name",children:[s,Object(a.jsx)("input",{type:"file",onChange:this.onChange})]})}),Object(a.jsxs)(br.a.Actions,{children:[Object(a.jsx)(ir.a,{negative:!0,onClick:this.handleCancel,children:"Cancel"}),Object(a.jsx)(ir.a,{positive:!0,icon:"checkmark",labelPosition:"right",content:"Done",disabled:!o,onClick:this.handleSubmit})]})]})}}]),n}(i.a.Component),Wr=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.onHideCells,n=e.onReverse,r=e.onSetFilter,i=e.userSettings;return Object(a.jsx)(Br.a,{item:!0,text:"Settings",children:Object(a.jsxs)(Br.a.Menu,{children:[Object(a.jsx)(Br.a.Header,{content:"Notebook cells in ..."},"head1"),Object(a.jsx)(Br.a.Item,{disabled:!i.showNotebookReversed(),icon:"sort numeric ascending",text:"Default order",title:"List notebook cells in default order (first cell shown first)",onClick:n},"defaultOrder"),Object(a.jsx)(Br.a.Item,{disabled:i.showNotebookReversed(),icon:"sort numeric descending",text:"Reverse order",title:"List notebook cells in reverse order (last cell shown first)",onClick:n},"reverseOrder"),Object(a.jsx)(Br.a.Divider,{},"div1"),Object(a.jsx)(Br.a.Header,{content:"Filter Modules"},"head2"),Object(a.jsx)(Br.a.Item,{icon:"remove circle",text:"Remove Filter",title:"Clear module filter to show all notebook cells",onClick:function(){return r()}},"showAll"),Object(a.jsx)(Br.a.Item,{icon:"th",text:"Filter VizUAL",title:"Filter VizUAL commands by default",onClick:function(){return r(f)}},"defaultFilter"),Object(a.jsx)(Br.a.Item,{disabled:!0,icon:"filter",text:"Customized Filter",title:"Show form to specify filter for all modules"},"filter"),Object(a.jsx)(Br.a.Divider,{},"div2"),Object(a.jsx)(Br.a.Header,{content:"Show Filtered Modules as ..."},"head3"),Object(a.jsx)(Br.a.Item,{disabled:!i.hideFilteredCommands(),icon:"compress",text:"Collapsed",title:"Collapse cells that contain filtered modules",onClick:t},"collapse"),Object(a.jsx)(Br.a.Item,{disabled:i.hideFilteredCommands(),icon:"hide",text:"Hidden",title:"Hide cells that contain filtered modules",onClick:t},"hide")]})})}}]),n}(i.a.Component),Yr=(n(147),n.p+"static/media/vizier_tiny.f23e05e5.svg"),Qr="MODAL_CREATE_PROJECT",Zr="MODAL_IMPORT_PROJECT",Xr="MODAL_DELETE_BRANCH",$r="MODAL_DELETE_PROJECT",ei="MODAL_EDIT_BRANCH_NAME",ti="MODAL_EDIT_PROJECT_NAME",ni=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var a;return Object(m.a)(this,n),(a=t.call(this,e)).handleDeleteCurrentBranch=function(e){(0,a.props.onDeleteBranch)(e),a.hideModal()},a.handleDeleteProject=function(){var e=a.props,t=e.onDeleteProject,n=e.project;a.hideModal(),t(n)},a.hideModal=function(){return a.setState({modal:null})},a.showCreateProjecthModal=function(){return a.setState({modal:Qr})},a.showImportProjecthModal=function(){return a.setState({modal:Zr})},a.showDeleteBranchModal=function(){return a.setState({modal:Xr})},a.showDeleteProjectModal=function(){return a.setState({modal:$r})},a.showEditBranchNameModal=function(){return a.setState({modal:ei})},a.showEditProjectNameModal=function(){return a.setState({modal:ti})},a.submitUpdateBranchName=function(e){var t=a.props,n=t.onEditBranch,r=t.branch;a.hideModal(),e.trim()!==r.name&&n(e)},a.submitUpdateProjectName=function(e){var t=a.props,n=t.onEditProject,r=t.project;a.hideModal(),e.trim()!==r.name&&n(e)},a.switchToBranchHead=function(){(0,a.props.onShowNotebook)()},a.state={modal:null},a}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.branch,n=e.notebook,r=e.onCreateBranch,i=e.onCreateProject,s=e.onImportProject,o=e.onGoHome,l=e.onHideCells,c=e.onReverse,u=e.onSetFilter,d=e.onShowChart,h=e.onShowDataset,p=e.onShowDatasetCaveat,j=e.onShowHistory,m=e.onShowNotebook,b=e.onShowProject,f=e.onSwitchBranch,v=e.project,O=e.projectList,g=e.resource,x=e.userSettings,C=[];if(g.isMainPage()?C.push(Object(a.jsx)(Ur.a.Item,{header:!0,children:Object(a.jsx)(Vr.a,{src:Yr})},"logo")):C.push(Object(a.jsx)(Ur.a.Item,{header:!0,onClick:o,children:Object(a.jsx)(Vr.a,{src:Yr})},"logo")),null!=v&&C.push(Object(a.jsx)(Ur.a.Item,{header:!0,children:v.name},"name")),C.push(Object(a.jsx)(Kr,{onCreate:this.showCreateProjecthModal,onImport:this.showImportProjecthModal,onDelete:this.showDeleteProjectModal,onEdit:this.showEditProjectNameModal,onSelect:b,project:v,projectList:O},"project")),null!=g){if(null!=t){var w=!1;null!=n&&(w=n.readOnly),C.push(Object(a.jsx)(Hr,{branches:v.branches,isMostRecent:!w,onCreateBranch:r,onDelete:this.showDeleteBranchModal,onEdit:this.showEditBranchNameModal,onGetMostRecent:this.switchToBranchHead,onSelect:f,onShowHistory:j,resource:g,selectedBranch:t},"branches"))}if(!g.isMainPage()&&(C.push(Object(a.jsx)(Ur.a.Item,{icon:"file alternate outline",name:"Notebook",disabled:g.isNotebook(),onClick:m},"notebook")),n)){if(n.workflow.modules.length>0&&Object.keys(n.workflow.datasets).length>0){var k=Array.from(new Map(n.workflow.modules.flatMap((function(e,t){return e.datasets?e.datasets:[]})).map((function(e){return[e.name,e]}))).values());C.push(Object(a.jsx)(qr,{datasets:k,onSelect:h,resource:g},"datasets")),C.push(Object(a.jsx)(Jr,{datasets:k,onSelect:p,resource:g},"errors"))}n.workflow.charts&&C.push(Object(a.jsx)(zr,{charts:n.workflow.charts,onSelect:d,resource:g},"charts"))}}C.push(Object(a.jsx)(Wr,{onHideCells:l,onReverse:c,onSetFilter:u,userSettings:x},"settings"));var y=Object(a.jsx)(Ur.a,{fixed:"top",children:C}),S=null,N=this.state.modal;return null!==N&&(N===Qr?S=Object(a.jsx)(Or,{isValid:Jt,open:!0,prompt:"Enter a name for the new project",title:"Create project",onCancel:this.hideModal,onSubmit:i}):N===Zr?S=Object(a.jsx)(Gr,{open:!0,prompt:"Select a project export file to import",title:"Import project",onCancel:this.hideModal,onSubmit:s}):N===Xr&&null!=t?S=Object(a.jsx)(Ir,{open:!0,onCancel:this.hideModal,onSubmit:this.handleDeleteCurrentBranch,prompt:"Do you really want to delete the branch "+t.name+"?",title:"Delete branch",value:t}):N===$r&&null!=v?S=Object(a.jsx)(Ir,{open:!0,onCancel:this.hideModal,onSubmit:this.handleDeleteProject,prompt:"Do you really want to delete the project "+v.name+"?",title:"Delete project",value:t}):N===ti&&null!=v?S=Object(a.jsx)(Or,{isValid:Jt,open:!0,onCancel:this.hideModal,onSubmit:this.submitUpdateProjectName,title:"Edit project name",value:v.name}):N===ei&&null!=t&&(S=Object(a.jsx)(Or,{isValid:Jt,open:!0,onCancel:this.hideModal,onSubmit:this.submitUpdateBranchName,title:"Edit branch name",value:t.name}))),Object(a.jsxs)("div",{className:"project-menu",children:[y,S]})}}]),n}(i.a.Component),ai=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i0){for(var o=[],l=0;l0;)t=(e-1)%26,n=String.fromCharCode(t+65)+n,e=(e-t-1)/26;return n},Ni=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i",value:""});for(var s=0;s",value:""});for(var s=0;s",value:""});for(var o=0;o",value:""});for(var s=0;s { //do things with ds here })')):a===vs?i.push('VizierDB.outputAnnotations("unique-ds-name")'):a===Os?(i.push("//Iterate over list of dataset columns and print column name"),i.push('ds.schema.map(se => se._1).mkString("
")')):a===gs&&(i.push("//Iterate over list of dataset rows and print cell value."),i.push('ds.toList.map(row => row.tuple.mkString(",")).mkString("
")')),r(i)},e}return Object(b.a)(n,[{key:"render",value:function(){return Object(a.jsx)("div",{className:"snippet-selector",children:Object(a.jsx)(Mr.a,{columns:4,divided:!0,children:Object(a.jsxs)(Mr.a.Row,{children:[Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsxs)(ci.a,{link:!0,children:[Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"desktop"})," Access & Output"]})}),Object(a.jsx)(ci.a.Item,{value:fs,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Get Dataset"})}),Object(a.jsx)(ci.a.Item,{value:Os,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Print Column Names"})}),Object(a.jsx)(ci.a.Item,{value:gs,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Print Cell Values"})}),Object(a.jsx)(ci.a.Item,{value:vs,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Print Cell Annotations"})})]})},"output"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsx)(ci.a,{link:!0,children:Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"plus"})," New"]})})})},"new"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsx)(ci.a,{link:!0,children:Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"edit"})," Update"]})})})},"update"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsx)(ci.a,{link:!0,children:Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"trash"})," Delete"]})})})},"delete")]})})})}}]),n}(i.a.Component),Cs=(i.a.Component,"WITH_DATASET"),ws="OUTPUT_ANNOTATIONS",ks="OUTPUT_COLUMN_NAMES",ys="OUTPUT_CELL_VALUES",Ss=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i { //do things with ds here })')):a===ws?i.push('vizierdb.outputAnnotations("unique-ds-name")'):a===ks?(i.push("//Iterate over list of dataset columns and print column name"),i.push('ds.schema.map(se => se._1).mkString("
")')):a===ys&&(i.push("//Iterate over list of dataset rows and print cell value."),i.push('ds.toList.map(row => row.tuple.mkString(",")).mkString("
")')),r(i)},e}return Object(b.a)(n,[{key:"render",value:function(){return Object(a.jsx)("div",{className:"snippet-selector",children:Object(a.jsx)(Mr.a,{columns:4,divided:!0,children:Object(a.jsxs)(Mr.a.Row,{children:[Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsxs)(ci.a,{link:!0,children:[Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"desktop"})," Access & Output"]})}),Object(a.jsx)(ci.a.Item,{value:Cs,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Get Dataset"})}),Object(a.jsx)(ci.a.Item,{value:ks,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Print Column Names"})}),Object(a.jsx)(ci.a.Item,{value:ys,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Print Cell Values"})}),Object(a.jsx)(ci.a.Item,{value:ws,onClick:this.handleSelect,children:Object(a.jsx)(ci.a.Content,{as:"a",children:"Print Cell Annotations"})})]})},"output"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsx)(ci.a,{link:!0,children:Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"plus"})," New"]})})})},"new"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsx)(ci.a,{link:!0,children:Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"edit"})," Update"]})})})},"update"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsx)(ci.a,{link:!0,children:Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"trash"})," Delete"]})})})},"delete")]})})})}}]),n}(i.a.Component),Ns="SELECT_TABLE",Es="JOIN_TABLES",As="UNION_TABLES",Is="DATASET",Ds=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var a;return Object(m.a)(this,n),(a=t.call(this,e)).handleSelect=function(e,t){var n=t.value,r=a.props.onSelect,i=a.state,s=i.secondaryDatasetValue,o=i.primaryDatasetValue,l=[];n===Ns?l.push("SELECT * FROM "+o):n===Es?l.push("SELECT * FROM "+o+" JOIN "+s):n===As?l.push("(SELECT * FROM "+o+") UNION ALL (SELECT * FROM "+s+")"):n===Is&&l.push(" "+o+" "),r(l)},a.handleSecondaryDatasetChange=function(e){a.setState({secondaryDatasetValue:e})},a.handlePrimaryDatasetChange=function(e){a.setState({primaryDatasetValue:e})},a.state={secondaryDatasetValue:""},a}return Object(b.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.id,r=t.datasets,i=this.state,s=i.secondaryDatasetValue,o=i.primaryDatasetValue;return Object(a.jsx)("div",{className:"snippet-selector",children:Object(a.jsx)(Mr.a,{columns:4,divided:!0,children:Object(a.jsxs)(Mr.a.Row,{children:[Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsxs)(ci.a,{link:!0,children:[Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"desktop"})," Access & Output"]})}),Object(a.jsx)(ci.a.Item,{className:"sql-example-list-item",value:Ns,onClick:this.handleSelect,children:Object(a.jsxs)(ci.a.Content,{as:"a",children:[Object(a.jsx)("span",{className:"sql-example-a-span",children:"Select from"}),Object(a.jsx)("div",{className:"sql-example-ds-selector",children:Object(a.jsx)(Ii,{id:n,isRequired:!1,name:n,datasets:r,value:o,onChange:function(t,n){e.handlePrimaryDatasetChange(n)}},n)}),Object(a.jsx)(mr.a,{name:"plus"})]})}),Object(a.jsx)(ci.a.Item,{className:"sql-example-list-item",value:Es,onClick:this.handleSelect,children:Object(a.jsxs)(ci.a.Content,{as:"a",children:[Object(a.jsx)("div",{className:"sql-example-ds-selector",children:Object(a.jsx)(Ii,{id:n,isRequired:!1,name:n,datasets:r,value:o,onChange:function(t,n){e.handlePrimaryDatasetChange(n)}},n)}),Object(a.jsx)("span",{className:"sql-example-a-span",children:"Join"}),Object(a.jsx)("div",{className:"sql-example-ds-selector",children:Object(a.jsx)(Ii,{id:n,isRequired:!1,name:n,datasets:r,value:s,onChange:function(t,n){e.handleSecondaryDatasetChange(n)}},n)}),Object(a.jsx)(mr.a,{name:"plus"})]})}),Object(a.jsx)(ci.a.Item,{className:"sql-example-list-item",value:As,onClick:this.handleSelect,children:Object(a.jsxs)(ci.a.Content,{as:"a",children:[Object(a.jsx)("div",{className:"sql-example-ds-selector",children:Object(a.jsx)(Ii,{id:n,isRequired:!1,name:n,datasets:r,value:o,onChange:function(t,n){e.handlePrimaryDatasetChange(n)}},n)}),Object(a.jsx)("span",{className:"sql-example-a-span",children:"Union"}),Object(a.jsx)("div",{className:"sql-example-ds-selector",children:Object(a.jsx)(Ii,{id:n,isRequired:!1,name:n,datasets:r,value:s,onChange:function(t,n){e.handleSecondaryDatasetChange(n)}},n)}),Object(a.jsx)(mr.a,{name:"plus"})]})})]})},"output"),Object(a.jsx)(Mr.a.Column,{width:4,children:Object(a.jsxs)(ci.a,{link:!0,children:[Object(a.jsx)(ci.a.Item,{children:Object(a.jsxs)(ci.a.Header,{children:[Object(a.jsx)(mr.a,{name:"plus"})," Dataset"]})}),Object(a.jsx)(ci.a.Item,{className:"sql-example-list-item",value:Is,onClick:this.handleSelect,children:Object(a.jsxs)(ci.a.Content,{as:"a",children:[Object(a.jsx)("span",{className:"sql-example-a-span",children:"Dataset"}),Object(a.jsx)("div",{className:"sql-example-ds-selector",children:Object(a.jsx)(Ii,{id:n,isRequired:!1,name:n,datasets:r,value:o,onChange:function(t,n){e.handlePrimaryDatasetChange(n)}},n)}),Object(a.jsx)(mr.a,{name:"plus"})]})})]})},"new")]})})})}}]),n}(i.a.Component),Ps=(i.a.Component,n(1089),"TABLE"),Rs=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i0&&""!==s){for(var u=c[o.line],d=0;d0?a.setState({errors:c.errors,hasErrors:!0}):(a.setState({errors:null,hasErrors:!1,submitted:!0}),n(t,l,c.data,i)),a.setState({upstreamFormValues:!1})}else alert("Cannot submit cell in an active notebook")},a.handleToggleSnippetSelector=function(){var e=a.state.snippetSelectorVisible;a.setState({snippetSelectorVisible:!e})},a.handleF5Press=function(e){e.preventDefault(),a.handleSubmitForm()};var r=e.cell,i=e.datasets,s=null;return r.isNewCell()||(s=Wa(r.commandSpec.parameters,i,r.module.command.arguments)),a.state={codeEditorProps:{cursorPosition:{line:0,ch:0},newLines:""},errors:null,formValues:s,hasErrors:!1,selectedCommand:r.commandSpec,showCommandsListing:null==r.commandSpec,snippetSelectorVisible:!1,upstreamFormValues:!1,submitted:!1},a}return Object(b.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.apiEngine,r=t.cell,i=t.datasets,s=t.artifacts,o=t.isActiveCell,l=t.onClick,c=t.onSubmit,u=t.userSettings,d=this.state,h=d.errors,p=d.formValues,j=d.hasErrors,m=d.selectedCommand,b=d.showCommandsListing,f=d.snippetSelectorVisible,v=d.submitted,O=null;null!=h&&(O=Object(a.jsx)(hr,{title:"There are errors in the form",errors:h,onDismiss:this.handleDismissErrors}));var g=null,x=null,C=null;if(o&&(null==m||b)){var w=null;null!=u.clipboard&&(w=this.handlePasteCommand),g=Object(a.jsx)(vi,{apiEngine:n,onDismiss:this.handleDismissCommandsListing,onPaste:w,onSelect:this.handleSelectCommand})}else{var k=null;if(o?k=m.codeParameter:r.isNewCell()||(k=r.commandSpec.codeParameter),null!=k)if(v)g=Object(a.jsx)("div",{className:"module-form",children:Object(a.jsx)(or,{text:"Submitting Cell",size:"small"})});else{var y=null;o&&f&&("python"===k.language?y=Object(a.jsx)(bs,{onSelect:this.handleAppendCode}):"scala"===k.language?y=Object(a.jsx)(xs,{onSelect:this.handleAppendCode}):"r"===k.language?y=Object(a.jsx)(Ss,{onSelect:this.handleAppendCode}):"sql"===k.language?y=Object(a.jsx)(Ds,{datasets:i,onSelect:this.handleAppendCode}):"markdown"===k.language&&(y=Object(a.jsx)(Rs,{onSelect:this.handleAppendCode})));var S=this.state.codeEditorProps,N=!(!r||!r.module)&&r.module.locked;if(o&&"sql"===k.language){var E=p.output_dataset;x=Object(a.jsxs)("div",{className:"ui labeled input",children:[Object(a.jsx)("div",{className:"ui label",children:"Output Dataset"}),Object(a.jsx)(wi,{id:k.id,name:"Output Dataset",placeholder:"Output Dataset (optional)",isRequired:!1,value:E,onChange:function(t,n){e.handleFormValueChange("output_dataset",n,S.cursorPosition)}},k.id)]})}g=Object(a.jsxs)("div",{children:[Object(a.jsx)(bi.a,{children:Object(a.jsx)(Ci,{cursorPosition:S.cursorPosition,editing:!1,id:k.id,isActiveCell:o,language:k.language,onChange:this.handleFormValueChange,onCursor:this.handleCursorChange,onFocus:this.handleActivateCell,readOnly:null==c,value:p[k.id],locked:N},k.id)}),x,y]});var A=f?"Hide":"Show";C=Object(a.jsx)(ir.a,{content:A+" Code Examples",icon:"info",labelPosition:"left",primary:!0,onClick:this.handleToggleSnippetSelector})}else if(o){var I=j?" error":"";g=v?Object(a.jsx)("div",{className:"module-form"+I,children:Object(a.jsx)(or,{text:"Submitting Cell",size:"small"})}):Object(a.jsxs)("div",{className:"module-form"+I,children:[Object(a.jsx)("p",{className:"module-form-header"+I,children:m.name}),Object(a.jsx)(Gi,{datasets:i,artifacts:s,onChange:this.handleFormValueChange,selectedCommand:m,serviceProperties:n.serviceProperties,values:p})]})}else r.isNewCell()&&null!=m?g=Object(a.jsx)("pre",{className:"cell-cmd-text",onClick:l,children:m.name}):null!=r.module&&(g=Object(a.jsx)("pre",{className:"cell-cmd-text",onClick:l,children:r.module.text}))}var D=null;if(null!=c){var P={runCell:this.handleSubmitForm,dismiss:this.handleDismiss,catchF5:this.handleF5Press};D=Object(a.jsx)(mi.HotKeys,{keyMap:{runCell:"ctrl+enter",dismiss:"esc",catchF5:"f5"},handlers:P,children:g})}else D=g;var R=null;return!o||b||v||(R=Object(a.jsxs)("div",{className:"module-form-buttons",children:[C,Object(a.jsx)("span",{className:"padding-lg",children:Object(a.jsx)(ir.a,{content:"Change Command",icon:"wrench",labelPosition:"left",onClick:this.handleShowCommandsListing})}),Object(a.jsx)(ir.a,{content:"Dismiss",icon:"close",labelPosition:"left",negative:!0,onClick:this.handleDismiss}),Object(a.jsx)(ir.a,{content:"Submit",disabled:null==c,icon:"paper plane outline",labelPosition:"left",positive:!0,onClick:this.handleSubmitForm})]})),Object(a.jsxs)("div",{className:"cell-command-area",children:[O,D,R]})}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n="undefined"!==typeof e.cell.module?e.cell.module.command.arguments:null;if("undefined"!==typeof n&&null!==n&&!1===t.upstreamFormValues){var a=Wa(e.cell.commandSpec.parameters,e.datasets,n);return Object(j.a)(Object(j.a)({},t),{},{formValues:a})}return null}}]),n}(i.a.Component)),_s=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i1&&(f+="-"+n),b.push(Object(a.jsx)(Br.a.Item,{disabled:o.hasActiveCells(),icon:"fork",text:"Create branch",title:"Create new branch containing notebook cells ["+f+"]",onClick:u},"branch")),b.push(Object(a.jsx)(Br.a.Divider,{},"div-filter")),b.push(Object(a.jsx)(Br.a.Header,{content:"Filter"},"header-filter")),b.push(Object(a.jsx)(Br.a.Item,{icon:"filter",text:"Hide "+t.commandSpec.name,title:"Hide all cells with command of type "+t.commandSpec.name+" in the notebook",onClick:l},"hide-cmd"));var v=null;return t.isErrorOrCanceled()&&(t.isCanceled()?v=Object(a.jsx)(mr.a,{name:"cancel",color:"red",title:"Canceled"}):t.isError()&&(v=Object(a.jsx)(mr.a,{name:"warning circle",color:"red",title:"Error"})),v=Object(a.jsx)("div",{className:"cell-status-icon",children:v})),Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"cell-menu",children:Object(a.jsx)(Br.a,{icon:"bars",title:"Cell actions",children:Object(a.jsx)(Br.a.Menu,{children:b})})}),v]})}}]),n}(i.a.Component),Ls=n(540),Ms=n.n(Ls),Fs=n(541),Us=n.n(Fs),Vs=n(43),Bs=n(60),Hs=n(20),zs=n(347),qs=(n(180),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var r;Object(m.a)(this,n),(r=t.call(this,e)).handleResize=function(e){try{var t=o.a.findDOMNode(Object(Vs.a)(r));r.setState({width:t.offsetWidth})}catch(n){}},r.handleSelectChart=function(e,t){var n=t.value;r.setState({chartType:n})},r.handleToggleGrouped=function(e,t){var n=t.checked;r.setState({grouped:n})},r.selectedReCharts=function(e,t,n,i){var s=t.values,o=t.labels,l=r.selectedReChart(e,o,s);if(void 0===l)return null;if(n)return l(s,i,n,"");for(var c=[],u=1;u1&&(p=Object(a.jsx)("td",{className:"plot-form-check",children:Object(a.jsx)(ki.a,{checked:o,label:"Grouped",onChange:this.handleToggleGrouped})})),Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"plot-menu",children:Object(a.jsx)("table",{className:"plot-form-table",children:Object(a.jsx)("tbody",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{className:"plot-form-label",onClick:r,children:"Charts"}),Object(a.jsx)("td",{className:"plot-form-dropdown",children:Object(a.jsx)(Br.a,{text:s,selection:!0,fluid:!0,scrolling:!0,options:d,onChange:this.handleSelectChart})}),p]})})})}),Object(a.jsx)("div",{id:n,className:"plot-view",onClick:r,children:Object(a.jsx)("div",{children:u})})]})}}]),n}(i.a.Component)),Js=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.x,n=e.y;return!1===e.caveats[e.index]?Object(a.jsx)("svg",{x:t-6,y:n-6,width:14,height:14,fill:"red",viewBox:"0 0 14 14",children:Object(a.jsx)("text",{x:0,y:0,dy:14,fontSize:16,children:"*"})}):Object(a.jsx)("text",{})}}]),n}(r.PureComponent);qs.defaultProps={x:0,y:0,gridList_cellHeight:400,gridList_width:1e3,gridList_height:450,gridLis_overflowY:"auto",colorText:"black",charts:["Area Chart","Bar Chart","Line Chart","Scatter Plot","Pie Chart","Donut Chart","Radar Chart","Radial Bar Chart","Treemap"]};var Ks=qs,Gs=n(547),Ws=n.n(Gs),Ys=n(548),Qs=n.n(Ys),Zs=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i",name:"bullseye"})})})),Object(a.jsx)("td",{className:"grid-row-index",onClick:o,children:Object(a.jsxs)("div",{children:[d,Object(a.jsx)("div",{className:"row-index-content",children:i}),c,h]})})}}]),n}(i.a.Component);ro.defaultProps={disabled:!1,rowIndex:-1};var io=ro,so=n(1399),oo=n(159),lo=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i",name:"bullseye"})})})),p=Object(a.jsxs)("div",{children:[Object(a.jsx)("span",{className:"header-value",children:d}),Object(a.jsx)(di.a,{size:"mini",children:"(".concat(i.type,")")}),Object(a.jsx)("div",{children:this.props.isLoadingPlot&&this.props.dataset&&this.props.dataset.isProfiled()&&Object(a.jsx)(Co,{column:i,profiledData:this.props.profiledData,isLoadingPlot:this.props.isLoadingPlot})})]})),Object(a.jsxs)(ao.Draggable,{type:"header-cell",data:s,wrapperComponent:Object(a.jsx)("th",{}),className:h,onClick:this.handleClick,children:[m,b,p,f]})}}]),n}(i.a.Component);yo.defaultProps={disabled:!1,isActive:!1,isUpdating:!1};var So=yo,No=(n(506),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(m.a)(this,n),t.apply(this,arguments)}return Object(b.a)(n,[{key:"render",value:function(){for(var e=this.props.dataset,t=e.properties,n=e.columns,r=[Object(a.jsx)(io,{rowIndex:-1,value:" "},-1)],i=0;i2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.setState({isFetching:r,resourceName:a,activeTab:n,hide:n===ct},(function(){return e.fetchData()}))},e.handleCopyEmbedClick=function(t){var n=e.props.cell,a='',r=document.createElement("textarea");r.innerHTML=a,document.body.appendChild(r),r.select();var i=document.execCommand("copy");document.body.removeChild(r),Ao.a.options={positionClass:"toast-top-full-width",hideDuration:300,timeOut:5e3},i?(console.log("copied embed code of output for cell "+n.id+" to clipboard"),setTimeout((function(){return Ao.a.success("Embed code copied!")}),300)):(console.log("error copying embed code of output for cell "+n.id+" to clipboard"),setTimeout((function(){return Ao.a.error("Embed code copy failed!")}),300))},e.handleCopyURLClick=function(t){var n=e.props.cell,a=window.location+"/?cell-output="+n.id,r=document.createElement("textarea");r.innerHTML=a,document.body.appendChild(r),r.select();var i=document.execCommand("copy");document.body.removeChild(r),Ao.a.options={positionClass:"toast-top-full-width",hideDuration:300,timeOut:5e3},i?(console.log("copied url of output for cell "+n.id+" to clipboard"),setTimeout((function(){return Ao.a.success("Output URL copied!")}),300)):(console.log("error copying url of output for cell "+n.id+" to clipboard"),setTimeout((function(){return Ao.a.success("Output URL copy failed!")}),300))},e.getConsoleOutputs=function(t){var n={},r={},i=e.props,s=i.cell,o=i.onSelectCell;if(t.hasOwnProperty("isMultiple")&&!t.isMultiple())switch(t.type){case ut:n["text/plain"]=t.lines.join("\n");break;case ot:n["text/html"]=t.lines.join("\n");break;case lt:n["text/markdown"]=t.lines.join("\n");break;default:n["text/plain"]=t.lines.join("\n")}else n=s.output.outputs;var l=function(t){if("text/html"===t){var i=Ms()({displayName:"Response",render:function(){return Object(a.jsx)("div",{className:"output-content-html",dangerouslySetInnerHTML:{__html:n[t]}})}});r[t]=Object(a.jsx)("div",{className:"output-content",children:Object(a.jsx)(i,{})})}else r[t]="text/markdown"===t?Object(a.jsx)("div",{className:"output-content",children:Object(a.jsx)(Us.a,{plugins:[Lo.a],source:n[t]})}):"text/plain"===t?Object(a.jsx)("pre",{className:"plain-text",onClick:o,children:n[t]}):"dataset/view"===t?e.getDatasetView(s.id,n[t]):"chart/view"===t?e.getChartView(n[t].data.name,n[t].result):Object(a.jsx)("pre",{className:"plain-text",onClick:o,children:JSON.stringify(n[t],null,2)})};for(var c in n)l(c);return{outputs:n,renders:r}},e.getDatasetView=function(t,n){var r=e.props,i=r.onSelectCell,s=r.datasets,o=r.onNavigateDataset,l=r.userSettings,c=r.onEditSpreadsheet,u=r.onRecommendAction,d=r.apiEngine;try{n.name=s[n.id].name}catch(h){}return Object(a.jsx)("div",{className:"output-content",children:Object(a.jsx)(Do,{dataset:n,onNavigate:o,onFetchAnnotations:e.handleFetchAnnotations,onSelectCell:i,userSettings:l,onEditSpreadsheet:c,moduleId:t,downloadLimit:d.serviceProperties.maxDownloadRowLimit,onRecommendAction:u})})},e.getChartView=function(t,n){var r=e.props.onSelectCell;return Object(a.jsx)("div",{className:"output-content",children:Object(a.jsx)(Zs,{identifier:t,dataset:n,onSelectCell:r})})},e.getOutputContent=function(){var t=e.props,n=t.cell,r=t.onSelectCell,i=e.state.resourceName,s=n.output;if(s.isHidden()&&!n.isCanceled())return Object(a.jsx)("pre",{className:"plain-text",onClick:r});if(s.isTimestamps()){var o="";return o=n.isErrorOrCanceled()?"Canceled at":"Finished at",Object(a.jsxs)("div",{className:"module-timings",onClick:r,children:[Object(a.jsx)("p",{className:"output-info-headline",children:Object(a.jsx)("span",{className:"output-info-headline",children:"Module timings"})}),Object(a.jsx)(Po,{label:"Created at",time:s.createdAt}),Object(a.jsx)(Po,{label:"Started at",time:s.startedAt}),Object(a.jsx)(Po,{label:o,time:s.finishedAt})]})}if(s.isDataset())return e.getDatasetView(n.id,s.dataset);if(s.isChart())return e.getChartView(s.name,s.dataset);if(s.isError()){var l=s.error;return Object(a.jsx)(dr,{title:l.title,message:l.message,onDismiss:e.handleOutputDismiss})}if(n.isError()){var c=n.module.outputs.stderr;if(c.length>0){var u=new gt(c);return Object(a.jsx)("div",{children:Object(a.jsx)("div",{className:"output-error",children:Object(a.jsx)("pre",{className:"error-text",onClick:r,children:u.lines.join("\n")})})})}}var d=e.getConsoleOutputs(s).renders,h=null;for(var p in d)i!==p&&"All"!==i||n.isCanceled()||(h=Object(a.jsxs)("div",{children:[h,null!==h&&Object(a.jsx)(To.a,{horizontal:!0}),d[p]]}));return Object(a.jsxs)("div",{className:"cell-command-area",children:[h,"All"!==i&&Object(a.jsx)("div",{className:"horizontal-divider",children:Object(a.jsx)(Sr,{text:"download",title:"Download console output",onClick:e.handleConsoleDownload})})]})},e}return Object(b.a)(n,[{key:"componentDidMount",value:function(){this.setState({activeTab:ut,resourceName:"All"})}},{key:"render",value:function(){var e=this,t=this.props,n=t.cell,r=t.onCancelExec,i=t.onCheckStatus,s=t.isActive,o=n.output,l=null;if(null!=r)if(o.isError()){var c=o.error;l=Object(a.jsx)("div",{className:"output-error",children:Object(a.jsx)(dr,{title:c.title,message:c.message})})}else l=Object(a.jsx)(lr,{interval:1e3,onCancel:r,onFetch:i,resource:n,text:n.isRunning()?"Running ...":"Pending ..."});if(n.isRunning())return Object(a.jsxs)("div",{children:[Object(a.jsxs)("div",{className:"module-timings",children:[Object(a.jsx)(Po,{label:"Created at",time:n.module.timestamps.createdAt}),Object(a.jsx)(Po,{label:"Started at",time:n.module.timestamps.startedAt})]}),l]});if(n.isPending()||s)return Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"module-timings",children:Object(a.jsx)(Po,{label:"Created at",time:n.module.timestamps.createdAt})}),l]});var u=[];if(n.module.datasets.length>0)for(var d=function(t){var r=n.module.datasets[t];u.push(Object(a.jsx)(Br.a.Item,{icon:"table",text:r.name,title:r.name,disabled:e.state.resourceName===r.name&&n.output.isDataset(),onClick:function(){return e.handleItemClick({},it,r.name,!0)}},"ds-"+r.name))},h=0;h0)for(var j=function(t){var r=n.module.charts[t];p.push(Object(a.jsx)(Br.a.Item,{icon:"bar chart",text:r.name,title:r.name,disabled:e.state.resourceName===r.name&&n.output.isChart(),onClick:function(){return e.handleItemClick({},rt,r.name,!0)}},"vw-"+r.name))},m=0;m3&&void 0!==arguments[3]&&arguments[3],i=e.props,s=i.cell,o=i.onDatasetNavigate;o(s.module,t,n,a,r)},e.handleDeleteCell=function(){var t=e.props,n=t.cell;(0,t.onDeleteCell)(n)},e.handleInsertCell=function(t){var n=e.props,a=n.cell,r=n.onInsertCell;n.userSettings.showNotebookReversed()?r(a,t===fn?vn:fn):r(a,t)},e.handleRemoveFilteredCommand=function(){var t=e.props,n=t.cell;(0,t.onRemoveFilteredCommand)(n.commandSpec)},e.handleSelectCell=function(){var t=e.props,n=t.cell,a=t.isActiveCell,r=t.onSelect;a||n.isActive()||r(n)},e.handleFreezeCell=function(){var t=e.props,n=t.cell;(0,t.onFreezeCell)(n)},e.handleThawCell=function(){var t=e.props,n=t.cell;(0,t.onThawCell)(n)},e.handleRecommendAction=function(t,n){var a=e.props,r=a.cell;(0,a.onRecommendAction)(t,n,r)},e}return Object(b.a)(n,[{key:"render",value:function(){var e=this.props,t=e.apiEngine,n=e.cell,r=e.cellNumber,i=e.datasets,s=e.artifacts,o=e.isActiveCell,l=e.isNewNext,c=e.isNewPrevious,u=e.notebook,d=e.onCancelExec,h=e.onCheckStatus,p=e.onDismissCell,j=e.onFetchAnnotations,m=e.onOutputSelect,b=e.onSubmitCell,f=e.userSettings,v=e.onEditSpreadsheet,O=e.onResetRecommendations,g=null,x=null,C=null;if(n.isNewCell())g="*";else{var w=n.commandSpec;if(!n.isActive()&&f.isFiltered(w)){var k="",y=null;return n.isErrorOrCanceled()&&(k=" collapsed-error-cell",n.isCanceled()?y=Object(a.jsx)(mr.a,{name:"cancel",color:"red",title:"Canceled"}):n.isError()&&(y=Object(a.jsx)(mr.a,{name:"warning circle",color:"red",title:"Error"}))),f.hideFilteredCommands()?null:Object(a.jsxs)("div",{className:"horizontal-divider"+k,children:[y,Object(a.jsx)(Sr,{css:"code-text",text:w.name,title:"Show cells of this type",onClick:this.handleRemoveFilteredCommand})]})}g=r;var S=l,N=c;f.showNotebookReversed()&&(S=c,N=l),x=Object(a.jsx)(_s,{cell:n,cellNumber:r,isActiveCell:o,isNewNext:S,isNewPrevious:N,notebook:u,onAddFilteredCommand:this.handleAddFilteredCommand,onCopyCell:this.handleCopyCell,onCreateBranch:this.handleCreateBranch,onDeleteCell:this.handleDeleteCell,onInsertCell:this.handleInsertCell,onSelectCell:this.handleSelectCell,onFreezeCell:this.handleFreezeCell,onThawCell:this.handleThawCell}),C=Object(a.jsx)(Mo,{cell:n,datasets:u.datasets,onCancelExec:d,onCheckStatus:h,onFetchAnnotations:j,onNavigateDataset:this.handleDatasetNavigate,onOutputSelect:m,onSelectCell:this.handleSelectCell,userSettings:f,onEditSpreadsheet:v,onRecommendAction:this.handleRecommendAction,apiEngine:t})}var E=Object(a.jsx)(Ts,{apiEngine:t,datasets:i,artifacts:s,cell:n,isActiveCell:o&&!u.readOnly,onClick:this.handleSelectCell,onDismiss:p,onSelectCell:this.handleSelectCell,onSubmit:b,userSettings:f,onResetRecommendations:O,onUpdateProgress:this.handleUpdateProgress}),A=o?"cell active-cell":"cell inactive-cell",I="";return n.isErrorOrCanceled()?I=" error-cell":n.isRunning()?I=" running-cell":n.isPending()?I=" pending-cell":n.isFrozen()&&(I=" frozen-cell"),Object(a.jsx)(Bi.Provider,{value:this.state,children:Object(a.jsx)("table",{className:A+I,children:Object(a.jsx)("tbody",{children:Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{className:"cell-index"+I,onClick:this.handleSelectCell,children:[Object(a.jsx)("a",{id:"cell-"+g,children:Object(a.jsxs)("p",{className:"cell-index"+I,children:["[",g,"]"]})}),x]}),Object(a.jsxs)("td",{className:"cell-area"+I,children:[E,C]})]})})})})}}]),n}(i.a.Component),Uo=(n(1361),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){var e;Object(m.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i0&&(T=Object(a.jsx)(Uo,{contents:r.workflow.tableOfContents}));var _=null,L=r.lastCell();L.isNewCell()||L.isErrorOrCanceled()||r.readOnly||(_=Object(a.jsx)("table",{className:"cell",children:Object(a.jsx)("tbody",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{className:"cell-index"}),Object(a.jsx)("td",{className:"cell-button",children:Object(a.jsx)(mr.a,{size:"big",link:!0,name:"plus",onClick:this.handleAppendCell,title:"Append new cell"})})]})})}));var M=null;return O.showNotebookReversed()?(w.reverse(),M=Object(a.jsxs)("div",{children:[T,_,w]})):M=Object(a.jsxs)("div",{children:[T,w,_]}),M}}]),n}(i.a.Component),Bo=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var a;Object(m.a)(this,n),(a=t.call(this,e)).handleAddFilteredCommand=function(e){a.props.dispatch(function(e){return{type:v,command:e}}(e))},a.handleCancelWorkflowExec=function(){var e=a.props;(0,e.dispatch)(function(e){return function(t){return t(W(e.workflow.links.get("workflow.cancel"),{},(function(t){var n=new $e(e.workflow.engine).fromJson(t);return{type:En,notebook:e.updateWorkflow(n)}}),In))}}(e.notebook))},a.handleCheckWorkflowStatus=function(e){var t=a.props,n=t.dispatch,r=t.notebook;n(Pn(r,e))},a.handleCopyCell=function(e){(0,a.props.dispatch)(function(e){return{type:O,cell:e}}(e))},a.handleCreateBranch=function(e){var t=a.props,n=t.branch,r=t.dispatch,i=t.history,s=t.notebook,o=t.project,l=a.state.moduleId;r(function(e,t,n,a,r,i){return function(s){var o={properties:[{key:"name",value:r}]};null!=a&&(o.source={branchId:t.id,workflowId:n,moduleId:a}),s(q(e.links.get("branch.create"),o,(function(t){var n=(new oe).fromJson(t);return s(He(e.addBranch(n))),i.push(Wt(e.id,n.id)),{type:x}}),(function(e){return Ke("Error creating new branch",e)}),pn))}}(o,n,s.id,l,e,i)),a.hideCreateBranchModal()},a.handleDeleteBranch=function(e){var t=a.props,n=t.dispatch,r=t.history,i=t.project;n(dn(i,e,Wt,r))},a.handleDeleteCell=function(e){var t=a.props;(0,t.dispatch)(function(e,t){return function(n){return n(Ye()),V(t.module.links.get("module.delete"),{method:"DELETE"})(n).then((function(t){200===t.status?B(t).then((function(t){return n(zn(e,t))})):401===t.status?n(F()):B(t).then((function(e){return n(Ke("Error deleting module",e.message))}))})).catch((function(e){return n(Ke("Error while deleting module",e.message))}))}}(t.notebook,e))},a.handleDatasetNavigate=function(e,t,n,r,i){var s=a.props,o=s.dispatch,l=s.notebook;o(i?function(e,t,n,a,r,i){return function(s){var o=n.links.getDatasetUrl(a,r,i);return s(K(o,(function(a){return zn(e().replaceOutput(t.id,new mt(new Ze(a.id,n.name,n.activeCell).fromJson(a))))}),(function(a){return Tn(e(),t,"dataset "+n.name,a)})))}}((function(){return a.props.notebook}),e,t,n,r,i):Ln(l,e,t,n,r))},a.handleDismissCell=function(e){var t=a.props;(0,t.dispatch)(function(e,t){return function(n){n({type:En,notebook:e.dismissChangesForCell(t.id)}),n({type:Nn})}}(t.notebook,e))},a.handleFetchDatasetCellAnnotations=function(e,t,n,r){(0,a.props.dispatch)(oa(t,n,r))},a.dismissAnnotationModal=function(){(0,a.props.dispatch)(sa())},a.handleInsertCell=function(e,t){var n=a.props;(0,n.dispatch)(function(e,t,n){return function(a){var r=On(e.cellCounter);a({type:En,notebook:e.editCell(t,n)}),a({type:Nn,cellId:r})}}(n.notebook,e,t))},a.handleFreezeCell=function(e){var t=a.props,n=t.dispatch,r=t.notebook,i=e.module.links.get(re);n(Vn(r,i,e.id))},a.handleThawCell=function(e){var t=a.props,n=t.dispatch,r=t.notebook,i=e.module.links.get(ie);n(Vn(r,i,e.id))},a.handleRemoveFilteredCommand=function(e){a.props.dispatch(function(e){return{type:C,command:e}}(e))},a.handleSelectOutput=function(e,t,n){var r=a.props,i=r.dispatch,s=r.notebook,o=r.userSettings;t===rt?i(_n(s,e,n)):t===it?i(Ln(s,e,s.getDatasetForModule(e,n),0,o.cellRowLimit())):t===ct?i(function(e,t){return function(n){var a=new ft;n(zn(e.replaceOutput(t.id,a)))}}(s,e)):t===ut?i(Mn(s,e)):t===dt?i(function(e,t){return function(n){var a=t.timestamps,r=a.createdAt,i=a.startedAt,s=a.finishedAt,o=new Ct(r,i,s);n(zn(e.replaceOutput(t.id,o)))}}(s,e)):t===ht&&i(Mn(s,e))},a.handleSelectActiveCell=function(e){a.props.dispatch(function(e){var t=null!=e?e.id:null;return{type:Nn,cellId:t}}(e))},a.handleShowBranch=function(){var e=a.props,t=e.branch,n=e.history,r=e.project;n.push(Gt(r.id,t.id))},a.handleShowBranchHead=function(){var e=a.props,t=e.branch,n=e.history,r=e.project;n.push(Wt(r.id,t.id))},a.handleSubmitCell=function(e,t,n,r){var i=a.props,s=i.dispatch,o=i.notebook,l=i.project,c={packageId:t.packageId,commandId:t.id,arguments:n},u=null;if(null!=t.fileParameter&&(u=n.find((function(e){return e.id===t.fileParameter.id}))),e.isNewCell()){var d=null;if(o.lastCell().id===e.id)d=o.workflow.links.get(ae);else for(var h=0;h0)for(var i=t.cells.length-1;i>=0;i--){var s=t.cells[i];if(!s.isNewCell()){n=s.module.id;break}}}else{for(var o=0,l=0;lc&&(h=l):e===Ht?(d+=1)>=u.length&&(d=0,(h+=1)>c&&(h=l)):e===Bt&&(d-=1)<0&&(d=u.length-1,(h-=1)=s.length&&(o=0):e===Bt&&(o-=1)<0&&(o=s.length-1),r.handleSelectCell(s[o].id,-1,o,-1)}},r.handleNavigate=function(e,t,n){r.clearActiveCell();var a=r.props,i=a.dispatch,s=a.dataset,o=s.links.getDatasetUrl(t,n);i(ea(s,o))},r.handleSelectCell=function(e,t,n,a){var i=r.props,s=i.isUpdating,o=i.notebook;if(!s&&!o.workflow.readOnly){r.submitPendingUpdate();var l=null;if(-1!==n){var c=r.props.dataset;l=-1!==a?c.rowAtIndex(Math.abs(c.offset-a)).values[n]:c.columns[n].name}r.setState({activeColumnId:e,activeRowId:t,activeColumnIndex:n,activeRowIndex:a,originalCellValue:l,updatedCellValue:l})}},r.handleSubmitModal=function(e){var t=r.props.dataset,n=r.state,a=n.modal,i=n.modalValue;return r.dismissModal(),a===je?r.submitVizualCommand(function(e,t,n){return{packageId:we,commandId:je,arguments:[{id:"dataset",value:e},{id:"name",value:t},{id:"position",value:n}]}}(t.name,e,i)):a===fe?r.submitVizualCommand(Se(t.name,i,e)):a===ve?r.submitVizualCommand(Ne(t.name,i,e)):void 0},r.handleMoveAction=function(e,t,n){var a=r.props.dataset;return e===fe?r.submitVizualCommand(Se(a.name,t,n)):e===ve?r.submitVizualCommand(Ne(a.name,t,n)):void 0},r.handleVizualAction=function(e,t,n){var a=r.props.dataset;switch(e){case je:case fe:case ve:return void r.setState({modal:e,modalValue:t});case de:return r.submitVizualCommand(function(e,t){return{packageId:we,commandId:de,arguments:[{id:"dataset",value:e},{id:"column",value:t}]}}(a.name,t));case he:return r.submitVizualCommand(function(e,t){return{packageId:we,commandId:he,arguments:[{id:"dataset",value:e},{id:"row",value:t}]}}(a.name,t));case me:return r.submitVizualCommand(function(e,t){return{packageId:we,commandId:me,arguments:[{id:"dataset",value:e},{id:"position",value:t}]}}(a.name,t));case xe:return r.submitVizualCommand(function(e,t,n){return{packageId:we,commandId:xe,arguments:[{id:"dataset",value:e},{id:"columns",value:[[{id:"columns_column",value:t},{id:"columns_order",value:n}]]}]}}(a.name,t,n));default:return}},r.toggleNotebookCell=function(){var e=r.state.showNotebookCell;r.setState({showNotebookCell:!e})},r.handleFetchAnnotations=function(e,t){var n=r.props,a=n.dispatch,i=n.dataset;a(oa(i,e,t))},r.handleDisplayRows=function(e,t){var n=r.props.dataset,a=r.state.cellLimit;t.value!==a&&("all"===t.value&&a!==n.rowCount?(r.setState({cellLimit:n.rowCount}),r.handleNavigate(n,0,n.rowCount)):"all"!==t.value&&(r.setState({cellLimit:t.value}),r.handleNavigate(n,n.offset,t.value)))},r.handleCheckStatus=function(){var e=r.props,t=e.dispatch,n=e.notebook;t(Pn(n,n.cells[n.cells.length-1])),r.setState({notebookRunning:n.cells[n.cells.length-1].isRunning()})},r.showAnnotationModal=function(){var e=r.props,t=e.dispatch,n=e.dataset,a=r.state,i=a.activeColumnId,s=a.activeRowId;t(oa(n,i,s))},r.handleMoveColumnModalInputChange=function(e,t){r.setState({modalResult:t})},r.handleMoveRowModalInputChange=function(e,t){r.setState({modalResult:t.value})},r.showModal=function(){var e=r.state,t=e.modal,n=e.modalValue,i=e.modalResult,s=null,o="";if(null!=t){var l=null,c=null,u=null;if(t===je)l=Jt,c="Insert Column",u="Name of new column";else if(t===fe){for(var d=r.props.dataset,h=d.columns,p=null,j=0;j=0&&-1!==u&&(T=this.showAnnotationModal);var _=null;d&&(_=Object(a.jsx)("div",{className:"notebook-cell-xp-new",children:Object(a.jsx)("table",{className:"cell-area",children:Object(a.jsx)("tbody",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{className:"cell-index",children:Object(a.jsx)(kr,{name:"minus-square-o",onClick:this.toggleNotebookCell})}),Object(a.jsx)("td",{className:"cell-cmd",children:Object(a.jsx)("div",{className:"cell-form"})})]})})})}));var L=null;null!=T&&(L="icon-button");var M=null;if(!i.workflow.readOnly){var F="plus square outline";d&&(F="minus square outline"),M=Object(a.jsx)("span",{className:"left-padding-md",children:Object(a.jsx)(mr.a,{className:"icon-button",title:"Add notebook cell",name:F,onClick:this.toggleNotebookCell})})}for(var U=[],V=0,B=[25,50,100,150];Vs.maxDownloadRowLimit&&"row limit (".concat(s.maxDownloadRowLimit,") exceeded"),disabled:n.rowCount>s.maxDownloadRowLimit,value:"all",onClick:this.handleDisplayRows}));var z=null;if(i.cells[i.cells.length-1].isRunning())z=Object(a.jsx)(lr,{interval:1e3,onFetch:this.handleCheckStatus,resource:i.cells[i.cells.length-1],text:i.cells[i.cells.length-1].isRunning()?"Running ...":"Pending ..."});else if(!i.cells[i.cells.length-1].isRunning()&&m){z=Object(a.jsx)(lr,{interval:1e3,onFetch:this.handleCheckStatus,resource:i.cells[i.cells.length-1],text:i.cells[i.cells.length-1].isRunning()?"Running ...":"Pending ..."});var q=i.cells[i.cells.length-1].module.datasets.find((function(e){return e.name===n.name})).links.getDatasetUrl(n.offset,b);o(ea(n,q))}return Object(a.jsxs)("div",{className:"spreadsheet-container",children:[Object(a.jsxs)("h1",{className:"dataset-name",children:[n.name,Object(a.jsx)("span",{className:"left-padding-lg",children:Object(a.jsx)(mr.a,{className:L,name:"comment alternate outline",title:"Show annotations",disabled:null===T,onClick:T})}),M,Object(a.jsx)(Ur.a,{compact:!0,style:{float:"right"},children:Object(a.jsx)(Br.a,{selection:!0,text:"Showing ".concat(this.state.cellLimit," rows"),options:U})})]}),Object(a.jsx)(ui,{annotation:t,onDelete:this.deleteUserAnnotation,onDiscard:this.dismissAnnotationModal,onSubmit:this.submitUserAnnotation}),Object(a.jsxs)(zo.a.Dimmable,{dimmed:r,children:[Object(a.jsx)(sr.a,{active:r}),_,Object(a.jsxs)("div",{className:"spreadsheet-container",children:[Object(a.jsx)("div",{className:"spreadsheet-table-container",children:Object(a.jsxs)("table",{className:"spreadsheet",children:[Object(a.jsx)("thead",{children:v}),Object(a.jsx)("tbody",{children:k})]})}),Object(a.jsx)(uo,{cellLimit:this.state.cellLimit,dataset:n,onNavigate:this.handleNavigate})]})]}),this.showModal(),z]})}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};return e.dataset.name!==t.activeDataset&&(n={cellLimit:25,activeDataset:e.dataset.name}),t.cellLimit>e.dataset.rowCount&&(n=Object(j.a)(Object(j.a)({},n),{},{cellLimit:e.dataset.rowCount})),n}}]),n}(i.a.Component),Jo=Object(nr.a)(Object(c.b)((function(e){var t=e.spreadsheet.dataset;try{t.name=e.notebookPage.notebook.datasets[t.id].name}catch(n){}return{annotations:e.spreadsheet.annotations,dataset:t,isUpdating:e.spreadsheet.isUpdating,opError:e.spreadsheet.opError,project:e.projectPage.project,serviceApi:e.serviceApi,notebook:e.notebookPage.notebook,serviceProperties:e.serviceApi.properties}}))(qo)),Ko=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var a;Object(m.a)(this,n),(a=t.call(this,e)).handleShowBranchHead=function(){var e=a.props,t=e.branch,n=e.history,r=e.project;n.push(Wt(r.id,t.id))},a.state={modalOpen:!1,modalTitle:"New branch",moduleId:null};var r=a.props,i=r.branch,s=r.dispatch,o=r.notebook,l=r.project,c=r.projectList,u=a.props.match.params.project_id,d=a.props.match.params.branch_id,h=a.props.match.params.workflow_id;return null==l||l.id!==u?s(Ve(u,d,(function(e,t){return An(e,t,h)}))):null==i||i.id!==d?s(An(l,l.findBranch(d),h)):(null==o||o.id!==h)&&s(An(l,i,h)),null==c&&s(ga()),a}return Object(b.a)(n,[{key:"componentDidUpdate",value:function(e){if(e.location.pathname!==this.props.location.pathname){var t=this.props,n=t.dispatch,a=t.project,r=t.branch,i=t.notebook,s=this.props.match.params.project_id,o=this.props.match.params.branch_id,l=this.props.match.params.workflow_id;null==a||a.id!==s?n(Ve(s,o,(function(e,t){return An(e,t,l)}))):null==r||r.id!==o?n(ze(a,o,(function(e,t){return An(e,t,l)}))):null!=i&&i.id===l||n(An(a,r,l))}}},{key:"render",value:function(){var e=this.props,t=e.actionError,n=e.branch,r=e.dispatch,i=e.fetchError,s=e.isActive,o=e.isFetching,l=e.notebook,c=e.project,u=e.projectList,d=e.serviceApi,h=e.userSettings,p=e.dataset,j=null;if(i)j=Object(a.jsx)("div",{className:"page-content wide",children:Object(a.jsx)(pr,{error:i})});else if(null==c||null==n||null==l||null==p||o)j=Object(a.jsx)(or,{text:"Loading Spreadsheet..."});else if(null!=p){var m=Object(a.jsx)("div",{className:"spreadsheet",children:Object(a.jsx)(Jo,{})});j=Object(a.jsx)(ri,{actionError:t,branch:n,content:m,contentCss:"slim",dispatch:r,isActive:s,notebook:l,project:c,projectList:u,resource:new on(p),serviceApi:d,userSettings:h,onShowNotebook:this.handleShowBranchHead})}return j}}]),n}(r.Component),Go=Object(nr.a)(Object(c.b)((function(e){return{actionError:e.projectPage.actionError,activeCell:e.notebookPage.activeCell,branch:e.projectPage.branch,fetchError:e.notebookPage.fetchError,isActive:e.projectPage.isActive,isFetching:e.notebookPage.isFetching,notebook:e.notebookPage.notebook,project:e.projectPage.project,projectList:e.projectListing.projects,reversed:e.notebookPage.reversed,serviceApi:e.serviceApi,userSettings:e.app.userSettings,dataset:e.datasetErrorsPage.dataset}}))(Ko)),Wo=(n(511),function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var r;return Object(m.a)(this,n),(r=t.call(this,e)).handleExpand=function(){var e=r.state.expanded;r.setState({expanded:!e})},r.handleGotoError=function(e){var t=r.props;(0,t.onGotoError)(t.reason.value)},r.buildReasonElement=function(e,t){if(Array.isArray(t)){for(var n=[],i=0;i