!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=61)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.React},function(e,t,n){var r=n(35),i=n(36),s=n(23),a=n(37);e.exports=function(e,t){return r(e)||i(e,t)||s(e,t)||a()}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=window.wp.apiFetch},function(e,t,n){e.exports=n(29)()},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n=0&&y-j[0]<=f&&y+d+j[1]>=0}(e,n):function(e){var t=e.ref;if(!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))return!1;var n=void 0,r=void 0;try{var i=t.getBoundingClientRect();n=i.top,r=i.height}catch(e){n=0,r=0}var s=window.innerHeight||document.documentElement.clientHeight,a=Array.isArray(e.props.offset)?e.props.offset:[e.props.offset,e.props.offset];return n-a[0]<=s&&n+r+a[1]>=0}(e))?e.visible||(e.props.once&&d.push(e),e.visible=!0,e.forceUpdate()):e.props.once&&e.visible||(e.visible=!1,e.props.unmountIfInvisible&&e.forceUpdate())}},_=function(){d.forEach((function(e){var t=b.indexOf(e);-1!==t&&b.splice(t,1)})),d=[]},E=function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{};return function(t){return function(n){function i(){m(this,i);var e=f(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return e.displayName="LazyLoad"+k(t),e}return g(i,n),r(i,[{key:"render",value:function(){return s.default.createElement(C,e,s.default.createElement(t,this.props))}}]),i}(i.Component)}},t.default=C,t.forceCheck=E,t.forceVisible=function(){for(var e=0;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?r=setTimeout(l,t-c):(r=null,n||(o=e.apply(s,i),r||(s=null,i=null)))};return function(){s=this,i=arguments,a=+new Date;var c=n&&!r;return r||(r=setTimeout(l,t)),c&&(o=e.apply(s,i),s=null,i=null),o}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r,i;return t||(t=250),function(){var s=n||this,a=+new Date,o=arguments;r&&aa[l]?1:-1}return s.length!==a.length?-1:0}var j=n(1),_=n(2),E=n(20),w=n(6),P=n.n(w);var C=function(e){m()(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=b()(t);if(n){var i=b()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return g()(this,e)});function s(){var e;return a()(this,s),(e=r.apply(this,arguments)).state={allSites:{},isAPIWorking:!1,siteOpened:!1,siteData:{},siteSlug:"",sitePlugins:{},hasData:{},hasWidgets:!1,importOptions:!0,importContent:!0,confirmImport:!1,importComplete:!1,installablePlugins:[],activePlugins:[],manualPlugins:[],refreshingSites:!1,hasBackup:gppSiteLibrary.hasBackup,pageBuilder:"No Page Builder",category:"",device:"desktop"},e.importThemeOptions=e.importThemeOptions.bind(p()(e)),e.installPlugins=e.installPlugins.bind(p()(e)),e.activatePlugins=e.activatePlugins.bind(p()(e)),e.importContent=e.importContent.bind(p()(e)),e.importSiteOptions=e.importSiteOptions.bind(p()(e)),e.importWidgets=e.importWidgets.bind(p()(e)),e}return l()(s,[{key:"componentDidMount",value:function(){var e=this;P()({path:"/generatepress-site-library/v1/get_sites",method:"POST",data:{forceRefresh:!1}}).then((function(t){e.setState({isAPILoaded:!0,allSites:t.response})}))}},{key:"importThemeOptions",value:function(e){var t=this,n=e.target.nextElementSibling;n.classList.add("gpp-library-action-message--show"),n.textContent=Object(j.__)("Importing theme options","gp-premium"),P()({path:"/generatepress-site-library/v1/import_theme_options",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(e){n.textContent=e.response,e.success&&e.response||n.classList.add("gblocks-action-message--error"),setTimeout((function(){t.state.importContent?Object.keys(t.state.hasData.plugin_data).length>0?t.installPlugins(n):t.importContent(n):(n.textContent=Object(j.__)("Import Complete","gp-premium"),t.setState({isAPIWorking:!1,importComplete:!0,hasBackup:!0}))}),2e3)}))}},{key:"installPlugins",value:function(e){var t=this;void 0!==e.target&&(e=e.target.nextElementSibling),e.classList.add("gpp-library-action-message--show"),e.textContent=Object(j.__)("Installing plugins","gp-premium"),Object.entries(this.state.hasData.plugin_data).forEach((function(n){var r=i()(n,2),s=r[0],a=r[1],o=a.slug.split("/")[0],l=a.name;a.installed?(delete t.state.hasData.plugin_data[s],0===Object.keys(t.state.hasData.plugin_data).length&&t.activatePlugins(e)):("bb-plugin"===o&&(o="beaver-builder-lite-version",l="Beaver Builder Lite"),e.textContent=Object(j.sprintf)( /* translators: Installing "Plugin Name" */ Object(j.__)("Installing %s","gp-premium"),l),wp.updates.installPlugin({slug:o,success:function(n){console.log(n),delete t.state.hasData.plugin_data[s],0===Object.keys(t.state.hasData.plugin_data).length&&t.activatePlugins(e)},error:function(n){console.log(n),delete t.state.hasData.plugin_data[s],0===Object.keys(t.state.hasData.plugin_data).length&&t.activatePlugins(e)}}))}))}},{key:"activatePlugins",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=Object(j.__)("Activating plugins","gp-premium"),P()({path:"/generatepress-site-library/v1/activate_plugins",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){t.importContent(e)}),2e3)}))}},{key:"importContent",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=Object(j.__)("Importing content","gp-premium"),P()({path:"/generatepress-site-library/v1/import_content",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){t.importSiteOptions(e)}),2e3)}))}},{key:"importSiteOptions",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=Object(j.__)("Importing site options","gp-premium"),P()({path:"/generatepress-site-library/v1/import_site_options",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){t.state.hasWidgets?t.importWidgets(e):(e.textContent=Object(j.__)("Import Complete","gp-premium"),t.setState({isAPIWorking:!1,importComplete:!0,hasBackup:!0}))}),2e3)}))}},{key:"importWidgets",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=Object(j.__)("Importing widgets","gp-premium"),P()({path:"/generatepress-site-library/v1/import_widgets",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){e.textContent=Object(j.__)("Import Complete","gp-premium"),t.setState({isAPIWorking:!1,importComplete:!0,hasBackup:!0})}),2e3)}))}},{key:"restoreBackup",value:function(e){var t=this,n=e.target.nextElementSibling;n.classList.add("gpp-library-action-message--show"),n.textContent=Object(j.__)("Restoring theme options","gp-premium"),P()({path:"/generatepress-site-library/v1/restore_theme_options",method:"POST"}).then((function(e){n.textContent=e.response,e.success&&e.response||n.classList.add("gblocks-action-message--error"),setTimeout((function(){n.textContent=Object(j.__)("Restoring content","gp-premium"),P()({path:"/generatepress-site-library/v1/restore_content",method:"POST"}).then((function(e){n.textContent=e.response,e.success&&e.response||n.classList.add("gblocks-action-message--error"),t.setState({isAPIWorking:!1,hasBackup:!1})}))}),2e3)}))}},{key:"render",value:function(){var e=this;if(!this.state.isAPILoaded)return Object(d.createElement)(_.Placeholder,{className:"gpp-library-placeholder"},Object(d.createElement)(_.Spinner,null));var t=this.state.allSites;if(!t||"no results"===t)return Object(d.createElement)("div",{className:"generatepress-site-library-no-results"},Object(d.createElement)("p",null,Object(j.__)("No sites were found.","gp-premium")," ",Object(d.createElement)("a",{href:"https://docs.generatepress.com/article/site-library-unavailable/",target:"_blank",rel:"noreferrer noopener"},Object(j.__)("Why?","gp-premium"))),Object(d.createElement)(_.Button,{isPrimary:!0,onClick:function(){e.setState({refreshingSites:!0}),P()({path:"/generatepress-site-library/v1/get_sites",method:"POST",data:{forceRefresh:!0}}).then((function(t){e.setState({isAPILoaded:!0,allSites:t.response,refreshingSites:!1})}))}},this.state.refreshingSites&&Object(d.createElement)(_.Spinner,null),!this.state.refreshingSites&&Object(j.__)("Try again","gp-premium")));var n=[{label:Object(j.__)("None","gp-premium"),value:""}],r=[];t&&Object.keys(t).forEach((function(e){t[e].page_builder.forEach((function(e){if(!r.includes(e)){if("No Page Builder"===e)return;n.push({label:e,value:e}),r.push(e)}}))}));var s=[{label:Object(j.__)("All","gp-premium"),value:""}],a=[];t&&Object.keys(t).forEach((function(e){t[e].category.forEach((function(e){a.includes(e)||(s.push({label:e,value:e}),a.push(e))}))}));var o="";"tablet"===this.state.device&&(o="768px"),"mobile"===this.state.device&&(o="480px");var l=this.state.siteData.author_name&&this.state.siteData.author_url&&"GeneratePress"!==this.state.siteData.author_name;return Object(d.createElement)(d.Fragment,null,Object(d.createElement)("div",{className:"generatepress-site-library"},!!this.state.hasBackup&&Object(d.createElement)("div",{className:"generatepress-site-library-restore"},Object(d.createElement)("h2",null,Object(j.__)("Existing Site Import Detected","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("It is highly recommended that you remove the last site you imported before importing a new one.","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.","gp-premium")),Object(d.createElement)("div",{className:"gpp-library-action-button"},Object(d.createElement)(_.Button,{isPrimary:!0,onClick:function(t){window.confirm(Object(j.__)("This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.","gp-premium"))&&(e.setState({isAPIWorking:!0}),e.restoreBackup(t))}},this.state.isAPIWorking&&Object(d.createElement)(_.Spinner,null),!this.state.isAPIWorking&&Object(j.__)("Remove imported site","gp-premium")),Object(d.createElement)("span",{className:"gpp-library-action-message"}),!this.state.isAPIWorking&&Object(d.createElement)(_.Button,{onClick:function(){e.setState({hasBackup:!1})}},Object(j.__)("No thanks","gp-premium")))),!this.state.siteOpened&&!this.state.hasBackup&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("div",{className:"generatepress-site-library-filter"},"No Page Builder"===this.state.pageBuilder&&Object(d.createElement)(_.SelectControl,{label:Object(j.__)("Category","gp-premium"),options:s,value:this.state.category,onChange:function(t){e.setState({category:t,pageBuilder:"No Page Builder"}),setTimeout((function(){Object(O.forceCheck)()}),100)}}),""===this.state.category&&Object(d.createElement)(_.SelectControl,{label:Object(j.__)("Page Builder","gp-premium"),options:n,value:this.state.pageBuilder,onChange:function(t){""===t&&(t="No Page Builder"),e.setState({pageBuilder:t,category:""}),setTimeout((function(){Object(O.forceCheck)()}),100)}})),Object(d.createElement)("ul",{className:"generatepress-site-library-list"},Object.keys(t).map((function(n){if(!t[n].page_builder.includes(e.state.pageBuilder))return null;if(""!==e.state.category&&!t[n].category.includes(e.state.category))return null;var r=t[n].directory+"/screenshot.png",i=t[n].name,s=Object(E.decodeEntities)(i),a=gppSiteLibrary.gppVersion.split("-")[0],o=t[n].min_version.split("-")[0],l=gppSiteLibrary.gpVersion.split("-")[0],c=t[n].min_theme_version?t[n].min_theme_version.split("-")[0]:l,p=y(o,a)>0||y(c,l)>0,u=t[n].image_width,m=t[n].image_height;return Object(d.createElement)("li",{className:"generatepress-site-library-list-item",key:i+":"+n},Object(d.createElement)("button",{disabled:p,onClick:function(){e.setState({siteOpened:!0,siteData:t[n],sitePlugins:JSON.parse(t[n].plugins)})}},Object(d.createElement)("div",{className:"generatepress-site-library-list-item-image"},Object(d.createElement)(v.a,{offset:100,once:!0},Object(d.createElement)("img",{src:r,alt:i,width:u,height:m}))),Object(d.createElement)("div",{className:"generatepress-site-library-list-item-title"},s,!!p&&y(o,a)>0&&Object(d.createElement)("span",{className:"generatepress-site-library-required-version"},Object(j.sprintf)( /* translators: Version number */ Object(j.__)("Requires GP Premium %s.","gp-premium"),o)),!!p&&y(c,l)>0&&Object(d.createElement)("span",{className:"generatepress-site-library-required-version"},Object(j.sprintf)( /* translators: Version number */ Object(j.__)("Requires GeneratePress %s.","gp-premium"),c)))))}))),Object(d.createElement)("div",{className:"generatepress-site-library-refresh"},Object(d.createElement)(_.Button,{isPrimary:!0,onClick:function(){e.setState({refreshingSites:!0}),P()({path:"/generatepress-site-library/v1/get_sites",method:"POST",data:{forceRefresh:!0}}).then((function(t){e.setState({isAPILoaded:!0,allSites:t.response,refreshingSites:!1})}))}},this.state.refreshingSites&&Object(d.createElement)(_.Spinner,null),!this.state.refreshingSites&&Object(j.__)("Refresh sites","gp-premium")))),this.state.siteOpened&&Object(d.createElement)("div",{className:"generatepress-site-library-opened"},Object(d.createElement)("div",{className:"generatepress-site-library-iframe"},Object(d.createElement)("iframe",{title:"gpp-site-library-frame",src:this.state.siteData.preview_url,style:{width:o}})),Object(d.createElement)("div",{className:"generatepress-site-library-info"},Object(d.createElement)("div",{className:"generatepress-site-library-header"},Object(d.createElement)("div",{className:"generatepress-site-library-header__title"},Object(d.createElement)("h2",{className:l?"has-author":""},Object(E.decodeEntities)(this.state.siteData.name)),l&&Object(d.createElement)("span",{className:"site-library-author"}, /* translators: Site library site built by "author name" */ Object(j.__)("Built by","gp-premium")+" ",Object(d.createElement)("a",{href:this.state.siteData.author_url,target:"_blank",rel:"noreferrer noopener"},this.state.siteData.author_name))),Object(d.createElement)(_.Button,{onClick:function(){e.setState({isAPIWorking:!1,siteOpened:!1,siteData:{},siteSlug:"",sitePlugins:{},hasData:{},hasWidgets:!1,importOptions:!0,importContent:!0,confirmImport:!1,importComplete:!1,installablePlugins:[],activePlugins:[],manualPlugins:[]})}},Object(d.createElement)("svg",{width:"35",height:"35",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},Object(d.createElement)("path",{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})))),Object(d.createElement)("div",{className:"generatepress-site-library-content"},!!this.state.siteData.description&&Object(d.createElement)("p",null,Object(E.decodeEntities)(this.state.siteData.description)),!this.state.importComplete&&Object(d.createElement)(d.Fragment,null,0===Object.keys(this.state.hasData).length&&Object(d.createElement)(d.Fragment,null,gppSiteLibrary.isDebugEnabled&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Debug Mode Enabled","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("WordPress debug mode is currently enabled. With this, any errors from third-party plugins might affect the import process.","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("To disable it, find WP_DEBUG in your wp-config.php file and set it to false like the below.","gp-premium")),Object(d.createElement)("code",null,"define( 'WP_DEBUG', false );"),Object(d.createElement)("p",null,Object(d.createElement)("a",{href:"https://docs.generatepress.com/article/debug-mode-enabled/",target:"_blank",rel:"noreferrer noopener"},Object(j.__)("Learn more here","gp-premium")))),Object.keys(this.state.sitePlugins).length>0&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Plugins","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("This site uses the following plugins.","gp-premium")),Object(d.createElement)("ul",{className:"generatepress-site-library-plugins"},Object.entries(this.state.sitePlugins).map((function(e){var t=i()(e,1)[0];return Object(d.createElement)("li",{key:t},t)})))),Object(d.createElement)("div",{className:"gpp-library-action-button"},Object(d.createElement)(_.Button,{isPrimary:!0,disabled:this.state.isAPIWorking,onClick:function(t){e.setState({isAPIWorking:!0});var n=t.target.nextElementSibling;n.textContent=Object(j.__)("Gathering information","gp-premium"),P()({path:"/generatepress-site-library/v1/get_site_data",method:"POST",data:{siteData:e.state.siteData}}).then((function(t){var r=[],s=[],a=[];Object.entries(t.response.plugin_data).forEach((function(e){var n=i()(e,1)[0],o=t.response.plugin_data[n];o.repo&&!o.installed?r.push(o.name):o.installed||o.active?s.push(o.name):a.push(o.name)})),e.setState({isAPIWorking:!1,hasData:t.response,sitePlugins:t.response.plugins,hasWidgets:t.response.widgets,installablePlugins:r,activePlugins:s,manualPlugins:a}),n.classList.add("gpp-library-action-message--show"),n.textContent=t.response,t.success&&t.response?setTimeout((function(){n.classList.remove("gpp-library-action-message--show")}),3e3):n.classList.add("gpp-library-action-message--error")}))}},this.state.isAPIWorking&&Object(d.createElement)(_.Spinner,null),!this.state.isAPIWorking&&Object(j.__)("Get Started","gp-premium")),Object(d.createElement)("span",{className:"gpp-library-action-message"}))),Object.keys(this.state.hasData).length>0&&Object.keys(this.state.sitePlugins).length>0&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Plugins","gp-premium")),this.state.installablePlugins.length>0&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("p",null,Object(j.__)("These plugins can be installed automatically.","gp-premium")),Object(d.createElement)("ul",{className:"generatepress-site-library-plugins"},this.state.installablePlugins.map((function(e){return Object(d.createElement)("li",{key:e},e)})))),this.state.activePlugins.length>0&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("p",null,Object(j.__)("These plugins are already installed.","gp-premium")),Object(d.createElement)("ul",{className:"generatepress-site-library-plugins"},this.state.activePlugins.map((function(e){return Object(d.createElement)("li",{key:e},e)})))),this.state.manualPlugins.length>0&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("p",null,Object(j.__)("These plugins need to be installed manually.","gp-premium")),Object(d.createElement)("ul",{className:"generatepress-site-library-plugins"},this.state.manualPlugins.map((function(e){return Object(d.createElement)("li",{key:e},e)}))))),Object.keys(this.state.hasData).length>0&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Import","gp-premium")),this.state.hasData.options&&!this.state.isAPIWorking&&Object(d.createElement)(_.Tooltip,{text:Object(j.__)("This will import the options from the Customizer.","gp-premium")},Object(d.createElement)(_.ToggleControl,{checked:!!this.state.importOptions,label:Object(j.__)("Import Theme Options","gp-premium"),onChange:function(t){e.setState({importOptions:t})}})),this.state.hasData.content&&!this.state.isAPIWorking&&Object(d.createElement)(_.Tooltip,{text:Object(j.__)("This will install and activate needed plugins, import demo content, and import site options.","gp-premium")},Object(d.createElement)(_.ToggleControl,{checked:!!this.state.importContent,label:Object(j.__)("Import Demo Content","gp-premium"),onChange:function(t){e.setState({importContent:t})}})),(!!this.state.importOptions||!!this.state.importContent)&&Object(d.createElement)(d.Fragment,null,!this.state.isAPIWorking&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Confirm Import","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.","gp-premium")),Object(d.createElement)(_.ToggleControl,{checked:!!this.state.confirmImport,label:Object(j.__)("I understand","gp-premium"),onChange:function(t){e.setState({confirmImport:t})}})),!!this.state.confirmImport&&!this.state.importComplete&&Object(d.createElement)("div",{className:"gpp-library-action-button"},Object(d.createElement)(_.Button,{isPrimary:!0,disabled:this.state.isAPIWorking,onClick:function(t){e.setState({isAPIWorking:!0}),e.state.importOptions?e.importThemeOptions(t):e.state.importContent&&e.installPlugins(t)}},this.state.isAPIWorking&&Object(d.createElement)(_.Spinner,null),!this.state.isAPIWorking&&Object(j.__)("Begin Import","gp-premium")),Object(d.createElement)("span",{className:"gpp-library-action-message"}))))),!!this.state.importComplete&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Import Complete","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("Check out your new site and start making it yours!","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("Note: We do our best to ensure all imported images are licensed for open use. However, image licenses can change, so we strongly advise that you replace all imported images with your own.","gp-premium")),Object(d.createElement)("a",{className:"components-button is-primary",href:gppSiteLibrary.homeUrl},Object(j.__)("View Site","gp-premium")),this.state.siteData.uploads_url&&Object.values(this.state.sitePlugins).includes("elementor/elementor.php")&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("h3",null,Object(j.__)("Additional Cleanup","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("This site is using Elementor which means you will want to replace the imported image URLs.","gp-premium")),Object(d.createElement)("p",null,Object(j.__)("Take note of the old and new URLs below, then head over to the Elementor Tools area to replace them.","gp-premium")),Object(d.createElement)(_.TextControl,{label:Object(j.__)("Old URL","gp-premium"),readOnly:!0,value:this.state.siteData.uploads_url}),Object(d.createElement)(_.TextControl,{label:Object(j.__)("New URL","gp-premium"),readOnly:!0,value:gppSiteLibrary.uploadsUrl}),Object(d.createElement)("a",{href:gppSiteLibrary.elementorReplaceUrls,className:"components-button is-primary",target:"_blank",rel:"noopener noreferrer"},Object(j.__)("Elementor Tools","gp-premium")))),Object(d.createElement)("div",{className:"generatepress-site-library-footer"},Object(d.createElement)(_.Tooltip,{text:Object(j.__)("Preview desktop","gp-premium")},Object(d.createElement)(_.Button,{isPrimary:"desktop"===this.state.device,onClick:function(){e.setState({device:"desktop"})}},Object(d.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},Object(d.createElement)("path",{d:"M21 14H3V4h18m0-2H3c-1.11 0-2 .89-2 2v12a2 2 0 002 2h7l-2 3v1h8v-1l-2-3h7a2 2 0 002-2V4a2 2 0 00-2-2z",fill:"currentColor"})))),Object(d.createElement)(_.Tooltip,{text:Object(j.__)("Preview tablet","gp-premium")},Object(d.createElement)(_.Button,{isPrimary:"tablet"===this.state.device,onClick:function(){e.setState({device:"tablet"})}},Object(d.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},Object(d.createElement)("path",{d:"M19 19H4V3h15m-7.5 20a1.5 1.5 0 01-1.5-1.5 1.5 1.5 0 011.5-1.5 1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m7-23h-14A2.5 2.5 0 002 2.5v19A2.5 2.5 0 004.5 24h14a2.5 2.5 0 002.5-2.5v-19A2.5 2.5 0 0018.5 0z",fill:"currentColor"})))),Object(d.createElement)(_.Tooltip,{text:Object(j.__)("Preview mobile","gp-premium")},Object(d.createElement)(_.Button,{isPrimary:"mobile"===this.state.device,onClick:function(){e.setState({device:"mobile"})}},Object(d.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},Object(d.createElement)("path",{d:"M17 19H7V5h10m0-4H7c-1.11 0-2 .89-2 2v18a2 2 0 002 2h10a2 2 0 002-2V3a2 2 0 00-2-2z",fill:"currentColor"}))))))))))}}]),s}(d.Component);Object(d.render)(Object(d.createElement)(C,null),document.getElementById("gpp-site-library"))}]);