'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),r=require("@gem-sdk/system"),t=require("react"),a=require("./common/helpers.js"),u=require("./common/classes.js"),l=require("./common/styles.js");exports.default=({setting:n,styles:i})=>{let d=s.useUniqProductID(),{name:c,type:o,placeholder:m,required:h,handleChange:y,label:g,validationData:p}=n??{},q=t.useMemo(()=>{switch(o){case"textarea":case"hidden":return"textarea";default:return"input"}},[o]),x=t.useMemo(()=>"hidden"===o,[o]),j=`${m}${m&&h&&!g?" *":""}`,C=r.createClass({...u.getClasses(i),...s.composeClasses("hidden"===o?"gp-cursor-default":"")}),f=r.createStyle({...l.getStyles(i),...p?.isValid||"hidden"===o?{}:s.makeStyle({bc:"#F44336"})}),{elementType:$,elementValue:k,minLength:v,maxLength:M}=a.getElementContent(n);return e.jsx(q,{id:`${d}-${c}`,type:$,value:k,placeholder:j,name:c,readOnly:x,className:C,style:f,required:h,minLength:v,maxLength:M,onChange:y})};
