File: /var/www/html/triad-infosec/wp-content/plugins/genesis-blocks/lib/Migration/js/build/migration.js
(()=>{var e={184:(e,t)=>{var s;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var i=typeof s;if("string"===i||"number"===i)e.push(s);else if(Array.isArray(s)){if(s.length){var l=a.apply(null,s);l&&e.push(l)}}else if("object"===i)if(s.toString===Object.prototype.toString)for(var o in s)n.call(s,o)&&s[o]&&e.push(o);else e.push(s.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(s=function(){return a}.apply(t,[]))||(e.exports=s)}()}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,s),i.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=window.wp.domReady;var n=s.n(t);window.React;const a=window.wp.i18n,i=t=>{let{isStepActive:s,isStepComplete:n,goToNext:i,goToPrevious:l,stepIndex:o}=t;const r=1===o;let c=(0,a.__)("Migrating from Atomic Blocks to Genesis Blocks is a one-way action. It can’t be undone. Please back up your site before you begin.","genesis-blocks");return genesisBlocksMigration.isPro&&(c=(0,a.__)("Migrating your Genesis Blocks content is a one-way action. It can’t be undone. Please back up your site before you begin.","genesis-blocks")),(0,e.createElement)(_,{isActive:s,isComplete:n},(0,e.createElement)(v,{index:o,isComplete:n}),(0,e.createElement)(h,{heading:(0,a.__)("Back Up Your Site","genesis-blocks"),isStepActive:s},(0,e.createElement)("p",null,c),(0,e.createElement)(E,null,!r&&(0,e.createElement)(u,{onClick:l}),(0,e.createElement)(p,{checkboxLabel:(0,a.__)("I have backed up my site.","genesis-blocks"),onClick:i,stepIndex:o}))))},l=window.wp.a11y,o=window.wp.apiFetch;var r=s.n(o);const c=t=>{let{isStepActive:s,isStepComplete:n,stepIndex:i,goToNext:o}=t;const[c,m]=(0,e.useState)(0),[g,p]=(0,e.useState)(!1),[u,b]=(0,e.useState)(!1),[d,k]=(0,e.useState)(""),[f,w]=(0,e.useState)(!1),[S,P]=(0,e.useState)(0),C=[(0,a.__)("Migrate block settings.","genesis-blocks"),(0,a.__)("Migrate block content. Migrated: ","genesis-blocks")+` ${S}.`,(0,a.__)("Migrate favorite blocks.","genesis-blocks"),genesisBlocksMigration.isPro?(0,a.__)("Clean up.","genesis-blocks"):(0,a.__)("Deactivate Atomic Blocks.","genesis-blocks")],N=async()=>{await r()({path:"/genesis-blocks/migrate-content",method:"POST"}).then((async e=>{if(e.results&&e.results.postsFound>0)return P((t=>t+e.results.postsFound)),void await N();m(2),await x()})).catch((async e=>{e.hasOwnProperty("code")&&"invalid_json"===e.code?await N():(e.hasOwnProperty("message")&&k(e.message),(0,l.speak)((0,a.__)("The migration failed during post content migration","genesis-blocks")),b(!0))}))},x=async()=>{await r()({path:"/genesis-blocks/migrate-user-meta",method:"POST"}).then((async()=>{m(3),await T()})).catch((async e=>{e.hasOwnProperty("code")&&"invalid_json"===e.code?await x():(e.hasOwnProperty("message")&&k(e.message),(0,l.speak)((0,a.__)("The migration failed while migrating favorite blocks.","genesis-blocks")),b(!0))}))},T=async()=>{await r()({path:"/genesis-blocks/migrate-cleanup",method:"POST"}).then((()=>{(0,l.speak)((0,a.__)("The migration was successful!","genesis-blocks")),w(!0),o()}))};return(0,e.createElement)(_,{isActive:s,isComplete:n},(0,e.createElement)(v,{index:i,isComplete:n}),(0,e.createElement)(h,{heading:(0,a.__)("Migrate Your Content","genesis-blocks"),isStepActive:s,isLastStep:!0},!f&&(0,e.createElement)("p",null,(0,a.__)("Okay! Everything is ready. Let’s do this. While the migration is underway, don’t leave this page.","genesis-blocks")),!!d&&(0,e.createElement)("div",{className:"gb-migration__error inline-notice gb-error"},(0,e.createElement)("p",null,(0,e.createElement)("span",null,(0,a.__)("The following error occurred:","genesis-blocks")),d)),(g||f)&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(y,{steps:C,currentStep:c,complete:!g})),!g&&!f&&(0,e.createElement)("button",{className:"gb-admin-button-primary",onClick:async()=>{(0,l.speak)((0,a.__)("The migration is now in progress","genesis-blocks")),k(""),p(!0),await(async()=>{await r()({path:"/genesis-blocks/migrate-settings",method:"POST"}).then((async()=>{m(1),await(async()=>{await r()({path:"/genesis-blocks/migrate-pro-settings",method:"POST"}).catch((e=>{e.hasOwnProperty("message")&&k(e.message),(0,l.speak)((0,a.__)("The pro settings migration failed.","genesis-blocks")),b(!0)}))})(),await N()})).catch((e=>{e.hasOwnProperty("message")&&k(e.message),(0,l.speak)((0,a.__)("The migration failed during settings migration.","genesis-blocks")),b(!0),p(!1)}))})(),p(!1)}},u?(0,a.__)("Try Again","genesis-blocks"):(0,a.__)("Migrate Now","genesis-blocks")),f&&(0,e.createElement)(e.Fragment,null,!genesisBlocksMigration.isPro&&(0,e.createElement)("p",null,(0,e.createElement)("span",{role:"img","aria-label":(0,a.__)("party emoji","genesis-blocks")},"🎉")," ",(0,a.__)("The migration completed successfully! Time to say goodbye to Atomic Blocks (it’s been fun!) and step into the FUTURE","genesis-blocks")," ",(0,e.createElement)("span",{className:"message-future"},(0,a.__)("FUTURE","genesis-blocks"))," ",(0,e.createElement)("sub",null,(0,a.__)("FUTURE","genesis-blocks")),"."),genesisBlocksMigration.isPro&&(0,e.createElement)("p",null,(0,e.createElement)("span",{role:"img","aria-label":(0,a.__)("party emoji","genesis-blocks")},"🎉")," ",(0,a.__)("The migration completed successfully!","genesis-blocks")),(0,e.createElement)(E,null,(0,e.createElement)("a",{href:genesisBlocksMigration.gbUrl,className:"btn"},(0,a.__)("Get started with Genesis Blocks","genesis-blocks"))))))},m=t=>{let{isStepActive:s,isStepComplete:n,stepIndex:i,goToNext:l,goToPrevious:o}=t;return(0,e.createElement)(_,{isActive:s,isComplete:n},(0,e.createElement)(v,{index:i,isComplete:n}),(0,e.createElement)(h,{heading:(0,a.__)("Update CSS and PHP code","genesis-blocks"),isStepActive:s},(0,e.createElement)("p",null,(0,e.createElement)("b",null,(0,a.__)("You will need to make manual changes if your theme, plugins or customizations include Atomic Blocks CSS or PHP:","genesis-blocks"))),(0,e.createElement)("ul",{className:"list-disc list-inside mt-2"},(0,e.createElement)("li",null,(0,e.createElement)("b",null,(0,a.__)("CSS","genesis-blocks"))," -"," ",(0,a.__)("CSS classes and HTML markup have changed.","genesis-blocks")," ",(0,e.createElement)("a",{href:"https://wpeng.in/ab-gb-css/",target:"_blank",rel:"noopener noreferrer"},(0,a.__)("Check if you need to make CSS changes.","genesis-blocks"))),(0,e.createElement)("li",null,(0,e.createElement)("b",null,(0,a.__)("PHP","genesis-blocks"))," -"," ",(0,a.__)("Filter, function and block names have changed.","genesis-blocks")," ",(0,e.createElement)("a",{href:"https://wpeng.in/ab-gb-php/",target:"_blank",rel:"noopener noreferrer"},(0,a.__)("Check if you need to make PHP changes.","genesis-blocks")))),(0,e.createElement)(E,null,(0,e.createElement)(u,{onClick:o}),(0,e.createElement)(p,{checkboxLabel:(0,a.__)("I have made necessary changes to PHP and CSS.","genesis-blocks"),onClick:l,stepIndex:i}))))},g=()=>{const[t,s]=(0,e.useState)(1),n=()=>{s(t-1)},a=()=>{s(t+1)},l=[i,m,c];return(0,e.createElement)("div",{className:"gb-migration__content-wrapper"},(0,e.createElement)("div",{className:"container gb-migration__content-container gb-admin-plugin-container"},(0,e.createElement)(b,null),l.map(((s,i)=>{const l=1+i,o=t===l,r=t>l;return(0,e.createElement)(s,{key:`gb-migration-step-${l}`,currentStepIndex:t,goToNext:a,goToPrevious:n,isStepActive:o,isStepComplete:r,stepIndex:l})}))))},p=t=>{let{onClick:s,checkboxLabel:n,stepIndex:i}=t;const[l,o]=(0,e.useState)(!1);if(!n)return(0,e.createElement)("button",{className:"btn",onClick:s},(0,a.__)("Next Step","genesis-blocks"));const r=`gb-migration-check-${i}`;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("form",null,(0,e.createElement)("input",{id:r,type:"checkbox",onClick:()=>{o(!l)}}),(0,e.createElement)("label",{htmlFor:r,className:"gb-checkbox-label"},n)),(0,e.createElement)("button",{className:"gb-admin-button-primary",onClick:s,disabled:!l},(0,a.__)("Next Step","genesis-blocks")))},u=t=>{let{onClick:s}=t;return(0,e.createElement)("button",{className:"gb-admin-button-secondary",onClick:s},(0,a.__)("Previous","genesis-blocks"))},b=()=>{let t=(0,a.__)("Atomic Blocks has been renamed to Genesis Blocks","genesis-blocks");return genesisBlocksMigration.isPro&&(t=(0,a.__)("We need to update your blocks to give you the latest features!","genesis-blocks")),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gb-migration-intro"},(0,e.createElement)("h2",null,t),(0,e.createElement)("p",null,(0,a.__)("Same powerful blocks, same beautiful designs, same innovative team.","genesis-blocks")),(0,e.createElement)("p",null,(0,a.__)("To continue receiving the best of what our team is building, we encourage you to migrate. Our migration tool makes this nice and easy, and for the majority of use cases, completely automated.","genesis-blocks")),(0,e.createElement)("div",{className:"inline-notice gb-info"},(0,e.createElement)("p",null,(0,a.__)("Need to let the developer for this site know about this? Send them this link.","genesis-blocks")),(0,e.createElement)("a",{href:"https://wpeng.in/ab-gb-dev/",target:"_blank",rel:"noopener noreferrer",className:"gb-admin-button-link aligned"},(0,e.createElement)("span",null,(0,a.__)("Developer Notice","genesis-blocks"))))),(0,e.createElement)("h2",null,(0,a.__)("Let's Migrate","genesis-blocks")))};var d=s(184),k=s.n(d);const _=t=>{let{isActive:s,isComplete:n,children:a}=t;return(0,e.createElement)("div",{className:k()("step",{"step--active":s,"step--complete":n})},a)},h=t=>{let{children:s,heading:n,isStepActive:a,isLastStep:i}=t;return(0,e.createElement)("div",{className:"step-content"},(0,e.createElement)("h3",null,n),(a||i)&&s)},E=t=>{let{children:s}=t;return(0,e.createElement)("div",{className:"step-footer"},s)},v=t=>{let{index:s,isComplete:n}=t;const i=`gb-migration-icon-${s}`,l=(0,e.createElement)("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-labelledby":i},(0,e.createElement)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"}),(0,e.createElement)("title",{id:i},(0,a.__)("Step completed","genesis-blocks")));return(0,e.createElement)("div",{className:"step-icon"},n?l:s)},y=t=>{let{steps:s,currentStep:n,complete:a}=t;const i=s.map(((t,i)=>{let l="";return n===i&&(l="active"),(n>i||a&&n===s.length-1)&&(l="done"),(0,e.createElement)("li",{key:i,className:l},t,n===i&&!a&&(0,e.createElement)("div",{className:"gb-migration-progress",role:"progressbar"},(0,e.createElement)("div",{className:"gb-migration-progress-inside"}),(0,e.createElement)("div",{className:"gb-migration-progress-inside gb-migration-progress-animate2"})))}));return(0,e.createElement)("ul",{className:"substeps"},i)};n()((()=>{(0,e.render)((0,e.createElement)(g,null),document.querySelector(".gb-migration__content"))}))})()})();