Created
May 27, 2021 11:38
-
-
Save ziyahan/b2e90dcc2f115013f6ab4eaf20dbd1e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(e) { | |
if ("object" == typeof exports && "undefined" != typeof module) | |
module.exports = e(); | |
else if ("function" == typeof define && define.amd) | |
define([], e); | |
else { | |
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).frameService = e() | |
} | |
}((function() { | |
return function e(t, n, r) { | |
function i(o, a) { | |
if (!n[o]) { | |
if (!t[o]) { | |
var c = "function" == typeof require && require; | |
if (!a && c) | |
return c(o, !0); | |
if (s) | |
return s(o, !0); | |
var u = new Error("Cannot find module '" + o + "'"); | |
throw u.code = "MODULE_NOT_FOUND", | |
u | |
} | |
var d = n[o] = { | |
exports: {} | |
}; | |
t[o][0].call(d.exports, (function(e) { | |
return i(t[o][1][e] || e) | |
} | |
), d, d.exports, e, t, n, r) | |
} | |
return n[o].exports | |
} | |
for (var s = "function" == typeof require && require, o = 0; o < r.length; o++) | |
i(r[o]); | |
return i | |
}({ | |
1: [function(e, t, n) { | |
"use strict"; | |
t.exports = function() { | |
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(e) { | |
var t = 16 * Math.random() | 0; | |
return ("x" === e ? t : 3 & t | 8).toString(16) | |
} | |
)) | |
} | |
} | |
, {}], | |
2: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.Framebus = void 0; | |
var r = e("./lib/is-not-string") | |
, i = e("./lib/subscription-args-invalid") | |
, s = e("./lib/broadcast") | |
, o = e("./lib/package-payload") | |
, a = e("./lib/constants") | |
, c = "undefined" != typeof window && window.Promise | |
, u = function() { | |
function e(e) { | |
void 0 === e && (e = {}), | |
this.origin = e.origin || "*", | |
this.channel = e.channel || "", | |
this.verifyDomain = e.verifyDomain, | |
this.isDestroyed = !1, | |
this.listeners = [] | |
} | |
return e.setPromise = function(t) { | |
e.Promise = t | |
} | |
, | |
e.target = function(t) { | |
return new e(t) | |
} | |
, | |
e.prototype.include = function(e) { | |
return null != e && (null != e.Window && (e.constructor === e.Window && (a.childWindows.push(e), | |
!0))) | |
} | |
, | |
e.prototype.target = function(t) { | |
return e.target(t) | |
} | |
, | |
e.prototype.emit = function(e, t, n) { | |
if (this.isDestroyed) | |
return !1; | |
var i = this.origin; | |
if (e = this.namespaceEvent(e), | |
r.isntString(e)) | |
return !1; | |
if (r.isntString(i)) | |
return !1; | |
"function" == typeof t && (n = t, | |
t = void 0); | |
var a = o.packagePayload(e, i, t, n); | |
return !!a && (s.broadcast(window.top || window.self, a, i), | |
!0) | |
} | |
, | |
e.prototype.emitAsPromise = function(t, n) { | |
var r = this; | |
return new e.Promise((function(e, i) { | |
r.emit(t, n, (function(t) { | |
e(t) | |
} | |
)) || i(new Error('Listener not added for "' + t + '"')) | |
} | |
)) | |
} | |
, | |
e.prototype.on = function(e, t) { | |
if (this.isDestroyed) | |
return !1; | |
var n = this | |
, r = this.origin | |
, s = t; | |
return e = this.namespaceEvent(e), | |
!i.subscriptionArgsInvalid(e, s, r) && (this.verifyDomain && (s = function() { | |
for (var e = [], r = 0; r < arguments.length; r++) | |
e[r] = arguments[r]; | |
n.checkOrigin(this && this.origin) && t.apply(void 0, e) | |
} | |
), | |
this.listeners.push({ | |
eventName: e, | |
handler: s, | |
originalHandler: t | |
}), | |
a.subscribers[r] = a.subscribers[r] || {}, | |
a.subscribers[r][e] = a.subscribers[r][e] || [], | |
a.subscribers[r][e].push(s), | |
!0) | |
} | |
, | |
e.prototype.off = function(e, t) { | |
var n = t; | |
if (this.isDestroyed) | |
return !1; | |
if (this.verifyDomain) | |
for (var r = 0; r < this.listeners.length; r++) { | |
var s = this.listeners[r]; | |
s.originalHandler === t && (n = s.handler) | |
} | |
e = this.namespaceEvent(e); | |
var o = this.origin; | |
if (i.subscriptionArgsInvalid(e, n, o)) | |
return !1; | |
var c = a.subscribers[o] && a.subscribers[o][e]; | |
if (!c) | |
return !1; | |
for (r = 0; r < c.length; r++) | |
if (c[r] === n) | |
return c.splice(r, 1), | |
!0; | |
return !1 | |
} | |
, | |
e.prototype.teardown = function() { | |
if (!this.isDestroyed) { | |
this.isDestroyed = !0; | |
for (var e = 0; e < this.listeners.length; e++) { | |
var t = this.listeners[e]; | |
this.off(t.eventName, t.handler) | |
} | |
this.listeners.length = 0 | |
} | |
} | |
, | |
e.prototype.checkOrigin = function(e) { | |
var t, n = document.createElement("a"); | |
return n.href = location.href, | |
t = "https:" === n.protocol ? n.host.replace(/:443$/, "") : "http:" === n.protocol ? n.host.replace(/:80$/, "") : n.host, | |
n.protocol + "//" + t === e || (!this.verifyDomain || this.verifyDomain(e)) | |
} | |
, | |
e.prototype.namespaceEvent = function(e) { | |
return this.channel ? this.channel + ":" + e : e | |
} | |
, | |
e.Promise = c, | |
e | |
}(); | |
n.Framebus = u | |
} | |
, { | |
"./lib/broadcast": 6, | |
"./lib/constants": 7, | |
"./lib/is-not-string": 10, | |
"./lib/package-payload": 12, | |
"./lib/subscription-args-invalid": 14 | |
}], | |
3: [function(e, t, n) { | |
"use strict"; | |
var r = e("./lib/attach") | |
, i = e("./framebus"); | |
r.attach(), | |
t.exports = i.Framebus | |
} | |
, { | |
"./framebus": 2, | |
"./lib/attach": 4 | |
}], | |
4: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.detach = n.attach = void 0; | |
var r = e("./message") | |
, i = !1; | |
n.attach = function() { | |
i || "undefined" == typeof window || (i = !0, | |
window.addEventListener("message", r.onmessage, !1)) | |
} | |
, | |
n.detach = function() { | |
i = !1, | |
window.removeEventListener("message", r.onmessage, !1) | |
} | |
} | |
, { | |
"./message": 11 | |
}], | |
5: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.broadcastToChildWindows = void 0; | |
var r = e("./broadcast") | |
, i = e("./constants"); | |
n.broadcastToChildWindows = function(e, t, n) { | |
for (var s = i.childWindows.length - 1; s >= 0; s--) { | |
var o = i.childWindows[s]; | |
o.closed ? i.childWindows.splice(s, 1) : n !== o && r.broadcast(o.top, e, t) | |
} | |
} | |
} | |
, { | |
"./broadcast": 6, | |
"./constants": 7 | |
}], | |
6: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.broadcast = void 0; | |
var r = e("./has-opener"); | |
n.broadcast = function e(t, n, i) { | |
var s, o = 0; | |
try { | |
for (t.postMessage(n, i), | |
r.hasOpener(t) && t.opener.top !== window.top && e(t.opener.top, n, i); s = t.frames[o]; ) | |
e(s, n, i), | |
o++ | |
} catch (e) {} | |
} | |
} | |
, { | |
"./has-opener": 9 | |
}], | |
7: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.subscribers = n.childWindows = n.prefix = void 0, | |
n.prefix = "/*framebus*/", | |
n.childWindows = [], | |
n.subscribers = {} | |
} | |
, {}], | |
8: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.dispatch = void 0; | |
var r = e("./constants"); | |
n.dispatch = function(e, t, n, i, s) { | |
if (r.subscribers[e] && r.subscribers[e][t]) { | |
var o = []; | |
n && o.push(n), | |
i && o.push(i); | |
for (var a = 0; a < r.subscribers[e][t].length; a++) | |
r.subscribers[e][t][a].apply(s, o) | |
} | |
} | |
} | |
, { | |
"./constants": 7 | |
}], | |
9: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.hasOpener = void 0, | |
n.hasOpener = function(e) { | |
return e.top === e && (null != e.opener && (e.opener !== e && !0 !== e.opener.closed)) | |
} | |
} | |
, {}], | |
10: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.isntString = void 0, | |
n.isntString = function(e) { | |
return "string" != typeof e | |
} | |
} | |
, {}], | |
11: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.onmessage = void 0; | |
var r = e("./is-not-string") | |
, i = e("./unpack-payload") | |
, s = e("./dispatch") | |
, o = e("./broadcast-to-child-windows"); | |
n.onmessage = function(e) { | |
if (!r.isntString(e.data)) { | |
var t = i.unpackPayload(e); | |
if (t) { | |
var n = t.eventData | |
, a = t.reply; | |
s.dispatch("*", t.event, n, a, e), | |
s.dispatch(e.origin, t.event, n, a, e), | |
o.broadcastToChildWindows(e.data, t.origin, e.source) | |
} | |
} | |
} | |
} | |
, { | |
"./broadcast-to-child-windows": 5, | |
"./dispatch": 8, | |
"./is-not-string": 10, | |
"./unpack-payload": 15 | |
}], | |
12: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.packagePayload = void 0; | |
var r = e("./subscribe-replier") | |
, i = e("./constants"); | |
n.packagePayload = function(e, t, n, s) { | |
var o, a = { | |
event: e, | |
origin: t | |
}; | |
"function" == typeof s && (a.reply = r.subscribeReplier(s, t)), | |
a.eventData = n; | |
try { | |
o = i.prefix + JSON.stringify(a) | |
} catch (e) { | |
throw new Error("Could not stringify event: " + e.message) | |
} | |
return o | |
} | |
} | |
, { | |
"./constants": 7, | |
"./subscribe-replier": 13 | |
}], | |
13: [function(e, t, n) { | |
"use strict"; | |
var r = this && this.__importDefault || function(e) { | |
return e && e.__esModule ? e : { | |
default: e | |
} | |
} | |
; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.subscribeReplier = void 0; | |
var i = e("../framebus") | |
, s = r(e("@braintree/uuid")); | |
n.subscribeReplier = function(e, t) { | |
var n = s.default(); | |
return i.Framebus.target({ | |
origin: t | |
}).on(n, (function r(s, o) { | |
e(s, o), | |
i.Framebus.target({ | |
origin: t | |
}).off(n, r) | |
} | |
)), | |
n | |
} | |
} | |
, { | |
"../framebus": 2, | |
"@braintree/uuid": 1 | |
}], | |
14: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.subscriptionArgsInvalid = void 0; | |
var r = e("./is-not-string"); | |
n.subscriptionArgsInvalid = function(e, t, n) { | |
return !!r.isntString(e) || ("function" != typeof t || r.isntString(n)) | |
} | |
} | |
, { | |
"./is-not-string": 10 | |
}], | |
15: [function(e, t, n) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}), | |
n.unpackPayload = void 0; | |
var r = e("./constants") | |
, i = e("./package-payload"); | |
n.unpackPayload = function(e) { | |
var t; | |
if (e.data.slice(0, r.prefix.length) !== r.prefix) | |
return !1; | |
try { | |
t = JSON.parse(e.data.slice(r.prefix.length)) | |
} catch (e) { | |
return !1 | |
} | |
if (t.reply) { | |
var n = e.origin | |
, s = e.source | |
, o = t.reply; | |
t.reply = function(e) { | |
if (s) { | |
var t = i.packagePayload(o, n, e); | |
t && s.postMessage(t, n) | |
} | |
} | |
} | |
return t | |
} | |
} | |
, { | |
"./constants": 7, | |
"./package-payload": 12 | |
}], | |
16: [function(e, t, n) { | |
"use strict"; | |
t.exports = { | |
ANALYTICS_PREFIX: "web.", | |
ANALYTICS_REQUEST_TIMEOUT_MS: 2e3, | |
ASSETS_URLS: { | |
production: "https://assets.braintreegateway.com", | |
sandbox: "https://assets.braintreegateway.com" | |
}, | |
CLIENT_API_URLS: { | |
production: "https://api.braintreegateway.com:443", | |
sandbox: "https://api.sandbox.braintreegateway.com:443" | |
}, | |
FRAUDNET_SOURCE: "BRAINTREE_SIGNIN", | |
FRAUDNET_FNCLS: "fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99", | |
FRAUDNET_URL: "https://c.paypal.com/da/r/fb.js", | |
BUS_CONFIGURATION_REQUEST_EVENT: "BUS_CONFIGURATION_REQUEST", | |
GRAPHQL_URLS: { | |
production: "https://payments.braintree-api.com/graphql", | |
sandbox: "https://payments.sandbox.braintree-api.com/graphql" | |
}, | |
INTEGRATION_TIMEOUT_MS: 6e4, | |
VERSION: "3.76.4", | |
INTEGRATION: "custom", | |
SOURCE: "client", | |
PLATFORM: "web", | |
BRAINTREE_LIBRARY_VERSION: "braintree/web/3.76.4" | |
} | |
} | |
, {}], | |
17: [function(e, t, n) { | |
"use strict"; | |
t.exports = function(e, t) { | |
return t = null == t ? "" : t, | |
e.reduce((function(e, n) { | |
return e[n] = t + n, | |
e | |
} | |
), {}) | |
} | |
} | |
, {}], | |
18: [function(e, t, n) { | |
"use strict"; | |
var r = e("framebus") | |
, i = e("../shared/events") | |
, s = e("../../json-clone") | |
, o = e("../../constants").BUS_CONFIGURATION_REQUEST_EVENT; | |
t.exports = { | |
start: function() { | |
var e, t = window.name.split("_")[1].split("?")[0]; | |
window.bus = new r({ | |
channel: t | |
}), | |
window.bus.emit(o, (function(t) { | |
e = t, | |
window.bus.emit(i.DISPATCH_FRAME_READY) | |
} | |
)), | |
window.getConfiguration = function() { | |
return s(e) | |
} | |
} | |
} | |
} | |
, { | |
"../../constants": 16, | |
"../../json-clone": 20, | |
"../shared/events": 19, | |
framebus: 3 | |
}], | |
19: [function(e, t, n) { | |
"use strict"; | |
var r = e("../../enumerate"); | |
t.exports = r(["DISPATCH_FRAME_READY", "DISPATCH_FRAME_REPORT"], "frameService:") | |
} | |
, { | |
"../../enumerate": 17 | |
}], | |
20: [function(e, t, n) { | |
"use strict"; | |
t.exports = function(e) { | |
return JSON.parse(JSON.stringify(e)) | |
} | |
} | |
, {}] | |
}, {}, [18])(18) | |
} | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment