(window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["tools-partials-ExportSettings-vue"],{"824c":function(t,s,o){"use strict";o.r(s);var e=function(){var t=this,s=t.$createElement,o=t._self._c||s;return o("core-card",{staticClass:"aioseo-export-settings",attrs:{slug:"exportSettings",toggles:!1,"no-slide":"","header-text":t.strings.exportSettings},scopedSlots:t._u([{key:"header-icon",fn:function(){return[o("svg-upload")]},proxy:!0}])},[o("div",{staticClass:"export-settings",class:{"aioseo-settings-row":t.canExportPostOptions}},[o("grid-row",[o("grid-column",{staticClass:"export-all"},[o("base-checkbox",{attrs:{size:"medium"},model:{value:t.options.all,callback:function(s){t.$set(t.options,"all",s)},expression:"options.all"}},[t._v(" "+t._s(t.strings.allSettings)+" ")])],1),t._l(t.toolsSettings,(function(s,e){return o("grid-column",{key:e,attrs:{sm:"6"}},[t.options.all?t._e():o("base-checkbox",{attrs:{size:"medium"},model:{value:t.options[s.value],callback:function(o){t.$set(t.options,s.value,o)},expression:"options[setting.value]"}},[t._v(" "+t._s(s.label)+" ")]),"all"!==s.value&&t.options.all?o("base-checkbox",{attrs:{size:"medium",value:!0,disabled:""}},[t._v(" "+t._s(s.label)+" ")]):t._e()],1)}))],2)],1),t.canExportPostOptions?o("div",{staticClass:"export-post-types"},[o("grid-row",[o("grid-column",{staticClass:"export-all"},[o("base-checkbox",{attrs:{size:"medium"},model:{value:t.postOptions.all,callback:function(s){t.$set(t.postOptions,"all",s)},expression:"postOptions.all"}},[t._v(" "+t._s(t.strings.allPostTypes)+" ")])],1),t._l(t.$aioseo.postData.postTypes,(function(s,e){return o("grid-column",{key:e,attrs:{sm:"6"}},[t.postOptions.all?t._e():o("base-checkbox",{attrs:{size:"medium"},model:{value:t.postOptions[s.name],callback:function(o){t.$set(t.postOptions,s.name,o)},expression:"postOptions[postType.name]"}},[t._v(" "+t._s(s.label)+" ")]),"all"!==s.name&&t.postOptions.all?o("base-checkbox",{attrs:{size:"medium",value:!0,disabled:""}},[t._v(" "+t._s(s.label)+" ")]):t._e()],1)}))],2)],1):t._e(),o("base-button",{staticClass:"import",attrs:{type:"blue",size:"medium",disabled:!t.canExport,loading:t.loading},on:{click:t.processExportSettings}},[t._v(" "+t._s(t.strings.exportSettings)+" ")])],1)},i=[],n=o("5530"),a=(o("159b"),o("b64b"),o("4de4"),o("b0c0"),o("d3b7"),o("3ca3"),o("ddb0"),o("2b3d"),o("2f62")),l=o("9c0e"),p={mixins:[l["m"]],data:function(){return{options:{},postOptions:{},loading:!1,strings:{exportSettings:this.$t.__("Export Settings",this.$td),allSettings:this.$t.__("Export All Settings",this.$td),allPostTypes:this.$t.__("Export All Post Types",this.$td)}}},computed:{canExport:function(){var t=this,s=[];return Object.keys(this.options).forEach((function(o){s.push(t.options[o])})),Object.keys(this.postOptions).forEach((function(o){s.push(t.postOptions[o])})),s.some((function(t){return t}))},canExportPostOptions:function(){var t=this;return["aioseo_page_general_settings","aioseo_page_advanced_settings","aioseo_page_schema_settings","aioseo_page_social_settings","aioseo_page_local_seo_settings"].some((function(s){return t.$allowed(s)}))}},methods:Object(n["a"])(Object(n["a"])({},Object(a["b"])(["exportSettings"])),{},{processExportSettings:function(){var t=this,s=[];this.options.all?(this.$isPro&&s.push("general"),s.push("internal"),this.toolsSettings.filter((function(t){return"all"!==t.value})).forEach((function(t){s.push(t.value)}))):Object.keys(this.options).forEach((function(o){t.options[o]&&s.push(o)}));var o=[];this.postOptions.all?this.$aioseo.postData.postTypes.forEach((function(t){o.push(t.name)})):Object.keys(this.postOptions).forEach((function(s){t.postOptions[s]&&o.push(s)})),this.loading=!0,this.exportSettings({settings:s,postOptions:o}).then((function(s){t.loading=!1,t.options={},t.postOptions={};var o=new Blob([JSON.stringify(s.body.settings)],{type:"application/json"}),e=document.createElement("a");e.href=URL.createObjectURL(o),e.download="aioseo-export-settings-".concat(t.$moment().format("YYYY-MM-DD"),".json"),e.click(),URL.revokeObjectURL(e.href)}))}})},r=p,c=(o("b395d"),o("2877")),u=Object(c["a"])(r,e,i,!1,null,null,null);s["default"]=u.exports},b395d:function(t,s,o){"use strict";o("d68e")},d68e:function(t,s,o){}}]);