import{r as i,d as o,h as n}from"./p-9b6cc562.js";const t=class{constructor(n){i(this,n),this.fireenjinTrigger=o(this,"fireenjinTrigger",7),this.pageTitle="Sample Data",this.name="sampleData"}async onSubmit(){this.fireenjinTrigger.emit({name:"closeModal"})}onCodeChange(i){var o;(null===(o=null==i?void 0:i.detail)||void 0===o?void 0:o.value)&&(this.value=i.detail.value)}render(){return[n("ion-header",null,n("ion-toolbar",null,n("ion-title",null,this.pageTitle||"Sample Data"),n("ion-buttons",{slot:"end"},this.documentId&&n("ion-button",{onClick:()=>this.formEl.submit()},n("ion-icon",{slot:"icon-only",name:"save"})),n("ion-button",{onClick:()=>this.fireenjinTrigger.emit({name:"closeModal",el:this.modalEl,component:"mx-modal-send-email"})},n("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),n("ion-content",{style:{"--background":"var(--ion-color-base)"}},n("fireenjin-form",{ref:i=>this.formEl=i,endpoint:this.endpoint,documentId:this.documentId,hideControls:!0,beforeSubmit:async()=>({[this.name]:"string"==typeof this.value&&"json"===this.language?JSON.parse(this.value):this.value||null})},n("fireenjin-code-editor",{name:this.name||"sampleData",language:this.language||"json",value:this.value})))]}};t.style="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%}";export{t as fireenjin_mx_modal_code_editor}