import{A as S,B as A,h as V,i as w,r as h,e as d,b as u,o as n,d as t,a as v,t as i,w as m,f,u as r,c as q,F as M,g as P,x as F}from"./vue.esm-bundler.js?ver=1.3.23";import{A as N,t as p}from"./Translator.js?ver=1.3.23";import{B as U}from"./Badge.js?ver=1.3.23";import{_ as j}from"./Animation.js?ver=1.3.23";import"./Arr.js?ver=1.3.23";import"./_plugin-vue_export-helper.js?ver=1.3.23";import"./DynamicIcon.js?ver=1.3.23";import"./Str.js?ver=1.3.23";const T={key:0,class:"fct-content-card-list-item py-4 px-6"},z={class:"fct-content-card-list-head"},O={class:"flex items-start gap-2 flex-row"},D={class:"mb-0"},E={key:0,class:"fct-content-card-list-content"},I={class:"mt-3 space-y-2 fct-module-settings-option-wrap"},K={key:0,class:"text-xs block"},L={class:"fct-content-card-list-action"},R={class:"pr-4"},Z={__name:"ModuleSettings",props:S({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=A(a,"modelValue"),_=N.get("app_config.isProActive"),l=V(!1),b=V(!1),x=(g,o)=>{g==="enable_advanced_inventory"&&!_&&o==="yes"&&(e[g]="no")};return w(()=>{l.value=e.value.active,b.value=!0}),(g,o)=>{const k=h("el-button"),C=h("el-checkbox"),B=h("el-switch");return b.value?(n(),d("div",T,[t("div",z,[t("div",O,[t("h4",D,i(a.field.title),1),v(U,{size:"small",type:l.value==="yes"?"active":"inactive","hide-icon":!0},{default:m(()=>[f(i(l.value==="yes"?r(p)("Active"):r(p)("Inactive")),1)]),_:1},8,["type"])])]),a.field.description?(n(),d("div",E,[t("p",null,i(a.field.description),1),a.field.settings?(n(),q(j,{key:0,visible:l.value==="yes",accordion:""},{default:m(()=>[t("div",I,[(n(!0),d(M,null,P(a.field.settings,(c,s)=>(n(),d("div",{key:s,class:"fct-module-settings-option"},[v(C,{modelValue:e.value[s],"onUpdate:modelValue":y=>e.value[s]=y,"true-value":"yes","false-value":"no",disabled:s==="enable_advanced_inventory"&&!r(_),onChange:y=>x(s,y)},{default:m(()=>[f(i(c.label)+" ",1),s==="enable_advanced_inventory"&&!r(_)?(n(),d("span",K,[f(i(r(p)("This feature is only available in FluentCart Pro."))+" ",1),v(k,{size:"small",tag:"a",link:"",href:"https://fluentcart.com/discount-deal",target:"_blank",rel:"noopener noreferrer"},{default:m(()=>[f(i(r(p)("Upgrade to Pro")),1)]),_:1})])):u("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"])]))),128))])]),_:1},8,["visible"])):u("",!0)])):u("",!0),t("div",L,[t("div",R,[v(B,{"active-value":"yes","inactive-value":"no",modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=c=>l.value=c),onChange:o[1]||(o[1]=c=>{(!e.value||typeof e.value!="object")&&(e.value={}),F(()=>{e.value.active=c})})},null,8,["modelValue"])]),u("",!0)])])):u("",!0)}}};export{Z as default};
