import{_ as d,m as l,j as t,a as i,bV as c,f as x,bP as h,bQ as m,ao as u,b8 as f,r as p,aJ as b,ap as y,d as j,b3 as g,W as w,cN as S}from"./index-_eM6l4Nf.js";import{V as T}from"./ViewTransformation-D-2ijvBj.js";var _=d(function(r,a){var e=Number(a),o=0,n;if(e<0||isNaN(e))throw new RangeError("n must be a non-negative number");for(n=new Array(e);o<e;)n[o]=r(o),o+=1;return n}),C=d(function(r,a){return _(l(r),a)});const D=({label:s,date:r,primary:a=!1,...e})=>t.jsxs(i,{flexDirection:"column",...e,children:[t.jsx(c,{mb:"3px",gray:!0,children:s}),t.jsx(x,{primary:a,children:h(r,m.DATE_TIME.DATE_TIME_FULL)})]}),k={bg:"white",p:"10px",borderStyle:"solid",borderWidth:"1px",borderColor:"grayShade1"},N=(s,r=[])=>({table:{whiteSpace:"nowrap","tr:nth-of-type(1)":{position:"sticky",top:"32px",background:s.colors.white,td:{pt:"20px",pb:"10px",boxShadow:`
         inset 0 -2px 0 0 ${s.colors.grayShade2}`}},"tr:nth-of-type(2)":{borderTop:"none"},...r.reduce((a,e)=>({...a,[`tr:nth-of-type(${e+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"}}}),W=({maxLength:s=40,value:r,...a})=>{const e=String(r).length<=s,o=e?String(r):`${String(r).slice(0,s-3)}...`;return t.jsx(u,{isDisabled:e,mainText:String(r),children:t.jsx(f,{value:o,...a})})},E=({transformations:s=[],name:r,showTFName:a})=>{const[e,o]=p.useState();return t.jsxs(i,{gap:"8px",children:[s.map(n=>t.jsx(p.Fragment,{children:t.jsxs(b,{p:"0 0 0 0px",intent:"inline",onClick:()=>o(n),children:[a?n.hopsworksUdf.name:r,t.jsx(y,{icon:j.arrows_maximize,size:"xs",color:"primary",ml:"5px"})]})},n.id)),e&&t.jsx(g,{hasCloseButton:!0,size:"7xl",title:`${e==null?void 0:e.hopsworksUdf.name} transformation code preview`,isOpen:!!e,onClose:()=>o(void 0),children:t.jsx(T,{...e,featureName:r})})]})},B=p.memo(E),V=({content:s,hasTitle:r=!0,...a})=>t.jsx(w,{...a,children:t.jsx(i,{sx:{gap:"20px",flexDirection:"column"},children:s.map(({title:e,code:o,language:n})=>t.jsx(i,{width:"100%",children:t.jsx(S,{title:e,copyButton:!0,content:o,language:n,padding:"0"})},`${e}-${o}-${n}`))})});export{V as C,D,W as E,B as T,k as c,N as f,C as r,_ as t};
