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