text: (window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["redirects-pro-partials-ExportRedirects-vue"],{3869:function(t,e,s){"use strict";s.r(e);var o=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("core-card",{staticClass:"aioseo-export-redirects",attrs:{slug:"exportRedirects",toggles:!1,"no-slide":"","header-text":t.strings.exportRedirects},scopedSlots:t._u([{key:"header-icon",fn:function(){return[s("svg-upload")]},proxy:!0}])},[s("div",{staticClass:"export-redirects aioseo-settings-row"},[s("div",{staticClass:"export-description"},[t._v(" "+t._s(t.strings.exportDescription)+" ")]),s("grid-row",[s("grid-column",{staticClass:"export-logs"},[s("base-checkbox",{attrs:{size:"medium"},model:{value:t.exportOptions.all,callback:function(e){t.$set(t.exportOptions,"all",e)},expression:"exportOptions.all"}},[t._v(" "+t._s(t.strings.allRedirects)+" ")])],1),t._l(t.$constants.REDIRECT_GROUPS,(function(e,o){return s("grid-column",{key:o,attrs:{sm:"12"}},[t.exportOptions.all?t._e():s("base-checkbox",{attrs:{size:"medium"},model:{value:t.exportOptions[e.value],callback:function(s){t.$set(t.exportOptions,e.value,s)},expression:"exportOptions[group.value]"}},[t._v(" "+t._s(e.label)+" ")]),"all"!==e.value&&t.exportOptions.all?s("base-checkbox",{attrs:{size:"medium",value:!0,disabled:""}},[t._v(" "+t._s(e.label)+" ")]):t._e()],1)}))],2),s("base-select",{attrs:{size:"medium",options:t.exportTypes},model:{value:t.exportType,callback:function(e){t.exportType=e},expression:"exportType"}}),s("base-button",{staticClass:"import",attrs:{type:"blue",size:"medium",disabled:!t.canExport,loading:t.loading},on:{click:t.processExportRedirects}},[t._v(" "+t._s(t.strings.exportRedirects)+" ")])],1),s("div",{staticClass:"export-logs-wrapper"},[s("div",{staticClass:"export-logs"},[t._v(" "+t._s(t.strings.logs)+" ")]),t.options.logs.redirects.enabled&&"server"!==t.options.main.method?s("base-button",{attrs:{type:"gray",size:"medium",loading:t.exportingRedirectLogs},on:{click:function(e){return t.processExportLogs("redirect")}}},[t._v(" "+t._s(t.strings.exportRedirectLogs)+" ")]):t._e(),t.options.logs.log404.enabled?s("base-button",{attrs:{type:"gray",size:"medium",loading:t.exporting404Logs},on:{click:function(e){return t.processExportLogs("404")}}},[t._v(" "+t._s(t.strings.export404Logs)+" ")]):t._e()],1)])},i=[],r=s("5530"),a=(s("159b"),s("b64b"),s("4de4"),s("d3b7"),s("3ca3"),s("ddb0"),s("2b3d"),s("99af"),s("fb6a"),s("2f62")),n={data:function(){return{exportingRedirectLogs:!1,exporting404Logs:!1,exportOptions:{},postOptions:{},loading:!1,exportType:{label:this.$t.__("Complete Data (JSON)",this.$td),value:"json"},exportTypes:[{label:this.$t.__("Complete Data (JSON)",this.$td),value:"json"},{label:this.$t.__("Apache Redirects (.htaccess)",this.$td),value:"htaccess"},{label:this.$t.__("Nginx Redirects (.nginx)",this.$td),value:"nginx"}],strings:{exportRedirects:this.$t.__("Export Redirects",this.$td),exportDescription:this.$t.__("Export to JSON, .htaccess or .nginx. The JSON format contains full information (and can be re-imported), while the other formats only contain partial information relavant to that format.",this.$td),allRedirects:this.$t.__("Export All Redirects",this.$td),logs:this.$t.__("Logs",this.$td),exportRedirectLogs:this.$t.__("Export Redirect Logs",this.$td),export404Logs:this.$t.__("Export 404 Logs",this.$td)}}},computed:Object(r["a"])(Object(r["a"])({},Object(a["e"])("redirects",["options"])),{},{settings:function(){var t=[{value:"webmasterTools",label:this.$t.__("Webmaster Tools",this.$td)},{value:"rssContent",label:this.$t.__("RSS Content",this.$td)},{value:"advanced",label:this.$t.__("Advanced",this.$td)},{value:"searchAppearance",label:this.$t.__("Search Appearance",this.$td)},{value:"social",label:this.$t.__("Social Networks",this.$td)},{value:"sitemap",label:this.$t.__("Sitemaps",this.$td)},{value:"tools",label:this.$t.__("Tools",this.$td)}];return this.$isPro&&t.push({value:"accessControl",label:this.$t.__("Access Control",this.$td)}),!this.isUnlicensed&&this.showImageSeoReset&&t.push({value:"image",label:this.$t.__("Image SEO",this.$td)}),!this.isUnlicensed&&this.showLocalBusinessReset&&t.push({value:"localBusiness",label:this.$t.__("Local Business SEO",this.$td)}),t},canExport:function(){var t=this,e=[];return Object.keys(this.exportOptions).forEach((function(s){e.push(t.exportOptions[s])})),Object.keys(this.postOptions).forEach((function(s){e.push(t.postOptions[s])})),e.some((function(t){return t}))}}),methods:Object(r["a"])(Object(r["a"])({},Object(a["b"])("redirects",["exportRedirects","exportLogs"])),{},{processExportRedirects:function(){var t=this,e=[];this.exportOptions.all?this.$constants.REDIRECT_GROUPS.filter((function(t){return"all"!==t.value})).forEach((function(t){e.push(t.value)})):Object.keys(this.exportOptions).forEach((function(s){t.exportOptions[s]&&e.push(s)}));var s=this.exportType.value;this.loading=!0,this.exportRedirects({groups:e,type:s}).then((function(e){var o=new Blob([e.body.redirects]);"json"===s&&(o=new Blob([JSON.stringify(e.body.redirects)],{type:"application/json"})),t.loading=!1,t.exportOptions={},t.postOptions={};var i=document.createElement("a");i.href=URL.createObjectURL(o),i.download="aioseo-export-redirects-".concat(t.$moment().format("YYYY-MM-DD"),".").concat(s),i.click(),URL.revokeObjectURL(i.href)}))},processExportLogs:function(t){var e=this;this["exporting"+t.charAt(0).toUpperCase()+t.slice(1)+"Logs"]=!0,this.exportLogs(t).then((function(s){e["exporting"+t.charAt(0).toUpperCase()+t.slice(1)+"Logs"]=!1;var o=new Blob([s.body.redirects]),i=document.createElement("a");i.href=URL.createObjectURL(o),i.download="aioseo-export-redirects-log-".concat(t,"-").concat(e.$moment().format("YYYY-MM-DD"),".log"),i.click(),URL.revokeObjectURL(i.href)}))}})},c=n,l=(s("94f6"),s("2877")),p=Object(l["a"])(c,o,i,!1,null,null,null);e["default"]=p.exports},"79fd":function(t,e,s){},"94f6":function(t,e,s){"use strict";s("79fd")}}]);