"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js");const TextInput=({setting:e,builderProps:s,className:t,builderAttrs:a,advanced:l,pageContext:r,styles:c})=>{let{text:o,name:m,placeholder:i,required:y,translate:d,formType:p}=e??{},u=m?.[p??"text"]===""||void 0===m?"contact[first_name]":m?.[p??"text"],n=helpers.getDynamicSourceLocales({val:i,uid:s?.uid,settingId:"placeholder",pageContext:r,translate:d}),$=system.createStyle(styles.composeContainerStyles(l,e)),x=system.createClass(classes.composeContainerClasses(l,s)),v=system.createClass(classes.composeTextFieldClasses(e,s,t??"")),C=system.createStyle(styles.composeTextareaStyles(l,e,c)),q=system.createClass({composedTextFieldClasses:!0}),f=styles.getRowsTextArea(e),h="textarea"===p;return core.template`
    <div
      ${a}
      data-id="${s?.uid}"
      class="${x}"
      style="${$}"
    >
      <div>
        ${system.If(!h,core.template`<input
            type="text"
            class="${v}"
            style="${C}"
            placeholder="${n}"
            ${system.If(y,"required")}
            name="${u}"
            value="${o}"
          ></input>`,core.template`<textarea
            rows="${f}"
            class="${q}"
            style="${C}"
            placeholder="${n}"
            ${system.If(y,"required")}
            name="${u}"
            value="${o}"
          ></textarea>`)}
      </div>
    </div>
  `};exports.default=TextInput;
