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