import{r as i,d as o,h as t}from"./p-03169580.js";const n="fireenjin-mx-modal-code-editor fireenjin-code-editor{position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;min-height:100%;min-width:100%}";let e=class{constructor(t){i(this,t);this.fireenjinTrigger=o(this,"fireenjinTrigger",7);this.pageTitle="Sample Data";this.name="sampleData";this.endpoint="editTemplate"}async onSubmit(){this.fireenjinTrigger.emit({name:"closeModal"})}onCodeChange(i){var o;if(!((o=i===null||i===void 0?void 0:i.detail)===null||o===void 0?void 0:o.value))return;this.value=i.detail.value}render(){return[t("ion-header",null,t("ion-toolbar",null,t("ion-title",null,this.pageTitle||"Sample Data"),t("ion-buttons",{slot:"end"},t("ion-button",{onClick:()=>this.formEl.submit()},t("ion-icon",{slot:"icon-only",name:"save"})),t("ion-button",{onClick:()=>this.fireenjinTrigger.emit({name:"closeModal",el:this.modalEl,component:"mx-modal-send-email"})},t("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),t("ion-content",{style:{"--background":"var(--ion-color-base)"}},t("fireenjin-form",{ref:i=>this.formEl=i,endpoint:this.endpoint,documentId:this.documentId,hideControls:true,beforeSubmit:async()=>({[this.name]:typeof this.value==="string"&&this.language==="json"?JSON.parse(this.value):this.value||null})},t("fireenjin-code-editor",{name:this.name||"sampleData",language:this.language||"json",value:this.value})))]}};e.style=n;export{e as fireenjin_mx_modal_code_editor};
//# sourceMappingURL=p-965e2147.entry.js.map