'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("../../grid/components/ChildrenDroppable.js"),l=require("@gem-sdk/system"),a=require("../common/attrs.js"),r=require("../common/styles.js"),o=require("../common/classes.js"),n=require("../../button/components/ButtonIcon.js"),i=require("../hooks/useDialog.js");exports.default=c=>{let{setting:d,children:g,builderProps:y,style:C,advanced:u,builderAttrs:m,pageContext:S}=c,p=u?.d,{name:v,fullScreen:j,width:x,height:b,position:f,overlayColor:h,overlayOpacity:q,iconSize:B,closeButtonPosition:k,iconSvg:A}=d??{},D=t.useEditorMode(),{ref:N,overlay:L,handleClickOverlay:O,closeModal:w,open:E,dialogId:I}=i.useDialog(d,y,"edit"===D),M="edit"!==D,P=l.createAttr({...a.getAttr({uid:y?.uid||""})}),T=l.createStyle({...r.getWrapperStyle(p)}),_=l.createClass({...o.getContainClasses(u?.cssClass,q,h)}),z=l.createAttr({...a.getAttrContainer({uid:I||""})}),H=l.createStyle({...r.getContainStyle()}),W=l.createClass({...o.getBackdropClasses(f)}),F=l.createStyle({...r.getBackdropStyle(C)}),G=l.createAttr({...a.getAttrOverlay()}),J=l.createClass({...o.getOverlayClasses()}),K=l.createStyle({...r.getOverlayStyle(q,h,C)}),Q=l.createStyle({...r.getDialogContentStyle({style:C,width:x,height:b,fullScreen:j})}),R=l.createClass({...o.getDialogContentClasses({setting:d,enableEffect:E,isILP:M})}),U=l.createAttr({...a.getAttrClose()}),V=l.createClass({...o.getHeadContentClasses()}),X=l.createStyle({...r.getButtonContentStyle(d)}),Y=l.createClass({...o.getButtonContentClasses(k)}),Z=l.createStyle({...r.getSvgContentStyle(B)}),$=l.createClass({...o.getSvgContentClasses()}),ee=l.createStyle({...r.getBodyContentStyle({setting:d,style:C,uid:y?.uid,pageContext:S??{}})}),et=l.createClass({...o.getBodyContentClasses()});return e.jsx("div",{...P,style:T,children:(E||"edit"!==D)&&e.jsx("dialog",{ref:N,open:E,"aria-label":v,...z,className:_,style:H,children:e.jsxs("div",{"aria-label":"Backdrop",className:W,style:F,children:[l.If(!!h,e.jsx("div",{ref:L,...G,className:J,style:K,onClick:O,"aria-hidden":!0})),e.jsx("span",{className:V}),e.jsxs("div",{role:"dialog","aria-label":"Dialog content",...m,className:R,style:Q,children:[e.jsx("button",{...U,type:"button",tabIndex:-1,className:Y,style:X,onClick:w,children:e.jsx(n.default,{iconSvg:A??`<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
                  <path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
                </svg>`,styles:Z,classes:$})}),e.jsx("div",{"aria-label":"Dialog body",style:ee,className:et,children:t.isEmptyChildren(g)?e.jsx(s.default,{}):t.filterToolbarPreview(g)}),t.filterToolbarPreview(g,!0)]})]})})})};
