diff --git a/assets/index-CNLeE40t.js b/assets/index-XeUQ0QgX.js similarity index 99% rename from assets/index-CNLeE40t.js rename to assets/index-XeUQ0QgX.js index f1249c8..857e2d9 100644 --- a/assets/index-CNLeE40t.js +++ b/assets/index-XeUQ0QgX.js @@ -307,7 +307,7 @@ Error generating stack: `+o.message+` If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},A7="DialogDescriptionWarning",R7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Z2(A7).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},T7=F2,k7=V2,J2=z2,eI=H2,tI=G2,nI=q2,P7=X2;const Bv=T7,N7=k7,rI=p.forwardRef(({className:e,...t},n)=>f.jsx(J2,{ref:n,className:ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));rI.displayName=J2.displayName;const Ff=p.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(N7,{children:[f.jsx(rI,{}),f.jsxs(eI,{ref:r,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-slate-800 dark:bg-slate-950",e),...n,children:[t,f.jsxs(P7,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 data-[state=open]:text-slate-500 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-400",children:[f.jsx(Is,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ff.displayName=eI.displayName;const Uf=({className:e,...t})=>f.jsx("div",{className:ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Uf.displayName="DialogHeader";const sI=({className:e,...t})=>f.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sI.displayName="DialogFooter";const $f=p.forwardRef(({className:e,...t},n)=>f.jsx(tI,{ref:n,className:ae("text-lg font-semibold leading-none tracking-tight",e),...t}));$f.displayName=tI.displayName;const oI=p.forwardRef(({className:e,...t},n)=>f.jsx(nI,{ref:n,className:ae("text-sm text-slate-500 dark:text-slate-400",e),...t}));oI.displayName=nI.displayName;function Vf({isOpen:e,onClose:t,onDelete:n,itemNames:r}){const o=(Array.isArray(r)?r.length:1)===1?"item":"items",i=Array.isArray(r)?r.join(", "):r;async function a(){try{await n()}catch{Ga.error("Failed to delete item")}t()}return f.jsx(Bv,{open:e,onOpenChange:t,children:f.jsxs(Ff,{className:"sm:max-w-[425px]",children:[f.jsxs(Uf,{children:[f.jsxs($f,{className:"flex items-center gap-2",children:[f.jsx(BL,{className:"h-5 w-5 text-red-500"}),"Confirm Deletion"]}),f.jsxs(oI,{children:["Are you sure you want to delete the following ",o,"?",f.jsx("span",{className:"block mt-2 font-medium text-foreground",children:i})]})]}),f.jsxs(sI,{className:"sm:justify-start",children:[f.jsx(pe,{variant:"secondary",onClick:t,children:"Cancel"}),f.jsx(j2,{variant:"destructive",request:a,children:"Delete"})]})]})})}const iI=p.forwardRef(({className:e,...t},n)=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{ref:n,className:ae("w-full caption-bottom text-sm",e),...t})}));iI.displayName="Table";const aI=p.forwardRef(({className:e,...t},n)=>f.jsx("thead",{ref:n,className:ae("[&_tr]:border-b",e),...t}));aI.displayName="TableHeader";const lI=p.forwardRef(({className:e,...t},n)=>f.jsx("tbody",{ref:n,className:ae("[&_tr:last-child]:border-0",e),...t}));lI.displayName="TableBody";const I7=p.forwardRef(({className:e,...t},n)=>f.jsx("tfoot",{ref:n,className:ae("border-t bg-slate-100/50 font-medium [&>tr]:last:border-b-0 dark:bg-slate-800/50",e),...t}));I7.displayName="TableFooter";const zg=p.forwardRef(({className:e,...t},n)=>f.jsx("tr",{ref:n,className:ae("border-b transition-colors hover:bg-slate-100/50 data-[state=selected]:bg-slate-100 dark:hover:bg-slate-800/50 dark:data-[state=selected]:bg-slate-800",e),...t}));zg.displayName="TableRow";const Iu=p.forwardRef(({className:e,...t},n)=>f.jsx("th",{ref:n,className:ae("h-12 px-4 text-left align-middle font-medium text-slate-500 [&:has([role=checkbox])]:pr-0 dark:text-slate-400",e),...t}));Iu.displayName="TableHead";const Ou=p.forwardRef(({className:e,...t},n)=>f.jsx("td",{ref:n,className:ae("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ou.displayName="TableCell";const O7=p.forwardRef(({className:e,...t},n)=>f.jsx("caption",{ref:n,className:ae("mt-4 text-sm text-slate-500 dark:text-slate-400",e),...t}));O7.displayName="TableCaption";var Lv="Checkbox",[M7,hte]=Ho(Lv),[_7,D7]=M7(Lv),cI=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,m]=p.useState(null),g=Pe(t,S=>m(S)),y=p.useRef(!1),x=h?u||!!h.closest("form"):!0,[w=!1,v]=$s({prop:s,defaultProp:o,onChange:c}),b=p.useRef(w);return p.useEffect(()=>{const S=h==null?void 0:h.form;if(S){const E=()=>v(b.current);return S.addEventListener("reset",E),()=>S.removeEventListener("reset",E)}},[h,v]),f.jsxs(_7,{scope:n,state:w,disabled:a,children:[f.jsx(fe.button,{type:"button",role:"checkbox","aria-checked":Os(w)?"mixed":w,"aria-required":i,"data-state":fI(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:g,onKeyDown:Q(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Q(e.onClick,S=>{v(E=>Os(E)?!0:!E),x&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),x&&f.jsx(j7,{control:h,bubbles:!y.current,name:r,value:l,checked:w,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Os(o)?!1:o})]})});cI.displayName=Lv;var uI="CheckboxIndicator",dI=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=D7(uI,n);return f.jsx(lr,{present:r||Os(o.state)||o.state===!0,children:f.jsx(fe.span,{"data-state":fI(o.state),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});dI.displayName=uI;var j7=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:s,...o}=e,i=p.useRef(null),a=M0(n),l=T0(t);p.useEffect(()=>{const u=i.current,d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&m){const g=new Event("click",{bubbles:r});u.indeterminate=Os(n),m.call(u,Os(n)?!1:n),u.dispatchEvent(g)}},[a,n,r]);const c=p.useRef(Os(n)?!1:n);return f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??c.current,...o,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Os(e){return e==="indeterminate"}function fI(e){return Os(e)?"indeterminate":e?"checked":"unchecked"}var hI=cI,B7=dI;const Hg=p.forwardRef(({className:e,...t},n)=>f.jsx("div",{className:"flex items-center",children:f.jsx(hI,{ref:n,className:ae("peer h-4 w-4 shrink-0 rounded-sm border border-slate-200 border-slate-900 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=checked]:text-slate-50 dark:border-slate-800 dark:border-slate-50 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300 dark:data-[state=checked]:bg-slate-50 dark:data-[state=checked]:text-slate-900",e),...t,children:f.jsx(B7,{className:ae("flex items-center justify-center text-current"),children:f.jsx(ic,{className:"h-4 w-4"})})})}));Hg.displayName=hI.displayName;function Fv({data:e,columns:t,actions:n,idKey:r}){const[s,o]=p.useState(new Set),i=()=>{s.size===e.length?o(new Set):o(new Set(e.map(x=>x[r])))},a=x=>{const w=new Set(s);w.has(x)?w.delete(x):w.add(x),o(w)},[l,c]=p.useState(1),[u,d]=p.useState(10),h=Math.ceil(e.length/u),m=(l-1)*u,g=m+u,y=e.slice(m,g)??[];return f.jsxs("div",{className:"relative flex flex-col flex-grow flex-basis-0 overflow-y-auto",children:[f.jsx("div",{className:"flex-grow",children:f.jsxs(iI,{children:[f.jsx(aI,{className:"sticky top-0 z-10 h-[34px]",children:f.jsxs(zg,{style:{background:"white",padding:0,height:"34px",borderBottom:dt.border},children:[f.jsx(Iu,{className:"w-[50px] h-[34px]",style:{height:"34px"},children:f.jsx(Hg,{checked:e.length>0&&s.size===e.length,onCheckedChange:i})}),t.map((x,w)=>f.jsx(Iu,{style:{height:"34px"},children:x.header},w)),n&&f.jsx(Iu,{className:"text-right pr-6",style:{height:"34px"},children:"Actions"})]})}),f.jsx(lI,{children:y==null?void 0:y.map((x,w)=>f.jsxs(zg,{children:[f.jsx(Ou,{children:f.jsx(Hg,{checked:s.has(x[r]),onCheckedChange:()=>a(x[r])})}),t.map((v,b)=>f.jsx(Ou,{children:typeof v.accessor=="function"?v.accessor(x):x[v.accessor]},b)),n&&f.jsx(Ou,{children:f.jsx("div",{className:"flex justify-end",children:n.map((v,b)=>f.jsx("div",{children:v.button(x)},b))})})]},w))})]})}),f.jsxs("div",{style:{borderTop:dt.border,position:"sticky",bottom:0,left:0,background:"white",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"4px"},children:[f.jsxs("div",{className:"w-max flex items-center gap-2 pl-2",children:[f.jsx("span",{className:"w-max text-nowrap",children:"Rows per page"}),f.jsxs(Lo,{value:u.toString(),onValueChange:x=>d(Number(x)),children:[f.jsx(Vs,{className:"w-[75px]",children:f.jsx(Ji,{})}),f.jsxs(zs,{children:[f.jsx(wn,{value:"10",children:"10"}),f.jsx(wn,{value:"20",children:"20"}),f.jsx(wn,{value:"50",children:"50"}),f.jsx(wn,{value:"100",children:"100"})]})]})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(pe,{size:"icon",variant:"ghost",disabled:l===1,onClick:()=>{c(1)},children:f.jsx(vL,{})}),f.jsx(pe,{onClick:()=>c(x=>Math.max(x-1,1)),disabled:l===1,size:"icon",variant:"ghost",children:f.jsx(wL,{})}),f.jsx("span",{children:`Page ${l} of ${h}`}),f.jsx(pe,{onClick:()=>c(x=>Math.min(x+1,h)),disabled:l===h,size:"icon",variant:"ghost",children:f.jsx(xd,{})}),f.jsx(pe,{size:"icon",variant:"ghost",disabled:l===h,onClick:()=>c(h),children:f.jsx(xL,{})})]})]})]})}function L7(){const{services:e,setServices:t,orderBy:n,setFormService:r}=Pr(),[s,o]=p.useState(null);async function i(){try{const c=await F0(),u=l(c);t(u)}catch(c){We.error("Error getting services"),console.error(c)}}async function a(){if(s)try{await y7(s),await i(),We.success(`Service ${s.name} deleted successfully`)}catch(c){We.error("Error deleting service"),console.error(c)}finally{o(null)}}function l(c){switch(n){case jr.NameAsc:return c.sort((u,d)=>u.name.localeCompare(d.name));case jr.NameDesc:return c.sort((u,d)=>d.name.localeCompare(u.name));case jr.CPUAsc:return c.sort((u,d)=>Number(d.cpu)-Number(u.cpu));case jr.CPUDesc:return c.sort((u,d)=>Number(u.cpu)-Number(d.cpu));case jr.MemoryAsc:return c.sort((u,d)=>Number(d.memory)-Number(u.memory));case jr.MemoryDesc:return c.sort((u,d)=>Number(u.memory)-Number(d.memory))}return c}return U0(()=>{const c=l(e);t(c)},[n,e]),f.jsxs("div",{style:{display:"flex",flexDirection:"column",flexGrow:1,flexBasis:0,overflow:"hidden"},children:[f.jsx(Fv,{data:e,idKey:"name",columns:[{header:"Name",accessor:"name"},{header:"Image",accessor:"image"},{header:"CPU",accessor:"cpu"},{header:"Memory",accessor:"memory"}],actions:[{button:()=>f.jsx(pe,{variant:"link",size:"icon",children:f.jsx(RL,{})})},{button:()=>f.jsx(pe,{variant:"link",size:"icon",children:f.jsx(jL,{})})},{button:c=>f.jsx(pn,{to:`/ui/services/${c.name}/settings`,replace:!0,onClick:()=>{r(c)},children:f.jsx(pe,{variant:"link",size:"icon",children:f.jsx(bT,{})})})},{button:c=>f.jsx(pe,{variant:"link",size:"icon",onClick:()=>o(c),children:f.jsx(y0,{color:ke.Red})})}]}),f.jsx(Vf,{isOpen:!!s,onClose:()=>o(null),onDelete:a,itemNames:(s==null?void 0:s.name)||""})]})}function F7({tab:e,setTab:t}){return f.jsx("div",{style:{background:"white",borderBottom:dt.border,display:"flex",flexDirection:"row",padding:"0 16px"},children:Object.keys(bs).filter(n=>isNaN(Number(n))).map(n=>{const r=n===bs[e];return f.jsxs("div",{style:{height:34,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 16px",cursor:"pointer",position:"relative"},onClick:()=>t(bs[n]),children:[r&&f.jsx("div",{style:{position:"absolute",bottom:-1,left:0,height:1,width:"100%",background:"black"}}),n]},n)})})}function U7(){const{formService:e,setFormService:t}=Pr(),n=p.useMemo(()=>{var a;const o=(a=e.environment)==null?void 0:a.Variables,i=o?Object.entries(o).map(([l,c])=>({key:l,value:c})):[];return i.length===0&&i.push({key:"",value:""}),i},[e]),[r,s]=p.useState(n);return p.useEffect(()=>{t(o=>({...o,environment:{...o.environment,Variables:r.reduce((i,a)=>(i[a.key]=a.value,i),{})}}))},[r]),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"9px"},children:[r.map((o,i)=>f.jsxs("div",{style:{display:"flex",gap:"5px",alignItems:"center"},children:[f.jsx(Ke,{value:o.key,onChange:a=>{const l=[...r];l[i].key=a.target.value,s(l)},placeholder:"Variable name"}),f.jsx(Ke,{type:"password",value:o.value,onFocus:a=>a.target.type="text",onBlur:a=>a.target.type="password",style:{width:300},onChange:a=>{const l=[...r];l[i].value=a.target.value,s(l)},placeholder:"Value"}),r.length>1&&f.jsx(pe,{size:"icon",variant:"ghost",onClick:()=>{const a=r.filter((l,c)=>c!==i);s(a)},children:f.jsx(Is,{size:16})})]},i)),f.jsxs(pe,{size:"sm",style:{width:"max-content"},onClick:()=>{s([...r,{key:"",value:""}])},children:[f.jsx(ac,{className:"h-4 w-4 mr-2"})," Add Variable"]})]})}function Ui({title:e,subtitle:t,children:n,button:r}){return f.jsxs("div",{style:{display:"flex",flexDirection:"column",flexWrap:"wrap",width:"100%",padding:18,margin:0},children:[f.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:18},children:[f.jsxs("div",{children:[f.jsx("h1",{style:{color:ke.DarkGrayText,fontSize:14},children:e}),f.jsx("h2",{style:{fontSize:16,fontWeight:"bold"},children:t})]}),r]}),f.jsx("div",{style:{display:"flex",width:"100%",gap:18,alignItems:"end"},children:n})]})}function $7(){const{setFormService:e}=Pr(),[t,n]=p.useState("file"),[r,s]=p.useState(""),[o,i]=p.useState(""),a=c=>{var d;const u=(d=c.target.files)==null?void 0:d[0];if(u){const h=new FileReader;h.onload=m=>{var y;const g=(y=m.target)==null?void 0:y.result;s(g),e(x=>({...x,script:g}))},h.readAsText(u)}},l=c=>{const u=c.target.value;i(u),e(d=>({...d,script:u}))};return f.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"end"},children:[f.jsxs("div",{children:[f.jsx(Zn,{children:"Script upload method"}),f.jsxs(Lo,{value:t,onValueChange:c=>n(c),children:[f.jsx(Vs,{className:"w-[180px]",children:f.jsx(Ji,{placeholder:"Select upload method"})}),f.jsxs(zs,{children:[f.jsx(wn,{value:"file",children:"File Upload"}),f.jsx(wn,{value:"url",children:"URL"})]})]})]}),t==="file"?f.jsx("div",{children:f.jsx(Ke,{type:"file",onChange:a,className:"bg-white"})}):f.jsx(Ke,{type:"url",placeholder:"Enter script URL",value:o,onChange:l,width:"275px"})]})}const Wg=({orientation:e="horizontal"})=>f.jsx("div",{style:{width:e==="horizontal"?"100%":"1px",height:e==="horizontal"?"1px":"100%",borderTop:dt.border}});function V7(){var o,i,a;const{formService:e,setFormService:t}=Pr();function n(l,c){t(u=>({...u,[c]:l.target.value}))}const[r,s]=p.useState("Mi");return f.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"flex-start"},children:[f.jsx(Ui,{title:"General Settings",subtitle:"Configure the service name and a container image to use",children:f.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",gap:10},children:[f.jsxs("section",{style:{display:"flex",flexDirection:"row",width:"100%",gap:10},children:[f.jsx(Ke,{flex:1,value:e==null?void 0:e.name,onChange:l=>{n(l,"name")},label:"Service name"}),f.jsx(Ke,{flex:2,value:e==null?void 0:e.image,label:"Docker image",onChange:l=>{n(l,"image")}})]}),f.jsxs("div",{className:"flex flex-row w-full items-end",children:[e.token&&f.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"end",width:"50%",gap:10},children:[f.jsx(Ke,{value:e==null?void 0:e.token,readOnly:!0,label:"Token",type:"password",width:"80%"}),f.jsx(pe,{variant:"ghost",style:{height:"39px"},onClick:()=>{navigator.clipboard.writeText((e==null?void 0:e.token)||""),We.success("Token copied to clipboard")},children:f.jsx(g0,{})})]}),f.jsxs("div",{style:{width:"50%",display:"flex",flexDirection:"column",gap:"0.375rem"},children:[f.jsx(Zn,{children:"Log level"}),f.jsxs(Lo,{value:e==null?void 0:e.log_level,onValueChange:l=>{t(c=>({...c,log_level:l}))},children:[f.jsx(Vs,{children:f.jsx(Ji,{placeholder:"Log level"})}),f.jsx(zs,{children:Object.values(L0).map(l=>f.jsx(wn,{value:l,children:l},l))})]})]})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:50},children:[f.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[f.jsx("strong",{children:"Alpine:"}),e.alpine?f.jsx(ic,{size:16}):f.jsx(Is,{size:16,className:"pt-[2px]"})]}),f.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[f.jsx("strong",{children:"Interlink:"}),e.interlink_node_name?e.interlink_node_name:f.jsx(Is,{size:16,className:"pt-[2px]"})]}),f.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[f.jsx("strong",{children:"Allowed users:"}),(o=e.allowed_users)!=null&&o.length?e.allowed_users.join(", "):f.jsx(Is,{size:16,className:"pt-[2px]"})]})]})]})}),f.jsx(Wg,{}),f.jsx(Ui,{title:"Service specifications",subtitle:"Adjust container resources and provide a script for the processing of files",children:f.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",gap:10},children:[f.jsx($7,{}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%",alignItems:"end",gap:10},children:[f.jsx(Ke,{value:e==null?void 0:e.cpu,onChange:l=>{n(l,"cpu")},label:"CPU cores"}),f.jsx(Ke,{value:(a=(i=e==null?void 0:e.memory)==null?void 0:i.replace("Mi",""))==null?void 0:a.replace("Gi",""),label:"Memory",onChange:l=>{t(c=>({...c,memory:l.target.value+r}))},type:"number"}),f.jsxs(Lo,{value:r,onValueChange:l=>{s(l)},children:[f.jsx(Vs,{className:"w-[75px]",children:f.jsx(Ji,{placeholder:"Order by"})}),f.jsxs(zs,{children:[f.jsx(wn,{value:"Mi",children:"Mi"}),f.jsx(wn,{value:"Gi",children:"Gi"})]})]})]})]})}),f.jsx(Wg,{}),f.jsx(Ui,{title:"Enviroment variables",subtitle:"Provide environment variables to the service adding them here",children:f.jsx(U7,{})})]})}function z7({setSelectedProvider:e}){return f.jsxs(sN,{children:[f.jsx(oN,{asChild:!0,children:f.jsxs(pe,{children:[f.jsx(ac,{className:"h-4 w-4 mr-2"}),"Add provider"]})}),f.jsxs(Z0,{children:[f.jsx(ev,{children:"Available providers:"}),f.jsx(tv,{}),f.jsx(iN,{children:f.jsx(J0,{onClick:()=>{e({type:"minio"})},children:"Minio"})})]})]})}function H7(){const{formService:e,setFormService:t}=Pr(),n=p.useMemo(()=>{const i=e.storage_providers,a=[];return Object.keys(i).forEach(l=>{const c=i[l];c&&Object.entries(c).forEach(([u,d])=>{a.push({...d,id:u,type:l})})}),a},[]),[r,s]=p.useState(n);async function o(){let i={};r.forEach(a=>{const{type:l,...c}=a;i={...i,[a.type]:{...i[a.type],[a.id]:c}}}),t(a=>({...a,storage_providers:i}))}return U0(()=>{o()},[r]),{providers:r,setProviders:s}}const W7="/assets/minio-Cl9aXDmH.png";function G7({provider:e,setSelectedProvider:t,setSelectedId:n,onDelete:r}){function s(){switch(e.type){case"minio":return W7;default:return}}function o(){switch(e.type){case"minio":return e.endpoint;default:return}}return f.jsxs("div",{style:{flexGrow:1,maxWidth:"32.8%",height:72,border:dt.border,background:"white",borderRadius:8,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:16,padding:10,paddingLeft:14},children:[f.jsx("img",{src:s(),alt:"Provider logo",style:{width:"30%"}}),f.jsxs("div",{style:{flexGrow:1,flexBasis:0,overflow:"hidden"},children:[f.jsx("h1",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.id}),f.jsx("h2",{style:{color:ke.DarkGrayText,maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:o()})]}),f.jsxs("div",{children:[f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>{t(e),n(e.id)},children:f.jsx(DL,{})}),f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>{r(e.id)},children:f.jsx(y0,{color:ke.Red})})]})]})}var Uv="Switch",[K7,pte]=Ho(Uv),[q7,Y7]=K7(Uv),pI=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,m]=p.useState(null),g=Pe(t,b=>m(b)),y=p.useRef(!1),x=h?u||!!h.closest("form"):!0,[w=!1,v]=$s({prop:s,defaultProp:o,onChange:c});return f.jsxs(q7,{scope:n,checked:w,disabled:a,children:[f.jsx(fe.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":yI(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:g,onClick:Q(e.onClick,b=>{v(S=>!S),x&&(y.current=b.isPropagationStopped(),y.current||b.stopPropagation())})}),x&&f.jsx(X7,{control:h,bubbles:!y.current,name:r,value:l,checked:w,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});pI.displayName=Uv;var mI="SwitchThumb",gI=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Y7(mI,n);return f.jsx(fe.span,{"data-state":yI(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});gI.displayName=mI;var X7=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=p.useRef(null),i=M0(n),a=T0(t);return p.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[i,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function yI(e){return e?"checked":"unchecked"}var vI=pI,Q7=gI;const xI=p.forwardRef(({className:e,...t},n)=>f.jsx(vI,{className:ae("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-300 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:n,children:f.jsx(Q7,{className:ae("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));xI.displayName=vI.displayName;function Z7({selectedProvider:e,setSelectedProvider:t}){const n=e,r=(s,o)=>{t(i=>i?{...i,[s]:o}:null)};return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[f.jsx(Ke,{value:e.id,autoFocus:!1,placeholder:"ID",label:"ID",onChange:s=>r("id",s.target.value)}),f.jsx(Ke,{value:n.endpoint,placeholder:"Endpoint",label:"Endpoint",onChange:s=>r("endpoint",s.target.value)}),f.jsx(Ke,{value:n.region,placeholder:"Region",label:"Region",onChange:s=>r("region",s.target.value)}),f.jsx(Ke,{value:n.access_key,placeholder:"Access key",title:"Access Key",label:"Access key",type:"password",onChange:s=>r("access_key",s.target.value)}),f.jsx(Ke,{value:n.secret_key,placeholder:"Secret access key",title:"Secret Access Key",label:"Secret access key",type:"password",onChange:s=>r("secret_key",s.target.value)}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(xI,{checked:n.verify,onCheckedChange:s=>r("verify",s)}),f.jsx(Zn,{children:"Verify"})]})]})}function J7({onClose:e,selectedProvider:t,setSelectedProvider:n,onUpdate:r}){return f.jsx(Bv,{defaultOpen:!0,onOpenChange:e,children:f.jsxs(Ff,{style:{paddingBottom:"1rem"},children:[f.jsx(Uf,{children:f.jsxs($f,{children:[t.type.charAt(0).toUpperCase()+t.type.slice(1)," "," provider configuration"]})}),t.type==="minio"&&f.jsx(Z7,{selectedProvider:t,setSelectedProvider:n}),f.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:f.jsx(pe,{variant:"mainGreen",onClick:()=>{r(),e()},children:"Save"})})]})})}function eH(){const{providers:e,setProviders:t}=H7(),[n,r]=p.useState(null),[s,o]=p.useState(null);function i(){t(h=>(!n&&h.push(s),h.map(y=>y.id===n?s:y)))}function a(h){t(m=>m.filter(g=>g.id!==h)),u(null)}function l(){r(null),o(null)}const[c,u]=p.useState(null),d=c!==null;return f.jsxs(f.Fragment,{children:[d&&f.jsx(Vf,{isOpen:d,onClose:()=>u(null),onDelete:()=>a(c),itemNames:c}),s&&f.jsx(J7,{selectedProvider:s,onClose:l,onUpdate:i,setSelectedProvider:o}),f.jsx("div",{style:{flexGrow:1,flexBasis:0,display:"flex",flexDirection:"column"},children:f.jsx(Ui,{title:"Storage configuration",subtitle:"Set up the credentials of the storage providers",button:f.jsx(z7,{setSelectedProvider:o}),children:f.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",width:"100%",gap:"10px"},children:e.map((h,m)=>f.jsx(G7,{provider:h,setSelectedProvider:o,setSelectedId:r,onDelete:()=>{u(h.id)}},m))})})})]})}const tH=gf("inline-flex items-center rounded-full border border-slate-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 dark:border-slate-800 dark:focus:ring-slate-300",{variants:{variant:{default:"border-transparent bg-slate-900 text-slate-50 hover:bg-slate-900/80 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50/80",secondary:"border-transparent bg-slate-100 text-slate-900 hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80",destructive:"border-transparent bg-red-500 text-slate-50 hover:bg-red-500/80 dark:bg-red-900 dark:text-slate-50 dark:hover:bg-red-900/80",outline:"text-slate-950 dark:text-slate-50"}},defaultVariants:{variant:"default"}});function Pi({className:e,variant:t,...n}){return f.jsx("div",{className:ae(tH({variant:t}),e),...n})}function nH(){const{formService:e,setFormService:t}=Pr(),n=e.storage_providers,[r,s]=p.useState(null),[o,i]=p.useState(!1),[a,l]=p.useState("inputs"),c=g=>{const y={...e};a==="inputs"?r!==null?y.input[r.index]=g:y.input.push(g):r!==null?y.output[r.index]=g:y.output.push(g),t(y),i(!1),s(null)},u=(g,y)=>{const x={...e};g==="inputs"?x.input.splice(y,1):x.output.splice(y,1),t(x)},d=(g,y,x)=>{l(g),s({item:y,index:x}),i(!0)},h=g=>{l(g),s(null),i(!0)},m=(g,y)=>f.jsxs(f.Fragment,{children:[y.length===0&&f.jsxs("div",{style:{textAlign:"center",color:ke.DarkGrayText},children:["No ",g," defined yet."]}),y.map((x,w)=>{var v,b,S,E;return f.jsxs("div",{style:{border:dt.border,background:"white",height:74,borderRadius:8,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:16,padding:"10px 14px"},children:[f.jsxs("div",{style:{display:"flex",height:"100%",flexDirection:"column",justifyContent:"space-evenly"},children:[f.jsx("h1",{children:x.storage_provider}),f.jsx("h3",{style:{fontSize:12,color:ke.DarkGrayText},children:x.path})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",rowGap:8},children:[f.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-baseline",children:[f.jsx("h3",{style:{fontSize:12,color:ke.DarkGrayText},children:"Prefixes:"}),(v=x.prefix)==null?void 0:v.slice(0,3).map((R,T)=>f.jsx(Pi,{variant:"secondary",style:{maxWidth:"100px",overflow:"hidden"},children:f.jsx("span",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:R})},`prefix-${T}`)),((b=x.prefix)==null?void 0:b.length)>3&&f.jsxs(Pi,{variant:"secondary",children:["+",x.prefix.length-3]})]}),f.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-baseline",children:[f.jsx("h3",{style:{fontSize:12,color:ke.DarkGrayText},children:"Suffixes:"}),(S=x.suffix)==null?void 0:S.slice(0,3).map((R,T)=>f.jsx(Pi,{variant:"secondary",style:{maxWidth:"100px",overflow:"hidden"},children:f.jsx("span",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:R})},`suffix-${T}`)),((E=x.suffix)==null?void 0:E.length)>3&&f.jsxs(Pi,{variant:"secondary",children:["+",x.suffix.length-3]})]})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>d(g,x,w),children:f.jsx(bT,{})}),f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>u(g,w),children:f.jsx(y0,{color:ke.Red})})]})]})})]});return f.jsxs("div",{style:{display:"flex",flexDirection:"column",flexGrow:1,flexBasis:0,overflow:"auto"},children:[f.jsx("div",{style:{width:"100%",minHeight:"50%"},children:f.jsx(Ui,{title:"Inputs",subtitle:"Define the input paths for your service.",button:f.jsxs(pe,{variant:"default",onClick:()=>h("inputs"),children:[f.jsx(hb,{className:"mr-2 h-4 w-4"}),"Add Input"]}),children:f.jsx("div",{style:{display:"flex",flexDirection:"row",gap:16,flexWrap:"wrap"},children:m("inputs",e.input)})})}),f.jsx(Wg,{}),f.jsx(Ui,{title:"Outputs",subtitle:"Define the output paths for your service.",button:f.jsxs(pe,{variant:"default",onClick:()=>h("outputs"),children:[f.jsx(hb,{className:"mr-2 h-4 w-4"}),"Add Output"]}),children:f.jsx("div",{style:{display:"flex",flexGrow:1,flexDirection:"row",gap:16,flexWrap:"wrap"},children:m("outputs",e.output)})}),f.jsx(Bv,{open:o,onOpenChange:i,children:f.jsxs(Ff,{children:[f.jsx(Uf,{children:f.jsxs($f,{children:[r?"Edit":"Create"," ",a==="inputs"?"Input":"Output"]})}),f.jsx(rH,{providers:n,item:r?r.item:{storage_provider:"",path:"",prefix:[],suffix:[]},onSave:c})]})})]})}function rH({item:e,onSave:t}){var g,y;const[n,r]=p.useState({...e,storage_provider:e.storage_provider||"minio.default",prefix:e.prefix||[],suffix:e.suffix||[]}),[s,o]=p.useState(""),[i,a]=p.useState(""),l=(x,w)=>{r(v=>({...v,[x]:w}))},c=()=>{s.trim()&&(r(x=>({...x,prefix:[...x.prefix,s.trim()]})),o(""))},u=()=>{i.trim()&&(r(x=>({...x,suffix:[...x.suffix,i.trim()]})),a(""))},d=x=>{r(w=>({...w,prefix:w.prefix.filter((v,b)=>b!==x)}))},h=x=>{r(w=>({...w,suffix:w.suffix.filter((v,b)=>b!==x)}))},m=(x,w)=>{x.key==="Enter"&&(w==="prefix"?c():u())};return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"provider",children:"Provider"}),f.jsxs(Lo,{value:n.storage_provider,onValueChange:x=>l("storage_provider",x),children:[f.jsx(Vs,{id:"provider",children:f.jsx(Ji,{placeholder:"Select a provider"})}),f.jsx(zs,{children:f.jsx(wn,{value:"minio.default",children:"minio.default"},"minio")})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"path",children:"Path"}),f.jsx(Ke,{id:"path",value:n.path,autoFocus:!0,onChange:x=>l("path",x.target.value)})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"prefix",children:"Prefixes"}),f.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(g=n.prefix)==null?void 0:g.map((x,w)=>f.jsxs(Pi,{variant:"secondary",children:[x,f.jsxs(pe,{variant:"ghost",size:"sm",className:"ml-1 h-4 w-4 p-0",onClick:()=>d(w),children:[f.jsx(Is,{className:"h-3 w-3"}),f.jsx("span",{className:"sr-only",children:"Remove prefix"})]})]},w))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ke,{id:"new-prefix",value:s,onChange:x=>o(x.target.value),onKeyPress:x=>m(x,"prefix"),placeholder:"Add new prefix"}),f.jsx(pe,{onClick:c,children:"Add"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"suffix",children:"Suffixes"}),f.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(y=n.suffix)==null?void 0:y.map((x,w)=>f.jsxs(Pi,{variant:"outline",children:[x,f.jsxs(pe,{variant:"ghost",size:"sm",className:"ml-1 h-4 w-4 p-0",onClick:()=>h(w),children:[f.jsx(Is,{className:"h-3 w-3"}),f.jsx("span",{className:"sr-only",children:"Remove suffix"})]})]},w))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ke,{id:"new-suffix",value:i,onChange:x=>a(x.target.value),onKeyPress:x=>m(x,"suffix"),placeholder:"Add new suffix"}),f.jsx(pe,{onClick:u,children:"Add"})]})]}),f.jsx(pe,{onClick:()=>t(n),children:"Save"})]})}function l1(){const{formService:e}=Pr(),[t,n]=p.useState(bs.General);return Object.keys(e).length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(F7,{tab:t,setTab:n}),f.jsxs("div",{style:{display:"flex",flexGrow:1,flexBasis:0,overflow:"scroll"},children:[t===bs.General&&f.jsx(V7,{}),t===bs.Storage&&f.jsx(eH,{}),t===bs["Input - Output"]&&f.jsx(nH,{})]})]})}function sH(){return f.jsx(p0,{children:f.jsxs(kt,{path:"/",element:f.jsx(w6,{children:f.jsxs("div",{style:{flexGrow:1,flexBasis:0,display:"flex",flexDirection:"column"},children:[f.jsx(g7,{}),f.jsx(h0,{})]})}),children:[f.jsx(kt,{path:"",element:f.jsx(L7,{})}),f.jsx(kt,{path:":serviceId",element:f.jsx(l1,{})}),f.jsx(kt,{path:":serviceId/settings",element:f.jsx(l1,{})}),f.jsx(kt,{path:":serviceId/logs",element:f.jsx("h1",{children:"logs"})})]})})}function oH({value:e}){return p.useEffect(()=>{document.title=e},[e]),null}var iH="Separator",c1="horizontal",aH=["horizontal","vertical"],wI=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=c1,...s}=e,o=lH(r)?r:c1,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return f.jsx(fe.div,{"data-orientation":o,...a,...s,ref:t})});wI.displayName=iH;function lH(e){return aH.includes(e)}var bI=wI;const SI=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>f.jsx(bI,{ref:s,decorative:n,orientation:t,className:ae("shrink-0 bg-slate-200 dark:bg-slate-800",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));SI.displayName=bI.displayName;const cH="/assets/egi-BuAf2fET.svg",ai={provider_url:"https://aai-dev.egi.eu/auth/realms/egi/protocol/",client_id:"f997c320-e51f-4309-957e-8af004495aab",redirect_uri:`${location.origin}/callback.html`,url_authorize:"https://aai-dev.egi.eu/auth/realms/egi/protocol/openid-connect/auth",url_user_info:"https://aai-dev.egi.eu/auth/realms/egi/protocol/openid-connect/userinfo",token_endpoint:"https://aai-dev.egi.eu/auth/realms/egi/protocol/openid-connect/token",api:"",deploy_container:"false",minio_local_endpoint:"localhost",minio_local_port:"30300",minio_local_ssl:!1,response_default_minio:"minio.minio",external_ui:"https://ui.oscar.grycap.net/?endpoint=",ai4eosc_servers:["https://inference.cloud.ai4eosc.eu"],imagine_servers:["https://inference.cloud.imagine-ai.eu","https://inference-walton.cloud.imagine-ai.eu"],juno:{repo:"https://raw.githubusercontent.com/grycap/oscar-juno/main/",service:"juno.yaml",script:"script.sh"}};function uH(){const e=ma(),{authData:t,setAuthData:n}=oc();async function r(o){o.preventDefault();const i=o.target,a=new FormData(i),l=a.get("endpoint"),c=a.get("username"),u=a.get("password"),d=void 0;if(!l.match(/^(http|https):\/\/[^ "]+$/)){We.error("Invalid endpoint");return}try{await aT({endpoint:l,username:c,password:u,token:d}),n({authenticated:!0,user:c,password:u,endpoint:l})}catch{We.error("Invalid credentials")}}async function s(o){o.preventDefault();const i=o.target;let l=new FormData(i).get("endpoint");if(console.log(l),!l.match(/^(http|https):\/\/[^ "]+$/)){We.error("Invalid endpoint");return}try{l=l.endsWith("/")?l.slice(0,-1):l,localStorage.setItem("api",l),localStorage.setItem("client_id",ai.client_id),localStorage.setItem("provider_url",ai.provider_url),localStorage.setItem("url_authorize",ai.url_authorize),localStorage.setItem("url_user_info",ai.url_user_info),localStorage.setItem("token_endpoint",ai.token_endpoint),window.location.replace(ai.redirect_uri)}catch{We.error("Invalid credentials")}}return p.useEffect(()=>{t!=null&&t.authenticated&&e("/")},[t]),p.useEffect(()=>{document.title="OSCAR - Login"},[]),f.jsxs(f.Fragment,{children:[f.jsx(oH,{value:"Login"}),f.jsx("main",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw",backgroundColor:m0(ke.Green1,.75)},children:f.jsxs("div",{style:{position:"relative",paddingBottom:"100px"},children:[f.jsxs("div",{style:{position:"absolute",background:"#FFFFFF50",border:`1px solid ${ke.Green1}`,width:"100%",height:"100px",bottom:50,borderRadius:"0 0 30px 30px",zIndex:0,display:"flex",flexDirection:"column"},children:[f.jsx("div",{style:{height:"50px"}}),f.jsxs("div",{style:{flex:1,display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"10px",color:"rgba(0,0,0,0.5)",padding:"0 20px"},children:[f.jsxs("div",{children:["© 2021 ",f.jsx("a",{href:"https://oscar.grycap.net",children:"Oscar"})]}),f.jsxs("div",{children:[f.jsx("a",{href:"https://grycap.upv.es/",children:"GRyCAP-I3M-UPV"}),", Universitat Politècnica de València, Spain."]})]})]}),f.jsxs("section",{style:{zIndex:2,borderRadius:"30px",display:"flex",flexDirection:"column",background:"white",alignItems:"center",padding:"36px 48px",gap:"26px",border:`1px solid ${ke.Green1}`,position:"relative"},children:[f.jsx("img",{src:yT,alt:"Oscar logo",width:320}),f.jsxs("form",{onSubmit:o=>{let i=o.nativeEvent.submitter;if(i!=null){let a=i.getAttribute("name");console.log(a),a==="normal"&&r(o),a==="EGI"&&s(o)}},style:{width:"320px",display:"flex",flexDirection:"column",gap:"15px"},children:[f.jsx(Ke,{name:"endpoint",placeholder:"Endpoint"}),f.jsx(Ke,{name:"username",type:"text",placeholder:"Username"}),f.jsx(Ke,{name:"password",type:"password",placeholder:"Password"}),f.jsx(pe,{name:"normal",type:"submit",size:"sm",style:{background:ke.Green4},children:"Login"}),f.jsx(SI,{}),f.jsxs(pe,{name:"EGI",type:"submit",size:"sm",style:{width:"100%",background:ke.Blue},children:[f.jsx("img",{src:cH,alt:"EGI Check-in",style:{width:"24px",marginRight:"10px"}}),"Login via EGI Check-in"]})]})]})]})})]})}function dH(){const e=[{category:"Name of the service",details:"OSCAR"},{category:"URLs of the service",details:"https://ui.oscar.grycap.net/"},{category:"Description of the service",details:"OSCAR is an open-source platform to support the Functions as a Service (FaaS) computing model for file-processing applications. It can be automatically deployed on multi-Clouds in order to create highly-parallel event-driven file-processing serverless applications that execute on customized runtime environments provided by Docker containers than run on an elastic Kubernetes cluster."},{category:"Data controller",details:`Grupo de Grid y Computación de Altas Prestaciones (GRyCAP) de la Universitat Politècnica de València (UPV): Universitat Politècnica de València Camino de Vera s/n Edificio 8B, Acc. N, Nivel 1. GRyCAP Valencia, Valencia 46022 Spain +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},A7="DialogDescriptionWarning",R7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Z2(A7).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},T7=F2,k7=V2,J2=z2,eI=H2,tI=G2,nI=q2,P7=X2;const Bv=T7,N7=k7,rI=p.forwardRef(({className:e,...t},n)=>f.jsx(J2,{ref:n,className:ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));rI.displayName=J2.displayName;const Ff=p.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(N7,{children:[f.jsx(rI,{}),f.jsxs(eI,{ref:r,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-slate-800 dark:bg-slate-950",e),...n,children:[t,f.jsxs(P7,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 data-[state=open]:text-slate-500 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-400",children:[f.jsx(Is,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ff.displayName=eI.displayName;const Uf=({className:e,...t})=>f.jsx("div",{className:ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Uf.displayName="DialogHeader";const sI=({className:e,...t})=>f.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sI.displayName="DialogFooter";const $f=p.forwardRef(({className:e,...t},n)=>f.jsx(tI,{ref:n,className:ae("text-lg font-semibold leading-none tracking-tight",e),...t}));$f.displayName=tI.displayName;const oI=p.forwardRef(({className:e,...t},n)=>f.jsx(nI,{ref:n,className:ae("text-sm text-slate-500 dark:text-slate-400",e),...t}));oI.displayName=nI.displayName;function Vf({isOpen:e,onClose:t,onDelete:n,itemNames:r}){const o=(Array.isArray(r)?r.length:1)===1?"item":"items",i=Array.isArray(r)?r.join(", "):r;async function a(){try{await n()}catch{Ga.error("Failed to delete item")}t()}return f.jsx(Bv,{open:e,onOpenChange:t,children:f.jsxs(Ff,{className:"sm:max-w-[425px]",children:[f.jsxs(Uf,{children:[f.jsxs($f,{className:"flex items-center gap-2",children:[f.jsx(BL,{className:"h-5 w-5 text-red-500"}),"Confirm Deletion"]}),f.jsxs(oI,{children:["Are you sure you want to delete the following ",o,"?",f.jsx("span",{className:"block mt-2 font-medium text-foreground",children:i})]})]}),f.jsxs(sI,{className:"sm:justify-start",children:[f.jsx(pe,{variant:"secondary",onClick:t,children:"Cancel"}),f.jsx(j2,{variant:"destructive",request:a,children:"Delete"})]})]})})}const iI=p.forwardRef(({className:e,...t},n)=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{ref:n,className:ae("w-full caption-bottom text-sm",e),...t})}));iI.displayName="Table";const aI=p.forwardRef(({className:e,...t},n)=>f.jsx("thead",{ref:n,className:ae("[&_tr]:border-b",e),...t}));aI.displayName="TableHeader";const lI=p.forwardRef(({className:e,...t},n)=>f.jsx("tbody",{ref:n,className:ae("[&_tr:last-child]:border-0",e),...t}));lI.displayName="TableBody";const I7=p.forwardRef(({className:e,...t},n)=>f.jsx("tfoot",{ref:n,className:ae("border-t bg-slate-100/50 font-medium [&>tr]:last:border-b-0 dark:bg-slate-800/50",e),...t}));I7.displayName="TableFooter";const zg=p.forwardRef(({className:e,...t},n)=>f.jsx("tr",{ref:n,className:ae("border-b transition-colors hover:bg-slate-100/50 data-[state=selected]:bg-slate-100 dark:hover:bg-slate-800/50 dark:data-[state=selected]:bg-slate-800",e),...t}));zg.displayName="TableRow";const Iu=p.forwardRef(({className:e,...t},n)=>f.jsx("th",{ref:n,className:ae("h-12 px-4 text-left align-middle font-medium text-slate-500 [&:has([role=checkbox])]:pr-0 dark:text-slate-400",e),...t}));Iu.displayName="TableHead";const Ou=p.forwardRef(({className:e,...t},n)=>f.jsx("td",{ref:n,className:ae("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ou.displayName="TableCell";const O7=p.forwardRef(({className:e,...t},n)=>f.jsx("caption",{ref:n,className:ae("mt-4 text-sm text-slate-500 dark:text-slate-400",e),...t}));O7.displayName="TableCaption";var Lv="Checkbox",[M7,hte]=Ho(Lv),[_7,D7]=M7(Lv),cI=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,m]=p.useState(null),g=Pe(t,S=>m(S)),y=p.useRef(!1),x=h?u||!!h.closest("form"):!0,[w=!1,v]=$s({prop:s,defaultProp:o,onChange:c}),b=p.useRef(w);return p.useEffect(()=>{const S=h==null?void 0:h.form;if(S){const E=()=>v(b.current);return S.addEventListener("reset",E),()=>S.removeEventListener("reset",E)}},[h,v]),f.jsxs(_7,{scope:n,state:w,disabled:a,children:[f.jsx(fe.button,{type:"button",role:"checkbox","aria-checked":Os(w)?"mixed":w,"aria-required":i,"data-state":fI(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:g,onKeyDown:Q(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Q(e.onClick,S=>{v(E=>Os(E)?!0:!E),x&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),x&&f.jsx(j7,{control:h,bubbles:!y.current,name:r,value:l,checked:w,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Os(o)?!1:o})]})});cI.displayName=Lv;var uI="CheckboxIndicator",dI=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=D7(uI,n);return f.jsx(lr,{present:r||Os(o.state)||o.state===!0,children:f.jsx(fe.span,{"data-state":fI(o.state),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});dI.displayName=uI;var j7=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:s,...o}=e,i=p.useRef(null),a=M0(n),l=T0(t);p.useEffect(()=>{const u=i.current,d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&m){const g=new Event("click",{bubbles:r});u.indeterminate=Os(n),m.call(u,Os(n)?!1:n),u.dispatchEvent(g)}},[a,n,r]);const c=p.useRef(Os(n)?!1:n);return f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??c.current,...o,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Os(e){return e==="indeterminate"}function fI(e){return Os(e)?"indeterminate":e?"checked":"unchecked"}var hI=cI,B7=dI;const Hg=p.forwardRef(({className:e,...t},n)=>f.jsx("div",{className:"flex items-center",children:f.jsx(hI,{ref:n,className:ae("peer h-4 w-4 shrink-0 rounded-sm border border-slate-200 border-slate-900 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=checked]:text-slate-50 dark:border-slate-800 dark:border-slate-50 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300 dark:data-[state=checked]:bg-slate-50 dark:data-[state=checked]:text-slate-900",e),...t,children:f.jsx(B7,{className:ae("flex items-center justify-center text-current"),children:f.jsx(ic,{className:"h-4 w-4"})})})}));Hg.displayName=hI.displayName;function Fv({data:e,columns:t,actions:n,idKey:r}){const[s,o]=p.useState(new Set),i=()=>{s.size===e.length?o(new Set):o(new Set(e.map(x=>x[r])))},a=x=>{const w=new Set(s);w.has(x)?w.delete(x):w.add(x),o(w)},[l,c]=p.useState(1),[u,d]=p.useState(10),h=Math.ceil(e.length/u),m=(l-1)*u,g=m+u,y=e.slice(m,g)??[];return f.jsxs("div",{className:"relative flex flex-col flex-grow flex-basis-0 overflow-y-auto",children:[f.jsx("div",{className:"flex-grow",children:f.jsxs(iI,{children:[f.jsx(aI,{className:"sticky top-0 z-10 h-[34px]",children:f.jsxs(zg,{style:{background:"white",padding:0,height:"34px",borderBottom:dt.border},children:[f.jsx(Iu,{className:"w-[50px] h-[34px]",style:{height:"34px"},children:f.jsx(Hg,{checked:e.length>0&&s.size===e.length,onCheckedChange:i})}),t.map((x,w)=>f.jsx(Iu,{style:{height:"34px"},children:x.header},w)),n&&f.jsx(Iu,{className:"text-right pr-6",style:{height:"34px"},children:"Actions"})]})}),f.jsx(lI,{children:y==null?void 0:y.map((x,w)=>f.jsxs(zg,{children:[f.jsx(Ou,{children:f.jsx(Hg,{checked:s.has(x[r]),onCheckedChange:()=>a(x[r])})}),t.map((v,b)=>f.jsx(Ou,{children:typeof v.accessor=="function"?v.accessor(x):x[v.accessor]},b)),n&&f.jsx(Ou,{children:f.jsx("div",{className:"flex justify-end",children:n.map((v,b)=>f.jsx("div",{children:v.button(x)},b))})})]},w))})]})}),f.jsxs("div",{style:{borderTop:dt.border,position:"sticky",bottom:0,left:0,background:"white",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"4px"},children:[f.jsxs("div",{className:"w-max flex items-center gap-2 pl-2",children:[f.jsx("span",{className:"w-max text-nowrap",children:"Rows per page"}),f.jsxs(Lo,{value:u.toString(),onValueChange:x=>d(Number(x)),children:[f.jsx(Vs,{className:"w-[75px]",children:f.jsx(Ji,{})}),f.jsxs(zs,{children:[f.jsx(wn,{value:"10",children:"10"}),f.jsx(wn,{value:"20",children:"20"}),f.jsx(wn,{value:"50",children:"50"}),f.jsx(wn,{value:"100",children:"100"})]})]})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(pe,{size:"icon",variant:"ghost",disabled:l===1,onClick:()=>{c(1)},children:f.jsx(vL,{})}),f.jsx(pe,{onClick:()=>c(x=>Math.max(x-1,1)),disabled:l===1,size:"icon",variant:"ghost",children:f.jsx(wL,{})}),f.jsx("span",{children:`Page ${l} of ${h}`}),f.jsx(pe,{onClick:()=>c(x=>Math.min(x+1,h)),disabled:l===h,size:"icon",variant:"ghost",children:f.jsx(xd,{})}),f.jsx(pe,{size:"icon",variant:"ghost",disabled:l===h,onClick:()=>c(h),children:f.jsx(xL,{})})]})]})]})}function L7(){const{services:e,setServices:t,orderBy:n,setFormService:r}=Pr(),[s,o]=p.useState(null);async function i(){try{const c=await F0(),u=l(c);t(u)}catch(c){We.error("Error getting services"),console.error(c)}}async function a(){if(s)try{await y7(s),await i(),We.success(`Service ${s.name} deleted successfully`)}catch(c){We.error("Error deleting service"),console.error(c)}finally{o(null)}}function l(c){switch(n){case jr.NameAsc:return c.sort((u,d)=>u.name.localeCompare(d.name));case jr.NameDesc:return c.sort((u,d)=>d.name.localeCompare(u.name));case jr.CPUAsc:return c.sort((u,d)=>Number(d.cpu)-Number(u.cpu));case jr.CPUDesc:return c.sort((u,d)=>Number(u.cpu)-Number(d.cpu));case jr.MemoryAsc:return c.sort((u,d)=>Number(d.memory)-Number(u.memory));case jr.MemoryDesc:return c.sort((u,d)=>Number(u.memory)-Number(d.memory))}return c}return U0(()=>{const c=l(e);t(c)},[n,e]),f.jsxs("div",{style:{display:"flex",flexDirection:"column",flexGrow:1,flexBasis:0,overflow:"hidden"},children:[f.jsx(Fv,{data:e,idKey:"name",columns:[{header:"Name",accessor:"name"},{header:"Image",accessor:"image"},{header:"CPU",accessor:"cpu"},{header:"Memory",accessor:"memory"}],actions:[{button:()=>f.jsx(pe,{variant:"link",size:"icon",children:f.jsx(RL,{})})},{button:()=>f.jsx(pe,{variant:"link",size:"icon",children:f.jsx(jL,{})})},{button:c=>f.jsx(pn,{to:`/ui/services/${c.name}/settings`,replace:!0,onClick:()=>{r(c)},children:f.jsx(pe,{variant:"link",size:"icon",children:f.jsx(bT,{})})})},{button:c=>f.jsx(pe,{variant:"link",size:"icon",onClick:()=>o(c),children:f.jsx(y0,{color:ke.Red})})}]}),f.jsx(Vf,{isOpen:!!s,onClose:()=>o(null),onDelete:a,itemNames:(s==null?void 0:s.name)||""})]})}function F7({tab:e,setTab:t}){return f.jsx("div",{style:{background:"white",borderBottom:dt.border,display:"flex",flexDirection:"row",padding:"0 16px"},children:Object.keys(bs).filter(n=>isNaN(Number(n))).map(n=>{const r=n===bs[e];return f.jsxs("div",{style:{height:34,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 16px",cursor:"pointer",position:"relative"},onClick:()=>t(bs[n]),children:[r&&f.jsx("div",{style:{position:"absolute",bottom:-1,left:0,height:1,width:"100%",background:"black"}}),n]},n)})})}function U7(){const{formService:e,setFormService:t}=Pr(),n=p.useMemo(()=>{var a;const o=(a=e.environment)==null?void 0:a.Variables,i=o?Object.entries(o).map(([l,c])=>({key:l,value:c})):[];return i.length===0&&i.push({key:"",value:""}),i},[e]),[r,s]=p.useState(n);return p.useEffect(()=>{t(o=>({...o,environment:{...o.environment,Variables:r.reduce((i,a)=>(i[a.key]=a.value,i),{})}}))},[r]),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"9px"},children:[r.map((o,i)=>f.jsxs("div",{style:{display:"flex",gap:"5px",alignItems:"center"},children:[f.jsx(Ke,{value:o.key,onChange:a=>{const l=[...r];l[i].key=a.target.value,s(l)},placeholder:"Variable name"}),f.jsx(Ke,{type:"password",value:o.value,onFocus:a=>a.target.type="text",onBlur:a=>a.target.type="password",style:{width:300},onChange:a=>{const l=[...r];l[i].value=a.target.value,s(l)},placeholder:"Value"}),r.length>1&&f.jsx(pe,{size:"icon",variant:"ghost",onClick:()=>{const a=r.filter((l,c)=>c!==i);s(a)},children:f.jsx(Is,{size:16})})]},i)),f.jsxs(pe,{size:"sm",style:{width:"max-content"},onClick:()=>{s([...r,{key:"",value:""}])},children:[f.jsx(ac,{className:"h-4 w-4 mr-2"})," Add Variable"]})]})}function Ui({title:e,subtitle:t,children:n,button:r}){return f.jsxs("div",{style:{display:"flex",flexDirection:"column",flexWrap:"wrap",width:"100%",padding:18,margin:0},children:[f.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:18},children:[f.jsxs("div",{children:[f.jsx("h1",{style:{color:ke.DarkGrayText,fontSize:14},children:e}),f.jsx("h2",{style:{fontSize:16,fontWeight:"bold"},children:t})]}),r]}),f.jsx("div",{style:{display:"flex",width:"100%",gap:18,alignItems:"end"},children:n})]})}function $7(){const{setFormService:e}=Pr(),[t,n]=p.useState("file"),[r,s]=p.useState(""),[o,i]=p.useState(""),a=c=>{var d;const u=(d=c.target.files)==null?void 0:d[0];if(u){const h=new FileReader;h.onload=m=>{var y;const g=(y=m.target)==null?void 0:y.result;s(g),e(x=>({...x,script:g}))},h.readAsText(u)}},l=c=>{const u=c.target.value;i(u),e(d=>({...d,script:u}))};return f.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"end"},children:[f.jsxs("div",{children:[f.jsx(Zn,{children:"Script upload method"}),f.jsxs(Lo,{value:t,onValueChange:c=>n(c),children:[f.jsx(Vs,{className:"w-[180px]",children:f.jsx(Ji,{placeholder:"Select upload method"})}),f.jsxs(zs,{children:[f.jsx(wn,{value:"file",children:"File Upload"}),f.jsx(wn,{value:"url",children:"URL"})]})]})]}),t==="file"?f.jsx("div",{children:f.jsx(Ke,{type:"file",onChange:a,className:"bg-white"})}):f.jsx(Ke,{type:"url",placeholder:"Enter script URL",value:o,onChange:l,width:"275px"})]})}const Wg=({orientation:e="horizontal"})=>f.jsx("div",{style:{width:e==="horizontal"?"100%":"1px",height:e==="horizontal"?"1px":"100%",borderTop:dt.border}});function V7(){var o,i,a;const{formService:e,setFormService:t}=Pr();function n(l,c){t(u=>({...u,[c]:l.target.value}))}const[r,s]=p.useState("Mi");return f.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"flex-start"},children:[f.jsx(Ui,{title:"General Settings",subtitle:"Configure the service name and a container image to use",children:f.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",gap:10},children:[f.jsxs("section",{style:{display:"flex",flexDirection:"row",width:"100%",gap:10},children:[f.jsx(Ke,{flex:1,value:e==null?void 0:e.name,onChange:l=>{n(l,"name")},label:"Service name"}),f.jsx(Ke,{flex:2,value:e==null?void 0:e.image,label:"Docker image",onChange:l=>{n(l,"image")}})]}),f.jsxs("div",{className:"flex flex-row w-full items-end",children:[e.token&&f.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"end",width:"50%",gap:10},children:[f.jsx(Ke,{value:e==null?void 0:e.token,readOnly:!0,label:"Token",type:"password",width:"80%"}),f.jsx(pe,{variant:"ghost",style:{height:"39px"},onClick:()=>{navigator.clipboard.writeText((e==null?void 0:e.token)||""),We.success("Token copied to clipboard")},children:f.jsx(g0,{})})]}),f.jsxs("div",{style:{width:"50%",display:"flex",flexDirection:"column",gap:"0.375rem"},children:[f.jsx(Zn,{children:"Log level"}),f.jsxs(Lo,{value:e==null?void 0:e.log_level,onValueChange:l=>{t(c=>({...c,log_level:l}))},children:[f.jsx(Vs,{children:f.jsx(Ji,{placeholder:"Log level"})}),f.jsx(zs,{children:Object.values(L0).map(l=>f.jsx(wn,{value:l,children:l},l))})]})]})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:50},children:[f.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[f.jsx("strong",{children:"Alpine:"}),e.alpine?f.jsx(ic,{size:16}):f.jsx(Is,{size:16,className:"pt-[2px]"})]}),f.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[f.jsx("strong",{children:"Interlink:"}),e.interlink_node_name?e.interlink_node_name:f.jsx(Is,{size:16,className:"pt-[2px]"})]}),f.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[f.jsx("strong",{children:"Allowed users:"}),(o=e.allowed_users)!=null&&o.length?e.allowed_users.join(", "):f.jsx(Is,{size:16,className:"pt-[2px]"})]})]})]})}),f.jsx(Wg,{}),f.jsx(Ui,{title:"Service specifications",subtitle:"Adjust container resources and provide a script for the processing of files",children:f.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",gap:10},children:[f.jsx($7,{}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%",alignItems:"end",gap:10},children:[f.jsx(Ke,{value:e==null?void 0:e.cpu,onChange:l=>{n(l,"cpu")},label:"CPU cores"}),f.jsx(Ke,{value:(a=(i=e==null?void 0:e.memory)==null?void 0:i.replace("Mi",""))==null?void 0:a.replace("Gi",""),label:"Memory",onChange:l=>{t(c=>({...c,memory:l.target.value+r}))},type:"number"}),f.jsxs(Lo,{value:r,onValueChange:l=>{s(l)},children:[f.jsx(Vs,{className:"w-[75px]",children:f.jsx(Ji,{placeholder:"Order by"})}),f.jsxs(zs,{children:[f.jsx(wn,{value:"Mi",children:"Mi"}),f.jsx(wn,{value:"Gi",children:"Gi"})]})]})]})]})}),f.jsx(Wg,{}),f.jsx(Ui,{title:"Enviroment variables",subtitle:"Provide environment variables to the service adding them here",children:f.jsx(U7,{})})]})}function z7({setSelectedProvider:e}){return f.jsxs(sN,{children:[f.jsx(oN,{asChild:!0,children:f.jsxs(pe,{children:[f.jsx(ac,{className:"h-4 w-4 mr-2"}),"Add provider"]})}),f.jsxs(Z0,{children:[f.jsx(ev,{children:"Available providers:"}),f.jsx(tv,{}),f.jsx(iN,{children:f.jsx(J0,{onClick:()=>{e({type:"minio"})},children:"Minio"})})]})]})}function H7(){const{formService:e,setFormService:t}=Pr(),n=p.useMemo(()=>{const i=e.storage_providers,a=[];return Object.keys(i).forEach(l=>{const c=i[l];c&&Object.entries(c).forEach(([u,d])=>{a.push({...d,id:u,type:l})})}),a},[]),[r,s]=p.useState(n);async function o(){let i={};r.forEach(a=>{const{type:l,...c}=a;i={...i,[a.type]:{...i[a.type],[a.id]:c}}}),t(a=>({...a,storage_providers:i}))}return U0(()=>{o()},[r]),{providers:r,setProviders:s}}const W7="/assets/minio-Cl9aXDmH.png";function G7({provider:e,setSelectedProvider:t,setSelectedId:n,onDelete:r}){function s(){switch(e.type){case"minio":return W7;default:return}}function o(){switch(e.type){case"minio":return e.endpoint;default:return}}return f.jsxs("div",{style:{flexGrow:1,maxWidth:"32.8%",height:72,border:dt.border,background:"white",borderRadius:8,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:16,padding:10,paddingLeft:14},children:[f.jsx("img",{src:s(),alt:"Provider logo",style:{width:"30%"}}),f.jsxs("div",{style:{flexGrow:1,flexBasis:0,overflow:"hidden"},children:[f.jsx("h1",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.id}),f.jsx("h2",{style:{color:ke.DarkGrayText,maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:o()})]}),f.jsxs("div",{children:[f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>{t(e),n(e.id)},children:f.jsx(DL,{})}),f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>{r(e.id)},children:f.jsx(y0,{color:ke.Red})})]})]})}var Uv="Switch",[K7,pte]=Ho(Uv),[q7,Y7]=K7(Uv),pI=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[h,m]=p.useState(null),g=Pe(t,b=>m(b)),y=p.useRef(!1),x=h?u||!!h.closest("form"):!0,[w=!1,v]=$s({prop:s,defaultProp:o,onChange:c});return f.jsxs(q7,{scope:n,checked:w,disabled:a,children:[f.jsx(fe.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":yI(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:g,onClick:Q(e.onClick,b=>{v(S=>!S),x&&(y.current=b.isPropagationStopped(),y.current||b.stopPropagation())})}),x&&f.jsx(X7,{control:h,bubbles:!y.current,name:r,value:l,checked:w,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});pI.displayName=Uv;var mI="SwitchThumb",gI=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Y7(mI,n);return f.jsx(fe.span,{"data-state":yI(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});gI.displayName=mI;var X7=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=p.useRef(null),i=M0(n),a=T0(t);return p.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[i,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function yI(e){return e?"checked":"unchecked"}var vI=pI,Q7=gI;const xI=p.forwardRef(({className:e,...t},n)=>f.jsx(vI,{className:ae("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-300 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:n,children:f.jsx(Q7,{className:ae("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));xI.displayName=vI.displayName;function Z7({selectedProvider:e,setSelectedProvider:t}){const n=e,r=(s,o)=>{t(i=>i?{...i,[s]:o}:null)};return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[f.jsx(Ke,{value:e.id,autoFocus:!1,placeholder:"ID",label:"ID",onChange:s=>r("id",s.target.value)}),f.jsx(Ke,{value:n.endpoint,placeholder:"Endpoint",label:"Endpoint",onChange:s=>r("endpoint",s.target.value)}),f.jsx(Ke,{value:n.region,placeholder:"Region",label:"Region",onChange:s=>r("region",s.target.value)}),f.jsx(Ke,{value:n.access_key,placeholder:"Access key",title:"Access Key",label:"Access key",type:"password",onChange:s=>r("access_key",s.target.value)}),f.jsx(Ke,{value:n.secret_key,placeholder:"Secret access key",title:"Secret Access Key",label:"Secret access key",type:"password",onChange:s=>r("secret_key",s.target.value)}),f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(xI,{checked:n.verify,onCheckedChange:s=>r("verify",s)}),f.jsx(Zn,{children:"Verify"})]})]})}function J7({onClose:e,selectedProvider:t,setSelectedProvider:n,onUpdate:r}){return f.jsx(Bv,{defaultOpen:!0,onOpenChange:e,children:f.jsxs(Ff,{style:{paddingBottom:"1rem"},children:[f.jsx(Uf,{children:f.jsxs($f,{children:[t.type.charAt(0).toUpperCase()+t.type.slice(1)," "," provider configuration"]})}),t.type==="minio"&&f.jsx(Z7,{selectedProvider:t,setSelectedProvider:n}),f.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:f.jsx(pe,{variant:"mainGreen",onClick:()=>{r(),e()},children:"Save"})})]})})}function eH(){const{providers:e,setProviders:t}=H7(),[n,r]=p.useState(null),[s,o]=p.useState(null);function i(){t(h=>(!n&&h.push(s),h.map(y=>y.id===n?s:y)))}function a(h){t(m=>m.filter(g=>g.id!==h)),u(null)}function l(){r(null),o(null)}const[c,u]=p.useState(null),d=c!==null;return f.jsxs(f.Fragment,{children:[d&&f.jsx(Vf,{isOpen:d,onClose:()=>u(null),onDelete:()=>a(c),itemNames:c}),s&&f.jsx(J7,{selectedProvider:s,onClose:l,onUpdate:i,setSelectedProvider:o}),f.jsx("div",{style:{flexGrow:1,flexBasis:0,display:"flex",flexDirection:"column"},children:f.jsx(Ui,{title:"Storage configuration",subtitle:"Set up the credentials of the storage providers",button:f.jsx(z7,{setSelectedProvider:o}),children:f.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",width:"100%",gap:"10px"},children:e.map((h,m)=>f.jsx(G7,{provider:h,setSelectedProvider:o,setSelectedId:r,onDelete:()=>{u(h.id)}},m))})})})]})}const tH=gf("inline-flex items-center rounded-full border border-slate-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 dark:border-slate-800 dark:focus:ring-slate-300",{variants:{variant:{default:"border-transparent bg-slate-900 text-slate-50 hover:bg-slate-900/80 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50/80",secondary:"border-transparent bg-slate-100 text-slate-900 hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80",destructive:"border-transparent bg-red-500 text-slate-50 hover:bg-red-500/80 dark:bg-red-900 dark:text-slate-50 dark:hover:bg-red-900/80",outline:"text-slate-950 dark:text-slate-50"}},defaultVariants:{variant:"default"}});function Pi({className:e,variant:t,...n}){return f.jsx("div",{className:ae(tH({variant:t}),e),...n})}function nH(){const{formService:e,setFormService:t}=Pr(),n=e.storage_providers,[r,s]=p.useState(null),[o,i]=p.useState(!1),[a,l]=p.useState("inputs"),c=g=>{const y={...e};a==="inputs"?r!==null?y.input[r.index]=g:y.input.push(g):r!==null?y.output[r.index]=g:y.output.push(g),t(y),i(!1),s(null)},u=(g,y)=>{const x={...e};g==="inputs"?x.input.splice(y,1):x.output.splice(y,1),t(x)},d=(g,y,x)=>{l(g),s({item:y,index:x}),i(!0)},h=g=>{l(g),s(null),i(!0)},m=(g,y)=>f.jsxs(f.Fragment,{children:[y.length===0&&f.jsxs("div",{style:{textAlign:"center",color:ke.DarkGrayText},children:["No ",g," defined yet."]}),y.map((x,w)=>{var v,b,S,E;return f.jsxs("div",{style:{border:dt.border,background:"white",height:74,borderRadius:8,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:16,padding:"10px 14px"},children:[f.jsxs("div",{style:{display:"flex",height:"100%",flexDirection:"column",justifyContent:"space-evenly"},children:[f.jsx("h1",{children:x.storage_provider}),f.jsx("h3",{style:{fontSize:12,color:ke.DarkGrayText},children:x.path})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",rowGap:8},children:[f.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-baseline",children:[f.jsx("h3",{style:{fontSize:12,color:ke.DarkGrayText},children:"Prefixes:"}),(v=x.prefix)==null?void 0:v.slice(0,3).map((R,T)=>f.jsx(Pi,{variant:"secondary",style:{maxWidth:"100px",overflow:"hidden"},children:f.jsx("span",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:R})},`prefix-${T}`)),((b=x.prefix)==null?void 0:b.length)>3&&f.jsxs(Pi,{variant:"secondary",children:["+",x.prefix.length-3]})]}),f.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-baseline",children:[f.jsx("h3",{style:{fontSize:12,color:ke.DarkGrayText},children:"Suffixes:"}),(S=x.suffix)==null?void 0:S.slice(0,3).map((R,T)=>f.jsx(Pi,{variant:"secondary",style:{maxWidth:"100px",overflow:"hidden"},children:f.jsx("span",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:R})},`suffix-${T}`)),((E=x.suffix)==null?void 0:E.length)>3&&f.jsxs(Pi,{variant:"secondary",children:["+",x.suffix.length-3]})]})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>d(g,x,w),children:f.jsx(bT,{})}),f.jsx(pe,{style:{minWidth:40,height:40},size:"icon",variant:"ghost",onClick:()=>u(g,w),children:f.jsx(y0,{color:ke.Red})})]})]})})]});return f.jsxs("div",{style:{display:"flex",flexDirection:"column",flexGrow:1,flexBasis:0,overflow:"auto"},children:[f.jsx("div",{style:{width:"100%",minHeight:"50%"},children:f.jsx(Ui,{title:"Inputs",subtitle:"Define the input paths for your service.",button:f.jsxs(pe,{variant:"default",onClick:()=>h("inputs"),children:[f.jsx(hb,{className:"mr-2 h-4 w-4"}),"Add Input"]}),children:f.jsx("div",{style:{display:"flex",flexDirection:"row",gap:16,flexWrap:"wrap"},children:m("inputs",e.input)})})}),f.jsx(Wg,{}),f.jsx(Ui,{title:"Outputs",subtitle:"Define the output paths for your service.",button:f.jsxs(pe,{variant:"default",onClick:()=>h("outputs"),children:[f.jsx(hb,{className:"mr-2 h-4 w-4"}),"Add Output"]}),children:f.jsx("div",{style:{display:"flex",flexGrow:1,flexDirection:"row",gap:16,flexWrap:"wrap"},children:m("outputs",e.output)})}),f.jsx(Bv,{open:o,onOpenChange:i,children:f.jsxs(Ff,{children:[f.jsx(Uf,{children:f.jsxs($f,{children:[r?"Edit":"Create"," ",a==="inputs"?"Input":"Output"]})}),f.jsx(rH,{providers:n,item:r?r.item:{storage_provider:"",path:"",prefix:[],suffix:[]},onSave:c})]})})]})}function rH({item:e,onSave:t}){var g,y;const[n,r]=p.useState({...e,storage_provider:e.storage_provider||"minio.default",prefix:e.prefix||[],suffix:e.suffix||[]}),[s,o]=p.useState(""),[i,a]=p.useState(""),l=(x,w)=>{r(v=>({...v,[x]:w}))},c=()=>{s.trim()&&(r(x=>({...x,prefix:[...x.prefix,s.trim()]})),o(""))},u=()=>{i.trim()&&(r(x=>({...x,suffix:[...x.suffix,i.trim()]})),a(""))},d=x=>{r(w=>({...w,prefix:w.prefix.filter((v,b)=>b!==x)}))},h=x=>{r(w=>({...w,suffix:w.suffix.filter((v,b)=>b!==x)}))},m=(x,w)=>{x.key==="Enter"&&(w==="prefix"?c():u())};return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"provider",children:"Provider"}),f.jsxs(Lo,{value:n.storage_provider,onValueChange:x=>l("storage_provider",x),children:[f.jsx(Vs,{id:"provider",children:f.jsx(Ji,{placeholder:"Select a provider"})}),f.jsx(zs,{children:f.jsx(wn,{value:"minio.default",children:"minio.default"},"minio")})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"path",children:"Path"}),f.jsx(Ke,{id:"path",value:n.path,autoFocus:!0,onChange:x=>l("path",x.target.value)})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"prefix",children:"Prefixes"}),f.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(g=n.prefix)==null?void 0:g.map((x,w)=>f.jsxs(Pi,{variant:"secondary",children:[x,f.jsxs(pe,{variant:"ghost",size:"sm",className:"ml-1 h-4 w-4 p-0",onClick:()=>d(w),children:[f.jsx(Is,{className:"h-3 w-3"}),f.jsx("span",{className:"sr-only",children:"Remove prefix"})]})]},w))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ke,{id:"new-prefix",value:s,onChange:x=>o(x.target.value),onKeyPress:x=>m(x,"prefix"),placeholder:"Add new prefix"}),f.jsx(pe,{onClick:c,children:"Add"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Zn,{htmlFor:"suffix",children:"Suffixes"}),f.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(y=n.suffix)==null?void 0:y.map((x,w)=>f.jsxs(Pi,{variant:"outline",children:[x,f.jsxs(pe,{variant:"ghost",size:"sm",className:"ml-1 h-4 w-4 p-0",onClick:()=>h(w),children:[f.jsx(Is,{className:"h-3 w-3"}),f.jsx("span",{className:"sr-only",children:"Remove suffix"})]})]},w))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ke,{id:"new-suffix",value:i,onChange:x=>a(x.target.value),onKeyPress:x=>m(x,"suffix"),placeholder:"Add new suffix"}),f.jsx(pe,{onClick:u,children:"Add"})]})]}),f.jsx(pe,{onClick:()=>t(n),children:"Save"})]})}function l1(){const{formService:e}=Pr(),[t,n]=p.useState(bs.General);return Object.keys(e).length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(F7,{tab:t,setTab:n}),f.jsxs("div",{style:{display:"flex",flexGrow:1,flexBasis:0,overflow:"scroll"},children:[t===bs.General&&f.jsx(V7,{}),t===bs.Storage&&f.jsx(eH,{}),t===bs["Input - Output"]&&f.jsx(nH,{})]})]})}function sH(){return f.jsx(p0,{children:f.jsxs(kt,{path:"/",element:f.jsx(w6,{children:f.jsxs("div",{style:{flexGrow:1,flexBasis:0,display:"flex",flexDirection:"column"},children:[f.jsx(g7,{}),f.jsx(h0,{})]})}),children:[f.jsx(kt,{path:"",element:f.jsx(L7,{})}),f.jsx(kt,{path:":serviceId",element:f.jsx(l1,{})}),f.jsx(kt,{path:":serviceId/settings",element:f.jsx(l1,{})}),f.jsx(kt,{path:":serviceId/logs",element:f.jsx("h1",{children:"logs"})})]})})}function oH({value:e}){return p.useEffect(()=>{document.title=e},[e]),null}var iH="Separator",c1="horizontal",aH=["horizontal","vertical"],wI=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=c1,...s}=e,o=lH(r)?r:c1,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return f.jsx(fe.div,{"data-orientation":o,...a,...s,ref:t})});wI.displayName=iH;function lH(e){return aH.includes(e)}var bI=wI;const SI=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>f.jsx(bI,{ref:s,decorative:n,orientation:t,className:ae("shrink-0 bg-slate-200 dark:bg-slate-800",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));SI.displayName=bI.displayName;const cH="/assets/egi-BuAf2fET.svg",ai={provider_url:"https://aai-dev.egi.eu/auth/realms/egi/protocol/",client_id:"f997c320-e51f-4309-957e-8af004495aab",redirect_uri:`${location.origin}/callback.html`,url_authorize:"https://aai-dev.egi.eu/auth/realms/egi/protocol/openid-connect/auth",url_user_info:"https://aai-dev.egi.eu/auth/realms/egi/protocol/openid-connect/userinfo",token_endpoint:"https://aai-dev.egi.eu/auth/realms/egi/protocol/openid-connect/token",api:"",deploy_container:"false",minio_local_endpoint:"localhost",minio_local_port:"30300",minio_local_ssl:!1,response_default_minio:"minio.minio",external_ui:"https://ui.oscar.grycap.net/?endpoint=",ai4eosc_servers:["https://inference.cloud.ai4eosc.eu"],imagine_servers:["https://inference.cloud.imagine-ai.eu","https://inference-walton.cloud.imagine-ai.eu"],juno:{repo:"https://raw.githubusercontent.com/grycap/oscar-juno/main/",service:"juno.yaml",script:"script.sh"}};function uH(){const e=ma(),{authData:t,setAuthData:n}=oc();async function r(o){o.preventDefault();const i=o.target,a=new FormData(i),l=a.get("endpoint"),c=a.get("username"),u=a.get("password"),d=void 0;if(!l.match(/^(http|https):\/\/[^ "]+$/)){We.error("Invalid endpoint");return}try{await aT({endpoint:l,username:c,password:u,token:d}),n({authenticated:!0,user:c,password:u,endpoint:l})}catch{We.error("Invalid credentials")}}async function s(o){o.preventDefault();const i=o.target;let l=new FormData(i).get("endpoint");if(!l.match(/^(http|https):\/\/[^ "]+$/)){We.error("Invalid endpoint");return}try{l=l.endsWith("/")?l.slice(0,-1):l,localStorage.setItem("api",l),localStorage.setItem("client_id",ai.client_id),localStorage.setItem("provider_url",ai.provider_url),localStorage.setItem("url_authorize",ai.url_authorize),localStorage.setItem("url_user_info",ai.url_user_info),localStorage.setItem("token_endpoint",ai.token_endpoint),window.location.replace(ai.redirect_uri)}catch{We.error("Invalid credentials")}}return p.useEffect(()=>{t!=null&&t.authenticated&&e("/")},[t]),p.useEffect(()=>{document.title="OSCAR - Login"},[]),f.jsxs(f.Fragment,{children:[f.jsx(oH,{value:"Login"}),f.jsx("main",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw",backgroundColor:m0(ke.Green1,.75)},children:f.jsxs("div",{style:{position:"relative",paddingBottom:"100px"},children:[f.jsxs("div",{style:{position:"absolute",background:"#FFFFFF50",border:`1px solid ${ke.Green1}`,width:"100%",height:"100px",bottom:50,borderRadius:"0 0 30px 30px",zIndex:0,display:"flex",flexDirection:"column"},children:[f.jsx("div",{style:{height:"50px"}}),f.jsxs("div",{style:{flex:1,display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"10px",color:"rgba(0,0,0,0.5)",padding:"0 20px"},children:[f.jsxs("div",{children:["© 2021 ",f.jsx("a",{href:"https://oscar.grycap.net",children:"Oscar"})]}),f.jsxs("div",{children:[f.jsx("a",{href:"https://grycap.upv.es/",children:"GRyCAP-I3M-UPV"}),", Universitat Politècnica de València, Spain."]})]})]}),f.jsxs("section",{style:{zIndex:2,borderRadius:"30px",display:"flex",flexDirection:"column",background:"white",alignItems:"center",padding:"36px 48px",gap:"26px",border:`1px solid ${ke.Green1}`,position:"relative"},children:[f.jsx("img",{src:yT,alt:"Oscar logo",width:320}),f.jsxs("form",{onSubmit:o=>{let i=o.nativeEvent.submitter;if(i!=null){let a=i.getAttribute("name");a==="normal"&&r(o),a==="EGI"&&s(o)}},style:{width:"320px",display:"flex",flexDirection:"column",gap:"15px"},children:[f.jsx(Ke,{name:"endpoint",placeholder:"Endpoint"}),f.jsx(Ke,{name:"username",type:"text",placeholder:"Username"}),f.jsx(Ke,{name:"password",type:"password",placeholder:"Password"}),f.jsx(pe,{name:"normal",type:"submit",size:"sm",style:{background:ke.Green4},children:"Login"}),f.jsx(SI,{}),f.jsxs(pe,{name:"EGI",type:"submit",size:"sm",style:{width:"100%",background:ke.Blue},children:[f.jsx("img",{src:cH,alt:"EGI Check-in",style:{width:"24px",marginRight:"10px"}}),"Login via EGI Check-in"]})]})]})]})})]})}function dH(){const e=[{category:"Name of the service",details:"OSCAR"},{category:"URLs of the service",details:"https://ui.oscar.grycap.net/"},{category:"Description of the service",details:"OSCAR is an open-source platform to support the Functions as a Service (FaaS) computing model for file-processing applications. It can be automatically deployed on multi-Clouds in order to create highly-parallel event-driven file-processing serverless applications that execute on customized runtime environments provided by Docker containers than run on an elastic Kubernetes cluster."},{category:"Data controller",details:`Grupo de Grid y Computación de Altas Prestaciones (GRyCAP) de la Universitat Politècnica de València (UPV): Universitat Politècnica de València Camino de Vera s/n Edificio 8B, Acc. N, Nivel 1. GRyCAP Valencia, Valencia 46022 Spain email: products@grycap.upv.es`},{category:"Jurisdiction",details:"ES.Spain (Valencia)"},{category:"Personal data processed",details:"None"},{category:"Purpose of the processing of personal data",details:"None"},{category:"Third parties to whom personal data is disclosed",details:"None"},{category:"How to access, rectify and delete the personal data",details:"Contact the email: products@grycap.upv.es. To rectify the data released by your Home Organisation, contact your Home Organisation's IT helpdesk"},{category:"Data retention",details:"No personal data is retained"},{category:"Data Protection Code of Conduct",details:f.jsxs(f.Fragment,{children:["Your personal data, if any, will be protected according to the"," ",f.jsx(pn,{to:"http://www.geant.net/uri/dataprotection-code-of-conduct/v1",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500",children:"Code of Conduct for Service Providers"}),", a common standard for the research and higher education sector to protect your privacy"]})},{category:"Cookies",details:f.jsxs(f.Fragment,{children:["This site uses an internal cookie only to maintain user sessions with the server. Our website uses Google Analytics. For more information about privacy at Google Analytics, please see"," ",f.jsx(pn,{to:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500",children:"Google's privacy policy"}),". You can prevent the collection of the data generated by the cookie and transmission to Google by modifying the Cookies Consent."]})}];return f.jsxs("div",{className:"container mx-auto px-4 py-8",children:[f.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Privacy Policy for OSCAR"}),f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"min-w-full bg-white border border-gray-300",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"bg-gray-100",children:[f.jsx("th",{className:"py-2 px-4 border-b text-left",children:"Category"}),f.jsx("th",{className:"py-2 px-4 border-b text-left",children:"Details"})]})}),f.jsx("tbody",{children:e.map((t,n)=>f.jsxs("tr",{className:n%2===0?"bg-gray-50":"bg-white",children:[f.jsx("td",{className:"py-2 px-4 border-b font-medium",children:t.category}),f.jsx("td",{className:"py-2 px-4 border-b whitespace-pre-wrap",children:t.details})]},n))})]})})]})}function fH(){return f.jsxs("div",{className:"container mx-auto py-8 px-4 overflow-y-scroll h-screen",children:[f.jsx("h1",{className:"text-3xl font-bold mb-5",children:"Terms of Use"}),f.jsxs("div",{className:"space-y-6",children:[f.jsxs("p",{children:["Thank you for visiting the ",f.jsx("strong",{children:"OSCAR"})," website provided by the"," ",f.jsx("a",{href:"http://www.grycap.upv.es",className:"text-blue-600 hover:underline",children:"GRyCAP"})," ","research group from the"," ",f.jsx("a",{href:"http://www.i3m.upv.es/",className:"text-blue-600 hover:underline",children:"Instituto de Instrumentación para Imagen Molecular (I3M)"})," ","at the"," ",f.jsx("a",{href:"http://www.upv.es",className:"text-blue-600 hover:underline",children:"Universitat Politécnica de València (UPV)"}),`, located at Camino de Vera S/N, Spain (the "Provider"). These Terms of Use ("TOU") represent a binding legal contract between you and the Provider. The TOU mandate your access to and the use of Provider's website, together with all content, services available at or through any service linking to this TOU (the "Services").`]}),f.jsxs("p",{children:[f.jsx("strong",{children:"IMPORTANT:"})," Please read the TOU carefully before using any of the Services. Using any of the Services states that you accept and agree to be bound by the TOU. Services must not be used unless you accept the TOU. The Provider may change or modify the Services or the TOU at any time. Such changes, revisions, or modifications shall be effective immediately upon being posted in relation to the Services. Any use of the Services by you after we post changes to the TOU constitutes your acceptance of those changes."]}),f.jsx("p",{children:"THESE TOU CONTAIN DISCLAIMERS OF WARRANTIES (SECTION 4), DISCLAIMERS OF LIABILITY AND AN EXCLUSIVE REMEDY (SECTION 5), AS WELL AS INFORMATION ABOUT CERTAIN LIMITATIONS ON YOUR ABILITY TO BRING A CLAIM AGAINST US (SECTION 10)."}),f.jsx("p",{children:"The minimum age to use the Services is 16 years. Services are only offered to users that are at least 16 years old. Any person who registers as a user or provides his/her personal information on the Services represents that he/she is 16 years of age or older."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"1. Access and Use of the Services"}),f.jsx("p",{children:"You must not access or use the Services for any unlawful or unauthorized purpose. International users agree to comply with all local laws regarding privacy and the protection of personal data, online conduct and the legality of content."}),f.jsx("p",{children:'You may not access or use, or attempt to access or use, the Services to take any action that could harm us or any person or entity (a "person"), interfere with the operation of the Services, or use the Services in a manner that violates any laws. For example, and without limitation, you may not:'}),f.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[f.jsx("li",{children:"Impersonate any person or falsely state or otherwise misrepresent your credentials, affiliation with any person, or the origin of any information you provide;"}),f.jsx("li",{children:"Engage in unauthorized spidering, scraping, or harvesting of content or information, or use any other unauthorized automated means to compile information;"}),f.jsx("li",{children:"Obtain or attempt to gain unauthorized access to other computer systems, materials, information or any services available on or through the Services;"}),f.jsx("li",{children:"Use any device, software, or routine to interfere or attempt to interfere with the proper working of the Services or any activity conducted on the Services or attempt to probe, scan, test the vulnerability of, or breach the security of any system, device or network;"}),f.jsx("li",{children:"Circumvent, reverse engineer, decipher, decompile, disassemble, decrypt, or otherwise alter or interfere with (or attempt, encourage, or support anyone else's attempt to engage in such activities) any of the software comprising or in any way making up a part of the Services. The use or distribution of tools designed for compromising security (e.g., password guessing programs, cracking tools or network probing tools) is strictly prohibited;"}),f.jsx("li",{children:"Take any action that imposes an unreasonable or disproportionately large load on our network or infrastructure;"}),f.jsx("li",{children:"Upload or otherwise transmit any communication, software, or material that contains a virus or is otherwise harmful to the computers, devices or systems of the Provider or its users; or"}),f.jsx("li",{children:"Engage in any other conduct that restricts or inhibits any person from using or enjoying the Services, or that, in our sole judgment, exposes us or any of our affiliates, users or any other third party to any liability, damages, or detriment of any type."})]}),f.jsx("p",{children:"You agree that we reserve the right to monitor the use of the Services. Violations of system or network security and certain other conduct may result in civil or criminal liability. We may investigate and work with law enforcement authorities to prosecute users who violate the TOU. We may suspend or terminate your access to the Services for any or no reason at any time without notice."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"2. Account/Service Termination"}),f.jsx("p",{children:"You agree and understand that the Provider may terminate your access to the Services without any previous notice and may destroy any data stored with the Provider. If the Provider receives notice alleging that you have engaged in infringing behaviour the Provider or others or applicable laws, The Provider may, at their discretion, suspend Services without notice. The Provider is not liable to you or to any third party for the termination of your account and for the interruption of the Services."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"3. User Responsibilities"}),f.jsx("p",{children:"You are fully responsible and liable for what you copy, share, upload, download and all other activities performed within your account and with the Services. You must not upload spyware or any other malicious software to the Services. The Provider is not liable for any loss or corruption of your data or for any costs or expenses associated with backing up or restoring any of your data entrusted to the Provider."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"4. Disclaimer of Warranties"}),f.jsx("p",{children:'YOUR USE OF THE SERVICES IS ENTIRELY AT YOUR OWN RISK. WE MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SERVICES, INCLUDING WITHOUT LIMITATION THE OPERATION OF THE SERVICES OR THE INFORMATION, MATERIALS, OR SERVICES APPEARING OR OFFERED ON THE SERVICES OR WITH RESPECT TO ANY WEBSITES OR SERVICES LINKED FROM THE SERVICES. THE SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE." WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, WE DISCLAIM ALL WARRANTIES, EXPRESS, STATUTORY OR IMPLIED, INCLUDING BUT NOT LIMITED TO (I) THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE; (II) THE WARRANTIES AGAINST INFRINGEMENT, MISAPPROPRIATION OR VIOLATION OF ANY INTELLECTUAL PROPERTY OR PROPRIETARY RIGHTS OF ANY PERSON; (III) WARRANTIES ARISING THROUGH COURSE OF DEALING OR USAGE IN TRADE; AND (IV) THE WARRANTIES RELATING TO THE ACCURACY, RELIABILITY, CORRECTNESS, OR COMPLETENESS OF DATA OR CONTENT MADE AVAILABLE ON THE SERVICES OR OTHERWISE BY THE PROVIDER. FURTHER, THERE IS NO WARRANTY THAT THE SERVICES WILL MEET YOUR NEEDS OR REQUIREMENTS OR THE NEEDS OR REQUIREMENTS OF ANY OTHER PERSON OR THE NEEDS OR REQUIREMENTS SET FORTH IN ANY DOCUMENTATION. WE MAKE NO WARRANTIES, EXPRESS, STATUTORY OR IMPLIED, THAT THE SERVICES, INCLUDING WITHOUT LIMITATION THE CONTENT, FUNCTIONS OR MATERIALS CONTAINED THEREIN, WILL BE TIMELY, SECURE, ACCURATE, ERROR-FREE, COMPLETE, UP-TO-DATE, FREE OF VIRUSES, OR UNINTERRUPTED. THE PROVIDER DO NOT NECESSARILY ENDORSE, SUPPORT, SANCTION, ENCOURAGE OR AGREE WITH ANY CONTENT, AND WE EXPRESSLY DISCLAIM ANY AND ALL REPRESENTATIONS, WARRANTIES AND LIABILITIES IN CONNECTION WITH ANY CONTENT. THE PROVIDER MAKE NO REPRESENTATION THAT THE SERVICES ARE APPROPRIATE OR AVAILABLE FOR USE OUTSIDE THE EUROPEAN UNION. NO ORAL OR WRITTEN INFORMATION MADE AVAILABLE BY OR ON BEHALF OF THE PROVIDER SHALL CREATE ANY WARRANTY.'}),f.jsx("p",{children:"IF APPLICABLE LAW DOES NOT ALLOW THE EXCLUSION OF SOME OR ALL OF THE ABOVE IMPLIED OR STATUTORY WARRANTIES TO APPLY TO YOU, THE ABOVE EXCLUSIONS WILL APPLY TO YOU TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"5. Exclusive Remedy and Limitation of Liability"}),f.jsx("p",{children:"UNDER NO CIRCUMSTANCES, INCLUDING WITHOUT LIMITATION NEGLIGENCE, WILL THE PROVIDER, ITS AFFILIATES, OR ANY PARTY INVOLVED IN CREATING, PRODUCING , OR DELIVERING THE SERVICES BE LIABLE FOR DAMAGES OR LOSSES INCLUDING WITHOUT LIMITATION DIRECT, INCIDENTAL, CONSEQUENTIAL, INDIRECT, SPECIAL, OR PUNITIVE DAMAGES AND LOST PROFITS ARISING OUT OF THE TERMS OR YOUR ACCESS, USE, MISUSE, OR INABILITY TO USE THE SERVICES, INCLUDING WITHOUT LIMITATION ANY PROVIDER'S CONTENT OR USER CONTENT, OR ANY SITES LINKED FROM THE SERVICES, HOWEVER CAUSED, WHETHER IN CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF THE PROVIDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR IN CONNECTION WITH ANY FAILURE OF PERFORMANCE, ERROR, OMISSION, INTERRUPTION, DEFECT, DELAY IN OPERATION OR TRANSMISSION, COMPUTER VIRUS, OR LINE OR SYSTEM FAILURE. Because some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, the Provider's liability in such jurisdictions shall be limited to the extent permitted by law. Any claim against us shall be limited to the amount you paid, if any, for use of the Services."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"6. Indemnification"}),f.jsx("p",{children:"You agree to indemnify, hold harmless, and defend the Provider and its affiliates, officers, directors, contractors, agents, employees, successors and assigns from and against any and all demands, claims, damages, liabilities, judgments, fines, interest, penalties, losses, costs, expenses and harms, including without limitation reasonable attorneys' fees and fees of other professional advisers, arising out of or in connection with (i) your use of the Services (including, without limitation, your Content and or by the Provider, and your use of any other user's Content), (ii) your online conduct, (iii) your violation or breach of this TOU, (iv) your failure to comply with any applicable laws or regulations, (v) your negligence, wilful misconduct, or violations of the intellectual property or other rights of any person, or (vi) any of your dealings or transactions with other persons resulting from use of the Services. You shall not settle any such claim without the prior written consent of the Provider. These obligations will survive any termination of these TOU."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"7. Integration and Severability"}),f.jsx("p",{children:"These TOU constitute the entire agreement between the Provider and you, superseding any prior or contemporaneous communications and proposals (whether oral, written or electronic) between you and us. In the event any provision of this TOU is held unenforceable, it will not affect the validity or enforceability of the remaining provisions and will be replaced by an enforceable provision that comes closest to the intention underlying the unenforceable provision."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"8. No Waiver"}),f.jsx("p",{children:"Our failure to enforce any provisions of this TOU or respond to a breach by you or other parties shall not in any way waive our right to enforce subsequently any terms or conditions of the TOU or to act with respect to similar breaches."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"9. Location and Governing Law"}),f.jsx("p",{children:"These TOU are governed by, and must be construed in accordance with the laws of Spain and interpreted according to applicable EU law principles, without giving effect to their principles of conflicts of law. By using the Services, you waive any claims that may arise under the laws of other states, countries, territories or jurisdictions."}),f.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"10. Miscellaneous and Contact Information"}),f.jsx("p",{children:"No joint venture, partnership, employment, or agency relationship exists between the Provider and the user or as a result of this agreement or the use of our services."}),f.jsxs("p",{children:["Please direct any questions, complaints or claims related to the Services or your use of the Services by email to"," ",f.jsx("a",{href:"mailto:products@grycap.upv.es",className:"text-blue-600 hover:underline",children:"products@grycap.upv.es"}),"."]})]})]})}const hH=e=>{let t=e.httpHandler;return{setHttpHandler(n){t=n},httpHandler(){return t},updateHttpClientConfig(n,r){t.updateHttpClientConfig(n,r)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},pH=e=>({httpHandler:e.httpHandler()});var u1;(function(e){e.HEADER="header",e.QUERY="query"})(u1||(u1={}));var d1;(function(e){e.HEADER="header",e.QUERY="query"})(d1||(d1={}));var Gl;(function(e){e.HTTP="http",e.HTTPS="https"})(Gl||(Gl={}));var Dd;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(Dd||(Dd={}));var f1;(function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"})(f1||(f1={}));const Gg="__smithy_context";var h1;(function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"})(h1||(h1={}));var p1;(function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"})(p1||(p1={}));class pt{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const n=new pt({...t,headers:{...t.headers}});return n.query&&(n.query=mH(n.query)),n}static isInstance(t){if(!t)return!1;const n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return pt.clone(this)}}function mH(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}class Kl{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const n=t;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}function gH(e){return t=>async n=>{var s,o;const{request:r}=n;return pt.isInstance(r)&&r.body&&e.runtime==="node"&&((o=(s=e.requestHandler)==null?void 0:s.constructor)==null?void 0:o.name)!=="FetchHttpHandler"&&(r.headers={...r.headers,Expect:"100-continue"}),t({...n,request:r})}}const yH={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},vH=e=>({applyToStack:t=>{t.add(gH(e),yH)}}),EI={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},xH=EI.WHEN_SUPPORTED,wH=EI.WHEN_SUPPORTED;var tt;(function(e){e.MD5="MD5",e.CRC32="CRC32",e.CRC32C="CRC32C",e.SHA1="SHA1",e.SHA256="SHA256"})(tt||(tt={}));var m1;(function(e){e.HEADER="header",e.TRAILER="trailer"})(m1||(m1={}));const bH=tt.MD5,SH=tt.CRC32;var g1;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(g1||(g1={}));function EH(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}function Yt(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}const y1=e=>{var t,n;return Kl.isInstance(e)?((t=e.headers)==null?void 0:t.date)??((n=e.headers)==null?void 0:n.Date):void 0},$v=e=>new Date(Date.now()+e),CH=(e,t)=>Math.abs($v(t).getTime()-e)>=3e5,v1=(e,t)=>{const n=Date.parse(e);return CH(n,t)?n-Date.now():t},ul=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},CI=async e=>{var c,u,d;const t=ul("context",e.context),n=ul("config",e.config),r=(d=(u=(c=t.endpointV2)==null?void 0:c.properties)==null?void 0:u.authSchemes)==null?void 0:d[0],o=await ul("signer",n.signer)(r),i=e==null?void 0:e.signingRegion,a=e==null?void 0:e.signingRegionSet,l=e==null?void 0:e.signingName;return{config:n,signer:o,signingRegion:i,signingRegionSet:a,signingName:l}};class AI{async sign(t,n,r){var d;if(!pt.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const s=await CI(r),{config:o,signer:i}=s;let{signingRegion:a,signingName:l}=s;const c=r.context;if(((d=c==null?void 0:c.authSchemes)==null?void 0:d.length)??!1){const[h,m]=c.authSchemes;(h==null?void 0:h.name)==="sigv4a"&&(m==null?void 0:m.name)==="sigv4"&&(a=(m==null?void 0:m.signingRegion)??a,l=(m==null?void 0:m.signingName)??l)}return await i.sign(t,{signingDate:$v(o.systemClockOffset),signingRegion:a,signingService:l})}errorHandler(t){return n=>{const r=n.ServerTime??y1(n.$response);if(r){const s=ul("config",t.config),o=s.systemClockOffset;s.systemClockOffset=v1(r,s.systemClockOffset),s.systemClockOffset!==o&&n.$metadata&&(n.$metadata.clockSkewCorrected=!0)}throw n}}successHandler(t,n){const r=y1(t);if(r){const s=ul("config",n.config);s.systemClockOffset=v1(r,s.systemClockOffset)}}}class AH extends AI{async sign(t,n,r){var h;if(!pt.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:s,signer:o,signingRegion:i,signingRegionSet:a,signingName:l}=await CI(r),u=(await((h=s.sigv4aSigningRegionSet)==null?void 0:h.call(s))??a??[i]).join(",");return await o.sign(t,{signingDate:$v(s.systemClockOffset),signingRegion:u,signingService:l})}}const Sa=e=>e[Gg]||(e[Gg]={}),Er=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t};function RH(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}const TH=(e,t)=>(n,r)=>async s=>{var c;const o=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,s.input)),i=RH(e.httpAuthSchemes),a=Sa(r),l=[];for(const u of o){const d=i.get(u.schemeId);if(!d){l.push(`HttpAuthScheme \`${u.schemeId}\` was not enabled for this service.`);continue}const h=d.identityProvider(await t.identityProviderConfigProvider(e));if(!h){l.push(`HttpAuthScheme \`${u.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:m={},signingProperties:g={}}=((c=u.propertiesExtractor)==null?void 0:c.call(u,e,r))||{};u.identityProperties=Object.assign(u.identityProperties||{},m),u.signingProperties=Object.assign(u.signingProperties||{},g),a.selectedHttpAuthScheme={httpAuthOption:u,identity:await h(u.identityProperties),signer:d.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(l.join(` `));return n(s)},kH={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},PH=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(TH(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),kH)}}),NH=(e,t)=>n=>async r=>{const{response:s}=await n(r);try{const o=await t(s,e);return{response:s,output:o}}catch(o){if(Object.defineProperty(o,"$response",{value:s}),!("$metadata"in o)){const i="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";o.message+=` `+i,typeof o.$responseBodyText<"u"&&o.$response&&(o.$response.body=o.$responseBodyText)}throw o}},IH=(e,t)=>(n,r)=>async s=>{var a;const o=(a=r.endpointV2)!=null&&a.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint;if(!o)throw new Error("No valid endpoint provider available.");const i=await t(s.input,{...e,endpoint:o});return n({...s,request:i})},OH={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Vv={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Ko(e,t,n){return{applyToStack:r=>{r.add(NH(e,n),OH),r.add(IH(e,t),Vv)}}}Vv.name;const MH=e=>t=>{throw t},_H=(e,t)=>{},DH=e=>(t,n)=>async r=>{if(!pt.isInstance(r.request))return t(r);const o=Sa(n).selectedHttpAuthScheme;if(!o)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:a,signer:l}=o,c=await t({...r,request:await l.sign(r.request,a,i)}).catch((l.errorHandler||MH)(i));return(l.successHandler||_H)(c.response,i),c},RI={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},jH=e=>({applyToStack:t=>{t.addRelativeTo(DH(),RI)}}),Ni=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},Ks={},Ea=new Array(64);for(let e=0,t=65,n=90;e+t<=n;e++){const r=String.fromCharCode(e+t);Ks[r]=e,Ea[e]=r}for(let e=0,t=97,n=122;e+t<=n;e++){const r=String.fromCharCode(e+t),s=e+26;Ks[r]=s,Ea[s]=r}for(let e=0;e<10;e++){Ks[e.toString(10)]=e+52;const t=e.toString(10),n=e+52;Ks[t]=n,Ea[n]=t}Ks["+"]=62;Ea[62]="+";Ks["/"]=63;Ea[63]="/";const $i=6,dl=8,BH=63,zv=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let s=0;s>=$i;const a=s/4*3;o>>=i%dl;const l=Math.floor(i/dl);for(let c=0;c>u)}}return new Uint8Array(n)},Uo=e=>new TextEncoder().encode(e),Vi=e=>typeof e=="string"?Uo(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),Hv=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function Wv(e){let t;typeof e=="string"?t=Uo(e):t=e;const n=typeof t=="object"&&typeof t.length=="number",r=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let o=0;o>u]}s+="==".slice(0,4-l)}return s}function LH(e,t="utf-8"){return t==="base64"?Wv(e):Hv(e)}function FH(e,t){return t==="base64"?To.mutate(zv(e)):To.mutate(Uo(e))}class To extends Uint8Array{static fromString(t,n="utf-8"){switch(typeof t){case"string":return FH(t,n);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,To.prototype),t}transformToString(t="utf-8"){return LH(this,t)}}const UH=(e,t)=>{const{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:s,checksumLocationName:o,streamHasher:i}=t,a=n!==void 0&&r!==void 0&&s!==void 0&&o!==void 0&&i!==void 0,l=a?i(s,e):void 0,c=e.getReader();return new ReadableStream({async pull(u){const{value:d,done:h}=await c.read();if(h){if(u.enqueue(`0\r diff --git a/index.html b/index.html index c690f0c..960df0f 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ /> OSCAR - +