import{r as e,d as i,h as n,e as t}from"./p-846bd001.js";const l=class{constructor(n){e(this,n),this.fireenjinTrigger=i(this,"fireenjinTrigger",7),this.pageTitle="Edit Template Info",this.template={},this.partials=[],this.hideTemplateSelect=!1,this.templateId=void 0,this.showAdvanced=!1,this.tags=[],this.head=void 0,this.helpers={formatUSD:e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(e||0)},this.types=[{label:"Component",value:"component"},{label:"Email",value:"email"},{label:"Contract",value:"contract"},{label:"Frame",value:"frame"},{label:"PDF",value:"pdf"},{label:"Feed Card",value:"feed"},{label:"Message",value:"message"},{label:"Web Page",value:"page"}]}async onSubmit(){this.fireenjinTrigger.emit({name:"closeModal"})}async onReset(){this.fireenjinTrigger.emit({name:"closeModal"})}onCodeChange(e){var i;(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.value)&&(this.head=e.detail.value)}render(){var e,i,t,l,o,a,s,d;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?"editTemplate":"addTemplate",documentId:this.templateId,hideControls:!0,beforeSubmit:async e=>{var i;return{...e,head:this.head||(null===(i=this.template)||void 0===i?void 0:i.head),attachments:((null==e?void 0:e.attachments)||[]).map((e=>({href:e,filename:e.split("/").pop()})))}}},n("fireenjin-input",{labelPosition:"stacked",name:"subject",label:"Subject",value:null===(e=this.template)||void 0===e?void 0:e.subject}),n("fireenjin-input",{labelPosition:"stacked",name:"description",label:"Description",value:null===(i=this.template)||void 0===i?void 0:i.description}),n("fireenjin-input",{labelPosition:"stacked",label:"Text Only Version",name:"text",value:null===(t=this.template)||void 0===t?void 0:t.text}),n("fireenjin-select-tags",{labelPosition:"stacked",label:"Tags",lines:"full",options:this.tags,allowAdding:!0,value:(null===(l=this.template)||void 0===l?void 0:l.tags)||[]}),n("ion-accordion-group",null,n("ion-accordion",null,n("ion-item",{slot:"header"},n("ion-label",null,"Advanced")),n("ion-list",{slot:"content"},n("fireenjin-input",{labelPosition:"stacked",name:"name",label:"Name",value:null===(o=this.template)||void 0===o?void 0:o.name}),n("fireenjin-select-tags",{labelPosition:"stacked",label:"Attachments",lines:"full",options:((null===(a=this.template)||void 0===a?void 0:a.attachments)||[]).map((e=>({label:null==e?void 0:e.filename,value:null==e?void 0:e.path}))),allowAdding:!0,value:(null===(s=this.template)||void 0===s?void 0:s.attachments)||[]}),n("fireenjin-input",{labelPosition:"stacked",label:"AMP Version",name:"amp",value:null===(d=this.template)||void 0===d?void 0:d.amp}))))))]}get modalEl(){return t(this)}};l.style="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}";export{l as fireenjin_mx_modal_template_settings}