"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");const ProductPropertyChoice=({setting:e,styles:t,builderProps:s,pageContext:r,attributes:o})=>{let c=s?.uid,{name:i,type:l,childItem:P,translate:a}=e??{},{valueTextColor:C,fullWidth:p,width:u}=t??{},d=core.makeStyleResponsive("w",core.makeWidth(u,p)),y=`properties[${i}]`,m=getProductPropertiesChoiceInlineCss.getPPCInlineStyleChoice(c,C),g=system.createClass({...getProductPropertiesChoiceClasses.getPPCWrapperClasses()}),n=system.createClass({...getProductPropertiesChoiceClasses.getPPCLabelClasses(t)}),h=system.createStyle({...getProductPropertiesChoiceStyles.getPPCContainerStyles(t)}),$=system.createClass({...getProductPropertiesChoiceClasses.getPPCWrapperClassesMain()}),S=system.createStyle({...getProductPropertiesChoiceStyles.getPPCLabelStyles(t)}),v=system.createAttr({...getProductPropertiesChoiceAttrs.getPPCInputAttrs(o)}),I=system.createStyle({...getProductPropertiesChoiceStyles.getPPCInputStyles(t)});return core.template`<div style="${{...d}}" class="${$}">
      <style>${m}</style>

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