@pactsafe/pactsafe-react-sdk
Advanced tools
Comparing version 2.12.0 to 2.13.3
@@ -0,5 +1,4 @@ | ||
var _jsxFileName = "/Users/adam.gillaspie/Repositories/pactsafe-react-sdk/src/PSBrowseWrap.js"; | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
/* global _ps */ | ||
@@ -10,36 +9,26 @@ import React from 'react'; | ||
import PSSnippet from './PSSnippet'; | ||
var PSBrowseWrap = /*#__PURE__*/function (_React$Component) { | ||
_inheritsLoose(PSBrowseWrap, _React$Component); | ||
function PSBrowseWrap(props) { | ||
var _this; | ||
_this = _React$Component.call(this, props) || this; | ||
var _this$props = _this.props, | ||
psScriptUrl = _this$props.psScriptUrl, | ||
groupKey = _this$props.groupKey, | ||
accessId = _this$props.accessId; | ||
psScriptUrl = _this$props.psScriptUrl, | ||
groupKey = _this$props.groupKey, | ||
accessId = _this$props.accessId; | ||
if (!PSSnippet.isSnippetLoaded(psScriptUrl)) { | ||
PSSnippet.injectSnippet(psScriptUrl); | ||
} | ||
_this.targetSelector = "psbw-" + groupKey; | ||
_ps('create', accessId); | ||
return _this; | ||
} | ||
var _proto = PSBrowseWrap.prototype; | ||
_proto.componentDidMount = function componentDidMount() { | ||
var _this$props2 = this.props, | ||
groupKey = _this$props2.groupKey, | ||
position = _this$props2.position, | ||
badgeText = _this$props2.badgeText, | ||
alwaysVisible = _this$props2.alwaysVisible, | ||
openLegalCenter = _this$props2.openLegalCenter; | ||
groupKey = _this$props2.groupKey, | ||
position = _this$props2.position, | ||
badgeText = _this$props2.badgeText, | ||
alwaysVisible = _this$props2.alwaysVisible, | ||
openLegalCenter = _this$props2.openLegalCenter; | ||
_ps('load', groupKey, { | ||
@@ -53,3 +42,2 @@ target_selector: this.targetSelector, | ||
}; | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
@@ -59,16 +47,19 @@ var groupKey = this.props.groupKey; | ||
}; | ||
_proto.render = function render() { | ||
var _this$props3 = this.props, | ||
link = _this$props3.link, | ||
linkText = _this$props3.linkText; | ||
link = _this$props3.link, | ||
linkText = _this$props3.linkText; | ||
return /*#__PURE__*/React.createElement("a", { | ||
href: link, | ||
id: this.targetSelector | ||
id: this.targetSelector, | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 37, | ||
columnNumber: 7 | ||
} | ||
}, linkText); | ||
}; | ||
return PSBrowseWrap; | ||
}(React.Component); | ||
PSBrowseWrap.MUST_PROVIDE_LINK_IF_OPEN_LEGAL_CENTER_FALSE = 'PSBrowseWrap Error: You must provide a link prop if openLegalCenter is passed false'; | ||
@@ -75,0 +66,0 @@ PSBrowseWrap.propTypes = process.env.NODE_ENV !== "production" ? { |
@@ -0,11 +1,9 @@ | ||
var _jsxFileName = "/Users/adam.gillaspie/Repositories/pactsafe-react-sdk/src/PSClickWrap.js"; | ||
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
/* global _ps */ | ||
@@ -18,13 +16,8 @@ import React from 'react'; | ||
import PSSnippet from './PSSnippet'; | ||
var PSClickWrap = /*#__PURE__*/function (_React$Component) { | ||
_inheritsLoose(PSClickWrap, _React$Component); | ||
function PSClickWrap(props) { | ||
var _this; | ||
_this = _React$Component.call(this, props) || this; | ||
_defineProperty(_assertThisInitialized(_this), "_isMounted", false); | ||
_this.createClickWrap = _this.createClickWrap.bind(_assertThisInitialized(_this)); | ||
@@ -52,22 +45,18 @@ _this.state = { | ||
var _this$props = _this.props, | ||
accessId = _this$props.accessId, | ||
backupScriptURL = _this$props.backupScriptURL, | ||
debug = _this$props.debug, | ||
disableSending = _this$props.disableSending, | ||
dynamic = _this$props.dynamic, | ||
injectSnippetOnly = _this$props.injectSnippetOnly, | ||
psScriptUrl = _this$props.psScriptUrl, | ||
signerId = _this$props.signerId, | ||
testMode = _this$props.testMode; | ||
accessId = _this$props.accessId, | ||
backupScriptURL = _this$props.backupScriptURL, | ||
debug = _this$props.debug, | ||
disableSending = _this$props.disableSending, | ||
dynamic = _this$props.dynamic, | ||
injectSnippetOnly = _this$props.injectSnippetOnly, | ||
psScriptUrl = _this$props.psScriptUrl, | ||
signerId = _this$props.signerId, | ||
testMode = _this$props.testMode; | ||
if (!PSSnippet.isSnippetLoaded(psScriptUrl, backupScriptURL)) { | ||
PSSnippet.injectSnippet(psScriptUrl, backupScriptURL); | ||
} | ||
if (debug) { | ||
_ps.debug = true; | ||
} | ||
if (injectSnippetOnly) return _assertThisInitialized(_this); | ||
_ps('create', accessId, { | ||
@@ -79,12 +68,7 @@ test_mode: testMode, | ||
}); | ||
_ps('set', 'client_library', 'react-sdk'); | ||
_ps('set', 'client_version', "2.12.0"); | ||
_ps('set', 'client_version', "2.13.3"); | ||
return _this; | ||
} | ||
var _proto = PSClickWrap.prototype; | ||
_proto.componentDidMount = function componentDidMount() { | ||
@@ -96,36 +80,28 @@ var injectSnippetOnly = this.props.injectSnippetOnly; | ||
}; | ||
_proto.componentDidUpdate = function componentDidUpdate(prevProps) { | ||
var _this$props2 = this.props, | ||
acceptanceLanguage = _this$props2.acceptanceLanguage, | ||
clickWrapStyle = _this$props2.clickWrapStyle, | ||
customData = _this$props2.customData, | ||
filter = _this$props2.filter, | ||
groupKey = _this$props2.groupKey, | ||
injectSnippetOnly = _this$props2.injectSnippetOnly, | ||
renderData = _this$props2.renderData, | ||
signerId = _this$props2.signerId, | ||
snapshotLocation = _this$props2.snapshotLocation; | ||
acceptanceLanguage = _this$props2.acceptanceLanguage, | ||
clickWrapStyle = _this$props2.clickWrapStyle, | ||
customData = _this$props2.customData, | ||
filter = _this$props2.filter, | ||
groupKey = _this$props2.groupKey, | ||
injectSnippetOnly = _this$props2.injectSnippetOnly, | ||
renderData = _this$props2.renderData, | ||
signerId = _this$props2.signerId, | ||
snapshotLocation = _this$props2.snapshotLocation; | ||
var _this$state = this.state, | ||
clickwrapGroupKey = _this$state.clickwrapGroupKey, | ||
dynamicGroup = _this$state.dynamicGroup; | ||
clickwrapGroupKey = _this$state.clickwrapGroupKey, | ||
dynamicGroup = _this$state.dynamicGroup; | ||
var _psLoadedValidGroup = _ps && _ps.getByKey && typeof _ps.getByKey === 'function' && clickwrapGroupKey && _ps.getByKey(clickwrapGroupKey); | ||
if (injectSnippetOnly) return; | ||
if (clickWrapStyle !== prevProps.clickWrapStyle && !dynamicGroup && _psLoadedValidGroup) { | ||
_ps.getByKey(clickwrapGroupKey).site.set('style', clickWrapStyle); | ||
_ps.getByKey(clickwrapGroupKey).retrieveHTML(); | ||
} | ||
if (!isEqual(customData, prevProps.customData)) { | ||
_ps('set', 'custom_data', customData); | ||
} | ||
if (acceptanceLanguage !== prevProps.acceptanceLanguage) { | ||
_ps('set', 'acceptance_language', acceptanceLanguage); | ||
} | ||
if (!isEqual(renderData, prevProps.renderData)) { | ||
@@ -135,6 +111,4 @@ if (clickWrapStyle && _psLoadedValidGroup) { | ||
} | ||
_ps(clickwrapGroupKey + ":retrieveHTML", renderData); | ||
} | ||
if (signerId !== prevProps.signerId) { | ||
@@ -144,18 +118,13 @@ if (clickWrapStyle && _psLoadedValidGroup) { | ||
} | ||
_ps('set', 'signer_id', signerId); | ||
} | ||
if (snapshotLocation !== prevProps.snapshotLocation) { | ||
_ps('set', 'snapshot_location', snapshotLocation); | ||
} | ||
if (clickWrapStyle !== prevProps.clickWrapStyle && dynamicGroup) { | ||
this.createClickWrap(); | ||
} | ||
if (filter !== prevProps.filter) { | ||
this.createClickWrap(); | ||
} | ||
if (groupKey !== prevProps.groupKey && !dynamicGroup) { | ||
@@ -166,10 +135,8 @@ this.createClickWrap(); | ||
}; | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
this._isMounted = false; | ||
var _this$props3 = this.props, | ||
injectSnippetOnly = _this$props3.injectSnippetOnly, | ||
groupKey = _this$props3.groupKey; | ||
injectSnippetOnly = _this$props3.injectSnippetOnly, | ||
groupKey = _this$props3.groupKey; | ||
if (injectSnippetOnly) return; | ||
if (_ps && _ps.getByKey && typeof _ps.getByKey === 'function' && _ps.getByKey(groupKey)) { | ||
@@ -179,23 +146,18 @@ if (_ps.getByKey(groupKey).rendered) { | ||
} | ||
_ps.getByKey(groupKey).resetData(); | ||
} | ||
this.unregisterEventListeners(); | ||
}; | ||
_proto.registerEventListener = function registerEventListener(eventProp, groupKey) { | ||
var _this2 = this; | ||
var eventCallbackFn = function eventCallbackFn() { | ||
var shouldFireListener = false; | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
args.forEach(function (arg) { | ||
// We need to check the context variable and see if it matches the groupKey, if it does -> fire the event (context argument position varies) | ||
if (arg && arg.get && arg.get('key') && arg.get('key') === groupKey) { | ||
shouldFireListener = true; // Else we should check if the context is for the entire site, and as such the context variable is a Site object. | ||
shouldFireListener = true; | ||
// Else we should check if the context is for the entire site, and as such the context variable is a Site object. | ||
} else if (arg && arg.toString() === '[object Site]') { | ||
@@ -205,26 +167,18 @@ shouldFireListener = true; | ||
}); | ||
if (shouldFireListener) { | ||
var _this2$props; | ||
(_this2$props = _this2.props)[eventProp].apply(_this2$props, args); | ||
} | ||
}; // In order to handle unregistration of event listeners, we override the toString function to identify the | ||
}; | ||
// In order to handle unregistration of event listeners, we override the toString function to identify the | ||
// function by a UUID rather than the default toString of a function. | ||
var newEventListenerID = uuidv4(); | ||
eventCallbackFn.toString = function () { | ||
return newEventListenerID; | ||
}; | ||
_ps.on(this.propsEventMap[eventProp], eventCallbackFn); | ||
return eventCallbackFn.toString(); | ||
}; | ||
_proto.registerEventListeners = function registerEventListeners(groupKey) { | ||
var _this3 = this; | ||
var eventListeners = {}; | ||
@@ -235,4 +189,4 @@ Object.keys(this.propsEventMap).forEach(function (eventProp) { | ||
} | ||
}); // Store event listeners in state so we can unregister them later on unmount | ||
}); | ||
// Store event listeners in state so we can unregister them later on unmount | ||
if (this._isMounted) { | ||
@@ -244,19 +198,15 @@ this.setState({ | ||
}; | ||
_proto.unregisterEventListeners = function unregisterEventListeners() { | ||
var _this4 = this; | ||
if (this.state.eventListeners) { | ||
Object.keys(this.state.eventListeners).forEach(function (event) { | ||
var eventUUID = _this4.state.eventListeners[event]; // In order to unregister the event, we must create a fake function (typeof passed to _ps.off must be a function), | ||
var eventUUID = _this4.state.eventListeners[event]; | ||
// In order to unregister the event, we must create a fake function (typeof passed to _ps.off must be a function), | ||
// that returns the UUID we want to unregister. | ||
var fakeEventListener = function fakeEventListener() { | ||
return eventUUID; | ||
}; | ||
fakeEventListener.toString = function () { | ||
return eventUUID; | ||
}; | ||
_ps.off(event, fakeEventListener); | ||
@@ -266,23 +216,20 @@ }); | ||
}; | ||
_proto.createClickWrap = function createClickWrap() { | ||
var _this5 = this; | ||
var _this$props4 = this.props, | ||
acceptanceLanguage = _this$props4.acceptanceLanguage, | ||
clickWrapStyle = _this$props4.clickWrapStyle, | ||
customData = _this$props4.customData, | ||
confirmationEmail = _this$props4.confirmationEmail, | ||
containerId = _this$props4.containerId, | ||
displayAll = _this$props4.displayAll, | ||
displayImmediately = _this$props4.displayImmediately, | ||
filter = _this$props4.filter, | ||
forceScroll = _this$props4.forceScroll, | ||
groupKey = _this$props4.groupKey, | ||
injectSnippetOnly = _this$props4.injectSnippetOnly, | ||
renderData = _this$props4.renderData, | ||
signerIdSelector = _this$props4.signerIdSelector, | ||
snapshotLocation = _this$props4.snapshotLocation, | ||
allowDisagreed = _this$props4.allowDisagreed; | ||
acceptanceLanguage = _this$props4.acceptanceLanguage, | ||
clickWrapStyle = _this$props4.clickWrapStyle, | ||
customData = _this$props4.customData, | ||
confirmationEmail = _this$props4.confirmationEmail, | ||
containerId = _this$props4.containerId, | ||
displayAll = _this$props4.displayAll, | ||
displayImmediately = _this$props4.displayImmediately, | ||
filter = _this$props4.filter, | ||
forceScroll = _this$props4.forceScroll, | ||
groupKey = _this$props4.groupKey, | ||
injectSnippetOnly = _this$props4.injectSnippetOnly, | ||
renderData = _this$props4.renderData, | ||
signerIdSelector = _this$props4.signerIdSelector, | ||
snapshotLocation = _this$props4.snapshotLocation, | ||
allowDisagreed = _this$props4.allowDisagreed; | ||
var options = _extends({}, allowDisagreed !== undefined && { | ||
@@ -310,5 +257,3 @@ allow_disagreed: allowDisagreed | ||
}); | ||
if (injectSnippetOnly) return; | ||
if (groupKey && this._isMounted) { | ||
@@ -320,5 +265,3 @@ this.setState({ | ||
} | ||
var isDynamic = !groupKey; | ||
var eventCallback = function eventCallback(err, group) { | ||
@@ -331,21 +274,15 @@ if (group) { | ||
if (isDynamic) state.dynamicGroup = true; | ||
if (_this5._isMounted) { | ||
_this5.setState(state); | ||
} | ||
if (!isDynamic) group.render(); | ||
_this5.registerEventListeners(key); | ||
} | ||
}; | ||
if (customData) { | ||
_ps('set', 'custom_data', customData); | ||
} | ||
if (snapshotLocation) { | ||
_ps('set', 'snapshot_location', snapshotLocation); | ||
} | ||
if (groupKey) { | ||
@@ -359,13 +296,16 @@ _ps('load', groupKey, _extends({}, options, { | ||
}; | ||
_proto.render = function render() { | ||
var containerId = this.props.containerId; | ||
return /*#__PURE__*/React.createElement("div", { | ||
id: containerId | ||
id: containerId, | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 275, | ||
columnNumber: 12 | ||
} | ||
}); | ||
}; | ||
return PSClickWrap; | ||
}(React.Component); | ||
PSClickWrap.FILTER_OR_GROUPKEY_REQUIRED_ERROR_MESSAGE = 'PSClickWrap Error: You must provide either a groupKey or filter prop in order to use the PactSafe ClickWrap component!'; | ||
@@ -372,0 +312,0 @@ PSClickWrap.MUST_PROVIDE_RENDER_DATA_ERROR_MESSAGE = 'PSClickWrap Error: You must provide a renderData prop when passing down the dynamic prop'; |
@@ -5,2 +5,3 @@ /* | ||
*/ | ||
function injectSnippet(scriptURL, backupScriptURL) { | ||
@@ -21,18 +22,18 @@ (function (w, d, s, c, f, n, t, g, a, b, l) { | ||
}, w[n].t = 1 * new Date(), w[n].l = 0; // Marks the time that the script is inserted. | ||
// Inserts a new script element to load the PactSafe Library JS file (ps.js). | ||
a = d.createElement(s); | ||
b = d.getElementsByTagName(s)[0]; | ||
a.async = 1; | ||
a.src = c; // Marks that the script has started loading or failed to load. | ||
a.src = c; | ||
// Marks that the script has started loading or failed to load. | ||
a.onload = a.onreadystatechange = function () { | ||
w[n].l = 1; | ||
}; | ||
a.onerror = a.onabort = function () { | ||
w[n].l = 0; | ||
}; // Insert the script tag to the DOM, n a testing context, no script tags exist so b is undefined. | ||
}; | ||
// Insert the script tag to the DOM, n a testing context, no script tags exist so b is undefined. | ||
if (b) { | ||
@@ -42,5 +43,5 @@ b.parentNode.insertBefore(a, b); | ||
document.body.appendChild(a); | ||
} // Retry loading the script from a fallback location after 4 seconds. | ||
} | ||
// Retry loading the script from a fallback location after 4 seconds. | ||
setTimeout(function () { | ||
@@ -52,13 +53,11 @@ if (!w[n].l && !w[n].loaded) { | ||
a.src = f; | ||
a.onload = a.onreadystatechange = function () { | ||
w[n].l = 1; | ||
}; | ||
a.onerror = a.onabort = function () { | ||
w[n].l = 0; | ||
}; | ||
b.parentNode.insertBefore(a, b); | ||
b.parentNode.insertBefore(a, b); // Log the loading error via beacon. | ||
// Log the loading error via beacon. | ||
l = function l(u, e) { | ||
@@ -71,13 +70,11 @@ try { | ||
}; | ||
l(c); | ||
l(c); // Call the optional error callback function after a second failed attempt. | ||
// Call the optional error callback function after a second failed attempt. | ||
setTimeout(function () { | ||
if (!w[n].l && !w[n].loaded) { | ||
w[n].error = 1; | ||
if (g && "function" == typeof g) { | ||
g.call(this); | ||
} | ||
l(f); | ||
@@ -92,7 +89,5 @@ } | ||
} | ||
function isSnippetLoaded(psScriptURL) { | ||
var scripts = document.getElementsByTagName('script'); | ||
if (window._ps && window._ps.loaded && window._ps.realThang === 317) return true; | ||
for (var i = 0; i < scripts.length; i += 1) { | ||
@@ -103,6 +98,4 @@ if (scripts[i].src && scripts[i].src.indexOf(psScriptURL) !== -1) { | ||
} | ||
return false; | ||
} | ||
module.exports = { | ||
@@ -109,0 +102,0 @@ injectSnippet: injectSnippet, |
@@ -5,11 +5,6 @@ "use strict"; | ||
exports.PSClickWrap = exports.PSBrowseWrap = void 0; | ||
var _PSClickWrap = _interopRequireDefault(require("./PSClickWrap")); | ||
exports.PSClickWrap = _PSClickWrap["default"]; | ||
var _PSBrowseWrap = _interopRequireDefault(require("./PSBrowseWrap")); | ||
exports.PSBrowseWrap = _PSBrowseWrap["default"]; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
@@ -5,50 +5,34 @@ "use strict"; | ||
exports["default"] = void 0; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _reactProptypeConditionalRequire = _interopRequireDefault(require("react-proptype-conditional-require")); | ||
var _PSSnippet = _interopRequireDefault(require("./PSSnippet")); | ||
var _jsxFileName = "/Users/adam.gillaspie/Repositories/pactsafe-react-sdk/src/PSBrowseWrap.js"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /* global _ps */ | ||
var PSBrowseWrap = /*#__PURE__*/function (_React$Component) { | ||
_inheritsLoose(PSBrowseWrap, _React$Component); | ||
function PSBrowseWrap(props) { | ||
var _this; | ||
_this = _React$Component.call(this, props) || this; | ||
var _this$props = _this.props, | ||
psScriptUrl = _this$props.psScriptUrl, | ||
groupKey = _this$props.groupKey, | ||
accessId = _this$props.accessId; | ||
psScriptUrl = _this$props.psScriptUrl, | ||
groupKey = _this$props.groupKey, | ||
accessId = _this$props.accessId; | ||
if (!_PSSnippet["default"].isSnippetLoaded(psScriptUrl)) { | ||
_PSSnippet["default"].injectSnippet(psScriptUrl); | ||
} | ||
_this.targetSelector = "psbw-" + groupKey; | ||
_ps('create', accessId); | ||
return _this; | ||
} | ||
var _proto = PSBrowseWrap.prototype; | ||
_proto.componentDidMount = function componentDidMount() { | ||
var _this$props2 = this.props, | ||
groupKey = _this$props2.groupKey, | ||
position = _this$props2.position, | ||
badgeText = _this$props2.badgeText, | ||
alwaysVisible = _this$props2.alwaysVisible, | ||
openLegalCenter = _this$props2.openLegalCenter; | ||
groupKey = _this$props2.groupKey, | ||
position = _this$props2.position, | ||
badgeText = _this$props2.badgeText, | ||
alwaysVisible = _this$props2.alwaysVisible, | ||
openLegalCenter = _this$props2.openLegalCenter; | ||
_ps('load', groupKey, { | ||
@@ -62,3 +46,2 @@ target_selector: this.targetSelector, | ||
}; | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
@@ -68,16 +51,19 @@ var groupKey = this.props.groupKey; | ||
}; | ||
_proto.render = function render() { | ||
var _this$props3 = this.props, | ||
link = _this$props3.link, | ||
linkText = _this$props3.linkText; | ||
link = _this$props3.link, | ||
linkText = _this$props3.linkText; | ||
return /*#__PURE__*/_react["default"].createElement("a", { | ||
href: link, | ||
id: this.targetSelector | ||
id: this.targetSelector, | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 37, | ||
columnNumber: 7 | ||
} | ||
}, linkText); | ||
}; | ||
return PSBrowseWrap; | ||
}(_react["default"].Component); | ||
PSBrowseWrap.MUST_PROVIDE_LINK_IF_OPEN_LEGAL_CENTER_FALSE = 'PSBrowseWrap Error: You must provide a link prop if openLegalCenter is passed false'; | ||
@@ -103,4 +89,3 @@ PSBrowseWrap.propTypes = process.env.NODE_ENV !== "production" ? { | ||
}; | ||
var _default = PSBrowseWrap; | ||
exports["default"] = _default; | ||
var _default = exports["default"] = PSBrowseWrap; | ||
module.exports = exports.default; |
@@ -5,37 +5,23 @@ "use strict"; | ||
exports["default"] = void 0; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _reactProptypeConditionalRequire = _interopRequireDefault(require("react-proptype-conditional-require")); | ||
var _uuid = require("uuid"); | ||
var _lodash = _interopRequireDefault(require("lodash.isequal")); | ||
var _PSSnippet = _interopRequireDefault(require("./PSSnippet")); | ||
var _jsxFileName = "/Users/adam.gillaspie/Repositories/pactsafe-react-sdk/src/PSClickWrap.js"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* global _ps */ | ||
var PSClickWrap = /*#__PURE__*/function (_React$Component) { | ||
_inheritsLoose(PSClickWrap, _React$Component); | ||
function PSClickWrap(props) { | ||
var _this; | ||
_this = _React$Component.call(this, props) || this; | ||
_defineProperty(_assertThisInitialized(_this), "_isMounted", false); | ||
_this.createClickWrap = _this.createClickWrap.bind(_assertThisInitialized(_this)); | ||
@@ -63,22 +49,18 @@ _this.state = { | ||
var _this$props = _this.props, | ||
accessId = _this$props.accessId, | ||
backupScriptURL = _this$props.backupScriptURL, | ||
debug = _this$props.debug, | ||
disableSending = _this$props.disableSending, | ||
dynamic = _this$props.dynamic, | ||
injectSnippetOnly = _this$props.injectSnippetOnly, | ||
psScriptUrl = _this$props.psScriptUrl, | ||
signerId = _this$props.signerId, | ||
testMode = _this$props.testMode; | ||
accessId = _this$props.accessId, | ||
backupScriptURL = _this$props.backupScriptURL, | ||
debug = _this$props.debug, | ||
disableSending = _this$props.disableSending, | ||
dynamic = _this$props.dynamic, | ||
injectSnippetOnly = _this$props.injectSnippetOnly, | ||
psScriptUrl = _this$props.psScriptUrl, | ||
signerId = _this$props.signerId, | ||
testMode = _this$props.testMode; | ||
if (!_PSSnippet["default"].isSnippetLoaded(psScriptUrl, backupScriptURL)) { | ||
_PSSnippet["default"].injectSnippet(psScriptUrl, backupScriptURL); | ||
} | ||
if (debug) { | ||
_ps.debug = true; | ||
} | ||
if (injectSnippetOnly) return _assertThisInitialized(_this); | ||
_ps('create', accessId, { | ||
@@ -90,12 +72,7 @@ test_mode: testMode, | ||
}); | ||
_ps('set', 'client_library', 'react-sdk'); | ||
_ps('set', 'client_version', "2.12.0"); | ||
_ps('set', 'client_version', "2.13.3"); | ||
return _this; | ||
} | ||
var _proto = PSClickWrap.prototype; | ||
_proto.componentDidMount = function componentDidMount() { | ||
@@ -107,36 +84,28 @@ var injectSnippetOnly = this.props.injectSnippetOnly; | ||
}; | ||
_proto.componentDidUpdate = function componentDidUpdate(prevProps) { | ||
var _this$props2 = this.props, | ||
acceptanceLanguage = _this$props2.acceptanceLanguage, | ||
clickWrapStyle = _this$props2.clickWrapStyle, | ||
customData = _this$props2.customData, | ||
filter = _this$props2.filter, | ||
groupKey = _this$props2.groupKey, | ||
injectSnippetOnly = _this$props2.injectSnippetOnly, | ||
renderData = _this$props2.renderData, | ||
signerId = _this$props2.signerId, | ||
snapshotLocation = _this$props2.snapshotLocation; | ||
acceptanceLanguage = _this$props2.acceptanceLanguage, | ||
clickWrapStyle = _this$props2.clickWrapStyle, | ||
customData = _this$props2.customData, | ||
filter = _this$props2.filter, | ||
groupKey = _this$props2.groupKey, | ||
injectSnippetOnly = _this$props2.injectSnippetOnly, | ||
renderData = _this$props2.renderData, | ||
signerId = _this$props2.signerId, | ||
snapshotLocation = _this$props2.snapshotLocation; | ||
var _this$state = this.state, | ||
clickwrapGroupKey = _this$state.clickwrapGroupKey, | ||
dynamicGroup = _this$state.dynamicGroup; | ||
clickwrapGroupKey = _this$state.clickwrapGroupKey, | ||
dynamicGroup = _this$state.dynamicGroup; | ||
var _psLoadedValidGroup = _ps && _ps.getByKey && typeof _ps.getByKey === 'function' && clickwrapGroupKey && _ps.getByKey(clickwrapGroupKey); | ||
if (injectSnippetOnly) return; | ||
if (clickWrapStyle !== prevProps.clickWrapStyle && !dynamicGroup && _psLoadedValidGroup) { | ||
_ps.getByKey(clickwrapGroupKey).site.set('style', clickWrapStyle); | ||
_ps.getByKey(clickwrapGroupKey).retrieveHTML(); | ||
} | ||
if (!(0, _lodash["default"])(customData, prevProps.customData)) { | ||
_ps('set', 'custom_data', customData); | ||
} | ||
if (acceptanceLanguage !== prevProps.acceptanceLanguage) { | ||
_ps('set', 'acceptance_language', acceptanceLanguage); | ||
} | ||
if (!(0, _lodash["default"])(renderData, prevProps.renderData)) { | ||
@@ -146,6 +115,4 @@ if (clickWrapStyle && _psLoadedValidGroup) { | ||
} | ||
_ps(clickwrapGroupKey + ":retrieveHTML", renderData); | ||
} | ||
if (signerId !== prevProps.signerId) { | ||
@@ -155,18 +122,13 @@ if (clickWrapStyle && _psLoadedValidGroup) { | ||
} | ||
_ps('set', 'signer_id', signerId); | ||
} | ||
if (snapshotLocation !== prevProps.snapshotLocation) { | ||
_ps('set', 'snapshot_location', snapshotLocation); | ||
} | ||
if (clickWrapStyle !== prevProps.clickWrapStyle && dynamicGroup) { | ||
this.createClickWrap(); | ||
} | ||
if (filter !== prevProps.filter) { | ||
this.createClickWrap(); | ||
} | ||
if (groupKey !== prevProps.groupKey && !dynamicGroup) { | ||
@@ -177,10 +139,8 @@ this.createClickWrap(); | ||
}; | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
this._isMounted = false; | ||
var _this$props3 = this.props, | ||
injectSnippetOnly = _this$props3.injectSnippetOnly, | ||
groupKey = _this$props3.groupKey; | ||
injectSnippetOnly = _this$props3.injectSnippetOnly, | ||
groupKey = _this$props3.groupKey; | ||
if (injectSnippetOnly) return; | ||
if (_ps && _ps.getByKey && typeof _ps.getByKey === 'function' && _ps.getByKey(groupKey)) { | ||
@@ -190,23 +150,18 @@ if (_ps.getByKey(groupKey).rendered) { | ||
} | ||
_ps.getByKey(groupKey).resetData(); | ||
} | ||
this.unregisterEventListeners(); | ||
}; | ||
_proto.registerEventListener = function registerEventListener(eventProp, groupKey) { | ||
var _this2 = this; | ||
var eventCallbackFn = function eventCallbackFn() { | ||
var shouldFireListener = false; | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
args.forEach(function (arg) { | ||
// We need to check the context variable and see if it matches the groupKey, if it does -> fire the event (context argument position varies) | ||
if (arg && arg.get && arg.get('key') && arg.get('key') === groupKey) { | ||
shouldFireListener = true; // Else we should check if the context is for the entire site, and as such the context variable is a Site object. | ||
shouldFireListener = true; | ||
// Else we should check if the context is for the entire site, and as such the context variable is a Site object. | ||
} else if (arg && arg.toString() === '[object Site]') { | ||
@@ -216,26 +171,18 @@ shouldFireListener = true; | ||
}); | ||
if (shouldFireListener) { | ||
var _this2$props; | ||
(_this2$props = _this2.props)[eventProp].apply(_this2$props, args); | ||
} | ||
}; // In order to handle unregistration of event listeners, we override the toString function to identify the | ||
}; | ||
// In order to handle unregistration of event listeners, we override the toString function to identify the | ||
// function by a UUID rather than the default toString of a function. | ||
var newEventListenerID = (0, _uuid.v4)(); | ||
eventCallbackFn.toString = function () { | ||
return newEventListenerID; | ||
}; | ||
_ps.on(this.propsEventMap[eventProp], eventCallbackFn); | ||
return eventCallbackFn.toString(); | ||
}; | ||
_proto.registerEventListeners = function registerEventListeners(groupKey) { | ||
var _this3 = this; | ||
var eventListeners = {}; | ||
@@ -246,4 +193,4 @@ Object.keys(this.propsEventMap).forEach(function (eventProp) { | ||
} | ||
}); // Store event listeners in state so we can unregister them later on unmount | ||
}); | ||
// Store event listeners in state so we can unregister them later on unmount | ||
if (this._isMounted) { | ||
@@ -255,19 +202,15 @@ this.setState({ | ||
}; | ||
_proto.unregisterEventListeners = function unregisterEventListeners() { | ||
var _this4 = this; | ||
if (this.state.eventListeners) { | ||
Object.keys(this.state.eventListeners).forEach(function (event) { | ||
var eventUUID = _this4.state.eventListeners[event]; // In order to unregister the event, we must create a fake function (typeof passed to _ps.off must be a function), | ||
var eventUUID = _this4.state.eventListeners[event]; | ||
// In order to unregister the event, we must create a fake function (typeof passed to _ps.off must be a function), | ||
// that returns the UUID we want to unregister. | ||
var fakeEventListener = function fakeEventListener() { | ||
return eventUUID; | ||
}; | ||
fakeEventListener.toString = function () { | ||
return eventUUID; | ||
}; | ||
_ps.off(event, fakeEventListener); | ||
@@ -277,23 +220,20 @@ }); | ||
}; | ||
_proto.createClickWrap = function createClickWrap() { | ||
var _this5 = this; | ||
var _this$props4 = this.props, | ||
acceptanceLanguage = _this$props4.acceptanceLanguage, | ||
clickWrapStyle = _this$props4.clickWrapStyle, | ||
customData = _this$props4.customData, | ||
confirmationEmail = _this$props4.confirmationEmail, | ||
containerId = _this$props4.containerId, | ||
displayAll = _this$props4.displayAll, | ||
displayImmediately = _this$props4.displayImmediately, | ||
filter = _this$props4.filter, | ||
forceScroll = _this$props4.forceScroll, | ||
groupKey = _this$props4.groupKey, | ||
injectSnippetOnly = _this$props4.injectSnippetOnly, | ||
renderData = _this$props4.renderData, | ||
signerIdSelector = _this$props4.signerIdSelector, | ||
snapshotLocation = _this$props4.snapshotLocation, | ||
allowDisagreed = _this$props4.allowDisagreed; | ||
acceptanceLanguage = _this$props4.acceptanceLanguage, | ||
clickWrapStyle = _this$props4.clickWrapStyle, | ||
customData = _this$props4.customData, | ||
confirmationEmail = _this$props4.confirmationEmail, | ||
containerId = _this$props4.containerId, | ||
displayAll = _this$props4.displayAll, | ||
displayImmediately = _this$props4.displayImmediately, | ||
filter = _this$props4.filter, | ||
forceScroll = _this$props4.forceScroll, | ||
groupKey = _this$props4.groupKey, | ||
injectSnippetOnly = _this$props4.injectSnippetOnly, | ||
renderData = _this$props4.renderData, | ||
signerIdSelector = _this$props4.signerIdSelector, | ||
snapshotLocation = _this$props4.snapshotLocation, | ||
allowDisagreed = _this$props4.allowDisagreed; | ||
var options = _extends({}, allowDisagreed !== undefined && { | ||
@@ -321,5 +261,3 @@ allow_disagreed: allowDisagreed | ||
}); | ||
if (injectSnippetOnly) return; | ||
if (groupKey && this._isMounted) { | ||
@@ -331,5 +269,3 @@ this.setState({ | ||
} | ||
var isDynamic = !groupKey; | ||
var eventCallback = function eventCallback(err, group) { | ||
@@ -342,21 +278,15 @@ if (group) { | ||
if (isDynamic) state.dynamicGroup = true; | ||
if (_this5._isMounted) { | ||
_this5.setState(state); | ||
} | ||
if (!isDynamic) group.render(); | ||
_this5.registerEventListeners(key); | ||
} | ||
}; | ||
if (customData) { | ||
_ps('set', 'custom_data', customData); | ||
} | ||
if (snapshotLocation) { | ||
_ps('set', 'snapshot_location', snapshotLocation); | ||
} | ||
if (groupKey) { | ||
@@ -370,13 +300,16 @@ _ps('load', groupKey, _extends({}, options, { | ||
}; | ||
_proto.render = function render() { | ||
var containerId = this.props.containerId; | ||
return /*#__PURE__*/_react["default"].createElement("div", { | ||
id: containerId | ||
id: containerId, | ||
__self: this, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 275, | ||
columnNumber: 12 | ||
} | ||
}); | ||
}; | ||
return PSClickWrap; | ||
}(_react["default"].Component); | ||
PSClickWrap.FILTER_OR_GROUPKEY_REQUIRED_ERROR_MESSAGE = 'PSClickWrap Error: You must provide either a groupKey or filter prop in order to use the PactSafe ClickWrap component!'; | ||
@@ -449,4 +382,3 @@ PSClickWrap.MUST_PROVIDE_RENDER_DATA_ERROR_MESSAGE = 'PSClickWrap Error: You must provide a renderData prop when passing down the dynamic prop'; | ||
}; | ||
var _default = PSClickWrap; | ||
exports["default"] = _default; | ||
var _default = exports["default"] = PSClickWrap; | ||
module.exports = exports.default; |
@@ -7,2 +7,3 @@ "use strict"; | ||
*/ | ||
function injectSnippet(scriptURL, backupScriptURL) { | ||
@@ -23,18 +24,18 @@ (function (w, d, s, c, f, n, t, g, a, b, l) { | ||
}, w[n].t = 1 * new Date(), w[n].l = 0; // Marks the time that the script is inserted. | ||
// Inserts a new script element to load the PactSafe Library JS file (ps.js). | ||
a = d.createElement(s); | ||
b = d.getElementsByTagName(s)[0]; | ||
a.async = 1; | ||
a.src = c; // Marks that the script has started loading or failed to load. | ||
a.src = c; | ||
// Marks that the script has started loading or failed to load. | ||
a.onload = a.onreadystatechange = function () { | ||
w[n].l = 1; | ||
}; | ||
a.onerror = a.onabort = function () { | ||
w[n].l = 0; | ||
}; // Insert the script tag to the DOM, n a testing context, no script tags exist so b is undefined. | ||
}; | ||
// Insert the script tag to the DOM, n a testing context, no script tags exist so b is undefined. | ||
if (b) { | ||
@@ -44,5 +45,5 @@ b.parentNode.insertBefore(a, b); | ||
document.body.appendChild(a); | ||
} // Retry loading the script from a fallback location after 4 seconds. | ||
} | ||
// Retry loading the script from a fallback location after 4 seconds. | ||
setTimeout(function () { | ||
@@ -54,13 +55,11 @@ if (!w[n].l && !w[n].loaded) { | ||
a.src = f; | ||
a.onload = a.onreadystatechange = function () { | ||
w[n].l = 1; | ||
}; | ||
a.onerror = a.onabort = function () { | ||
w[n].l = 0; | ||
}; | ||
b.parentNode.insertBefore(a, b); | ||
b.parentNode.insertBefore(a, b); // Log the loading error via beacon. | ||
// Log the loading error via beacon. | ||
l = function l(u, e) { | ||
@@ -73,13 +72,11 @@ try { | ||
}; | ||
l(c); | ||
l(c); // Call the optional error callback function after a second failed attempt. | ||
// Call the optional error callback function after a second failed attempt. | ||
setTimeout(function () { | ||
if (!w[n].l && !w[n].loaded) { | ||
w[n].error = 1; | ||
if (g && "function" == typeof g) { | ||
g.call(this); | ||
} | ||
l(f); | ||
@@ -94,7 +91,5 @@ } | ||
} | ||
function isSnippetLoaded(psScriptURL) { | ||
var scripts = document.getElementsByTagName('script'); | ||
if (window._ps && window._ps.loaded && window._ps.realThang === 317) return true; | ||
for (var i = 0; i < scripts.length; i += 1) { | ||
@@ -105,6 +100,4 @@ if (scripts[i].src && scripts[i].src.indexOf(psScriptURL) !== -1) { | ||
} | ||
return false; | ||
} | ||
module.exports = { | ||
@@ -111,0 +104,0 @@ injectSnippet: injectSnippet, |
{ | ||
"name": "@pactsafe/pactsafe-react-sdk", | ||
"version": "2.12.0", | ||
"version": "2.13.3", | ||
"description": "Ironclad Clickwrap React SDK - SDK for easy Ironclad Clickwrap implementations leveraging the Ironclad JavaScript Library & API", | ||
@@ -11,6 +11,6 @@ "author": "Ironclad", | ||
"scripts": { | ||
"build": "nwb build-react-component", | ||
"build": "NODE_OPTIONS=--openssl-legacy-provider nwb build-react-component", | ||
"clean": "nwb clean-module && nwb clean-demo", | ||
"prepublishOnly": "npm run build", | ||
"start": "nwb serve-react-demo", | ||
"start": "NODE_OPTIONS=--openssl-legacy-provider nwb serve-react-demo", | ||
"test": "jest", | ||
@@ -21,3 +21,3 @@ "test:watch": "jest --watch", | ||
"lint": "./node_modules/.bin/eslint src/ tests/ demo/src/ --fix", | ||
"release": "np", | ||
"release": "./node_modules/.bin/np", | ||
"preversion": "npm test && npm run lint", | ||
@@ -32,2 +32,5 @@ "postversion": "git push && git push --tags", | ||
], | ||
"engines": { | ||
"node": ">=18.18.2" | ||
}, | ||
"dependencies": { | ||
@@ -49,8 +52,7 @@ "classnames": "^2.3.2", | ||
"@babel/preset-react": "^7.18.6", | ||
"@testing-library/jest-dom": "^5.17.0", | ||
"@testing-library/react": "^11.2.7", | ||
"babel-jest": "^29.0.3", | ||
"babel-plugin-search-and-replace": "^1.1.1", | ||
"dotenv-webpack": "^8.0.1", | ||
"enzyme": "^3.11.0", | ||
"enzyme-adapter-react-16": "^1.15.6", | ||
"enzyme-to-json": "^3.6.2", | ||
"eslint": "^8.23.1", | ||
@@ -66,3 +68,3 @@ "eslint-config-airbnb": "^19.0.4", | ||
"jsdom": "^20.0.0", | ||
"np": "^7.6.2", | ||
"np": "^8.0.4", | ||
"nwb": "^0.25.2", | ||
@@ -81,8 +83,2 @@ "react": "^16.6.0", | ||
"jest": { | ||
"setupFiles": [ | ||
"./tests/jest-setup.js" | ||
], | ||
"snapshotSerializers": [ | ||
"enzyme-to-json/serializer" | ||
], | ||
"transform": { | ||
@@ -89,0 +85,0 @@ "^.+\\.js$": "<rootDir>/jest.transform.js" |
/*! | ||
* @pactsafe/pactsafe-react-sdk v2.12.0 - https://github.com/PactSafe/pactsafe-react-sdk | ||
* @pactsafe/pactsafe-react-sdk v2.13.3 - https://github.com/PactSafe/pactsafe-react-sdk | ||
* MIT Licensed | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.PSReactSDK=t(require("react")):e.PSReactSDK=t(e.React)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(t,r){t.exports=e},function(e,t){e.exports={injectSnippet:function(e,t){var r,n,o,i,a,c,s,u,p,l;r=window,n=document,o="script",i=e,a=t,c="_ps",s=function(){console.log("Unable to load the PactSafe PS.JS Library.")},r.PactSafeObject=c,r._ps=r._ps||function(){(r._ps.q=r._ps.q||[]).push(arguments)},r._ps.on=function(){(r._ps.e=r._ps.e||[]).push(arguments)},r._ps.once=function(){(r._ps.eo=r._ps.eo||[]).push(arguments)},r._ps.off=function(){(r._ps.o=r._ps.o||[]).push(arguments)},r._ps.t=1*new Date,r._ps.l=0,u=n.createElement(o),p=n.getElementsByTagName(o)[0],u.async=1,u.src=i,u.onload=u.onreadystatechange=function(){r._ps.l=1},u.onerror=u.onabort=function(){r._ps.l=0},p?p.parentNode.insertBefore(u,p):document.body.appendChild(u),setTimeout((function(){r._ps.l||r._ps.loaded||(r._ps.error=1,(u=n.createElement(o)).async=1,u.src=a,u.onload=u.onreadystatechange=function(){r._ps.l=1},u.onerror=u.onabort=function(){r._ps.l=0},p.parentNode.insertBefore(u,p),(l=function(e,t){try{(t=n.createElement("img")).src="https://d3r8bdci515tjv.cloudfront.net/error.gif?t="+r._ps.t+"&u="+encodeURIComponent(e),n.getElementsByTagName("body")[0].appendChild(t)}catch(e){}})(i),setTimeout((function(){r._ps.l||r._ps.loaded||(r._ps.error=1,s&&s.call(this),l(a))}),4e3))}),4e3)},isSnippetLoaded:function(e){var t=document.getElementsByTagName("script");if(window._ps&&window._ps.loaded&&317===window._ps.realThang)return!0;for(var r=0;r<t.length;r+=1)if(t[r].src&&-1!==t[r].src.indexOf(e))return!0;return!1}}},function(e,t,r){(function(e,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[n]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[o]=u["[object Number]"]=u[i]=u["[object RegExp]"]=u[a]=u["[object String]"]=u["[object WeakMap]"]=!1;var p="object"==typeof e&&e&&e.Object===Object&&e,l="object"==typeof self&&self&&self.Object===Object&&self,f=p||l||Function("return this")(),d=t&&!t.nodeType&&t,_=d&&"object"==typeof r&&r&&!r.nodeType&&r,y=_&&_.exports===d,h=y&&p.process,v=function(){try{return h&&h.binding&&h.binding("util")}catch(e){}}(),g=v&&v.isTypedArray;function b(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function m(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function j(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var S,w,E,O=Array.prototype,k=Function.prototype,P=Object.prototype,L=f["__core-js_shared__"],D=k.toString,A=P.hasOwnProperty,I=(S=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",R=P.toString,U=RegExp("^"+D.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=y?f.Buffer:void 0,K=f.Symbol,T=f.Uint8Array,B=P.propertyIsEnumerable,C=O.splice,x=K?K.toStringTag:void 0,W=Object.getOwnPropertySymbols,z=M?M.isBuffer:void 0,G=(w=Object.keys,E=Object,function(e){return w(E(e))}),N=ve(f,"DataView"),V=ve(f,"Map"),F=ve(f,"Promise"),$=ve(f,"Set"),q=ve(f,"WeakMap"),Y=ve(Object,"create"),H=je(N),J=je(V),Q=je(F),X=je($),Z=je(q),ee=K?K.prototype:void 0,te=ee?ee.valueOf:void 0;function re(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new oe;++t<r;)this.add(e[t])}function ae(e){var t=this.__data__=new ne(e);this.size=t.size}function ce(e,t){var r=Ee(e),n=!r&&we(e),o=!r&&!n&&Oe(e),i=!r&&!n&&!o&&Ae(e),a=r||n||o||i,c=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],s=c.length;for(var u in e)!t&&!A.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||me(u,s))||c.push(u);return c}function se(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":x&&x in Object(e)?function(e){var t=A.call(e,x),r=e[x];try{e[x]=void 0;var n=!0}catch(e){}var o=R.call(e);n&&(t?e[x]=r:delete e[x]);return o}(e):function(e){return R.call(e)}(e)}function pe(e){return De(e)&&ue(e)==n}function le(e,t,r,c,s){return e===t||(null==e||null==t||!De(e)&&!De(t)?e!=e&&t!=t:function(e,t,r,c,s,u){var p=Ee(e),l=Ee(t),f=p?"[object Array]":be(e),d=l?"[object Array]":be(t),_=(f=f==n?i:f)==i,y=(d=d==n?i:d)==i,h=f==d;if(h&&Oe(e)){if(!Oe(t))return!1;p=!0,_=!1}if(h&&!_)return u||(u=new ae),p||Ae(e)?_e(e,t,r,c,s,u):function(e,t,r,n,i,c,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!c(new T(e),new T(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Se(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case o:var u=m;case a:var p=1&n;if(u||(u=j),e.size!=t.size&&!p)return!1;var l=s.get(e);if(l)return l==t;n|=2,s.set(e,t);var f=_e(u(e),u(t),n,i,c,s);return s.delete(e),f;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,f,r,c,s,u);if(!(1&r)){var v=_&&A.call(e,"__wrapped__"),g=y&&A.call(t,"__wrapped__");if(v||g){var b=v?e.value():e,S=g?t.value():t;return u||(u=new ae),s(b,S,r,c,u)}}if(!h)return!1;return u||(u=new ae),function(e,t,r,n,o,i){var a=1&r,c=ye(e),s=c.length,u=ye(t).length;if(s!=u&&!a)return!1;var p=s;for(;p--;){var l=c[p];if(!(a?l in t:A.call(t,l)))return!1}var f=i.get(e);if(f&&i.get(t))return f==t;var d=!0;i.set(e,t),i.set(t,e);var _=a;for(;++p<s;){l=c[p];var y=e[l],h=t[l];if(n)var v=a?n(h,y,l,t,e,i):n(y,h,l,e,t,i);if(!(void 0===v?y===h||o(y,h,r,n,i):v)){d=!1;break}_||(_="constructor"==l)}if(d&&!_){var g=e.constructor,b=t.constructor;g==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,r,c,s,u)}(e,t,r,c,le,s))}function fe(e){return!(!Le(e)||function(e){return!!I&&I in e}(e))&&(ke(e)?U:c).test(je(e))}function de(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||P,t!==n)return G(e);var t,r,n,o=[];for(var i in Object(e))A.call(e,i)&&"constructor"!=i&&o.push(i);return o}function _e(e,t,r,n,o,i){var a=1&r,c=e.length,s=t.length;if(c!=s&&!(a&&s>c))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var p=-1,l=!0,f=2&r?new ie:void 0;for(i.set(e,t),i.set(t,e);++p<c;){var d=e[p],_=t[p];if(n)var y=a?n(_,d,p,t,e,i):n(d,_,p,e,t,i);if(void 0!==y){if(y)continue;l=!1;break}if(f){if(!b(t,(function(e,t){if(a=t,!f.has(a)&&(d===e||o(d,e,r,n,i)))return f.push(t);var a}))){l=!1;break}}else if(d!==_&&!o(d,_,r,n,i)){l=!1;break}}return i.delete(e),i.delete(t),l}function ye(e){return function(e,t,r){var n=t(e);return Ee(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Ie,ge)}function he(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function ve(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return fe(r)?r:void 0}re.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(Y){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return A.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:A.call(t,e)},re.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this},ne.prototype.clear=function(){this.__data__=[],this.size=0},ne.prototype.delete=function(e){var t=this.__data__,r=se(t,e);return!(r<0)&&(r==t.length-1?t.pop():C.call(t,r,1),--this.size,!0)},ne.prototype.get=function(e){var t=this.__data__,r=se(t,e);return r<0?void 0:t[r][1]},ne.prototype.has=function(e){return se(this.__data__,e)>-1},ne.prototype.set=function(e,t){var r=this.__data__,n=se(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},oe.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(V||ne),string:new re}},oe.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return he(this,e).get(e)},oe.prototype.has=function(e){return he(this,e).has(e)},oe.prototype.set=function(e,t){var r=he(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.add=ie.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ie.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.clear=function(){this.__data__=new ne,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ne){var n=r.__data__;if(!V||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new oe(n)}return r.set(e,t),this.size=r.size,this};var ge=W?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}(W(e),(function(t){return B.call(e,t)})))}:function(){return[]},be=ue;function me(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||s.test(e))&&e>-1&&e%1==0&&e<t}function je(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Se(e,t){return e===t||e!=e&&t!=t}(N&&"[object DataView]"!=be(new N(new ArrayBuffer(1)))||V&&be(new V)!=o||F&&"[object Promise]"!=be(F.resolve())||$&&be(new $)!=a||q&&"[object WeakMap]"!=be(new q))&&(be=function(e){var t=ue(e),r=t==i?e.constructor:void 0,n=r?je(r):"";if(n)switch(n){case H:return"[object DataView]";case J:return o;case Q:return"[object Promise]";case X:return a;case Z:return"[object WeakMap]"}return t});var we=pe(function(){return arguments}())?pe:function(e){return De(e)&&A.call(e,"callee")&&!B.call(e,"callee")},Ee=Array.isArray;var Oe=z||function(){return!1};function ke(e){if(!Le(e))return!1;var t=ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Le(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function De(e){return null!=e&&"object"==typeof e}var Ae=g?function(e){return function(t){return e(t)}}(g):function(e){return De(e)&&Pe(e.length)&&!!u[ue(e)]};function Ie(e){return null!=(t=e)&&Pe(t.length)&&!ke(t)?ce(e):de(e);var t}r.exports=function(e,t){return le(e,t)}}).call(this,r(5),r(6)(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r,n){return"boolean"==typeof e?e:"function"==typeof e?e(t,r,n):!(!0!=!!e||!e)},o=function(e,t){return Object.hasOwnProperty.call(e,t)},i=function(e,t,r,n){return n?new Error(n):new Error("Required "+e[t]+" `"+t+"` was not specified in `"+r+"`.")};t.default=function(e,t,r){return function(e,t){if("function"!=typeof e)throw new TypeError("The typeValidator argument must be a function with the signature function(props, propName, componentName).");if(t&&"string"!=typeof t)throw new TypeError("The error message is optional, but must be a string if provided.")}(e,r),function(a,c,s){for(var u=arguments.length,p=Array(3<u?u-3:0),l=3;l<u;l++)p[l-3]=arguments[l];return n(t,a,c,s)?o(a,c)?e.apply(void 0,[a,c,s].concat(p)):i(a,c,s,r):e.apply(void 0,[a,c,s].concat(p))}}},function(e,t,r){e.exports=r(7)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";r.r(t),r.d(t,"PSClickWrap",(function(){return m})),r.d(t,"PSBrowseWrap",(function(){return w}));var n=r(0),o=r.n(n);r(3);var i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let a;const c=new Uint8Array(16);function s(){if(!a&&(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!a))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(c)}const u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function p(e,t=0){return(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase()}var l=function(e,t,r){if(i.randomUUID&&!t&&!e)return i.randomUUID();const n=(e=e||{}).random||(e.rng||s)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return p(n)},f=r(2),d=r.n(f),_=r(1),y=r.n(_);function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var b=function(e){var t,r;function n(t){var r,n,o,i;r=e.call(this,t)||this,n=v(r),i=!1,(o="_isMounted")in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,r.createClickWrap=r.createClickWrap.bind(v(r)),r.state={clickwrapGroupKey:null,dynamicGroup:!1},r.propsEventMap={onAll:"all",onSent:"sent",onRetrieved:"retrieved",onSet:"set",onSetSignerId:"set:signer_id",onValid:"valid",onInvalid:"invalid",onChecked:"checked",onUnchecked:"unchecked",onRendered:"rendered",onDisplayed:"displayed",onScrolledContract:"scrolled:contract",onScrolled:"scrolled",onError:"error"};var a=r.props,c=a.accessId,s=a.backupScriptURL,u=a.debug,p=a.disableSending,l=a.dynamic,f=a.injectSnippetOnly,d=a.psScriptUrl,_=a.signerId,h=a.testMode;return y.a.isSnippetLoaded(d,s)||y.a.injectSnippet(d,s),u&&(_ps.debug=!0),f?v(r):(_ps("create",c,{test_mode:h,disable_sending:p,dynamic:l,signer_id:_}),_ps("set","client_library","react-sdk"),_ps("set","client_version","2.12.0"),r)}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,g(t,r);var i=n.prototype;return i.componentDidMount=function(){var e=this.props.injectSnippetOnly;this._isMounted=!0,e||this.createClickWrap()},i.componentDidUpdate=function(e){var t=this.props,r=t.acceptanceLanguage,n=t.clickWrapStyle,o=t.customData,i=t.filter,a=t.groupKey,c=t.injectSnippetOnly,s=t.renderData,u=t.signerId,p=t.snapshotLocation,l=this.state,f=l.clickwrapGroupKey,_=l.dynamicGroup,y=_ps&&_ps.getByKey&&"function"==typeof _ps.getByKey&&f&&_ps.getByKey(f);c||(n!==e.clickWrapStyle&&!_&&y&&(_ps.getByKey(f).site.set("style",n),_ps.getByKey(f).retrieveHTML()),d()(o,e.customData)||_ps("set","custom_data",o),r!==e.acceptanceLanguage&&_ps("set","acceptance_language",r),d()(s,e.renderData)||(n&&y&&_ps.getByKey(f).site.set("style",n),_ps(f+":retrieveHTML",s)),u!==e.signerId&&(n&&y&&_ps.getByKey(f).site.set("style",n),_ps("set","signer_id",u)),p!==e.snapshotLocation&&_ps("set","snapshot_location",p),n!==e.clickWrapStyle&&_&&this.createClickWrap(),i!==e.filter&&this.createClickWrap(),a===e.groupKey||_||(this.createClickWrap(),y&&_ps.getByKey(f).retrieveHTML()))},i.componentWillUnmount=function(){this._isMounted=!1;var e=this.props,t=e.injectSnippetOnly,r=e.groupKey;t||(_ps&&_ps.getByKey&&"function"==typeof _ps.getByKey&&_ps.getByKey(r)&&(_ps.getByKey(r).rendered&&(_ps.getByKey(r).rendered=!1),_ps.getByKey(r).resetData()),this.unregisterEventListeners())},i.registerEventListener=function(e,t){var r=this,n=function(){for(var n,o=!1,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];(a.forEach((function(e){(e&&e.get&&e.get("key")&&e.get("key")===t||e&&"[object Site]"===e.toString())&&(o=!0)})),o)&&(n=r.props)[e].apply(n,a)},o=l();return n.toString=function(){return o},_ps.on(this.propsEventMap[e],n),n.toString()},i.registerEventListeners=function(e){var t=this,r={};Object.keys(this.propsEventMap).forEach((function(n){t.props[n]&&(r[t.propsEventMap[n]]=t.registerEventListener(n,e))})),this._isMounted&&this.setState({eventListeners:r})},i.unregisterEventListeners=function(){var e=this;this.state.eventListeners&&Object.keys(this.state.eventListeners).forEach((function(t){var r=e.state.eventListeners[t],n=function(){return r};n.toString=function(){return r},_ps.off(t,n)}))},i.createClickWrap=function(){var e=this,t=this.props,r=t.acceptanceLanguage,n=t.clickWrapStyle,o=t.customData,i=t.confirmationEmail,a=t.containerId,c=t.displayAll,s=t.displayImmediately,u=t.filter,p=t.forceScroll,l=t.groupKey,f=t.injectSnippetOnly,d=t.renderData,_=t.signerIdSelector,y=t.snapshotLocation,v=t.allowDisagreed,g=h({},void 0!==v&&{allow_disagreed:v},void 0!==r&&{acceptance_language:r},{auto_run:s},void 0!==i&&{confirmation_email:i},{container_selector:a,display_all:c},void 0!==u&&{filter:u},void 0!==p&&{force_scroll:p},void 0!==d&&{render_data:d},void 0!==_&&{signer_id_selector:_},void 0!==n&&{style:n});if(!f){l&&this._isMounted&&this.setState({clickwrapGroupKey:l,dynamicGroup:!1});var b=!l,m=function(t,r){if(r){var n=l||r.get("key"),o={clickwrapGroupKey:n};b&&(o.dynamicGroup=!0),e._isMounted&&e.setState(o),b||r.render(),e.registerEventListeners(n)}};o&&_ps("set","custom_data",o),y&&_ps("set","snapshot_location",y),l?_ps("load",l,h({},g,{event_callback:m})):_ps("load",h({},g,{event_callback:m}))}},i.render=function(){var e=this.props.containerId;return o.a.createElement("div",{id:e})},n}(o.a.Component);b.FILTER_OR_GROUPKEY_REQUIRED_ERROR_MESSAGE="PSClickWrap Error: You must provide either a groupKey or filter prop in order to use the PactSafe ClickWrap component!",b.MUST_PROVIDE_RENDER_DATA_ERROR_MESSAGE="PSClickWrap Error: You must provide a renderData prop when passing down the dynamic prop",b.MUST_PROVIDE_SIGNER_ID_OR_SIGNER_ID_SELECTOR="PSClickWrap Error: You must provide either a signer ID or a signer ID selector",b.MUST_SET_ALLOW_DISAGREED="PSClickWrap Error: You must set allowDisagreed as true to make onInvalid work",b.defaultProps={psScriptUrl:"//vault.pactsafe.io/ps.min.js",backupScriptURL:"//d3l1mqnl5xpsuc.cloudfront.net/ps.min.js",containerId:"ps-clickwrap",displayImmediately:!0,disableSending:!1,displayAll:!0,dynamic:!1,testMode:!1};var m=b;function j(e,t){return(j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var S=function(e){var t,r;function n(t){var r,n=(r=e.call(this,t)||this).props,o=n.psScriptUrl,i=n.groupKey,a=n.accessId;return y.a.isSnippetLoaded(o)||y.a.injectSnippet(o),r.targetSelector="psbw-"+i,_ps("create",a),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,j(t,r);var i=n.prototype;return i.componentDidMount=function(){var e=this.props,t=e.groupKey,r=e.position,n=e.badgeText,o=e.alwaysVisible,i=e.openLegalCenter;_ps("load",t,{target_selector:this.targetSelector,position:r,badge_text:n,always_visible:o,open_legal_center:i})},i.componentWillUnmount=function(){var e=this.props.groupKey;_ps.getByKey(e).rendered=!1},i.render=function(){var e=this.props,t=e.link,r=e.linkText;return o.a.createElement("a",{href:t,id:this.targetSelector},r)},n}(o.a.Component);S.MUST_PROVIDE_LINK_IF_OPEN_LEGAL_CENTER_FALSE="PSBrowseWrap Error: You must provide a link prop if openLegalCenter is passed false",S.defaultProps={psScriptUrl:"//vault.pactsafe.io/ps.min.js",position:"auto",link:"#",openLegalCenter:!0};var w=S}]).default})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.PSReactSDK=t(require("react")):e.PSReactSDK=t(e.React)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(t,r){t.exports=e},function(e,t){e.exports={injectSnippet:function(e,t){var r,n,o,i,a,c,s,u,p,l;r=window,n=document,o="script",i=e,a=t,c="_ps",s=function(){console.log("Unable to load the PactSafe PS.JS Library.")},r.PactSafeObject=c,r._ps=r._ps||function(){(r._ps.q=r._ps.q||[]).push(arguments)},r._ps.on=function(){(r._ps.e=r._ps.e||[]).push(arguments)},r._ps.once=function(){(r._ps.eo=r._ps.eo||[]).push(arguments)},r._ps.off=function(){(r._ps.o=r._ps.o||[]).push(arguments)},r._ps.t=1*new Date,r._ps.l=0,u=n.createElement(o),p=n.getElementsByTagName(o)[0],u.async=1,u.src=i,u.onload=u.onreadystatechange=function(){r._ps.l=1},u.onerror=u.onabort=function(){r._ps.l=0},p?p.parentNode.insertBefore(u,p):document.body.appendChild(u),setTimeout((function(){r._ps.l||r._ps.loaded||(r._ps.error=1,(u=n.createElement(o)).async=1,u.src=a,u.onload=u.onreadystatechange=function(){r._ps.l=1},u.onerror=u.onabort=function(){r._ps.l=0},p.parentNode.insertBefore(u,p),(l=function(e,t){try{(t=n.createElement("img")).src="https://d3r8bdci515tjv.cloudfront.net/error.gif?t="+r._ps.t+"&u="+encodeURIComponent(e),n.getElementsByTagName("body")[0].appendChild(t)}catch(e){}})(i),setTimeout((function(){r._ps.l||r._ps.loaded||(r._ps.error=1,s&&s.call(this),l(a))}),4e3))}),4e3)},isSnippetLoaded:function(e){var t=document.getElementsByTagName("script");if(window._ps&&window._ps.loaded&&317===window._ps.realThang)return!0;for(var r=0;r<t.length;r+=1)if(t[r].src&&-1!==t[r].src.indexOf(e))return!0;return!1}}},function(e,t,r){(function(e,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[n]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[o]=u["[object Number]"]=u[i]=u["[object RegExp]"]=u[a]=u["[object String]"]=u["[object WeakMap]"]=!1;var p="object"==typeof e&&e&&e.Object===Object&&e,l="object"==typeof self&&self&&self.Object===Object&&self,f=p||l||Function("return this")(),d=t&&!t.nodeType&&t,_=d&&"object"==typeof r&&r&&!r.nodeType&&r,y=_&&_.exports===d,h=y&&p.process,v=function(){try{return h&&h.binding&&h.binding("util")}catch(e){}}(),g=v&&v.isTypedArray;function b(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function m(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function j(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var S,w,E,O=Array.prototype,k=Function.prototype,P=Object.prototype,D=f["__core-js_shared__"],L=k.toString,A=P.hasOwnProperty,I=(S=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",R=P.toString,U=RegExp("^"+L.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=y?f.Buffer:void 0,T=f.Symbol,K=f.Uint8Array,B=P.propertyIsEnumerable,C=O.splice,x=T?T.toStringTag:void 0,W=Object.getOwnPropertySymbols,z=M?M.isBuffer:void 0,N=(w=Object.keys,E=Object,function(e){return w(E(e))}),G=ve(f,"DataView"),V=ve(f,"Map"),F=ve(f,"Promise"),$=ve(f,"Set"),q=ve(f,"WeakMap"),Y=ve(Object,"create"),H=je(G),J=je(V),Q=je(F),X=je($),Z=je(q),ee=T?T.prototype:void 0,te=ee?ee.valueOf:void 0;function re(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new oe;++t<r;)this.add(e[t])}function ae(e){var t=this.__data__=new ne(e);this.size=t.size}function ce(e,t){var r=Ee(e),n=!r&&we(e),o=!r&&!n&&Oe(e),i=!r&&!n&&!o&&Ae(e),a=r||n||o||i,c=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],s=c.length;for(var u in e)!t&&!A.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||me(u,s))||c.push(u);return c}function se(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":x&&x in Object(e)?function(e){var t=A.call(e,x),r=e[x];try{e[x]=void 0;var n=!0}catch(e){}var o=R.call(e);n&&(t?e[x]=r:delete e[x]);return o}(e):function(e){return R.call(e)}(e)}function pe(e){return Le(e)&&ue(e)==n}function le(e,t,r,c,s){return e===t||(null==e||null==t||!Le(e)&&!Le(t)?e!=e&&t!=t:function(e,t,r,c,s,u){var p=Ee(e),l=Ee(t),f=p?"[object Array]":be(e),d=l?"[object Array]":be(t),_=(f=f==n?i:f)==i,y=(d=d==n?i:d)==i,h=f==d;if(h&&Oe(e)){if(!Oe(t))return!1;p=!0,_=!1}if(h&&!_)return u||(u=new ae),p||Ae(e)?_e(e,t,r,c,s,u):function(e,t,r,n,i,c,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!c(new K(e),new K(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Se(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case o:var u=m;case a:var p=1&n;if(u||(u=j),e.size!=t.size&&!p)return!1;var l=s.get(e);if(l)return l==t;n|=2,s.set(e,t);var f=_e(u(e),u(t),n,i,c,s);return s.delete(e),f;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,f,r,c,s,u);if(!(1&r)){var v=_&&A.call(e,"__wrapped__"),g=y&&A.call(t,"__wrapped__");if(v||g){var b=v?e.value():e,S=g?t.value():t;return u||(u=new ae),s(b,S,r,c,u)}}if(!h)return!1;return u||(u=new ae),function(e,t,r,n,o,i){var a=1&r,c=ye(e),s=c.length,u=ye(t).length;if(s!=u&&!a)return!1;var p=s;for(;p--;){var l=c[p];if(!(a?l in t:A.call(t,l)))return!1}var f=i.get(e);if(f&&i.get(t))return f==t;var d=!0;i.set(e,t),i.set(t,e);var _=a;for(;++p<s;){l=c[p];var y=e[l],h=t[l];if(n)var v=a?n(h,y,l,t,e,i):n(y,h,l,e,t,i);if(!(void 0===v?y===h||o(y,h,r,n,i):v)){d=!1;break}_||(_="constructor"==l)}if(d&&!_){var g=e.constructor,b=t.constructor;g==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,r,c,s,u)}(e,t,r,c,le,s))}function fe(e){return!(!De(e)||function(e){return!!I&&I in e}(e))&&(ke(e)?U:c).test(je(e))}function de(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||P,t!==n)return N(e);var t,r,n,o=[];for(var i in Object(e))A.call(e,i)&&"constructor"!=i&&o.push(i);return o}function _e(e,t,r,n,o,i){var a=1&r,c=e.length,s=t.length;if(c!=s&&!(a&&s>c))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var p=-1,l=!0,f=2&r?new ie:void 0;for(i.set(e,t),i.set(t,e);++p<c;){var d=e[p],_=t[p];if(n)var y=a?n(_,d,p,t,e,i):n(d,_,p,e,t,i);if(void 0!==y){if(y)continue;l=!1;break}if(f){if(!b(t,(function(e,t){if(a=t,!f.has(a)&&(d===e||o(d,e,r,n,i)))return f.push(t);var a}))){l=!1;break}}else if(d!==_&&!o(d,_,r,n,i)){l=!1;break}}return i.delete(e),i.delete(t),l}function ye(e){return function(e,t,r){var n=t(e);return Ee(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Ie,ge)}function he(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function ve(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return fe(r)?r:void 0}re.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(Y){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return A.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:A.call(t,e)},re.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this},ne.prototype.clear=function(){this.__data__=[],this.size=0},ne.prototype.delete=function(e){var t=this.__data__,r=se(t,e);return!(r<0)&&(r==t.length-1?t.pop():C.call(t,r,1),--this.size,!0)},ne.prototype.get=function(e){var t=this.__data__,r=se(t,e);return r<0?void 0:t[r][1]},ne.prototype.has=function(e){return se(this.__data__,e)>-1},ne.prototype.set=function(e,t){var r=this.__data__,n=se(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},oe.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(V||ne),string:new re}},oe.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return he(this,e).get(e)},oe.prototype.has=function(e){return he(this,e).has(e)},oe.prototype.set=function(e,t){var r=he(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.add=ie.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ie.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.clear=function(){this.__data__=new ne,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ne){var n=r.__data__;if(!V||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new oe(n)}return r.set(e,t),this.size=r.size,this};var ge=W?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}(W(e),(function(t){return B.call(e,t)})))}:function(){return[]},be=ue;function me(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||s.test(e))&&e>-1&&e%1==0&&e<t}function je(e){if(null!=e){try{return L.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Se(e,t){return e===t||e!=e&&t!=t}(G&&"[object DataView]"!=be(new G(new ArrayBuffer(1)))||V&&be(new V)!=o||F&&"[object Promise]"!=be(F.resolve())||$&&be(new $)!=a||q&&"[object WeakMap]"!=be(new q))&&(be=function(e){var t=ue(e),r=t==i?e.constructor:void 0,n=r?je(r):"";if(n)switch(n){case H:return"[object DataView]";case J:return o;case Q:return"[object Promise]";case X:return a;case Z:return"[object WeakMap]"}return t});var we=pe(function(){return arguments}())?pe:function(e){return Le(e)&&A.call(e,"callee")&&!B.call(e,"callee")},Ee=Array.isArray;var Oe=z||function(){return!1};function ke(e){if(!De(e))return!1;var t=ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function De(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Le(e){return null!=e&&"object"==typeof e}var Ae=g?function(e){return function(t){return e(t)}}(g):function(e){return Le(e)&&Pe(e.length)&&!!u[ue(e)]};function Ie(e){return null!=(t=e)&&Pe(t.length)&&!ke(t)?ce(e):de(e);var t}r.exports=function(e,t){return le(e,t)}}).call(this,r(5),r(6)(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r,n){return"boolean"==typeof e?e:"function"==typeof e?e(t,r,n):!(!0!=!!e||!e)},o=function(e,t){return Object.hasOwnProperty.call(e,t)},i=function(e,t,r,n){return n?new Error(n):new Error("Required "+e[t]+" `"+t+"` was not specified in `"+r+"`.")};t.default=function(e,t,r){return function(e,t){if("function"!=typeof e)throw new TypeError("The typeValidator argument must be a function with the signature function(props, propName, componentName).");if(t&&"string"!=typeof t)throw new TypeError("The error message is optional, but must be a string if provided.")}(e,r),function(a,c,s){for(var u=arguments.length,p=Array(3<u?u-3:0),l=3;l<u;l++)p[l-3]=arguments[l];return n(t,a,c,s)?o(a,c)?e.apply(void 0,[a,c,s].concat(p)):i(a,c,s,r):e.apply(void 0,[a,c,s].concat(p))}}},function(e,t,r){e.exports=r(7)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";r.r(t),r.d(t,"PSClickWrap",(function(){return j})),r.d(t,"PSBrowseWrap",(function(){return E}));var n=r(0),o=r.n(n);r(3);var i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let a;const c=new Uint8Array(16);function s(){if(!a&&(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!a))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(c)}const u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function p(e,t=0){return u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]}var l=function(e,t,r){if(i.randomUUID&&!t&&!e)return i.randomUUID();const n=(e=e||{}).random||(e.rng||s)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return p(n)},f=r(2),d=r.n(f),_=r(1),y=r.n(_);function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var m=function(e){var t,r;function n(t){var r;b(v(r=e.call(this,t)||this),"_isMounted",!1),r.createClickWrap=r.createClickWrap.bind(v(r)),r.state={clickwrapGroupKey:null,dynamicGroup:!1},r.propsEventMap={onAll:"all",onSent:"sent",onRetrieved:"retrieved",onSet:"set",onSetSignerId:"set:signer_id",onValid:"valid",onInvalid:"invalid",onChecked:"checked",onUnchecked:"unchecked",onRendered:"rendered",onDisplayed:"displayed",onScrolledContract:"scrolled:contract",onScrolled:"scrolled",onError:"error"};var n=r.props,o=n.accessId,i=n.backupScriptURL,a=n.debug,c=n.disableSending,s=n.dynamic,u=n.injectSnippetOnly,p=n.psScriptUrl,l=n.signerId,f=n.testMode;return y.a.isSnippetLoaded(p,i)||y.a.injectSnippet(p,i),a&&(_ps.debug=!0),u?v(r):(_ps("create",o,{test_mode:f,disable_sending:c,dynamic:s,signer_id:l}),_ps("set","client_library","react-sdk"),_ps("set","client_version","2.13.3"),r)}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,g(t,r);var i=n.prototype;return i.componentDidMount=function(){var e=this.props.injectSnippetOnly;this._isMounted=!0,e||this.createClickWrap()},i.componentDidUpdate=function(e){var t=this.props,r=t.acceptanceLanguage,n=t.clickWrapStyle,o=t.customData,i=t.filter,a=t.groupKey,c=t.injectSnippetOnly,s=t.renderData,u=t.signerId,p=t.snapshotLocation,l=this.state,f=l.clickwrapGroupKey,_=l.dynamicGroup,y=_ps&&_ps.getByKey&&"function"==typeof _ps.getByKey&&f&&_ps.getByKey(f);c||(n!==e.clickWrapStyle&&!_&&y&&(_ps.getByKey(f).site.set("style",n),_ps.getByKey(f).retrieveHTML()),d()(o,e.customData)||_ps("set","custom_data",o),r!==e.acceptanceLanguage&&_ps("set","acceptance_language",r),d()(s,e.renderData)||(n&&y&&_ps.getByKey(f).site.set("style",n),_ps(f+":retrieveHTML",s)),u!==e.signerId&&(n&&y&&_ps.getByKey(f).site.set("style",n),_ps("set","signer_id",u)),p!==e.snapshotLocation&&_ps("set","snapshot_location",p),n!==e.clickWrapStyle&&_&&this.createClickWrap(),i!==e.filter&&this.createClickWrap(),a===e.groupKey||_||(this.createClickWrap(),y&&_ps.getByKey(f).retrieveHTML()))},i.componentWillUnmount=function(){this._isMounted=!1;var e=this.props,t=e.injectSnippetOnly,r=e.groupKey;t||(_ps&&_ps.getByKey&&"function"==typeof _ps.getByKey&&_ps.getByKey(r)&&(_ps.getByKey(r).rendered&&(_ps.getByKey(r).rendered=!1),_ps.getByKey(r).resetData()),this.unregisterEventListeners())},i.registerEventListener=function(e,t){var r=this,n=function(){for(var n,o=!1,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];(a.forEach((function(e){(e&&e.get&&e.get("key")&&e.get("key")===t||e&&"[object Site]"===e.toString())&&(o=!0)})),o)&&(n=r.props)[e].apply(n,a)},o=l();return n.toString=function(){return o},_ps.on(this.propsEventMap[e],n),n.toString()},i.registerEventListeners=function(e){var t=this,r={};Object.keys(this.propsEventMap).forEach((function(n){t.props[n]&&(r[t.propsEventMap[n]]=t.registerEventListener(n,e))})),this._isMounted&&this.setState({eventListeners:r})},i.unregisterEventListeners=function(){var e=this;this.state.eventListeners&&Object.keys(this.state.eventListeners).forEach((function(t){var r=e.state.eventListeners[t],n=function(){return r};n.toString=function(){return r},_ps.off(t,n)}))},i.createClickWrap=function(){var e=this,t=this.props,r=t.acceptanceLanguage,n=t.clickWrapStyle,o=t.customData,i=t.confirmationEmail,a=t.containerId,c=t.displayAll,s=t.displayImmediately,u=t.filter,p=t.forceScroll,l=t.groupKey,f=t.injectSnippetOnly,d=t.renderData,_=t.signerIdSelector,y=t.snapshotLocation,v=t.allowDisagreed,g=h({},void 0!==v&&{allow_disagreed:v},void 0!==r&&{acceptance_language:r},{auto_run:s},void 0!==i&&{confirmation_email:i},{container_selector:a,display_all:c},void 0!==u&&{filter:u},void 0!==p&&{force_scroll:p},void 0!==d&&{render_data:d},void 0!==_&&{signer_id_selector:_},void 0!==n&&{style:n});if(!f){l&&this._isMounted&&this.setState({clickwrapGroupKey:l,dynamicGroup:!1});var b=!l,m=function(t,r){if(r){var n=l||r.get("key"),o={clickwrapGroupKey:n};b&&(o.dynamicGroup=!0),e._isMounted&&e.setState(o),b||r.render(),e.registerEventListeners(n)}};o&&_ps("set","custom_data",o),y&&_ps("set","snapshot_location",y),l?_ps("load",l,h({},g,{event_callback:m})):_ps("load",h({},g,{event_callback:m}))}},i.render=function(){var e=this.props.containerId;return o.a.createElement("div",{id:e})},n}(o.a.Component);m.FILTER_OR_GROUPKEY_REQUIRED_ERROR_MESSAGE="PSClickWrap Error: You must provide either a groupKey or filter prop in order to use the PactSafe ClickWrap component!",m.MUST_PROVIDE_RENDER_DATA_ERROR_MESSAGE="PSClickWrap Error: You must provide a renderData prop when passing down the dynamic prop",m.MUST_PROVIDE_SIGNER_ID_OR_SIGNER_ID_SELECTOR="PSClickWrap Error: You must provide either a signer ID or a signer ID selector",m.MUST_SET_ALLOW_DISAGREED="PSClickWrap Error: You must set allowDisagreed as true to make onInvalid work",m.defaultProps={psScriptUrl:"//vault.pactsafe.io/ps.min.js",backupScriptURL:"//d3l1mqnl5xpsuc.cloudfront.net/ps.min.js",containerId:"ps-clickwrap",displayImmediately:!0,disableSending:!1,displayAll:!0,dynamic:!1,testMode:!1};var j=m;function S(e,t){return(S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var w=function(e){var t,r;function n(t){var r,n=(r=e.call(this,t)||this).props,o=n.psScriptUrl,i=n.groupKey,a=n.accessId;return y.a.isSnippetLoaded(o)||y.a.injectSnippet(o),r.targetSelector="psbw-"+i,_ps("create",a),r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,S(t,r);var i=n.prototype;return i.componentDidMount=function(){var e=this.props,t=e.groupKey,r=e.position,n=e.badgeText,o=e.alwaysVisible,i=e.openLegalCenter;_ps("load",t,{target_selector:this.targetSelector,position:r,badge_text:n,always_visible:o,open_legal_center:i})},i.componentWillUnmount=function(){var e=this.props.groupKey;_ps.getByKey(e).rendered=!1},i.render=function(){var e=this.props,t=e.link,r=e.linkText;return o.a.createElement("a",{href:t,id:this.targetSelector},r)},n}(o.a.Component);w.MUST_PROVIDE_LINK_IF_OPEN_LEGAL_CENTER_FALSE="PSBrowseWrap Error: You must provide a link prop if openLegalCenter is passed false",w.defaultProps={psScriptUrl:"//vault.pactsafe.io/ps.min.js",position:"auto",link:"#",openLegalCenter:!0};var E=w}]).default})); | ||
//# sourceMappingURL=pactsafe-react-sdk.min.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
317179
25
3736
5