import{O as n,m as o,A as e,B as s,T as t,n as i,o as l,q as a,r,s as c,f as d,v as u,y as f,z as m,g as p}from"../../vendor.js";import{u as v}from"../../hooks.js";import{C as j}from"../Col/index.js";import{D as g}from"../Droppable/index.js";import{o as x}from"./index.options.js";import{s as b}from"./index.settings.js";var h=["element","parent"];function k(n,o){var e=f(n);if(m){var s=m(n);o&&(s=p(s).call(s,(function(o){return c(n,o).enumerable}))),e.push.apply(e,s)}return e}function y(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?k(Object(e),!0).forEach((function(o){i(n,o,e[o])})):l?a(n,l(e)):k(Object(e)).forEach((function(o){r(n,o,c(e,o))}))}return n}var D=function(i){var l,a,r,c,f=i.element,m=i.parent,p=n(i,h),x=v(),b=x.setElement,k=x.removeElement,D=x.moveElement,E=function(n,o){var e;d(e=f.cols).call(e,o?n:n+1,0,{content:[],id:u(),style:{},type:"col"}),b(f,{cols:f.cols})},C=function(n){var o;d(o=f.cols).call(o,n,1),b(f,{cols:f.cols}),f.cols.length<=0&&k(f,{parent:m})},z=function(n,o){D(o,f,{parent:m,position:n})};return o.jsxs("div",y(y({},t(p,["builder"])),{},{children:[o.jsx(g,{onDrop:z.bind(null,"before"),children:o.jsx("div",{className:"oak-drop-zone oak-before"})}),o.jsx("div",{className:e("oak-row-content",(null===(l=f.settings)||void 0===l?void 0:l.flexDirection)&&"oak-direction-"+f.settings.flexDirection,(null===(a=f.settings)||void 0===a?void 0:a.alignItems)&&"oak-align-"+f.settings.alignItems,(null===(r=f.settings)||void 0===r?void 0:r.justifyContent)&&"oak-justify-"+f.settings.justifyContent),children:null==f||null===(c=f.cols)||void 0===c?void 0:s(c).call(c,(function(n,e){return o.jsx(j,{element:n,onPrepend:E.bind(null,e,!0),onAppend:E.bind(null,e,!1),onRemove:C.bind(null,e)},e)}))}),o.jsx(g,{onDrop:z.bind(null,"after"),children:o.jsx("div",{className:"oak-drop-zone oak-after"})})]}))};D.options=x,D.settings=b;var E=D;export{E as R};
//# sourceMappingURL=index.js.map
