Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ (()=>{"use strict";function e(){var n,r,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function i(e,o,a,s){var i=o&&o.prototype instanceof u?o:u,l=Object.create(i.prototype);return t(l,"_invoke",function(e,t,o){var a,s,i,u=0,l=o||[],f=!1,p={p:0,n:0,v:n,a:d,f:d.bind(n,4),d:function(e,t){return a=e,s=0,i=n,p.n=t,c}};function d(e,t){for(s=e,i=t,r=0;!f&&u&&!o&&r3?(o=y===t)&&(i=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=n):a[0]<=d&&((o=e<2&&dt||t>y)&&(a[4]=e,a[5]=t,p.n=y,s=0))}if(o||e>1)return c;throw f=!0,t}return function(o,l,y){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),s=l,i=y;(r=s<2?n:i)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,i)):p.n=i:p.v=i);try{if(u=2,a){if(s||(o="next"),r=a[o]){if(!(r=r.call(a,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,s<2&&(s=0)}else 1===s&&(r=a.return)&&r.call(a),s<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=n}else if((r=(f=p.n<0)?i:e.call(t,p))!==c)break}catch(e){a=n,s=1,i=e}finally{u=1}}return{value:r,done:f}}}(e,a,s),!0),l}var c={};function u(){}function l(){}function f(){}r=Object.getPrototypeOf;var p=[][a]?r(r([][a]())):(t(r={},a,function(){return this}),r),d=f.prototype=u.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,t(e,s,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,t(d,"constructor",f),t(f,"constructor",l),l.displayName="GeneratorFunction",t(f,s,"GeneratorFunction"),t(d),t(d,s,"Generator"),t(d,a,function(){return this}),t(d,"toString",function(){return"[object Generator]"}),(e=function(){return{w:i,m:y}})()}function t(e,n,r,o){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}t=function(e,n,r,o){function s(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(s("next",0),s("throw",1),s("return",2))},t(e,n,r,o)}function n(e,t,n,r,o,a,s){try{var i=e[a](s),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var s=e.apply(t,r);function i(e){n(s,o,a,i,c,"next",e)}function c(e){n(s,o,a,i,c,"throw",e)}i(void 0)})}}document.addEventListener("DOMContentLoaded",function(){var t=jQuery(PayPalCommerceGatewayWebhooksStatus.resubscribe.button);function n(e){return new Promise(function(t){return setTimeout(t,e)})}t.click(r(e().m(function n(){var r,o,a,s;return e().w(function(e){for(;;)switch(e.p=e.n){case 0:return t.prop("disabled",!0),e.n=1,fetch(PayPalCommerceGatewayWebhooksStatus.resubscribe.endpoint,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({nonce:PayPalCommerceGatewayWebhooksStatus.resubscribe.nonce})});case 1:if(r=e.v,o=function(e){var t=PayPalCommerceGatewayWebhooksStatus.resubscribe.failureMessage+" "+e;alert(t)},r.ok){e.n=5;break}return e.p=2,e.n=3,r.json();case 3:a=e.v,o(a.data),e.n=5;break;case 4:e.p=4,s=e.v,console.error(s),o(r.status);case 5:window.location.reload();case 6:return e.a(2)}},n,null,[[2,4]])})));var o=jQuery(PayPalCommerceGatewayWebhooksStatus.simulation.start.button);o.click(r(e().m(function t(){var r,a,s,i,c,u,l,f,p,d,y,b;return e().w(function(e){for(;;)switch(e.p=e.n){case 0:return o.prop("disabled",!0),e.p=1,e.n=2,fetch(PayPalCommerceGatewayWebhooksStatus.simulation.start.endpoint,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({nonce:PayPalCommerceGatewayWebhooksStatus.simulation.start.nonce})});case 2:if(r=e.v,a=function(e){var t=PayPalCommerceGatewayWebhooksStatus.simulation.start.failureMessage+" "+e;alert(t)},r.ok){e.n=7;break}return e.p=3,e.n=4,r.json();case 4:s=e.v,a(s.data),e.n=6;break;case 5:e.p=5,y=e.v,console.error(y),a(r.status);case 6:return e.a(2);case 7:i=function(e){var t=o.siblings(".ppcp-webhooks-status-text");t.length||(t=jQuery('
').insertAfter(o)),t.html(e)},o.siblings(".description").hide(),i(PayPalCommerceGatewayWebhooksStatus.simulation.state.waitingMessage+''),c=2e3,u=15,l=30,f=0;case 8:if(!(f✔️ '+PayPalCommerceGatewayWebhooksStatus.simulation.state.successMessage+""),e.a(2);case 14:e.n=16;break;case 15:e.p=15,b=e.v,console.error(b);case 16:f===u&&i(''+PayPalCommerceGatewayWebhooksStatus.simulation.state.tooLongDelayMessage+"");case 17:f++,e.n=8;break;case 18:return e.p=18,o.prop("disabled",!1),e.f(18);case 19:return e.a(2)}},t,null,[[11,15],[3,5],[1,,18,19]])})));var a=document.querySelector("#ppcp-sandbox_on");if(a){var s=function(e){["#field-webhook_status_heading","#field-webhooks_list","#field-webhooks_resubscribe","#field-webhooks_simulate"].forEach(function(t){!function(e,t,n){var r=function(e){return"string"==typeof e?document.querySelector(e):e}(e);r&&(t?(r.classList.remove(n),function(e,t,n){jQuery(document).trigger("ppcp-shown",{handler:e,action:"show",selector:t,element:n})}("Hiding.setVisibleByClass",e,r)):(r.classList.add(n),function(e,t,n){jQuery(document).trigger("ppcp-hidden",{handler:e,action:"hide",selector:t,element:n})}("Hiding.setVisibleByClass",e,r)))}(t,e,"hide")})},i="sandbox"===PayPalCommerceGatewayWebhooksStatus.environment;s(i===a.checked),a.addEventListener("click",function(){s(i===a.checked)})}})})();