(window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["tools-partials-ImportOthers-vue"],{"6e58":function(t,s,i){},"954e":function(t,s,i){"use strict";var e=i("6e58"),o=i.n(e);o.a},"9b1d":function(t,s,i){"use strict";i.r(s);var e=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("core-card",{staticClass:"aioseo-import-others",attrs:{id:"aioseo-import-others",slug:"importOtherPlugins",toggles:!1,"no-slide":"","header-text":t.strings.importSettingsFromOtherPlugins},scopedSlots:t._u([{key:"header-icon",fn:function(){return[i("svg-download")]},proxy:!0}])},[i("div",{staticClass:"aioseo-section-description"},[t._v(" "+t._s(t.strings.importOthersDescription)+" ")]),t.importSuccess?i("core-alert",{staticClass:"import-success",attrs:{type:"green"}},[t._v(" "+t._s(t.importSuccessful)+" ")]):t._e(),t.importError?i("core-alert",{staticClass:"import-error",attrs:{type:"red"}},[t._v(" "+t._s(t.importErrorMessage)+" ")]):t._e(),i("base-select",{attrs:{size:"medium",options:t.plugins,placeholder:t.strings.selectPlugin},scopedSlots:t._u([{key:"option",fn:function(s){var e=s.option;return[i("div",{staticClass:"import-plugin-label"},[i("span",{staticClass:"plugin-label"},[t._v(t._s(e.label))]),e.$isDisabled?i("span",{staticClass:"plugin-status"},[t._v(t._s(t.strings.notInstalled))]):t._e()])]}}]),model:{value:t.plugin,callback:function(s){t.plugin=s},expression:"plugin"}}),t.plugin?i("div",{staticClass:"import-settings"},[t.plugin.canImport?i("grid-row",[i("grid-column",[i("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.settings,(function(s,e){return i("grid-column",{key:e,attrs:{xl:"3",md:"4",sm:"6"}},[t.options.all?t._e():i("base-checkbox",{attrs:{size:"medium"},model:{value:t.options[s.value],callback:function(i){t.$set(t.options,s.value,i)},expression:"options[setting.value]"}},[t._v(" "+t._s(s.label)+" ")]),"all"!==s.value&&t.options.all?i("base-checkbox",{attrs:{size:"medium",value:!0,disabled:""}},[t._v(" "+t._s(s.label)+" ")]):t._e()],1)}))],2):t._e(),t.plugin.canImport?t._e():i("core-alert",{attrs:{type:"red"}},[t._v(" "+t._s(t.invalidVersion(t.plugin))+" ")])],1):t._e(),i("base-button",{staticClass:"import",attrs:{type:"blue",size:"medium",disabled:!t.plugin||!t.canImport,loading:t.loading},on:{click:t.processImportPlugin}},[t._v(" "+t._s(t.strings.import)+" ")])],1)},o=[],n=(i("4de4"),i("4160"),i("45fc"),i("b0c0"),i("b64b"),i("159b"),i("5530")),r=i("2f62"),l={data:function(){return{importSuccess:!1,importError:!1,options:{},plugin:null,loading:!1,strings:{importSettingsFromOtherPlugins:this.$t.__("Import Settings From Other Plugins",this.$td),importOthersDescription:this.$t.sprintf(this.$t.__("Choose a plugin to import SEO data directly into %1$s.",this.$td),"AIOSEO"),selectPlugin:this.$t.__("Select a plugin...",this.$td),import:this.$t.__("Import",this.$td),allSettings:this.$t.__("All Settings",this.$td),notInstalled:this.$t.__("not installed",this.$td)}}},watch:{plugin:function(){this.importSuccess=!1,this.importError=!1,this.options={}}},computed:{settings:function(){var t=[{value:"settings",label:this.$t.__("SEO Settings",this.$td)},{value:"postMeta",label:this.$t.__("Post Meta",this.$td)}];return this.$isPro&&t.push({value:"termMeta",label:this.$t.__("Term Meta",this.$td)}),t},plugins:function(){var t=[];return this.$aioseo.importers.forEach((function(s){t.push({value:s.slug,label:s.name,canImport:s.canImport,version:s.version,$isDisabled:!s.installed})})),t},canImport:function(){var t=this,s=[];return Object.keys(this.options).forEach((function(i){s.push(t.options[i])})),s.some((function(t){return t}))},importSuccessful:function(){return this.$t.sprintf(this.$t.__("%1$s was successfully imported!",this.$td),this.plugin.label)},importErrorMessage:function(){return this.$t.sprintf(this.$t.__("An error occurred while importing %1$s. Please try again.",this.$td),this.plugin.label)}},methods:Object(n["a"])(Object(n["a"])({},Object(r["b"])(["importPlugins"])),{},{processImportPlugin:function(){var t=this;this.importSuccess=!1,this.importError=!1,this.loading=!0;var s=[];this.options.all?this.settings.filter((function(t){return"all"!==t.value})).forEach((function(t){s.push(t.value)})):Object.keys(this.options).forEach((function(i){t.options[i]&&s.push(i)})),this.importPlugins([{plugin:this.plugin.value,settings:s}]).then((function(){t.loading=!1,t.importSuccess=!0,t.options={}})).catch((function(){t.loading=!1,t.importError=!0,t.options={}}))},invalidVersion:function(t){return this.$t.sprintf(this.$t.__("We do not support importing from the currently installed version of %1$s (%2$s). Please upgrade to the latest version and try again.",this.$td),t.label,t.version)}})},a=l,u=(i("954e"),i("2877")),p=Object(u["a"])(a,e,o,!1,null,null,null);s["default"]=p.exports}}]);