// Module ID: 3798
// Function ID: 29622
// Name: r
// Dependencies: []
// Module 3798 (r)
let fn = () => {
let fn = function r(arg0, arg1, arg2) {
let length;
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
const fn = function o(arg0) {
const dependencyMap = arg0;
if (!dependencyMap2[arg0]) {
if (dependencyMap[arg0]) {
const obj = { exports: {} };
dependencyMap2[arg0] = obj;
const first = dependencyMap[arg0][0];
first.call(obj.exports, (arg0) => {
let tmp2 = table[table][1][arg0];
if (!tmp2) {
tmp2 = arg0;
}
return outer1_4(tmp2);
}, obj, obj.exports, dependencyMap, dependencyMap, dependencyMap2, closure_2);
} else {
if (!arg1) {
if (tmp3) {
return tmp3(arg0, true);
}
}
if (callback) {
return callback(arg0, true);
} else {
const _Error = Error;
const error = new Error("Cannot find module '" + arg0 + "'");
error.code = "MODULE_NOT_FOUND";
throw error;
}
}
}
return dependencyMap2[arg0].exports;
};
let closure_3 = "function" === typeof fn && fn;
let num = 0;
if (0 < arg2.length) {
do {
let fnResult = fn(arg2[num]);
num = num + 1;
length = arg2.length;
} while (num < length);
}
return fn;
};
let items = [
(arg0, arg1, arg2) => {
function loadScript(forceScriptReload) {
const table = forceScriptReload;
const json = JSON.stringify(forceScriptReload);
if (!forceScriptReload.forceScriptReload) {
if (table[json]) {
return tmp3;
}
}
let element = ;
const tmp4 = forceScriptReload.dataAttributes || {};
let closure_2 = tmp4;
let head = forceScriptReload.container;
if (!head) {
const _document = document;
head = document.head;
}
element.src = forceScriptReload.src;
element.id = forceScriptReload.id || "";
element.async = true;
if (forceScriptReload.type) {
const concat = "".concat;
let attr = element.setAttribute("type", "".concat(forceScriptReload.type));
}
if (forceScriptReload.crossorigin) {
const concat2 = "".concat;
const attr1 = element.setAttribute("crossorigin", "".concat(forceScriptReload.crossorigin));
}
const keys = Object.keys(tmp4);
const item = keys.forEach((arg0) => {
const combined = "data-".concat(arg0);
const attr = element.setAttribute(combined, "".concat(tmp4[arg0]));
});
const promise = new Promise((arg0, arg1) => {
let closure_0 = arg0;
const element = arg1;
const listener = element.addEventListener("load", () => {
lib(closure_1);
});
const listener1 = element.addEventListener("error", () => {
const error = new Error("".concat(lib.src, " failed to load."));
callback(error);
});
const listener2 = element.addEventListener("abort", () => {
const error = new Error("".concat(lib.src, " has aborted."));
callback(error);
});
head.appendChild(element);
});
table[json] = promise;
return promise;
}
let closure_0 = {};
loadScript.clearCache = () => {
let closure_0 = {};
};
module.exports = loadScript;
},
{}
];
let items1 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/load-script");
},
{ "./dist/load-script": 1 }
];
let items2 = [
(arg0, arg1, arg2) => {
module.exports = function isAndroid(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return /Android/i.test(userAgent);
};
},
{}
];
let items3 = [
(arg0, arg1, arg2) => {
module.exports = function isChromeOS(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return /CrOS/i.test(userAgent);
};
},
{}
];
let items4 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./is-edge");
let closure_1 = global("./is-samsung");
let closure_2 = global("./is-duckduckgo");
let closure_3 = global("./is-opera");
let closure_4 = global("./is-silk");
module.exports = function isChrome(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
let tmp2 = -1 === userAgent.indexOf("Chrome");
if (tmp2) {
tmp2 = -1 === userAgent.indexOf("CriOS");
}
if (!tmp2) {
tmp2 = callback(userAgent);
}
if (!tmp2) {
tmp2 = callback2(userAgent);
}
if (!tmp2) {
tmp2 = callback3(userAgent);
}
if (!tmp2) {
tmp2 = callback4(userAgent);
}
if (!tmp2) {
tmp2 = callback5(userAgent);
}
return !tmp2;
};
},
{ "./is-duckduckgo": 6, "./is-edge": 7, "./is-opera": 16, "./is-samsung": 17, "./is-silk": 18 }
];
let items5 = [
(arg0, arg1, arg2) => {
module.exports = function isDuckDuckGo(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return -1 !== userAgent.indexOf("DuckDuckGo/");
};
},
{}
];
let items6 = [
(arg0, arg1, arg2) => {
module.exports = function isEdge(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
let tmp2 = -1 !== userAgent.indexOf("Edge/");
if (!tmp2) {
tmp2 = -1 !== userAgent.indexOf("Edg/");
}
return tmp2;
};
},
{}
];
let items7 = [
(arg0, arg1, arg2) => {
module.exports = function isFirefox(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return /Firefox/i.test(userAgent);
};
},
{}
];
const items8 = [
(arg0, arg1, arg2) => {
module.exports = function isIosFirefox(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return /FxiOS/i.test(userAgent);
};
},
{}
];
const items9 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./is-ios");
module.exports = function isIosGoogleSearchApp(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
let isMatch = callback(userAgent);
if (isMatch) {
isMatch = /\bGSA\b/.test(userAgent);
const obj = /\bGSA\b/;
}
return isMatch;
};
},
{ "./is-ios": 14 }
];
const items10 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./is-ios");
let closure_1 = global("./is-ios-firefox");
const re2 = /webkit/i;
module.exports = function isIosSafari(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
let isMatch = callback(userAgent);
if (isMatch) {
isMatch = regex.test(userAgent);
}
if (isMatch) {
isMatch = userAgent.indexOf("CriOS") <= -1;
}
if (isMatch) {
isMatch = !callback2(userAgent);
}
if (isMatch) {
isMatch = userAgent.indexOf("FBAN") <= -1;
}
return isMatch;
};
},
{ "./is-ios": 14, "./is-ios-firefox": 9 }
];
const items11 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./is-ios");
let closure_1 = global("./is-ios-google-search-app");
module.exports = function isIosWebview(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
const tmp2 = !callback(userAgent);
let tmp3 = !tmp2;
if (!tmp2) {
const tmp5 = !callback2(userAgent);
let isMatch = !tmp5;
if (tmp5) {
isMatch = /.+AppleWebKit(?!.*Safari)/i.test(userAgent);
const obj = /.+AppleWebKit(?!.*Safari)/i;
}
tmp3 = isMatch;
}
return tmp3;
};
},
{ "./is-ios": 14, "./is-ios-google-search-app": 10 }
];
const items12 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./is-ios-webview");
module.exports = function isIosWKWebview(arg0, arg1) {
let visible = arg1;
if (undefined === arg1) {
const _window = window;
visible = window.statusbar.visible;
}
return callback(arg0) && visible;
};
},
{ "./is-ios-webview": 12 }
];
const items13 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./is-ipados");
module.exports = function isIos(arg0, arg1, arg2) {
let userAgent = arg0;
let flag = arg1;
if (undefined === arg1) {
flag = true;
}
if (!userAgent) {
const _window = window;
userAgent = window.navigator.userAgent;
}
const isMatch = /iPhone|iPod|iPad/i.test(userAgent);
let tmp3 = isMatch;
if (flag) {
let tmp4 = isMatch;
if (!isMatch) {
tmp4 = callback(userAgent, arg2);
}
tmp3 = tmp4;
}
return tmp3;
};
},
{ "./is-ipados": 15 }
];
const items14 = [
(arg0, arg1, arg2) => {
module.exports = function isIpadOS(arg0, arg1) {
let userAgent = arg0;
let _document = arg1;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
if (!_document) {
const _window2 = window;
_document = window.document;
}
let isMatch = /Mac|iPad/i.test(userAgent);
if (isMatch) {
isMatch = "ontouchend" in _document;
}
return isMatch;
};
},
{}
];
const items15 = [
(arg0, arg1, arg2) => {
module.exports = function isOpera(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
let tmp2 = -1 !== userAgent.indexOf("OPR/");
if (!tmp2) {
tmp2 = -1 !== userAgent.indexOf("Opera/");
}
if (!tmp2) {
tmp2 = -1 !== userAgent.indexOf("OPT/");
}
return tmp2;
};
},
{}
];
const items16 = [
(arg0, arg1, arg2) => {
module.exports = function isSamsungBrowser(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return /SamsungBrowser/i.test(userAgent);
};
},
{}
];
const items17 = [
(arg0, arg1, arg2) => {
module.exports = function isSilk(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return -1 !== userAgent.indexOf("Silk/");
};
},
{}
];
const items18 = [
(arg0, arg1, arg2) => {
function isOperaMini(userAgent) {
if (!userAgent) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return userAgent.indexOf("Opera Mini") > -1;
}
let closure_0 = global("./is-android");
let closure_1 = global("./is-ios-firefox");
let closure_2 = global("./is-ios-webview");
let closure_3 = global("./is-chrome");
let closure_4 = global("./is-samsung");
let closure_5 = global("./is-duckduckgo");
module.exports = function supportsPopups(userAgent) {
if (!userAgent) {
const _window = window;
userAgent = window.navigator.userAgent;
}
let tmp2 = callback3(userAgent);
if (!tmp2) {
tmp2 = callback2(userAgent);
}
if (!tmp2) {
let userAgent2 = userAgent;
if (!userAgent) {
const _window2 = window;
userAgent2 = window.navigator.userAgent;
}
const tmp6 = !callback(userAgent2);
let isMatch = !tmp6;
if (!tmp6) {
isMatch = /Version\/[\d.]+/i.test(userAgent2);
const obj = /Version\/[\d.]+/i;
}
if (isMatch) {
isMatch = !isOperaMini(userAgent2);
}
if (isMatch) {
isMatch = !callback6(userAgent2);
}
tmp2 = isMatch;
}
if (!tmp2) {
tmp2 = isOperaMini(userAgent);
}
if (!tmp2) {
let str = userAgent;
if (!userAgent) {
const _window3 = window;
str = window.navigator.userAgent;
}
const match = str.match(/CriOS\/(\d+)\./);
let tmp14 = !tmp13;
if (!!match) {
const _parseInt = parseInt;
tmp14 = parseInt(match[1], 10) < 48;
}
tmp2 = tmp14;
}
if (!tmp2) {
let isMatch1 = !callback4(userAgent);
if (isMatch1) {
isMatch1 = !callback5(userAgent);
}
if (isMatch1) {
isMatch1 = /samsung/i.test(userAgent);
const obj2 = /samsung/i;
}
tmp2 = isMatch1;
}
return !tmp2;
};
},
{ "./is-android": 3, "./is-chrome": 5, "./is-duckduckgo": 6, "./is-ios-firefox": 9, "./is-ios-webview": 12, "./is-samsung": 17 }
];
const items19 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-android");
},
{ "./dist/is-android": 3 }
];
const items20 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-chrome-os");
},
{ "./dist/is-chrome-os": 4 }
];
const items21 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-chrome");
},
{ "./dist/is-chrome": 5 }
];
const items22 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-firefox");
},
{ "./dist/is-firefox": 8 }
];
const items23 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-ios-safari");
},
{ "./dist/is-ios-safari": 11 }
];
const items24 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-ios-webview");
},
{ "./dist/is-ios-webview": 12 }
];
const items25 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-ios-wkwebview");
},
{ "./dist/is-ios-wkwebview": 13 }
];
const items26 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-ios");
},
{ "./dist/is-ios": 14 }
];
const items27 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-samsung");
},
{ "./dist/is-samsung": 17 }
];
const items28 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/supports-popups");
},
{ "./dist/supports-popups": 19 }
];
const items29 = [
(arg0, arg1, arg2) => {
module.exports = (() => {
class EventEmitter {
constructor() {
this._events = {};
return;
}
on(arg0, arg1) {
_events = this._events;
if (this._events[arg0]) {
arr2 = _events[arg0];
arr = arr2.push(arg1);
} else {
items = [];
items[0] = arg1;
_events[arg0] = items;
}
return;
}
off(arg0, arg1) {
arr = this._events[arg0];
if (arr) {
tmp = arg1;
num = 1;
spliceResult = arr.splice(arr.indexOf(arg1), 1);
}
return;
}
_emit(arg0) {
items = [];
EventEmitter = items;
num = 1;
if (1 < arguments.length) {
do {
items[num - 1] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
arr2 = this._events[arg0];
if (arr2) {
item = arr2.forEach((apply) => {
apply.apply(undefined, items);
});
}
return;
}
hasListener(arg0) {
arr = this._events[arg0];
tmp = !arr;
tmp2 = !tmp;
if (!tmp) {
num = 0;
tmp2 = arr.length > 0;
}
return tmp2;
}
static createChild(arg0) {
obj = { constructor: arg0 };
arg0.prototype = Object.create(EventEmitter.prototype, obj);
return;
}
}
return EventEmitter;
})();
},
{}
];
const items30 = [
(arg0, arg1, arg2) => {
let _Promise = null;
if ("undefined" !== typeof Promise) {
_Promise = Promise;
}
module.exports = (() => {
class ExtendedPromise {
constructor(arg0) {
self = this;
self = this;
if ("function" !== typeof arg0) {
tmp7 = self;
_Promise2 = self.Promise;
prototype2 = _Promise2.prototype;
tmp8 = new.target;
tmp9 = new.target;
_Promise2 = new _Promise2((_resolveFunction, _rejectFunction) => {
self._resolveFunction = _resolveFunction;
self._rejectFunction = _rejectFunction;
});
tmp11 = _Promise2;
self._promise = _Promise2;
obj = arg0;
if (!arg0) {
obj = {};
}
defaultOnResolve = obj.onResolve;
if (!defaultOnResolve) {
tmp12 = self;
defaultOnResolve = self.defaultOnResolve;
}
self._onResolve = defaultOnResolve;
defaultOnReject = obj.onReject;
if (!defaultOnReject) {
tmp13 = self;
defaultOnReject = self.defaultOnReject;
}
self._onReject = defaultOnReject;
tmp14 = self;
if (self.shouldCatchExceptions(obj)) {
_promise = self._promise;
catchPromise = _promise.catch(() => {
});
}
_resetStateResult = self._resetState();
} else {
tmp = self;
_Promise = self.Promise;
prototype = _Promise.prototype;
tmp2 = new.target;
tmp3 = new.target;
tmp4 = arg0;
_Promise = new _Promise(arg0);
tmp6 = _Promise;
self._promise = _Promise;
}
return;
}
static defaultOnResolve(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.resolve(arg0);
}
static defaultOnReject(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.reject(arg0);
}
static setPromise(arg0) {
ExtendedPromise.Promise = arg0;
return;
}
static shouldCatchExceptions(arg0) {
_Boolean = Boolean;
if (arg0.hasOwnProperty("suppressUnhandledPromiseMessage")) {
_BooleanResult = _Boolean(arg0.suppressUnhandledPromiseMessage);
} else {
tmp = ExtendedPromise;
_BooleanResult = _Boolean(ExtendedPromise.suppressUnhandledPromiseMessage);
}
return _BooleanResult;
}
static all(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.all(arg0);
}
static allSettled(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.allSettled(arg0);
}
static race(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.race(arg0);
}
static reject(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.reject(arg0);
}
static resolve(arg0) {
_Promise = ExtendedPromise.Promise;
return _Promise.resolve(arg0);
}
then() {
items = [];
num = 0;
if (0 < arguments.length) {
do {
items[num] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
_promise = this._promise;
then = _promise.then;
return then.apply(_promise, items);
}
catch() {
items = [];
num = 0;
if (0 < arguments.length) {
do {
items[num] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
_promise = this._promise;
_catch = _promise.catch;
return _catch.apply(_promise, items);
}
resolve(arg0) {
self = this;
closure_0 = arg0;
self = this;
if (!this.isFulfilled) {
_setResolvedResult = self._setResolved();
tmp2 = closure_0;
_Promise = closure_0.Promise;
resolveResult = _Promise.resolve();
nextPromise = resolveResult.then(() => self._onResolve(closure_0));
nextPromise1 = nextPromise.then((arg0) => {
self._resolveFunction(arg0);
});
catchPromise = nextPromise1.catch((arg0) => {
self._resetState();
self.reject(arg0);
});
}
return self;
}
reject(arg0) {
self = this;
closure_0 = arg0;
self = this;
if (!this.isFulfilled) {
_setRejectedResult = self._setRejected();
tmp2 = closure_0;
_Promise = closure_0.Promise;
resolveResult = _Promise.resolve();
nextPromise = resolveResult.then(() => self._onReject(closure_0));
nextPromise1 = nextPromise.then((arg0) => {
self._setResolved();
self._resolveFunction(arg0);
});
catchPromise = nextPromise1.catch((arg0) => self._rejectFunction(arg0));
}
return self;
}
_resetState() {
this.isFulfilled = false;
this.isResolved = false;
this.isRejected = false;
return;
}
_setResolved() {
this.isFulfilled = true;
this.isResolved = true;
this.isRejected = false;
return;
}
_setRejected() {
this.isFulfilled = true;
this.isResolved = false;
this.isRejected = true;
return;
}
}
ExtendedPromise.Promise = ExtendedPromise;
return ExtendedPromise;
})();
},
{}
];
const items31 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./lib/set-attributes");
let closure_1 = global("./lib/default-attributes");
let closure_2 = global("./lib/assign");
module.exports = function createFrame(arg0) {
let obj = arg0;
if (undefined === arg0) {
obj = {};
}
const element = ;
obj = closure_2.assign({}, defaultAttributes.defaultAttributes, obj);
let style = obj.style;
if (style) {
style = "string" !== typeof obj.style;
}
if (style) {
obj = closure_2.assign(element.style, obj.style);
delete tmp.style;
}
attributes.setAttributes(element, obj);
if (!element.getAttribute("id")) {
element.id = element.name;
}
return element;
};
},
{ "./lib/assign": 33, "./lib/default-attributes": 34, "./lib/set-attributes": 35 }
];
const items32 = [
(arg0, arg1, arg2) => {
arg2.assign = function assign(arg0) {
let length;
let closure_0 = arg0;
const items = [];
let num = 1;
if (1 < arguments.length) {
do {
items[num - 1] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
let item = items.forEach((arg0) => {
let closure_0 = arg0;
if ("object" === typeof arg0) {
const _Object = Object;
const keys = Object.keys(arg0);
const item = keys.forEach((arg0) => {
table[arg0] = table[arg0];
});
}
});
return arg0;
};
},
{}
];
const items33 = [
(arg0, arg1, arg2) => {
arg2.defaultAttributes = { src: "about:blank", frameBorder: 0, allowtransparency: true, scrolling: "no" };
},
{}
];
const items34 = [
(arg0, arg1, arg2) => {
arg2.setAttributes = function setAttributes(removeAttribute, obj) {
for (const key10007 in arg1) {
let tmp6 = key10007;
if (!arg1.hasOwnProperty(key10007)) {
continue;
} else {
let tmp = arg1[key10007];
if (null == tmp) {
let removeAttributeResult = arg0.removeAttribute(key10007);
let tmp5 = tmp;
continue;
} else {
let attr = arg0.setAttribute(key10007, tmp);
let tmp3 = tmp;
continue;
}
continue;
}
continue;
}
};
},
{}
];
const items35 = [
(arg0, arg1, arg2) => {
module.exports = function uuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (arg0) => {
const tmp = 16 * Math.random() | 0;
let str = tmp;
if ("x" !== arg0) {
str = 3 & tmp | 8;
}
return str.toString(16);
});
};
},
{}
];
const items36 = [
(arg0, arg1, arg2) => {
arg2.deferred = function deferred(items) {
let closure_0 = items;
return () => {
let length;
const items = [];
let num = 0;
if (0 < arguments.length) {
do {
items[num] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
const timerId = setTimeout(() => {
items.apply(undefined, items);
}, 1);
};
};
},
{}
];
const items37 = [
(arg0, arg1, arg2) => {
arg2.once = function once(arg0) {
let closure_0 = arg0;
let c1 = false;
return () => {
let length;
const items = [];
let num = 0;
if (0 < arguments.length) {
do {
items[num] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
if (!c1) {
c1 = true;
callback.apply(undefined, items);
}
};
};
},
{}
];
const items38 = [
(arg0, arg1, arg2) => {
arg2.promiseOrCallback = function promiseOrCallback(closure_0, onceResult) {
closure_0 = onceResult;
if (onceResult) {
closure_0.then((arg0) => onceResult(null, arg0)).catch((arg0) => onceResult(arg0));
} else {
return closure_0;
}
};
},
{}
];
const items39 = [
(arg0, arg1, arg2) => {
function wrapPromise(arg0) {
let closure_0 = arg0;
return function() {
let length;
const items = [];
let num = 0;
if (0 < arguments.length) {
do {
items[num] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
let onceResult;
if ("function" === typeof items[items.length - 1]) {
onceResult = outer1_1.once(lib.deferred(items.pop()));
}
return outer1_2.promiseOrCallback(lib.apply(this, items), onceResult);
};
}
let closure_0 = global("./lib/deferred");
let closure_1 = global("./lib/once");
let closure_2 = global("./lib/promise-or-callback");
wrapPromise.wrapPrototype = (arg0, arg1) => {
let obj = arg1;
let closure_0 = arg0;
if (undefined === arg1) {
obj = {};
}
let closure_1 = obj.ignoreMethods || [];
let closure_2 = true === obj.transformPrivateMethods;
const ownPropertyNames = Object.getOwnPropertyNames(arg0.prototype);
const found = ownPropertyNames.filter((str) => {
let tmp = "constructor" !== str;
if (tmp) {
tmp = "function" === typeof ctor.prototype[str];
}
let tmp4 = closure_2;
if (!closure_2) {
tmp4 = "_" !== str.charAt(0);
}
if (tmp) {
tmp = tmp4;
}
if (tmp) {
tmp = tmp3;
}
return tmp;
});
const item = found.forEach((arg0) => {
ctor.prototype[arg0] = outer1_3(ctor.prototype[arg0]);
});
return arg0;
};
module.exports = wrapPromise;
},
{ "./lib/deferred": 37, "./lib/once": 38, "./lib/promise-or-callback": 39 }
];
const items40 = [
function(arg0, arg1, arg2) {
let self = this;
const fn = (arg0) => {
let concat;
let concat2;
function __awaiter(arg0, arg1, arg2, arg3) {
let closure_0 = arg0;
let closure_3 = arg3;
return new Promise((arg0, arg1) => {
let closure_0 = arg0;
let closure_1 = arg1;
function fulfilled() { ... }
let iter = function rejected() { ... };
function step() { ... }
let items = closure_1;
if (!closure_1) {
items = [];
}
iter = iter.apply(closure_0, items);
step(iter.next());
});
}
function __generator(arg0, arg1) {
let closure_0 = arg0;
let closure_1 = arg1;
function verb(arg0) {
let closure_0 = arg0;
return () => { ... };
}
let obj = {
label: 0,
sent() {
if (1 & dependencyMap[0]) {
throw tmp;
} else {
return tmp;
}
},
trys: [],
ops: []
};
obj = { next: verb(0), throw: verb(1), return: verb(2) };
if ("function" === typeof Symbol) {
const _Symbol = Symbol;
obj[Symbol.iterator] = function() {
return this;
};
}
return obj;
}
function loadScript$1(forceScriptReload) {
const table = forceScriptReload;
const json = JSON.stringify(forceScriptReload);
if (!forceScriptReload.forceScriptReload) {
if (table[json]) {
return tmp3;
}
}
let element = ;
const tmp4 = forceScriptReload.dataAttributes || {};
const fastlane = tmp4;
let head = forceScriptReload.container;
if (!head) {
const _document = document;
head = document.head;
}
element.src = forceScriptReload.src;
element.id = forceScriptReload.id || "";
element.async = true;
if (forceScriptReload.type) {
const concat = "".concat;
let attr = element.setAttribute("type", "".concat(forceScriptReload.type));
}
if (forceScriptReload.crossorigin) {
const concat2 = "".concat;
const attr1 = element.setAttribute("crossorigin", "".concat(forceScriptReload.crossorigin));
}
const keys = Object.keys(tmp4);
const item = keys.forEach((arg0) => {
const combined = "data-".concat(arg0);
const attr = element.setAttribute(combined, "".concat(tmp4[arg0]));
});
const promise = new Promise((arg0, arg1) => {
let closure_0 = arg0;
const element = arg1;
const listener = element.addEventListener("load", () => { ... });
const listener1 = element.addEventListener("error", () => { ... });
const listener2 = element.addEventListener("abort", () => { ... });
head.appendChild(element);
});
table[json] = promise;
return promise;
}
function isAmdEnv() {
let amd = "function" === typeof window.define;
if (amd) {
const _window = window;
amd = window.define.amd;
}
return amd;
}
function safeLoadBtModule(arg0, arg1, arg2) {
let closure_0 = arg0;
let closure_1 = arg1;
let c2 = arg2;
if (undefined === arg2) {
c2 = true;
}
return __awaiter(this, undefined, undefined, function() {
return outer1_6(this, () => { ... });
});
}
function loadBtModule(amdModule) {
let flag = arg2;
if (undefined === arg2) {
flag = true;
}
if (isAmdEnv()) {
amdModule = amdModule.amdModule;
let closure_0 = flag ? amdModule.minified : amdModule.unminified;
const promise = new Promise((arg0, arg1) => {
const items = [closure_0];
const _module = window.require(items, arg0, arg1);
});
return promise;
} else {
const script = amdModule.script;
const obj = {};
const concat = "".concat;
const combined = "".concat(amdModule.id, "-");
obj.id = combined.concat(arg1);
const concat2 = "https://js.braintreegateway.com/web/".concat;
const combined1 = "https://js.braintreegateway.com/web/".concat(arg1, "/js/");
obj.src = combined1.concat(flag ? script.minified : script.unminified);
return loadScript$1(obj);
}
}
function loadAXOScript(src) {
let flag = arg1;
if (undefined === arg1) {
flag = true;
}
if (isAmdEnv()) {
let tmp3 = isAmdEnv();
if (tmp3) {
const _window = window;
tmp3 = "function" === typeof window.requirejs;
}
if (tmp3) {
const _window2 = window;
tmp3 = "function" === typeof window.requirejs.config;
}
if (tmp3) {
let obj = {};
obj = {};
obj[fastlane] = src;
obj.paths = obj;
globalThis.requirejs.config(obj);
}
const concat = "".concat;
const combined = "".concat(fastlane, "/");
const AXO_ASSET_NAME = obj.AXO_ASSET_NAME;
let closure_0 = combined.concat(flag ? AXO_ASSET_NAME.minified : AXO_ASSET_NAME.unminified);
const promise = new Promise((arg0, arg1) => {
const items = [closure_0];
const _module = window.require(items, arg0, arg1);
});
return promise;
} else {
obj = { id: "axo-id", src, forceScriptReload: true };
return loadScript$1(obj);
}
}
function generateAssetUrl(arg0) {
let assetUrl;
let bundleId;
({ assetUrl, bundleId } = arg0);
if (bundleId) {
const concat2 = "https://cdn-".concat;
const combined = "https://cdn-".concat(bundleId, ".static.engineering.dev.paypalinc.com/");
let combined1 = combined.concat(assetUrl);
} else {
const concat = "".concat;
const combined2 = "".concat(obj.CDNX_PROD, "/");
combined1 = combined2.concat(assetUrl);
}
return combined1;
}
let obj = {};
let closure_0 = {};
loadScript$1.clearCache = () => {
let closure_0 = {};
};
obj.loadScript = undefined;
loadScript$1 = undefined;
obj.loadStylesheet = undefined;
obj.loadScript = loadScript$1;
obj.loadStylesheet = function loadStylesheet(href) {
const element = document.querySelector("link[href=\"".concat(href.href, "\"]"));
if (element) {
return Promise.resolve(element);
} else {
const _document = document;
const element1 = ;
let head = href.container;
if (!head) {
const _document2 = document;
head = document.head;
}
const attr = element1.setAttribute("rel", "stylesheet");
const attr1 = element1.setAttribute("type", "text/css");
const attr2 = element1.setAttribute("href", href.href);
const attr3 = element1.setAttribute("id", href.id);
if (head.firstChild) {
head.insertBefore(element1, head.firstChild);
} else {
head.appendChild(element1);
}
return Promise.resolve(element1);
}
};
let fastlane = "fastlane";
obj = { AXO_ASSET_NAME: { minified: "axo.min", unminified: "axo" }, AXO_ASSET_PATH: "connect-boba", LOCALE_PATH: "".concat("connect-boba", "/locales/"), CDNX_PROD: "https://www.paypalobjects.com" };
obj = { client: "client", hostedFields: "hosted-fields" };
let obj1 = {};
const obj2 = { id: "client", module: "client" };
const obj3 = {};
let combined = "".concat("braintree", "/");
obj3.unminified = combined.concat(obj.client);
let combined1 = "".concat("braintree", "/");
obj3.minified = combined1.concat(obj.client, ".min");
obj2.amdModule = obj3;
obj2.script = { unminified: "".concat(obj.client, ".js"), minified: "".concat(obj.client, ".min.js") };
obj1.client = obj2;
const obj5 = { id: "hcf", module: "hostedFields" };
const obj6 = {};
let combined2 = "".concat("braintree", "/");
obj6.unminified = combined2.concat(obj.hostedFields);
const combined3 = "".concat("braintree", "/");
obj6.minified = combined3.concat(obj.hostedFields, ".min");
obj5.amdModule = obj6;
const obj4 = { unminified: "".concat(obj.client, ".js"), minified: "".concat(obj.client, ".min.js") };
({ concat, concat: concat2 } = "");
obj5.script = { unminified: "".concat(obj.hostedFields, ".js"), minified: "".concat(obj.hostedFields, ".min.js") };
obj1.hostedFields = obj5;
arg0.constants = obj;
arg0.loadAxo = function loadAxo(arg0) {
let closure_0 = arg0;
return __awaiter(this, undefined, undefined, function() {
return outer1_6(this, () => { ... });
});
};
};
if ("object" === typeof arg2) {
if (undefined !== arg1) {
fn(arg2);
}
}
if ("undefined" !== typeof globalThis) {
self = globalThis;
}
let obj = {};
self.loadAxo = obj;
fn(obj);
},
{}
];
const items41 = [
function(arg0, arg1, arg2) {
function findType(arg0) {
let tmp = dependencyMap2[arg0];
if (!tmp) {
tmp = dependencyMap[arg0];
}
return tmp;
}
function getCardPosition(type, arg1) {
let flag = arg1;
if (undefined === arg1) {
flag = false;
}
const index = arr.indexOf(type);
if (!flag) {
if (-1 === index) {
const _Error = Error;
const error = new Error("\"" + type + "\" is not a supported card type.");
throw error;
}
}
return index;
}
function creditCardType(arg0) {
let closure_0 = arg0;
let items = [];
if (validInputType.isValidInputType(arg0)) {
if (0 === arg0.length) {
return (function getAllCardTypes() {
return outer1_8.map((arg0) => outer2_5.clone(outer2_9(arg0)));
})();
} else {
const item = arr.forEach((arg0) => {
const result = outer1_2.addMatchingCardsToResults(closure_0, outer1_9(arg0), items);
});
const findBestMatchResult = closure_4.findBestMatch(items);
if (findBestMatchResult) {
const items1 = [findBestMatchResult];
items = items1;
}
return items;
}
} else {
return items;
}
}
let fn = this;
if (this) {
fn = this.__assign;
}
if (!fn) {
fn = function() {
const obj = Object.assign || ((arg0) => {
for (let num = 1; num < length; num = num + 1) {
let tmp3 = arguments[num];
let tmp4 = tmp3;
let tmp5 = tmp2;
let keys = Object.keys();
if (keys !== undefined) {
tmp2 = tmp5;
let tmp7 = keys[tmp];
while (tmp7 !== undefined) {
let tmp8 = tmp7;
let _Object = Object;
tmp5 = tmp7;
if (!hasOwnProperty.call(tmp3, tmp7)) {
continue;
} else {
arg0[tmp7] = tmp3[tmp7];
tmp5 = tmp7;
continue;
}
continue;
}
}
}
return arg0;
});
return obj(...arguments);
};
}
let closure_1 = global("./lib/card-types");
let closure_2 = global("./lib/add-matching-cards-to-results");
let closure_3 = global("./lib/is-valid-input-type");
let closure_4 = global("./lib/find-best-match");
const globalResult = global("./lib/clone");
let closure_6 = {};
let obj = { VISA: "visa", MASTERCARD: "mastercard", AMERICAN_EXPRESS: "american-express", DINERS_CLUB: "diners-club", DISCOVER: "discover", JCB: "jcb", UNIONPAY: "unionpay", MAESTRO: "maestro", ELO: "elo", MIR: "mir", HIPER: "hiper", HIPERCARD: "hipercard" };
let items = [, , , , , , , , , , , ];
({ VISA: arr[0], MASTERCARD: arr[1], AMERICAN_EXPRESS: arr[2], DINERS_CLUB: arr[3], DISCOVER: arr[4], JCB: arr[5], UNIONPAY: arr[6], MAESTRO: arr[7], ELO: arr[8], MIR: arr[9], HIPER: arr[10], HIPERCARD: arr[11] } = obj);
let closure_8 = globalResult.clone(items);
creditCardType.getTypeInfo = (arg0) => globalResult.clone(findType(arg0));
creditCardType.removeCard = (type) => {
arr.splice(getCardPosition(type), 1);
};
creditCardType.addCard = (type) => {
closure_6[type.type] = type;
if (-1 === getCardPosition(type.type, true)) {
arr = arr.push(type.type);
}
};
creditCardType.updateCard = (arg0, type) => {
let tmp = dependencyMap2[arg0];
if (!tmp) {
tmp = dependencyMap[arg0];
}
if (tmp) {
if (type.type) {
if (tmp.type !== type.type) {
const _Error2 = Error;
const error = new Error("Cannot overwrite type parameter.");
throw error;
}
}
const tmp10 = fn(fn({}, globalResult.clone(tmp)), type);
dependencyMap2[tmp10.type] = tmp10;
} else {
const _Error = Error;
const concat = "\"".concat;
const error1 = new Error("\"".concat(arg0, "\" is not a recognized type. Use `addCard` instead.'"));
throw error1;
}
};
creditCardType.changeOrder = (type) => {
arr.splice(getCardPosition(type), 1);
arr.splice(arg1, 0, type);
};
creditCardType.resetModifications = () => {
let closure_8 = globalResult.clone(items);
let closure_6 = {};
};
creditCardType.types = obj;
module.exports = creditCardType;
},
{ "./lib/add-matching-cards-to-results": 43, "./lib/card-types": 44, "./lib/clone": 45, "./lib/find-best-match": 46, "./lib/is-valid-input-type": 47 }
];
const items42 = [
(arg0, arg1, arg2) => {
arg2.addMatchingCardsToResults = undefined;
let closure_0 = arg0("./clone");
let closure_1 = arg0("./matches");
arg2.addMatchingCardsToResults = function addMatchingCardsToResults(closure_0, patterns, items) {
let num = 0;
if (0 < patterns.patterns.length) {
while (!closure_1.matches(closure_0, patterns.patterns[num])) {
num = num + 1;
}
const cloneResult = closure_0.clone(patterns);
const _Array = Array;
const _String = String;
if (Array.isArray(patterns.patterns[num])) {
let length = _String(tmp[0]).length;
} else {
length = _String(tmp).length;
}
if (closure_0.length >= length) {
cloneResult.matchStrength = length;
}
items.push(cloneResult);
}
};
},
{ "./clone": 45, "./matches": 48 }
];
const items43 = [
(arg0, arg1, arg2) => {
let obj = { niceType: "Visa", type: "visa", patterns: [4], gaps: [4, 8, 12], lengths: [16, 18, 19], code: { name: "CVV", size: 3 } };
obj = { niceType: "Mastercard", type: "mastercard" };
const items = [[51, 55], [2221, 2229], [223, 229], [23, 26], [270, 271], 2720];
obj.patterns = items;
obj.gaps = [4, 8, 12];
obj.lengths = [16];
obj.code = { name: "CVC", size: 3 };
obj = { niceType: "American Express", type: "american-express", patterns: [34, 37], gaps: [4, 10], lengths: [15], code: { name: "CID", size: 4 } };
const obj1 = { niceType: "Diners Club", type: "diners-club" };
const items1 = [[300, 305], 36, 38, 39];
obj1.patterns = items1;
obj1.gaps = [4, 10];
obj1.lengths = [14, 16, 19];
obj1.code = { name: "CVV", size: 3 };
const obj2 = { niceType: "Discover", type: "discover" };
const items2 = [6011, [644, 649], 65];
obj2.patterns = items2;
obj2.gaps = [4, 8, 12];
obj2.lengths = [16, 19];
obj2.code = { name: "CID", size: 3 };
const obj3 = { niceType: "JCB", type: "jcb" };
const items3 = [2131, 1800, [3528, 3589]];
obj3.patterns = items3;
obj3.gaps = [4, 8, 12];
obj3.lengths = [16, 17, 18, 19];
obj3.code = { name: "CVV", size: 3 };
const obj4 = { niceType: "UnionPay", type: "unionpay" };
const items4 = [620, [62100, 62182], [62184, 62187], [62185, 62197], [62200, 62205], [622010, 622999], 622018, [62207, 62209], [623, 626], 6270, 6272, 6276, [627700, 627779], [627781, 627799], [6282, 6289], 6291, 6292, 810, [8110, 8131], [8132, 8151], [8152, 8163], [8164, 8171]];
obj4.patterns = items4;
obj4.gaps = [4, 8, 12];
obj4.lengths = [14, 15, 16, 17, 18, 19];
obj4.code = { name: "CVN", size: 3 };
const obj5 = { niceType: "Maestro", type: "maestro" };
const items5 = [493698, [500000, 504174], [504176, 506698], [506779, 508999], [56, 59], 63, 67, 6];
obj5.patterns = items5;
obj5.gaps = [4, 8, 12];
obj5.lengths = [12, 13, 14, 15, 16, 17, 18, 19];
obj5.code = { name: "CVC", size: 3 };
const obj6 = { niceType: "Elo", type: "elo" };
const items6 = [401178, 401179, 438935, 457631, 457632, 431274, 451416, 457393, 504175, [506699, 506778], [509000, 509999], 627780, 636297, 636368, [650031, 650033], [650035, 650051], [650405, 650439], [650485, 650538], [650541, 650598], [650700, 650718], [650720, 650727], [650901, 650978], [651652, 651679], [655000, 655019], [655021, 655058]];
obj6.patterns = items6;
obj6.gaps = [4, 8, 12];
obj6.lengths = [16];
obj6.code = { name: "CVE", size: 3 };
const obj7 = { niceType: "Mir", type: "mir" };
const items7 = [[2200, 2204]];
obj7.patterns = items7;
obj7.gaps = [4, 8, 12];
obj7.lengths = [16, 17, 18, 19];
obj7.code = { name: "CVP2", size: 3 };
const obj8 = { niceType: "Hiper", type: "hiper", patterns: [637095, 63737423, 63743358, 637568, 637599, 637609, 637612], gaps: [4, 8, 12], lengths: [16], code: { name: "CVC", size: 3 } };
const obj9 = { niceType: "Hipercard", type: "hipercard", patterns: [606282], gaps: [4, 8, 12], lengths: [16], code: { name: "CVC", size: 3 } };
module.exports = { visa: obj, mastercard: obj, "american-express": obj, "diners-club": obj1, discover: obj2, jcb: obj3, unionpay: obj4, maestro: obj5, elo: obj6, mir: obj7, hiper: obj8, hipercard: obj9 };
},
{}
];
const items44 = [
(arg0, arg1, arg2) => {
arg2.clone = function clone(arg0) {
let parsed = null;
if (arg0) {
const _JSON = JSON;
const _JSON2 = JSON;
parsed = JSON.parse(JSON.stringify(arg0));
}
return parsed;
};
},
{}
];
const items45 = [
(arg0, arg1, arg2) => {
arg2.findBestMatch = function findBestMatch(arr) {
let reduced = null;
if ((function hasEnoughResultsToDetermineBestMatch(arr) {
const length = arr.filter((matchStrength) => matchStrength.matchStrength).length;
return length > 0 && length === arr.length;
})(arr)) {
reduced = arr.reduce((arg0, matchStrength) => {
let tmp = arg0;
let tmp2 = matchStrength;
if (arg0) {
const _Number = Number;
const _Number2 = Number;
if (NumberResult < Number(matchStrength.matchStrength)) {
tmp = matchStrength;
}
tmp2 = tmp;
NumberResult = Number(tmp.matchStrength);
}
return tmp2;
});
}
return reduced;
};
},
{}
];
const items46 = [
(arg0, arg1, arg2) => {
arg2.isValidInputType = function isValidInputType(arg0) {
let tmp = "string" === typeof arg0;
if (!tmp) {
const _String = String;
tmp = arg0 instanceof String;
}
return tmp;
};
},
{}
];
const items47 = [
(arg0, arg1, arg2) => {
arg2.matches = function matches(str) {
if (Array.isArray(arg1)) {
const first = arg1[0];
const _String2 = String;
const substr = str.substr(0, String(first).length);
const _parseInt = parseInt;
const parsed = parseInt(substr, 10);
const _parseInt2 = parseInt;
const _String3 = String;
const _parseInt3 = parseInt;
const _String4 = String;
const parsed1 = parseInt(String(first).substr(0, substr.length), 10);
const str2 = String(first);
const str3 = String(arg1[1]);
let tmp2 = parsed >= parsed1 && parsed <= parseInt(String(arg1[1]).substr(0, substr.length), 10);
const tmp6 = parsed >= parsed1 && parsed <= parseInt(String(arg1[1]).substr(0, substr.length), 10);
} else {
const _String = String;
str = String(arg1);
const substr1 = str.substring(0, str.length);
tmp2 = substr1 === str.substring(0, str.length);
}
return tmp2;
};
},
{}
];
const items48 = [
(arg0, arg1, arg2) => {
arg2.Framebus = undefined;
let closure_0 = arg0("./lib");
let _Promise = "undefined" !== typeof window;
if (_Promise) {
let _window = window;
_Promise = window.Promise;
}
arg2.Framebus = (() => {
class Framebus {
constructor(arg0) {
obj = arg0;
self = this;
if (undefined === arg0) {
obj = {};
}
self.origin = obj.origin || "*";
self.channel = obj.channel || "";
self.verifyDomain = obj.verifyDomain;
self.targetFrames = obj.targetFrames || [];
self.limitBroadcastToFramesArray = Boolean(obj.targetFrames);
self.isDestroyed = false;
self.listeners = [];
limitBroadcastToFramesArray = self.verifyDomain;
if (!limitBroadcastToFramesArray) {
limitBroadcastToFramesArray = self.limitBroadcastToFramesArray;
}
self.hasAdditionalChecksForOnListeners = Boolean(limitBroadcastToFramesArray);
return;
}
static setPromise(arg0) {
Framebus.Promise = arg0;
return;
}
static target(arg0) {
tmp = new Framebus(arg0);
return tmp;
}
addTargetFrame(arg0) {
if (this.limitBroadcastToFramesArray) {
targetFrames = this.targetFrames;
tmp = arg0;
arr = targetFrames.push(arg0);
}
return;
}
include(arg0) {
tmp = null != arg0;
if (tmp) {
tmp2 = null != arg0.Window;
if (tmp2) {
flag = arg0.constructor === arg0.Window;
if (flag) {
tmp3 = Framebus;
childWindows = Framebus.childWindows;
arr = childWindows.push(arg0);
flag = true;
}
tmp2 = flag;
}
tmp = tmp2;
}
return tmp;
}
target(arg0) {
return Framebus.target(arg0);
}
emit(arg0, arg1, arg2) {
tmp = arg2;
self = this;
if (this.isDestroyed) {
flag4 = false;
return false;
} else {
origin = self.origin;
tmp2 = arg0;
namespaceEventResult = self.namespaceEvent(arg0);
tmp4 = Framebus;
if (Framebus.isntString(namespaceEventResult)) {
flag3 = false;
return false;
} else {
tmp5 = Framebus;
if (Framebus.isntString(origin)) {
flag2 = false;
return false;
} else {
str = "function";
tmp6 = arg1;
if ("function" === typeof arg1) {
tmp = arg1;
}
tmp7 = Framebus;
tmp8 = namespaceEventResult;
tmp9 = origin;
tmp10 = tmp6;
tmp11 = tmp;
packagePayloadResult = Framebus.packagePayload(namespaceEventResult, origin, tmp6, tmp);
closure_1 = packagePayloadResult;
tmp13 = !packagePayloadResult;
flag = !tmp13;
if (!tmp13) {
if (self.limitBroadcastToFramesArray) {
result = self.targetFramesAsWindows();
item = result.forEach((arg0) => {
Framebus.sendMessage(arg0, closure_1, origin);
});
flag = true;
} else {
tmp14 = Framebus;
obj = {};
obj.origin = origin;
tmp15 = globalThis;
_window = window;
_self = window.top;
if (!_self) {
_window2 = window;
_self = window.self;
}
obj.frame = _self;
broadcastResult = Framebus.broadcast(packagePayloadResult, obj);
flag = true;
}
}
return flag;
}
}
}
}
emitAsPromise(arg0, arg1) {
closure_0 = arg0;
closure_1 = arg1;
self = this;
promise = new closure_0.Promise((arg0, arg1) => {
let closure_0 = arg0;
if (!self.emit(closure_0, closure_1, (arg0) => {
callback(arg0);
})) {
const _Error = Error;
const concat = "Listener not added for \"".concat;
const error = new Error("Listener not added for \"".concat(closure_0, "\""));
arg1(error);
}
});
return promise;
}
on(arg0, arg1) {
self = this;
closure_0 = arg1;
if (this.isDestroyed) {
flag2 = false;
return false;
} else {
origin = self.origin;
tmp = arg0;
namespaceEventResult = self.namespaceEvent(arg0);
tmp3 = Framebus;
flag = !Framebus.subscriptionArgsInvalid(namespaceEventResult, arg1, origin);
if (flag) {
handler = arg1;
if (self.hasAdditionalChecksForOnListeners) {
handler = function handler() {
let length;
const self = this;
const items = [];
let num = 0;
if (0 < arguments.length) {
do {
items[num] = arguments[num];
num = num + 1;
length = arguments.length;
} while (num < length);
}
let origin = self;
if (self) {
origin = self.origin;
}
let result = self.passesVerifyDomainCheck(origin);
if (result) {
let source = self;
if (self) {
source = self.source;
}
result = self.hasMatchingTargetFrame(source);
}
if (result) {
originalHandler.apply(undefined, items);
}
};
}
listeners = self.listeners;
obj = {};
obj.eventName = namespaceEventResult;
obj.handler = handler;
obj.originalHandler = arg1;
arr = listeners.push(obj);
tmp5 = Framebus;
obj = Framebus.subscribers[origin];
if (!obj) {
obj = {};
}
Framebus.subscribers[origin] = obj;
tmp6 = Framebus;
items = Framebus.subscribers[origin][namespaceEventResult];
if (!items) {
items = [];
}
Framebus.subscribers[origin][namespaceEventResult] = items;
tmp7 = Framebus;
arr3 = Framebus.subscribers[origin][namespaceEventResult];
arr1 = arr3.push(handler);
flag = true;
}
return flag;
}
}
off(arg0, arg1) {
self = this;
if (this.isDestroyed) {
flag5 = false;
return false;
} else {
tmp = arg1;
if (self.verifyDomain) {
num = 0;
handler = arg1;
tmp = arg1;
if (0 < self.listeners.length) {
do {
tmp2 = self.listeners[num];
if (tmp2.originalHandler === arg1) {
handler = tmp2.handler;
}
num = num + 1;
tmp = handler;
} while (num < self.listeners.length);
}
}
tmp3 = arg0;
namespaceEventResult = self.namespaceEvent(arg0);
origin = self.origin;
tmp5 = Framebus;
if (Framebus.subscriptionArgsInvalid(namespaceEventResult, tmp, origin)) {
flag4 = false;
return false;
} else {
tmp6 = Framebus;
arr = Framebus.subscribers[origin];
if (arr) {
tmp7 = Framebus;
arr = Framebus.subscribers[origin][namespaceEventResult];
}
if (arr) {
num2 = 0;
if (0 < arr.length) {
tmp8 = num2;
while (arr[num2] !== tmp) {
num2 = num2 + 1;
}
num3 = 1;
spliceResult = arr.splice(num2, 1);
flag3 = true;
return true;
}
flag2 = false;
return false;
} else {
flag = false;
return false;
}
}
}
}
teardown() {
self = this;
if (!this.isDestroyed) {
flag = true;
self.isDestroyed = true;
num = 0;
num2 = 0;
if (0 < self.listeners.length) {
do {
tmp = self.listeners[num2];
offResult = self.off(tmp.eventName, tmp.handler);
num2 = num2 + 1;
length = self.listeners.length;
} while (num2 < length);
}
self.listeners.length = 0;
}
return;
}
passesVerifyDomainCheck(arg0) {
self = this;
checkOriginResult = !this.verifyDomain;
if (!checkOriginResult) {
tmp2 = arg0;
checkOriginResult = self.checkOrigin(arg0);
}
return checkOriginResult;
}
targetFramesAsWindows() {
if (this.limitBroadcastToFramesArray) {
targetFrames = this.targetFrames;
mapped = targetFrames.map((contentWindow) => {
if (contentWindow instanceof globalThis.HTMLIFrameElement) {
contentWindow = contentWindow.contentWindow;
}
return contentWindow;
});
found = mapped.filter((arg0) => arg0);
} else {
found = [];
}
return found;
}
hasMatchingTargetFrame(arg0) {
self = this;
closure_0 = arg0;
if (this.limitBroadcastToFramesArray) {
result = self.targetFramesAsWindows();
tmp = globalThis;
_Boolean = Boolean;
return Boolean(result.find((arg0) => arg0 === closure_0));
} else {
flag = true;
return true;
}
}
checkOrigin(arg0) {
self = this;
url = document.createElement("a");
url.href = location.href;
if ("https:" === url.protocol) {
str4 = url.host;
str5 = "";
host = str4.replace(/:443$/, "");
} else {
str = "http:";
if ("http:" === url.protocol) {
str2 = url.host;
str3 = "";
host = str2.replace(/:80$/, "");
} else {
host = url.host;
}
}
tmp = `${url.protocol}//${host}` === arg0;
if (!tmp) {
tmp2 = !self.verifyDomain || self.verifyDomain(arg0);
tmp = tmp2;
}
return tmp;
}
namespaceEvent(arg0) {
combined1 = arg0;
if (this.channel) {
str = "";
concat = "".concat;
str2 = ":";
combined = "".concat(tmp.channel, ":");
combined1 = combined.concat(arg0);
}
return combined1;
}
}
Framebus.Promise = _Promise;
return Framebus;
})();
},
{ "./lib": 57 }
];
const items49 = [
(arg0, arg1, arg2) => {
const globalResult = global("./lib");
globalResult.attach();
module.exports = global("./framebus").Framebus;
},
{ "./framebus": 49, "./lib": 57 }
];
const items50 = [
(arg0, arg1, arg2) => {
arg2.attach = undefined;
arg2.detach = undefined;
let closure_0 = arg0("./");
let c1 = false;
arg2.attach = function attach(outer1_1, file, filename) {
let tmp = c1;
if (!c1) {
const _window = window;
tmp = "undefined" === typeof window;
}
if (!tmp) {
c1 = true;
const _window2 = window;
const listener = window.addEventListener("message", closure_0.onMessage, false);
}
};
arg2.detach = function detach() {
let c1 = false;
const removed = window.removeEventListener("message", closure_0.onMessage, false);
};
},
{ "./": 57 }
];
const items51 = [
(arg0, arg1, arg2) => {
arg2.broadcastToChildWindows = undefined;
let closure_0 = arg0("./");
arg2.broadcastToChildWindows = function broadcastToChildWindows(data, origin, source) {
let diff = closure_0.childWindows.length - 1;
if (diff >= 0) {
do {
let tmp2 = closure_0;
let tmp3 = closure_0.childWindows[diff];
if (tmp3.closed) {
let tmp6 = closure_0;
let childWindows = closure_0.childWindows;
let spliceResult = childWindows.splice(diff, 1);
} else if (source !== tmp3) {
let tmp4 = closure_0;
let obj = { origin, frame: tmp3.top };
let broadcastResult = closure_0.broadcast(data, obj);
}
diff = diff - 1;
} while (diff >= 0);
}
};
},
{ "./": 57 }
];
const items52 = [
(arg0, arg1, arg2) => {
arg2.broadcast = undefined;
let closure_0 = arg0("./");
function broadcast(packagePayloadResult, arg1) {
let frame;
let origin;
let num = 0;
({ origin, frame } = arg1);
frame.postMessage(packagePayloadResult, origin);
const hasOpenerResult = closure_0.hasOpener(frame);
let tmp3 = hasOpenerResult;
if (hasOpenerResult) {
const _window = window;
tmp3 = frame.opener.top !== window.top;
}
if (tmp3) {
let obj = { origin, frame: frame.opener.top };
broadcast(packagePayloadResult, obj);
}
let tmp12 = tmp11;
if (frame.frames[num]) {
do {
let tmp13 = broadcast;
let tmp14 = packagePayloadResult;
obj = {};
let tmp15 = origin;
obj.origin = origin;
let tmp16 = tmp12;
obj.frame = tmp12;
let tmp17 = broadcast(packagePayloadResult, obj);
let tmp18 = num;
let sum = num + 1;
num = sum;
let tmp20 = frame;
tmp12 = frame.frames[sum];
} while (tmp21);
}
}
arg2.broadcast = broadcast;
},
{ "./": 57 }
];
const items53 = [
(arg0, arg1, arg2) => {
arg2.prefix = undefined;
arg2.childWindows = undefined;
arg2.subscribers = undefined;
arg2.prefix = "/*framebus*/";
arg2.childWindows = [];
arg2.subscribers = {};
},
{}
];
const items54 = [
(arg0, arg1, arg2) => {
arg2.dispatch = undefined;
let closure_0 = arg0("./");
arg2.dispatch = function dispatch(arg0, arg1, arg2, arg3, arg4) {
let length;
if (closure_0.subscribers[arg0]) {
if (closure_0.subscribers[arg0][arg1]) {
const items = [];
if (arg2) {
items.push(arg2);
}
if (arg3) {
items.push(arg3);
}
let num = 0;
if (0 < closure_0.subscribers[arg0][arg1].length) {
do {
let tmp5 = closure_0;
let obj = closure_0.subscribers[arg0][arg1][num];
let applyResult = obj.apply(arg4, items);
num = num + 1;
length = closure_0.subscribers[arg0][arg1].length;
} while (num < length);
}
}
}
};
},
{ "./": 57 }
];
const items55 = [
(arg0, arg1, arg2) => {
arg2.hasOpener = function hasOpener(frame) {
let tmp = frame.top === frame;
if (tmp) {
let tmp3 = null != frame.opener;
if (tmp3) {
let tmp4 = frame.opener !== frame;
if (tmp4) {
tmp4 = true !== frame.opener.closed;
}
tmp3 = tmp4;
}
tmp = tmp3;
}
return tmp;
};
},
{}
];
const items56 = [
function(arg0, arg1, arg2) {
const self = this;
let self2 = this;
if (this) {
self2 = self.__createBinding;
}
if (self2) {
let fn = self;
if (self) {
fn = self.__exportStar;
}
if (!fn) {
fn = (obj, arg1) => {
for (const key10007 in arg0) {
let tmp4 = key10007;
let callResult = "default" === key10007;
if (!callResult) {
let _Object = Object;
callResult = hasOwnProperty.call(arg1, key10007);
}
if (callResult) {
continue;
} else {
let tmp2 = self2;
let tmp3 = self2(arg1, arg0, key10007);
continue;
}
continue;
}
};
}
const _Object2 = Object;
let obj = { value: true };
fn(arg0("./attach"), arg2);
fn(arg0("./broadcast-to-child-windows"), arg2);
fn(arg0("./broadcast"), arg2);
fn(arg0("./constants"), arg2);
fn(arg0("./dispatch"), arg2);
fn(arg0("./has-opener"), arg2);
fn(arg0("./is-not-string"), arg2);
fn(arg0("./message"), arg2);
fn(arg0("./package-payload"), arg2);
fn(arg0("./send-message"), arg2);
fn(arg0("./subscribe-replier"), arg2);
fn(arg0("./subscription-args-invalid"), arg2);
fn(arg0("./types"), arg2);
fn(arg0("./unpack-payload"), arg2);
} else {
let _Object = Object;
}
},
{ "./attach": 51, "./broadcast": 53, "./broadcast-to-child-windows": 52, "./constants": 54, "./dispatch": 55, "./has-opener": 56, "./is-not-string": 58, "./message": 59, "./package-payload": 60, "./send-message": 61, "./subscribe-replier": 62, "./subscription-args-invalid": 63, "./types": 64, "./unpack-payload": 65 }
];
const items57 = [
(arg0, arg1, arg2) => {
arg2.isntString = function isntString(data) {
return "string" !== typeof data;
};
},
{}
];
const items58 = [
(arg0, arg1, arg2) => {
arg2.onMessage = undefined;
let closure_0 = arg0("./");
arg2.onMessage = function onMessage(data) {
let eventData;
let reply;
if (!closure_0.isntString(data.data)) {
const unpackPayloadResult = closure_0.unpackPayload(data);
if (unpackPayloadResult) {
({ eventData, reply } = unpackPayloadResult);
closure_0.dispatch("*", unpackPayloadResult.event, eventData, reply, data);
closure_0.dispatch(data.origin, unpackPayloadResult.event, eventData, reply, data);
const result = closure_0.broadcastToChildWindows(data.data, unpackPayloadResult.origin, data.source);
}
}
};
},
{ "./": 57 }
];
const items59 = [
(arg0, arg1, arg2) => {
arg2.packagePayload = undefined;
let closure_0 = arg0("./");
arg2.packagePayload = function packagePayload(namespaceEventResult, closure_0, eventData, eventData) {
const obj = { event: namespaceEventResult, origin: closure_0 };
if ("function" === typeof eventData) {
tmp.reply = closure_0.subscribeReplier(eventData, closure_0);
}
obj.eventData = eventData;
return closure_0.prefix + JSON.stringify(obj);
};
},
{ "./": 57 }
];
const items60 = [
(arg0, arg1, arg2) => {
arg2.sendMessage = function sendMessage(postMessage) {
postMessage.postMessage(arg1, arg2);
};
},
{}
];
const items61 = [
function(arg0, arg1, arg2) {
let fn = this;
if (this) {
fn = this.__importDefault;
}
if (!fn) {
fn = (__esModule) => {
if (!__esModule) {
const obj = { default: __esModule };
let tmp = obj;
} else {
tmp = __esModule;
}
return tmp;
};
}
arg2.subscribeReplier = undefined;
let closure_0 = arg0("../framebus");
let closure_1 = fn(arg0("@braintree/uuid"));
arg2.subscribeReplier = function subscribeReplier(eventData, origin) {
let Framebus = eventData;
let closure_1 = origin;
const defaultResult = closure_1.default();
Framebus = Framebus.Framebus;
function replier(arg0, arg1) {
eventData(arg0, arg1);
const Framebus = eventData.Framebus;
Framebus.target({ origin: closure_1 }).off(closure_2, replier);
}
Framebus.target({ origin }).on(defaultResult, replier);
return defaultResult;
};
},
{ "../framebus": 49, "@braintree/uuid": 66 }
];
const items62 = [
(arg0, arg1, arg2) => {
arg2.subscriptionArgsInvalid = undefined;
let closure_0 = arg0("./");
arg2.subscriptionArgsInvalid = function subscriptionArgsInvalid(namespaceEventResult, originalHandler, origin) {
const tmp = !closure_0.isntString(namespaceEventResult);
let tmp2 = !tmp;
if (tmp) {
let isntStringResult = "function" !== typeof originalHandler;
if (!isntStringResult) {
isntStringResult = closure_0.isntString(origin);
}
tmp2 = isntStringResult;
}
return tmp2;
};
},
{ "./": 57 }
];
const items63 = [
(arg0, arg1, arg2) => {
},
{}
];
const items64 = [
(arg0, arg1, arg2) => {
arg2.unpackPayload = undefined;
let closure_0 = arg0("./");
arg2.unpackPayload = function unpackPayload(data) {
let closure_0;
let closure_1;
data = data.data;
if (data.slice(0, closure_0.prefix.length) !== closure_0.prefix) {
return false;
} else {
const _JSON = JSON;
const data1 = tmp.data;
const parsed = JSON.parse(data1.slice(closure_0.prefix.length));
if (parsed.reply) {
({ origin: closure_0, source: closure_1 } = data);
const reply = parsed.reply;
parsed.reply = function reply(eventData) {
if (closure_1) {
const packagePayloadResult = outer1_0.packagePayload(reply, closure_0, eventData);
if (packagePayloadResult) {
closure_1.postMessage(packagePayloadResult, closure_0);
}
}
};
}
return parsed;
}
tmp = data;
};
},
{ "./": 57 }
];
const items65 = [
(arg0, arg1, arg2) => {
module.exports = function uuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (arg0) => {
const tmp = 16 * Math.random() | 0;
let str = tmp;
if ("x" !== arg0) {
str = 3 & tmp | 8;
}
return str.toString(16);
});
};
},
{}
];
const items66 = [
(arg0, arg1, arg2) => {
arg2.isKitKatWebview = undefined;
arg2.isAndroidChrome = undefined;
arg2.isSamsungBrowser = undefined;
arg2.isIE9 = undefined;
arg2.isIos = undefined;
let userAgent = "undefined" !== typeof window;
if (userAgent) {
const _window = window;
userAgent = window.navigator;
}
if (userAgent) {
const _window2 = window;
userAgent = window.navigator.userAgent;
}
let closure_1 = arg0("@braintree/browser-detection/is-android");
let closure_2 = arg0("@braintree/browser-detection/is-chrome-os");
let closure_3 = arg0("@braintree/browser-detection/is-chrome");
arg2.isIos = arg0("@braintree/browser-detection/is-ios");
arg2.isIE9 = arg0("@braintree/browser-detection/is-ie9");
const re4 = /Version\/\d\.\d* Chrome\/\d*\.0\.0\.0/;
arg2.isKitKatWebview = function isKitKatWebview(arg0) {
let tmp = arg0;
if (undefined === arg0) {
tmp = userAgent;
}
let isMatch = callback(tmp);
if (isMatch) {
isMatch = regex.test(tmp);
}
return isMatch;
};
arg2.isAndroidChrome = function isAndroidChrome(arg0) {
let tmp = arg0;
if (undefined === arg0) {
tmp = userAgent;
}
let tmp2 = callback(tmp);
if (!tmp2) {
tmp2 = callback2(tmp);
}
if (tmp2) {
tmp2 = callback3(tmp);
}
return tmp2;
};
arg2.isSamsungBrowser = function isSamsungBrowser(arg0) {
let arr = arg0;
if (undefined === arg0) {
arr = userAgent;
}
let isMatch = /SamsungBrowser/.test(arr);
if (!isMatch) {
let tmp3 = !callback3(arr);
if (tmp3) {
tmp3 = arr.indexOf("Samsung") > -1;
}
isMatch = tmp3;
}
return isMatch;
};
},
{ "@braintree/browser-detection/is-android": 80, "@braintree/browser-detection/is-chrome": 82, "@braintree/browser-detection/is-chrome-os": 81, "@braintree/browser-detection/is-ie9": 83, "@braintree/browser-detection/is-ios": 84 }
];
const items67 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./lib/device");
module.exports = function supportsInputFormatting() {
return !samsungBrowser.isSamsungBrowser();
};
},
{ "./lib/device": 67 }
];
const items68 = [
(arg0, arg1, arg2) => {
const first = arguments[4][3][0];
first(...arguments);
},
{ dup: 3 }
];
const items69 = [
(arg0, arg1, arg2) => {
const first = arguments[4][4][0];
first(...arguments);
},
{ dup: 4 }
];
const items70 = [
(arg0, arg1, arg2) => {
const first = arguments[4][5][0];
first(...arguments);
},
{ "./is-duckduckgo": 72, "./is-edge": 73, "./is-opera": 77, "./is-samsung": 78, "./is-silk": 79, dup: 5 }
];
const items71 = [
(arg0, arg1, arg2) => {
const first = arguments[4][6][0];
first(...arguments);
},
{ dup: 6 }
];
const items72 = [
(arg0, arg1, arg2) => {
const first = arguments[4][7][0];
first(...arguments);
},
{ dup: 7 }
];
const items73 = [
(arg0, arg1, arg2) => {
module.exports = function isIe9(arg0) {
let userAgent = arg0;
if (!arg0) {
const _window = window;
userAgent = window.navigator.userAgent;
}
return -1 !== userAgent.indexOf("MSIE 9");
};
},
{}
];
const items74 = [
(arg0, arg1, arg2) => {
const first = arguments[4][14][0];
first(...arguments);
},
{ "./is-ipados": 76, dup: 14 }
];
const items75 = [
(arg0, arg1, arg2) => {
const first = arguments[4][15][0];
first(...arguments);
},
{ dup: 15 }
];
const items76 = [
(arg0, arg1, arg2) => {
const first = arguments[4][16][0];
first(...arguments);
},
{ dup: 16 }
];
const items77 = [
(arg0, arg1, arg2) => {
const first = arguments[4][17][0];
first(...arguments);
},
{ dup: 17 }
];
const items78 = [
(arg0, arg1, arg2) => {
const first = arguments[4][18][0];
first(...arguments);
},
{ dup: 18 }
];
const items79 = [
(arg0, arg1, arg2) => {
const first = arguments[4][20][0];
first(...arguments);
},
{ "./dist/is-android": 69, dup: 20 }
];
const items80 = [
(arg0, arg1, arg2) => {
const first = arguments[4][21][0];
first(...arguments);
},
{ "./dist/is-chrome-os": 70, dup: 21 }
];
const items81 = [
(arg0, arg1, arg2) => {
const first = arguments[4][22][0];
first(...arguments);
},
{ "./dist/is-chrome": 71, dup: 22 }
];
const items82 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/is-ie9");
},
{ "./dist/is-ie9": 74 }
];
const items83 = [
(arg0, arg1, arg2) => {
const first = arguments[4][27][0];
first(...arguments);
},
{ "./dist/is-ios": 75, dup: 27 }
];
const items84 = [
(arg0, arg1, arg2) => {
module.exports = global("./dist/supports-input-formatting");
},
{ "./dist/supports-input-formatting": 68 }
];
const items85 = [
(arg0, arg1, arg2) => {
class AmericanExpress {
constructor(arg0) {
this._client = global.client;
return;
}
getRewardsBalance(arg0) {
nonce = global.nonce;
if (nonce) {
tmp11 = assign;
obj = {};
obj1 = {};
str2 = "american-express";
obj1.source = "american-express";
obj._meta = obj1;
obj.paymentMethodNonce = nonce;
tmp12 = assign(obj, global);
delete tmp.nonce;
self = this;
_client = this._client;
obj2 = { method: "get", endpoint: "payment_methods/amex_rewards_balance" };
obj2.data = tmp12;
requestResult = _client.request(obj2);
catchPromise = requestResult.catch((originalError) => {
obj = { type: outer1_1.AMEX_NETWORK_ERROR.type, code: outer1_1.AMEX_NETWORK_ERROR.code, message: "A network error occurred when getting the American Express rewards balance.", details: obj };
obj = { originalError };
return Promise.reject(new outer1_0(obj));
});
} else {
tmp2 = globalThis;
_Promise = Promise;
tmp3 = c0;
obj = {};
tmp4 = c1;
obj.type = c1.AMEX_NONCE_REQUIRED.type;
obj.code = c1.AMEX_NONCE_REQUIRED.code;
str = "getRewardsBalance must be called with a nonce.";
obj.message = "getRewardsBalance must be called with a nonce.";
prototype = c0.prototype;
tmp5 = new.target;
tmp6 = new.target;
tmp7 = obj;
tmp8 = new c0(obj);
tmp9 = tmp8;
catchPromise = Promise.reject(tmp8);
}
return catchPromise;
}
getExpressCheckoutProfile(arg0) {
if (global.nonce) {
self = this;
_client = this._client;
obj = {};
str2 = "get";
obj.method = "get";
str3 = "payment_methods/amex_express_checkout_cards/";
obj.endpoint = `payment_methods/amex_express_checkout_cards/${global.nonce}`;
obj1 = {};
obj2 = {};
str4 = "american-express";
obj2.source = "american-express";
obj1._meta = obj2;
obj1.paymentMethodNonce = global.nonce;
obj.data = obj1;
requestResult = _client.request(obj);
catchPromise = requestResult.catch((originalError) => {
obj = { type: outer1_1.AMEX_NETWORK_ERROR.type, code: outer1_1.AMEX_NETWORK_ERROR.code, message: "A network error occurred when getting the American Express Checkout nonce profile.", details: obj };
obj = { originalError };
return Promise.reject(new outer1_0(obj));
});
} else {
tmp = globalThis;
_Promise = Promise;
tmp2 = c0;
obj = {};
tmp3 = c1;
obj.type = c1.AMEX_NONCE_REQUIRED.type;
obj.code = c1.AMEX_NONCE_REQUIRED.code;
str = "getExpressCheckoutProfile must be called with a nonce.";
obj.message = "getExpressCheckoutProfile must be called with a nonce.";
prototype = c0.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c0(obj);
tmp8 = tmp7;
catchPromise = Promise.reject(tmp7);
}
return catchPromise;
}
teardown() {
tmp = c4(this, c3(AmericanExpress.prototype));
return Promise.resolve();
}
}
let closure_0 = global("../lib/braintree-error");
let closure_1 = global("./errors");
const assign = global("../lib/assign").assign;
let closure_3 = global("../lib/methods");
let closure_4 = global("../lib/convert-methods-to-error");
module.exports = global("@braintree/wrap-promise").wrapPrototype(AmericanExpress);
},
{ "../lib/assign": 140, "../lib/braintree-error": 143, "../lib/convert-methods-to-error": 146, "../lib/methods": 175, "./errors": 87, "@braintree/wrap-promise": 40 }
];
const items86 = [
(arg0, arg1, arg2) => {
const globalResult = global("../lib/braintree-error");
let obj = { type: globalResult.types.MERCHANT, code: "AMEX_NONCE_REQUIRED" };
obj = { type: globalResult.types.NETWORK, code: "AMEX_NETWORK_ERROR" };
module.exports = { AMEX_NONCE_REQUIRED: obj, AMEX_NETWORK_ERROR: obj };
},
{ "../lib/braintree-error": 143 }
];
const items87 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./american-express");
let closure_1 = global("../lib/basic-component-verification");
let closure_2 = global("../lib/create-deferred-client");
let closure_3 = global("../lib/create-assets-url");
module.exports = {
create: global("@braintree/wrap-promise")(function create(client) {
let closure_0 = client;
const obj = { name: "American Express", client: client.client, authorization: client.authorization };
const verifyResult = closure_1.verify({ name: "American Express", client: client.client, authorization: client.authorization });
return closure_1.verify({ name: "American Express", client: client.client, authorization: client.authorization }).then(() => outer1_2.create({ authorization: client.authorization, client: client.client, debug: client.debug, assetsUrl: outer1_3.create(client.authorization), name: "American Express" })).then((client) => {
closure_0.client = client;
return new closure_0(closure_0);
});
}),
VERSION: "3.112.1"
};
},
{ "../lib/basic-component-verification": 141, "../lib/create-assets-url": 148, "../lib/create-deferred-client": 150, "./american-express": 86, "@braintree/wrap-promise": 40 }
];
const items88 = [
(arg0, arg1, arg2) => {
class ApplePay {
constructor(arg0) {
self = this;
this._instantiatedWithClient = Boolean(!global.useDeferredClient);
({ client: this._client, createPromise: this._createPromise } = global);
if (this._client) {
result = self._setMerchantIdentifier();
}
return;
}
_waitForClient() {
self = this;
if (this._client) {
tmp2 = globalThis;
_Promise = Promise;
resolved = Promise.resolve();
} else {
_createPromise = self._createPromise;
fn = function(_client) {
this._client = _client;
const result = this._setMerchantIdentifier();
};
resolved = _createPromise.then(fn.bind(self));
}
return resolved;
}
_setMerchantIdentifier() {
_client = this._client;
applePayWeb = _client.getConfiguration().gatewayConfiguration.applePayWeb;
if (applePayWeb) {
tmp = globalThis;
_Object = Object;
obj = { value: null, configurable: false, writable: false };
obj.value = applePayWeb.merchantIdentifier;
str = "merchantIdentifier";
definePropertyResult = Object.defineProperty(this, "merchantIdentifier", obj);
}
return;
}
createPaymentRequest(arg0) {
self = this;
closure_0 = global;
if (this._instantiatedWithClient) {
result = self._createPaymentRequestSynchronously(global);
} else {
_waitForClientResult = self._waitForClient();
fn = function() {
return this._createPaymentRequestSynchronously(closure_0);
};
result = _waitForClientResult.then(fn.bind(self));
}
return result;
}
_createPaymentRequestSynchronously(arg0) {
_client = this._client;
applePayWeb = _client.getConfiguration().gatewayConfiguration.applePayWeb;
obj = {
countryCode: applePayWeb.countryCode,
currencyCode: applePayWeb.currencyCode,
merchantCapabilities: tmp,
supportedNetworks: supportedNetworks.map((arg0) => {
let str = "masterCard";
if ("mastercard" !== arg0) {
str = arg0;
}
return str;
})
};
tmp = applePayWeb.merchantCapabilities || ["supports3DS"];
supportedNetworks = applePayWeb.supportedNetworks;
return Object.assign({}, obj, global);
}
performValidation(arg0) {
self = this;
closure_0 = global;
self = this;
if (global) {
if (global.validationURL) {
_waitForClientResult = self._waitForClient();
nextPromise = _waitForClientResult.then(() => {
let obj = { validationUrl: validationURL.validationURL };
let hostname = validationURL.domainName;
if (!hostname) {
const _window = window;
hostname = window.location.hostname;
}
obj.domainName = hostname;
let merchantIdentifier = validationURL.merchantIdentifier;
if (!merchantIdentifier) {
merchantIdentifier = self.merchantIdentifier;
}
obj.merchantIdentifier = merchantIdentifier;
if (null != validationURL.displayName) {
obj.displayName = validationURL.displayName;
}
const _client = self._client;
obj = { method: "post", endpoint: "apple_pay_web/sessions" };
obj.data = { _meta: { source: "apple-pay" }, applePayWebSession: obj };
return _client.request(obj);
});
nextPromise1 = nextPromise.then((arg0) => {
self.sendEvent(self._client, "applepay.performValidation.succeeded");
return Promise.resolve(arg0);
});
catchPromise = nextPromise1.catch((code) => {
self.sendEvent(self._client, "applepay.performValidation.failed");
if ("CLIENT_REQUEST_ERROR" === code.code) {
let obj = { type: outer1_2.APPLE_PAY_MERCHANT_VALIDATION_FAILED.type, code: outer1_2.APPLE_PAY_MERCHANT_VALIDATION_FAILED.code, message: outer1_2.APPLE_PAY_MERCHANT_VALIDATION_FAILED.message };
obj = { originalError: code.details.originalError };
obj.details = obj;
const prototype2 = validationURL.prototype;
const tmp17 = new validationURL(obj);
let rejectResult = Promise.reject(tmp17);
} else {
obj = { type: outer1_2.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.type, code: outer1_2.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.code, message: outer1_2.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.message };
const obj1 = { originalError: code };
obj.details = obj1;
const prototype = validationURL.prototype;
const tmp8 = new validationURL(obj);
rejectResult = Promise.reject(tmp8);
}
return rejectResult;
});
}
return catchPromise;
}
tmp = new closure_0(c2.APPLE_PAY_VALIDATION_URL_REQUIRED);
catchPromise = Promise.reject(tmp);
return;
}
tokenize(arg0) {
self = this;
closure_0 = global;
self = this;
if (global.token) {
_waitForClientResult = self._waitForClient();
nextPromise = _waitForClientResult.then(() => {
const _client = self._client;
let obj = { method: "post", endpoint: "payment_methods/apple_payment_tokens" };
obj = { _meta: { source: "apple-pay" } };
obj = { paymentData: btoa(JSON.stringify(token.token.paymentData)) };
obj.applePaymentToken = Object.assign({}, token.token, obj);
obj.data = obj;
return _client.request(obj);
});
nextPromise1 = nextPromise.then((arg0) => {
self.sendEvent(self._client, "applepay.tokenize.succeeded");
return Promise.resolve(arg0.applePayCards[0]);
});
catchPromise = nextPromise1.catch((originalError) => {
self.sendEvent(self._client, "applepay.tokenize.failed");
obj = { type: outer1_2.APPLE_PAY_TOKENIZATION.type, code: outer1_2.APPLE_PAY_TOKENIZATION.code, message: outer1_2.APPLE_PAY_TOKENIZATION.message, details: obj };
obj = { originalError };
return Promise.reject(new closure_0(obj));
});
} else {
tmp = globalThis;
_Promise = Promise;
tmp2 = closure_0;
tmp3 = c2;
prototype = closure_0.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = new closure_0(c2.APPLE_PAY_PAYMENT_TOKEN_REQUIRED);
tmp7 = tmp6;
catchPromise = Promise.reject(tmp6);
}
return catchPromise;
}
teardown() {
tmp = c4(this, c3(ApplePay.prototype));
return Promise.resolve();
}
}
let closure_0 = global("../lib/braintree-error");
let closure_1 = global("../lib/analytics");
let closure_2 = global("./errors");
let closure_3 = global("../lib/methods");
let closure_4 = global("../lib/convert-methods-to-error");
module.exports = global("@braintree/wrap-promise").wrapPrototype(ApplePay);
},
{ "../lib/analytics": 138, "../lib/braintree-error": 143, "../lib/convert-methods-to-error": 146, "../lib/methods": 175, "./errors": 90, "@braintree/wrap-promise": 40 }
];
const items89 = [
(arg0, arg1, arg2) => {
const globalResult = global("../lib/braintree-error");
let obj = { type: globalResult.types.MERCHANT, code: "APPLE_PAY_NOT_ENABLED", message: "Apple Pay is not enabled for this merchant." };
obj = { type: globalResult.types.MERCHANT, code: "APPLE_PAY_VALIDATION_URL_REQUIRED", message: "performValidation must be called with a validationURL." };
obj = { type: globalResult.types.NETWORK, code: "APPLE_PAY_MERCHANT_VALIDATION_NETWORK", message: "A network error occurred when validating the Apple Pay merchant." };
const obj1 = { type: globalResult.types.MERCHANT, code: "APPLE_PAY_MERCHANT_VALIDATION_FAILED", message: "Make sure you have registered your domain name in the Braintree Control Panel." };
const obj2 = { type: globalResult.types.MERCHANT, code: "APPLE_PAY_PAYMENT_TOKEN_REQUIRED", message: "tokenize must be called with a payment token." };
const obj3 = { type: globalResult.types.NETWORK, code: "APPLE_PAY_TOKENIZATION", message: "A network error occurred when processing the Apple Pay payment." };
module.exports = { APPLE_PAY_NOT_ENABLED: obj, APPLE_PAY_VALIDATION_URL_REQUIRED: obj, APPLE_PAY_MERCHANT_VALIDATION_NETWORK: obj, APPLE_PAY_MERCHANT_VALIDATION_FAILED: obj1, APPLE_PAY_PAYMENT_TOKEN_REQUIRED: obj2, APPLE_PAY_TOKENIZATION: obj3 };
},
{ "../lib/braintree-error": 143 }
];
const items90 = [
(arg0, arg1, arg2) => {
let closure_0 = global("./apple-pay");
let closure_1 = global("../lib/analytics");
let closure_2 = global("../lib/braintree-error");
let closure_3 = global("../lib/basic-component-verification");
let closure_4 = global("../lib/create-assets-url");
let closure_5 = global("../lib/create-deferred-client");
let closure_6 = global("./errors");
module.exports = {
create: global("@braintree/wrap-promise")(function create(client) {
let closure_0 = client;
return closure_3.verify({ name: "Apple Pay", client: client.client, authorization: client.authorization }).then(() => {
let obj = { authorization: client.authorization, client: client.client, debug: client.debug, assetsUrl: outer1_4.create(client.authorization), name: "Apple Pay" };
obj = outer1_5.create(obj);
const nextPromise = obj.then((getConfiguration) => {
if (getConfiguration.getConfiguration().gatewayConfiguration.applePayWeb) {
outer2_1.sendEvent(getConfiguration, "applepay.initialized");
let rejectResult = getConfiguration;
} else {
const prototype = outer2_2.prototype;
const tmp6 = new outer2_2(outer2_6.APPLE_PAY_NOT_ENABLED);
rejectResult = Promise.reject(tmp6);
}
return rejectResult;
});
client.createPromise = nextPromise;
const tmp = new client(client);
let nextPromise1 = tmp;
client = tmp;
if (!client.useDeferredClient) {
nextPromise1 = nextPromise.then((_client) => {
closure_0._client = _client;
return closure_0;
});
}
return nextPromise1;
});
}),
VERSION: "3.112.1"
};
},
{ "../lib/analytics": 138, "../lib/basic-component-verification": 141, "../lib/braintree-error": 143, "../lib/create-assets-url": 148, "../lib/create-deferred-client": 150, "./apple-pay": 89, "./errors": 90, "@braintree/wrap-promise": 40 }
];
const items91 = [
(arg0, arg1, arg2) => {
class Client {
constructor(arg0) {
obj = global;
self = this;
if (!global) {
obj = {};
}
stringify = JSON.stringify(obj);
gatewayConfiguration = obj.gatewayConfiguration;
if (gatewayConfiguration) {
items = ["assetsUrl", "clientApiUrl", "configUrl"];
item = items.forEach((arg0) => {
if (arg0 in gatewayConfiguration) {
if (!outer1_3(gatewayConfiguration[arg0])) {
const obj = { type: outer1_13.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type, code: outer1_13.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code, message: `${arg0} property is on an invalid domain.` };
const prototype = outer1_4.prototype;
const tmp9 = new outer1_4(obj);
throw tmp9;
}
}
});
self.getConfiguration = () => JSON.parse(closure_0);
tmp8 = c2;
self._request = c2;
self._configuration = self.getConfiguration();
str = "/v1/";
self._clientApiBaseUrl = `${gatewayConfiguration.clientApiUrl}/v1/`;
if (gatewayConfiguration.graphQL) {
tmp9 = c3;
if (c3(gatewayConfiguration.graphQL.url)) {
tmp18 = gatewayConfiguration;
obj = {};
obj.graphQL = gatewayConfiguration.graphQL;
prototype3 = gatewayConfiguration.prototype;
tmp19 = new.target;
tmp20 = new.target;
tmp21 = obj;
tmp22 = new gatewayConfiguration(obj);
tmp23 = tmp22;
self._graphQL = tmp22;
} else {
tmp10 = c4;
obj1 = {};
tmp11 = c13;
obj1.type = c13.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type;
tmp12 = c13;
obj1.code = c13.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code;
str2 = "graphQL.url property is on an invalid domain.";
obj1.message = "graphQL.url property is on an invalid domain.";
prototype2 = c4.prototype;
tmp13 = new.target;
tmp14 = new.target;
tmp15 = obj1;
tmp16 = new c4(obj1);
tmp17 = tmp16;
throw tmp16;
}
}
return;
} else {
tmp = c4;
tmp2 = c13;
prototype = c4.prototype;
tmp3 = new.target;
tmp4 = new.target;
tmp5 = new c4(c13.CLIENT_MISSING_GATEWAY_CONFIGURATION);
tmp6 = tmp5;
throw tmp5;
}
}
static initialize(arg0) {
closure_0 = global;
tmp2 = FRAUDNET_URL[global.authorization];
if (tmp2) {
tmp12 = c12;
str2 = "custom.client.load.cached";
sendEventResult = c12.sendEvent(tmp2, "custom.client.load.cached");
return tmp2;
} else {
tmp3 = c7;
tmp4 = global;
tmp5 = c7(tmp.authorization);
tmp6 = getConfiguration;
tmp7 = tmp5;
promise = getConfiguration(tmp5, global.sessionId);
nextPromise = promise.then((arg0) => {
if (sessionId.debug) {
arg0.isDebug = true;
}
arg0.authorization = sessionId.authorization;
const tmp = new outer1_23(arg0);
let closure_1 = tmp;
return tmp;
});
tmp8 = nextPromise;
tmp9 = FRAUDNET_URL;
FRAUDNET_URL[global.authorization] = nextPromise;
tmp10 = c12;
str = "custom.client.load.initialized";
sendEventResult1 = c12.sendEvent(nextPromise, "custom.client.load.initialized");
nextPromise1 = nextPromise.then((arg0) => {
outer1_12.sendEvent(closure_1, "custom.client.load.succeeded");
return arg0;
});
return nextPromise1.catch((arg0) => {
delete tmp2[tmp];
return Promise.reject(arg0);
});
}
}
static clearCache() {
FRAUDNET_URL = {};
return;
}
_findOrCreateFraudnetJSON(arg0) {
self = this;
element = document.querySelector(`script[fncls="${FRAUDNET_FNCLS}"]`);
if (!element) {
_document = document;
body = document.body;
_document2 = document;
str = "script";
appendChildResult = body.appendChild(document.createElement("script"));
str2 = "application/json";
appendChildResult.type = "application/json";
tmp2 = FRAUDNET_FNCLS;
str3 = "fncls";
attr = appendChildResult.setAttribute("fncls", FRAUDNET_FNCLS);
element = appendChildResult;
}
configuration = self.getConfiguration();
obj = { rda_tenant: "bt_card", mid: configuration.gatewayConfiguration.merchantId };
getConfiguration = obj;
str4 = configuration.authorizationFingerprint;
if (str4) {
str5 = "&";
parts = str4.split("&");
item = parts.forEach((str) => {
const parts = str.split("=");
let tmp = "customer_id" === parts[0];
if (tmp) {
tmp = parts.length > 1;
}
if (tmp) {
obj.cid = parts[1];
}
});
}
obj1 = { f: global.substr(0, 32), fp: obj, bu: false, s: FRAUDNET_SOURCE };
element.text = JSON.stringify(obj1);
return;
}
request(arg0, arg1) {
closure_0 = global;
closure_1 = module;
self = this;
promise = new Promise((arg0, arg1) => {
const config = arg0;
let closure_1 = arg1;
let collectDeviceData = "payment_methods/credit_cards" === config.endpoint;
if (collectDeviceData) {
collectDeviceData = str5.getConfiguration().gatewayConfiguration.creditCards.collectDeviceData;
}
let closure_3 = Boolean(collectDeviceData);
let tmp2;
if ("graphQLApi" !== config.api) {
let str = "options.method";
if (config.method) {
let str2;
if (!config.endpoint) {
str2 = "options.endpoint";
}
str = str2;
}
tmp2 = str;
}
if (tmp2) {
let obj = { type: outer1_13.CLIENT_OPTION_REQUIRED.type, code: outer1_13.CLIENT_OPTION_REQUIRED.code, message: `${tmp2} is required when making a request.` };
let prototype2 = outer1_4.prototype;
let tmp31 = new outer1_4(obj);
throw tmp31;
} else {
str5 = "clientApi";
if ("api" in config) {
str5 = config.api;
}
obj = { method: config.method, graphQL: str5._graphQL, timeout: config.timeout, metadata: str5._configuration.analyticsMetadata };
if ("clientApi" === str5) {
let _clientApiBaseUrl = str5._clientApiBaseUrl;
obj.data = outer1_8.addMetadata(str5._configuration, config.data);
} else if ("graphQLApi" !== str5) {
obj = { type: outer1_13.CLIENT_OPTION_INVALID.type, code: outer1_13.CLIENT_OPTION_INVALID.code, message: "options.api is invalid." };
let prototype = outer1_4.prototype;
const tmp17 = new outer1_4(obj);
throw tmp17;
} else {
_clientApiBaseUrl = outer1_15[str5._configuration.gatewayConfiguration.environment];
config.endpoint = "";
obj.method = "post";
let obj1 = {};
const obj2 = { platform: str5._configuration.analyticsMetadata.platform, source: str5._configuration.analyticsMetadata.source, integration: str5._configuration.analyticsMetadata.integration, sessionId: str5._configuration.analyticsMetadata.sessionId, version: outer1_14 };
obj1.clientSdkMetadata = obj2;
obj.data = outer1_11(obj1, config.data);
const _configuration = str5._configuration;
const obj3 = { Authorization: `Bearer ${_configuration.authorizationFingerprint || _configuration.authorization}`, "Braintree-Version": config };
obj.headers = obj3;
const tmp9 = _configuration.authorizationFingerprint || _configuration.authorization;
}
obj.url = _clientApiBaseUrl + config.endpoint;
obj.sendAnalyticsEvent = (arg0) => {
outer2_12.sendEvent(str5, arg0);
};
str5._request(obj, (arg0, errors, httpStatus) => {
if (-1 === httpStatus) {
const prototype5 = outer2_4.prototype;
let tmp2 = new outer2_4(outer2_13.CLIENT_REQUEST_TIMEOUT);
} else if (401 === httpStatus) {
const prototype4 = outer2_4.prototype;
tmp2 = new outer2_4(outer2_13.CLIENT_AUTHORIZATION_INVALID);
} else if (403 === httpStatus) {
const prototype3 = outer2_4.prototype;
tmp2 = new outer2_4(outer2_13.CLIENT_AUTHORIZATION_INSUFFICIENT);
} else if (429 === httpStatus) {
const prototype2 = outer2_4.prototype;
tmp2 = new outer2_4(outer2_13.CLIENT_RATE_LIMITED);
} else if (httpStatus >= 500) {
const prototype = outer2_4.prototype;
tmp2 = new outer2_4(outer2_13.CLIENT_GATEWAY_NETWORK);
} else {
let tmp = httpStatus < 200;
if (!tmp) {
tmp = httpStatus >= 400;
}
if (tmp) {
let obj = { type: outer2_13.CLIENT_REQUEST_ERROR.type, code: outer2_13.CLIENT_REQUEST_ERROR.code, message: outer2_13.CLIENT_REQUEST_ERROR.message };
tmp2 = outer2_5(arg0, obj);
}
}
let tmp28;
if (tmp2) {
tmp2.details = tmp2.details || {};
tmp2.details.httpStatus = httpStatus;
tmp28 = tmp2;
}
if (tmp28) {
callback2(tmp28);
} else {
if ("graphQLApi" === str5) {
if (errors.errors) {
obj = { type: outer2_13.CLIENT_GRAPHQL_REQUEST_ERROR.type, code: outer2_13.CLIENT_GRAPHQL_REQUEST_ERROR.code, message: outer2_13.CLIENT_GRAPHQL_REQUEST_ERROR.message };
callback2(outer2_5(errors.errors, obj));
}
}
obj = { _httpStatus: httpStatus };
const tmp31 = outer2_11(obj, errors);
let creditCards = closure_3;
if (closure_3) {
creditCards = tmp31.creditCards;
}
if (creditCards) {
creditCards = tmp31.creditCards.length > 0;
}
if (creditCards) {
const result = str5._findOrCreateFraudnetJSON(tmp31.creditCards[0].nonce);
const obj1 = { src: outer2_21, forceScriptReload: true };
const script = outer2_18.loadScript(obj1);
}
callback(tmp31);
}
});
}
});
tmp = promise;
if ("function" === typeof module) {
tmp2 = c9;
tmp3 = c10;
closure_1 = c9(c10(module));
nextPromise = promise.then((_httpStatus) => {
callback(null, _httpStatus, _httpStatus._httpStatus);
});
catchPromise = nextPromise.catch((details) => {
let httpStatus = details;
if (details) {
httpStatus = details.details;
}
if (httpStatus) {
httpStatus = details.details.httpStatus;
}
callback(details, null, httpStatus);
});
}
return tmp;
}
toJSON() {
return this.getConfiguration();
}
getVersion() {
return VERSION;
}
}
const BRAINTREE_VERSION = global("./constants").BRAINTREE_VERSION;
let closure_1 = global("./request/graphql");
let closure_2 = global("./request");
let closure_3 = global("../lib/is-verified-domain");
let closure_4 = global("../lib/braintree-error");
let closure_5 = global("../lib/convert-to-braintree-error");
const getConfiguration = global("./get-configuration").getConfiguration;
let closure_7 = global("../lib/create-authorization-data");
let closure_8 = global("../lib/add-metadata");
let closure_9 = global("../lib/once");
let closure_10 = global("../lib/deferred");
const assign = global("../lib/assign").assign;
let closure_12 = global("../lib/analytics");
let closure_13 = global("./errors");
const VERSION = global("../lib/constants").VERSION;
const GRAPHQL_URLS = global("../lib/constants").GRAPHQL_URLS;
let closure_16 = global("../lib/methods");
let closure_17 = global("../lib/convert-methods-to-error");
let closure_18 = global("../lib/assets");
const FRAUDNET_FNCLS = global("../lib/constants").FRAUDNET_FNCLS;
const FRAUDNET_SOURCE = global("../lib/constants").FRAUDNET_SOURCE;
const FRAUDNET_URL = global("../lib/constants").FRAUDNET_URL;
let closure_22 = {};
Client.prototype.teardown = global("@braintree/wrap-promise")(function() {
const authorization = this.getConfiguration().authorization;
delete tmp2[tmp];
callback6(this, callback5(Client.prototype));
return Promise.resolve();
});
module.exports = Client;
},
{ "../lib/add-metadata": 137, "../lib/analytics": 138, "../lib/assets": 139, "../lib/assign": 140, "../lib/braintree-error": 143, "../lib/constants": 145, "../lib/convert-methods-to-error": 146, "../lib/convert-to-braintree-error": 147, "../lib/create-authorization-data": 149, "../lib/deferred": 151, "../lib/is-verified-domain": 173, "../lib/methods": 175, "../lib/once": 176, "./constants": 93, "./errors": 94, "./get-configuration": 95, "./request": 108, "./request/graphql": 106, "@braintree/wrap-promise": 40 }
];
const items92 = [
(arg0, arg1, arg2) => {
module.exports = { BRAINTREE_VERSION: "2018-05-10" };
},
{}
];
const items93 = [
(arg0, arg1, arg2) => {
const globalResult = global("../lib/braintree-error");
let obj = { type: globalResult.types.MERCHANT, code: "CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN" };
obj = { type: globalResult.types.MERCHANT, code: "CLIENT_OPTION_REQUIRED" };
obj = { type: globalResult.types.MERCHANT, code: "CLIENT_OPTION_INVALID" };
const obj1 = { type: globalResult.types.INTERNAL, code: "CLIENT_MISSING_GATEWAY_CONFIGURATION", message: "Missing gatewayConfiguration." };
const obj2 = { type: globalResult.types.MERCHANT, code: "CLIENT_INVALID_AUTHORIZATION", message: "Authorization is invalid. Make sure your client token or tokenization key is valid." };
const obj3 = { type: globalResult.types.NETWORK, code: "CLIENT_GATEWAY_NETWORK", message: "Cannot contact the gateway at this time." };
const obj4 = { type: globalResult.types.NETWORK, code: "CLIENT_REQUEST_TIMEOUT", message: "Request timed out waiting for a reply." };
const obj5 = { type: globalResult.types.NETWORK, code: "CLIENT_REQUEST_ERROR", message: "There was a problem with your request." };
const obj6 = { type: globalResult.types.NETWORK, code: "CLIENT_GRAPHQL_REQUEST_ERROR", message: "There was a problem with your request." };
const obj7 = { type: globalResult.types.MERCHANT, code: "CLIENT_RATE_LIMITED", message: "You are being rate-limited; please try again in a few minutes." };
const obj8 = { type: globalResult.types.MERCHANT, code: "CLIENT_AUTHORIZATION_INSUFFICIENT", message: "The authorization used has insufficient privileges." };
const obj9 = { type: globalResult.types.MERCHANT, code: "CLIENT_AUTHORIZATION_INVALID", message: "Either the client token has expired and a new one should be generated or the tokenization key has been deactivated or deleted." };
module.exports = { CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN: obj, CLIENT_OPTION_REQUIRED: obj, CLIENT_OPTION_INVALID: obj, CLIENT_MISSING_GATEWAY_CONFIGURATION: obj1, CLIENT_INVALID_AUTHORIZATION: obj2, CLIENT_GATEWAY_NETWORK: obj3, CLIENT_REQUEST_TIMEOUT: obj4, CLIENT_REQUEST_ERROR: obj5, CLIENT_GRAPHQL_REQUEST_ERROR: obj6, CLIENT_RATE_LIMITED: obj7, CLIENT_AUTHORIZATION_INSUFFICIENT: obj8, CLIENT_AUTHORIZATION_INVALID: obj9 };
},
{ "../lib/braintree-error": 143 }
];
const items94 = [
(arg0, arg1, arg2) => {
let closure_0 = global("../lib/braintree-error");
let closure_1 = global("./request");
let closure_2 = global("@braintree/uuid");
let closure_3 = global("../lib/constants");
let closure_4 = global("./errors");
let closure_5 = global("./request/graphql");
const GRAPHQL_URLS = global("../lib/constants").GRAPHQL_URLS;
let closure_7 = global("../lib/is-date-string-before-or-on");
const BRAINTREE_VERSION = global("./constants").BRAINTREE_VERSION;
const globalResult = global("@braintree/wrap-promise");
module.exports = {
getConfiguration: global("@braintree/wrap-promise")(function getConfiguration(arg0, sessionId) {
let closure_0 = arg0;
let closure_1 = sessionId;
return new Promise((arg0, arg1) => {
let closure_0 = arg0;
const sessionId = arg1;
let tmp = sessionId;
if (!sessionId) {
tmp = outer1_2();
}
let obj = { merchantAppId: window.location.host, platform: outer1_3.PLATFORM, sdkVersion: outer1_3.VERSION, source: outer1_3.SOURCE, integration: outer1_3.INTEGRATION, integrationType: outer1_3.INTEGRATION, sessionId: tmp };
const attrs = closure_0.attrs;
attrs._meta = obj;
attrs.braintreeLibraryVersion = outer1_3.BRAINTREE_LIBRARY_VERSION;
attrs.configVersion = "3";
obj = { url: closure_0.configUrl, method: "GET", data: attrs };
if (attrs.authorizationFingerprint) {
if (closure_0.graphQL) {
if (outer1_7(closure_0.graphQL.date, outer1_8)) {
obj = {};
const obj1 = { url: closure_0.graphQL.url, features: ["configuration"] };
obj.graphQL = obj1;
const prototype2 = outer1_5.prototype;
const tmp20 = new outer1_5(obj);
obj.graphQL = tmp20;
}
obj.metadata = obj;
}
sessionId(obj, (originalError, gatewayConfiguration) => {
if (originalError) {
if (403 === arg2) {
let CLIENT_GATEWAY_NETWORK = outer2_4.CLIENT_AUTHORIZATION_INSUFFICIENT;
} else if (401 === arg2) {
CLIENT_GATEWAY_NETWORK = outer2_4.CLIENT_AUTHORIZATION_INVALID;
} else {
CLIENT_GATEWAY_NETWORK = outer2_4.CLIENT_GATEWAY_NETWORK;
}
let obj = {};
({ type: obj2.type, code: obj2.code, message: obj2.message } = CLIENT_GATEWAY_NETWORK);
obj = { originalError };
obj.details = obj;
const prototype = lib.prototype;
const tmp15 = new lib(obj);
callback(tmp15);
} else {
obj = {};
let str = "CLIENT_TOKEN";
if (attrs.tokenizationKey) {
str = "TOKENIZATION_KEY";
}
obj.authorizationType = str;
obj.authorizationFingerprint = attrs.authorizationFingerprint;
obj.analyticsMetadata = obj;
obj.gatewayConfiguration = gatewayConfiguration;
lib(obj);
}
});
}
if (attrs.tokenizationKey) {
const obj2 = {};
const obj3 = { url: outer1_6[closure_0.environment], features: ["configuration"] };
obj2.graphQL = obj3;
let prototype = outer1_5.prototype;
const tmp10 = new outer1_5(obj2);
obj.graphQL = tmp10;
obj.metadata = obj;
}
});
})
};
},
{ "../lib/braintree-error": 143, "../lib/constants": 145, "../lib/is-date-string-before-or-on": 170, "./constants": 93, "./errors": 94, "./request": 108, "./request/graphql": 106, "@braintree/uuid": 36, "@braintree/wrap-promise": 40 }
];
const items95 = [
(arg0, arg1, arg2) => {
let closure_0 = global("../lib/braintree-error");
let closure_1 = global("./client");
let closure_2 = global("../lib/errors");
const globalResult = global("@braintree/wrap-promise");
module.exports = {
create: global("@braintree/wrap-promise")(function create(authorization) {
if (authorization.authorization) {
let initializeResult = closure_1.initialize(authorization);
} else {
const obj = { type: constants.INSTANTIATION_OPTION_REQUIRED.type, code: constants.INSTANTIATION_OPTION_REQUIRED.code, message: "options.authorization is required when instantiating a client." };
const prototype = ctor.prototype;
const tmp7 = new ctor(obj);
initializeResult = Promise.reject(tmp7);
}
return initializeResult;
}),
VERSION: "3.112.1"
};
},
{ "../lib/braintree-error": 143, "../lib/errors": 154, "./client": 92, "@braintree/wrap-promise": 40 }
];
const items96 = [
(arg0, arg1, arg2) => {
function _requestWithRetry(timeout, arg1, arg2) {
let graphQL;
let url;
let closure_0 = timeout;
const assign = arg1;
const callback = arg2;
({ url, graphQL } = timeout);
const requestObject = globalResult.getRequestObject();
let closure_9 = arg2;
let isGraphQLRequestResult = graphQL;
if (graphQL) {
isGraphQLRequestResult = graphQL.isGraphQLRequest(url, tmp.data);
}
const BooleanResult = Boolean(isGraphQLRequestResult);
timeout.headers = assign({ "Content-Type": "application/json" }, timeout.headers);
if (BooleanResult) {
const prototype2 = headers.prototype;
let obj2 = new headers(tmp);
} else {
const prototype = ctor.prototype;
obj2 = new ctor(tmp);
}
url = obj2.getUrl();
let body = obj2.getBody();
const method = obj2.getMethod();
headers = obj2.getHeaders();
if ("GET" === method) {
url = closure_0.queryify(url, body);
body = null;
}
if (obj2) {
obj.onreadystatechange = () => {
if (4 === requestObject.readyState) {
if (0 === requestObject.status) {
if (closure_10) {
delete tmp.graphQL;
requestObject(closure_0, closure_1, closure_2);
}
}
const data = outer1_3(requestObject.responseText);
let closure_4 = obj2.adaptResponseBody(data);
const determineStatusResult = obj2.determineStatus(requestObject.status, data);
if (determineStatusResult < 400) {
if (determineStatusResult >= 200) {
callback(null, closure_4, determineStatusResult);
}
}
if (closure_10) {
const tmp18 = !data.data && data.errors && data.errors[0] && data.errors[0].extensions && data.errors[0].extensions.errorClass;
let tmp19 = "UNKNOWN" === tmp18;
if (!tmp19) {
tmp19 = "INTERNAL" === tmp18;
}
if (tmp19) {
delete tmp.graphQL;
requestObject(closure_0, closure_1, closure_2);
}
}
if (closure_1 < 1) {
let tmp22 = !determineStatusResult;
if (!tmp22) {
tmp22 = 408 === tmp21;
}
if (tmp22) {
const sum = closure_1 + 1;
closure_1 = sum;
requestObject(closure_0, sum, closure_2);
}
}
let str3 = closure_4;
if (!closure_4) {
str3 = "error";
}
let num5 = determineStatusResult;
if (!determineStatusResult) {
num5 = 500;
}
callback(str3, null, num5);
const tmp23 = callback;
}
};
} else {
if (tmp.headers) {
url = closure_0.queryify(url, headers);
}
obj.onload = () => {
callback(null, outer1_3(requestObject.responseText), requestObject.status);
};
obj.onerror = () => {
callback("error", null, 500);
};
obj.onprogress = () => {
};
obj.ontimeout = () => {
callback("timeout", null, -1);
};
}
requestObject.open(method, url, true);
requestObject.timeout = timeout.timeout;
if (obj2) {
const _Object = Object;
const keys = Object.keys(headers);
const item = keys.forEach((baggage) => {
requestObject.setRequestHeader(baggage, headers[baggage]);
});
}
requestObject.send(callback(method, body));
}
let closure_0 = global("../../lib/querystring");
let assign = global("../../lib/assign").assign;
let closure_2 = global("./prep-body");
let closure_3 = global("./parse-body");
const globalResult = global("./xhr");
const isAvailable = globalResult.isAvailable;
let closure_6 = global("./graphql/request");
let closure_7 = global("./default-request");
module.exports = {
request(timeout) {
_requestWithRetry(timeout, 0, arg1);
}
};
},
{ "../../lib/assign": 140, "../../lib/querystring": 177, "./default-request": 98, "./graphql/request": 107, "./parse-body": 109, "./prep-body": 110, "./xhr": 111 }
];
const items97 = [
(arg0, arg1, arg2) => {
class DefaultRequest {
constructor(arg0) {
({ url: this._url, data: this._data, method: this._method, headers: this._headers } = global);
return;
}
getUrl() {
return this._url;
}
getBody() {
return this._data;
}
getMethod() {
return this._method;
}
getHeaders() {
return this._headers;
}
adaptResponseBody(arg0) {
return global;
}
determineStatus(arg0) {
return global;
}
}
module.exports = DefaultRequest;
},
{}
];
const items98 = [
(arg0, arg1, arg2) => {
function mapCardTypes(arr) {
let closure_0 = arg1;
return arr.reduce((arr) => {
let combined = arr;
if (closure_0.hasOwnProperty(arg1)) {
combined = arr.concat(closure_0[arg1]);
}
return combined;
}, []);
}
let closure_0 = global("./error");
const assign = global("../../../../lib/assign").assign;
let closure_2 = { AMERICAN_EXPRESS: "American Express", DISCOVER: "Discover", INTERNATIONAL_MAESTRO: "Maestro", JCB: "JCB", MASTERCARD: "MasterCard", SOLO: "Solo", UK_MAESTRO: "UK Maestro", UNION_PAY: "UnionPay", VISA: "Visa", ELO: "Elo", HIPER: "Hiper", HIPERCARD: "Hipercard" };
let closure_3 = { VISA: "visa", MASTERCARD: "mastercard", DISCOVER: "discover", AMERICAN_EXPRESS: "amex", INTERNATIONAL_MAESTRO: "maestro", ELO: "elo" };
let closure_4 = { VISA: "Visa", MASTERCARD: "MasterCard", DISCOVER: "Discover", AMERICAN_EXPRESS: "American Express" };
let closure_5 = { VISA: "visa", MASTERCARD: "mastercard", DISCOVER: "discover", AMERICAN_EXPRESS: "amex", INTERNATIONAL_MAESTRO: "maestro", ELO: "elo" };
let closure_6 = { VISA: "visa", MASTERCARD: "master", DISCOVER: "discover", AMERICAN_EXPRESS: "amex", DINERS: "diners", INTERNATIONAL_MAESTRO: "maestro", JCB: "jcb" };
module.exports = function configurationResponseAdapter(data, _graphQL) {
if (data.data) {
if (!data.errors) {
let tmp2 = (function adaptConfigurationResponseBody(data, _graphQL) {
const clientConfiguration = data.data.clientConfiguration;
obj = { environment: str.toLowerCase(), clientApiUrl: clientConfiguration.clientApiUrl, assetsUrl: clientConfiguration.assetsUrl, analytics: obj, merchantId: clientConfiguration.merchantId, venmo: "off" };
obj = { url: clientConfiguration.analyticsUrl };
if (clientConfiguration.supportedFeatures) {
obj = { url: _graphQL._graphQL._config.url };
const supportedFeatures = clientConfiguration.supportedFeatures;
obj.features = supportedFeatures.map((str) => str.toLowerCase());
obj.graphQL = obj;
}
if (clientConfiguration.braintreeApi) {
obj.braintreeApi = clientConfiguration.braintreeApi;
}
if (clientConfiguration.applePayWeb) {
obj.applePayWeb = clientConfiguration.applePayWeb;
obj.applePayWeb.supportedNetworks = outer1_7(clientConfiguration.applePayWeb.supportedCardBrands, outer1_3);
const applePayWeb = obj.applePayWeb;
delete tmp2.supportedCardBrands;
}
if (clientConfiguration.fastlane) {
obj.fastlane = clientConfiguration.fastlane;
}
if (clientConfiguration.ideal) {
obj.ideal = clientConfiguration.ideal;
}
if (clientConfiguration.kount) {
const obj1 = { kountMerchantId: clientConfiguration.kount.merchantId };
obj.kount = obj1;
}
if (clientConfiguration.creditCard) {
const challenges = clientConfiguration.creditCard.challenges;
obj.challenges = challenges.map((str) => str.toLowerCase());
const obj2 = { supportedCardTypes: outer1_7(clientConfiguration.creditCard.supportedCardBrands, outer1_2) };
obj.creditCards = obj2;
obj.threeDSecureEnabled = clientConfiguration.creditCard.threeDSecureEnabled;
obj.threeDSecure = clientConfiguration.creditCard.threeDSecure;
} else {
obj.challenges = [];
const obj3 = { supportedCardTypes: [] };
obj.creditCards = obj3;
obj.threeDSecureEnabled = false;
}
if (clientConfiguration.googlePay) {
const obj4 = { displayName: clientConfiguration.googlePay.displayName, enabled: true, environment: clientConfiguration.googlePay.environment.toLowerCase(), googleAuthorizationFingerprint: clientConfiguration.googlePay.googleAuthorization, paypalClientId: clientConfiguration.googlePay.paypalClientId, supportedNetworks: outer1_7(clientConfiguration.googlePay.supportedCardBrands, outer1_5) };
obj.androidPay = obj4;
const str2 = clientConfiguration.googlePay.environment;
}
if (clientConfiguration.venmo) {
const obj5 = { merchantId: clientConfiguration.venmo.merchantId, accessToken: clientConfiguration.venmo.accessToken, environment: clientConfiguration.venmo.environment.toLowerCase(), enrichedCustomerDataEnabled: clientConfiguration.venmo.enrichedCustomerDataEnabled };
obj.payWithVenmo = obj5;
const str3 = clientConfiguration.venmo.environment;
}
if (clientConfiguration.paypal) {
obj.paypalEnabled = true;
obj.paypal = outer1_1({}, clientConfiguration.paypal);
obj.paypal.currencyIsoCode = obj.paypal.currencyCode;
obj.paypal.environment = obj.paypal.environment.toLowerCase();
const paypal = obj.paypal;
delete tmp.currencyCode;
const str4 = obj.paypal.environment;
} else {
obj.paypalEnabled = false;
}
if (clientConfiguration.unionPay) {
const obj6 = { enabled: true, merchantAccountId: clientConfiguration.unionPay.merchantAccountId };
obj.unionPay = obj6;
}
if (clientConfiguration.visaCheckout) {
const obj7 = { apikey: clientConfiguration.visaCheckout.apiKey, encryptionKey: clientConfiguration.visaCheckout.encryptionKey, externalClientId: clientConfiguration.visaCheckout.externalClientId, supportedCardTypes: outer1_7(clientConfiguration.visaCheckout.supportedCardBrands, outer1_4) };
obj.visaCheckout = obj7;
}
if (clientConfiguration.masterpass) {
const obj8 = { merchantCheckoutId: clientConfiguration.masterpass.merchantCheckoutId, supportedNetworks: outer1_7(clientConfiguration.masterpass.supportedCardBrands, outer1_6) };
obj.masterpass = obj8;
}
if (clientConfiguration.usBankAccount) {
const obj9 = { routeId: clientConfiguration.usBankAccount.routeId };
const obj10 = { publicKey: clientConfiguration.usBankAccount.plaidPublicKey };
obj9.plaid = obj10;
obj.usBankAccount = obj9;
}
return obj;
})(data, _graphQL);
}
return tmp2;
}
tmp2 = callback(data);
};
},
{ "../../../../lib/assign": 140, "./error": 102 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("./error");
let closure_1 = { AMERICAN_EXPRESS: "American Express", DINERS: "Discover", DISCOVER: "Discover", ELO: "Elo", HIPER: "Hiper", HIPERCARD: "Hipercard", INTERNATIONAL_MAESTRO: "Maestro", JCB: "JCB", MASTERCARD: "MasterCard", UK_MAESTRO: "Maestro", UNION_PAY: "UnionPay", VISA: "Visa" };
let closure_2 = { YES: "Yes", NO: "No", UNKNOWN: "Unknown" };
let closure_3 = { PSDTWO: "psd2" };
module.exports = function creditCardTokenizationFastlaneResponseAdapter(data) {
if (data.data) {
if (!data.errors) {
let tmp = (function adaptTokenizeCreditCardForFastlaneResponseBody(data) {
const tokenizeCreditCardForPayPalConnect = data.data.tokenizeCreditCardForPayPalConnect;
const details = tokenizeCreditCardForPayPalConnect.paymentMethod.details;
let str = "";
if (details.last4) {
str = details.last4.substr(2, 4);
const str2 = details.last4;
}
const binData = details.binData;
if (binData) {
const items = ["commercial", "debit", "durbinRegulated", "healthcare", "payroll", "prepaid"];
const item = items.forEach((arg0) => {
if (binData[arg0]) {
tmp[arg0] = outer2_2[tmp[arg0]];
} else {
tmp[arg0] = "Unknown";
}
});
const items1 = ["issuingBank", "countryOfIssuance", "productId"];
const item1 = items1.forEach((arg0) => {
if (!binData[arg0]) {
binData[arg0] = "Unknown";
}
});
}
let obj = {};
obj = { binData, consumed: false };
let str3 = "";
if (str) {
str3 = `ending in ${str}`;
}
obj.description = str3;
obj.nonce = tokenizeCreditCardForPayPalConnect.paymentMethod.id;
obj = { cardholderName: details.cardholderName, expirationMonth: details.expirationMonth, expirationYear: details.expirationYear, bin: tmp3, cardType: tmp4, lastFour: tmp5, lastTwo: str };
obj.details = obj;
obj.type = "CreditCard";
obj.threeDSecureInfo = null;
const items2 = [obj];
obj.creditCards = items2;
if (tokenizeCreditCardForPayPalConnect.authenticationInsight) {
const obj1 = {};
let formatted = outer1_3[str5];
if (!formatted) {
formatted = str5.toLowerCase();
}
obj1.regulationEnvironment = formatted;
obj.creditCards[0].authenticationInsight = obj1;
}
return obj;
})(data);
}
return tmp;
}
tmp = callback(data);
};
},
{ "./error": 102 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("./error");
let closure_1 = { AMERICAN_EXPRESS: "American Express", DINERS: "Discover", DISCOVER: "Discover", ELO: "Elo", HIPER: "Hiper", HIPERCARD: "Hipercard", INTERNATIONAL_MAESTRO: "Maestro", JCB: "JCB", MASTERCARD: "MasterCard", UK_MAESTRO: "Maestro", UNION_PAY: "UnionPay", VISA: "Visa" };
let closure_2 = { YES: "Yes", NO: "No", UNKNOWN: "Unknown" };
let closure_3 = { PSDTWO: "psd2" };
module.exports = function creditCardTokenizationResponseAdapter(data) {
if (data.data) {
if (!data.errors) {
let tmp = (function adaptTokenizeCreditCardResponseBody(data) {
const tokenizeCreditCard = data.data.tokenizeCreditCard;
const creditCard = tokenizeCreditCard.creditCard;
let str = "";
if (creditCard.last4) {
str = creditCard.last4.substr(2, 4);
const str2 = creditCard.last4;
}
const binData = creditCard.binData;
if (binData) {
const items = ["commercial", "debit", "durbinRegulated", "healthcare", "payroll", "prepaid"];
const item = items.forEach((arg0) => {
if (binData[arg0]) {
tmp[arg0] = outer2_2[tmp[arg0]];
} else {
tmp[arg0] = "Unknown";
}
});
const items1 = ["issuingBank", "countryOfIssuance", "productId"];
const item1 = items1.forEach((arg0) => {
if (!binData[arg0]) {
binData[arg0] = "Unknown";
}
});
}
let obj = {};
obj = { binData, consumed: false };
let str3 = "";
if (str) {
str3 = `ending in ${str}`;
}
obj.description = str3;
obj.nonce = tokenizeCreditCard.token;
obj = { cardholderName: creditCard.cardholderName, expirationMonth: creditCard.expirationMonth, expirationYear: creditCard.expirationYear, bin: tmp3, cardType: tmp4, lastFour: tmp5, lastTwo: str };
obj.details = obj;
obj.type = "CreditCard";
obj.threeDSecureInfo = null;
const items2 = [obj];
obj.creditCards = items2;
if (tokenizeCreditCard.authenticationInsight) {
const obj1 = {};
let formatted = outer1_3[str5];
if (!formatted) {
formatted = str5.toLowerCase();
}
obj1.regulationEnvironment = formatted;
obj.creditCards[0].authenticationInsight = obj1;
}
return obj;
})(data);
}
return tmp;
}
tmp = callback(data);
};
},
{ "./error": 102 }
];
items = [
(arg0, arg1, arg2) => {
function addFieldError(arr, message, arr2) {
const first = arr[0];
if (1 !== arr.length) {
const item = arr2.forEach((field) => {
if (field.field === first) {
let closure_0 = field;
}
});
if (!obj) {
obj = { field: first, fieldErrors: [] };
arr2.push(obj);
}
obj(arr.slice(1), message, obj.fieldErrors);
} else {
obj = { code: tmp, field: first, message: message.message };
arr2.push(obj);
}
}
function getLegacyMessage(arg0) {
return { creditCard: "Credit card is invalid" }[arg0[0].field];
}
module.exports = function errorResponseAdapter(errors) {
let errorClass = errors.errors;
if (errorClass) {
errorClass = errors.errors[0];
}
if (errorClass) {
errorClass = errors.errors[0].extensions;
}
if (errorClass) {
errorClass = errors.errors[0].extensions.errorClass;
}
if ("VALIDATION" === errorClass) {
let tmp = (function userErrorResponseAdapter(errors) {
const arr = (function buildFieldErrors(errors) {
const items = [];
const item = errors.forEach(() => { ... });
return items;
})(errors.errors);
if (0 === arr.length) {
let obj = {};
obj = { message: errors.errors[0].message };
obj.error = obj;
return obj;
} else {
obj = {};
const obj1 = { message: outer1_1(arr) };
obj.error = obj1;
obj.fieldErrors = arr;
return obj;
}
})(errors);
} else {
let obj = {};
obj = {};
if (errorClass) {
obj.message = errors.errors[0].message;
obj.error = obj;
obj.fieldErrors = [];
tmp = obj;
} else {
obj.message = "There was a problem serving your request";
obj.error = obj;
obj.fieldErrors = [];
tmp = obj;
}
}
return tmp;
};
},
{}
];
items = [
(arg0, arg1, arg2) => {
module.exports = function configuration() {
return { query: "query ClientConfiguration { clientConfiguration { analyticsUrl environment merchantId assetsUrl clientApiUrl creditCard { supportedCardBrands challenges threeDSecureEnabled threeDSecure { cardinalAuthenticationJWT } } applePayWeb { countryCode currencyCode merchantIdentifier supportedCardBrands } fastlane { enabled } googlePay { displayName supportedCardBrands environment googleAuthorization paypalClientId } ideal { routeId assetsUrl } kount { merchantId } masterpass { merchantCheckoutId supportedCardBrands } paypal { displayName clientId assetsUrl environment environmentNoNetwork unvettedMerchant braintreeClientId billingAgreementsEnabled merchantAccountId currencyCode payeeEmail } unionPay { merchantAccountId } usBankAccount { routeId plaidPublicKey } venmo { merchantId accessToken environment enrichedCustomerDataEnabled } visaCheckout { apiKey externalClientId supportedCardBrands } braintreeApi { accessToken url } supportedFeatures } }", operationName: "ClientConfiguration" };
};
},
{}
];
items = [
(arg0, arg1, arg2) => {
function createCreditCardForFastlaneTokenizationBody(creditCard, hasAuthenticationInsight) {
creditCard = creditCard.creditCard;
let tmp = creditCard.fastlane || {};
let termsAndConditionsVersion = "fastlane" in creditCard;
if (termsAndConditionsVersion) {
termsAndConditionsVersion = "termsAndConditionsVersion" in creditCard.fastlane;
}
if (termsAndConditionsVersion) {
termsAndConditionsVersion = creditCard.fastlane.termsAndConditionsVersion;
}
let hasBuyerConsent = "hasBuyerConsent" in tmp;
if (hasBuyerConsent) {
hasBuyerConsent = tmp.hasBuyerConsent;
}
const shippingAddress = creditCard.shippingAddress;
let obj = { email: creditCard.email, optIn: hasBuyerConsent, phone: creditCard.phone, termsAndConditionsVersion };
let input = assign({}, (function createCreditCardTokenizationBody(creditCard, hasAuthenticationInsight) {
creditCard = creditCard.creditCard;
let billingAddress = creditCard;
if (creditCard) {
billingAddress = creditCard.billingAddress;
}
let str = creditCard;
if (creditCard) {
str = creditCard.expirationDate;
}
let tmp = creditCard;
if (creditCard) {
let expirationMonth = creditCard.expirationMonth;
if (!expirationMonth) {
let trimmed = str;
if (str) {
trimmed = str.split("/")[0].trim();
const str3 = str.split("/")[0];
}
expirationMonth = trimmed;
}
tmp = expirationMonth;
}
let tmp3 = creditCard;
if (creditCard) {
let expirationYear = creditCard.expirationYear;
if (!expirationYear) {
let trimmed1 = str;
if (str) {
trimmed1 = str.split("/")[1].trim();
const str5 = str.split("/")[1];
}
expirationYear = trimmed1;
}
tmp3 = expirationYear;
}
let obj = {};
obj = {};
obj = {};
let number = creditCard;
if (creditCard) {
number = creditCard.number;
}
obj.number = number;
obj.expirationMonth = tmp;
obj.expirationYear = tmp3;
let cvv = creditCard;
if (creditCard) {
cvv = creditCard.cvv;
}
obj.cvv = cvv;
let cardholderName = creditCard;
if (creditCard) {
cardholderName = creditCard.cardholderName;
}
obj.cardholderName = cardholderName;
obj.creditCard = obj;
obj.options = {};
obj.input = obj;
if (hasAuthenticationInsight.hasAuthenticationInsight) {
const obj1 = { merchantAccountId: creditCard.merchantAccountId };
obj.authenticationInsightInput = obj1;
}
if (billingAddress) {
obj.input.creditCard.billingAddress = billingAddress;
}
const input = obj.input;
if (creditCard.creditCard) {
if (creditCard.creditCard.options) {
if ("boolean" === typeof creditCard.creditCard.options.validate) {
let flag = creditCard.creditCard.options.validate;
}
if ("boolean" === typeof flag) {
const obj2 = { validate: flag };
input.options = outer1_0(obj2, input.options);
}
obj.input = input;
return obj;
}
}
if (!creditCard.authorizationFingerprint) {
flag = true;
if (!creditCard.authorizationFingerprint) {
if (creditCard.tokenizationKey) {
flag = false;
}
}
} else {
flag = true;
}
})(creditCard, hasAuthenticationInsight).input, obj);
if ("authAssertion" in tmp) {
input.authAssertion = tmp.authAssertion;
}
if (shippingAddress) {
input.shippingAddress = shippingAddress;
}
return { input };
}
const assign = global("../../../../lib/assign").assign;
module.exports = function creditCardForFastlaneTokenization(authenticationInsight) {
let obj = {};
let merchantAccountId = authenticationInsight.authenticationInsight;
if (merchantAccountId) {
merchantAccountId = authenticationInsight.merchantAccountId;
}
obj.hasAuthenticationInsight = Boolean(merchantAccountId);
obj = {};
const hasAuthenticationInsight = obj.hasAuthenticationInsight;
let str = "mutation TokenizeCreditCardForPayPalConnect($input: TokenizeCreditCardForPayPalConnectInput!";
if (hasAuthenticationInsight) {
str = "mutation TokenizeCreditCardForPayPalConnect($input: TokenizeCreditCardForPayPalConnectInput!, $authenticationInsightInput: AuthenticationInsightInput!";
}
const text = `${str}) { tokenizeCreditCardForPayPalConnect(input: $input) { clientMutationId paymentMethod { id details { ... on CreditCardDetails { bin brandCode last4 cardholderName expirationMonth expirationYear binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId } } } }`;
let text1 = text;
if (hasAuthenticationInsight) {
text1 = `${str}) { tokenizeCreditCardForPayPalConnect(input: $input) { clientMutationId paymentMethod { id details { ... on CreditCardDetails { bin brandCode last4 cardholderName expirationMonth expirationYear binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId } } } } authenticationInsight(input: $authenticationInsightInput) { customerAuthenticationRegulationEnvironment }`;
}
obj.query = `${tmp2} } }`;
obj.variables = createCreditCardForFastlaneTokenizationBody(authenticationInsight, obj);
obj.operationName = "TokenizeCreditCardForPayPalConnect";
return obj;
};
},
{ "../../../../lib/assign": 140 }
];
items = [
(arg0, arg1, arg2) => {
function createCreditCardTokenizationBody(creditCard, hasAuthenticationInsight) {
creditCard = creditCard.creditCard;
let billingAddress = creditCard;
if (creditCard) {
billingAddress = creditCard.billingAddress;
}
let str = creditCard;
if (creditCard) {
str = creditCard.expirationDate;
}
let tmp = creditCard;
if (creditCard) {
let expirationMonth = creditCard.expirationMonth;
if (!expirationMonth) {
let trimmed = str;
if (str) {
trimmed = str.split("/")[0].trim();
const str3 = str.split("/")[0];
}
expirationMonth = trimmed;
}
tmp = expirationMonth;
}
let tmp3 = creditCard;
if (creditCard) {
let expirationYear = creditCard.expirationYear;
if (!expirationYear) {
let trimmed1 = str;
if (str) {
trimmed1 = str.split("/")[1].trim();
const str5 = str.split("/")[1];
}
expirationYear = trimmed1;
}
tmp3 = expirationYear;
}
let obj = {};
obj = {};
obj = {};
let number = creditCard;
if (creditCard) {
number = creditCard.number;
}
obj.number = number;
obj.expirationMonth = tmp;
obj.expirationYear = tmp3;
let cvv = creditCard;
if (creditCard) {
cvv = creditCard.cvv;
}
obj.cvv = cvv;
let cardholderName = creditCard;
if (creditCard) {
cardholderName = creditCard.cardholderName;
}
obj.cardholderName = cardholderName;
obj.creditCard = obj;
obj.options = {};
obj.input = obj;
if (hasAuthenticationInsight.hasAuthenticationInsight) {
const obj1 = { merchantAccountId: creditCard.merchantAccountId };
obj.authenticationInsightInput = obj1;
}
if (billingAddress) {
obj.input.creditCard.billingAddress = billingAddress;
}
const input = obj.input;
if (creditCard.creditCard) {
if (creditCard.creditCard.options) {
if ("boolean" === typeof creditCard.creditCard.options.validate) {
let flag = creditCard.creditCard.options.validate;
}
if ("boolean" === typeof flag) {
const obj2 = { validate: flag };
input.options = assign(obj2, input.options);
}
obj.input = input;
return obj;
}
}
if (!creditCard.authorizationFingerprint) {
flag = true;
if (!creditCard.authorizationFingerprint) {
if (creditCard.tokenizationKey) {
flag = false;
}
}
} else {
flag = true;
}
}
const assign = global("../../../../lib/assign").assign;
module.exports = function creditCardTokenization(authenticationInsight) {
let obj = {};
let merchantAccountId = authenticationInsight.authenticationInsight;
if (merchantAccountId) {
merchantAccountId = authenticationInsight.merchantAccountId;
}
obj.hasAuthenticationInsight = Boolean(merchantAccountId);
obj = {};
const hasAuthenticationInsight = obj.hasAuthenticationInsight;
let str = "mutation TokenizeCreditCard($input: TokenizeCreditCardInput!";
if (hasAuthenticationInsight) {
str = "mutation TokenizeCreditCard($input: TokenizeCreditCardInput!, $authenticationInsightInput: AuthenticationInsightInput!";
}
const text = `${str}) { tokenizeCreditCard(input: $input) { token creditCard { bin brandCode last4 cardholderName expirationMonth expirationYear binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId } } `;
let text1 = text;
if (hasAuthenticationInsight) {
text1 = `${str}) { tokenizeCreditCard(input: $input) { token creditCard { bin brandCode last4 cardholderName expirationMonth expirationYear binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId } } authenticationInsight(input: $authenticationInsightInput) { customerAuthenticationRegulationEnvironment }`;
}
obj.query = `${tmp2} } }`;
obj.variables = createCreditCardTokenizationBody(authenticationInsight, obj);
obj.operationName = "TokenizeCreditCard";
return obj;
};
},
{ "../../../../lib/assign": 140 }
];
items = [
(arg0, arg1, arg2) => {
class GraphQL {
constructor(arg0) {
this._config = global.graphQL;
return;
}
getGraphQLEndpoint() {
return this._config.url;
}
isGraphQLRequest(arg0, arg1) {
clientApiPath = this.getClientApiPath(global);
closure_0 = clientApiPath;
tmp2 = !this._isGraphQLEnabled() || !clientApiPath;
tmp3 = !tmp2;
if (!tmp2) {
features = this._config.features;
tmp5 = module;
someResult = features.some((arg0) => clientApiPath[arg0] === clientApiPath);
tmp6 = !(function containsDisallowedlistedKeys(arg0) {
let closure_0 = arg0;
return outer1_1.some((str) => {
const parts = str.split(".");
return undefined !== parts.reduce((arg0, arg1) => {
let tmp = arg0;
if (arg0) {
tmp = arg0[arg1];
}
return tmp;
}, closure_0);
});
})(module) && someResult;
tmp3 = tmp6;
}
return tmp3;
}
getClientApiPath(arg0) {
parts = global.split("/client_api/v1/");
first = undefined;
if (parts.length > 1) {
str = parts[1];
str2 = "?";
num = 0;
first = str.split("?")[0];
}
return first;
}
_isGraphQLEnabled() {
return Boolean(this._config);
}
}
let closure_0 = { tokenize_credit_cards: "payment_methods/credit_cards", configuration: "configuration" };
let closure_1 = ["creditCard.options.unionPayEnrollment"];
module.exports = GraphQL;
},
{}
];
items = [
(arg0, arg1, arg2) => {
class GraphQLRequest {
constructor(arg0) {
self = this;
graphQL = global.graphQL;
clientApiPath = graphQL.getClientApiPath(global.url);
({ graphQL: this._graphQL, data: this._data, method: this._method, headers: this._headers } = global);
this._clientSdkMetadata = { source: global.metadata.source, integration: global.metadata.integration, sessionId: global.metadata.sessionId };
prototype = global.sendAnalyticsEvent;
if (!prototype) {
tmp2 = globalThis;
_Function = Function;
prototype = Function.prototype;
}
self._sendAnalyticsEvent = prototype;
self._generator = c8[clientApiPath];
self._adapter = c9[clientApiPath];
_sendAnalyticsEventResult = self._sendAnalyticsEvent("graphql.init");
return;
}
getUrl() {
_graphQL = this._graphQL;
return _graphQL.getGraphQLEndpoint();
}
getBody() {
tmp = formatBodyKeys(this._data);
obj = { clientSdkMetadata: this._clientSdkMetadata };
return JSON.stringify(assign(obj, this._generator(tmp, c3(this._data.creditCard))));
}
getMethod() {
return "POST";
}
getHeaders() {
self = this;
_sendAnalyticsEvent = this._sendAnalyticsEvent;
if (this._data.authorizationFingerprint) {
str2 = "graphql.authorization-fingerprint";
_sendAnalyticsEventResult = _sendAnalyticsEvent("graphql.authorization-fingerprint");
tokenizationKey = self._data.authorizationFingerprint;
} else {
str = "graphql.tokenization-key";
_sendAnalyticsEventResult1 = _sendAnalyticsEvent("graphql.tokenization-key");
tokenizationKey = self._data.tokenizationKey;
}
obj = { Authorization: `Bearer ${tokenizationKey}`, "Braintree-Version": BRAINTREE_VERSION };
return assign({}, self._headers, obj);
}
adaptResponseBody(arg0) {
self = this;
tmp = "creditCard" in this._data;
if (tmp) {
tmp2 = c3;
tmp = c3(self._data.creditCard);
}
return this._adapter(global, self, tmp);
}
determineStatus(arg0, arg1) {
self = this;
num = 200;
if (200 === global) {
errorClass = module.errors;
if (errorClass) {
num3 = 0;
errorClass = module.errors[0];
}
if (errorClass) {
num4 = 0;
errorClass = module.errors[0].extensions;
}
if (errorClass) {
num5 = 0;
errorClass = module.errors[0].extensions.errorClass;
}
if (!module.data) {
num6 = 422;
str = "VALIDATION";
if ("VALIDATION" !== errorClass) {
num7 = 403;
str2 = "AUTHORIZATION";
num8 = 403;
if ("AUTHORIZATION" !== errorClass) {
num9 = 401;
str3 = "AUTHENTICATION";
if ("AUTHENTICATION" !== errorClass) {
message = !errorClass;
if (message) {
num10 = 0;
message = module.errors[0].message;
}
num11 = 500;
if (message) {
num11 = 403;
}
num9 = num11;
}
num8 = num9;
}
num6 = num8;
}
num = num6;
}
num2 = num;
} else {
num2 = global;
if (!global) {
num2 = 500;
}
}
_sendAnalyticsEventResult = self._sendAnalyticsEvent(`graphql.status.${global}`);
_sendAnalyticsEventResult1 = self._sendAnalyticsEvent(`graphql.determinedStatus.${num2}`);
return num2;
}
}
function formatBodyKeys(_data) {
let closure_0 = _data;
const obj = {};
const keys = Object.keys(_data);
const item = keys.forEach((arg0) => {
const tmp = outer1_2(arg0);
if ("object" === typeof dependencyMap[arg0]) {
obj[tmp] = outer1_10(dependencyMap[arg0]);
} else if ("number" === typeof dependencyMap[arg0]) {
const _String = String;
obj[tmp] = String(dependencyMap[arg0]);
} else {
obj[tmp] = dependencyMap[arg0];
}
});
return obj;
}
const BRAINTREE_VERSION = global("../../constants").BRAINTREE_VERSION;
const assign = global("../../../lib/assign").assign;
let closure_2 = global("../../../lib/snake-case-to-camel-case");
let closure_3 = global("../../../lib/is-fastlane-checkout");
let closure_4 = global("./generators/credit-card-tokenization");
let closure_5 = global("./adapters/credit-card-tokenization");
let closure_6 = global("./adapters/credit-card-tokenization-fastlane");
let closure_7 = global("./generators/credit-card-for-fastlane-tokenization");
let closure_8 = {
"payment_methods/credit_cards": function payment_methods_credit_cards(arg0, arg1) {
if (arg1) {
let tmp2 = callback5(arg0);
} else {
tmp2 = callback2(arg0);
}
return tmp2;
},
configuration: global("./generators/configuration")
};
let obj = {
"payment_methods/credit_cards": function payment_methods_credit_cards(arg0, arg1, arg2) {
if (arg2) {
let tmp2 = callback4(arg0, arg1);
} else {
tmp2 = callback3(arg0, arg1);
}
return tmp2;
},
configuration: global("./adapters/configuration")
};
module.exports = GraphQLRequest;
},
{ "../../../lib/assign": 140, "../../../lib/is-fastlane-checkout": 171, "../../../lib/snake-case-to-camel-case": 179, "../../constants": 93, "./adapters/configuration": 99, "./adapters/credit-card-tokenization": 101, "./adapters/credit-card-tokenization-fastlane": 100, "./generators/configuration": 103, "./generators/credit-card-for-fastlane-tokenization": 104, "./generators/credit-card-tokenization": 105 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("../../lib/once");
let closure_1 = global("./ajax-driver");
module.exports = (method) => {
let prototype = arg1;
if (!arg1) {
const _Function = Function;
prototype = Function.prototype;
}
let str = method.method;
if (!str) {
str = "GET";
}
method.method = str.toUpperCase();
let num = 60000;
if (null != method.timeout) {
num = method.timeout;
}
method.timeout = num;
method.data = method.data || {};
closure_1.request(method, closure_0(prototype));
};
},
{ "../../lib/once": 176, "./ajax-driver": 97 }
];
items = [
(arg0, arg1, arg2) => {
module.exports = (arg0) => {
const parsed = JSON.parse(arg0);
};
},
{}
];
items = [
(arg0, arg1, arg2) => {
module.exports = (str) => {
if ("string" !== typeof str) {
const _Error = Error;
const error = new Error("Method must be a string");
throw error;
} else {
let tmp = "get" !== str.toLowerCase();
if (tmp) {
tmp = null != arg1;
}
let tmp3 = arg1;
if (tmp) {
let json = arg1;
if ("string" !== typeof arg1) {
const _JSON = JSON;
json = JSON.stringify(arg1);
}
tmp3 = json;
}
return tmp3;
}
};
},
{}
];
items = [
(arg0, arg1, arg2) => {
let _XMLHttpRequest = "undefined" !== typeof window;
if (_XMLHttpRequest) {
let _window = window;
_XMLHttpRequest = window.XMLHttpRequest;
}
if (_XMLHttpRequest) {
const _window2 = window;
let _XMLHttpRequest2 = window.XMLHttpRequest;
let prototype = _XMLHttpRequest2.prototype;
_XMLHttpRequest2 = new _XMLHttpRequest2();
_XMLHttpRequest = "withCredentials" in _XMLHttpRequest2;
}
const obj = {
isAvailable: _XMLHttpRequest,
getRequestObject() {
const _window = window;
if (_XMLHttpRequest) {
_XMLHttpRequest = _window.XMLHttpRequest;
const prototype2 = _XMLHttpRequest.prototype;
_XMLHttpRequest = new _XMLHttpRequest();
} else {
const XDomainRequest = _window.XDomainRequest;
const prototype = XDomainRequest.prototype;
_XMLHttpRequest = new XDomainRequest();
}
return _XMLHttpRequest;
}
};
module.exports = obj;
},
{}
];
items = [
(arg0, arg1, arg2) => {
const globalResult = global("../lib/braintree-error");
let obj = { type: globalResult.types.MERCHANT, code: "DATA_COLLECTOR_KOUNT_NOT_ENABLED", message: "Kount is not enabled for this merchant." };
obj = { type: globalResult.types.MERCHANT, code: "DATA_COLLECTOR_KOUNT_ERROR" };
obj = { type: globalResult.types.MERCHANT, code: "DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS", message: "Data Collector must be created with Kount and/or PayPal." };
module.exports = { DATA_COLLECTOR_KOUNT_NOT_ENABLED: obj, DATA_COLLECTOR_KOUNT_ERROR: obj, DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS: obj };
},
{ "../lib/braintree-error": 143 }
];
items = [
(arg0, arg1, arg2) => {
class Fraudnet {
constructor() {
return;
}
initialize(arg0) {
self = this;
sessionId = this;
({ sessionId, environment } = global);
if (!sessionId) {
sessionId = global.clientSessionId;
}
self.sessionId = sessionId;
if (self.sessionId) {
str = self.sessionId;
num = 0;
num2 = 32;
self.sessionId = str.substring(0, 32);
}
if (!global.sessionId) {
sessionId = self.sessionId;
}
date = new Date();
self._beaconId = `https://b.stats.paypal.com/counter.cgi?i=127.0.0.1&p=${tmp}&t=${obj.getTime() / 1000}&a=14`;
body = document.body;
({ sessionId: sessionId2, _beaconId } = self);
appendChildResult = body.appendChild(document.createElement("script"));
obj = { f: sessionId2, s: FRAUDNET_SOURCE, b: _beaconId };
if ("production" !== environment) {
flag = true;
obj.sandbox = true;
}
appendChildResult.type = "application/json";
attr = appendChildResult.setAttribute("fncls", FRAUDNET_FNCLS);
appendChildResult.text = JSON.stringify(obj);
self._parameterBlock = appendChildResult;
obj1 = { src: FRAUDNET_URL };
promise = loadScript(obj1);
nextPromise = promise.then((_thirdPartyBlock) => {
sessionId._thirdPartyBlock = _thirdPartyBlock;
return sessionId;
});
return nextPromise.catch(() => null);
}
teardown() {
tmp = removeElementIfOnPage(document.querySelector("iframe[title=\"ppfniframe\"]"));
tmp2 = removeElementIfOnPage(document.querySelector("iframe[title=\"pbf\"]"));
tmp3 = removeElementIfOnPage(this._parameterBlock);
tmp4 = removeElementIfOnPage(this._thirdPartyBlock);
return;
}
}
function removeElementIfOnPage(_parameterBlock) {
let parentNode = _parameterBlock;
if (_parameterBlock) {
parentNode = _parameterBlock.parentNode;
}
if (parentNode) {
const parentNode2 = _parameterBlock.parentNode;
parentNode2.removeChild(_parameterBlock);
}
}
const FRAUDNET_FNCLS = global("../lib/constants").FRAUDNET_FNCLS;
const FRAUDNET_SOURCE = global("../lib/constants").FRAUDNET_SOURCE;
const FRAUDNET_URL = global("../lib/constants").FRAUDNET_URL;
const loadScript = global("../lib/assets").loadScript;
module.exports = {
setup(arg0) {
let obj = arg0;
const obj2 = new Fraudnet();
if (!arg0) {
obj = {};
}
if (!obj.sessionId) {
if (closure_0) {
obj2.sessionId = closure_0;
let resolved = Promise.resolve(obj2);
}
return resolved;
}
resolved = obj2.initialize(obj);
},
clearSessionIdCache() {
let c0 = null;
}
};
},
{ "../lib/assets": 139, "../lib/constants": 145 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("./kount");
let closure_1 = global("./fraudnet");
let closure_2 = global("../lib/braintree-error");
let closure_3 = global("../lib/basic-component-verification");
let closure_4 = global("../lib/create-deferred-client");
let closure_5 = global("../lib/create-assets-url");
let closure_6 = global("../lib/methods");
let closure_7 = global("../lib/convert-methods-to-error");
const globalResult = global("@braintree/wrap-promise");
let closure_9 = global("./errors");
module.exports = {
create: globalResult(function create(client) {
let closure_0 = client;
let closure_2 = { _instances: [] };
return closure_3.verify({ name: "Data Collector", client: client.client, authorization: client.authorization }).then(() => {
obj._instantiatedWithAClient = !client.useDeferredClient;
obj = { authorization: client.authorization, client: client.client, debug: client.debug, assetsUrl: outer1_5.create(client.authorization), name: "Data Collector" };
obj = outer1_4.create(obj);
const nextPromise = obj.then((getConfiguration) => {
const configuration = getConfiguration.getConfiguration();
if (true === outer1_0.kount) {
if (configuration.gatewayConfiguration.kount) {
const obj = { environment: configuration.gatewayConfiguration.environment, merchantId: configuration.gatewayConfiguration.kount.kountMerchantId };
const setupResult = closure_0.setup(obj);
let outer1_1 = setupResult.deviceData;
const _instances = outer1_2._instances;
_instances.push(setupResult);
}
return Promise.resolve(getConfiguration);
}
outer1_1 = {};
});
obj._createPromise = obj.then((getConfiguration) => {
const configuration = getConfiguration.getConfiguration();
if (true === outer1_0.kount) {
if (configuration.gatewayConfiguration.kount) {
const obj = { environment: configuration.gatewayConfiguration.environment, merchantId: configuration.gatewayConfiguration.kount.kountMerchantId };
const setupResult = closure_0.setup(obj);
let outer1_1 = setupResult.deviceData;
const _instances = outer1_2._instances;
_instances.push(setupResult);
}
return Promise.resolve(getConfiguration);
}
outer1_1 = {};
}).then((getConfiguration) => {
const configuration = getConfiguration.getConfiguration();
const obj = {};
let correlationId = outer1_0.riskCorrelationId;
if (!correlationId) {
correlationId = outer1_0.clientMetadataId;
}
if (!correlationId) {
correlationId = outer1_0.correlationId;
}
obj.sessionId = correlationId;
obj.clientSessionId = configuration.analyticsMetadata.sessionId;
obj.environment = configuration.gatewayConfiguration.environment;
return outer2_1.setup(obj).then(() => { ... });
}).then(() => {
if (0 === outer1_2._instances.length) {
const prototype = ctor.prototype;
const tmp10 = new ctor(outer2_9.DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS);
let rejectResult = Promise.reject(tmp10);
} else {
rejectResult = outer1_2;
const _JSON = JSON;
outer1_2.deviceData = JSON.stringify(outer1_1);
outer1_2.rawDeviceData = outer1_1;
}
return rejectResult;
});
obj.teardown = (function createTeardownMethod(closure_2) {
let closure_0 = closure_2;
return outer2_8(function teardown() { ... });
})(obj);
obj.getDeviceData = (function createGetDeviceDataMethod(closure_2) {
let closure_0 = closure_2;
return outer2_8(function getDeviceData() { ... });
})(obj);
return obj._instantiatedWithAClient ? obj._createPromise : obj;
});
}),
VERSION: "3.112.1"
};
},
{ "../lib/basic-component-verification": 141, "../lib/braintree-error": 143, "../lib/convert-methods-to-error": 146, "../lib/create-assets-url": 148, "../lib/create-deferred-client": 150, "../lib/methods": 175, "./errors": 112, "./fraudnet": 113, "./kount": 115, "@braintree/wrap-promise": 40 }
];
items = [
(arg0, arg1, arg2) => {
class Kount {
constructor(arg0) {
self = this;
cachedDeviceData = Kount.getCachedDeviceData(global.merchantId);
if (cachedDeviceData) {
self.deviceData = cachedDeviceData;
flag = true;
self._isCached = true;
return;
} else {
self._currentEnvironment = self._initializeEnvironment(global);
tmp2 = c0;
random = c0.random;
startCollectorsResult = random.startCollectors();
self._deviceSessionId = self._generateDeviceSessionId();
self.deviceData = self._getDeviceData();
tmp4 = Kount;
setCachedDeviceDataResult = Kount.setCachedDeviceData(global.merchantId, self.deviceData);
self._iframe = self._setupIFrame();
return;
}
}
static getCachedDeviceData(arg0) {
return closure_3[global];
}
static setCachedDeviceData(arg0, arg1) {
closure_3[global] = module;
return;
}
teardown() {
self = this;
if (!this._isCached) {
tmp = c0;
random = c0.random;
stopCollectorsResult = random.stopCollectors();
_removeIframeResult = self._removeIframe();
}
return;
}
_removeIframe() {
parentNode = this._iframe.parentNode;
removeChildResult = parentNode.removeChild(this._iframe);
return;
}
_getDeviceData() {
obj = { deviceSessionId: this._deviceSessionId, fraudMerchantId: this._currentEnvironment.id };
return c1(obj);
}
_generateDeviceSessionId() {
random = c0.random;
hex = c0.codec.hex;
return hex.fromBits(random.randomWords(4, 0));
}
_setupIFrame() {
self = this;
c0 = `?m=${this._currentEnvironment.id}&s=${this._deviceSessionId}`;
element = document.createElement("iframe");
iframe = element;
element.width = 1;
element.id = `braintreeDataFrame-${this._deviceSessionId}`;
element.height = 1;
element.frameBorder = 0;
element.scrolling = "no";
element.style.position = "fixed";
element.style.left = "-999999px";
element.style.top = "-999999px";
element.title = "Braintree-Kount-iframe";
attr = element.setAttribute("aria-hidden", "true");
body = document.body;
appendChildResult = body.appendChild(element);
timerId = setTimeout(() => {
element.src = `${self._currentEnvironment.url}/logo.htm${closure_0}`;
element.innerHTML = `
`;
}, 10);
return element;
}
_initializeEnvironment(arg0) {
tmp = c2[global.environment];
if (null == tmp) {
tmp2 = globalThis;
_Error = Error;
str = " is not a valid environment for kount.environment";
prototype = Error.prototype;
tmp3 = new.target;
tmp4 = new.target;
error = new Error(global.environment + " is not a valid environment for kount.environment");
tmp6 = error;
throw error;
} else {
obj = {};
obj.url = tmp;
({ environment: obj.name, merchantId: obj.id } = global);
return obj;
}
}
}
let closure_0 = global("./vendor/sjcl");
let closure_1 = global("../lib/camel-case-to-snake-case");
let obj = { development: "https://assets.qa.braintreepayments.com/data", qa: "https://assets.qa.braintreepayments.com/data", sandbox: "https://assets.braintreegateway.com/sandbox/data", production: "https://assets.braintreegateway.com/data" };
let closure_3 = {};
obj = {
setup(arg0) {
let obj = arg0;
let tmp = Kount;
if (null == arg0) {
obj = {};
}
tmp = new tmp(obj);
return tmp;
},
Kount,
environmentUrls: obj
};
module.exports = obj;
},
{ "../lib/camel-case-to-snake-case": 144, "./vendor/sjcl": 116 }
];
items = [
(arg0, arg1, arg2) => {
function t(arg0, arg1, arg2) {
let tmp5;
let tmp6;
let tmp7;
let tmp8;
let tmp9;
if (4 !== arg1.length) {
let invalid = obj.exception.invalid;
const prototype = invalid.prototype;
invalid = new invalid("invalid aes block size");
throw invalid;
} else {
let num = 1;
if (arg2) {
num = 3;
}
let num4 = 3;
if (arg2) {
num4 = 1;
}
let tmp3 = arg1[num4] ^ arr2[3];
const diff = arr2.length / 4 - 2;
const items = [0, 0, 0, 0];
[tmp5, tmp6, tmp7, tmp8, tmp9] = arg0.l[arg2];
let tmp10 = tmp28;
let tmp11 = tmp;
let tmp12 = tmp2;
let num9 = 0;
let num10 = 4;
let tmp13 = tmp3;
let tmp14 = tmp28;
let tmp15 = tmp;
let tmp16 = tmp2;
let num11 = 4;
if (0 < diff) {
do {
let tmp17 = tmp5[tmp10 >>> 24] ^ tmp6[tmp11 >> 16 & 255] ^ tmp7[tmp12 >> 8 & 255] ^ tmp8[255 & tmp3] ^ arr2[num10];
let tmp18 = tmp5[tmp11 >>> 24] ^ tmp6[tmp12 >> 16 & 255] ^ tmp7[tmp3 >> 8 & 255] ^ tmp8[255 & tmp10] ^ arr2[num10 + 1];
let tmp19 = tmp5[tmp12 >>> 24] ^ tmp6[tmp3 >> 16 & 255] ^ tmp7[tmp10 >> 8 & 255] ^ tmp8[255 & tmp11] ^ arr2[num10 + 2];
tmp3 = tmp5[tmp3 >>> 24] ^ tmp6[tmp10 >> 16 & 255] ^ tmp7[tmp11 >> 8 & 255] ^ tmp8[255 & tmp12] ^ arr2[num10 + 3];
num10 = num10 + 4;
num9 = num9 + 1;
tmp10 = tmp17;
tmp11 = tmp18;
tmp12 = tmp19;
tmp13 = tmp3;
tmp14 = tmp17;
tmp15 = tmp18;
tmp16 = tmp19;
num11 = num10;
} while (num9 < diff);
}
let num12 = 0;
do {
let tmp21 = num12;
let tmp20 = tmp13;
if (arg2) {
tmp21 = 3 & -num12;
}
let tmp22 = +num11;
num11 = tmp22 + 1;
items[tmp21] = tmp9[tmp14 >>> 24] << 24 ^ tmp9[tmp15 >> 16 & 255] << 16 ^ tmp9[tmp16 >> 8 & 255] << 8 ^ tmp9[255 & tmp13] ^ arr2[tmp22];
num12 = num12 + 1;
tmp13 = tmp14;
tmp14 = tmp15;
tmp15 = tmp16;
tmp16 = tmp20;
} while (4 > num12);
return items;
}
}
function u(u) {
let tmp10;
let tmp11;
let tmp12;
let tmp13;
let tmp14;
let tmp15;
let tmp18;
let tmp19;
u = u.u;
let first = u[0];
let tmp3 = u[1];
let tmp4 = u[2];
let tmp5 = u[3];
let tmp6 = u[4];
let tmp7 = u[5];
let tmp8 = u[6];
let tmp9 = u[7];
let num = 0;
do {
tmp10 = first;
tmp11 = tmp3;
tmp12 = tmp4;
tmp13 = tmp6;
tmp14 = tmp7;
tmp15 = tmp8;
if (16 > num) {
let tmp16 = arg1[num];
} else {
let tmp20 = arg1[num + 1 & 15];
let tmp21 = arg1[num + 14 & 15];
tmp16 = (tmp20 >>> 7 ^ tmp20 >>> 18 ^ tmp20 >>> 3 ^ tmp20 << 25 ^ tmp20 << 14) + (tmp21 >>> 17 ^ tmp21 >>> 19 ^ tmp21 >>> 10 ^ tmp21 << 15 ^ tmp21 << 13) + arg1[15 & num] + arg1[num + 9 & 15] | 0;
arg1[15 & num] = tmp16;
}
let sum = tmp16 + tmp9 + (tmp6 >>> 6 ^ tmp6 >>> 11 ^ tmp6 >>> 25 ^ tmp6 << 26 ^ tmp6 << 21 ^ tmp6 << 7) + (tmp8 ^ tmp6 & (tmp7 ^ tmp8)) + tmp[num];
tmp18 = tmp5 + sum | 0;
tmp19 = sum + (first & tmp3 ^ tmp4 & (first ^ tmp3)) + (first >>> 2 ^ first >>> 13 ^ first >>> 22 ^ first << 30 ^ first << 19 ^ first << 10) | 0;
num = num + 1;
first = tmp19;
tmp3 = tmp10;
tmp4 = tmp11;
tmp5 = tmp12;
tmp6 = tmp18;
tmp7 = tmp13;
tmp8 = tmp14;
tmp9 = tmp15;
} while (64 > num);
u[0] = u[0] + tmp19 | 0;
u[1] = u[1] + tmp10 | 0;
u[2] = u[2] + tmp11 | 0;
u[3] = u[3] + tmp12 | 0;
u[4] = u[4] + tmp18 | 0;
u[5] = u[5] + tmp13 | 0;
u[6] = u[6] + tmp14 | 0;
u[7] = u[7] + tmp15 | 0;
}
function A(arg0, arg1) {
let length;
const items = [];
for (const key10009 in obj) {
let tmp3 = key10009;
if (!obj.hasOwnProperty(key10009)) {
continue;
} else {
let arr = items.push(obj[key10009]);
continue;
}
continue;
}
let num = 0;
if (0 < items.length) {
do {
let tmp2 = items[num](arg1);
num = num + 1;
length = items.length;
} while (num < length);
}
}
function C(addEntropy) {
if ("undefined" !== typeof window) {
const _window = window;
if (window.performance) {
const _window2 = window;
if ("function" === typeof window.performance.now) {
const _window3 = window;
const _performance = window.performance;
addEntropy.addEntropy(_performance.now(), arg1, "loadtime");
}
}
}
addEntropy.addEntropy(new Date().valueOf(), arg1, "loadtime");
}
function y(arg0) {
const obj = z(arg0);
arg0.b = obj.concat(z(arg0));
const aes = new obj.cipher.aes(arg0.b);
arg0.C = aes;
}
function z(g) {
let num = 0;
g.g[0] = g.g[0] + 1 | 0;
if (!g.g[0]) {
num = num + 1;
while (4 > num) {
g.g[num] = g.g[num] + 1 | 0;
if (g.g[num]) {
break;
}
}
}
const C = g.C;
return C.encrypt(g.g);
}
function B(arg0, arg1) {
let closure_0 = arg0;
let closure_1 = arg1;
return () => {
callback(...arguments);
};
}
obj = { cipher: {}, hash: {}, keyexchange: {}, mode: {}, misc: {}, codec: {}, exception: obj };
obj = {
corrupt(message) {
this.toString = function() {
return "CORRUPT: " + this.message;
};
this.message = message;
},
invalid(message) {
this.toString = function() {
return "INVALID: " + this.message;
};
this.message = message;
},
bug(message) {
this.toString = function() {
return "BUG: " + this.message;
};
this.message = message;
},
notReady(message) {
this.toString = function() {
return "NOT READY: " + this.message;
};
this.message = message;
}
};
obj.cipher.aes = function(arr) {
const self = this;
if (!this.l[0][0][0]) {
self.G();
}
if (4 !== arr.length) {
if (6 !== length) {
if (8 !== length) {
let invalid = obj.exception.invalid;
const prototype = invalid.prototype;
invalid = new invalid("invalid aes key size");
throw invalid;
}
}
}
const substr = arr.slice(0);
const items = [substr, ];
const items1 = [];
items[1] = items1;
self.b = items;
let sum = length;
let num3 = 1;
let diff1 = length;
if (arr.length < 4 * arr.length + 28) {
do {
let tmp8 = substr[sum - 1];
let tmp9 = 0 == sum % length;
if (!tmp9) {
let tmp10 = tmp5;
if (tmp5) {
tmp10 = 4 == sum % length;
}
tmp9 = tmp10;
}
let tmp11 = tmp8;
let tmp12 = num3;
if (tmp9) {
let tmp13 = tmp2[tmp8 >>> 24] << 24 ^ tmp2[tmp8 >> 16 & 255] << 16 ^ tmp2[tmp8 >> 8 & 255] << 8 ^ tmp2[255 & tmp8];
let tmp14 = tmp13;
let tmp15 = num3;
if (0 == sum % length) {
tmp14 = tmp13 << 8 ^ tmp13 >>> 24 ^ num3 << 24;
tmp15 = num3 << 1 ^ 283 * (num3 >> 7);
}
tmp11 = tmp14;
tmp12 = tmp15;
}
substr[sum] = substr[sum - length] ^ tmp11;
sum = sum + 1;
num3 = tmp12;
diff1 = sum;
} while (sum < 4 * length + 28);
}
let num4 = 0;
while (diff1) {
let diff = diff1;
if (!(3 & num4)) {
diff = diff1 - 4;
}
let tmp17 = substr[diff];
let tmp18 = tmp17;
if (4 < diff1) {
tmp18 = tmp17;
if (4 <= num4) {
tmp18 = tmp3[0][tmp2[tmp17 >>> 24]] ^ tmp3[1][tmp2[tmp17 >> 16 & 255]] ^ tmp3[2][tmp2[tmp17 >> 8 & 255]] ^ tmp3[3][tmp2[255 & tmp17]];
}
}
items1[num4] = tmp18;
num4 = num4 + 1;
diff1 = diff1 - 1;
}
};
obj = {
encrypt(g) {
return t(this, g, 0);
},
decrypt(arg0) {
return t(this, arg0, 1);
},
l: items1,
G() {
const first = this.l[0];
const items = [];
const items1 = [];
let num = 0;
do {
let tmp4 = num << 1 ^ 283 * (num >> 7);
items[num] = tmp4;
items1[tmp4 ^ num] = num;
num = num + 1;
} while (256 > num);
let num2 = 0;
let num3 = 0;
let num4 = 0;
if (!first[4][0]) {
const tmp5 = num3 ^ num3 << 1 ^ num3 << 2 ^ num3 << 3 ^ num3 << 4;
tmp3[num2] = tmp5 >> 8 ^ 255 & tmp5 ^ 99;
tmp2[4][tmp5 >> 8 ^ 255 & tmp5 ^ 99] = num2;
let num5 = items[num2];
let tmp8 = 16843009 * items[tmp7] ^ 65537 * tmp7 ^ 257 * num5 ^ 16843008 * num2;
let tmp9 = 257 * items[tmp6] ^ 16843008 * tmp6;
let num6 = 0;
do {
do {
tmp9 = tmp9 << 24 ^ tmp9 >>> 8;
first[num6][num2] = tmp9;
tmp8 = tmp8 << 24 ^ tmp8 >>> 8;
tmp2[num6][tmp6] = tmp8;
num6 = num6 + 1;
} while (4 > num6);
if (!num5) {
num5 = 1;
}
num2 = num2 ^ num5;
num3 = items1[num3] || 1;
num4 = 0;
} while (!tmp3[num2]);
}
do {
let arr3 = first[num4];
first[num4] = arr3.slice(0);
let arr4 = tmp2[num4];
tmp2[num4] = arr4.slice(0);
num4 = num4 + 1;
let num7 = 5;
} while (5 > num4);
}
};
let items = [[], [], [], [], []];
items1 = [items, ];
let items2 = [[], [], [], [], []];
items1[1] = items2;
obj.cipher.aes.prototype = obj;
obj.bitArray = {
bitSlice(arr) {
const bitArray = obj.bitArray;
const substr = bitArray.M(arr.slice(arg1 / 32), 32 - (31 & arg1)).slice(1);
let clampResult = substr;
if (undefined !== arg2) {
const bitArray2 = obj.bitArray;
clampResult = bitArray2.clamp(substr, arg2 - arg1);
}
return clampResult;
},
extract(arg0, arg1, arg2) {
const rounded = Math.floor(-arg1 - arg2 & 31);
if (-32 & (arg1 + arg2 - 1 ^ arg1)) {
let tmp3 = tmp2 << 32 - rounded ^ arg0[arg1 / 32 + 1 | 0] >>> rounded;
} else {
tmp3 = tmp2 >>> rounded;
}
return tmp3 & (1 << arg2) - 1;
},
concat(arr) {
if (0 !== arr.length) {
if (0 !== arg1.length) {
const bitArray = obj.bitArray;
const partial = bitArray.getPartial(tmp);
if (32 === partial) {
let combined = arr.concat(arg1);
} else {
const bitArray2 = obj.bitArray;
combined = bitArray2.M(arg1, partial, tmp | 0, arr.slice(0, arr.length - 1));
const tmp5 = tmp | 0;
}
return combined;
}
}
return arr.concat(arg1);
},
bitLength(toBitsResult) {
let num = 0;
if (0 !== toBitsResult.length) {
const bitArray = obj.bitArray;
const diff = length - 1;
num = 32 * diff + bitArray.getPartial(toBitsResult[length - 1]);
}
return num;
},
clamp(arr) {
if (32 * arr.length < arg1) {
return arr;
} else {
const _Math = Math;
const substr = arr.slice(0, Math.ceil(arg1 / 32));
if (tmp) {
const bitArray = obj.bitArray;
const diff = length - 1;
substr[diff] = bitArray.partial(tmp5, substr[length - 1] & 2147483648 >> tmp5 - 1, 1);
}
return substr;
}
},
partial(arg0, arg1, arg2) {
let result = arg1;
if (32 === arg0) {
return result;
} else {
if (arg2) {
let tmp3 = result | 0;
} else {
tmp3 = result << 32 - arg0;
}
result = 1099511627776 * arg0;
const sum = tmp3 + result;
}
},
getPartial(arr) {
return Math.round(arr / 1099511627776) || 32;
},
equal(json, toBitsResult) {
let length;
const bitArray = obj.bitArray;
const bitArray2 = obj.bitArray;
if (bitLengthResult !== bitArray2.bitLength(toBitsResult)) {
return false;
} else {
let num2 = 0;
let num3 = 0;
let num4 = 0;
if (0 < json.length) {
do {
num3 = num3 | json[num2] ^ toBitsResult[num2];
num2 = num2 + 1;
num4 = num3;
length = json.length;
} while (num2 < length);
}
return 0 === num4;
}
bitLengthResult = bitArray.bitLength(json);
},
M(arr) {
let length;
let items = arg3;
if (undefined === arg3) {
items = [];
}
let diff = arg1;
let num = arg2;
let num2 = arg2;
let tmp2 = arg1;
if (32 <= arg1) {
do {
arr = items.push(num);
diff = diff - 32;
num = 0;
num2 = 0;
tmp2 = diff;
} while (32 <= diff);
}
if (0 === tmp2) {
return items.concat(arr);
} else {
let tmp5 = num2;
let num3 = 0;
let arr1 = num2;
if (0 < arr.length) {
do {
arr = items.push(tmp5 | arr[num3] >>> tmp2);
tmp5 = arr[num3] << 32 - tmp2;
num3 = num3 + 1;
arr1 = tmp5;
length = arr.length;
} while (num3 < length);
}
let num4 = 0;
if (arr.length) {
num4 = arr[arr.length - 1];
}
const bitArray = obj.bitArray;
const partial = bitArray.getPartial(num4);
const bitArray2 = obj.bitArray;
if (32 >= tmp2 + partial) {
arr1 = items.pop();
}
items.push(bitArray2.partial(tmp2 + partial & 31, arr1, 1));
return items;
}
},
Y(arg0, arg1) {
const items = [arg0[0] ^ arg1[0], arg0[1] ^ arg1[1], arg0[2] ^ arg1[2], arg0[3] ^ arg1[3]];
return items;
},
byteswapM(arg0) {
let length;
let num = 0;
if (0 < arg0.length) {
do {
let tmp = arg0[num];
arg0[num] = tmp >>> 24 | tmp >>> 8 & 65280 | (65280 & tmp) << 8 | tmp << 24;
num = num + 1;
length = arg0.length;
} while (num < length);
}
return arg0;
}
};
obj.codec.utf8String = {
fromBits(toBitsResult) {
const bitArray = obj.bitArray;
const bitLengthResult = bitArray.bitLength(toBitsResult);
let str = "";
let str2 = "";
let num = 0;
if (0 < bitLengthResult / 8) {
do {
if (!(3 & num)) {
let tmp2 = toBitsResult[num / 4];
}
let _String = String;
str = str + String.fromCharCode(tmp2 >>> 8 >>> 8 >>> 8);
tmp2 = tmp2 << 8;
num = num + 1;
str2 = str;
} while (num < bitLengthResult / 8);
}
return decodeURIComponent(escape(str2));
},
toBits(arg0) {
const unescapeResult = unescape(encodeURIComponent(arg0));
const items = [];
let num = 0;
let num2 = 0;
let num3 = 0;
let num4 = 0;
if (0 < unescapeResult.length) {
do {
let tmp = num2 << 8 | unescapeResult.charCodeAt(num);
let tmp2 = num;
let num5 = tmp;
if (!(3 & ~num)) {
let arr = items.push(tmp);
num5 = 0;
}
num = num + 1;
num2 = num5;
num4 = num5;
num3 = num;
} while (num < unescapeResult.length);
}
if (3 & num3) {
const bitArray = obj.bitArray;
items.push(bitArray.partial(8 * (3 & num3), num4));
}
return items;
}
};
obj.codec.hex = {
fromBits(toBitsResult) {
let length;
let str = "";
let num = 0;
let str2 = "";
if (0 < toBitsResult.length) {
do {
let str3 = 263882790666240 + (toBitsResult[num] | 0);
let str4 = str3.toString(16);
str = `${str4.substr(4)}`;
num = num + 1;
str2 = str;
length = toBitsResult.length;
} while (num < length);
}
const bitArray = obj.bitArray;
return str2.substr(0, bitArray.bitLength(toBitsResult) / 4);
},
toBits(str) {
let length;
const items = [];
const replaced = str.replace(/\s|0x/g, "");
let num = 0;
if (0 < `${arr2}00000000`.length) {
do {
let _parseInt = parseInt;
let arr = items.push(0 ^ parseInt(`${arr2}00000000`.substr(num, 8), 16));
num = num + 8;
length = `${arr2}00000000`.length;
} while (num < length);
}
const bitArray = obj.bitArray;
return bitArray.clamp(items, 4 * replaced.length);
}
};
obj.hash.sha256 = function(u) {
const self = this;
if (!this.b[0]) {
self.G();
}
if (u) {
u = u.u;
self.u = u.slice(0);
const o = u.o;
self.o = o.slice(0);
self.h = u.h;
} else {
self.reset();
}
};
obj.hash.sha256.hash = (arg0) => {
const sha256 = new obj.hash.sha256();
return sha256.update(arg0).finalize();
};
obj.hash.sha256.prototype = {
blockSize: 512,
reset() {
const K = this.K;
this.u = K.slice(0);
this.o = [];
this.h = 0;
return this;
},
update(toBitsResult) {
const self = this;
if ("string" === typeof toBitsResult) {
const utf8String = obj.codec.utf8String;
toBitsResult = utf8String.toBits(toBitsResult);
}
const bitArray = obj.bitArray;
const combined = bitArray.concat(self.o, toBitsResult);
self.o = combined;
const h = self.h;
const bitArray2 = obj.bitArray;
const sum = h + bitArray2.bitLength(toBitsResult);
self.h = sum;
if (9007199254740991 < sum) {
let invalid = obj.exception.invalid;
const prototype2 = invalid.prototype;
invalid = new invalid("Cannot hash more than 2^53 - 1 bits");
throw invalid;
} else {
const _Uint32Array2 = Uint32Array;
if ("undefined" !== typeof Uint32Array) {
const _Uint32Array = Uint32Array;
const uint32Array = new Uint32Array(combined);
let diff = 512 + h - (512 + h & 511);
let num10 = 0;
let num11 = 0;
if (diff <= sum) {
do {
let tmp12 = u;
let sum1 = num10 + 1;
let tmp14 = u(self, uint32Array.subarray(16 * num10, 16 * sum1));
diff = diff + 512;
num10 = sum1;
num11 = sum1;
} while (diff <= sum);
}
combined.splice(0, 16 * num11);
} else {
let diff1 = 512 + h - (512 + h & 511);
if (diff1 <= sum) {
do {
let tmp5 = u;
let tmp6 = u(self, combined.splice(0, 16));
diff1 = diff1 + 512;
} while (diff1 <= sum);
}
}
return self;
}
},
finalize() {
let length;
let o;
let tmp3;
let u;
const self = this;
const bitArray = obj.bitArray;
const bitArray2 = obj.bitArray;
({ o, u } = this);
const items = [bitArray2.partial(1, 1)];
const combined = bitArray.concat(o, items);
let sum = combined.length + 2;
if (15 & sum) {
do {
let arr = combined.push(0);
sum = sum + 1;
tmp3 = 15 & sum;
} while (tmp3);
}
combined.push(Math.floor(self.h / 4294967296));
combined.push(self.h | 0);
if (combined.length) {
do {
let tmp6 = u;
let tmp7 = u(self, combined.splice(0, 16));
length = combined.length;
} while (length);
}
self.reset();
return u;
},
K: [],
b: [],
G() {
let sum;
const self = this;
const fn = function a(arg0) {
return 4294967296 * (arg0 - Math.floor(arg0)) | 0;
};
let num = 0;
let num2 = 2;
do {
let num3 = 2;
let flag = true;
if (4 <= num2) {
flag = false;
while (0 != num2 % num3) {
num3 = num3 + 1;
flag = true;
if (num3 * num3 > num2) {
break;
}
}
}
sum = num;
if (flag) {
if (8 > num) {
let _Math = Math;
self.K[num] = fn(Math.pow(num2, 0.5));
}
let _Math2 = Math;
self.b[num] = fn(Math.pow(num2, 0.3333333333333333));
sum = num + 1;
}
num2 = num2 + 1;
num = sum;
} while (64 > sum);
}
};
obj.prng = function(D) {
const sha256 = new obj.hash.sha256();
const items = [sha256];
this.c = items;
this.i = [0];
this.H = 0;
this.v = {};
this.F = 0;
this.J = {};
this.T = 0;
this.j = 0;
this.f = 0;
this.L = 0;
this.b = [0, 0, 0, 0, 0, 0, 0, 0];
this.g = [0, 0, 0, 0];
this.C = undefined;
this.D = D;
this.s = false;
this.B = { progress: {}, seeded: {} };
this.S = 0;
this.m = 0;
this.w = 1;
this.A = 2;
this.O = 65536;
this.I = [0, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024];
this.P = 30000;
this.N = 80;
};
obj.prng.prototype = {
randomWords(arg0, arg1) {
const self = this;
const items = [];
const isReadyResult = this.isReady(arg1);
if (isReadyResult === this.m) {
let notReady = obj.exception.notReady;
const prototype4 = notReady.prototype;
notReady = new notReady("generator isn't seeded");
throw notReady;
} else {
if (isReadyResult & self.A) {
const items1 = [];
const _Date = Date;
const date = new Date();
const sum = date.valueOf() + self.P;
items1[0] = sum;
self.L = sum;
let num4 = 0;
do {
let _Math = Math;
let arr = items1.push(4294967296 * Math.random() | 0);
num4 = num4 + 1;
} while (16 > num4);
let tmp9 = items1;
let num5 = 0;
if (0 < self.c.length) {
const first = self.c[0];
const combined = items1.concat(first.finalize());
const first1 = self.i[0];
self.i[0] = 0;
let obj3 = combined;
let num7 = 0;
let tmp12 = first1;
if (!tmp2) {
const sum1 = num7 + 1;
tmp9 = obj3;
num5 = tmp12;
while (sum1 < self.c.length) {
let obj4 = self.c[sum1];
let combined1 = obj3.concat(obj4.finalize());
let sum2 = tmp12 + self.i[sum1];
self.i[sum1] = 0;
obj3 = combined1;
num7 = sum1;
tmp12 = sum2;
if (!tmp2) {
continue;
} else {
obj3 = combined1;
num7 = sum1;
tmp12 = sum2;
tmp9 = combined1;
num5 = sum2;
if (self.H & 1 << sum1) {
break;
}
}
continue;
}
} else {
obj3 = combined;
num7 = 0;
tmp12 = first1;
tmp9 = combined;
num5 = first1;
}
}
if (self.H >= 1 << self.c.length) {
const c = self.c;
let sha256 = obj.hash.sha256;
const prototype2 = sha256.prototype;
sha256 = new sha256();
c.push(sha256);
const i = self.i;
i.push(0);
}
self.f = self.f - num5;
if (num5 > self.j) {
self.j = num5;
}
self.H = self.H + 1;
const sha2562 = obj.hash.sha256;
const b = self.b;
self.b = sha2562.hash(b.concat(tmp9));
let aes = obj.cipher.aes;
const prototype3 = aes.prototype;
aes = new aes(self.b);
self.C = aes;
self.g[0] = self.g[0] + 1 | 0;
let num10 = 0;
if (!self.g[0]) {
num10 = num10 + 1;
while (4 > num10) {
self.g[num10] = self.g[num10] + 1 | 0;
if (self.g[num10]) {
break;
}
}
}
}
for (let num16 = 0; num16 < arg0; num16 = num16 + 4) {
if (0 === (num16 + 1) % self.O) {
let tmp29 = y;
let tmp30 = y(self);
}
let tmp31 = z;
let tmp32 = z(self);
let tmp33 = items;
let arr2 = items.push(tmp32[0], tmp32[1], tmp32[2], tmp32[3]);
}
y(self);
return items.slice(0, arg0);
}
},
setDefaultParanoia(D) {
if (0 === D) {
if ("Setting paranoia=0 will ruin your security; use it only for testing" !== arg1) {
let invalid = obj.exception.invalid;
const prototype = invalid.prototype;
invalid = new invalid("Setting paranoia=0 will ruin your security; use it only for testing");
throw invalid;
}
}
this.D = D;
},
addEntropy(items, arg1, accelerometer) {
let tmp13;
let str = accelerometer;
const self = this;
if (!accelerometer) {
str = "user";
}
const valueOfResult = new Date().valueOf();
let num = self.v[str];
let tmp3 = self.J[str];
const date = new Date();
if (undefined === tmp3) {
self.T = +self.T + 1;
self.J[str] = +self.T;
tmp3 = tmp4;
}
if (undefined === num) {
self.v[str] = 0;
num = 0;
}
self.v[str] = (self.v[str] + 1) % self.c.length;
if ("number" === typeof items) {
let num17 = arg1;
if (undefined === arg1) {
num17 = 1;
}
items = [tmp3, , , , , , ];
self.F = +self.F + 1;
items[1] = +self.F;
items[2] = 1;
items[3] = num17;
items[4] = valueOfResult;
items[5] = 1;
items[6] = items | 0;
self.c[num].update(items);
let num4 = 0;
let tmp9 = num17;
const obj5 = self.c[num];
} else if ("object" === tmp5) {
const _Object = Object;
const callResult = toString.call(items);
if ("[object Uint32Array]" === callResult) {
const items1 = [];
let num11 = 0;
let arr2 = items1;
let num7 = 0;
if (0 < items.length) {
do {
let arr = items1.push(items[num11]);
num11 = num11 + 1;
arr2 = items1;
num7 = 0;
tmp13 = num11 < items.length;
} while (tmp13);
}
} else {
let num6 = 0;
if ("[object Array]" !== callResult) {
num6 = 1;
}
arr2 = items;
num7 = num6;
if (0 < items.length) {
let num9 = 0;
let num8 = num6;
arr2 = items;
num7 = num6;
if (!num6) {
while (true) {
if ("number" !== typeof items[num9]) {
num8 = 1;
}
num9 = num9 + 1;
arr2 = items;
num7 = num8;
if (num9 >= items.length) {
break;
} else {
arr2 = items;
num7 = num8;
if (tmp11) {
break;
}
}
}
}
}
}
tmp9 = arg1;
num4 = num7;
if (!num7) {
let num12 = arg1;
if (undefined === arg1) {
let num14 = 0;
let num15 = 0;
num12 = 0;
if (0 < arr2.length) {
do {
let tmp14 = arr2[num15];
let sum = num14;
let tmp16 = num14;
if (0 < tmp14) {
do {
sum = sum + 1;
tmp14 = tmp14 >>> 1;
tmp16 = sum;
} while (0 < tmp14);
}
num15 = num15 + 1;
num14 = tmp16;
num12 = tmp16;
} while (num15 < arr2.length);
}
}
const items2 = [tmp3, , , , , ];
self.F = +self.F + 1;
items2[1] = +self.F;
items2[2] = 2;
items2[3] = num12;
items2[4] = valueOfResult;
items2[5] = arr2.length;
self.c[num].update(items2.concat(arr2));
tmp9 = num12;
num4 = num7;
const obj4 = self.c[num];
}
} else {
tmp9 = arg1;
num4 = 1;
if ("string" === tmp5) {
let length = arg1;
if (undefined === arg1) {
length = items.length;
}
const items3 = [tmp3, , , , , ];
self.F = +self.F + 1;
items3[1] = +self.F;
items3[2] = 3;
items3[3] = length;
items3[4] = valueOfResult;
items3[5] = items.length;
self.c[num].update(items3);
self.c[num].update(items);
num4 = 0;
tmp9 = length;
const obj2 = self.c[num];
const obj3 = self.c[num];
}
}
if (num4) {
let bug = obj.exception.bug;
const prototype = bug.prototype;
bug = new bug("random: addEntropy only supports number, array of numbers or string");
throw bug;
} else {
const i = self.i;
i[num] = i[num] + tmp9;
self.f = self.f + tmp9;
if (isReadyResult === self.m) {
if (self.isReady() !== self.m) {
const _Math = Math;
A("seeded", Math.max(self.j, self.f));
}
A("progress", self.getProgress());
}
}
isReadyResult = self.isReady();
},
isReady(arg0) {
let A;
let w;
let D = arg0;
w = this;
if (undefined === arg0) {
D = w.D;
}
if (w.j) {
if (w.j >= tmp) {
if (w.i[0] <= w.N) {
const w2 = w.w;
} else {
const _Date = Date;
const date = new Date();
}
({ A, w } = w);
}
}
if (w.f >= this.I[D]) {
let m = w.A | w.m;
} else {
m = w.m;
}
return m;
},
getProgress(id) {
let D = id;
const self = this;
if (!id) {
D = self.D;
}
let num = 1;
if (self.j < this.I[D]) {
num = 1;
if (self.f <= tmp) {
num = self.f / tmp;
}
}
return num;
},
startCollectors() {
const self = this;
if (!this.s) {
const obj = { loadTimeCollector: B(self, self.V), mouseCollector: B(self, self.W), keyboardCollector: B(self, self.U), accelerometerCollector: B(self, self.R), touchCollector: B(self, self.X) };
self.a = obj;
let flag = globalThis;
const _window = window;
if (window.addEventListener) {
const _window2 = flag.window;
const listener = _window2.addEventListener("load", self.a.loadTimeCollector, false);
const _window3 = flag.window;
const listener1 = _window3.addEventListener("mousemove", self.a.mouseCollector, false);
const _window4 = flag.window;
const listener2 = _window4.addEventListener("keypress", self.a.keyboardCollector, false);
const _window5 = flag.window;
const listener3 = _window5.addEventListener("devicemotion", self.a.accelerometerCollector, false);
const _window6 = flag.window;
const listener4 = _window6.addEventListener("touchmove", self.a.touchCollector, false);
} else {
const _document = document;
if (document.attachEvent) {
const _document2 = document;
document.attachEvent("onload", self.a.loadTimeCollector);
const _document3 = document;
document.attachEvent("onmousemove", self.a.mouseCollector);
const _document4 = document;
document.attachEvent("keypress", self.a.keyboardCollector);
} else {
let bug = obj.exception.bug;
const prototype = bug.prototype;
bug = new bug("can't attach event");
throw bug;
}
}
flag = true;
self.s = true;
}
},
stopCollectors() {
const self = this;
if (this.s) {
let flag = globalThis;
const _window = window;
if (window.removeEventListener) {
const _window2 = flag.window;
const removed = _window2.removeEventListener("load", self.a.loadTimeCollector, false);
const _window3 = flag.window;
const removed1 = _window3.removeEventListener("mousemove", self.a.mouseCollector, false);
const _window4 = flag.window;
const removed2 = _window4.removeEventListener("keypress", self.a.keyboardCollector, false);
const _window5 = flag.window;
const removed3 = _window5.removeEventListener("devicemotion", self.a.accelerometerCollector, false);
const _window6 = flag.window;
const removed4 = _window6.removeEventListener("touchmove", self.a.touchCollector, false);
} else {
const _document = document;
if (document.detachEvent) {
const _document2 = document;
document.detachEvent("onload", self.a.loadTimeCollector);
const _document3 = document;
document.detachEvent("onmousemove", self.a.mouseCollector);
const _document4 = document;
document.detachEvent("keypress", self.a.keyboardCollector);
}
}
flag = false;
self.s = false;
}
},
addEventListener(arg0, arg1) {
this.S = +this.S + 1;
this.B[arg0][+this.S] = arg1;
},
removeEventListener(arg0, arg1) {
let length;
const items = [];
for (const key10008 in obj) {
let tmp6 = key10008;
let hasOwnPropertyResult = obj.hasOwnProperty(key10008);
if (hasOwnPropertyResult) {
hasOwnPropertyResult = obj[key10008] === arg1;
}
if (!hasOwnPropertyResult) {
continue;
} else {
let arr = items.push(key10008);
continue;
}
continue;
}
let num = 0;
if (0 < items.length) {
do {
let tmp5 = items[num];
delete tmp2[tmp];
num = num + 1;
length = items.length;
} while (num < length);
}
},
U() {
C(this, 1);
},
W(arg0) {
const self = this;
const x = arg0.x;
let clientX = x;
if (!x) {
clientX = arg0.clientX;
}
let offsetX = clientX;
if (!clientX) {
offsetX = arg0.offsetX;
}
let num = offsetX;
if (!offsetX) {
num = 0;
}
const y = arg0.y;
let clientY = y;
if (!y) {
clientY = arg0.clientY;
}
let offsetY = clientY;
if (!clientY) {
offsetY = arg0.offsetY;
}
let num2 = offsetY;
if (!offsetY) {
num2 = 0;
}
while (true) {
let tmp6 = tmp3;
let num3 = 0;
let tmp7 = 0 != tmp3;
let tmp8 = tmp7;
if (!tmp7) {
break;
} else {
let tmp9 = tmp5;
tmp8 = 0 != tmp5;
break;
}
if (tmp8) {
let items = [tmp3, tmp5];
let num4 = 2;
let str = "mouse";
let addEntropyResult = self.addEntropy(items, 2, "mouse");
}
let tmp11 = C;
let tmp12 = C(self, 0);
}
},
X(arg0) {
const self = this;
let clientX = tmp.pageX;
if (!clientX) {
clientX = tmp.clientX;
}
const items = [clientX, arg0.touches[0] || arg0.changedTouches[0].pageY || arg0.touches[0] || arg0.changedTouches[0].clientY];
self.addEntropy(items, 1, "touch");
C(self, 0);
},
V() {
C(this, 2);
},
R(accelerationIncludingGravity) {
const self = this;
if (window.orientation) {
const _window = window;
if ("number" === typeof orientation) {
self.addEntropy(orientation, 1, "accelerometer");
}
}
if (accelerationIncludingGravity.accelerationIncludingGravity.x || accelerationIncludingGravity.accelerationIncludingGravity.y || accelerationIncludingGravity.accelerationIncludingGravity.z) {
self.addEntropy(tmp, 2, "accelerometer");
}
C(self, 0);
}
};
const prng = new obj.prng(6);
obj.random = prng;
let _exports = tmp3;
if (undefined !== module) {
_exports = module.exports;
}
if (!_exports) {
if (_exports) {
if (undefined.randomBytes) {
let _Uint32Array = Uint32Array;
const _Uint8Array = Uint8Array;
const uint8Array = new Uint8Array(undefined.randomBytes(128));
let uint32Array = new Uint32Array(uint8Array.buffer);
const random2 = tmp.random;
random2.addEntropy(uint32Array, 1024, "crypto['randomBytes']");
}
while (true) {
let tmp29 = module;
let tmp30 = undefined !== module;
let _exports2 = tmp30;
if (!tmp30) {
break;
} else {
let tmp31 = module;
_exports2 = module.exports;
break;
}
if (_exports2) {
module.exports = obj;
}
}
}
let _window = window;
if ("undefined" !== typeof window) {
let _Uint32Array2 = Uint32Array;
if ("undefined" !== typeof Uint32Array) {
const _Uint32Array3 = Uint32Array;
const uint32Array1 = new Uint32Array(32);
const _window7 = window;
if (window.crypto) {
let _window2 = window;
if (window.crypto.getRandomValues) {
let _window6 = window;
const _crypto = window.crypto;
const randomValues = _crypto.getRandomValues(tmp35);
const random = tmp.random;
random.addEntropy(tmp35, 1024, "crypto['getRandomValues']");
}
}
let _window3 = window;
if (window.msCrypto) {
let _window4 = window;
if (window.msCrypto.getRandomValues) {
let _window5 = window;
const randomValues1 = msCrypto.getRandomValues(tmp35);
}
}
}
}
} else {
let globalResult = global("crypto");
while (true) {
let tmp7 = __exception;
globalResult = null;
continue;
}
}
},
{ crypto: undefined }
];
items = [
(arg0, arg1, arg2) => {
let obj = {};
obj = { type: global("../lib/braintree-error").types.MERCHANT, code: "FASTLANE_SDK_LOAD_ERROR" };
obj.FASTLANE_SDK_LOAD_ERROR = obj;
module.exports = obj;
},
{ "../lib/braintree-error": 143 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("../lib/braintree-error");
let closure_1 = global("./errors");
const loadFastlane = global("../lib/assets").loadFastlane;
const assign = global("../lib/assign").assign;
module.exports = global("@braintree/wrap-promise")(function fastlane(arg0) {
let client;
let client2;
let closure_0 = arg0;
({ client, client: client2 } = arg0);
const configuration = client.getConfiguration();
let flag = true;
const version = client2.getVersion();
if ("production" !== configuration.gatewayConfiguration.environment) {
flag = false;
}
const obj = { platform: "BT", btSdkVersion: version, minified: flag };
const promise = loadFastlane(assign(obj, arg0));
return loadFastlane(assign(obj, arg0)).then((metadata) => {
const platformOptions = { platform: "BT", authorization: closure_0.authorization, client: closure_0.client, deviceData: closure_0.deviceData };
delete tmp.authorization;
delete tmp.client;
delete tmp.deviceData;
delete tmp.minified;
delete tmp.btSdkVersion;
return fastlane.create(outer1_3({ platformOptions }, closure_0, metadata.metadata));
}).catch((message) => Promise.reject(new closure_0({ type: outer1_1.FASTLANE_SDK_LOAD_ERROR.type, code: outer1_1.FASTLANE_SDK_LOAD_ERROR.code, message: message.message })));
});
},
{ "../lib/assets": 139, "../lib/assign": 140, "../lib/braintree-error": 143, "./errors": 117, "@braintree/wrap-promise": 40 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("../lib/basic-component-verification");
let closure_1 = global("./fastlane");
let closure_2 = global("../lib/create-assets-url");
let closure_3 = global("../lib/create-deferred-client");
const assign = global("../lib/assign").assign;
const globalResult = global("@braintree/wrap-promise");
module.exports = {
create: global("@braintree/wrap-promise")(function create(client) {
let closure_0 = client;
const obj = { name: "fastlane", client: client.client, authorization: client.authorization };
const verifyResult = closure_0.verify({ name: "fastlane", client: client.client, authorization: client.authorization });
return closure_0.verify({ name: "fastlane", client: client.client, authorization: client.authorization }).then(() => outer1_3.create({ authorization: client.authorization, client: client.client, assetsUrl: outer1_2.create(client.authorization), name: "fastlane" })).then((client) => outer1_1(outer1_4({ client, deviceData: client.deviceData }, client)));
}),
VERSION: "3.112.1"
};
},
{ "../lib/assign": 140, "../lib/basic-component-verification": 141, "../lib/create-assets-url": 148, "../lib/create-deferred-client": 150, "./fastlane": 118, "@braintree/wrap-promise": 40 }
];
items = [
(arg0, arg1, arg2) => {
const globalResult = global("../lib/braintree-error");
let obj = { type: globalResult.types.MERCHANT, code: "GOOGLE_PAYMENT_NOT_ENABLED", message: "Google Pay is not enabled for this merchant." };
obj = { code: "GOOGLE_PAYMENT_GATEWAY_ERROR", message: "There was an error when tokenizing the Google Pay payment method.", type: globalResult.types.UNKNOWN };
obj = { code: "GOOGLE_PAYMENT_UNSUPPORTED_VERSION", type: globalResult.types.MERCHANT };
module.exports = { GOOGLE_PAYMENT_NOT_ENABLED: obj, GOOGLE_PAYMENT_GATEWAY_ERROR: obj, GOOGLE_PAYMENT_UNSUPPORTED_VERSION: obj };
},
{ "../lib/braintree-error": 143 }
];
items = [
(arg0, arg1, arg2) => {
class GooglePayment {
constructor(arg0) {
self = this;
({ createPromise: this._createPromise, client: this._client, useDeferredClient: this._useDeferredClient } = global);
self._googlePayVersion = global.googlePayVersion || 1;
self._googleMerchantId = global.googleMerchantId;
if (self._isUnsupportedGooglePayAPIVersion()) {
tmp = c5;
obj = {};
tmp2 = c6;
obj.code = c6.GOOGLE_PAYMENT_UNSUPPORTED_VERSION.code;
str = "The Braintree SDK does not support Google Pay version ";
str2 = ". Please upgrade the version of your Braintree SDK and contact support if this error persists.";
obj.message = `The Braintree SDK does not support Google Pay version ${self._googlePayVersion}. Please upgrade the version of your Braintree SDK and contact support if this error persists.`;
tmp3 = c6;
obj.type = c6.GOOGLE_PAYMENT_UNSUPPORTED_VERSION.type;
prototype = c5.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c5(obj);
tmp8 = tmp7;
throw tmp7;
} else {
return;
}
}
_waitForClient() {
self = this;
if (this._client) {
tmp2 = globalThis;
_Promise = Promise;
resolved = Promise.resolve();
} else {
_createPromise = self._createPromise;
fn = function(_client) {
this._client = _client;
};
resolved = _createPromise.then(fn.bind(self));
}
return resolved;
}
_isUnsupportedGooglePayAPIVersion() {
return !(this._googlePayVersion in closure_8);
}
_getDefaultConfig() {
self = this;
if (!this._defaultConfig) {
tmp = c4;
_client = self._client;
self._defaultConfig = c4(_client.getConfiguration(), self._googlePayVersion, self._googleMerchantId);
}
return self._defaultConfig;
}
_createV1PaymentDataRequest(arg0) {
_getDefaultConfigResult = this._getDefaultConfig();
tmp2 = global.cardRequirements && global.cardRequirements.allowedCardNetworks || _getDefaultConfigResult.cardRequirements.allowedCardNetworks;
tmp3 = assign({}, _getDefaultConfigResult, global);
tmp3.cardRequirements.allowedCardNetworks = tmp2;
return tmp3;
}
_createV2PaymentDataRequest(arg0) {
_getDefaultConfigResult = this._getDefaultConfig();
c0 = _getDefaultConfigResult;
if (global.allowedPaymentMethods) {
prop = global.allowedPaymentMethods;
item = prop.forEach((type) => {
let tmp = outer1_3(obj.allowedPaymentMethods, "type", type.type);
if (tmp) {
(function applyDefaultsToPaymentMethodConfiguration(type, arg1) {
let closure_0 = type;
let closure_1 = arg1;
const keys = Object.keys(arg1);
const item = keys.forEach((arg0) => {
if ("object" === typeof dependencyMap[arg0]) {
type[arg0] = outer3_1({}, dependencyMap[arg0], type[arg0]);
} else {
let tmp2 = type[arg0];
if (!tmp2) {
tmp2 = dependencyMap[arg0];
}
type[arg0] = tmp2;
const tmp = type;
}
});
})(type, tmp);
}
});
}
return assign({}, _getDefaultConfigResult, global);
}
createPaymentDataRequest(arg0) {
self = this;
closure_0 = global;
if (this._useDeferredClient) {
_waitForClientResult = self._waitForClient();
fn = function() {
return this._createPaymentDataRequestSyncronously(closure_0);
};
nextPromise = _waitForClientResult.then(fn.bind(self));
} else {
nextPromise = self._createPaymentDataRequestSyncronously(global);
}
return nextPromise;
}
_createPaymentDataRequestSyncronously(arg0) {
self = this;
tmp = assign({}, global);
_googlePayVersion = this._googlePayVersion;
totalPrice = tmp.transactionInfo;
if (totalPrice) {
totalPrice = tmp.transactionInfo.totalPrice;
}
if (totalPrice) {
str = tmp.transactionInfo.totalPrice;
tmp.transactionInfo.totalPrice = str.toString();
}
sendEventResult = c0.sendEvent(self._createPromise, `google-payment.v${_googlePayVersion}.createPaymentDataRequest`);
return self[closure_8[_googlePayVersion]](tmp);
}
parseResponse(arg0) {
closure_0 = global;
self = this;
resolved = Promise.resolve();
nextPromise = resolved.then(() => {
if (2 === closure_0.apiVersion) {
let token = closure_0.paymentMethodData.tokenizationData.token;
} else {
token = closure_0.paymentMethodToken.token;
}
const parsed = JSON.parse(token);
const error = parsed.error;
if (error) {
let rejectResult = Promise.reject(error);
} else {
closure_0.sendEvent(self._createPromise, "google-payment.parseResponse.succeeded");
if (parsed.paypalAccounts) {
closure_0.sendEvent(self._createPromise, "google-payment.parseResponse.succeeded.paypal");
let obj = {};
({ nonce: obj3.nonce, type: obj3.type, description: obj3.description } = parsed.paypalAccounts[0]);
rejectResult = Promise.resolve(obj);
} else {
const first = parsed.androidPayCards[0];
closure_0.sendEvent(self._createPromise, "google-payment.parseResponse.succeeded.google-payment");
obj = {};
({ nonce: obj.nonce, type: obj.type, description: obj.description } = first);
obj = { cardType: first.details.cardType, lastFour: first.details.lastFour, lastTwo: first.details.lastTwo, isNetworkTokenized: first.details.isNetworkTokenized, bin: first.details.bin };
obj.details = obj;
obj.binData = first.binData;
rejectResult = Promise.resolve(obj);
}
}
return rejectResult;
});
return nextPromise.catch((originalError) => {
closure_0.sendEvent(self._createPromise, "google-payment.parseResponse.failed");
obj = { code: outer1_6.GOOGLE_PAYMENT_GATEWAY_ERROR.code, message: outer1_6.GOOGLE_PAYMENT_GATEWAY_ERROR.message, type: outer1_6.GOOGLE_PAYMENT_GATEWAY_ERROR.type, details: obj };
obj = { originalError };
return Promise.reject(new outer1_5(obj));
});
}
teardown() {
tmp = c2(this, c7(GooglePayment.prototype));
return Promise.resolve();
}
}
let closure_0 = global("../lib/analytics");
const assign = global("../lib/assign").assign;
let closure_2 = global("../lib/convert-methods-to-error");
let closure_3 = global("../lib/find");
let closure_4 = global("../lib/generate-google-pay-configuration");
let closure_5 = global("../lib/braintree-error");
let closure_6 = global("./errors");
let closure_7 = global("../lib/methods");
let closure_8 = { 1: "_createV1PaymentDataRequest", 2: "_createV2PaymentDataRequest" };
module.exports = global("@braintree/wrap-promise").wrapPrototype(GooglePayment);
},
{ "../lib/analytics": 138, "../lib/assign": 140, "../lib/braintree-error": 143, "../lib/convert-methods-to-error": 146, "../lib/find": 156, "../lib/generate-google-pay-configuration": 168, "../lib/methods": 175, "./errors": 120, "@braintree/wrap-promise": 40 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("./google-payment");
let closure_1 = global("../lib/braintree-error");
let closure_2 = global("../lib/create-assets-url");
let closure_3 = global("../lib/create-deferred-client");
let closure_4 = global("../lib/basic-component-verification");
let closure_5 = global("./errors");
const globalResult = global("@braintree/wrap-promise");
module.exports = {
create: global("@braintree/wrap-promise")(function create(client) {
let closure_0 = client;
return closure_4.verify({ name: "Google Pay", client: client.client, authorization: client.authorization }).then(() => {
let obj = { authorization: client.authorization, client: client.client, debug: client.debug, assetsUrl: outer1_2.create(client.authorization), name: "Google Pay" };
obj = outer1_3.create(obj);
const nextPromise = obj.then((client) => {
let rejectResult = client;
closure_0.client = client;
if (!client.getConfiguration().gatewayConfiguration.androidPay) {
const prototype = outer2_1.prototype;
const tmp7 = new outer2_1(outer2_5.GOOGLE_PAYMENT_NOT_ENABLED);
rejectResult = Promise.reject(tmp7);
}
return rejectResult;
});
client.createPromise = nextPromise;
const tmp = new client(client);
let nextPromise1 = tmp;
client = tmp;
if (!client.useDeferredClient) {
nextPromise1 = nextPromise.then((_client) => {
closure_0._client = _client;
return closure_0;
});
}
return nextPromise1;
});
}),
VERSION: "3.112.1"
};
},
{ "../lib/basic-component-verification": 141, "../lib/braintree-error": 143, "../lib/create-assets-url": 148, "../lib/create-deferred-client": 150, "./errors": 120, "./google-payment": 121, "@braintree/wrap-promise": 40 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("../../lib/braintree-error");
let closure_1 = global("../shared/errors");
const allowedAttributes = global("../shared/constants").allowedAttributes;
module.exports = function attributeValidationError(arg0, arg1) {
if (allowedAttributes.hasOwnProperty(arg0)) {
if (null == arg1) {
if (!tmp8) {
let obj = { type: constants.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.type, code: constants.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.code, message: `Value "${arg1}" is not allowed for "${arg0}" attribute.` };
const prototype2 = ctor.prototype;
let tmp6 = new ctor(obj);
}
} else {
let str3 = "string";
if ("string" === allowedAttributes[arg0]) {
str3 = `string` === tmp13;
if (!str3) {
str3 = "number" === tmp13;
}
let flag = str3;
} else {
flag = false;
if ("boolean" === allowedAttributes[arg0]) {
const _String = String;
let tmp12 = "true" === String(arg1);
if (!tmp12) {
const _String2 = String;
tmp12 = "false" === String(arg1);
}
flag = tmp12;
}
}
}
} else {
obj = { type: constants.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.type, code: constants.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.code, message: `The "${arg0}" attribute is not supported in Hosted Fields.` };
const prototype = ctor.prototype;
tmp6 = new ctor(obj);
}
return tmp6;
};
},
{ "../../lib/braintree-error": 143, "../shared/constants": 131, "../shared/errors": 132 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("../shared/constants");
let closure_1 = global("../../lib/use-min");
module.exports = function composeUrl(arg0, arg1, arg2) {
const text = `${arg0}/web/${closure_0.VERSION}`;
return text + "/html/hosted-fields-frame" + callback(arg2) + ".html#" + arg1;
};
},
{ "../../lib/use-min": 181, "../shared/constants": 131 }
];
items = [
(arg0, arg1, arg2) => {
function _isUserFocusableElement(tagName) {
if (closure_1.hasSoftwareKeyboard()) {
let tmp3 = closure_4.indexOf(tagName.tagName) > -1;
if (tmp3) {
tmp3 = closure_5.indexOf(tagName.type) < 0;
}
let tmp = tmp3;
} else {
tmp = "hidden" !== tagName.type;
}
return tmp;
}
function _findFirstFocusableElement(callResult) {
let num = 0;
if (0 < callResult.length) {
while (!_isUserFocusableElement(callResult[num])) {
num = num + 1;
}
return callResult[num];
}
return null;
}
const navigationDirections = global("../shared/constants").navigationDirections;
let closure_1 = global("../shared/browser-detection");
let closure_2 = global("../shared/focus-intercept");
let closure_3 = global("../shared/find-parent-tags");
let closure_4 = ["INPUT", "SELECT", "TEXTAREA"];
let closure_5 = ["hidden", "button", "reset", "submit", "checkbox", "radio", "file"];
module.exports = {
removeExtraFocusElements(first, fn) {
let closure_0 = fn;
const callResult = slice.call(first.elements);
const items = [_findFirstFocusableElement(callResult), _findFirstFocusableElement(callResult.reverse())];
const item = items.forEach((getAttribute) => {
let matchFocusElementResult = getAttribute;
if (getAttribute) {
matchFocusElementResult = outer1_2.matchFocusElement(getAttribute.getAttribute("id"));
}
if (matchFocusElementResult) {
callback(getAttribute.getAttribute("id"));
}
});
},
createFocusChangeHandler(arg0, arg1) {
let closure_0 = arg0;
let closure_1 = arg1;
return (direction) => {
const element = document.getElementById(`bt-${direction.field}-${direction.direction}-${closure_0}`);
if (element) {
const first = outer1_3(element, "form")[0];
const _document = document;
if (document.forms.length >= 1) {
if (first) {
const slice = [].slice;
const callResult = slice.call(first.elements);
const index = callResult.indexOf(element);
let obj = (function _createNavigationHelper(direction, length) {
const constants = length;
if (constants.BACK === direction) {
let obj = { checkIndexBounds() { ... }, indexChange: -1 };
return obj;
} else if (constants.FORWARD === direction) {
obj = { checkIndexBounds() { ... }, indexChange: 1 };
return obj;
} else {
return {};
}
})(direction.direction, callResult.length);
let tmp5 = index;
const sum = tmp5 + obj.indexChange;
while (!obj.checkIndexBounds(sum)) {
let obj2 = callResult[sum];
let tmp7 = outer1_6;
tmp5 = sum;
if (!outer1_6(obj2)) {
continue;
} else {
let tmp8 = outer1_2;
let str2 = "id";
if (outer1_2.matchFocusElement(obj2.getAttribute("id"))) {
let tmp10 = closure_1;
let str3 = "data-braintree-type";
let onTriggerInputFocusResult = closure_1.onTriggerInputFocus(obj2.getAttribute("data-braintree-type"));
} else {
let focusResult = obj2.focus();
}
}
}
}
}
const result = closure_1.onRemoveFocusIntercepts();
}
};
}
};
},
{ "../shared/browser-detection": 130, "../shared/constants": 131, "../shared/find-parent-tags": 133, "../shared/focus-intercept": 134 }
];
items = [
(arg0, arg1, arg2) => {
let allowedStyles = global("../shared/constants").allowedStyles;
module.exports = function getStylesFromClass(str) {
const element = ;
const obj = {};
let substr = str;
if ("." === str[0]) {
substr = str.substring(1);
}
element.className = substr;
element.style.display = "none !important";
element.style.position = "fixed !important";
element.style.left = "-99999px !important";
element.style.top = "-99999px !important";
body.appendChild(element);
const allowedStyles = window.getComputedStyle(element);
const item = allowedStyles.forEach((arg0) => {
if (table[arg0]) {
obj[arg0] = tmp;
}
});
body2.removeChild(element);
return obj;
};
},
{ "../shared/constants": 131 }
];
items = [
(arg0, arg1, arg2) => {
class HostedFields {
constructor(arg0) {
self = this;
closure_0 = global;
self = this;
obj = {};
c4 = obj;
framebus = {};
items = [];
c6 = items;
tmp = c13();
c7 = tmp;
sessionId = global.sessionId;
this._merchantConfigurationOptions = closure_0({}, global);
if (global.client) {
client = global.client;
configuration = client.getConfiguration(undefined, sessionId);
assetsUrl = configuration.gatewayConfiguration.assetsUrl;
isDebug = configuration.isDebug;
} else {
tmp2 = f30201;
tmp4 = globalThis;
_Boolean = Boolean;
obj = f30201.create(global.authorization);
assetsUrl = obj;
isDebug = Boolean(global.isDebug);
}
obj1 = { client: global.client, authorization: global.authorization };
obj1.debug = isDebug;
obj1.assetsUrl = assetsUrl;
obj1.name = "Hosted Fields";
obj1.sessionId = sessionId;
self._clientPromise = c6.create(obj1);
isDebug = c8(assetsUrl, tmp, isDebug);
if (global.fields) {
tmp6 = globalThis;
_Object = Object;
num = 0;
if (0 !== Object.keys(global.fields).length) {
tmp32 = closure_17;
callResult = closure_17.call(self);
self._injectedNodes = [];
tmp34 = self;
prototype = self.prototype;
tmp35 = new.target;
tmp36 = new.target;
tmp37 = new self();
tmp38 = tmp37;
self._destructor = tmp37;
self._fields = obj;
obj2 = {};
obj2.fields = {};
tmp39 = c26;
str3 = "";
obj2.cards = c26("");
self._state = obj2;
tmp40 = framebus;
obj3 = {};
obj3.channel = tmp;
tmp41 = isDebug;
obj3.verifyDomain = isDebug;
_window = window;
items1 = [];
items1[0] = window;
obj3.targetFrames = items1;
prototype2 = framebus.prototype;
tmp42 = new.target;
tmp43 = new.target;
tmp44 = obj3;
tmp45 = new framebus(obj3);
tmp46 = tmp45;
self._bus = tmp45;
_destructor4 = self._destructor;
result = _destructor4.registerFunctionForTeardown(() => {
const _bus = self._bus;
_bus.teardown();
});
tmp48 = c19;
sendEvent = c19.sendEvent;
_clientPromise = self._clientPromise;
if (global.client) {
str2 = "custom.hosted-fields.initialized";
sendEventResult = sendEvent(_clientPromise, "custom.hosted-fields.initialized");
} else {
str = "custom.hosted-fields.initialized.deferred-client";
sendEventResult1 = sendEvent(_clientPromise, "custom.hosted-fields.initialized.deferred-client");
}
_Object2 = Object;
keys = Object.keys(global.fields);
fn = function(fieldKey) {
const self = this;
const fields = fieldKey;
const allowedFields = outer1_10.allowedFields;
if (allowedFields.hasOwnProperty(fieldKey)) {
let element = tmp11;
if ("string" === typeof fields.fields[fieldKey].container || fields.fields[fieldKey].selector) {
const _document = document;
element = document.querySelector(tmp11);
}
if (element) {
if (1 === element.nodeType) {
if (element.querySelector("iframe[name^=\"braintree-\"]")) {
let obj = { type: outer1_11.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.type, code: outer1_11.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.code, message: outer1_11.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.message };
obj = {};
({ selector: obj11.fieldSelector, container: obj11.fieldContainer } = tmp10);
obj.fieldKey = fieldKey;
obj.details = obj;
const prototype5 = tmp.prototype;
const tmp59 = new tmp(obj);
throw tmp59;
} else {
let transformToSlotResult = element;
if (outer1_22.isShadowElement(element)) {
transformToSlotResult = outer1_22.transformToSlot(element, "height: 100%");
}
if (tmp10.maxlength) {
if ("number" !== typeof tmp10.maxlength) {
const obj1 = { type: outer1_11.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type, code: outer1_11.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code, message: "The value for maxlength must be a number." };
const obj2 = { fieldKey };
obj1.details = obj2;
const prototype4 = tmp.prototype;
const tmp50 = new tmp(obj1);
throw tmp50;
}
}
if (tmp10.minlength) {
if ("number" !== typeof tmp10.minlength) {
const obj3 = { type: outer1_11.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type, code: outer1_11.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code, message: "The value for minlength must be a number." };
const obj4 = { fieldKey };
obj3.details = obj4;
const prototype3 = tmp.prototype;
const tmp42 = new tmp(obj3);
throw tmp42;
}
}
const obj5 = { type: fieldKey, name: `braintree-hosted-field-${fieldKey}`, style: outer1_10.defaultIFrameStyle };
let iframeTitle = tmp10.iframeTitle;
if (!iframeTitle) {
iframeTitle = `Secure Credit Card Frame - ${outer1_10.allowedFields[fieldKey].label}`;
}
obj5.title = iframeTitle;
const tmp16Result = obj(obj5);
let closure_1 = tmp16Result;
const _bus = self._bus;
_bus.addTargetFrame(tmp16Result);
const push = self._injectedNodes.push;
push.apply(self._injectedNodes, outer1_18(tmp, tmp16Result, transformToSlotResult, () => {
outer1_3.focus(closure_0);
}));
self._setupLabelFocus(fieldKey, element);
const obj6 = { frameElement: tmp16Result, containerElement: element };
obj[fieldKey] = obj6;
const promise = new Promise((arg0) => {
outer1_5[closure_0] = arg0;
});
items.push(promise);
const obj7 = { isEmpty: true, isValid: false, isPotentiallyValid: true, isFocused: false, container: element };
self._state.fields[fieldKey] = obj7;
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
closure_1.src = outer1_2;
}, 0);
}
}
}
const obj8 = { type: outer1_11.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.type, code: outer1_11.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.code, message: outer1_11.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.message };
const obj9 = {};
({ selector: obj13.fieldSelector, container: obj13.fieldContainer } = fields.fields[fieldKey]);
obj9.fieldKey = fieldKey;
obj8.details = obj9;
const prototype6 = tmp.prototype;
const tmp68 = new tmp(obj8);
throw tmp68;
} else {
obj = { type: outer1_11.HOSTED_FIELDS_INVALID_FIELD_KEY.type, code: outer1_11.HOSTED_FIELDS_INVALID_FIELD_KEY.code, message: `"${fieldKey}" is not a valid field.` };
const prototype = tmp.prototype;
const tmp7 = new tmp(obj);
throw tmp7;
}
};
item = keys.forEach(fn.bind(self));
if (self._merchantConfigurationOptions.styles) {
_Object3 = Object;
keys1 = Object.keys(self._merchantConfigurationOptions.styles);
item1 = keys1.forEach((arg0) => {
if ("string" === typeof self._merchantConfigurationOptions.styles[arg0]) {
self._merchantConfigurationOptions.styles[arg0] = outer1_9(tmp);
}
});
}
_bus = self._bus;
tmp11 = events;
onResult = _bus.on(events.REMOVE_FOCUS_INTERCEPTS, (id) => {
if (id) {
id = id.id;
}
outer1_29(id);
});
_bus2 = self._bus;
tmp13 = events;
tmp14 = c28;
obj4 = {};
obj4.onRemoveFocusIntercepts = function onRemoveFocusIntercepts(id) {
const _bus = self._bus;
_bus.emit(outer1_16.REMOVE_FOCUS_INTERCEPTS, { id });
};
obj4.onTriggerInputFocus = function onTriggerInputFocus(attribute) {
self.focus(attribute);
};
onResult1 = _bus2.on(events.TRIGGER_FOCUS_CHANGE, c28.createFocusChangeHandler(tmp, obj4));
_bus3 = self._bus;
tmp16 = events;
onResult2 = _bus3.on(events.READY_FOR_CLIENT, (arg0) => {
let closure_0 = arg0;
self._clientPromise.then((arg0) => {
callback(arg0);
});
});
_bus4 = self._bus;
tmp18 = events;
onResult3 = _bus4.on(events.CARD_FORM_ENTRY_HAS_BEGUN, () => {
outer1_19.sendEvent(self._clientPromise, "hosted-fields.input.started");
});
_bus5 = self._bus;
tmp20 = events;
onResult4 = _bus5.on(events.BIN_AVAILABLE, (bin) => {
self._emit("binAvailable", { bin });
});
_setTimeout = setTimeout;
tmp22 = INTEGRATION_TIMEOUT_MS;
f30201 = setTimeout(() => {
outer1_19.sendEvent(self._clientPromise, "custom.hosted-fields.load.timed-out");
self._emit("timeout");
}, INTEGRATION_TIMEOUT_MS);
_Promise = Promise;
allPromises = Promise.all(items);
nextPromise = allPromises.then((arg0) => {
clearTimeout(closure_1);
arg0[0]((function formatMerchantConfigurationForIframes(_merchantConfigurationOptions) {
const tmp = callback({}, _merchantConfigurationOptions);
callback = tmp;
tmp.fields = callback({}, tmp.fields);
const keys = Object.keys(tmp.fields);
const item = keys.forEach((arg0) => {
tmp.fields[arg0] = tmp({}, tmp.fields[arg0]);
delete tmp.container;
});
return tmp;
})(self._merchantConfigurationOptions));
const result = self._cleanUpFocusIntercepts();
self._emit("ready");
});
_bus6 = self._bus;
tmp24 = events;
onResult5 = _bus6.on(events.FRAME_READY, (arg0, arg1) => {
dependencyMap[arg0.field](arg1);
});
_bus7 = self._bus;
tmp26 = events;
obj4 = (function createInputEventHandler(arg0) {
let closure_0 = arg0;
return function(merchantPayload) {
merchantPayload = merchantPayload.merchantPayload;
const emittedBy = merchantPayload.emittedBy;
const containerElement = merchantPayload[emittedBy].containerElement;
const keys = Object.keys(merchantPayload.fields);
const item = keys.forEach((arg0) => {
merchantPayload.fields[arg0].container = merchantPayload[arg0].containerElement;
});
const classList = containerElement.classList;
classList.toggle(outer2_10.externalClasses.FOCUSED, merchantPayload.fields[emittedBy].isFocused);
const classList2 = containerElement.classList;
classList2.toggle(outer2_10.externalClasses.VALID, merchantPayload.fields[emittedBy].isValid);
const classList3 = containerElement.classList;
classList3.toggle(outer2_10.externalClasses.INVALID, !merchantPayload.fields[emittedBy].isPotentiallyValid);
this._state = { cards: merchantPayload.cards, fields: merchantPayload.fields };
this._emit(merchantPayload.type, merchantPayload);
};
})(obj);
onResult6 = _bus7.on(events.INPUT_EVENT, obj4.bind(self));
_destructor = self._destructor;
result1 = _destructor.registerFunctionForTeardown(() => {
let length;
let num = 0;
if (0 < self._injectedNodes.length) {
do {
let tmp = self;
let tmp2 = self._injectedNodes[num];
let parentNode = tmp2.parentNode;
let removeChildResult = parentNode.removeChild(tmp2);
let classList = parentNode.classList;
let tmp4 = outer1_10;
let tmp5 = outer1_10;
let tmp6 = outer1_10;
let removeResult = classList.remove(outer1_10.externalClasses.FOCUSED, outer1_10.externalClasses.INVALID, outer1_10.externalClasses.VALID);
num = num + 1;
length = self._injectedNodes.length;
} while (num < length);
}
});
_destructor2 = self._destructor;
result2 = _destructor2.registerFunctionForTeardown(() => {
outer1_29();
});
_destructor3 = self._destructor;
result3 = _destructor3.registerFunctionForTeardown(() => {
outer1_24(self, outer1_21(outer1_30.prototype).concat(outer1_21(outer1_17.prototype)));
});
return;
}
}
obj5 = { type: c25.INSTANTIATION_OPTION_REQUIRED.type, code: c25.INSTANTIATION_OPTION_REQUIRED.code, message: "options.fields is required when instantiating Hosted Fields." };
tmp31 = new c7(obj5);
throw tmp31;
}
_setupLabelFocus(arg0, arg1) {
closure_0 = global;
triggerFocus = function triggerFocus() {
self.focus(closure_0);
};
self = this;
obj = c23(module);
if (null != module.id) {
tmp8 = globalThis;
_Array2 = Array;
slice2 = Array.prototype.slice;
_document = document;
str3 = "label[for=\"";
str4 = "\"]";
callResult = slice2.call(document.querySelectorAll(`label[for="${module.id}"]`));
closure_1 = callResult;
_document2 = document;
obj2 = callResult;
if (obj !== document) {
_Array = Array;
slice = Array.prototype.slice;
combined = callResult.concat(slice.call(obj.querySelectorAll(`label[for="${module.id}"]`)));
closure_1 = combined;
obj2 = combined;
}
tmp2 = c14;
str = "label";
combined1 = obj2.concat(c14(module, "label"));
closure_1 = combined1;
found = combined1.filter((arg0, arg1, arr) => arr.indexOf(arg0) === arg1);
closure_1 = found;
num = 0;
c2 = 0;
str2 = "click";
flag = false;
if (0 < found.length) {
do {
tmp3 = c2;
obj3 = found[c2];
listener = obj3.addEventListener("click", triggerFocus, false);
tmp5 = c2;
sum = c2 + 1;
c2 = sum;
length = found.length;
} while (sum < length);
}
_destructor = this._destructor;
result = _destructor.registerFunctionForTeardown(() => {
let length;
let sum;
let c2 = 0;
if (0 < found.length) {
do {
let tmp = found;
let tmp2 = c2;
let obj = found[c2];
let tmp3 = triggerFocus;
let removed = obj.removeEventListener("click", triggerFocus, false);
let tmp5 = c2;
sum = c2 + 1;
c2 = sum;
let tmp7 = found;
length = found.length;
} while (sum < length);
}
});
}
return;
}
_getAnyFieldContainer() {
self = this;
keys = Object.keys(this._fields);
return keys.reduce((arg0, arg1) => {
let containerElement = arg0;
if (!arg0) {
containerElement = self._fields[arg1].containerElement;
}
return containerElement;
}, null);
}
_cleanUpFocusIntercepts() {
self = this;
if (document.forms.length < 1) {
_bus2 = self._bus;
tmp7 = events;
emitResult = _bus2.emit(events.REMOVE_FOCUS_INTERCEPTS);
} else {
tmp = c14;
str = "form";
num = 0;
first = c14(self._getAnyFieldContainer(), "form")[0];
if (first) {
tmp5 = c28;
fn = function(id) {
const _bus = this._bus;
_bus.emit(outer1_16.REMOVE_FOCUS_INTERCEPTS, { id });
};
result = c28.removeExtraFocusElements(first, fn.bind(self));
} else {
_bus = self._bus;
tmp3 = events;
emitResult1 = _bus.emit(events.REMOVE_FOCUS_INTERCEPTS);
}
}
return;
}
_attachInvalidFieldContainersToError(arg0) {
closure_0 = global;
tmp = global.details && global.details.invalidFieldKeys;
if (tmp) {
num = 0;
tmp = global.details.invalidFieldKeys.length > 0;
}
if (tmp) {
global.details.invalidFields = {};
invalidFieldKeys = global.details.invalidFieldKeys;
fn = function(arg0) {
details.details.invalidFields[arg0] = this._fields[arg0].containerElement;
};
self = this;
item = invalidFieldKeys.forEach(fn.bind(this));
}
return;
}
getChallenges() {
_clientPromise = this._clientPromise;
return _clientPromise.then((getConfiguration) => getConfiguration.getConfiguration().gatewayConfiguration.challenges);
}
getSupportedCardTypes() {
_clientPromise = this._clientPromise;
return _clientPromise.then((getConfiguration) => {
const supportedCardTypes = getConfiguration.getConfiguration().gatewayConfiguration.creditCards.supportedCardTypes;
return supportedCardTypes.map((arg0) => {
let str = "Mastercard";
if ("MasterCard" !== arg0) {
str = arg0;
}
return str;
});
});
}
teardown() {
self = this;
promise = new Promise((arg0, arg1) => {
const _self = arg0;
let closure_1 = arg1;
const _destructor = _self._destructor;
_destructor.teardown((arg0) => {
outer2_19.sendEvent(lib._clientPromise, "custom.hosted-fields.teardown-completed");
if (arg0) {
callback(arg0);
} else {
lib();
}
});
});
return promise;
}
tokenize(arg0) {
closure_0 = global;
self = this;
if (!global) {
closure_0 = {};
}
promise = new Promise((arg0, arg1) => {
let closure_0 = arg0;
const _self = arg1;
const _bus = _self._bus;
_bus.emit(outer1_16.TOKENIZATION_REQUEST, closure_0, (arg0) => {
const first = arg0[0];
if (first) {
const result = lib._attachInvalidFieldContainersToError(first);
const prototype = outer2_7.prototype;
const tmp12 = new outer2_7(first);
lib(tmp12);
} else {
callback(tmp2);
}
});
});
return promise;
}
addClass(arg0, arg1) {
self = this;
if (allowedFields.hasOwnProperty(global)) {
_fields = self._fields;
if (_fields.hasOwnProperty(global)) {
_bus = self._bus;
tmp14 = events;
obj = {};
obj.field = global;
tmp15 = module;
obj.classname = module;
emitResult = _bus.emit(events.ADD_CLASS, obj);
} else {
tmp8 = c7;
obj1 = {};
tmp9 = c11;
obj1.type = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.type;
tmp10 = c11;
obj1.code = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.code;
str3 = "Cannot add class to \"";
str4 = "\" field because it is not part of the current Hosted Fields options.";
obj1.message = `Cannot add class to "${global}" field because it is not part of the current Hosted Fields options.`;
prototype2 = c7.prototype;
tmp11 = new.target;
tmp12 = new.target;
tmp13 = obj1;
tmp7 = new c7(obj1);
}
} else {
tmp = c7;
obj = {};
tmp2 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_INVALID.type;
tmp3 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_INVALID.code;
str = "\"";
str2 = "\" is not a valid field. You must use a valid field option when adding a class.";
obj.message = `"${global}" is not a valid field. You must use a valid field option when adding a class.`;
prototype = c7.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c7(obj);
}
_Promise = Promise;
if (tmp7) {
rejectResult = _Promise.reject(tmp7);
} else {
rejectResult = _Promise.resolve();
}
return rejectResult;
}
removeClass(arg0, arg1) {
self = this;
if (allowedFields.hasOwnProperty(global)) {
_fields = self._fields;
if (_fields.hasOwnProperty(global)) {
_bus = self._bus;
tmp14 = events;
obj = {};
obj.field = global;
tmp15 = module;
obj.classname = module;
emitResult = _bus.emit(events.REMOVE_CLASS, obj);
} else {
tmp8 = c7;
obj1 = {};
tmp9 = c11;
obj1.type = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.type;
tmp10 = c11;
obj1.code = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.code;
str3 = "Cannot remove class from \"";
str4 = "\" field because it is not part of the current Hosted Fields options.";
obj1.message = `Cannot remove class from "${global}" field because it is not part of the current Hosted Fields options.`;
prototype2 = c7.prototype;
tmp11 = new.target;
tmp12 = new.target;
tmp13 = obj1;
tmp7 = new c7(obj1);
}
} else {
tmp = c7;
obj = {};
tmp2 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_INVALID.type;
tmp3 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_INVALID.code;
str = "\"";
str2 = "\" is not a valid field. You must use a valid field option when removing a class.";
obj.message = `"${global}" is not a valid field. You must use a valid field option when removing a class.`;
prototype = c7.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c7(obj);
}
_Promise = Promise;
if (tmp7) {
rejectResult = _Promise.reject(tmp7);
} else {
rejectResult = _Promise.resolve();
}
return rejectResult;
}
setAttribute(arg0) {
self = this;
if (allowedFields.hasOwnProperty(global.field)) {
_fields = self._fields;
if (_fields.hasOwnProperty(global.field)) {
tmp14 = c27;
tmp7 = c27(global.attribute, global.value);
if (!tmp7) {
_bus = self._bus;
tmp15 = events;
obj = {};
({ field: obj3.field, attribute: obj3.attribute, value: obj3.value } = global);
emitResult = _bus.emit(events.SET_ATTRIBUTE, obj);
}
} else {
tmp8 = c7;
obj1 = {};
tmp9 = c11;
obj1.type = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.type;
tmp10 = c11;
obj1.code = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.code;
str3 = "Cannot set attribute for \"";
str4 = "\" field because it is not part of the current Hosted Fields options.";
obj1.message = `Cannot set attribute for "${global.field}" field because it is not part of the current Hosted Fields options.`;
prototype2 = c7.prototype;
tmp11 = new.target;
tmp12 = new.target;
tmp13 = obj1;
tmp7 = new c7(obj1);
}
} else {
tmp = c7;
obj = {};
tmp2 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_INVALID.type;
tmp3 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_INVALID.code;
str = "\"";
str2 = "\" is not a valid field. You must use a valid field option when setting an attribute.";
obj.message = `"${global.field}" is not a valid field. You must use a valid field option when setting an attribute.`;
prototype = c7.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c7(obj);
}
_Promise = Promise;
if (tmp7) {
rejectResult = _Promise.reject(tmp7);
} else {
rejectResult = _Promise.resolve();
}
return rejectResult;
}
setMonthOptions(arg0) {
closure_0 = global;
self = this;
fields = this._merchantConfigurationOptions.fields;
str = "Expiration month field must exist to use setMonthOptions.";
if (fields.expirationMonth) {
if (!fields.expirationMonth.select) {
str = "Expiration month field must be a select element.";
}
}
_Promise = Promise;
if (str) {
tmp4 = c7;
obj = {};
tmp5 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type;
tmp6 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code;
obj.message = str;
prototype2 = c7.prototype;
tmp7 = new.target;
tmp8 = new.target;
tmp9 = obj;
tmp10 = new c7(obj);
tmp11 = tmp10;
rejectResult = _Promise.reject(tmp10);
} else {
prototype = _Promise.prototype;
tmp = new.target;
tmp2 = new.target;
rejectResult = new _Promise((arg0) => {
const _bus = self._bus;
_bus.emit(outer1_16.SET_MONTH_OPTIONS, closure_0, arg0);
});
}
return rejectResult;
}
setMessage(arg0) {
_bus = this._bus;
obj = { field: global.field, message: global.message };
emitResult = _bus.emit(events.SET_MESSAGE, obj);
return;
}
removeAttribute(arg0) {
self = this;
if (allowedFields.hasOwnProperty(global.field)) {
_fields = self._fields;
if (_fields.hasOwnProperty(global.field)) {
tmp14 = c27;
tmp7 = c27(global.attribute);
if (!tmp7) {
_bus = self._bus;
tmp15 = events;
obj = {};
({ field: obj3.field, attribute: obj3.attribute } = global);
emitResult = _bus.emit(events.REMOVE_ATTRIBUTE, obj);
}
} else {
tmp8 = c7;
obj1 = {};
tmp9 = c11;
obj1.type = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.type;
tmp10 = c11;
obj1.code = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.code;
str3 = "Cannot remove attribute for \"";
str4 = "\" field because it is not part of the current Hosted Fields options.";
obj1.message = `Cannot remove attribute for "${global.field}" field because it is not part of the current Hosted Fields options.`;
prototype2 = c7.prototype;
tmp11 = new.target;
tmp12 = new.target;
tmp13 = obj1;
tmp7 = new c7(obj1);
}
} else {
tmp = c7;
obj = {};
tmp2 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_INVALID.type;
tmp3 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_INVALID.code;
str = "\"";
str2 = "\" is not a valid field. You must use a valid field option when removing an attribute.";
obj.message = `"${global.field}" is not a valid field. You must use a valid field option when removing an attribute.`;
prototype = c7.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c7(obj);
}
_Promise = Promise;
if (tmp7) {
rejectResult = _Promise.reject(tmp7);
} else {
rejectResult = _Promise.resolve();
}
return rejectResult;
}
setPlaceholder(arg0, arg1) {
obj = { field: global, attribute: "placeholder", value: module };
return this.setAttribute(obj);
}
clear(arg0) {
self = this;
if (allowedFields.hasOwnProperty(global)) {
_fields = self._fields;
if (_fields.hasOwnProperty(global)) {
_bus = self._bus;
tmp14 = events;
obj = {};
obj.field = global;
emitResult = _bus.emit(events.CLEAR_FIELD, obj);
} else {
tmp8 = c7;
obj1 = {};
tmp9 = c11;
obj1.type = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.type;
tmp10 = c11;
obj1.code = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.code;
str3 = "Cannot clear \"";
str4 = "\" field because it is not part of the current Hosted Fields options.";
obj1.message = `Cannot clear "${global}" field because it is not part of the current Hosted Fields options.`;
prototype2 = c7.prototype;
tmp11 = new.target;
tmp12 = new.target;
tmp13 = obj1;
tmp7 = new c7(obj1);
}
} else {
tmp = c7;
obj = {};
tmp2 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_INVALID.type;
tmp3 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_INVALID.code;
str = "\"";
str2 = "\" is not a valid field. You must use a valid field option when clearing a field.";
obj.message = `"${global}" is not a valid field. You must use a valid field option when clearing a field.`;
prototype = c7.prototype;
tmp4 = new.target;
tmp5 = new.target;
tmp6 = obj;
tmp7 = new c7(obj);
}
_Promise = Promise;
if (tmp7) {
rejectResult = _Promise.reject(tmp7);
} else {
rejectResult = _Promise.resolve();
}
return rejectResult;
}
focus(arg0) {
self = this;
tmp = this._fields[global];
assign = tmp;
if (allowedFields.hasOwnProperty(global)) {
_fields = self._fields;
if (_fields.hasOwnProperty(global)) {
frameElement = tmp.frameElement;
focusResult = frameElement.focus();
_bus = self._bus;
tmp16 = events;
obj = {};
obj.field = global;
emitResult = _bus.emit(events.TRIGGER_INPUT_FOCUS, obj);
tmp18 = c15;
if (c15.isIos()) {
tmp19 = globalThis;
_setTimeout = setTimeout;
num = 5;
timerId = setTimeout(() => {
const containerElement = tmp.containerElement;
const size = containerElement.getBoundingClientRect();
const rounded = Math.floor(size.height / 2);
const rounded1 = Math.floor(size.width / 2);
let diff = window.innerHeight - rounded;
if (!diff) {
const _document = document;
diff = document.documentElement.clientHeight - rounded;
}
let tmp4 = size.top < diff && size.right > rounded1 && size.bottom > rounded;
if (tmp4) {
const _window = window;
let diff1 = window.innerWidth - rounded1;
if (!diff1) {
const _document2 = document;
diff1 = document.documentElement.clientWidth - rounded1;
}
tmp4 = size.left < diff1;
}
if (!tmp4) {
const containerElement2 = tmp.containerElement;
containerElement2.scrollIntoView();
}
}, 5);
}
} else {
tmp9 = c7;
obj1 = {};
tmp10 = c11;
obj1.type = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.type;
tmp11 = c11;
obj1.code = c11.HOSTED_FIELDS_FIELD_NOT_PRESENT.code;
str3 = "Cannot focus \"";
str4 = "\" field because it is not part of the current Hosted Fields options.";
obj1.message = `Cannot focus "${global}" field because it is not part of the current Hosted Fields options.`;
prototype2 = c7.prototype;
tmp12 = new.target;
tmp13 = new.target;
tmp14 = obj1;
tmp8 = new c7(obj1);
}
} else {
tmp2 = c7;
obj = {};
tmp3 = c11;
obj.type = c11.HOSTED_FIELDS_FIELD_INVALID.type;
tmp4 = c11;
obj.code = c11.HOSTED_FIELDS_FIELD_INVALID.code;
str = "\"";
str2 = "\" is not a valid field. You must use a valid field option when focusing a field.";
obj.message = `"${global}" is not a valid field. You must use a valid field option when focusing a field.`;
prototype = c7.prototype;
tmp5 = new.target;
tmp6 = new.target;
tmp7 = obj;
tmp8 = new c7(obj);
}
_Promise = Promise;
if (tmp8) {
rejectResult = _Promise.reject(tmp8);
} else {
rejectResult = _Promise.resolve();
}
return rejectResult;
}
getState() {
return this._state;
}
}
let assign = global("../../lib/assign").assign;
let closure_1 = global("../../lib/create-assets-url");
let closure_2 = global("../../lib/is-verified-domain");
let closure_3 = global("../../lib/destructor");
let closure_4 = global("@braintree/iframer");
let closure_5 = global("framebus");
let closure_6 = global("../../lib/create-deferred-client");
let closure_7 = global("../../lib/braintree-error");
let closure_8 = global("./compose-url");
let closure_9 = global("./get-styles-from-class");
const globalResult = global("../shared/constants");
let closure_11 = global("../shared/errors");
const INTEGRATION_TIMEOUT_MS = global("../../lib/constants").INTEGRATION_TIMEOUT_MS;
let closure_13 = global("@braintree/uuid");
let closure_14 = global("../shared/find-parent-tags");
let closure_15 = global("../shared/browser-detection");
const events = globalResult.events;
const globalResult1 = global("@braintree/event-emitter");
let closure_18 = global("./inject-frame");
let closure_19 = global("../../lib/analytics");
let allowedFields = globalResult.allowedFields;
let closure_21 = global("../../lib/methods");
let closure_22 = global("../../lib/shadow");
let closure_23 = global("../../lib/find-root-node");
let closure_24 = global("../../lib/convert-methods-to-error");
let closure_25 = global("../../lib/errors");
let closure_26 = global("../shared/get-card-types");
let closure_27 = global("./attribute-validation-error");
let closure_28 = global("./focus-change");
const destroy = global("../shared/focus-intercept").destroy;
const child = globalResult1.createChild(HostedFields);
module.exports = global("@braintree/wrap-promise").wrapPrototype(HostedFields);
},
{ "../../lib/analytics": 138, "../../lib/assign": 140, "../../lib/braintree-error": 143, "../../lib/constants": 145, "../../lib/convert-methods-to-error": 146, "../../lib/create-assets-url": 148, "../../lib/create-deferred-client": 150, "../../lib/destructor": 152, "../../lib/errors": 154, "../../lib/find-root-node": 155, "../../lib/is-verified-domain": 173, "../../lib/methods": 175, "../../lib/shadow": 178, "../shared/browser-detection": 130, "../shared/constants": 131, "../shared/errors": 132, "../shared/find-parent-tags": 133, "../shared/focus-intercept": 134, "../shared/get-card-types": 135, "./attribute-validation-error": 123, "./compose-url": 124, "./focus-change": 125, "./get-styles-from-class": 126, "./inject-frame": 128, "@braintree/event-emitter": 30, "@braintree/iframer": 32, "@braintree/uuid": 36, "@braintree/wrap-promise": 40, framebus: 50 }
];
items = [
(arg0, arg1, arg2) => {
let closure_0 = global("../shared/focus-intercept");
const navigationDirections = global("../shared/constants").navigationDirections;
module.exports = function injectFrame(arg0, getAttribute, appendChild) {
const attr = getAttribute.getAttribute("type");
const element =