(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{531:function(t,e,s){"use strict";function n(t,e,s,n,i,a,o,l){var p,r="function"==typeof t?t.options:t;if(e&&(r.render=e,r.staticRenderFns=s,r._compiled=!0),n&&(r.functional=!0),a&&(r._scopeId="data-v-"+a),o?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},r._ssrRegister=p):i&&(p=l?function(){i.call(this,this.$root.$options.shadowRoot)}:i),p)if(r.functional){r._injectStyles=p;var d=r.render;r.render=function(t,e){return p.call(e),d(t,e)}}else{var c=r.beforeCreate;r.beforeCreate=c?[].concat(c,p):[p]}return{exports:t,options:r}}s.d(e,"a",(function(){return n}))},735:function(t,e,s){"use strict";s.r(e);var n=s(220),i=s(222),a=s(3).a.extend({components:{dashboardInput:n.f},model:{prop:"post",event:"change"},props:{post:{type:Object,required:!0}},data:()=>({template:"",settings:{},pageTemplateInfo:{}}),computed:{localPost:{get(){return{template:"default",...this.post}},set(t){this.$emit("change",t)}},fields(){return this.pageTemplateInfo.fields||[]}},watch:{settings:{handler:function(t){this.localPost={...this.localPost,settings:t}},deep:!0},template:{handler:function(t){this.setPageTemplate(t)}},"post.template":{handler:function(t){t&&t!=this.template&&(this.template=t)},immediate:!0},"post.settings":{handler:function(t){t&&t!=this.settings&&(this.settings=t)},immediate:!0}},methods:{getPageTemplates:i.a,async setPageTemplate(t){this.localPost={...this.localPost,template:t},this.pageTemplateInfo=await Object(i.b)(t),this.setTemplateDefaults()},setTemplateDefaults(){this.fields.forEach(t=>{const e=t._id;let s;void 0===this.settings[e]&&t.default&&(s=t.settings&&Array.isArray(t.settings)?t.default.map(e=>(t.settings.forEach(t=>{void 0===e[t._id]&&t.default&&(e[t._id]=t.default)}),e)):t.default,this.$set(this.settings,e,s))})}}}),o=s(531),l=Object(o.a)(a,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"edit-page-templates"},[s("dashboard-input",{attrs:{list:t.getPageTemplates(),input:"factor-input-select",label:"Page Template"},model:{value:t.template,callback:function(e){t.template=e},expression:"template"}}),t._v(" "),t._l(t.fields,(function(e,n){return s("dashboard-input",{key:n,class:["engine-input",e.input],attrs:{input:"factor-input-"+e.input,label:e.label,description:e.description,inputs:e.settings||[]},model:{value:t.settings[e._id],callback:function(s){t.$set(t.settings,e._id,s)},expression:"settings[field._id]"}})}))],2)}),[],!1,null,null,null);e.default=l.exports}}]);