import{A as S,B as A,h as V,i as w,r as h,e as d,b as u,o as s,d as t,a as m,t as r,w as p,f as v,u as a,c as q,F as M,g as P,x as U}from"./vue.esm-bundler.js?ver=1.6.0";import{A as F,t as f}from"./Translator.js?ver=1.6.0";import{u as N}from"./common.js?ver=1.6.0";import{B as j}from"./Badge.js?ver=1.6.0";import{_ as T}from"./Animation.js?ver=1.6.0";import"./Arr.js?ver=1.6.0";import"./dayjs.min.js?ver=1.6.0";import"./Str.js?ver=1.6.0";import"./timezone.js?ver=1.6.0";import"./index.js?ver=1.6.0";import"./Model.js?ver=1.6.0";import"./Rest.js?ver=1.6.0";import"./vue-router.js?ver=1.6.0";import"./Url.js?ver=1.6.0";import"./Notify.js?ver=1.6.0";import"./DynamicIcon.js?ver=1.6.0";import"./_plugin-vue_export-helper.js?ver=1.6.0";import"./index3.js?ver=1.6.0";import"./IconButton.js?ver=1.6.0";import"./Utils.js?ver=1.6.0";import"./TransitionAccordion.js?ver=1.6.0";const z={key:0,class:"fct-content-card-list-item py-4 px-6"},O={class:"fct-content-card-list-head"},D={class:"flex items-start gap-2 flex-row"},E={class:"mb-0"},I={key:0,class:"fct-content-card-list-content"},K={class:"mt-3 space-y-2 fct-module-settings-option-wrap"},L={key:0,class:"text-xs block"},R={class:"fct-content-card-list-action"},$={class:"pr-4"},pe={__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(o){const e=A(o,"modelValue"),_=F.get("app_config.isProActive"),i=V(!1),b=V(!1),x=(g,l)=>{g==="enable_advanced_inventory"&&!_&&l==="yes"&&(e[g]="no")};return w(()=>{i.value=e.value.active,b.value=!0}),(g,l)=>{const k=h("el-button"),C=h("el-checkbox"),B=h("el-switch");return b.value?(s(),d("div",z,[t("div",O,[t("div",D,[t("h4",E,r(o.field.title),1),m(j,{size:"small",type:i.value==="yes"?"active":"inactive","hide-icon":!0},{default:p(()=>[v(r(i.value==="yes"?a(f)("Active"):a(f)("Inactive")),1)]),_:1},8,["type"])])]),o.field.description?(s(),d("div",I,[t("p",null,r(o.field.description),1),o.field.settings?(s(),q(T,{key:0,visible:i.value==="yes",accordion:""},{default:p(()=>[t("div",K,[(s(!0),d(M,null,P(o.field.settings,(c,n)=>(s(),d("div",{key:n,class:"fct-module-settings-option"},[m(C,{modelValue:e.value[n],"onUpdate:modelValue":y=>e.value[n]=y,"true-value":"yes","false-value":"no",disabled:n==="enable_advanced_inventory"&&!a(_),onChange:y=>x(n,y)},{default:p(()=>[v(r(c.label)+" ",1),n==="enable_advanced_inventory"&&!a(_)?(s(),d("span",L,[v(r(a(f)("This feature is only available in FluentCart Pro."))+" ",1),m(k,{size:"small",tag:"a",link:"",href:a(N)("feature_lock_advanced_inventory"),target:"_blank",rel:"noopener noreferrer"},{default:p(()=>[v(r(a(f)("Upgrade to Pro")),1)]),_:1},8,["href"])])):u("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"])]))),128))])]),_:1},8,["visible"])):u("",!0)])):u("",!0),t("div",R,[t("div",$,[m(B,{"active-value":"yes","inactive-value":"no",modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onChange:l[1]||(l[1]=c=>{(!e.value||typeof e.value!="object")&&(e.value={}),U(()=>{e.value.active=c})})},null,8,["modelValue"])]),u("",!0)])])):u("",!0)}}};export{pe as default};
