1 line
25 KiB
JavaScript
1 line
25 KiB
JavaScript
(window.webpackJsonp_gp_premium=window.webpackJsonp_gp_premium||[]).push([[5],{55:function(e,t,n){},56:function(e,t,n){},57:function(e,t,n){},58:function(e,t,n){}}]),function(e){function t(t){for(var r,o,c=t[0],i=t[1],l=t[2],p=0,d=[];p<c.length;p++)o=c[p],Object.prototype.hasOwnProperty.call(s,o)&&s[o]&&d.push(s[o][0]),s[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(m&&m(t);d.length;)d.shift()();return a.push.apply(a,l||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],r=!0,c=1;c<n.length;c++){var i=n[c];0!==s[i]&&(r=!1)}r&&(a.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},s={2:0},a=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var c=window.webpackJsonp_gp_premium=window.webpackJsonp_gp_premium||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var m=i;a.push([60,5]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},14:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},15:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0);function s(e){return"generatepress"===e?Object(r.createElement)("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 600 600",preserveAspectRatio:"none"},Object(r.createElement)("path",{d:"M485.2 427.8l-99.1-46.2 15.8-34c5.6-11.9 8.8-24.3 10-36.7 3.3-33.7-9-67.3-33.2-91.1-8.9-8.7-19.3-16.1-31.3-21.7-11.9-5.6-24.3-8.8-36.7-10-33.7-3.3-67.4 9-91.1 33.2-8.7 8.9-16.1 19.3-21.7 31.3l-15.8 34-30.4 65.2c-.7 1.5-.1 3.3 1.5 4l65.2 30.4 34 15.8 34 15.8 68 31.7 74.7 34.8c-65 45.4-152.1 55.2-228.7 17.4C90.2 447.4 44.1 313.3 97.3 202.6c53.3-110.8 186-158.5 297.8-106.3 88.1 41.1 137.1 131.9 129.1 223.4-.1 1.3.6 2.4 1.7 3l65.6 30.6c1.8.8 3.9-.3 4.2-2.2 22.6-130.7-44-265.4-170.5-323.5-150.3-69-327-4.1-396.9 145.8-70 150.1-5.1 328.5 145.1 398.5 114.1 53.2 244.5 28.4 331.3-52.3 17.9-16.6 33.9-35.6 47.5-56.8 1-1.5.4-3.6-1.3-4.3l-65.7-30.7zm-235-109.6l15.8-34c8.8-18.8 31.1-26.9 49.8-18.1s26.9 31 18.1 49.8l-15.8 34-34-15.8-33.9-15.9z"})):"dynamic"===e?Object(r.createElement)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 256 256"},Object(r.createElement)("path",{d:"M128 26c-52.71 0-94 23.72-94 54v96c0 30.28 41.29 54 94 54s94-23.72 94-54V80c0-30.28-41.29-54-94-54zm0 12c44.449 0 82 19.233 82 42s-37.551 42-82 42-82-19.233-82-42 37.551-42 82-42zm82 138c0 22.767-37.551 42-82 42s-82-19.233-82-42v-21.21C61.97 171.163 92.374 182 128 182s66.03-10.837 82-27.21zm0-48c0 22.767-37.551 42-82 42s-82-19.233-82-42v-21.21C61.97 123.163 92.374 134 128 134s66.03-10.837 82-27.21z",fill:"currentColor"})):"tools"===e?Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},Object(r.createElement)("path",{d:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"})):"sliders"===e?Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"})):void 0}},16:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},2:function(e,t){e.exports=window.wp.components},21:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},23:function(e,t,n){var r=n(21);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},27:function(e,t,n){(function(n){var r,s;void 0===(s="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){c(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,n,o){var c=a.URL||a.webkitURL,i=document.createElement("a");n=n||e.name||"download",i.download=n,i.rel="noopener","string"==typeof e?(i.href=e,i.origin===location.origin?s(i):r(i.href)?t(e,n,o):s(i,i.target="_blank")):(i.href=c.createObjectURL(e),setTimeout((function(){c.revokeObjectURL(i.href)}),4e4),setTimeout((function(){s(i)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,a){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),n);else if(r(e))t(e,n,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){s(o)}))}}:function(e,n,r,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var c="application/octet-stream"===e.type,i=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||c&&i||o)&&"undefined"!=typeof FileReader){var m=new FileReader;m.onloadend=function(){var e=m.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=e:location=e,s=null},m.readAsDataURL(e)}else{var p=a.URL||a.webkitURL,d=p.createObjectURL(e);s?s.location=d:location.href=d,s=null,setTimeout((function(){p.revokeObjectURL(d)}),4e4)}});a.saveAs=c.saveAs=c,e.exports=c})?r.apply(t,[]):r)||(e.exports=s)}).call(this,n(54))},35:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},36:function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,s=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(s)throw a}}return n}}},37:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},4:function(e,t,n){var r=n(35),s=n(36),a=n(23),o=n(37);e.exports=function(e,t){return r(e)||s(e,t)||a(e,t)||o()}},54:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},6:function(e,t){e.exports=window.wp.apiFetch},60:function(e,t,n){"use strict";n.r(t);var r=n(14),s=n.n(r),a=n(16),o=n.n(a),c=n(4),i=n.n(c),l=n(0),m=n(1),p=n(2),d=n(6),u=n.n(d),b=n(27),g=n.n(b),_=(n(55),n(15));function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=function(){var e=Object(l.useState)(!1),t=i()(e,2),n=t[0],r=t[1],a=Object(l.useState)(""),c=i()(a,2),d=c[0],b=c[1],f=Object(l.useState)(""),h=i()(f,2),j=h[0],v=h[1],y=Object(l.useState)(!1),E=i()(y,2),w=E[0],S=E[1],x=Object(l.useState)(!1),L=i()(x,2),N=L[0],C=L[1],k=Object(l.useState)(generateProDashboard.modules),P=i()(k,2),T=P[0],A=P[1];if(Object(l.useEffect)((function(){n||r(!0)})),!n)return Object(l.createElement)(p.Placeholder,{className:"generatepress-dashboard__placeholder"},Object(l.createElement)(p.Spinner,null));var M=function(e,t,n){b(t);var r=e.target.previousElementSibling.previousElementSibling;u()({path:"/generatepress-pro/v1/modules",method:"POST",data:{key:T[t].key,action:n}}).then((function(e){b(""),r.classList.add("generatepress-dashboard__section-item-message__show"),r.textContent=e.response,e.success&&e.response?(A((function(e){return O(O({},e),{},o()({},t,O(O({},e[t]),{},{isActive:"activate"===n})))})),setTimeout((function(){r.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)):r.classList.add("generatepress-dashboard__section-item-message__error")}))};return Object(l.createElement)(l.Fragment,null,!!T&&Object(l.createElement)("div",{className:"generatepress-dashboard__section"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-title"},Object(l.createElement)("h2",null,Object(m.__)("Modules","gp-premium"))),Object.keys(T).filter((function(e){return!(!T[e].isActive&&T[e].deprecated)})).map((function(e){return Object(l.createElement)("div",{className:"generatepress-dashboard__section-item",key:e,style:{boxShadow:T[e].isActive?"-5px 0 0 var(--wp-admin-theme-color)":"-5px 0 0 #ddd",pointerEvents:"WooCommerce"!==e||generateProDashboard.hasWooCommerce?null:"none",opacity:"WooCommerce"!==e||generateProDashboard.hasWooCommerce?null:"0.5"}},Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-content"},Object(l.createElement)(l.Fragment,null,!!T[e].title&&Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-title"},T[e].title,!!T[e].isActive&&"Site Library"===e&&Object(l.createElement)("a",{className:"generatepress-module-action",href:generateProDashboard.siteLibraryUrl},Object(m.__)("Open Site Library","gp-premium")," →"),!!T[e].isActive&&"Elements"===e&&Object(l.createElement)("a",{className:"generatepress-module-action",href:generateProDashboard.elementsUrl},Object(m.__)("Open Elements","gp-premium")," →")),!!T[e].description&&Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-description"},T[e].description))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-action"},Object(l.createElement)("span",{className:"generatepress-dashboard__section-item-message"}),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-settings"},!!T[e].settings&&!!T[e].isActive&&Object(l.createElement)(l.Fragment,null,e!==j&&Object(l.createElement)(p.Tooltip,{text:Object(m.__)("Open tools for this module.","gp-premium")},Object(l.createElement)(p.Button,{isTertiary:!0,icon:Object(_.a)("sliders"),onClick:function(){return v(e)}})),e===j&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(p.Button,{disabled:!!N,className:"generatepress-dashboard__reset-button",isPrimary:!0,onClick:function(t){var n=o()({},e,T[e]);window.confirm(Object(m.__)("This will delete all settings for this module. It cannot be undone.","gp-premium"))&&function(e,t){C(!0);var n=e.target.parentNode.previousElementSibling;u()({path:"/generatepress-pro/v1/reset",method:"POST",data:{items:t}}).then((function(e){C(!1),n.classList.add("generatepress-dashboard__section-item-message__show"),"object"===s()(e.response)?n.textContent=Object(m.__)("Settings reset.","gp-premium"):n.textContent=e.response,e.success&&e.response?setTimeout((function(){n.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3):n.classList.add("generatepress-dashboard__section-item-message__error")}))}(t,n)}},!!N&&Object(l.createElement)(p.Spinner,null),!N&&Object(m.__)("Reset","gp-premium")),Object(l.createElement)(p.Button,{isTertiary:!0,onClick:function(t){!function(e,t,n,r){S(!0);var a=e.target.parentNode.previousElementSibling;u()({path:"/generatepress-pro/v1/export",method:"POST",data:{items:t,type:"all"}}).then((function(e){if(S(!1),a.classList.add("generatepress-dashboard__section-item-message__show"),"object"===s()(e.response)?a.textContent=Object(m.__)("Options exported","gp-premium"):a.textContent=e.response,e.success&&e.response){var t=(new Date).toISOString().slice(0,10),n="generatepress-settings-"+r+"-"+t+".json",o=new Blob([JSON.stringify(e.response)],{type:"application/json",name:n});g()(o,n),setTimeout((function(){a.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)}else a.classList.add("generatepress-dashboard__section-item-message__error")}))}(t,o()({},e,T[e]),0,e)}},!!w&&Object(l.createElement)(p.Spinner,null),!w&&Object(m.__)("Export","gp-premium"))))),Object(l.createElement)(p.Button,{disabled:e===d||"WooCommerce"===e&&!generateProDashboard.hasWooCommerce,isPrimary:!T[e].isActive||null,isSecondary:!!T[e].isActive||null,onClick:function(t){if(T[e].isActive){if(T[e].deprecated&&!window.confirm(Object(m.__)("This module has been deprecated. Deactivating it will remove it from this list.","gp-premium")))return;M(t,e,"deactivate")}else M(t,e,"activate")}},e===d&&Object(l.createElement)(p.Spinner,null),e!==d&&!T[e].isActive&&Object(m.__)("Activate","gp-premium"),e!==d&&!!T[e].isActive&&Object(m.__)("Deactivate","gp-premium"))))}))))};window.addEventListener("DOMContentLoaded",(function(){Object(l.render)(Object(l.createElement)(h,null),document.getElementById("generatepress-module-list"))})),n(56);var j=function(){var e=Object(l.useState)(!1),t=i()(e,2),n=t[0],r=t[1],s=Object(l.useState)(!1),a=i()(s,2),o=a[0],c=a[1],d=Object(l.useState)(generateProDashboard.licenseKey),b=i()(d,2),g=b[0],_=b[1],f=Object(l.useState)(generateProDashboard.licenseKeyStatus),O=i()(f,2),h=O[0],j=O[1],v=Object(l.useState)(generateProDashboard.betaTester),y=i()(v,2),E=y[0],w=y[1];return Object(l.useEffect)((function(){n||r(!0)})),n?Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"generatepress-dashboard__section generatepress-license-key-area"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-title"},Object(l.createElement)("h2",null,Object(m.__)("License Key","gp-premium")),Object(l.createElement)("span",{className:"generatepress-dashboard__section-item-message"})),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item"},Object(l.createElement)(p.Notice,{className:"generatepress-dashboard__section-license-notice",isDismissible:!1,status:"valid"===h?"success":"warning"},"valid"===h?Object(l.createElement)("span",null,Object(m.__)("Receiving premium updates.","gp-premium")):Object(l.createElement)("span",null,Object(m.__)("Not receiving premium updates.","gp-premium"))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-content"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-license-key"},Object(l.createElement)(p.TextControl,{help:Object(m.__)("Enter your license key to activate updates.","gp-premium"),type:"password",autoComplete:"off",value:g,onChange:function(e){_(e)}}))),""!==g&&Object(l.createElement)("div",{className:"generatepress-dashboard__section-beta-tester"},Object(l.createElement)(p.ToggleControl,{label:Object(m.__)("Receive beta updates"),help:Object(m.__)("Get alpha and beta updates directly to your Dashboard.","gp-premium"),checked:!!E,onChange:function(e){w(e)}})),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-action"},Object(l.createElement)(p.Button,{isPrimary:!0,disabled:!!o,onClick:function(e){return function(){c(!0);var e=document.querySelector(".generatepress-dashboard__section-item-message");e.classList.remove("generatepress-dashboard__section-item-message__show"),u()({path:"/generatepress-pro/v1/license",method:"POST",data:{key:g,status:h,betaTester:E}}).then((function(t){c(!1),e.classList.add("generatepress-dashboard__section-item-message__show"),t.success&&t.response?(e.classList.remove("generatepress-dashboard__section-item-message__error"),"valid"===t.response.license?e.textContent=Object(m.__)("License key activated.","gp-premium"):"deactivated"===t.response.license?e.textContent=Object(m.__)("License key deactivated.","gp-premium"):e.textContent=t.response,j(t.response.license),setTimeout((function(){e.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)):(e.classList.add("generatepress-dashboard__section-item-message__error"),e.textContent=t.response)}))}()}},o&&Object(l.createElement)(p.Spinner,null),!o&&!g&&Object(m.__)("Save key"),!o&&!!g&&Object(m.__)("Update key")))))):Object(l.createElement)(p.Placeholder,{className:"generatepress-dashboard__placeholder"},Object(l.createElement)(p.Spinner,null))};window.addEventListener("DOMContentLoaded",(function(){Object(l.render)(Object(l.createElement)(j,null),document.getElementById("generatepress-license-key"))})),n(57);var v=function(){var e=Object(l.useState)(!1),t=i()(e,2),n=t[0],r=t[1],a=Object(l.useState)(!1),o=i()(a,2),c=o[0],d=o[1],b=Object(l.useState)(!1),_=i()(b,2),f=_[0],O=_[1],h=Object(l.useState)(!1),j=i()(h,2),v=j[0],y=j[1],E=Object(l.useState)("all"),w=i()(E,2),S=w[0],x=w[1];return Object(l.useEffect)((function(){n||r(!0)})),n?Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"generatepress-dashboard__section"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-title"},Object(l.createElement)("h2",null,Object(m.__)("Import / Export","gp-premium"))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-content"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-title"},Object(m.__)("Export","gp-premium")),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-description"},Object(m.__)("Export your customizer settings.","gp-premium"))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-action"},Object(l.createElement)("span",{className:"generatepress-dashboard__section-item-message"}),Object(l.createElement)(p.ButtonGroup,{className:"generatepress-dashboard__section-item-export-type"},Object(l.createElement)(p.Button,{isPrimary:"all"===S,onClick:function(){return x("all")}},Object(m.__)("All","gp-premium")),Object(l.createElement)(p.Button,{isPrimary:"global-colors"===S,onClick:function(){return x("global-colors")}},Object(m.__)("Global Colors","gp-premium")),Object(l.createElement)(p.Button,{isPrimary:"typography"===S,onClick:function(){return x("typography")}},Object(m.__)("Typography","gp-premium"))),Object(l.createElement)(p.Button,{disabled:!!c,isPrimary:!0,onClick:function(e){return function(e){d(!0);var t=e.target.previousElementSibling.previousElementSibling;u()({path:"/generatepress-pro/v1/export",method:"POST",data:{items:!1,type:S}}).then((function(e){if(d(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),"object"===s()(e.response)?t.textContent=Object(m.__)("Options exported","gp-premium"):t.textContent=e.response,e.success&&e.response){var n=(new Date).toISOString().slice(0,10),r="generatepress-settings-"+S+"-"+n+".json",a=new Blob([JSON.stringify(e.response)],{type:"application/json",name:r});g()(a,r),setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)}else t.classList.add("generatepress-dashboard__section-item-message__error")}))}(e)}},!!c&&Object(l.createElement)(p.Spinner,null),!c&&Object(m.__)("Export","gp-premium")))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-content"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-title"},Object(m.__)("Import","gp-premium")),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-description"},Object(m.__)("Import your customizer settings.","gp-premium"))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-action"},Object(l.createElement)("span",{className:"generatepress-dashboard__section-item-message"}),Object(l.createElement)("input",{type:"file",accept:".json",onChange:function(e){var t=new FileReader;t.onloadend=function(){var e=t.result;(e=JSON.parse(e))&&y(e)},t.readAsText(e.target.files[0])}}),Object(l.createElement)(p.Button,{disabled:!!f||!v,isPrimary:!0,onClick:function(e){window.confirm(Object(m.__)("This can overwrite existing settings and cannot be undone.","gp-premium"))&&function(e){O(!0);var t=e.target.previousElementSibling.previousElementSibling,n=e.target.previousElementSibling;n.style.display="none",u()({path:"/generatepress-pro/v1/import",method:"POST",data:{import:v}}).then((function(e){O(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),"object"===s()(e.response)?t.textContent=Object(m.__)("Options imported.","gp-premium"):t.textContent=e.response,e.success&&e.response?setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show"),n.style.display="block",n.value=""}),3e3):t.classList.add("generatepress-dashboard__section-item-message__error")}))}(e)}},!!f&&Object(l.createElement)(p.Spinner,null),!f&&Object(m.__)("Import","gp-premium")))))):Object(l.createElement)(p.Placeholder,{className:"generatepress-dashboard__placeholder"},Object(l.createElement)(p.Spinner,null))};window.addEventListener("DOMContentLoaded",(function(){Object(l.render)(Object(l.createElement)(v,null),document.getElementById("generatepress-import-export-pro"))})),n(58);var y=function(){var e=Object(l.useState)(!1),t=i()(e,2),n=t[0],r=t[1],a=Object(l.useState)(!1),o=i()(a,2),c=o[0],d=o[1];return Object(l.useEffect)((function(){n||r(!0)})),n?Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"generatepress-dashboard__section"},Object(l.createElement)("div",{className:"generatepress-dashboard__section-title",style:{marginBottom:0}},Object(l.createElement)("h2",null,Object(m.__)("Reset","gp-premium"))),Object(l.createElement)("div",{className:"generatepress-dashboard__section-item-description",style:{marginTop:0}},Object(m.__)("Reset your customizer settings.","gp-premium")),Object(l.createElement)(p.Button,{className:"generatepress-dashboard__reset-button",style:{marginTop:"10px"},disabled:!!c,isPrimary:!0,onClick:function(e){window.confirm(Object(m.__)("This will delete all of your customizer settings. It cannot be undone.","gp-premium"))&&function(e){d(!0);var t=e.target.nextElementSibling;u()({path:"/generatepress-pro/v1/reset",method:"POST",data:{items:!1}}).then((function(e){d(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),"object"===s()(e.response)?t.textContent=Object(m.__)("Settings reset.","gp-premium"):t.textContent=e.response,e.success&&e.response?setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3):t.classList.add("generatepress-dashboard__section-item-message__error")}))}(e)}},!!c&&Object(l.createElement)(p.Spinner,null),!c&&Object(m.__)("Reset","gp-premium")),Object(l.createElement)("span",{className:"generatepress-dashboard__section-item-message",style:{marginLeft:"10px"}}))):Object(l.createElement)(p.Placeholder,{className:"generatepress-dashboard__placeholder"},Object(l.createElement)(p.Spinner,null))};window.addEventListener("DOMContentLoaded",(function(){Object(l.render)(Object(l.createElement)(y,null),document.getElementById("generatepress-reset-pro"))}))}}); |