import{r as e,d as i,h as n,e as l}from"./p-03169580.js";const t="fireenjin-mx-modal-template-settings .head-input,fireenjin-mx-modal-template-settings .routes-input{display:block;width:100%}fireenjin-mx-modal-template-settings .head-input ion-label,fireenjin-mx-modal-template-settings .routes-input ion-label{font-size:16px !important;font-weight:bold !important;display:block;background:transparent;text-align:left;font-family:var(--ion-font-family);position:relative;font-size:inherit;text-align:inherit;padding:0 0 20px 25px}fireenjin-mx-modal-template-settings .head-input fireenjin-code-editor,fireenjin-mx-modal-template-settings .routes-input fireenjin-code-editor{min-height:300px !important}";let o=class{constructor(n){e(this,n);this.fireenjinTrigger=i(this,"fireenjinTrigger",7);this.pageTitle="Edit Template Info";this.template={};this.showAdvanced=false;this.tags=[]}async onSubmit(){this.fireenjinTrigger.emit({name:"closeModal"})}async onReset(){this.fireenjinTrigger.emit({name:"closeModal"})}onCodeChange(e){var i;if(!((i=e===null||e===void 0?void 0:e.detail)===null||i===void 0?void 0:i.value))return;this.head=e.detail.value}render(){var e,i,l,t,o,a,s,d,r,u,m,h;return[n("ion-header",null,n("ion-toolbar",null,n("ion-title",null,this.pageTitle),n("ion-buttons",{slot:"end"},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",null,n("fireenjin-form",{ref:e=>this.formEl=e,endpoint:this.templateId!=="new"?"editTemplate":"addTemplate",documentId:this.templateId,hideControls:true,beforeSubmit:async e=>{var i;return{...e,head:this.head||((i=this.template)===null||i===void 0?void 0:i.head),partial:(e===null||e===void 0?void 0:e.partial)==="on",prerender:(e===null||e===void 0?void 0:e.prerender)==="on",attachments:((e===null||e===void 0?void 0:e.attachments)||[]).map((e=>({href:e,filename:e.split("/").pop()})))}}},n("fireenjin-input",{labelPosition:"stacked",name:"subject",label:"Subject",value:(e=this.template)===null||e===void 0?void 0:e.subject}),this.types&&n("fireenjin-select",{name:"type",label:"Type",labelPosition:"stacked",placeholder:"Select Type",value:(i=this.template)===null||i===void 0?void 0:i.type,interface:"action-sheet",options:this.types}),n("fireenjin-input",{labelPosition:"stacked",name:"description",label:"Description",value:(l=this.template)===null||l===void 0?void 0:l.description}),n("fireenjin-input",{labelPosition:"stacked",label:"Text Only Version",name:"text",value:(t=this.template)===null||t===void 0?void 0:t.text}),n("fireenjin-select-tags",{labelPosition:"stacked",label:"Tags",lines:"full",multiple:true,options:this.tags,allowAdding:true,value:((o=this.template)===null||o===void 0?void 0:o.tags)||[]}),n("div",{id:"advanced",style:{transition:"all ease 0.4s",opacity:this.showAdvanced?"1":"0",height:this.showAdvanced?"auto":"0",overflow:"hidden"}},n("fireenjin-input",{labelPosition:"stacked",name:"name",label:"Name",value:(a=this.template)===null||a===void 0?void 0:a.name}),n("fireenjin-select-tags",{labelPosition:"stacked",label:"Attachments",lines:"full",multiple:true,options:(((s=this.template)===null||s===void 0?void 0:s.attachments)||[]).map((e=>({label:e===null||e===void 0?void 0:e.filename,value:e===null||e===void 0?void 0:e.path}))),allowAdding:true,value:((d=this.template)===null||d===void 0?void 0:d.attachments)||[]}),n("fireenjin-input",{labelPosition:"stacked",label:"AMP Version",name:"amp",value:(r=this.template)===null||r===void 0?void 0:r.amp}),n("ion-grid",null,n("ion-row",null,n("ion-col",null,n("fireenjin-toggle",{label:"Template Partial",name:"partial",value:!!((u=this.template)===null||u===void 0?void 0:u.partial)})),n("ion-col",null,n("fireenjin-toggle",{label:"Prerender",name:"prerender",value:!!((m=this.template)===null||m===void 0?void 0:m.prerender)})))),n("div",{class:"head-input"},n("ion-label",{class:"sc-ion-label-md-h sc-ion-label-md-s md label-stacked hydrated"},"Head"),n("fireenjin-code-editor",{name:"head",value:((h=this.template)===null||h===void 0?void 0:h.head)||""}))),n("ion-button",{fill:"clear",expand:"full",onClick:()=>this.showAdvanced=!this.showAdvanced},this.showAdvanced?"Hide":"Show"," Advnaced")))]}get modalEl(){return l(this)}};o.style=t;export{o as fireenjin_mx_modal_template_settings};
//# sourceMappingURL=p-7ee3208b.entry.js.map