import{J as e,j as n,w as o,$ as s,k as t,l,m as r,n as a,o as i,t as d,u as p,f as c}from"../../vendor.js";import{useRef as x}from"react";import{u as f}from"../../hooks.js";import{o as u}from"./index.options.js";import{s as m}from"./index.settings.js";import{C as b}from"../Catalogue/index.js";import{D as j}from"../Droppable/index.js";import{E as v}from"../Element/index.js";import{T as h}from"../Text/index.js";var g=["element"];function L(e,n){var o=d(e);if(p){var s=p(e);n&&(s=c(s).call(s,(function(n){return i(e,n).enumerable}))),o.push.apply(o,s)}return o}function M(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?L(Object(o),!0).forEach((function(n){t(e,n,o[n])})):l?r(e,l(o)):L(Object(o)).forEach((function(n){a(e,n,i(o,n))}))}return e}var k=function(t){var l,r,a,i=t.element,d=e(t,g),p=f(),c=p.moveElement,u=p.addElement,m=p.getText,L=x(),k=function(e,n,o){var s,t,l=(null===(s=o.construct)||void 0===s?void 0:s.call(o))||{};null==u||u(M(M({},l),{},{content:"function"==typeof l.content?l.content(m):l.content}),{parent:e,position:n}),null===(t=L.current)||void 0===t||t.close()},A=function(e,n,o){var s;u(o,{parent:e,position:n,normalizeOptions:{resetIds:!0}}),null===(s=L.current)||void 0===s||s.close()},N=function(e,n){c(n,i,{parent:e,position:"before"})};return n.exports.jsxs("div",M(M({},s(d,["builder"])),{},{children:[n.exports.jsx("div",{className:"oak-foldable-section-title",children:n.exports.jsx(h,{name:"core.components.foldable.sectionsTitle.seeMore",default:"Label when collapsed"})}),n.exports.jsx(j,{disabled:i.seeMore.length>0,onDrop:N.bind(null,i.seeMore),children:n.exports.jsx("div",{className:"oak-foldable-content",children:null!=i&&i.seeMore.length?n.exports.jsxs(n.exports.Fragment,{children:[n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.seeMore,"before"),onPaste:A.bind(null,i.seeMore,"before")}),null==i||null===(l=i.seeMore)||void 0===l?void 0:o(l).call(l,(function(e){return n.exports.jsx(v,{element:e,parent:i.seeMore},e.id)})),n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.seeMore,"after"),onPaste:A.bind(null,i.seeMore,"after")})]}):n.exports.jsx("div",{className:"oak-foldable-content-empty",children:n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.seeMore,"after"),onPaste:A.bind(null,i.seeMore,"after")})})})}),n.exports.jsx("div",{className:"oak-foldable-section-title",children:n.exports.jsx(h,{name:"core.components.foldable.sectionsTitle.seeLess",default:"Label when expanded"})}),n.exports.jsx(j,{disabled:i.seeLess.length>0,onDrop:N.bind(null,i.seeLess),children:n.exports.jsx("div",{className:"oak-foldable-content",children:null!=i&&i.seeLess.length?n.exports.jsxs(n.exports.Fragment,{children:[n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.seeLess,"before"),onPaste:A.bind(null,i.seeLess,"before")}),null==i||null===(r=i.seeLess)||void 0===r?void 0:o(r).call(r,(function(e){return n.exports.jsx(v,{element:e,parent:i.seeLess},e.id)})),n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.seeLess,"after"),onPaste:A.bind(null,i.seeLess,"after")})]}):n.exports.jsx("div",{className:"oak-foldable-content-empty",children:n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.seeLess,"after"),onPaste:A.bind(null,i.seeLess,"after")})})})}),n.exports.jsx("div",{className:"oak-foldable-section-title",children:n.exports.jsx(h,{name:"core.components.foldable.sectionsTitle.content",default:"Content"})}),n.exports.jsx(j,{disabled:i.content.length>0,onDrop:N.bind(null,i.content),children:n.exports.jsx("div",{className:"oak-foldable-content",children:null!=i&&i.content.length?n.exports.jsxs(n.exports.Fragment,{children:[n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.content,"before"),onPaste:A.bind(null,i.content,"before")}),null==i||null===(a=i.content)||void 0===a?void 0:o(a).call(a,(function(e){return n.exports.jsx(v,{element:e,parent:i.content},e.id)})),n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.content,"after"),onPaste:A.bind(null,i.content,"after")})]}):n.exports.jsx("div",{className:"oak-foldable-content-empty",children:n.exports.jsx(b,{ref:L,onAppend:k.bind(null,i.content,"after"),onPaste:A.bind(null,i.content,"after")})})})})]}))};k.options=u,k.settings=m;var A=k;export{A as F};
//# sourceMappingURL=index.js.map
