import{_ as d,k as l,j as n,at as c,bb as x,r as i,B as p,b4 as h,au as m,C as u,bA as y,y as b,c_ as f}from"./index-C1DmWO_C.js";import{V as g}from"./ViewTransformation-CvML2ehg.js";var w=d(function(t,e){var r=Number(e),s=0,a;if(r<0||isNaN(r))throw new RangeError("n must be a non-negative number");for(a=new Array(r);s<r;)a[s]=t(s),s+=1;return a}),C=d(function(t,e){return w(l(t),e)});const v={bg:"white",p:"10px",borderStyle:"solid",borderWidth:"1px",borderColor:"grayShade1"},$=(o,t=[])=>({table:{whiteSpace:"nowrap","tr:nth-of-type(1)":{position:"sticky",top:"32px",background:o.colors.white,td:{pt:"20px",pb:"10px",boxShadow:`
         inset 0 -2px 0 0 ${o.colors.grayShade2}`}},"tr:nth-of-type(2)":{borderTop:"none"},...t.reduce((e,r)=>({...e,[`tr:nth-of-type(${r+2})`]:{bg:"grayShade2",borderBottom:"1px solid gray"}}),{}),td:{px:"10px"},"td:nth-of-type(1)":{pl:"20px"},"td:nth-of-type(2)":{span:{ml:"initial"}},"td:nth-of-type(6)":{pr:"20px"},"tr:last-of-type":{border:"none"}}}),k=({maxLength:o=40,value:t,...e})=>{const r=String(t).length<=o,s=r?String(t):`${String(t).slice(0,o-3)}...`;return n.jsx(c,{isDisabled:r,mainText:String(t),children:n.jsx(x,{value:s,...e})})},j=({transformations:o=[],name:t})=>{const[e,r]=i.useState();return n.jsxs(p,{gap:"8px",children:[o.map(s=>n.jsx(i.Fragment,{children:n.jsxs(h,{p:"0 0 0 0px",intent:"inline",onClick:()=>r(s),children:[s.hopsworksUdf.name,n.jsx(m,{icon:u.arrows_maximize,size:"xs",color:"primary",ml:"5px"})]})},s.id)),n.jsx(y,{size:"7xl",title:`${e==null?void 0:e.hopsworksUdf.name} transformation code preview`,isOpen:!!e,onClose:()=>r(void 0),mainButtonProps:{children:"Done",onClick:()=>r(void 0)},children:n.jsx(g,{...e,featureName:t})})]})},_=i.memo(j),B=({content:o,hasTitle:t=!0,...e})=>n.jsx(b,{...e,children:n.jsx(p,{sx:{gap:"20px",flexDirection:"column"},children:o.map(({title:r,code:s,language:a})=>n.jsx(p,{width:"100%",children:n.jsx(f,{title:r,copyButton:!0,content:s,language:a,padding:"0"})},`${r}-${s}-${a}`))})});export{B as C,k as E,_ as T,v as c,$ as f,C as r};
