import{s as P,d8 as x,bz as g,f as t,b2 as v,z as k,D as N}from"./index-BPRWoLf4.js";var z=function(y){P(o,y);function o(e){return y.call(this,e)||this}return o.prototype.prepareRows=function(){var e,n,a=this.props,u=a.column,c=u===void 0?3:u,p=a.items,b=a.source,d=a.data,m=p||b||[],r=[],s=[],i=c,l=0,h=x(m,d);try{for(var E=g(h),f=E.next();!f.done;f=E.next()){var S=f.value;l=l+1;var R=Math.min(S.span||1,c);i=i-R;var w={label:S.label,content:S.content,span:R};i>=0?s.push(w):(r.push(s),i=c-R,s=[w]),l===h.length&&r.push(s)}}catch(_){e={error:_}}finally{try{f&&!f.done&&(n=E.return)&&n.call(E)}finally{if(e)throw e.error}}return r},o.prototype.renderRow=function(e){var n=this.props,a=n.render,u=n.contentStyle,c=n.labelStyle,p=n.separator,b=p===void 0?": ":p,d=n.mode,m=d===void 0?"table":d,r=n.data;return e.map(function(s,i){return t.createElement("tr",{key:i},s.map(function(l,h){return m==="table"?t.createElement(t.Fragment,{key:"item-".concat(h)},t.createElement("th",{style:v(c,r)},a("label",l.label)),t.createElement("td",{colSpan:l.span+l.span-1,style:v(u,r)},a("content",l.content))):t.createElement("td",{colSpan:l.span,style:v(u,r),key:"item-".concat(h)},t.createElement("span",{style:v(c,r)},a("label",l.label)),b,a("content",l.content))}))})},o.prototype.render=function(){var e=this.props,n=e.style,a=e.title,u=e.column,c=u===void 0?3:u,p=e.classnames,b=e.className,d=e.titleStyle,m=e.data,r=e.mode,s=r===void 0?"table":r,i=this.prepareRows();return t.createElement("div",{className:p("Property","Property--".concat(s),b),style:v(n,m)},t.createElement("table",null,a?t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",{colSpan:s==="table"?c+c:c,style:v(d,m)},a))):null,t.createElement("tbody",null,this.renderRow(i))))},o}(t.Component),C=function(y){P(o,y);function o(){return y!==null&&y.apply(this,arguments)||this}return o=k([N({type:"property",autoVar:!0})],o),o}(z);export{C as PropertyRenderer,z as default};
