import{aL as e,aK as l,k as a,g as i}from"./vendor-element-plus.js?ver=3.1.0";import{c as d,o,a as t,K as s,L as n,w as r,Q as m,as as u,bM as c,d as p,b as f,O as h,P as g}from"./vendor.js?ver=3.1.0";import{_ as V}from"./fc-bits-ui.js?ver=3.1.0";const v={style:{width:"100%"}},b=["type","placeholder"],C={key:2},k={class:"fc-verified-email-input-dialog-footer"};const w=V({name:"VerifiedEmailInput",props:["field","modelValue"],emits:["update:modelValue"],data(){return{selectedMail:this.modelValue,model:this.modelValue,dialogWarningVisible:!1,warningMessage:this.$t("Warning default email change")}},watch:{model(e){this.$emit("update:modelValue",e),null!=e&&e!=this.selectedMail&&(this.dialogWarningVisible=!0),null!=e&&e==this.selectedMail&&(this.dialogWarningVisible=!1)}},methods:{cancelChangeDefaultEmail(){this.model=this.selectedMail,this.dialogWarningVisible=!1},confirmChangeDefaultEmail(){this.dialogWarningVisible=!1,this.selectedMail=this.model}}},[["render",function(V,w,y,_,M,W){const E=e,$=l,D=a,j=i;return o(),d("div",v,[V.appVars.verified_senders.length?(o(),t($,{key:0,placeholder:y.field.placeholder,filterable:"","allow-create":"",modelValue:M.model,"onUpdate:modelValue":w[0]||(w[0]=e=>M.model=e)},{default:r(()=>[(o(!0),d(m,null,u(V.appVars.verified_senders,e=>(o(),t(E,{key:e,value:e},null,8,["value"]))),128))],void 0),_:1},8,["placeholder","modelValue"])):s((o(),d("input",{key:1,type:y.field.data_type,placeholder:y.field.placeholder,"onUpdate:modelValue":w[1]||(w[1]=e=>M.model=e),class:"fc-input-email"},null,8,b)),[[c,M.model]]),y.field.show_warning?(o(),d("div",C,[p(j,{title:V.$t("Confirm"),modelValue:M.dialogWarningVisible,"onUpdate:modelValue":w[2]||(w[2]=e=>M.dialogWarningVisible=e),"close-on-click-modal":!1,"append-to-body":!0,width:"30%"},{footer:r(()=>[f("span",k,[p(D,{onClick:W.cancelChangeDefaultEmail},{default:r(()=>[h(g(V.$t("Cancel")),1)],void 0,!0),_:1},8,["onClick"]),p(D,{type:"warning",onClick:W.confirmChangeDefaultEmail},{default:r(()=>[h(g(V.$t("Continue")),1)],void 0,!0),_:1},8,["onClick"])])]),default:r(()=>[f("span",null,[h(g(M.warningMessage+" "),1),f("strong",null,g(M.model+"."),1)])],void 0),_:1},8,["title","modelValue"])])):n("",!0)])}]]);export{w as V};
