PageSourceSearch

https://my.clockodo.com/static/js/stripe.pure.esm.js

js clockodo.com collected 2026-09-24 09:32:49 UTC 4,326 bytes, 157 lines download raw bytes

1function _typeof(obj) {
2  "@babel/helpers - typeof";
3
4  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
5    _typeof = function (obj) {
6      return typeof obj;
7    };
8  } else {
9    _typeof = function (obj) {
10      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11    };
12  }
13
14  return _typeof(obj);
15}
16
17var V3_URL = 'https://js.stripe.com/v3';
18var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
19var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
20var findScript = function findScript() {
21  var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
22
23  for (var i = 0; i < scripts.length; i++) {
24    var script = scripts[i];
25
26    if (!V3_URL_REGEX.test(script.src)) {
27      continue;
28    }
29
30    return script;
31  }
32
33  return null;
34};
35
36var injectScript = function injectScript(params) {
37  var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
38  var script = document.createElement('script');
39  script.src = "".concat(V3_URL).concat(queryString);
40  var headOrBody = document.head || document.body;
41
42  if (!headOrBody) {
43    throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
44  }
45
46  headOrBody.appendChild(script);
47  return script;
48};
49
50var registerWrapper = function registerWrapper(stripe, startTime) {
51  if (!stripe || !stripe._registerWrapper) {
52    return;
53  }
54
55  stripe._registerWrapper({
56    name: 'stripe-js',
57    version: "1.21.1",
58    startTime: startTime
59  });
60};
61
62var stripePromise = null;
63var loadScript = function loadScript(params) {
64  // Ensure that we only attempt to load Stripe.js at most once
65  if (stripePromise !== null) {
66    return stripePromise;
67  }
68
69  stripePromise = new Promise(function (resolve, reject) {
70    if (typeof window === 'undefined') {
71      // Resolve to null when imported server side. This makes the module
72      // safe to import in an isomorphic code base.
73      resolve(null);
74      return;
75    }
76
77    if (window.Stripe && params) {
78      console.warn(EXISTING_SCRIPT_MESSAGE);
79    }
80
81    if (window.Stripe) {
82      resolve(window.Stripe);
83      return;
84    }
85
86    try {
87      var script = findScript();
88
89      if (script && params) {
90        console.warn(EXISTING_SCRIPT_MESSAGE);
91      } else if (!script) {
92        script = injectScript(params);
93      }
94
95      script.addEventListener('load', function () {
96        if (window.Stripe) {
97          resolve(window.Stripe);
98        } else {
99          reject(new Error('Stripe.js not available'));
100        }
101      });
102      script.addEventListener('error', function () {
103        reject(new Error('Failed to load Stripe.js'));
104      });
105    } catch (error) {
106      reject(error);
107      return;
108    }
109  });
110  return stripePromise;
111};
112var initStripe = function initStripe(maybeStripe, args, startTime) {
113  if (maybeStripe === null) {
114    return null;
115  }
116
117  var stripe = maybeStripe.apply(undefined, args);
118  registerWrapper(stripe, startTime);
119  return stripe;
120};
121var validateLoadParams = function validateLoadParams(params) {
122  var errorMessage = "invalid load parameters; expected object of shape\n\n    {advancedFraudSignals: boolean}\n\nbut received\n\n    ".concat(JSON.stringify(params), "\n");
123
124  if (params === null || _typeof(params) !== 'object') {
125    throw new Error(errorMessage);
126  }
127
128  if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {
129    return params;
130  }
131
132  throw new Error(errorMessage);
133};
134
135var loadParams;
136var loadStripeCalled = false;
137var loadStripe = function loadStripe() {
138  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
139    args[_key] = arguments[_key];
140  }
141
142  loadStripeCalled = true;
143  var startTime = Date.now();
144  return loadScript(loadParams).then(function (maybeStripe) {
145    return initStripe(maybeStripe, args, startTime);
146  });
147};
148
149loadStripe.setLoadParameters = function (params) {
150  if (loadStripeCalled) {
151    throw new Error('You cannot change load parameters after calling loadStripe');
152  }
153
154  loadParams = validateLoadParams(params);
155};
156
157export { loadStripe };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.