'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers=require("../common/helpers.js");const Text=React.forwardRef(({styles:e,builderAttrs:s,style:t,setting:r,advanced:a,builderProps:l,className:c,children:y,disableEdit:m,...n},i)=>{let{isEditMode:o,isPreviewSharePageMode:u}=core.useRenderMode(),{htmlTag:d="div",options:x}=r??{},g=system.createAttr({...attrs.getAttr({uid:l?.uid||""})}),j=system.createAttr({...attrs.getTextAttr(x)}),R=system.createStyleReact({...styles.getStyle(e,t)}),p=system.createStyleReact({...styles.getContainerStyle(e,r)}),C=system.createStyleReact({...styles.getTextStyle(e,r)}),q=system.createClass({...classes.getClasses({setting:r,advanced:a,builderProps:l})}),S=system.createClass({...classes.getContainerClasses({setting:r})}),T=system.createClass({...classes.getTextClasses({styles:e,setting:r,className:c,isEdit:o||u,disableEdit:m})}),f=helpers.getDisplayText({type:"React",styles:e,setting:r,builderProps:l}),h=system.createContent(f);return jsxRuntime.jsxs("div",{...g,...n,...s,style:R,className:q,children:[jsxRuntime.jsx("div",{className:S,style:{...p},children:jsxRuntime.jsx(d,{ref:i,...j,className:T,onDragStart:e=>e.preventDefault(),onDrop:e=>e.preventDefault(),style:{...C},dangerouslySetInnerHTML:{__html:h}})}),y]})});exports.default=Text;
