Files
aaPanel/BTPanel/static/vite/js/vendor-pay-legacy.js
T
2026-07-24 16:25:43 +08:00

1 line
5.2 KiB
JavaScript

(function(){System.register([],function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_;function v(e){"@swc/helpers - typeof";return e&&typeof Symbol<`u`&&e.constructor===Symbol?`symbol`:typeof e}function y(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function b(e,t){var n=document.querySelector(`script[src="`.concat(e,`"]`));if(n===null)return null;var r=E(e,t),i=n.cloneNode();if(delete i.dataset.uidAuto,Object.keys(i.dataset).length!==Object.keys(r.dataset).length)return null;var a=!0;return Object.keys(i.dataset).forEach(function(e){i.dataset[e]!==r.dataset[e]&&(a=!1)}),a?n:null}function x(e){var t=e.url,n=e.attributes,r=e.onSuccess,i=e.onError,a=E(t,n);a.onerror=i,a.onload=r,document.head.insertBefore(a,document.head.firstElementChild)}function S(e){var t=e.sdkBaseUrl,n=e.environment,r=y(e,[`sdkBaseUrl`,`environment`]),i=t||T(n),a=r,o=Object.keys(a).filter(function(e){return a[e]!==void 0&&a[e]!==null&&a[e]!==``}).reduce(function(e,t){var n=a[t].toString();return t=C(t),t.substring(0,4)===`data`||t===`crossorigin`?e.attributes[t]=n:e.queryParams[t]=n,e},{queryParams:{},attributes:{}}),s=o.queryParams,c=o.attributes;return s[`merchant-id`]&&s[`merchant-id`].indexOf(`,`)!==-1&&(c[`data-merchant-id`]=s[`merchant-id`],s[`merchant-id`]=`*`),{url:``.concat(i,`?`,w(s)),attributes:c}}function C(e){return e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,function(e,t){return(t?`-`:``)+e.toLowerCase()})}function w(e){var t=``;return Object.keys(e).forEach(function(n){t.length!==0&&(t+=`&`),t+=n+`=`+e[n]}),t}function T(e){return e===`sandbox`?`https://www.sandbox.paypal.com/sdk/js`:`https://www.paypal.com/sdk/js`}function E(e,t){t===void 0&&(t={});var n=document.createElement(`script`);return n.src=e,Object.keys(t).forEach(function(e){n.setAttribute(e,t[e]),e===`data-csp-nonce`&&n.setAttribute(`nonce`,t[`data-csp-nonce`])}),n}function D(e,t){if(t===void 0&&(t=Promise),A(e,t),typeof document>`u`)return t.resolve(null);var n=S(e),r=n.url,i=n.attributes,a=i[`data-namespace`]||`paypal`,o=k(a);return i[`data-js-sdk-library`]||(i[`data-js-sdk-library`]=`paypal-js`),b(r,i)&&o?t.resolve(o):O({url:r,attributes:i},t).then(function(){var e=k(a);if(e)return e;throw Error(`The window.`.concat(a,` global variable is not available.`))})}function O(e,t){t===void 0&&(t=Promise),A(e,t);var n=e.url,r=e.attributes;if(typeof n!=`string`||n.length===0)throw Error(`Invalid url.`);if(r!==void 0&&(r===void 0?`undefined`:v(r))!==`object`)throw Error(`Expected attributes to be an object.`);return new t(function(e,t){if(typeof document>`u`)return e();x({url:n,attributes:r,onSuccess:function(){return e()},onError:function(){return t(Error(`The script "`.concat(n,`" failed to load. Check the HTTP status code and response body in DevTools to learn more.`)))}})})}function k(e){return window[e]}function A(e,t){if((e===void 0?`undefined`:v(e))!==`object`||e===null)throw Error(`Expected an options object.`);var n=e.environment;if(n&&n!==`production`&&n!==`sandbox`)throw Error('The `environment` option must be either "production" or "sandbox".');if(t!==void 0&&typeof t!=`function`)throw Error(`Expected PromisePonyfill to be a function.`)}return e({n:void 0,t:D}),{setters:[],execute:function(){r=`https://js.stripe.com/v3`,i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,n=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,a=function(){for(var e=document.querySelectorAll(`script[src^="`.concat(r,`"]`)),t=0;t<e.length;t++){var n=e[t];if(i.test(n.src))return n}return null},c=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=``.concat(r,t);var i=document.head||document.body;if(!i)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return i.appendChild(n),n},h=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:`stripe-js`,version:`3.4.1`,startTime:t})},g=null,f=null,m=null,d=function(e){return function(){e(Error(`Failed to load Stripe.js`))}},p=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},u=function(e){return g===null?(g=new Promise(function(t,r){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(n),window.Stripe){t(window.Stripe);return}try{var i=a();if(i&&e)console.warn(n);else if(!i)i=c(e);else if(i&&m!==null&&f!==null){var o;i.removeEventListener(`load`,m),i.removeEventListener(`error`,f),(o=i.parentNode)==null||o.removeChild(i),i=c(e)}m=p(t,r),f=d(r),i.addEventListener(`load`,m),i.addEventListener(`error`,f)}catch(e){r(e);return}}),g.catch(function(e){return g=null,Promise.reject(e)})):g},s=function(e,t,n){if(e===null)return null;var r=e.apply(void 0,t);return h(r,n),r},l=!1,o=function(){return _||(_=u(null).catch(function(e){return _=null,Promise.reject(e)}),_)},Promise.resolve().then(function(){return o()}).catch(function(e){l||console.warn(e)}),e(`n`,function(){var e=[...arguments];l=!0;var t=Date.now();return o().then(function(n){return s(n,e,t)})})}}})})();