1import{_ as h,O as L,E as n}from"./index.b39fe1b1.js";import{F as y}from"./index.42dae36b.js";import{e as k}from"./editorMixin.7e61341c.js";import{N as s,D as M,W as v,U as a,f as o}from"./vue.00f7c436.js";import{N as m,P as c}from"./index.c06744a9.js";import{T as d}from"./teemail-mailing-list.9b9374c0.js";import{a as g,b as u}from"./sentry.09480738.js";import"./faSlidersH.ad74e57e.js";import"./faCopy.38f9d2ec.js";import"./faFloppyDisk.3e6f3d05.js";import"./isEqual.7a4a4211.js";import"./formConfig.a1ad88ef.js";import"./faCircle.bfdafcd9.js";import"./faAlignCenter.2ec5515f.js";import"./faArrowDown.54f3a258.js";import"./faArrowRight.97fd3c4b.js";const w={name:"NewsletterSubscribeTemplateEditor",components:{FormBuilder:y},mixins:[k],data(){return{mailingLists:[],loadingMailingLists:!1,genericErrorMessage:"Sorry, something went wrong configuring your mailing lists, we've informed our team of the issue"}},computed:{mailingList(){return this.mailingLists.find(e=>e.id===this.getProperty("mailingList",void 0,"number"))}},created(){this.fetchMailingLists()},methods:{maxDevice:L,setMailingList(e){!e||this.setProperty("mailingList",e.id)},async fetchMailingLists(){if(!this.loadingMailingLists){this.loadingMailingLists=!0;try{this.mailingLists=await d.list(this.$store.state.store.active),this.mailingLists.length||await this.createDefaultMailingList(),this.getProperty("mailingList")||this.setMailingList(this.mailingLists[0])}catch(e){switch(n.Log.tag("teemail").red(`Provider - ${e.constructor.name}`).space().error(e),e.constructor){case c:snackbar.error(e.message);break;case m:u("404'ed attempting to fetch Teemail mailing lists"),snackbar.error(this.genericErrorMessage);break;default:g(e),snackbar.error(this.genericErrorMessage);break}this.mailingLists=[]}finally{this.loadingMailingLists=!1}}},async createDefaultMailingList(){try{const e=await d.create(this.$store.state.store.active,{name:"All"});this.mailingLists.push(e)}catch(e){switch(n.Log.tag("teemail").red(`Provider - ${e.constructor.name}`).space().error(e),e.constructor){case c:snackbar.error(e.message);break;case m:u("404'ed attempting to create a mailing list"),snackbar.error(this.genericErrorMessage);break;default:g(e),snackbar.error(this.genericErrorMessage);break}this.mailingLists=[]}}}};function P(e,i,B,E,p,r){const l=s("form-builder"),f=s("tml-new-select"),b=s("template-editor-layout");return M(),v(b,null,{advanced:a(()=>[o(l,{value:e.template.data.properties,fields:{mailingList:"custom",font:"font",primaryActions:{type:"selector",label:"Button style",options:[{text:"Primary",value:"1"},{text:"Secondary",value:"0"}]},stacked:{when:!r.maxDevice("md"),label:"Style",type:"selector",options:[{text:"Stacked",value:"1",icon:["fak","newsletter-stacked-light"]},{text:"Parallel",value:"0",icon:["fak","newsletter-parallel-light"]}]},backgroundColor:e.config.boxColor,textColor:{type:"color",label:"Text Colour"},spacing:{type:"text",label:"Extra Padding"},borderRadius:e.config.borderRadius,formBorderRadius:{...e.config.borderRadius,label:"Form Corners"},buttonBorderRadius:{...e.config.borderRadius,label:"Button Corners"},...e.globalFields},"pre-process-field":e.onProcessField,groups:{[void 0]:["mailingList"],Text:["font","textColor"],Form:["formBorderRadius"],Button:["primaryActions","buttonBorderRadius"],Block:["fullBackgroundColor","borderRadius","fullWidth","backgroundColor","stacked","spacing"]},onSet:i[1]||(i[1]=t=>e.setProperty(t.name,t.value))},{mailingList:a(()=>[o(f,{class:"mb-4",label:"Mailing list",name:"mailing-list","identifier-field":"id","display-field":"name","as-reference":!1,options:p.mailingLists,value:r.mailingList,onInput:r.setMailingList},null,8,["options","value","onInput"])]),_:1},8,["value","fields","pre-process-field"])]),default:a(()=>[o(l,{value:e.template.data.properties,fields:{title:"text",copy:"text"},"pre-process-field":e.onProcessField,onSet:i[0]||(i[0]=t=>e.setProperty(t.name,t.value))},null,8,["value","pre-process-field"])]),_:1})}const j=h(w,[["render",P]]);export{j as default}; 2//# sourceMappingURL=NewsletterSubscribeEditor.4f1f54b0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.