harperdb 4.3.24 → 4.3.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +1 -1
  2. package/bin/harperdb.js +22 -22
  3. package/bin/lite.js +17 -17
  4. package/launchServiceScripts/launchInstallNATSServer.js +1 -1
  5. package/launchServiceScripts/launchNatsIngestService.js +17 -17
  6. package/launchServiceScripts/launchNatsReplyService.js +17 -17
  7. package/launchServiceScripts/launchUpdateNodes4-0-0.js +17 -17
  8. package/npm-shrinkwrap.json +250 -250
  9. package/package.json +2 -2
  10. package/server/jobs/jobProcess.js +17 -17
  11. package/server/serverHelpers/Headers.d.ts +1 -1
  12. package/server/threads/threadServer.js +17 -17
  13. package/studio/build-local/asset-manifest.json +47 -46
  14. package/studio/build-local/index.html +1 -1
  15. package/studio/build-local/static/css/main.e1f8b48c.css +13 -0
  16. package/studio/build-local/static/js/23.3b9f7144.chunk.js +1 -0
  17. package/studio/build-local/static/js/239.183c6cbc.chunk.js +2 -0
  18. package/studio/build-local/static/js/{228.302d7db9.chunk.js → 279.7890bce3.chunk.js} +1 -1
  19. package/studio/build-local/static/js/311.3d832d8b.chunk.js +2 -0
  20. package/studio/build-local/static/js/311.3d832d8b.chunk.js.LICENSE.txt +38 -0
  21. package/studio/build-local/static/js/43.73dc432d.chunk.js +2 -0
  22. package/studio/build-local/static/js/452.03944f0d.chunk.js +2 -0
  23. package/studio/build-local/static/js/{446.5237e847.chunk.js.LICENSE.txt → 452.03944f0d.chunk.js.LICENSE.txt} +2 -2
  24. package/studio/build-local/static/js/545.e12f8571.chunk.js +1 -0
  25. package/studio/build-local/static/js/591.7498da00.chunk.js +2 -0
  26. package/studio/build-local/static/js/805.6aab06e2.chunk.js +1 -0
  27. package/studio/build-local/static/js/806.adb20036.chunk.js +1 -0
  28. package/studio/build-local/static/js/833.5b133801.chunk.js +1 -0
  29. package/studio/build-local/static/js/851.e7004b75.chunk.js +1 -0
  30. package/studio/build-local/static/js/860.727e7fc8.chunk.js +1 -0
  31. package/studio/build-local/static/js/browse-csvupload.02fdfbea.chunk.js +1 -0
  32. package/studio/build-local/static/js/browse-datatable.c2eb203f.chunk.js +1 -0
  33. package/studio/build-local/static/js/browse-entitymanager.0db076c3.chunk.js +1 -0
  34. package/studio/build-local/static/js/browse-jsonviewer.90814e97.chunk.js +1 -0
  35. package/studio/build-local/static/js/custom-functions.01f632d1.chunk.js +1 -0
  36. package/studio/build-local/static/js/instance-charts.217c477d.chunk.js +1 -0
  37. package/studio/build-local/static/js/instance-cluster.7f6df625.chunk.js +1 -0
  38. package/studio/build-local/static/js/instance-config.59b29ef6.chunk.js +1 -0
  39. package/studio/build-local/static/js/instance-query.44ba3d7b.chunk.js +1 -0
  40. package/studio/build-local/static/js/instance-roles.38ef8e77.chunk.js +1 -0
  41. package/studio/build-local/static/js/instance-status.694a7846.chunk.js +1 -0
  42. package/studio/build-local/static/js/instance-users-datatable.d61ab3ef.chunk.js +1 -0
  43. package/studio/build-local/static/js/instance-users-edit.ff5bfa06.chunk.js +1 -0
  44. package/studio/build-local/static/js/instance-users.c71b71f2.chunk.js +1 -0
  45. package/studio/build-local/static/js/instance.47c8b74b.chunk.js +1 -0
  46. package/studio/build-local/static/js/instances.1ec58722.chunk.js +1 -0
  47. package/studio/build-local/static/js/main.a7016f30.js +2 -0
  48. package/studio/build-local/static/js/{main.7106edfd.js.LICENSE.txt → main.a7016f30.js.LICENSE.txt} +0 -33
  49. package/studio/build-local/static/js/offline-app.31c18661.chunk.js +1 -0
  50. package/studio/build-local/static/js/online-app.0d8194e1.chunk.js +1 -0
  51. package/studio/build-local/static/js/organization-billing.21b2d3c9.chunk.js +1 -0
  52. package/studio/build-local/static/js/organization-users.532711dd.chunk.js +1 -0
  53. package/studio/build-local/static/js/organization.99a1e759.chunk.js +1 -0
  54. package/studio/build-local/static/js/organizations.4933fdbc.chunk.js +1 -0
  55. package/studio/build-local/static/js/profile.e4e06bdf.chunk.js +1 -0
  56. package/studio/build-local/static/js/resetPassword.3478535b.chunk.js +1 -0
  57. package/studio/build-local/static/js/roles-jsonviewer.bf1011d5.chunk.js +1 -0
  58. package/studio/build-local/static/js/signIn.0134746e.chunk.js +1 -0
  59. package/studio/build-local/static/js/signUp.c8fce52d.chunk.js +1 -0
  60. package/studio/build-local/static/js/structure-reloader.f65842a1.chunk.js +1 -0
  61. package/studio/build-local/static/js/topnav.0fa4de77.chunk.js +1 -0
  62. package/studio/build-local/static/js/updatePassword.bc881b36.chunk.js +1 -0
  63. package/utility/scripts/restartHdb.js +17 -17
  64. package/studio/build-local/static/css/main.6c0f1b63.css +0 -13
  65. package/studio/build-local/static/js/110.ca4244a6.chunk.js +0 -2
  66. package/studio/build-local/static/js/287.21477cf9.chunk.js +0 -1
  67. package/studio/build-local/static/js/409.17daa4fe.chunk.js +0 -2
  68. package/studio/build-local/static/js/424.ad87c8fd.chunk.js +0 -1
  69. package/studio/build-local/static/js/446.5237e847.chunk.js +0 -2
  70. package/studio/build-local/static/js/662.92e32ffc.chunk.js +0 -1
  71. package/studio/build-local/static/js/718.74e9355d.chunk.js +0 -1
  72. package/studio/build-local/static/js/723.c58acced.chunk.js +0 -2
  73. package/studio/build-local/static/js/731.8a941eb3.chunk.js +0 -1
  74. package/studio/build-local/static/js/807.510f66df.chunk.js +0 -2
  75. package/studio/build-local/static/js/807.510f66df.chunk.js.LICENSE.txt +0 -5
  76. package/studio/build-local/static/js/926.88d6f9ce.chunk.js +0 -1
  77. package/studio/build-local/static/js/browse-csvupload.453237f3.chunk.js +0 -1
  78. package/studio/build-local/static/js/browse-datatable.b9ef2d28.chunk.js +0 -1
  79. package/studio/build-local/static/js/browse-entitymanager.50827a5a.chunk.js +0 -1
  80. package/studio/build-local/static/js/browse-jsonviewer.a2534004.chunk.js +0 -1
  81. package/studio/build-local/static/js/custom-functions.dd7e182c.chunk.js +0 -1
  82. package/studio/build-local/static/js/instance-charts.34d15f02.chunk.js +0 -1
  83. package/studio/build-local/static/js/instance-cluster.5bce430c.chunk.js +0 -1
  84. package/studio/build-local/static/js/instance-config.70c17b53.chunk.js +0 -1
  85. package/studio/build-local/static/js/instance-query.4f6eec62.chunk.js +0 -1
  86. package/studio/build-local/static/js/instance-roles.507a4ed0.chunk.js +0 -1
  87. package/studio/build-local/static/js/instance-status.ce9d7f64.chunk.js +0 -1
  88. package/studio/build-local/static/js/instance-users-datatable.190640fd.chunk.js +0 -1
  89. package/studio/build-local/static/js/instance-users-edit.d2444479.chunk.js +0 -1
  90. package/studio/build-local/static/js/instance-users.eabfbbde.chunk.js +0 -1
  91. package/studio/build-local/static/js/instance.a163623f.chunk.js +0 -1
  92. package/studio/build-local/static/js/instances.6b88a87c.chunk.js +0 -1
  93. package/studio/build-local/static/js/main.7106edfd.js +0 -2
  94. package/studio/build-local/static/js/offline-app.7371216b.chunk.js +0 -1
  95. package/studio/build-local/static/js/online-app.db436eec.chunk.js +0 -1
  96. package/studio/build-local/static/js/organization-billing.b2f260f0.chunk.js +0 -1
  97. package/studio/build-local/static/js/organization-users.b6171b18.chunk.js +0 -1
  98. package/studio/build-local/static/js/organization.7800f16a.chunk.js +0 -1
  99. package/studio/build-local/static/js/organizations.8bb505f2.chunk.js +0 -1
  100. package/studio/build-local/static/js/profile.292bdd86.chunk.js +0 -1
  101. package/studio/build-local/static/js/resetPassword.8fdfba77.chunk.js +0 -1
  102. package/studio/build-local/static/js/roles-jsonviewer.c11f1816.chunk.js +0 -1
  103. package/studio/build-local/static/js/signIn.b11bdc50.chunk.js +0 -1
  104. package/studio/build-local/static/js/signUp.564d4e0b.chunk.js +0 -1
  105. package/studio/build-local/static/js/structure-reloader.b6de4091.chunk.js +0 -1
  106. package/studio/build-local/static/js/topnav.4fd41d60.chunk.js +0 -1
  107. package/studio/build-local/static/js/updatePassword.e23019c7.chunk.js +0 -1
  108. /package/studio/build-local/static/js/{723.c58acced.chunk.js.LICENSE.txt → 239.183c6cbc.chunk.js.LICENSE.txt} +0 -0
  109. /package/studio/build-local/static/js/{110.ca4244a6.chunk.js.LICENSE.txt → 43.73dc432d.chunk.js.LICENSE.txt} +0 -0
  110. /package/studio/build-local/static/js/{409.17daa4fe.chunk.js.LICENSE.txt → 591.7498da00.chunk.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[25],{8244:(e,s,a)=>{a.r(s),a.d(s,{default:()=>A});var t=a(7313),r=a(6782),l=a(5399),n=a(7387),o=a(9327),i=a(238),c=a(3516),d=a(4122),m=a(9842),u=a(6449),x=a(5447),h=a(511),j=a(9859);const p=1e9,Z=1073741824,f=async e=>{let{auth:s,url:a,signal:t,refresh:r,is_local:l,cachedSystemInfo:n,skip:o=[]}=e;const i=["network","disk","cpu","memory","system"],c=await(0,j.Z)({operation:{operation:"system_information",attributes:null!==o&&void 0!==o&&o.length?i.filter((e=>!o.includes(e))):i},auth:s,url:a,signal:t});if(c.error&&r)return x.Z.update((e=>{e.systemInfoError=!0}));if(c.error)return x.Z.update((e=>{e.systemInfo={totalMemory:"...",usedMemory:"...",freeMemory:"...",memoryStatus:"grey",totalDisk:"...",usedDisk:"...",freeDisk:"...",diskStatus:"grey",cpuInfo:"...",cpuCores:"...",cpuLoad:"...",cpuStatus:"grey",networkTransferred:"...",networkReceived:"...",networkLatency:"...",networkLatencyStatus:"grey"},e.systemInfoError=!0}));const d=o.includes("memory")?parseFloat(n.totalMemory):c.memory.total/Z,m=o.includes("memory")?parseFloat(n.usedMemory):c.memory.active/Z,u=o.includes("memory")?parseFloat(n.freeMemory):c.memory.available/Z,h=o.includes("memory")?n.memoryStatus:u/d<.1?"danger":u/d<.25?"warning":"success",f=o.includes("disk")?parseFloat(n.totalDisk):"darwin"===c.system.platform?c.disk.size[0].size/p:l?c.disk.size[0].size/Z:c.disk.size.find((e=>"/home/ubuntu/hdb"===e.mount)).size/Z,v=o.includes("disk")?parseFloat(n.usedDisk):"darwin"===c.system.platform?c.disk.size.reduce(((e,s)=>e+s.used),0)/p:l?c.disk.size.reduce(((e,s)=>e+s.used),0)/Z:c.disk.size.find((e=>"/home/ubuntu/hdb"===e.mount)).used/Z,w=o.includes("disk")?parseFloat(n.freeDisk):f-v,N=o.includes("disk")?n.diskStatus:w/f<.1?"danger":w/f<.25?"warning":"success",g=o.includes("cpu")?n.cpuInfo:`${c.cpu.manufacturer} ${c.cpu.brand}`,k=o.includes("cpu")?n.cpuCores:`${c.cpu.physicalCores} physical / ${c.cpu.cores} virtual`,y=o.includes("cpu")?parseFloat(n.cpuLoad):c.cpu.current_load.currentLoad||c.cpu.current_load.currentload||0,b=o.includes("cpu")?n.cpuStatus:y>90?"danger":y>75?"warning":"success",S=o.includes("network")?parseFloat(n.networkTransferred):c.network.stats.reduce(((e,s)=>e+s.tx_bytes),0)/p,_=o.includes("network")?parseFloat(n.networkReceived):c.network.stats.reduce(((e,s)=>e+s.rx_bytes),0)/p,D=o.includes("network")?parseFloat(n.networkLatency):c.network.latency.ms,C=o.includes("network")?parseFloat(n.networkLatencyStatus):D>1e3?"danger":D>500?"warning":"success",L={totalMemory:null===d||void 0===d?void 0:d.toFixed(2),usedMemory:null===m||void 0===m?void 0:m.toFixed(2),freeMemory:null===u||void 0===u?void 0:u.toFixed(2),memoryStatus:h,totalDisk:null===f||void 0===f?void 0:f.toFixed(2),usedDisk:null===v||void 0===v?void 0:v.toFixed(2),freeDisk:null===w||void 0===w?void 0:w.toFixed(2),diskStatus:N,cpuInfo:g,cpuCores:k,cpuLoad:null===y||void 0===y?void 0:y.toFixed(2),cpuStatus:b,networkTransferred:null===S||void 0===S?void 0:S.toFixed(2),networkReceived:null===_||void 0===_?void 0:_.toFixed(2),networkLatency:D,networkLatencyStatus:C};return x.Z.update((e=>{e.systemInfo=L}))};var v=a(2589),w=a(4220),N=a(2261),g=a(6417);let k;const y=function(){const e=(0,n.Kw)(x.Z,(e=>e.compute_stack_id)),s=(0,n.Kw)(x.Z,(e=>e.auth)),a=(0,n.Kw)(x.Z,(e=>e.url)),j=(0,n.Kw)(x.Z,(e=>e.systemInfo)),p=(0,n.Kw)(x.Z,(e=>e.is_local)),Z=(0,n.Kw)(x.Z,(e=>e.storage)),y=(0,n.Kw)(u.Z,(s=>{var a;return s.alarms&&(null===(a=s.alarms[e])||void 0===a?void 0:a.alarmCounts["Disk I/O"])}),[e]),[b,S]=(0,t.useState)(!1),[_,D]=(0,t.useState)(!0),[C,L]=(0,t.useState)(null);async function F(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?await f({auth:s,url:a,is_local:p,signal:k.signal,refresh:!!j,previousSystemInfo:j,skip:["disk","network"]}):await f({auth:s,url:a,is_local:p,signal:k.signal,refresh:!!j,previousSystemInfo:j})}return(0,t.useEffect)((()=>{let e=!0;return s&&(async()=>{D(!0),k=new AbortController,await F(!!C),e&&D(!1)})(),()=>{var s;null===(s=k)||void 0===s||s.abort(),e=!1}}),[s,C]),(0,d.Z)((()=>{s&&b&&L(Date.now())}),h.Z.refresh_content_interval),(0,g.jsxs)(m.SV,{onError:(e,s)=>(0,N.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:w.Z,children:[(0,g.jsxs)(r.Z,{className:"floating-card-header",children:[(0,g.jsx)(l.Z,{children:"host system"}),(0,g.jsxs)(l.Z,{className:"text-end",children:[(0,g.jsx)(o.Z,{color:"link",title:"Update Metrics",className:"me-2",onClick:async()=>{D(!0),await F(!1),D(!1)},children:(0,g.jsx)("i",{className:"fa "+(_?"fa-spinner fa-spin":"fa-sync-alt")})}),(0,g.jsxs)(o.Z,{color:"link",title:"Turn on autofresh",onClick:()=>S(!b),children:[(0,g.jsx)("span",{className:"me-2",children:"auto"}),(0,g.jsx)("i",{className:"fa fa-lg fa-toggle-"+(b?"on":"off")})]})]})]}),(0,g.jsx)(i.Z,{className:"my-3 instance-details",children:(0,g.jsx)(c.Z,{children:j||b?(0,g.jsxs)(r.Z,{children:[(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Total Memory",className:"mb-3",children:(0,g.jsxs)("div",{className:"nowrap-scroll",children:[(null===j||void 0===j?void 0:j.totalMemory)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Active Memory",className:"mb-3",children:(0,g.jsxs)("div",{className:"nowrap-scroll",children:[(null===j||void 0===j?void 0:j.usedMemory)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Available Memory",className:"mb-3",children:(0,g.jsxs)("div",{className:`nowrap-scroll text-${(null===j||void 0===j?void 0:j.memoryStatus)||"grey"}`,children:[(null===j||void 0===j?void 0:j.freeMemory)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Total Disk",className:"mb-3",children:(0,g.jsxs)("div",{className:"nowrap-scroll",children:[(null===j||void 0===j?void 0:j.totalDisk)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Used Disk",className:"mb-3",children:(0,g.jsxs)("div",{className:"nowrap-scroll",children:[(null===j||void 0===j?void 0:j.usedDisk)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Free Disk",className:"mb-3",children:(0,g.jsxs)("div",{className:`nowrap-scroll text-${(null===j||void 0===j?void 0:j.diskStatus)||"grey"}`,children:[(null===j||void 0===j?void 0:j.freeDisk)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"CPU Cores",className:"mb-3",children:(0,g.jsx)("div",{className:"nowrap-scroll",children:(null===j||void 0===j?void 0:j.cpuCores)||"..."})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"CPU Load",className:"mb-3",children:(0,g.jsxs)("div",{className:`nowrap-scroll text-${(null===j||void 0===j?void 0:j.cpuStatus)||"grey"}`,children:[(null===j||void 0===j?void 0:j.cpuLoad)||"...","%"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Network Volume Up",className:"mb-3",children:(0,g.jsxs)("div",{className:"nowrap-scroll",children:[(null===j||void 0===j?void 0:j.networkTransferred)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Network Volume Down",className:"mb-3",children:(0,g.jsxs)("div",{className:"nowrap-scroll",children:[(null===j||void 0===j?void 0:j.networkReceived)||"...","GB"]})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Network Latency",className:"mb-3",children:(0,g.jsx)("div",{className:`nowrap-scroll text-${(null===j||void 0===j?void 0:j.networkLatencyStatus)||"grey"}`,children:null!==j&&void 0!==j&&j.networkLatency?`${null===j||void 0===j?void 0:j.networkLatency} ms`:"N/A"})})}),(0,g.jsx)(l.Z,{md:"2",sm:"4",xs:"6",children:(0,g.jsx)(v.Z,{header:"Disk IOPS",className:"mb-3",children:(0,g.jsx)("div",{className:"nowrap-scroll text-"+(y?"danger":""),children:p?"HARDWARE LIMIT":(null===Z||void 0===Z?void 0:Z.iops)||"..."})})})]}):(0,g.jsx)("div",{className:"pt-5 text-center",children:(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-purple"})})})}),(0,g.jsx)("br",{})]})};var b=a(8467);const S=e=>"object"===typeof e&&!Array.isArray(e)&&null!==e;const _=function(e){let{level:s,timestamp:a,message:t,tags:n,thread:o}=e;return(0,g.jsx)("div",{className:"item-row",children:(0,g.jsxs)(r.Z,{children:[(0,g.jsx)(l.Z,{className:`text-nowrap ${null===s||void 0===s?void 0:s.toLowerCase()}`,children:(null===s||void 0===s?void 0:s.toUpperCase())||"UNKNOWN"}),(0,g.jsx)(l.Z,{className:"text-nowrap",children:new Date(a||null).toLocaleDateString()}),(0,g.jsx)(l.Z,{className:"text-nowrap",children:new Date(a||null).toLocaleTimeString()}),(0,g.jsx)(l.Z,{className:"text-nowrap",children:o}),(0,g.jsx)(l.Z,{className:"text-nowrap",children:null===n||void 0===n?void 0:n.join(", ")}),(0,g.jsx)(l.Z,{xs:"12",className:"mt-1",children:S(t)&&t.error?t.error:JSON.stringify(t).slice(1,-1)})]})})};let D;const C=function(){const{compute_stack_id:e}=(0,b.UO)(),s=(0,n.Kw)(x.Z,(e=>e.auth)),a=(0,n.Kw)(x.Z,(e=>e.url)),u=(0,n.Kw)(x.Z,(e=>e.logs),[e]),p=(0,n.Kw)(x.Z,(e=>e.logsError)),[Z,f]=(0,t.useState)(!1),[v,k]=(0,t.useState)(!0),[y,S]=(0,t.useState)(!0);return(0,t.useEffect)((()=>{let e=!0;return s&&(async()=>{k(!0),D=new AbortController,await(async e=>{let{auth:s,url:a,signal:t}=e;const r=await(0,j.Z)({operation:{operation:"read_log",limit:1e3,order:"desc"},auth:s,url:a,signal:t});return x.Z.update((e=>{e.logs=r.filter((e=>e.message)),e.logsError=!1}))})({auth:s,url:a,signal:D.signal,currentLogCount:(null===u||void 0===u?void 0:u.length)||0}),e&&k(!1)})(),()=>{var s;null===(s=D)||void 0===s||s.abort(),e=!1}}),[s,y]),(0,d.Z)((()=>s&&Z&&S(Date.now())),h.Z.refresh_content_interval),(0,g.jsxs)(m.SV,{onError:(e,s)=>(0,N.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:w.Z,children:[(0,g.jsxs)(r.Z,{className:"floating-card-header",children:[(0,g.jsx)(l.Z,{children:"logs"}),(0,g.jsxs)(l.Z,{className:"text-end",children:[(0,g.jsx)(o.Z,{color:"link",title:"Update Logs",className:"me-2",onClick:()=>S(Date.now()),children:(0,g.jsx)("i",{className:"fa "+(v?"fa-spinner fa-spin":"fa-sync-alt")})}),(0,g.jsxs)(o.Z,{color:"link",title:"Turn on autofresh",onClick:()=>f(!Z),children:[(0,g.jsx)("span",{className:"me-2",children:"auto"}),(0,g.jsx)("i",{className:"fa fa-lg fa-toggle-"+(Z?"on":"off")})]})]})]}),(0,g.jsx)(i.Z,{className:"my-3",children:(0,g.jsxs)(c.Z,{className:"item-list",children:[(0,g.jsxs)(r.Z,{xs:"5",className:"header",children:[(0,g.jsx)(l.Z,{className:"text-bold text-nowrap",children:"status"}),(0,g.jsx)(l.Z,{className:"text-bold text-nowrap",children:"date"}),(0,g.jsx)(l.Z,{className:"text-left text-bold text-nowrap",children:!v&&p?(0,g.jsxs)("span",{className:"text-danger",children:["log fetch error: ",(new Date).toLocaleTimeString().toLowerCase()]}):(0,g.jsx)("span",{children:"time"})}),(0,g.jsx)(l.Z,{className:"text-bold text-nowrap",children:"thread"}),(0,g.jsx)(l.Z,{className:"text-bold text-nowrap",children:"tags"})]}),(0,g.jsx)("hr",{className:"mt-1 mb-0"}),(0,g.jsx)("div",{className:"item-scroller",children:!v||u||Z?u&&u.length?u.map(((e,s)=>(0,g.jsx)(_,{...e},s))):u&&!u.length?(0,g.jsx)("div",{className:"pt-5 text-center",children:"no logs found"}):(0,g.jsx)("div",{className:"pt-5 text-center",children:"no logs found in this view"}):(0,g.jsx)("div",{className:"pt-5 text-center",children:(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-lightgrey"})})})]})}),(0,g.jsx)("br",{})]})};const L=function(e){let{end_datetime:s,start_datetime:a,status:t,message:n}=e;return(0,g.jsx)("div",{className:"item-row",children:(0,g.jsxs)(r.Z,{children:[(0,g.jsx)(l.Z,{xs:"3",className:`text-nowrap ${t.toLowerCase()}`,children:t}),(0,g.jsx)(l.Z,{xs:"3",className:"text-nowrap",children:new Date(a).toLocaleDateString()}),(0,g.jsx)(l.Z,{xs:"3",className:"text-nowrap",children:new Date(a).toLocaleTimeString()}),(0,g.jsx)(l.Z,{xs:"3",className:"text-nowrap",children:new Date(s).toLocaleTimeString()}),(0,g.jsx)(l.Z,{xs:"12",className:"mt-1",children:S(n)?JSON.stringify(n):n})]})})};let F;const K=function(){const e=(0,n.Kw)(x.Z,(e=>e.auth)),s=(0,n.Kw)(x.Z,(e=>e.url)),a=(0,n.Kw)(x.Z,(e=>e.jobs)),u=(0,n.Kw)(x.Z,(e=>e.jobsError)),[p,Z]=(0,t.useState)(!1),[f,v]=(0,t.useState)(!0),[k,y]=(0,t.useState)(!0);return(0,t.useEffect)((()=>{let t=!0;return e&&(async()=>{v(!0),F=new AbortController;const r=new Date;r.setDate(r.getDate()+1);const l=r.toISOString().split("T")[0];r.setFullYear(r.getFullYear()-1);const n=r.toISOString().split("T")[0];await(async e=>{let{auth:s,url:a,signal:t,from_date:r,to_date:l,currentJobCount:n}=e;const o=await(0,j.Z)({operation:{operation:"search_jobs_by_start_date",from_date:r,to_date:l},auth:s,url:a,signal:t});return o.error&&n?x.Z.update((e=>{e.jobsError=!0})):!Array.isArray(o)||o.error?x.Z.update((e=>{e.jobs=[],e.jobsError=!0})):x.Z.update((e=>{e.jobs=[...o].sort(((e,s)=>s.start_datetime-e.end_datetime)),e.jobsError=!1}))})({auth:e,url:s,signal:F.signal,currentJobCount:(null===a||void 0===a?void 0:a.length)||0,from_date:n,to_date:l}),t&&v(!1)})(),()=>{var e;null===(e=F)||void 0===e||e.abort(),t=!1}}),[e,k]),(0,d.Z)((()=>e&&p&&y(Date.now())),h.Z.refresh_content_interval),(0,g.jsxs)(m.SV,{onError:(e,s)=>(0,N.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:w.Z,children:[(0,g.jsxs)(r.Z,{className:"floating-card-header",children:[(0,g.jsx)(l.Z,{children:"jobs"}),(0,g.jsxs)(l.Z,{className:"text-end",children:[(0,g.jsx)(o.Z,{color:"link",title:"Update Jobs",className:"me-2",onClick:()=>y(Date.now()),children:(0,g.jsx)("i",{className:"fa "+(f?"fa-spinner fa-spin":"fa-sync-alt")})}),(0,g.jsxs)(o.Z,{color:"link",title:"Turn on autofresh",onClick:()=>Z(!p),children:[(0,g.jsx)("span",{className:"me-2",children:"auto"}),(0,g.jsx)("i",{className:"fa fa-lg fa-toggle-"+(p?"on":"off")})]})]})]}),(0,g.jsx)(i.Z,{className:"my-3",children:(0,g.jsxs)(c.Z,{className:"item-list",children:[(0,g.jsxs)(r.Z,{className:"header",children:[(0,g.jsx)(l.Z,{xs:"3",className:"text-bold text-nowrap",children:"status"}),(0,g.jsx)(l.Z,{xs:"3",className:"text-bold text-nowrap",children:"date"}),!f&&u?(0,g.jsx)(l.Z,{xs:"6",className:"text-end text-danger text-bold text-nowrap",children:(0,g.jsxs)("b",{children:["job fetch error: ",(new Date).toLocaleTimeString().toLowerCase()]})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.Z,{xs:"3",className:"text-bold text-nowrap",children:"start"}),(0,g.jsx)(l.Z,{xs:"3",className:"text-bold text-nowrap",children:"end"})]})]}),(0,g.jsx)("hr",{className:"mt-1 mb-0"}),(0,g.jsx)("div",{className:"item-scroller",children:!f||a||p?null!==a&&void 0!==a&&a.length?a.map((e=>(0,g.jsx)(L,{...e},e.id))):(0,g.jsx)("div",{className:"pt-5 text-center",children:"no jobs found"}):(0,g.jsx)("div",{className:"pt-5 text-center",children:(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-lightgrey"})})})]})}),(0,g.jsx)("br",{})]})};const T=function(e){let{date:s,type:a,message:t}=e;return(0,g.jsx)("div",{className:"item-row",children:(0,g.jsxs)(r.Z,{children:[(0,g.jsx)(l.Z,{xs:"3",className:"text-danger text-nowrap",children:a}),(0,g.jsx)(l.Z,{xs:"9",className:"text-nowrap",children:new Date(s).toLocaleString()}),(0,g.jsx)(l.Z,{xs:"12",className:"mt-1",children:S(t)?JSON.stringify(t):t})]})})};var E=a(8751);let I;const M=function(){const{customer_id:e}=(0,b.UO)(),s=(0,n.Kw)(x.Z,(e=>e.compute_stack_id)),a=(0,n.Kw)(u.Z,(e=>e.auth)),j=(0,n.Kw)(u.Z,(e=>{var a;return e.alarms&&(null===(a=e.alarms[s])||void 0===a?void 0:a.alarms)}),[s]),p=(0,n.Kw)(u.Z,(e=>e.alarmsError)),[Z,f]=(0,t.useState)(!1),[v,k]=(0,t.useState)(!1),[y,S]=(0,t.useState)(!0);return(0,t.useEffect)((()=>{let s=!0;return a&&(async()=>{k(!0),I=new AbortController,await(0,E.Z)({auth:a,signal:I.signal,customer_id:e,currentAlarmsLength:null===j||void 0===j?void 0:j.length}),s&&k(!1)})(),()=>{var e;null===(e=I)||void 0===e||e.abort(),s=!1}}),[a,y]),(0,d.Z)((()=>a&&Z&&S(Date.now())),h.Z.refresh_content_interval),(0,g.jsxs)(m.SV,{onError:(e,s)=>(0,N.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:w.Z,children:[(0,g.jsxs)(r.Z,{className:"floating-card-header",children:[(0,g.jsx)(l.Z,{children:"alarms"}),(0,g.jsxs)(l.Z,{className:"text-end",children:[(0,g.jsx)(o.Z,{color:"link",title:"Update Jobs",className:"me-2",onClick:()=>S(Date.now()),children:(0,g.jsx)("i",{className:"fa "+(v?"fa-spinner fa-spin":"fa-sync-alt")})}),(0,g.jsxs)(o.Z,{color:"link",title:"Turn on autofresh",onClick:()=>f(!Z),children:[(0,g.jsx)("span",{className:"me-2",children:"auto"}),(0,g.jsx)("i",{className:"fa fa-lg fa-toggle-"+(Z?"on":"off")})]})]})]}),(0,g.jsx)(i.Z,{className:"my-3",children:(0,g.jsxs)(c.Z,{className:"item-list",children:[(0,g.jsxs)(r.Z,{className:"header",children:[(0,g.jsx)(l.Z,{xs:"3",className:"text-bold text-nowrap",children:"status"}),(0,g.jsx)(l.Z,{xs:"3",className:"text-bold text-nowrap",children:"date"}),(0,g.jsx)(l.Z,{xs:"6",className:"text-end text-danger text-bold",children:!v&&p&&(0,g.jsxs)("span",{children:["alarms fetch error: ",(new Date).toLocaleTimeString().toLowerCase()]})})]}),(0,g.jsx)("hr",{className:"mt-1 mb-0"}),(0,g.jsx)("div",{className:"item-scroller",children:!v||j||Z?null!==j&&void 0!==j&&j.length?j.map((e=>(0,g.jsx)(T,{...e},e.id))):(0,g.jsx)("div",{className:"pt-5 text-center",children:"no alarms found"}):(0,g.jsx)("div",{className:"pt-5 text-center",children:(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-lightgrey"})})})]})}),(0,g.jsx)("br",{})]})};const A=function(){return(0,g.jsxs)(r.Z,{id:"config",children:[(0,g.jsx)(l.Z,{xs:"12",children:(0,g.jsx)(y,{})}),(0,g.jsx)(l.Z,{lg:"6",xs:"12",children:(0,g.jsx)(C,{})}),(0,g.jsx)(l.Z,{lg:"3",xs:"12",children:(0,g.jsx)(K,{})}),(0,g.jsx)(l.Z,{lg:"3",xs:"12",children:(0,g.jsx)(M,{})})]})}},2589:(e,s,a)=>{a.d(s,{Z:()=>r});a(7313);var t=a(6417);const r=function(e){let{children:s,header:a,subheader:r,maxHeight:l="auto",minHeight:n="auto",className:o}=e;return(0,t.jsxs)("div",{className:`content-container ${o}`,children:[(0,t.jsxs)("div",{className:"header-container",children:[(0,t.jsx)("span",{className:"header",children:a}),(0,t.jsx)("span",{className:"subheader",children:r})]}),(0,t.jsx)("div",{className:"auto"!==l?"scrollable":"",style:{maxHeight:l,minHeight:n},children:s})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[196],{8351:(e,a,s)=>{s.r(a),s.d(a,{default:()=>N});var t=s(7313),n=s(6782),r=s(5399),l=s(9327),i=s(238),o=s(3516),c=s(7387),d=s(8467),g=s(9842),u=s(5447),m=s(2066),h=s(4220),p=s(2261),x=s(6855),j=s(6417);const f={tableData:[],dataTableColumns:[],totalRecords:0,filtered:[],sorted:[{id:"username",desc:!1}],page:0,loading:!1,totalPages:1,pageSize:20,autoRefresh:!1,showFilter:!1,lastUpdate:!1};let v;const N=function(e){var a,s;let{lastUpdate:N,setLastUpdate:b}=e;const{customer_id:C}=(0,d.UO)(),Z=(0,d.s0)(),P=(0,c.Kw)(u.Z,(e=>e.compute_stack_id)),w=(0,c.Kw)(u.Z,(e=>e.auth)),S=(0,c.Kw)(u.Z,(e=>e.url)),[k,z]=(0,t.useState)(f),[F,y]=(0,t.useState)(!0),R=null===(a=k.sorted[0])||void 0===a?void 0:a.id,O=null===(s=k.sorted[0])||void 0===s?void 0:s.desc,$=(0,t.useCallback)((e=>{Z(`/o/${C}/i/${P}/users/${e}`)}),[P,C]);return(0,t.useEffect)((()=>{let e=!0;return w&&(async()=>{y(!0),v=new AbortController;const a=await(0,m.Z)({auth:w,url:S,signal:v.signal});e&&(y(!1),z({...k,tableData:a,dataTableColumns:[{Header:"username",accessor:"username"},{Header:"role",accessor:"role"}],totalPages:Math.ceil((a.length||k.pageSize)/k.pageSize),loading:!1}))})(),()=>{var a;e=!1,null===(a=v)||void 0===a||a.abort()}}),[w,N,k.pageSize]),(0,t.useEffect)((()=>{let e=!0;if(k.tableData.length&&R){const a=[...[...k.tableData]].sort(((e,a)=>e[R]>a[R]&&O?1:e[R]>a[R]||O?-1:1));e&&z({...k,tableData:a})}return()=>{var a;e=!1,null===(a=v)||void 0===a||a.abort()}}),[R,O]),(0,j.jsxs)(g.SV,{onError:(e,a)=>(0,p.Z)({error:{message:e.message,componentStack:a}}),FallbackComponent:h.Z,children:[(0,j.jsxs)(n.Z,{className:"floating-card-header",children:[(0,j.jsx)(r.Z,{children:"existing users"}),(0,j.jsxs)(r.Z,{className:"text-end",children:[(0,j.jsx)(l.Z,{color:"link",onClick:()=>b(Date.now()),className:"me-2",children:(0,j.jsx)("i",{title:"Refresh Structure",className:"fa "+(F?"fa-spinner fa-spin":"fa-sync-alt")})}),(0,j.jsx)("span",{className:"mx-3 text",children:"|"}),(0,j.jsx)(l.Z,{color:"link",title:"Filter Users",className:"me-2",onClick:()=>z({...k,filtered:k.showFilter?[]:k.filtered,showFilter:!k.showFilter}),children:(0,j.jsx)("i",{className:"fa fa-search"})})]})]}),(0,j.jsx)(i.Z,{className:"mt-3",children:(0,j.jsx)(o.Z,{className:"react-table-holder",children:(0,j.jsx)(x.Z,{columns:k.dataTableColumns,data:k.tableData,currentPage:k.page,pageSize:k.pageSize,totalPages:k.totalPages,showFilter:k.showFilter,sorted:k.sorted,loading:F,onFilteredChange:e=>z({...k,filtered:e}),onSortedChange:e=>z({...k,sorted:e}),onPageChange:e=>z({...k,pageSize:e}),onPageSizeChange:e=>z({...k,page:0,pageSize:e}),onRowClick:e=>$(e.username)})})})]})}},6855:(e,a,s)=>{s.d(a,{Z:()=>N});var t=s(7313),n=s(5110),r=s(1781),l=s(9842),i=s(6782),o=s(5399),c=s(6417);const d=e=>{let{headerGroups:a,onSortedChange:s,sorted:t,showFilter:n}=e;return a.map((e=>(0,c.jsxs)("div",{...e.getHeaderGroupProps(),children:[(0,c.jsx)(i.Z,{className:"header g-0",children:e.headers.map((e=>{var a,n;return(0,c.jsx)(o.Z,{onClick:()=>{var a,n;return s([{id:e.id,desc:(null===(a=t[0])||void 0===a?void 0:a.id)===e.id&&!(null!==(n=t[0])&&void 0!==n&&n.desc)}])},className:`${(null===(a=t[0])||void 0===a?void 0:a.id)===e.id?"sorted":""} ${null!==(n=t[0])&&void 0!==n&&n.desc?"desc":"asc"} ${-1!==e.id.indexOf("hdb-narrow")?"action":""} px-1`,children:(0,c.jsx)("div",{className:"text-renderer",children:e.render("Header")})},e.id)}))}),n&&(0,c.jsx)(i.Z,{className:"filter g-0",children:e.headers.map((e=>(0,c.jsx)(o.Z,{className:-1!==e.id.indexOf("hdb-narrow")?"action":"",children:e.render("Filter")},e.id)))})]})))};var g=s(9327);const u=function(e){let{page:a,pageSize:s,totalPages:t,onPageChange:n,onPageSizeChange:l,loading:d}=e;return(0,c.jsxs)(i.Z,{className:"pagination",children:[(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"previous",children:(0,c.jsx)(g.Z,{className:"mb-2 btn-pagination",color:"purple",block:!0,onClick:()=>n(a-1),disabled:!t||0===a,children:(0,c.jsx)("i",{className:"fa fa-chevron-left"})})}),(0,c.jsxs)(o.Z,{xs:"12",sm:"4",className:"paginator",children:[(0,c.jsx)("i",{className:"fa fa-book me-2"}),(0,c.jsx)(r.Z,{className:"mb-2",type:"number",value:a+1,min:1,max:t,onChange:e=>n(e.target.value-1)}),(0,c.jsxs)("div",{className:"page-count",children:["\xa0/\xa0",d?(0,c.jsx)("i",{className:"fa fa-spinner fa-spin"}):t]})]}),(0,c.jsx)(o.Z,{xs:"12",sm:"4",className:"page-size",children:(0,c.jsx)(r.Z,{className:"mb-2",type:"select",value:s,onChange:e=>l(e.target.value),children:[20,50,100,250].map((e=>(0,c.jsxs)("option",{value:e,children:[e," rows"]},e)))})}),(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"next",children:(0,c.jsx)(g.Z,{className:"mb-2 pull-right btn-pagination",block:!0,color:"purple",onClick:()=>n(a+1),disabled:!t||a+1===t,children:(0,c.jsx)("i",{className:"fa fa-chevron-right"})})})]})};const m=function(e){let{previousPage:a,canPreviousPage:s,pageIndex:t,gotoPage:n,setPageSize:l,pageCount:d,nextPage:u,canNextPage:m,loading:h}=e;return(0,c.jsxs)(i.Z,{className:"pagination",children:[(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"previous",children:(0,c.jsx)(g.Z,{className:"mb-2 btn-pagination",color:"purple",block:!0,onClick:a,disabled:!d||!s,children:(0,c.jsx)("i",{className:"fa fa-chevron-left"})})}),(0,c.jsxs)(o.Z,{xs:"12",sm:"4",className:"paginator",children:[(0,c.jsx)("i",{className:"fa fa-book me-2"}),(0,c.jsx)(r.Z,{className:"mb-2",type:"number",value:t+1||1,min:1,max:d,onChange:e=>n(e.target.value?Number(e.target.value)-1:0)}),(0,c.jsxs)("div",{className:"page-count",children:["\xa0/\xa0",h?(0,c.jsx)("i",{className:"fa fa-spinner fa-spin"}):d]})]}),(0,c.jsx)(o.Z,{xs:"12",sm:"4",className:"page-size",children:(0,c.jsx)(r.Z,{className:"mb-2",type:"select",onChange:e=>{n(0),setTimeout((()=>l(e.target.value)),1e3)},children:[20,50,100,250].map((e=>(0,c.jsxs)("option",{value:e,children:[e," rows"]},e)))})}),(0,c.jsx)(o.Z,{xs:"12",sm:"2",className:"next",children:(0,c.jsx)(g.Z,{className:"mb-2 pull-right btn-pagination",block:!0,color:"purple",onClick:u,disabled:!d||!m,children:(0,c.jsx)("i",{className:"fa fa-chevron-right"})})})]})};const h=function(e){let{prepareRow:a,row:s,onRowClick:t=!1}=e;return a(s),(0,c.jsx)(i.Z,{onClick:()=>t&&t(s.original),className:"g-0",children:s.cells.map((e=>(0,c.jsx)(o.Z,{className:-1!==e.column.id.indexOf("hdb-narrow")?"action":"",children:e.render("Cell")},`${e.row.id}-${e.column.id}`)))})};var p=s(2261),x=s(4220);function j(e){let{value:a}=e;return(0,c.jsx)("div",{className:"text-renderer",children:a})}function f(e){let{src:a}=e;const[s,n]=(0,t.useState)(!1),[r,l]=(0,t.useState)(!1);return(0,c.jsxs)("div",{className:"image-renderer",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[(0,c.jsx)("i",{className:"fa fa-image"}),s&&r?(0,c.jsxs)("div",{className:"preview-image no-image",children:[(0,c.jsx)("i",{className:"fa fa-ban text-danger"}),(0,c.jsx)("div",{className:"mt-2",children:"image failed to load"})]}):s?(0,c.jsx)("img",{onError:l,alt:a,src:a,className:"preview-image"}):null]})}const v={Filter:e=>{let{column:{filterValue:a,setFilter:s}}=e;return(0,c.jsx)(r.Z,{type:"text",value:a||"",onChange:e=>s(e.target.value||void 0)})},Cell:e=>{let{value:a}=e;return(e=>{switch(Object.prototype.toString.call(e)){case"[object Array]":case"[object Object]":return(0,c.jsx)(j,{value:JSON.stringify(e)});case"[object Boolean]":return(0,c.jsx)(j,{value:e?"true":"false"});case"[object String]":return(a=e)&&(a.match(/^https?.*\.(jpeg|jpg|gif|png)$/)||-1!==a.indexOf("data:image"))?(0,c.jsx)(f,{src:e}):(0,c.jsx)(j,{value:e});default:return(0,c.jsx)(j,{value:e})}var a})(a)}};const N=function(e){let{columns:a,data:s,currentPage:r,pageSize:i,totalPages:o,onFilteredChange:g,onSortedChange:j,onPageChange:f,onPageSizeChange:N,showFilter:b,onRowClick:C,sorted:Z,loading:P,manual:w=!1}=e;const{headerGroups:S,page:k,rows:z,prepareRow:F,state:y,setAllFilters:R,canPreviousPage:O,canNextPage:$,pageOptions:E,pageCount:D,gotoPage:T,nextPage:_,previousPage:A,setPageSize:U}=(0,n.useTable)({columns:a,data:s,defaultColumn:v,onFilteredChange:g,onSortedChange:j,onPageChange:f,onPageSizeChange:N,onRowClick:C,manualPagination:w,manualFilters:w,initialState:{pageIndex:r,pageSize:i}},n.useFilters,n.usePagination),[G,H]=(0,t.useState)(!0),I=w||!k.length?z:k;return(0,t.useEffect)((()=>{!b&&y.filters.length?R([]):g(y.filters)}),[y.filters,b]),(0,t.useEffect)((()=>{setTimeout((()=>H(!1)),100)}),[null===I||void 0===I?void 0:I.length]),(0,c.jsxs)(l.SV,{onError:(e,a)=>(0,p.Z)({error:{message:e.message,componentStack:a}}),FallbackComponent:x.Z,children:[(0,c.jsxs)("div",{className:"react-table-scroller",children:[(0,c.jsx)(d,{headerGroups:S,onSortedChange:j,sorted:Z,showFilter:b}),P||G?(0,c.jsx)("div",{className:"centered text-center",children:(0,c.jsx)("i",{className:"fa fa-spinner fa-spin"})}):I.length?I.map((e=>(0,c.jsx)(h,{row:e,prepareRow:F,onRowClick:C},e.id))):(0,c.jsxs)("div",{className:"centered text-center",children:[(0,c.jsx)("i",{className:"fa fa-exclamation-triangle text-danger"}),(0,c.jsx)("div",{className:"mt-2 text-darkgrey",children:"no records"})]})]}),w?(0,c.jsx)(u,{page:r,pageSize:i,totalPages:o,onPageChange:f,onPageSizeChange:N,loading:P}):(0,c.jsx)(m,{previousPage:A,pageSize:i,canPreviousPage:O,pageIndex:y.pageIndex,pageOptions:E,gotoPage:T,setPageSize:U,pageCount:D,nextPage:_,canNextPage:$,loading:P})]})}},2066:(e,a,s)=>{s.d(a,{Z:()=>r});var t=s(9859),n=s(5447);const r=async e=>{let{auth:a,url:s,signal:r}=e;const l=await(0,t.Z)({operation:{operation:"list_users"},auth:a,url:s,signal:r}),i=Array.isArray(l)?[...l].map((e=>({username:e.username,role:e.role.role}))).sort(((e,a)=>e.username.toLowerCase()>a.username.toLowerCase()?1:-1)):[];return n.Z.update((e=>{e.users=i})),i}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[40],{7211:(e,s,r)=>{r.r(s),r.d(s,{default:()=>U});var a=r(7313),t=r(8467),l=r(238),n=r(3516),o=r(6782),c=r(5399),u=r(9327),i=r(1781),d=r(7387),m=r(6160),h=r(9842),x=r(9859);const p=async e=>{let{auth:s,url:r,username:a,password:t,role:l}=e;return(0,x.Z)({operation:{operation:"alter_user",role:l,username:a,password:t,active:!0},auth:s,url:r})};var Z=r(5447),j=r(4220),w=r(2261),b=r(2066),g=r(6417);const f=function(){const{username:e}=(0,t.UO)(),[s,r]=(0,a.useState)({}),[l,n]=(0,a.useState)({}),x=(0,m.VY)(),f=(0,d.Kw)(Z.Z,(e=>e.auth)),v=(0,d.Kw)(Z.Z,(e=>e.url));return(0,g.jsx)(h.SV,{onError:(e,s)=>(0,w.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:j.Z,children:(0,g.jsxs)(o.Z,{children:[(0,g.jsxs)(c.Z,{xs:"4",className:"py-1",children:["Change user password",(0,g.jsx)("br",{}),(0,g.jsx)("span",{className:"text-small",children:"Modify user's access credentials"})]}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(i.Z,{id:"password",type:"text",className:"text-center",name:"password",placeholder:"enter new password",value:l.password||"",onChange:e=>n({...l,password:e.target.value})})}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(u.Z,{block:!0,color:"success",onClick:async()=>{const{password:s}=l;if(s){r({submitted:!0});const a=await p({auth:f,url:v,username:e,password:s});n({}),-1!==a.message.indexOf("updated")?(x.success("password updated"),(0,b.Z)({auth:f,url:v}),r({})):(x.error(a.message),r({}))}else r({error:"password is required"})},disabled:s.submitted||!l.password,children:"Update Password"})})]})})};var v=r(8212),y=r(3672),C=r.n(y);const k=function(){const{username:e}=(0,t.UO)(),[s,r]=(0,a.useState)({}),[l,n]=(0,a.useState)({}),i=(0,m.VY)(),x=(0,d.Kw)(Z.Z,(e=>e.auth)),f=(0,d.Kw)(Z.Z,(e=>e.url)),y=(0,d.Kw)(Z.Z,(e=>{var s;return parseFloat(null===(s=e.registration)||void 0===s?void 0:s.version)<3})),k=(0,d.Kw)(Z.Z,(e=>e.roles.map((e=>({label:e.role,value:y?e.id:e.role}))))),N=(0,d.Kw)(Z.Z,(s=>s.users&&s.users.find((s=>s.username===e))));return C()((()=>{var e;return n({...l,newRole:null===N||void 0===N||null===(e=N.role)||void 0===e?void 0:e.id})}),[]),(0,g.jsx)(h.SV,{onError:(e,s)=>(0,w.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:j.Z,children:(0,g.jsxs)(o.Z,{children:[(0,g.jsxs)(c.Z,{xs:"4",className:"py-1",children:["Change user role",(0,g.jsx)("br",{}),(0,g.jsx)("span",{className:"text-small",children:"Change what this user can do"})]}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(v.ZP,{className:"react-select-container",classNamePrefix:"react-select",onChange:e=>{let{value:s}=e;return n({...l,newRole:s})},options:k.filter((e=>e.value!==N.role.id)),value:k.find((e=>e.value===l.newRole)),isSearchable:!1,isClearable:!1,isLoading:!k,placeholder:"select a role",styles:{placeholder:e=>({...e,textAlign:"center",width:"100%",color:"#BCBCBC"})}})}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(u.Z,{id:"updateRole",block:!0,color:"success",onClick:async()=>{const{newRole:s}=l;if(s)if(N.role.id===s)r({error:"user already has this role"});else{r({submitted:!0});const a=await p({auth:x,url:f,username:e,role:s});-1!==a.message.indexOf("updated")?(i.success("user role updated"),(0,b.Z)({auth:x,url:f}),r({})):(i.error(a.message),r({}))}else r({error:"role is required"})},disabled:l.newRole===N.role.id||"submitted"===s,children:"Update Role"})})]})})};var N=r(8525);const S=function(){const{username:e}=(0,t.UO)(),{pathname:s}=(0,t.TH)(),r=(0,t.s0)(),[l,n]=(0,a.useState)({}),[x,p]=(0,a.useState)({}),f=(0,m.VY)(),v=(0,d.Kw)(Z.Z,(e=>e.auth)),y=(0,d.Kw)(Z.Z,(e=>e.url));return(0,g.jsx)(h.SV,{onError:(e,s)=>(0,w.Z)({error:{message:e.message,componentStack:s}}),FallbackComponent:j.Z,children:(0,g.jsxs)(o.Z,{children:[(0,g.jsxs)(c.Z,{xs:"4",className:"py-1",children:["Delete User",(0,g.jsx)("br",{}),(0,g.jsx)("span",{className:"text-small",children:"user will be removed from this instance"})]}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(i.Z,{id:"delete_username",onChange:e=>n({delete_username:e.target.value}),type:"text",className:"text-center",title:"confirm username to delete",placeholder:`Enter "${e}" here to enable deletion.`,value:l.delete_username||""})}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(u.Z,{id:"deleteUser",block:!0,color:"success",onClick:async()=>{if(l.delete_username!==e)f.error("Please type the username to delete this user");else{p({submitted:!0});const a=await(0,N.Z)({auth:v,username:e,url:y});-1!==a.message.indexOf("successfully")?(f.success(a.message),(0,b.Z)({auth:v,url:y}),p({}),setTimeout((()=>r(s.replace(`/users/${e}`,"/users"))),0)):(f.error(a.message),p({}))}},disabled:e!==l.delete_username||x.submitted,children:x.submitted?(0,g.jsx)("i",{className:"fa fa-spinner fa-spin text-white"}):(0,g.jsx)("span",{children:"Delete User"})})})]})})};const U=function(){const{username:e}=(0,t.UO)(),{pathname:s}=(0,t.TH)(),r=(0,t.s0)();return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"floating-card-header",children:["existing users > edit > ",(0,g.jsx)("b",{children:e})]}),(0,g.jsx)(l.Z,{className:"my-3",children:(0,g.jsxs)(n.Z,{children:[(0,g.jsx)(f,{}),(0,g.jsx)("hr",{className:"my-3"}),(0,g.jsx)(k,{}),(0,g.jsx)("hr",{className:"my-3"}),(0,g.jsx)(S,{}),(0,g.jsx)("hr",{className:"my-3"}),(0,g.jsxs)(o.Z,{children:[(0,g.jsx)(c.Z,{xs:"8",className:"py-1"}),(0,g.jsx)(c.Z,{xs:"4",children:(0,g.jsx)(u.Z,{id:"returnToUserList",block:!0,color:"grey",onClick:()=>r(s.replace(`/${e}`,"")),children:"Return to User List"})})]})]})})]})}},8525:(e,s,r)=>{r.d(s,{Z:()=>t});var a=r(9859);const t=async e=>{let{auth:s,username:r,url:t}=e;return(0,a.Z)({operation:{operation:"drop_user",username:r},auth:s,url:t})}},2066:(e,s,r)=>{r.d(s,{Z:()=>l});var a=r(9859),t=r(5447);const l=async e=>{let{auth:s,url:r,signal:l}=e;const n=await(0,a.Z)({operation:{operation:"list_users"},auth:s,url:r,signal:l}),o=Array.isArray(n)?[...n].map((e=>({username:e.username,role:e.role.role}))).sort(((e,s)=>e.username.toLowerCase()>s.username.toLowerCase()?1:-1)):[];return t.Z.update((e=>{e.users=o})),o}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[759],{6578:(e,t,r)=>{r.r(t),r.d(t,{default:()=>C});var s=r(7313),n=r(6782),a=r(5399),o=r(8467),i=r(238),c=r(3516),l=r(1781),u=r(9327),d=r(8212),f=r(3672),p=r.n(f),h=r(7387),m=r(9842),y=r(5447),b=r(9481),v=r(1891),g=r(3517),x=r(4220),j=r(2261),w=r(5200),O=r(6417);const Z=function(e){let{setLastUpdate:t}=e;const r=(0,h.Kw)(y.Z,(e=>e.auth)),n=(0,h.Kw)(y.Z,(e=>e.url)),a=(0,h.Kw)(y.Z,(e=>e.users)),o=(0,h.Kw)(y.Z,(e=>e.roles)),f=(0,h.Kw)(y.Z,(e=>{var t;return parseFloat(null===(t=e.registration)||void 0===t?void 0:t.version)<3})),[Z,N]=(0,s.useState)({}),[S,k]=(0,s.useState)({}),C="224px";return p()((async()=>{const{submitted:e}=Z;if(e){const{username:e,password:s,role:o}=S;if(e&&o&&s)if((0,g.Z)(e))if(a.find((t=>t.username.toLowerCase()===e.toLowerCase())))N({error:"User already exists"});else{N({processing:!0});const a=await(0,b.Z)({auth:r,role:o,username:e,password:s,url:n});-1!==a.message.indexOf("successfully")?(t(Date.now()),N({success:a.message})):N({error:a.message})}else N({error:"usernames must have only letters, numbers, hyphens, and underscores"}),setTimeout((()=>N({})),2e3);else N({error:"All fields must be filled out"});setTimeout((()=>k({})),2e3)}}),[Z]),p()((()=>{N({})}),[S]),p()((()=>o&&k({...S,role:!1})),[o]),(0,s.useEffect)((()=>{(0,w.Z)({auth:r,url:n})}),[r,n]),(0,O.jsxs)(m.SV,{onError:(e,t)=>(0,j.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:x.Z,children:[(0,O.jsx)("span",{className:"floating-card-header",children:"add user"}),Z.processing?(0,O.jsx)(v.Z,{className:"my-3",height:C,status:"processing",header:"Adding User",subhead:"The Account Airedale Is A Good Boy"}):Z.success?(0,O.jsx)(v.Z,{className:"my-3",height:C,status:"success",header:"Success!",subhead:Z.success}):Z.error?(0,O.jsx)(v.Z,{className:"my-3",height:C,status:"error",header:Z.error,subhead:"Please try again"}):(0,O.jsx)(i.Z,{className:"my-3",children:(0,O.jsxs)(c.Z,{children:[(0,O.jsx)(l.Z,{id:"username",type:"text",className:"mb-2 text-center",name:"username",placeholder:"username",value:S.username||"",onChange:e=>k({...S,username:e.target.value})}),(0,O.jsx)(l.Z,{id:"password",type:"text",className:"mb-2 text-center",name:"password",placeholder:"password",value:S.password||"",onChange:e=>k({...S,password:e.target.value})}),(0,O.jsx)(d.ZP,{className:"react-select-container",classNamePrefix:"react-select",onChange:e=>{let{value:t}=e;return k({...S,role:t})},options:o&&o.map((e=>({label:e.role,value:f?e.id:e.role}))),value:o&&S.role&&o.find((e=>e.value===S.role)),isSearchable:!1,isClearable:!1,isLoading:!o,placeholder:"select a role",styles:{placeholder:e=>({...e,textAlign:"center",width:"100%",color:"#BCBCBC"})}}),(0,O.jsx)(u.Z,{id:"addInstanceUser",color:"success",className:"mt-3",block:!0,onClick:()=>N({submitted:!0}),children:"Add User"})]})})]})};var N=r(7377);const S=(0,s.lazy)((()=>Promise.all([r.e(110),r.e(196)]).then(r.bind(r,8351)))),k=(0,s.lazy)((()=>r.e(40).then(r.bind(r,7211))));const C=function(){const{username:e}=(0,o.UO)(),[t,r]=(0,s.useState)(!0);return(0,O.jsxs)(n.Z,{children:[(0,O.jsx)(a.Z,{xl:"3",lg:"4",md:"5",xs:"12",children:(0,O.jsx)(Z,{setLastUpdate:r})}),(0,O.jsx)(a.Z,{xl:"9",lg:"8",md:"7",xs:"12",className:"pb-5",children:(0,O.jsx)(s.Suspense,{fallback:(0,O.jsx)(N.Z,{header:" ",spinner:!0}),children:e?(0,O.jsx)(k,{}):(0,O.jsx)(S,{lastUpdate:t,setLastUpdate:r})})})]})}},1891:(e,t,r)=>{r.d(t,{Z:()=>o});r(7313);var s=r(238),n=r(3516),a=r(6417);const o=function(e){let{header:t,subhead:r=" ",height:o,status:i,className:c}=e;return(0,a.jsx)(s.Z,{className:`form-status ${c}`,children:(0,a.jsxs)(n.Z,{className:"text-center",style:{height:o},children:[(0,a.jsx)("div",{className:"text-bold",children:t}),(0,a.jsx)("div",{className:"py-4",children:(0,a.jsx)("i",{className:"fa fa-lg "+("processing"===i?"fa-spinner fa-spin text-purple":"success"===i?"fa-check-circle text-purple":"fa-exclamation-triangle text-danger")})}),(0,a.jsx)("div",{className:"text-grey",children:r})]})})}},9481:(e,t,r)=>{r.d(t,{Z:()=>n});var s=r(9859);const n=async e=>{let{auth:t,role:r,username:n,password:a,url:o}=e;return(0,s.Z)({operation:{operation:"add_user",role:r,username:n,password:a,active:!0},auth:t,url:o})}},5200:(e,t,r)=>{r.d(t,{Z:()=>a});var s=r(9859),n=r(5447);const a=async e=>{let{auth:t,url:r}=e;const a=await(0,s.Z)({operation:{operation:"list_roles"},auth:t,url:r}),o=[...Array.isArray(a)?a:[]].sort(((e,t)=>e.role.toLowerCase()>t.role.toLowerCase()?1:-1));return n.Z.update((e=>{e.roles=o})),o}},3517:(e,t,r)=>{r.d(t,{Z:()=>s});const s=e=>e.match(/^[-a-zA-Z0-9_]+$/)},1781:(e,t,r)=>{r.d(t,{Z:()=>x});var s=r(7313),n=r(5192),a=r.n(n),o=r(6123),i=r.n(o),c=r(986);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},d.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,s,n=function(e,t){if(null==e)return{};var r,s,n={},a=Object.keys(e);for(s=0;s<a.length;s++)r=a[s],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function m(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,s=b(e);if(t){var n=b(this).constructor;r=Reflect.construct(s,arguments,n)}else r=s.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,r)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var v={children:a().node,type:a().string,size:a().oneOfType([a().number,a().string]),bsSize:a().string,valid:a().bool,invalid:a().bool,tag:c.iC,innerRef:a().oneOfType([a().object,a().func,a().string]),plaintext:a().bool,addon:a().bool,className:a().string,cssModule:a().object},g=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(o,e);var t,r,n,a=m(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=a.call(this,e)).getRef=t.getRef.bind(y(t)),t.focus=t.focus.bind(y(t)),t}return t=o,(r=[{key:"getRef",value:function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e}},{key:"focus",value:function(){this.ref&&this.ref.focus()}},{key:"render",value:function(){var e=this.props,t=e.className,r=e.cssModule,n=e.type,a=void 0===n?"text":n,o=e.bsSize,l=e.valid,p=e.invalid,h=e.tag,m=e.addon,y=e.plaintext,b=e.innerRef,v=f(e,u),g=["switch","radio","checkbox"].indexOf(a)>-1,x="select"===a,j="range"===a,w=h||(x||"textarea"===a?a:"input"),O="form-control";y?(O="".concat(O,"-plaintext"),w=h||"input"):j?O="form-range":x?O="form-select":g&&(O=m?null:"form-check-input"),v.size&&/\D/g.test(v.size)&&((0,c.O4)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),o=v.size,delete v.size);var Z=(0,c.mx)(i()(t,p&&"is-invalid",l&&"is-valid",!!o&&(x?"form-select-".concat(o):"form-control-".concat(o)),O),r);return("input"===w||h&&"function"===typeof h)&&(v.type="switch"===a?"checkbox":a),v.children&&!y&&"select"!==a&&"string"===typeof w&&"select"!==w&&((0,c.O4)('Input with a type of "'.concat(a,'" cannot have children. Please use "value"/"defaultValue" instead.')),delete v.children),s.createElement(w,d({},v,{ref:b,className:Z,"aria-invalid":p}))}}])&&p(t.prototype,r),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(s.Component);g.propTypes=v;const x=g}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkharperdb_studio=self.webpackChunkharperdb_studio||[]).push([[896],{5920:(e,t,s)=>{s.r(t),s.d(t,{default:()=>de});var a=s(7313),r=s(8467),n=s(7387),i=s(6160),o=s(3672),l=s.n(o),u=s(4122),c=s(6449),d=s(5447),p=s(2190),m=s(5708),h=s(2742),v=s(1613),_=s(8212),b=s(2135),g=s(9842),f=s(4220),Z=s(2261),y=s(511),j=s(6417);const x=function(e){let{routes:t=[]}=e;const{compute_stack_id:s,customer_id:a}=(0,r.UO)(),[i]=(0,p.Z)({}),o=(0,r.s0)(),l=(0,r.TH)(),u=(0,n.Kw)(d.Z,(e=>e.defaultBrowseURL)),x=(0,n.Kw)(c.Z,(e=>{var t;return e.alarms&&(null===(t=e.alarms[s])||void 0===t?void 0:t.alarmCounts.total)}),[s]),{options:w,activeOption:k}=(0,n.Kw)(c.Z,(e=>{const t=e.instances&&e.instances.find((e=>e.compute_stack_id===s)),a=e.instances&&e.instances.filter((e=>e.compute_stack_id!==s));return{options:a&&a.map((e=>({label:(0,j.jsxs)("span",{children:[(0,j.jsx)("i",{className:`d-none d-sm-inline-block fa me-2 fa-${e.is_local?"server":["CREATE_IN_PROGRESS","UPDATE_IN_PROGRESS","CONFIGURING_NETWORK"].includes(e.status)?"circle-exclamation":"cloud"} ${["CREATE_IN_PROGRESS","UPDATE_IN_PROGRESS","CONFIGURING_NETWORK"].includes(e.status)&&"opacity-25"}`}),e.instance_name," ",["CREATE_IN_PROGRESS","UPDATE_IN_PROGRESS","CONFIGURING_NETWORK"].includes(e.status)&&`(${e.status.replace(/_/g," ").toLowerCase()})`]}),value:e.compute_stack_id,has_auth:i[e.compute_stack_id],is_unavailable:["CREATE_IN_PROGRESS","UPDATE_IN_PROGRESS","CONFIGURING_NETWORK"].includes(e.status)}))),activeOption:{label:(0,j.jsxs)("span",{children:[(0,j.jsx)("i",{className:"d-none d-sm-inline-block fa me-2 fa-"+(t?null!==t&&void 0!==t&&t.is_local?"server":"cloud":"")}),null===t||void 0===t?void 0:t.instance_name]}),value:s}}}),[s]),$=`/o/${a}/i/${s}`,N=l.pathname.split(`/i/${s}`)[1].split("/")[1],S=null===t||void 0===t?void 0:t.find((e=>e.link===N));return(0,j.jsx)(g.SV,{onError:(e,t)=>(0,Z.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:f.Z,children:(0,j.jsxs)(m.Z,{className:"app-subnav",children:[!y.Z.is_local_studio&&(0,j.jsx)(h.Z,{navbar:!0,className:"instance-select",children:(0,j.jsx)(_.ZP,{className:"react-select-container",classNamePrefix:"react-select",onChange:e=>{let{value:t,has_auth:s,is_unavailable:r}=e;return!r&&o(s?`/o/${a}/i/${t}/${null===S||void 0===S?void 0:S.link}`:`/o/${a}/instances/login`)},options:w||[],value:k,defaultValue:k.value,isSearchable:!1,isClearable:!1,isLoading:!w,noOptionsMessage:()=>"No other instances available"})}),(0,j.jsx)(h.Z,{navbar:!0,className:"instance-nav d-none d-lg-flex",children:null===t||void 0===t?void 0:t.map((e=>(0,j.jsx)(v.Z,{children:(0,j.jsxs)(b.OL,{title:e.link,className:"nav-link",to:`${$}/${"browse"===e.link&&u?`${e.link}/${u}`:e.link}`,children:[(0,j.jsx)("i",{className:`d-none d-sm-inline-block fa me-2 fa-${e.icon}`}),e.label||e.link,!!x&&"status"===e.link&&(0,j.jsx)("span",{className:"badge",children:x})]})},e.path)))}),(0,j.jsx)(h.Z,{navbar:!0,className:"instance-nav-select d-flex d-lg-none",children:(0,j.jsx)(_.ZP,{className:"react-select-container",classNamePrefix:"react-select",width:"200px",onChange:e=>{let{value:t}=e;return o(`${$}/${t}`)},options:null===t||void 0===t?void 0:t.map((e=>({label:(0,j.jsxs)("span",{children:[(0,j.jsx)("i",{className:`d-none d-sm-inline-block fa me-2 fa-${e.icon}`}),e.label]}),value:e.link}))),isLoading:!(null!==S&&void 0!==S&&S.link),value:{label:(0,j.jsxs)("span",{children:[(0,j.jsx)("i",{className:`d-none d-sm-inline-block fa me-2 fa-${null===S||void 0===S?void 0:S.icon}`}),null===S||void 0===S?void 0:S.label]}),value:null===S||void 0===S?void 0:S.link},defaultValue:null===S||void 0===S?void 0:S.link,isSearchable:!1,isClearable:!1})})]})})};var w=s(238),k=s(3516),$=s(5192),N=s.n($),S=s(6123),E=s.n(S),O=s(986),P=["className","cssModule","tag"];function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},T.apply(this,arguments)}function R(e,t){if(null==e)return{};var s,a,r=function(e,t){if(null==e)return{};var s,a,r={},n=Object.keys(e);for(a=0;a<n.length;a++)s=n[a],t.indexOf(s)>=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)s=n[a],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var C={className:N().string,cssModule:N().object,tag:O.iC};function A(e){var t=e.className,s=e.cssModule,r=e.tag,n=void 0===r?"div":r,i=R(e,P),o=(0,O.mx)(E()(t,"card-title"),s);return a.createElement(n,T({},i,{className:o}))}A.propTypes=C;const I=A;var K=s(6782),z=s(5399),F=s(9496),U=s(35),q=s(8659);const G=(0,a.lazy)((()=>Promise.all([s.e(110),s.e(849)]).then(s.bind(s,7962)))),B=(0,a.lazy)((()=>s.e(3).then(s.bind(s,6201)))),D=(0,a.lazy)((()=>Promise.all([s.e(424),s.e(641)]).then(s.bind(s,9716)))),L=(0,a.lazy)((()=>Promise.all([s.e(718),s.e(938)]).then(s.bind(s,638)))),W=(0,a.lazy)((()=>s.e(6).then(s.bind(s,2122)))),V={tableData:[],dataTableColumns:[],filtered:[],sorted:[],page:0,pageSize:20,autoRefresh:!1,showFilter:!1,newEntityAttributes:!1,hashAttribute:!1};function H(e){let{table:t}=e;return(0,j.jsx)(w.Z,{className:"my-3 missing-primary-key",children:(0,j.jsxs)(k.Z,{children:[(0,j.jsx)(I,{children:"No Primary Key"}),(0,j.jsx)("i",{className:"fa fa-warning mt-3"}),(0,j.jsxs)("span",{className:"mt-3",children:["The table ",`'${t}'`," does not have a primary key. The HarperDB Studio does not currently support tables without a primary key defined. Please see the"," ",(0,j.jsx)("a",{href:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer",children:"HarperDB documention"})," ","to see the standard HarperDB querying options."]})]})})}const M=function(){var e,t,s,i,o;const l=(0,r.s0)(),u=(0,r.TH)(),{schema:c,table:m,action:h,customer_id:v,compute_stack_id:_}=(0,r.UO)(),[b]=(0,p.Z)({}),y=b&&b[_],x=(0,n.Kw)(d.Z,(e=>e.url)),w=(0,n.Kw)(d.Z,(e=>e.registration)),k=null===w||void 0===w?void 0:w.version,[$,N]=(null===k||void 0===k?void 0:k.split("."))||[],S=`${$}.${N}`,E=(0,n.Kw)(d.Z,(e=>e.structure)),[O,P]=(0,a.useState)({schemas:[],tables:[],activeTable:!1}),[T,R]=(0,a.useState)(V),C=`/o/${v}/i/${_}/browse`,A=(null===(e=b[_])||void 0===e?void 0:e.super)||!0===(null===(t=b[_])||void 0===t?void 0:t.structure),I=A||(null===(s=b[_])||void 0===s?void 0:s.structure)&&(null===(i=b[_])||void 0===i||null===(o=i.structure)||void 0===o?void 0:o.includes(c)),M=A?`Please ${c&&O.tables&&!O.tables.length||!O.schemas.length?"create":"choose"} a ${c?"table":""+(S>=4.2?"database":"schema")}`:"This user has not been granted access to any tables. A super-user must update this user's role.",[Y,J]=(0,a.useState)(!0);return(0,a.useEffect)((()=>{!async function(){if(m){const e=await(0,F.Z)({auth:y,url:x,schema:c,table:m});J(Boolean(e.hash_attribute))}}()}),[y,x,c,m]),(0,a.useEffect)((()=>{if(E){const e=Object.keys(E),t=Object.keys((null===E||void 0===E?void 0:E[c])||{});if(!e.length&&"/browse"!==u.pathname)return P({schemas:[],tables:[],activeTable:!1}),void l(`/o/${v}/i/${_}/browse`);if(e.length&&!e.includes(c))return void l(`/o/${v}/i/${_}/browse/${e[0]}`);if(t.length&&!t.includes(m))return void l(`/o/${v}/i/${_}/browse/${c}/${t[0]}`);O.activeTable!==`${_}:${c}:${m}`&&R(V),P({schemas:e,tables:t,activeTable:`${_}:${c}:${m}`})}}),[E,c,m,_]),(0,a.useEffect)((()=>{(0,q.Z)({auth:y,url:x})}),[y,x,c,m]),(0,j.jsxs)(K.Z,{id:"browse",children:[(0,j.jsx)(z.Z,{xl:"3",lg:"4",md:"5",xs:"12",children:(0,j.jsxs)(g.SV,{onError:(e,t)=>(0,Z.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:f.Z,children:[(0,j.jsx)(B,{activeItem:c,items:O.schemas,baseUrl:C,itemType:S>=4.2?"database":"schema",showForm:A}),c&&(0,j.jsx)(B,{activeItem:m,items:O.tables,activeSchema:c,baseUrl:`${C}/${c}`,itemType:"table",showForm:I}),(0,j.jsx)(W,{centerText:!0,label:`refresh ${S>=4.2?"databases":"schemas"} and tables`})]})}),(0,j.jsx)(z.Z,{xs:"12",className:"d-block d-md-none",children:(0,j.jsx)("hr",{})}),(0,j.jsx)(z.Z,{xl:"9",lg:"8",md:"7",xs:"12",children:(0,j.jsx)(g.SV,{onError:(e,t)=>(0,Z.Z)({error:{message:e.message,componentStack:t}}),FallbackComponent:f.Z,children:c&&m&&"csv"===h&&O.activeTable?(0,j.jsx)(L,{}):c&&m&&h&&O.activeTable?(0,j.jsx)(D,{newEntityAttributes:T.newEntityAttributes,hashAttribute:T.hashAttribute}):c&&m&&O.activeTable?(0,j.jsx)(G,{activeTable:O.activeTable,tableState:T,setTableState:R}):c&&m&&!Y?(0,j.jsx)(H,{}):(0,j.jsx)(U.Z,{headline:M,icon:(0,j.jsx)("i",{className:"fa fa-exclamation-triangle text-warning"})})})})]})},Y=(0,a.lazy)((()=>Promise.all([s.e(446),s.e(60)]).then(s.bind(s,7606)))),J=(0,a.lazy)((()=>Promise.all([s.e(110),s.e(287),s.e(446),s.e(255)]).then(s.bind(s,9951)))),Q=(0,a.lazy)((()=>Promise.all([s.e(110),s.e(287),s.e(463)]).then(s.bind(s,1608)))),X=(0,a.lazy)((()=>Promise.all([s.e(723),s.e(490)]).then(s.bind(s,7535)))),ee=(0,a.lazy)((()=>s.e(25).then(s.bind(s,8244)))),te=(0,a.lazy)((()=>s.e(759).then(s.bind(s,6578)))),se=(0,a.lazy)((()=>s.e(701).then(s.bind(s,7752)))),ae=(0,a.lazy)((()=>Promise.all([s.e(110),s.e(424),s.e(442)]).then(s.bind(s,3218)))),re=e=>{let{super_user:t,version:s=null}=e;const a={element:(0,j.jsx)(M,{}),path:"browse/:schema?/:table?/:action?/:hash?",link:"browse",label:"browse",icon:"list"},r={element:(0,j.jsx)(J,{}),path:"query",link:"query",label:"query",icon:"search"},n={element:(0,j.jsx)(te,{}),path:"users/:username?",link:"users",label:"users",icon:"users"},i={element:(0,j.jsx)(se,{}),path:"roles/:role_id?",link:"roles",label:"roles",icon:"check-square"},o={element:(0,j.jsx)(Y,{}),path:"charts",link:"charts",label:"charts",icon:"chart-line"},l={element:(0,j.jsx)(Q,{}),path:"replication",link:"replication",label:"replication",icon:"cubes"},u={element:(0,j.jsx)(ae,{}),path:"functions/:action?/:project?/:type?/:file?",link:"functions",label:"functions",icon:"project-diagram"},c={element:(0,j.jsx)(ae,{}),path:"applications",link:"applications",label:"applications",icon:"project-diagram"},d={element:(0,j.jsx)(ee,{}),path:"status",link:"status",label:"status",icon:"tachometer-alt"},p={element:(0,j.jsx)(X,{}),path:"config",link:"config",label:"config",icon:"wrench"};let m=!1;if(s){const[e,t]=(null===s||void 0===s?void 0:s.split("."))||[],a=parseInt(e,10),r=parseInt(t,10);m=parseFloat(`${a}.${r}`)>=4.2}return y.Z.is_local_studio&&t?[a,r,n,i,l,m?c:u,d,p]:t?[a,r,n,i,o,l,m?c:u,d,p]:y.Z.is_local_studio?[a,r,o]:[a,r]};var ne=s(7377),ie=s(3230),oe=s(6047),le=s(8751),ue=s(2230),ce=s(5491);const de=function(){const{compute_stack_id:e,customer_id:t}=(0,r.UO)(),s=(0,i.VY)(),o=(0,r.s0)(),[m,h]=(0,a.useState)(!0),[v,_]=(0,p.Z)({}),b=v&&v[e],g=(0,n.Kw)(c.Z,(e=>e.auth)),f=(0,n.Kw)(c.Z,(e=>{var s,a;return null===(s=e.auth)||void 0===s||null===(a=s.orgs)||void 0===a?void 0:a.find((e=>{var s;return(null===(s=e.customer_id)||void 0===s?void 0:s.toString())===t}))})),Z=(0,n.Kw)(c.Z,(e=>e.products)),w=(0,n.Kw)(c.Z,(e=>e.regions)),k=(0,n.Kw)(c.Z,(e=>e.subscriptions)),$=(0,n.Kw)(c.Z,(e=>e.instances)),N=(0,n.Kw)(c.Z,(t=>e&&t.instances&&t.instances.find((t=>t.compute_stack_id===e))),[e]),S=(0,n.Kw)(d.Z,(e=>e.url)),E=(0,n.Kw)(d.Z,(e=>e.restarting)),O=(0,n.Kw)(d.Z,(e=>e.registration)),P=re({customer_id:t,super_user:null===b||void 0===b?void 0:b.super,version:null===O||void 0===O?void 0:O.version}),[T,R]=(0,a.useState)(!1);return l()((()=>{!y.Z.is_local_studio&&g&&t&&(0,oe.Z)({auth:g,customer_id:t})}),[g,t,y.Z.is_local_studio]),l()((()=>{!y.Z.is_local_studio&&g&&t&&(0,le.Z)({auth:g,customer_id:t})}),[g,t,$,y.Z.is_local_studio]),l()((()=>{g&&Z&&w&&k&&t&&(null===$||void 0===$||!$.length)&&(0,ie.Z)({auth:g,customer_id:t,products:Z,regions:w,subscriptions:k,instanceCount:null===$||void 0===$?void 0:$.length})}),[g,Z,w,t,k,$]),l()((async()=>{if(N&&b){d.Z.update((()=>N));const{error:e}=await(0,q.Z)({auth:b,url:N.url});await(0,ce.Z)({auth:b,url:N.url}),h(!1),e&&setTimeout((()=>o(`/o/${t}/instances`)),10)}}),[N]),l()((()=>{T&&S&&null!==b&&void 0!==b&&b.super?s.success("Your instance user role has been upgraded to super_user"):T&&S&&s.success("Your instance user role has been downgraded to standard")}),[s,null===b||void 0===b?void 0:b.super]),l()((()=>R(!0)),(()=>R(!1)),[]),(0,u.Z)((async()=>{if(S){var a,r;const l=await(0,ue.Z)({auth:b,url:S});if(l.error&&"Network request failed"!==l.message&&!E)s.error("Unable to connect to instance."),o(`/o/${t}/instances`);else if(!l.error&&E)d.Z.update((e=>{e.restarting=!1}));else if(!l.error&&(null===b||void 0===b?void 0:b.super)!==(null===(a=l.role)||void 0===a||null===(r=a.permission)||void 0===r?void 0:r.super_user)){var n,i;_({...v,[e]:{...b,super:null===(n=l.role)||void 0===n||null===(i=n.permission)||void 0===i?void 0:i.super_user}})}}}),y.Z.refresh_content_interval),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(x,{routes:P}),(y.Z.is_local_studio||f&&$)&&!m?(0,j.jsx)(a.Suspense,{fallback:(0,j.jsx)(ne.Z,{header:" ",spinner:!0}),children:(0,j.jsxs)(r.Z5,{children:[P.map((e=>(0,j.jsx)(r.AW,{path:e.path,element:e.element},e.path))),(0,j.jsx)(r.AW,{path:"*",element:(0,j.jsx)(r.Fg,{to:P[0].path,replace:!0})})]})}):(0,j.jsx)(ne.Z,{header:"loading instance",spinner:!0})]})}},35:(e,t,s)=>{s.d(t,{Z:()=>i});s(7313);var a=s(238),r=s(3516),n=s(6417);const i=function(e){let{headline:t,description:s,icon:i,warning:o}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"floating-card-header text-end",children:"\xa0"}),(0,n.jsx)(a.Z,{className:"my-3",children:(0,n.jsx)(r.Z,{children:(0,n.jsxs)("div",{className:"empty-prompt narrow",children:[i,t&&(0,n.jsx)("div",{className:"mt-3",children:t}),(0,n.jsx)("div",{className:"mt-3",children:s}),o&&(0,n.jsxs)("div",{className:"warning-text mt-3",children:["Warning: ",o]})]})})})]})}},1343:(e,t,s)=>{s.d(t,{Z:()=>r});var a=s(9859);const r=async e=>{let{auth:t,url:s}=e;return(0,a.Z)({operation:{operation:"describe_all"},auth:t,url:s})}},9496:(e,t,s)=>{s.d(t,{Z:()=>r});var a=s(9859);const r=async e=>{let{auth:t,url:s,schema:r,table:n,signal:i}=e;return(0,a.Z)({operation:{operation:"describe_table",schema:r,table:n},auth:t,url:s,signal:i})}},5491:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(9859),r=s(5447);const n=async e=>{let{auth:t,url:s}=e;const n=await(0,a.Z)({operation:{operation:"registration_info"},auth:t,url:s,timeout:5e3});return r.Z.update((e=>{e.registration=n.error?{}:n})),n}},2230:(e,t,s)=>{s.d(t,{Z:()=>r});var a=s(9859);const r=async e=>{let{auth:t,url:s}=e;return(0,a.Z)({operation:{operation:"user_info"},auth:t,url:s,timeout:5e3})}},8751:(e,t,s)=>{s.d(t,{Z:()=>l});var a=s(576),r=s(6449),n=s(2261),i=s(511);const o=e=>{let{alarms:t}=e;return Object.values(t).reduce(((e,t)=>(e[t.type.trim()]=(e[t.type.trim()]||0)+1,e.total+=1,e)),{total:0})},l=async e=>{let{auth:t,customer_id:s,signal:l,currentAlarmsLength:u}=e,c=null;try{if(c=await(0,a.Z)({endpoint:"getAlarms",method:"POST",payload:{customer_id:s},signal:l,auth:t}),c.error&&u)return r.Z.update((e=>{e.alarmsError=!0}));if(!Array.isArray(c)||c.error)return r.Z.update((e=>{e.alarms=[],e.alarmsError=!0}));const e=[...c].sort(((e,t)=>t.date-e.date)),n=Object.assign({},...e.map((e=>{var t;const s=null===(t=c)||void 0===t?void 0:t.filter((t=>t.compute_stack_id===e.compute_stack_id));return{[e.compute_stack_id]:{alarms:s,alarmCounts:o({alarms:s.filter((e=>e.date+1e3*i.Z.alarm_badge_threshold>Date.now()))})}}})));return r.Z.update((e=>{e.alarms=n,e.alarmsError=!1}))}catch(d){return(0,n.Z)({type:"lms data",status:"error",url:i.Z.lms_api_url,operation:"getAlarms",request:{customer_id:s},error:{catch:d.toString()},customer_id:s})}}},6047:(e,t,s)=>{s.d(t,{Z:()=>l});var a=s(576),r=s(6449),n=s(2261),i=s(511),o=s(2174);const l=async e=>{let{auth:t,customer_id:s}=e,l=null;try{var u;return l=await(0,a.Z)({endpoint:"getCustomer",method:"POST",payload:{customer_id:s},auth:t}),(0,o.Z)({auth:t,customer_id:s,stripe_id:null===(u=l)||void 0===u?void 0:u.stripe_id}),l.error||r.Z.update((e=>{var t;e.customer={...l,customer_id:s},e.hasCard=null===(t=l.stripe_payment_methods)||void 0===t?void 0:t[0]})),l}catch(c){return(0,n.Z)({type:"lms data",status:"error",url:i.Z.lms_api_url,operation:"getCustomer",request:{customer_id:s},error:{catch:c.toString()},customer_id:s})}}},3230:(e,t,s)=>{s.d(t,{Z:()=>u});var a=s(576),r=s(6449),n=s(1842);const i=e=>{let{is_local:t,wavelength_zone_id:s,cloud_provider:a}=e;switch(!0){case s:return"wavelength_compute";case t:return"local_compute";case"akamai"===a:return"akamai_compute";default:return"cloud_compute"}};var o=s(2261),l=s(511);const u=async e=>{let{auth:t,customer_id:s,products:u,regions:c,subscriptions:d,instanceCount:p=0}=e,m=null;try{if(m=await(0,a.Z)({endpoint:"getInstances",method:"POST",payload:{customer_id:s,user_id:t.user_id},auth:t}),Array.isArray(m)){const e=m.map((e=>{const t=(e=>{let{instance:t,products:s,regions:a,subscriptions:r}=e;try{var o,l;const e=t.compute_subscription_id?r[i(t)]:s[i(t)],u=null===e||void 0===e?void 0:e.find((e=>e.value.stripe_plan_id===t.stripe_plan_id&&(!t.compute_subscription_id||e.value.compute_subscription_id===t.compute_subscription_id))),c=t.storage_subscription_id?r.cloud_storage:s.cloud_storage,d=!t.is_local&&(null===c||void 0===c?void 0:c.find((e=>e.value.data_volume_size===t.data_volume_size&&e.value.stripe_storage_plan_id===t.stripe_storage_plan_id&&(!t.storage_subscription_id||e.value.storage_subscription_id===t.storage_subscription_id)))),p=parseFloat((null===u||void 0===u||null===(o=u.value)||void 0===o?void 0:o.compute_price)||0)+parseFloat((null===d||void 0===d||null===(l=d.value)||void 0===l?void 0:l.storage_price)||0),m=p?`$${(0,n.Z)(p.toFixed(2))}`:"FREE",h=t.compute_subscription_id&&t.storage_subscription_id?"PREPAID":p?`${m}/${u.value.compute_interval}`:"FREE",v=!t.is_local&&a.find((e=>e.value===t.instance_region));return{compute:null===u||void 0===u?void 0:u.value,storage:null===d||void 0===d?void 0:d.value,totalPrice:p,totalPriceString:m,totalPriceStringWithInterval:h,region:v}}catch(u){return console.log(u)}})({instance:e,products:u,regions:c,subscriptions:d});return{...e,...t}})),t=e.sort(((e,t)=>e.instance_name>t.instance_name?1:-1));return r.Z.update((e=>{e.instances=t})),t}return!p&&r.Z.update((e=>{e.instances=[]}))}catch(h){return(0,o.Z)({type:"lms data",status:"error",url:l.Z.lms_api_url,operation:"getInstances",request:{customer_id:s},error:{catch:h.toString()},customer_id:s})}}},2174:(e,t,s)=>{s.d(t,{Z:()=>u});var a=s(576),r=s(6449),n=s(2261),i=s(8329),o=s(9274),l=s(511);const u=async e=>{let{auth:t,customer_id:s,stripe_id:u}=e;try{const e=await(0,a.Z)({endpoint:"getPrepaidSubscriptions",method:"POST",payload:{customer_id:s,stripe_id:u},auth:t});return!e.error&&r.Z.update((t=>{t.subscriptions={cloud_storage:(0,o.Z)(e.cloud_storage||[]),cloud_compute:(0,i.Z)(e.cloud_compute||[]),wavelength_compute:(0,i.Z)(e.wavelength_compute||[]),local_compute:(0,i.Z)(e.local_compute||[])}}))}catch(c){return(0,n.Z)({type:"lms data",status:"error",url:l.Z.lms_api_url,operation:"getPrepaidSubscriptions",error:{catch:c.toString()}})}}},9859:(e,t,s)=>{s.d(t,{Z:()=>r});var a=s(8093);const r=async e=>{let{operation:t,auth:s,url:r,timeout:n=0,authType:i,signal:o}=e;try{const e=new AbortController,c=setTimeout((()=>n?e.abort():null),n),d=await(0,a.he)(r,{signal:o||e.signal,method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",authorization:"token"===i?`Bearer ${s.token}`:`Basic ${btoa(`${s.user}:${s.pass}`)}`}});clearTimeout(c);const p=await d.json();var l,u;return p.error?{error:!0,message:p.error,type:"response",role_errors:null===(l=p.main_permissions)||void 0===l?void 0:l.join(", "),access_errors:null===(u=p.unauthorized_access)||void 0===u?void 0:u.map((e=>{var t,s,a,r,n,i;return{schema:e.schema,table:e.table,type:null!==(t=e.required_attribute_permissions)&&void 0!==t&&t.length?"attribute":"table",entity:null!==(s=e.required_attribute_permissions)&&void 0!==s&&s.length?null===(a=e.required_attribute_permissions[0])||void 0===a?void 0:a.attribute_name:e.table,permission:null!==(r=e.required_attribute_permissions)&&void 0!==r&&r.length?null===(n=e.required_attribute_permissions[0])||void 0===n?void 0:n.required_permissions.join(", "):null===(i=e.required_table_permissions)||void 0===i?void 0:i.join(", ")}}))}:200!==d.status?{error:!0,message:`Error of type ${d.status}`,type:"status"}:p}catch(c){return{error:!0,message:c.message,type:"catch"}}}},3708:(e,t,s)=>{s.d(t,{Z:()=>a});const a=e=>{const t={},s=[];return e.error||Object.keys(e).sort().forEach(((a,r)=>{t[a]={},0===r&&s.push(a),Object.keys(e[a]).sort().forEach(((n,i)=>{0===i&&0===r&&s.push(n),t[a][n]={record_count:e[a][n].record_count,hashAttribute:e[a][n].hash_attribute}}))})),{structure:t,defaultBrowseURL:s.join("/")}}},8659:(e,t,s)=>{s.d(t,{Z:()=>o});var a=s(5447),r=s(1343),n=s(3708),i=s(5491);const o=async e=>{let{auth:t,url:s}=e;const o=await(0,r.Z)({auth:t,url:s}),l=await(0,i.Z)({auth:t,url:s});if(o.error)return{error:"Could not log into instance"};const{structure:u,defaultBrowseURL:c}=(0,n.Z)(o);return a.Z.update((e=>{e.auth=t,e.structure=u,e.defaultBrowseURL=c,e.loading=!1,e.registration=l})),{error:!1}}},2190:(e,t,s)=>{s.d(t,{Z:()=>a});const a=(0,s(8131).Z)("instanceAuths")},5447:(e,t,s)=>{s.d(t,{Z:()=>a});const a=new(s(7387).yh)({})},3672:(e,t,s)=>{var a=s(7313);function r(e,t,s){var r="function"===typeof t;a.useEffect((function(){var s,a=!0,n=e((function(){return a}));return Promise.resolve(n).then((function(e){s=e})),function(){a=!1,r&&t(s)}}),r?s:t)}e.exports=r,e.exports.useAsyncEffect=r},4122:(e,t,s)=>{s.d(t,{Z:()=>n});var a=s(7313),r=function(){};function n(e,t,s){var n=(0,a.useRef)(r);(0,a.useEffect)((function(){n.current=e})),(0,a.useEffect)((function(){s&&null!==t&&!1!==t&&n.current()}),[s]),(0,a.useEffect)((function(){if(null!==t&&!1!==t){var e=setInterval((function(){return n.current()}),t);return function(){return clearInterval(e)}}}),[t])}}}]);