import{makeStyleResponsive as e,makeWidth as t,template as o}from"@gem-sdk/core";import{getPPCInlineStyleChoice as r}from"./common/getProductPropertiesChoiceInlineCss.js";import{getDynamicSourceLocales as s,createSettingId as i}from"../../../../helpers.js";import{createClass as m,createStyle as l,createAttr as p}from"@gem-sdk/system";import{getPPCWrapperClasses as c,getPPCLabelClasses as d,getPPCWrapperClassesMain as $}from"./common/getProductPropertiesChoiceClasses.js";import{getPPCContainerStyles as a,getPPCLabelStyles as n,getPPCInputStyles as u}from"./common/getProductPropertiesChoiceStyles.js";import{getPPCInputAttrs as f}from"./common/getProductPropertiesChoiceAttrs.js";import{ProductProperties as g}from"../../../settings/product-properties/configs/translate.js";let y=({setting:y,styles:P,builderProps:h,pageContext:C,attributes:j})=>{let v=h?.uid,{name:b,type:k,childItem:x}=y??{},{valueTextColor:I,fullWidth:_,width:w}=P??{},A=e("w",t(w,_)),S=`properties[${b}]`,q=r(v,I),z=m({...c()}),B=m({...d(P)}),D=l({...a(P)}),E=m({...$()}),F=l({...n(P)}),G=p({...f(j)}),H=l({...u(P)});return o`<div style="${{...A}}" class="${E}">
      <style>${q}</style>

      ${x?.map((e,t)=>{let r=s({val:e,uid:v,settingId:i({id:g?.childItem?.id,index:t}),pageContext:C??{}});return o`
            <div class="${z}" style="${D}">
              <input
                ${{...G}}
                type="${k}"
                id="${v}-${b}-${t}"
                name="${"radio"===k||"checkbox"===k?S:`${S}[]`}"
                value="${r}"
                style="${H}"
                form="{{ product_form_id }}"
              />
              <label
                for="${v}-${b}-${t}"
                class="${B}"
                style="${F}"
              >
                ${r}
              </label>
            </div>`}).join("")}
      </div>
  `};export{y as default};
