"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),getProductPropertiesChoiceInlineCss=require("./common/getProductPropertiesChoiceInlineCss.js"),helpers=require("../../../../helpers.js"),system=require("@gem-sdk/system"),getProductPropertiesChoiceClasses=require("./common/getProductPropertiesChoiceClasses.js"),getProductPropertiesChoiceStyles=require("./common/getProductPropertiesChoiceStyles.js"),getProductPropertiesChoiceAttrs=require("./common/getProductPropertiesChoiceAttrs.js"),translate=require("../../../settings/product-properties/configs/translate.js");const ProductPropertyChoice=({setting:e,styles:t,builderProps:r,pageContext:s,attributes:o})=>{let i=r?.uid,{name:c,type:l,childItem:P}=e??{},{valueTextColor:a,fullWidth:p,width:C}=t??{},u=core.makeStyleResponsive("w",core.makeWidth(C,p)),d=`properties[${c}]`,n=getProductPropertiesChoiceInlineCss.getPPCInlineStyleChoice(i,a),y=system.createClass({...getProductPropertiesChoiceClasses.getPPCWrapperClasses()}),g=system.createClass({...getProductPropertiesChoiceClasses.getPPCLabelClasses(t)}),m=system.createStyle({...getProductPropertiesChoiceStyles.getPPCContainerStyles(t)}),h=system.createClass({...getProductPropertiesChoiceClasses.getPPCWrapperClassesMain()}),$=system.createStyle({...getProductPropertiesChoiceStyles.getPPCLabelStyles(t)}),S=system.createAttr({...getProductPropertiesChoiceAttrs.getPPCInputAttrs(o)}),v=system.createStyle({...getProductPropertiesChoiceStyles.getPPCInputStyles(t)});return core.template`<div style="${{...u}}" class="${h}">
      <style>${n}</style>

      ${P?.map((e,t)=>{let r=helpers.getDynamicSourceLocales({val:e,uid:i,settingId:helpers.createSettingId({id:translate.ProductProperties?.childItem?.id,index:t}),pageContext:s??{}});return core.template`
            <div class="${y}" style="${m}">
              <input
                ${{...S}}
                type="${l}"
                id="${i}-${c}-${t}"
                name="${"radio"===l||"checkbox"===l?d:`${d}[]`}"
                value="${r}"
                style="${v}"
                form="{{ product_form_id }}"
              />
              <label
                for="${i}-${c}-${t}"
                class="${g}"
                style="${$}"
              >
                ${r}
              </label>
            </div>`}).join("")}
      </div>
  `};exports.default=ProductPropertyChoice;
