laipower/wp-content/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js

5 lines
46 KiB
JavaScript
Raw Normal View History

/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={235:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=s.apply(null,n);i&&e.push(i)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()},951:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))})),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(741)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},741:(e,t,n)=>{e.exports=function(e){function t(e){let n,s,a,i=null;function o(...e){if(!o.enabled)return;const r=o,s=Number(new Date),a=s-(n||s);r.diff=a,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";i++;const a=t.formatters[s];if("function"==typeof a){const t=e[i];n=a.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=r,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,a=t.enabled(e)),a),set:e=>{i=e}}),"function"==typeof t.init&&t.init(o),o}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString
__("<hostname>%1$s</hostname> settings, stats, and subscribers will start fresh. <hostname>%2$s</hostname> will keep its data as is.","jetpack-idc"),h,u),{hostname:p().createElement("strong",null),em:p().createElement("em",null),strong:p().createElement("strong",null)}))),p().createElement("div",{className:"jp-idc__idc-screen__card-action-bottom"},p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},u),p().createElement(a.Dashicon,{icon:"minus",className:"jp-idc__idc-screen__card-action-separator"}),p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},h),p().createElement(a.Button,{className:"jp-idc__idc-screen__card-action-button",label:k,onClick:n,disabled:y},t?p().createElement(s.Z,null):k),d&&(C=l.supportURL,p().createElement(f.Z,null,(0,o.createInterpolateElement)(__("Could not create the connection. Retry or find out more <a>here</a>.","jetpack-idc"),{a:p().createElement("a",{href:C||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})})))));var C};y.propTypes={wpcomHomeUrl:d().string.isRequired,currentUrl:d().string.isRequired,isStartingFresh:d().bool.isRequired,startFreshCallback:d().func.isRequired,customContent:d().shape(h.Z),hasError:d().bool.isRequired},y.defaultProps={isStartingFresh:!1,startFreshCallback:()=>{},customContent:{},hasError:!1};const k=y},596:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(895),s=n(33),a=n(609),i=n(818),o=n(307),c=n(736),l=n(162),d=n.n(l),u=n(196),p=n.n(u),m=n(678),h=n(144),g=n(115),f=n(637);const __=c.__,y=e=>{const t=(0,g.Z)(e.wpcomHomeUrl),n=(0,g.Z)(e.currentUrl),l=(0,i.useSelect)((e=>e(m.t).getIsActionInProgress()),[]),{isMigrating:d,migrateCallback:u,customContent:h,hasError:y}=e,k=h.migrateButtonLabel||__("Move your settings","jetpack-idc");return p().createElement("div",{className:"jp-idc__idc-screen__card-action-base"+(y?" jp-idc__idc-screen__card-action-error":"")},p().createElement("div",{className:"jp-idc__idc-screen__card-action-top"},p().createElement("h4",null,h.migrateCardTitle?(0,o.createInterpolateElement)(h.migrateCardTitle,{em:p().createElement("em",null)}):__("Move Jetpack data","jetpack-idc")),p().createElement("p",null,(0,o.createInterpolateElement)(h.migrateCardBodyText||(0,c.sprintf)(/* translators: %1$s: The current site domain name. %2$s: The original site domain name. */
__("Move all your settings, stats and subscribers to your other URL, <hostname>%1$s</hostname>. <hostname>%2$s</hostname> will be disconnected from Jetpack.","jetpack-idc"),n,t),{hostname:p().createElement("strong",null),em:p().createElement("em",null),strong:p().createElement("strong",null)}))),p().createElement("div",{className:"jp-idc__idc-screen__card-action-bottom"},p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},t),p().createElement(a.Dashicon,{icon:"arrow-down-alt",className:"jp-idc__idc-screen__card-action-separator"}),p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},n),p().createElement(a.Button,{className:"jp-idc__idc-screen__card-action-button",label:k,onClick:u,disabled:l},d?p().createElement(s.Z,null):k),y&&(C=h.supportURL,p().createElement(f.Z,null,(0,o.createInterpolateElement)(__("Could not move your settings. Retry or find out more <a>here</a>.","jetpack-idc"),{a:p().createElement("a",{href:C||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})})))));var C};y.propTypes={wpcomHomeUrl:d().string.isRequired,currentUrl:d().string.isRequired,isMigrating:d().bool.isRequired,migrateCallback:d().func.isRequired,customContent:d().shape(h.Z),hasError:d().bool.isRequired},y.defaultProps={isMigrating:!1,migrateCallback:()=>{},customContent:{},hasError:!1};const k=y},489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(196),s=n.n(r);const a=()=>s().createElement("svg",{className:"error-gridicon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24},s().createElement("rect",{x:"0",fill:"none",width:"24",height:"24"}),s().createElement("g",null,s().createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))},637:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(196),s=n.n(r),a=n(489);n(611);const i=e=>{const{children:t}=e;return s().createElement("div",{className:"jp-idc__error-message"},s().createElement(a.Z,null),s().createElement("span",null,t))}},381:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(743),s=n(818),a=n(162),i=n.n(a),o=n(196),c=n.n(o),l=n(970),d=n(272),u=n(105),p=n(678),m=n(144),h=n(521),g=n(567);const f=e=>{const{logo:t,customContent:n,wpcomHomeUrl:a,currentUrl:i,apiNonce:m,apiRoot:f,redirectUri:y,tracksUserData:k,tracksEventData:C,isAdmin:v,possibleDynamicSiteUrlDetected:_}=e,[b,E]=(0,o.useState)(!1),w=(0,s.useSelect)((e=>e(p.t).getErrorType()),[]),{isMigrating:j,migrateCallback:S}=(0,l.Z)((0,o.useCallback)((()=>{E(!0)}),[E])),{isStartingFresh:F,startFreshCallback:I}=(0,u.Z)(y),{isFinishingMigration:U,finishMigrationCallback:R}=(0,d.Z)();return(0,o.useEffect)((()=>{r.ZP.setApiRoot(f),r.ZP.setApiNonce(m),(0,h.M)(C,k),C&&(C.hasOwnProperty("isAdmin")&&C.isAdmin?(0,h.Z)("notice_view"):(0,h.Z)("non_admin_notice_view",{page:!!C.hasOwnProperty("currentScreen")&&C.currentScreen}))}),[f,m,k,C]),c().createElement(g.Z,{logo:t,customContent:n,wpcomHomeUrl:a,currentUrl:i,redirectUri:y,isMigrating:j,migrateCallback:S,isMigrated:b,finishMigrationCallback:R,isFinishingMigration:U,isStartingFresh:F,startFreshCallback:I,isAdmin:v,hasStaySafeError:"safe-mode"===w,hasFreshError:"start-fresh"===w,hasMigrateError:"migrate"===w,possibleDynamicSiteUrlDetected:_})};f.propTypes={logo:i().object,customContent:i().shape(m.Z),wpcomHomeUrl:i().string.isRequired,currentUrl:i().string.isRequired,redirectUri:i().string.isRequired,apiRoot:i().string.isRequired,apiNonce:i().string.isRequired,tracksUserData:i().object,tracksEventData:i().object,isAdmin:i().bool.isRequired,possibleDynamicSiteUrlDetected:i().bool},f.defaultProps={customContent:{}};const y=f},533:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(895),s=n(307),a=n(736),i=n(162),o=n.n(i),c=n(196),l=n.n(c),d=n(144),u=n(477),p=n(596),m=n(899);const __=a.__,h=e=>{const{wpcomHomeUrl:t,currentUrl:n,isMigrating:a,migrateCallback:i,isStartingFresh:o,startFreshCallback:c,customContent:d,hasMigrateError:h,hasFreshError:g,hasStaySafeError:f,possibleDy
__("Safe Mode has been switched off for <hostname>%1$s</hostname> website and Jetpack is fully functional.","jetpack-idc"),l),{hostname:d().createElement("strong",null),em:d().createElement("em",null),strong:d().createElement("strong",null)})),d().createElement("div",{className:"jp-idc__idc-screen__card-migrated"},d().createElement("div",{className:"jp-idc__idc-screen__card-migrated-hostname"},c),d().createElement(s.Dashicon,{icon:"arrow-down-alt",className:"jp-idc__idc-screen__card-migrated-separator"}),d().createElement(s.Dashicon,{icon:"arrow-right-alt",className:"jp-idc__idc-screen__card-migrated-separator-wide"}),d().createElement("div",{className:"jp-idc__idc-screen__card-migrated-hostname"},l)),d().createElement(s.Button,{className:"jp-idc__idc-screen__card-action-button jp-idc__idc-screen__card-action-button-migrated",onClick:t,label:u},n?d().createElement(r.Z,null):u))};m.propTypes={wpcomHomeUrl:c().string.isRequired,currentUrl:c().string.isRequired,finishCallback:c().func,isFinishing:c().bool.isRequired,customContent:c().shape(u.Z)},m.defaultProps={finishCallback:()=>{},isFinishing:!1,customContent:{}};const h=m},64:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(895),s=n(307),a=n(736),i=n(162),o=n.n(i),c=n(196),l=n.n(c),d=n(144);const __=a.__,u=e=>{const{customContent:t}=e;return l().createElement(l().Fragment,null,l().createElement("h2",null,t.nonAdminTitle?(0,s.createInterpolateElement)(t.nonAdminTitle,{em:l().createElement("em",null)}):__("Safe Mode has been activated","jetpack-idc")),l().createElement("p",null,(0,s.createInterpolateElement)(t.nonAdminBodyText||__("This site is in Safe Mode because there are 2 Jetpack-powered sites that appear to be duplicates. 2 sites that are telling Jetpack theyre the same site. <safeModeLink>Learn more about safe mode.</safeModeLink>","jetpack-idc"),{safeModeLink:l().createElement("a",{href:t.supportURL||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),t.nonAdminBodyText?"":l().createElement("p",null,__("An administrator of this site can take Jetpack out of Safe Mode.","jetpack-idc")))};u.propTypes={customContent:o().shape(d.Z)},u.defaultProps={customContent:{}};const p=u},567:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(868),s=n(307),a=n(736),i=n(162),o=n.n(i),c=n(196),l=n.n(c),d=n(144),u=n(533),p=n(52),m=n(64);n(724);const __=a.__,h=e=>{const{logo:t,customContent:n,wpcomHomeUrl:r,currentUrl:a,redirectUri:i,isMigrating:o,migrateCallback:c,isMigrated:d,finishMigrationCallback:h,isFinishingMigration:g,isStartingFresh:f,startFreshCallback:y,isAdmin:k,hasMigrateError:C,hasFreshError:v,hasStaySafeError:_,possibleDynamicSiteUrlDetected:b}=e,E=k?"":l().createElement(m.Z,{customContent:n});let w="";return k&&(w=d?l().createElement(p.Z,{wpcomHomeUrl:r,currentUrl:a,finishCallback:h,isFinishing:g,customContent:n}):l().createElement(u.Z,{wpcomHomeUrl:r,currentUrl:a,redirectUri:i,customContent:n,isMigrating:o,migrateCallback:c,isStartingFresh:f,startFreshCallback:y,hasMigrateError:C,hasFreshError:v,hasStaySafeError:_,possibleDynamicSiteUrlDetected:b})),l().createElement("div",{className:"jp-idc__idc-screen"+(d?" jp-idc__idc-screen__success":"")},l().createElement("div",{className:"jp-idc__idc-screen__header"},l().createElement("div",{className:"jp-idc__idc-screen__logo"},((e,t)=>"string"==typeof e||e instanceof String?l().createElement("img",{src:e,alt:t,className:"jp-idc__idc-screen__logo-image"}):e)(t,n.logoAlt||"")),l().createElement("div",{className:"jp-idc__idc-screen__logo-label"},n.headerText?(0,s.createInterpolateElement)(n.headerText,{em:l().createElement("em",null),strong:l().createElement("strong",null)}):__("Safe Mode","jetpack-idc"))),E,w)};h.propTypes={logo:o().object.isRequired,customContent:o().shape(d.Z),wpcomHomeUrl:o().string.isRequired,currentUrl:o().string.isRequired,redirectUri:o().string.isRequired,isMigrating:o().bool.isRequired,migrateCallback:o().func,isMigrated:o().bool.isRequired,finishMigrationCallback:o().func,isFinishingMigration:o().bool.